10grans-ng/contracts/TenGransArbToken.sol

31 lines
973 B
Solidity
Raw Permalink Normal View History

2023-08-13 15:15:29 +00:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "./TenGransAbstractToken.sol";
import "@arbitrum/token-bridge-contracts/contracts/tokenbridge/arbitrum/IArbToken.sol";
contract TenGransArbToken is AbstractGrans, IArbToken {
2023-08-13 22:57:02 +00:00
uint256 public immutable cap = 15_000 * 10 ** 18;
address public immutable l2Gateway;
address public immutable override l1Address;
2023-08-13 15:15:29 +00:00
modifier onlyGateway() {
require(msg.sender == l2Gateway, "ONLY_l2GATEWAY");
_;
}
constructor(address _l2Gateway, address _l1Address) AbstractGrans() {
l2Gateway = _l2Gateway;
l1Address = _l1Address;
}
function bridgeMint(address account, uint256 amount) external virtual override onlyGateway {
2023-08-13 22:57:02 +00:00
require(amount + totalSupply() <= cap, "CAP_EXCEEDED");
2023-08-13 15:15:29 +00:00
_mint(account, amount);
}
function bridgeBurn(address account, uint256 amount) external virtual override onlyGateway {
_burn(account, amount);
}
}