|
3 | 3 | pragma solidity 0.8.11; |
4 | 4 |
|
5 | 5 | import "../interfaces/IERCHandler.sol"; |
| 6 | +import "../interfaces/IBridge.sol"; |
| 7 | + |
6 | 8 |
|
7 | 9 | /** |
8 | 10 | @title Function used across handler contracts. |
9 | 11 | @author ChainSafe Systems. |
10 | 12 | @notice This contract is intended to be used with the Bridge contract. |
11 | 13 | */ |
12 | | -abstract contract ERCHandlerHelpers is IERCHandler { |
13 | | - address public immutable _bridgeAddress; |
14 | | - address public immutable _routerAddress; |
15 | | - address public immutable _executorAddress; |
| 14 | +contract ERCHandlerHelpers { |
| 15 | + IBridge public _bridge; |
16 | 16 |
|
17 | 17 | uint8 public constant DEFAULT_DECIMALS = 18; |
18 | 18 |
|
@@ -40,52 +40,11 @@ abstract contract ERCHandlerHelpers is IERCHandler { |
40 | 40 | // token contract address => ERCTokenContractProperties |
41 | 41 | mapping(address => ERCTokenContractProperties) public _tokenContractAddressToTokenProperties; |
42 | 42 |
|
43 | | - modifier onlyBridge() { |
44 | | - _onlyBridge(); |
45 | | - _; |
46 | | - } |
47 | | - |
48 | | - modifier onlyRouter() { |
49 | | - _onlyRouter(); |
50 | | - _; |
51 | | - } |
52 | | - |
53 | | - modifier onlyExecutor() { |
54 | | - _onlyExecutor(); |
55 | | - _; |
56 | | - } |
57 | | - |
58 | | - function _onlyBridge() private view { |
59 | | - if (msg.sender != _bridgeAddress) revert SenderNotBridgeContract(); |
60 | | - } |
61 | | - |
62 | | - function _onlyExecutor() private view { |
63 | | - if (msg.sender != _executorAddress) revert SenderNotExecutorContract(); |
64 | | - } |
65 | | - |
66 | | - function _onlyRouter() private view { |
67 | | - if (msg.sender != _routerAddress) revert SenderNotRouterContract(); |
68 | | - } |
69 | | - |
70 | | - |
71 | 43 | /** |
72 | | - @param bridgeAddress Contract address of previously deployed Bridge. |
73 | | - @param routerAddress Contract address of previously deployed Router. |
74 | | - @param executorAddress Contract address of previously deployed Executor. |
75 | | - */ |
76 | | - constructor(address bridgeAddress, address routerAddress, address executorAddress) { |
77 | | - _bridgeAddress = bridgeAddress; |
78 | | - _routerAddress = routerAddress; |
79 | | - _executorAddress = executorAddress; |
80 | | - } |
81 | | - |
82 | | - /** |
83 | | - @notice First verifies {contractAddress} is whitelisted, then sets |
84 | | - {_tokenContractAddressToTokenProperties[contractAddress].isBurnable} to true. |
85 | | - @param contractAddress Address of contract to be used when making or executing deposits. |
| 44 | + @param bridge Contract address of previously deployed Bridge. |
86 | 45 | */ |
87 | | - function setBurnable(address contractAddress) external override onlyBridge { |
88 | | - _setBurnable(contractAddress); |
| 46 | + constructor(IBridge bridge) { |
| 47 | + _bridge = bridge; |
89 | 48 | } |
90 | 49 |
|
91 | 50 | function _setResource(bytes32 resourceID, address contractAddress) internal { |
|
0 commit comments