Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
30
contracts/presets/ERC20PresetFixedSupply.sol
Normal file
30
contracts/presets/ERC20PresetFixedSupply.sol
Normal file
@ -0,0 +1,30 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.6.2;
|
||||
|
||||
import "../token/ERC20/ERC20Burnable.sol";
|
||||
|
||||
/**
|
||||
* @dev {ERC20} token, including:
|
||||
*
|
||||
* - Preminted initial supply
|
||||
* - Ability for holders to burn (destroy) their tokens
|
||||
* - No access control mechanism (for minting/pausing) and hence no governance
|
||||
*
|
||||
* This contract uses {ERC20Burnable} to include burn capabilities - head to
|
||||
* its documentation for details.
|
||||
*/
|
||||
contract ERC20PresetFixedSupply is ERC20Burnable {
|
||||
/**
|
||||
* @dev Mints `initialSupply` amount of token and transfers them to `owner`.
|
||||
*
|
||||
* See {ERC20-constructor}.
|
||||
*/
|
||||
constructor(
|
||||
string memory name,
|
||||
string memory symbol,
|
||||
uint256 initialSupply,
|
||||
address owner
|
||||
) public ERC20(name, symbol) {
|
||||
_mint(owner, initialSupply);
|
||||
}
|
||||
}
|
||||
27
contracts/presets/ERC777PresetFixedSupply.sol
Normal file
27
contracts/presets/ERC777PresetFixedSupply.sol
Normal file
@ -0,0 +1,27 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.6.2;
|
||||
|
||||
import "../token/ERC777/ERC777.sol";
|
||||
|
||||
/**
|
||||
* @dev {ERC777} token, including:
|
||||
*
|
||||
* - Preminted initial supply
|
||||
* - No access control mechanism (for minting/pausing) and hence no governance
|
||||
*/
|
||||
contract ERC777PresetFixedSupply is ERC777 {
|
||||
/**
|
||||
* @dev Mints `initialSupply` amount of token and transfers them to `owner`.
|
||||
*
|
||||
* See {ERC777-constructor}.
|
||||
*/
|
||||
constructor(
|
||||
string memory name,
|
||||
string memory symbol,
|
||||
address[] memory defaultOperators,
|
||||
uint256 initialSupply,
|
||||
address owner
|
||||
) public ERC777(name, symbol, defaultOperators) {
|
||||
_mint(owner, initialSupply, "", "");
|
||||
}
|
||||
}
|
||||
@ -16,3 +16,7 @@ TIP: Intermediate and advanced users can use these as starting points when writi
|
||||
{{ERC721PresetMinterPauserAutoId}}
|
||||
|
||||
{{ERC1155PresetMinterPauser}}
|
||||
|
||||
{{ERC20PresetFixedSupply}}
|
||||
|
||||
{{ERC777PresetFixedSupply}}
|
||||
|
||||
Reference in New Issue
Block a user