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.
The Output name must be in PascalCase.
Calling a view method with inputs:
call_fn(hyperdapp, ownerOf(55), [OwnerAddress])
Calling a payable method:
call_fn(hyperdapp, mint, [value(eth(0.1))], [])
value() predicate receive only WEI value
You can use the eth() predicate if you want to convert ETH -> WEI
You must provide the Output array even if there is no output
Calling a non-payable method:
call_fn(hyperdapp, withdraw(1), [])
Last updated