-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support layer zero protocol to mint tokens on L2s #53
base: fantom
Are you sure you want to change the base?
Conversation
uint8 private immutable _decimals; | ||
|
||
// Allow us to register a bridge to mint and burn tokens | ||
mapping(address => bool) public whitelistBridges; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitelistBridges
is added
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; | ||
import "./IL2StandardERC20.sol"; | ||
|
||
contract L2StandardERC20LayerZero is IL2StandardERC20, ERC20, Pausable, Ownable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The owner can pause this contract for the security consideration.
/*********************/ | ||
modifier onlyWhitelistBridge() { | ||
require( | ||
msg.sender == l2Bridge || whitelistBridges[msg.sender], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l2Bridge
and msg.sender
in whitelistBridges
can mint and burn tokens.
* @param _symbol ERC20 symbol. | ||
* @param _decimals ERC20 decimals. | ||
*/ | ||
function createStandardLayerZeroL2Token( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createStandardLayerZeroL2Token
is added for contracts that can be minted by third party.
This introduces a whitelist system in
L2StandardERC20LayerZero.sol
for theL2_BOBA.sol
. Any contracts or addresses in the whitelist are allowed to mint tokens.