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
contractSmart 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
addressEthereum address or label.contractSmart contract label, must be associated with the address.methodSmart 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