Solidity
如何為合約生成完整的函式選擇器列表?
一個合約有很多函式,如何為整個合約自動生成完整的選擇器列表,包括繼承的函式?
首選解決方案不應該只需要一個網路瀏覽器。
也許您可以使用線上乙太坊 IDE(Remix):
- 粘貼您發布的地址的整個程式碼。
- 選擇相同的編譯器版本:
v0.4.25+commit.59dbf8f1
.- 按名稱選擇契約:
SaiProxyCreateAndExecute
。按編譯詳細資訊並檢查該
functionHashes
部分。你會得到類似下面的東西:{ "581f3c50": "createAndOpen(address,address)", "eefe3818": "createOpenAndLock(address,address)", "d3140a65": "createOpenLockAndDraw(address,address,uint256)", "0344a36f": "draw(address,bytes32,uint256)", "f9ef04be": "free(address,bytes32,uint256)", "da93dfcf": "give(address,bytes32,address)", "bc25a810": "lock(address,bytes32)", "1edf0c1e": "lockAndDraw(address,bytes32,uint256)", "516e9aec": "lockAndDraw(address,uint256)", "b95460f8": "open(address)", "bc244c11": "shut(address,bytes32)", "792037e3": "shut(address,bytes32,address)", "a3dc65a7": "wipe(address,bytes32,uint256)", "8a9fc475": "wipe(address,bytes32,uint256,address)", "faed77ab": "wipeAndFree(address,bytes32,uint256,uint256)", "1b968160": "wipeAndFree(address,bytes32,uint256,uint256,address)" }