Skip to main content

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:

functiondescriptionread/writeinputsoutputs
allowanceread"2 inputs: tokenOwner address spender address""1 output: remaining uint256"
approvewrite"2 inputs: spender address tokens uint256""1 output: success bool"
balanceOfread"1 input: tokenOwner address""1 output: balance uint256"
decimalsreadno inputs"1 output: uint8"
namereadno inputs"1 output: string"
symbolreadno inputs"1 output: string"
totalSupplyreadno inputs"1 output: uint256"
transferwrite"2 inputs: to addresstokens uint256"
transferFromwrite"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:

0x005080f78567f8001115f1eee835dd0151bea476