BlockchainContractValue (for Ethereum)
BlockchainContractValue[caddr]
イーサリアムブロックチェーンのアドレスが caddr のWolfram式を含む契約から得られた結果を得る.
BlockchainContractValue[caddr,prop]
アドレスが caddr のWolfram式を含む契約から得られた結果の特性 prop を得る.
BlockchainContractValue[caddr,func]
アドレスが caddr の契約の関数 func を呼び出す.
BlockchainContractValue[caddr,assoc]
アドレスが caddr でAssociation assoc で定義された特性を持つ契約を呼び出す.
詳細
- イーサリアムの契約についての基本情報を与える.デフォルトで,最新ブロックの状態がターゲットとなる.
- BlockchainContractValueはイーサリアムのメインネット(デフォルト)とテストネット(Sepolia)にアクセスすることができる.これらのネットワークを指定する際はBlockchainBaseオプションを使うとよい.
- BlockchainContractValueはイーサリアムブロックチェーンから契約を抽出し,それに対して指定された関数を実行する.ブロックチェーンにデータを書き込むことはできない.データの書込みにはBlockchainTransactionSubmitが必要である.
- BlockchainContractValue[caddr,func]は契約関数を呼び出す.func は関数名と出力のデータ型を指定するTyped式でなければならない.
- BlockchainContractValue[caddr,assoc]は,追加的なパラメータを持つ契約を呼び出す.assoc には次の特性がなければならない.
-
"Function" 呼び出す関数を定義するTyped式 - さらに,連想 assoc は次の特性も持つことができる.
-
"Inputs" 呼び出す関数の入力パラメータ "Sender" 契約を呼び出している送信者のアドレス "BlockNumber" ブロックチェーンの特定の状態に関連付けられたブロック番号 - 特定の関数が指定されたアドレスの契約の評価に失敗した場合,BlockchainContractValueはMissing["NoResult"]を返す.
例題
すべて開く すべて閉じる例 (5)
アドレスを指定して,関数 name,symbol,decimals を呼び出す:
address = "f230b790E05390FC8295F4d3F60332c93BEd42e2";BlockchainContractValue[address, Typed["name", "string"], BlockchainBase -> {"Ethereum", "Mainnet"}]BlockchainContractValue[address, Typed["symbol", "string"], BlockchainBase -> {"Ethereum", "Mainnet"}]BlockchainContractValue[address, Typed["decimals", "uint256"], BlockchainBase -> {"Ethereum", "Mainnet"}]address = "cEf2Ba8C04343566867d1c3e5948efE4aC800E7b";BlockchainContractValue[address, "Result", BlockchainBase -> {"Ethereum", "Testnet"}]OmiseGoトークンの総供給量を,そのアドレスを使って確認する:
omgtoken = First[BlockchainTokenData["OMGToken", "TokenAddress", BlockchainBase -> {"Ethereum", "Mainnet"}]]BlockchainContractValue[omgtoken, Typed["totalSupply", "uint256"], BlockchainBase -> {"Ethereum", "Mainnet"}]omgtoken = First[BlockchainTokenData["OMGToken", "TokenAddress", BlockchainBase -> {"Ethereum", "Mainnet"}]]sender = RandomChoice[First[BlockchainTokenData["OMGToken", "TransferList", BlockchainBase -> "Ethereum"]]]["Sender"]BlockchainContractValue[omgtoken, <|"Function" -> Typed["balanceOf", "address" -> "uint256"], "Inputs" -> sender|>, BlockchainBase -> {"Ethereum", "Mainnet"}]ブロック6000000が採掘された際の所有者の口座残高をチェックする:
BlockchainContractValue[omgtoken, <|"Function" -> Typed["balanceOf", "address" -> "uint256"], "Inputs" -> sender, "BlockNumber" -> 6000000|>, BlockchainBase -> {"Ethereum", "Mainnet"}]トークンIDが883551のCryptoKittiesのオークションをチェックする:
BlockchainContractValue["b1690C08E213a35Ed9bAb7B318DE14420FB57d8C", <|"Function" -> Typed["getAuction", "uint256" -> {"address", "uint256", "uint256", "uint256", "uint256"}], "Inputs" -> 883551|>, BlockchainBase -> {"Ethereum", "Mainnet"}]オプション (2)
BlockchainBase (2)
Mainnet (1)
関連するガイド
履歴
2019 で導入 (12.0)
テキスト
Wolfram Research (2019), BlockchainContractValue, Wolfram言語関数, https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-Ethereum.html.
CMS
Wolfram Language. 2019. "BlockchainContractValue." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-Ethereum.html.
APA
Wolfram Language. (2019). BlockchainContractValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-Ethereum.html
BibTeX
@misc{reference.wolfram_2026_blockchaincontractvalue, author="Wolfram Research", title="{BlockchainContractValue}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-Ethereum.html}", note=[Accessed: 10-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaincontractvalue, organization={Wolfram Research}, title={BlockchainContractValue}, year={2019}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-Ethereum.html}, note=[Accessed: 10-August-2026]}