make bridge registration onlyOwner, add config for bridge info

This commit is contained in:
Moon Man 2023-08-13 18:01:31 -04:00
parent 39d816ee50
commit e0f8553b57
1 changed files with 7 additions and 5 deletions

View File

@ -25,12 +25,14 @@ interface IGatewayRouter2 {
}
contract TenGransEthToken is AbstractGrans, ICustomToken {
address public gateway;
address public router;
address public immutable gateway;
address public immutable router;
bool private shouldRegisterGateway;
constructor() AbstractGrans() {
_mint(msg.sender, 15000 * 10 ** decimals());
constructor(address _gateway, address _router) AbstractGrans() {
gateway = _gateway;
router = _router;
_mint(msg.sender, 15_000 * 10 ** 18);
}
function balanceOf(address account) public view virtual override(AbstractGrans, ICustomToken) returns (uint256) {
@ -57,7 +59,7 @@ contract TenGransEthToken is AbstractGrans, ICustomToken {
uint256 valueForGateway,
uint256 valueForRouter,
address creditBackAddress
) public payable override {
) public payable override onlyOwner {
// we temporarily set `shouldRegisterGateway` to true for the callback in registerTokenToL2 to succeed
bool prev = shouldRegisterGateway;
shouldRegisterGateway = true;