Sha256: 202ce922ce6b1957f5d3e2bc1ee41ecbbc9f48cc878297ce62e3c8fe57ec0ac5

Contents?: true

Size: 900 Bytes

Versions: 1

Compression:

Stored size: 900 Bytes

Contents

pragma :rubidity, "1.0.0"

import 'ERC20'

contract :UnsafeNoApprovalERC20, is: :ERC20 do
  constructor(
    name: :string,
    symbol: :string,
  ) {
    ERC20.constructor(name: name, symbol: symbol, decimals: 18)
  }
  
  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

1 entries across 1 versions & 1 rubygems

Version Path
0xfacet-contracts-0.0.1 lib/0xfacet/contracts/UnsafeNoApprovalERC20.rb