スマートコントラクト関数
ブロックチェーンのスマートコントラクトから情報を取得するのに役立ちます。
MBFUNCTIONLIST(contract, filter)
スマートコントラクトの関数の詳細なリストを取得します。
パラメータ
contractスマートコントラクトラベル、アドレスに関連付けられている必要があります。filter(オプション)関数名をフィルタリングするための正規表現(regex)。
戻り値
スマートコントラクト関数とその入力および出力の配列。
例
セルに =MBFUNCTIONLIST("erc20interface") と入力します。戻り値の構造は次のとおりです:
| 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)
スマートコントラクト関数呼び出しの結果を取得します。
パラメータ
addressEthereum アドレスまたはラベル。contractスマートコントラクトラベル、アドレスに関連付けられている必要があります。methodスマートコントラクト関数名。args(オプション)関数に渡す引数。
戻り値
関数から返される 1 つ以上の値。
例
セルに =MBGET("privatefaucet", "multibaasfaucet", "getOperator") と入力します。戻り値の構造は次のとおりです:
0x005080f78567f8001115f1eee835dd0151bea476