Skip to content

Commit

Permalink
first start for arb bridge contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
jellegerbrandy committed Jul 11, 2024
1 parent b05b7db commit 3a3363d
Show file tree
Hide file tree
Showing 5 changed files with 4,432 additions and 598 deletions.
2 changes: 2 additions & 0 deletions contracts/HATToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ contract HATToken is IHATToken, ERC20Votes, ERC20Capped, Ownable {
super._mint(account, amount);
}



}
38 changes: 38 additions & 0 deletions contracts/HatTokenArbitrumBridgeL1.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

import "./HATToken.sol";
import "@arbitrum/token-bridge-contracts/contracts/tokenbridge/ethereum/ICustomToken.sol";

contract HATTokenArbitrumBridgeL1 is ICustomToken, HATToken {
/** functions for registring the token with the arbitrum bridge */
function isArbitrumEnabled() external view override returns (uint8) {
return uint8(0xb1);
}

function registerTokenOnL2(
address l2CustomTokenAddress,
uint256 maxSubmissionCostForCustomGateway,
uint256 maxSubmissionCostForRouter,
uint256 maxGasForCustomGateway,
uint256 maxGasForRouter,
uint256 gasPriceBid,
uint256 valueForGateway,
uint256 valueForRouter,
address creditBackAddress
) public payable virtual override {
IL1CustomGateway(gateway).registerTokenToL2{ value: valueForGateway }(
l2CustomTokenAddress,
maxGasForCustomGateway,
gasPriceBid,
maxSubmissionCostForCustomGateway,
creditBackAddress
);

IGatewayRouter2(router).setGateway{ value: valueForRouter }(
gateway,
maxGasForRouter,
gasPriceBid,
maxSubmissionCostForRouter,
creditBackAddress
);
}
}
7 changes: 7 additions & 0 deletions contracts/HatTokenArbitrumBridgeL2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

import "./HATToken.sol";
import "@arbitrum/token-bridge-contracts/contracts/tokenbridge/arbitrum/IArbToken.sol";

contract HATTokenArbitrumBridgeL2 is IArbToken, HATToken {
/** functions for registring the token with the arbitrum bridge */
}
Loading

0 comments on commit 3a3363d

Please sign in to comment.