-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor BurnMintERC677 to inherit from BurnMintERC20
- Loading branch information
1 parent
2ee8c29
commit 0f22eb0
Showing
12 changed files
with
276 additions
and
427 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
contracts/src/v0.8/ccip/tokenAdminRegistry/FactoryBurnMintERC20.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {BurnMintERC20} from "../../shared/token/ERC20/BurnMintERC20.sol"; | ||
|
||
/// @notice A basic ERC20 compatible token contract with burn and minting roles. | ||
/// @dev The total supply can be limited during deployment. | ||
contract FactoryBurnMintERC20 is BurnMintERC20 { | ||
constructor( | ||
string memory name, | ||
string memory symbol, | ||
uint8 decimals_, | ||
uint256 maxSupply_, | ||
uint256 preMint_, | ||
address newOwner_ | ||
) BurnMintERC20(name, symbol, decimals_, maxSupply_) { | ||
i_decimals = decimals_; | ||
i_maxSupply = maxSupply_; | ||
|
||
s_ccipAdmin = newOwner_; | ||
|
||
// Mint the initial supply to the new Owner, saving gas by not calling if the mint amount is zero | ||
if (preMint_ != 0) _mint(newOwner_, preMint_); | ||
|
||
// Grant the deployer the minter and burner roles. This contract is expected to be deployed by a factory | ||
// contract that will transfer ownership to the correct address after deployment, so granting minting and burning | ||
// privileges here saves gas by not requiring two transactions. | ||
grantMintRole(newOwner_); | ||
grantBurnRole(newOwner_); | ||
} | ||
} |
Oops, something went wrong.