Sha256: 3031b8bca946bcb622972b1ab455977a561b968e828b54f9ca22f7bd35f4b642
Contents?: true
Size: 947 Bytes
Versions: 2
Compression:
Stored size: 947 Bytes
Contents
class PublicMintERC20 < ERC20 storage maxSupply: UInt, perMintLimit: UInt sig [String, String, UInt, UInt, UInt] def constructor( name:, symbol:, maxSupply:, perMintLimit:, decimals: ) super( name: name, symbol: symbol, decimals: decimals ) @maxSupply = maxSupply @perMintLimit = perMintLimit end sig [UInt] def mint( amount: ) assert amount > 0, 'Amount must be positive' assert amount <= @perMintLimit, 'Exceeded mint limit' assert @totalSupply + amount <= @maxSupply, 'Exceeded max supply' _mint( to: msg.sender, amount: amount ) end sig [Address, UInt] def airdrop( to:, amount: ) assert amount > 0, 'Amount must be positive' assert amount <= @perMintLimit, 'Exceeded mint limit' assert @totalSupply + amount <= @maxSupply, 'Exceeded max supply' _mint( to: to, amount: amount ) end end # class PublicMintERC20
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
rubysol-contracts-0.1.0 | lib/rubysol/contracts/public_mint_erc20.rb |
uniswap-0.1.0 | lib/uniswap/PublicMintERC20.rb |