Call ABI Method

  • You can call a method from a specific smart contract by using call_fn() predicate:

call_fn(contract_name, function_name(...inputs), [value(payable_eth)], [Output])

The third parameter is required only for payable methods.

  • Calling a view method without inputs:

call_fn(hyperdapp, name, [Name])

The function result will be stored in the Name variable.

  • Calling a view method with inputs:

call_fn(hyperdapp, ownerOf(55), [OwnerAddress])
  • Calling a payable method:

call_fn(hyperdapp, mint, [value(eth(0.1))], [])
  • Calling a non-payable method:

call_fn(hyperdapp, withdraw(1), [])

Last updated