Top Level Namespace

Defined Under Namespace

Modules: ABI, ABIParser Classes: String

Constant Summary collapse

IERC165 =

IERC165 0x01ffc9a7

ABI::Interface.new(
  'supportsInterface(bytes4)',
)
IERC20 =

IERC20 0x36372b07

ABI::Interface.new(
   'totalSupply()',
   'balanceOf(address)',
   'allowance(address,address)',
   'transfer(address,uint256)',
   'approve(address,uint256)',
   'transferFrom(address,address,uint256)'
)
IERC20_NAME =

IERC20_NAME 0x06fdde03

ABI::Interface.new(
  'name()'
)
IERC20_SYMBOL =

IERC20_SYMBOL 0x95d89b41

ABI::Interface.new(
  'symbol()'
)
IERC20_DECIMALS =

IERC20_DECIMALS 0x313ce567

ABI::Interface.new(
  'decimals()'
)
IERC721 =

IERC721 0x80ac58cd

ABI::Interface.new(
  'balanceOf(address)',
  'ownerOf(uint256)',
  'approve(address,uint256)',
  'getApproved(uint256)',
  'setApprovalForAll(address,bool)',
  'isApprovedForAll(address,address)',
  'transferFrom(address,address,uint256)',
  'safeTransferFrom(address,address,uint256)',
  'safeTransferFrom(address,address,uint256,bytes)'
)
IERC721_METADATA =

IERC721_METADATA 0x5b5e139f

ABI::Interface.new(
  'name()',
  'symbol()',
  'tokenURI(uint256)'
)
IERC721_ENUMERABLE =

IERC721_ENUMERABLE 0x780e9d63

ABI::Interface.new(
  'tokenOfOwnerByIndex(address,uint256)',
  'totalSupply()',
  'tokenByIndex(uint256)'
)
AbiParser =

add convenience alternate spellings - why? why not?

ABIParser

Instance Method Summary collapse

Instance Method Details

#keccak256(bin) ⇒ Object



30
31
32
# File 'lib/abiparser.rb', line 30

def keccak256( bin )
  Digest::KeccakLite.new( 256 ).digest( bin )
end

#sig(bin) ⇒ Object



34
35
36
# File 'lib/abiparser.rb', line 34

def sig( bin )
  keccak256( bin )[0,4]
end