Class: EthereumContractABI::ContractInterface::EIP::ERC721EnumerableInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb

Class Method Summary collapse

Class Method Details

.functionsObject



40
41
42
# File 'lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb', line 40

def self.functions
  [self.totalSupply, self.tokenByIndex, self.tokenOfOwnerByIndex]
end

.is_implemented_by?(contract) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb', line 13

def self.is_implemented_by?(contract)
  contract.has_function?(self.totalSupply) &&
    contract.has_function?(self.tokenByIndex) &&
    contract.has_function?(self.tokenOfOwnerByIndex)
end

.tokenByIndexObject



26
27
28
29
30
31
# File 'lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb', line 26

def self.tokenByIndex
  function_name = 'tokenByIndex'
  inputs = [Input.new('_index', AbiTypes::Uint.new)]
  outputs = [Output.new(AbiTypes::Uint.new)]
  Function.new(function_name, inputs, outputs)
end

.tokenOfOwnerByIndexObject



33
34
35
36
37
38
# File 'lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb', line 33

def self.tokenOfOwnerByIndex
  function_name = 'tokenOfOwnerByIndex'
  inputs = [Input.new('_owner', AbiTypes::Address.new), Input.new('_index', AbiTypes::Uint.new)]
  outputs = [Output.new(AbiTypes::Uint.new)]
  Function.new(function_name, inputs, outputs)
end

.totalSupplyObject



19
20
21
22
23
24
# File 'lib/ethereum-contract-abi/contract/eip/erc721_enumerable_interface.rb', line 19

def self.totalSupply
  function_name = 'totalSupply'
  inputs = []
  outputs = [Output.new(AbiTypes::Uint.new)]
  Function.new(function_name, inputs, outputs)
end