Skip to content

Commit 452d3d5

Browse files
authored
Merge pull request #27 from webb-tools/drew-factories
Add bridge factory
2 parents d7c3a60 + a885f6d commit 452d3d5

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

contracts/BridgeFactory.sol

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Copyright 2021 Webb Technologies
3+
* SPDX-License-Identifier: GPL-3.0-or-later-only
4+
*/
5+
6+
pragma solidity ^0.8.0;
7+
8+
import "./Bridge.sol";
9+
10+
contract BridgeFactory {
11+
function createBridge(
12+
uint256 chainID,
13+
address[] memory initialRelayers,
14+
uint256 initialRelayerThreshold,
15+
uint256 fee,
16+
uint256 expiry
17+
) external {
18+
new Bridge(
19+
chainID,
20+
initialRelayers,
21+
initialRelayerThreshold,
22+
fee,
23+
expiry
24+
);
25+
}
26+
27+
function create2Bridge(
28+
bytes32 _salt,
29+
uint256 chainID,
30+
address[] memory initialRelayers,
31+
uint256 initialRelayerThreshold,
32+
uint256 fee,
33+
uint256 expiry
34+
) external {
35+
new Bridge{salt: _salt}(
36+
chainID,
37+
initialRelayers,
38+
initialRelayerThreshold,
39+
fee,
40+
expiry
41+
);
42+
}
43+
}

contracts/handlers/AnchorHandler.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import "../interfaces/IExecutor.sol";
1818
contract AnchorHandler is IExecutor, HandlerHelpers {
1919
struct UpdateRecord {
2020
address _tokenAddress;
21-
uint256 _sourceChainID;
21+
uint256 _sourceChainID;
2222
bytes32 _resourceID;
2323
bytes32 _merkleRoot;
2424
uint256 _blockHeight;
@@ -95,7 +95,6 @@ contract AnchorHandler is IExecutor, HandlerHelpers {
9595
if (anchor.hasEdge(sourceChainId)) {
9696
anchor.updateEdge(
9797
sourceChainId,
98-
9998
bytes32(merkleRoot),
10099
blockHeight
101100
);

0 commit comments

Comments
 (0)