Sha256: 591f0490ab45f7019ae2d21411f2fdbc1d2a33f6d046caac510e88cdea7005f3
Contents?: true
Size: 891 Bytes
Versions: 2
Compression:
Stored size: 891 Bytes
Contents
pragma :rubidity, "1.0.0" import 'ERC20' contract :UnsafeNoApprovalERC20, is: :ERC20 do constructor( name: :string, symbol: :string, ) do super(name: name, symbol: symbol, decimals: 18) end function :mint, { amount: :uint256 }, :public do require(amount > 0, 'Amount must be positive') _mint(to: msg.sender, amount: amount) end function :airdrop, { to: :address, amount: :uint256 }, :public do require(amount > 0, 'Amount must be positive') _mint(to: to, amount: amount) end function :transferFrom, { from: :address, to: :address, amount: :uint256 }, :public, :override, returns: :bool do require(s.balanceOf[from] >= amount, 'Insufficient balance') s.balanceOf[from] -= amount s.balanceOf[to] += amount emit :Transfer, from: from, to: to, amount: amount return true end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
uniswap-0.1.0 | lib/uniswap/UnsafeNoApprovalERC20.rb |
uniswap-0.0.1 | lib/uniswap/UnsafeNoApprovalERC20.rb |