Smart contract functions

Helps to retrieve information from the blockchain smart contract.

MBFUNCTIONLIST(contract, filter)

Retrieve a detailed list of a smart contract's functions.

Parameters

  • contract Smart contract label, must be associated with the address.
  • filter (Optional) Regular expression (regex) to filter function names on.

Return

Array of smart contract functions and their inputs and outputs.

Example

=MBFUNCTIONLIST("erc20interface") in the cell. The structure of the return value is as follows:

function description read/write inputs outputs
allowance read "2 inputs: tokenOwner address spender address" "1 output: remaining uint256"
approve write "2 inputs: spender address tokens uint256" "1 output: success bool"
balanceOf read "1 input: tokenOwner address" "1 output: balance uint256"
decimals read no inputs "1 output: uint8"
name read no inputs "1 output: string"
symbol read no inputs "1 output: string"
totalSupply read no inputs "1 output: uint256"
transfer write "2 inputs: to address tokens uint256"
transferFrom write "3 inputs: from address to address tokens uint256" "1 output: success bool"

MBGET(address, contract, method, ...args)

Retrieve the results of a smart contract function call.

Parameters

  • address Ethereum address or label.
  • contract Smart contract label, must be associated with the address.
  • method Smart contract function name.
  • args (Optional) Arguments to pass to the function.

Return

One or more values returned from the function.

Example

=MBGET("privatefaucet", "multibaasfaucet", "getOperator") in the cell. The structure of the return value is as follows:

Copy
Copied
0x005080F78567F8001115F1eee835DD0151BEA476
Copyright © Curvegrid 2022. All right reserved.