Myetherwallet

如何找出用於部署 MyEtherWallet 的編譯器版本

  • May 9, 2018

如果我在 MyEtherWallet.com 上部署合約,我如何才能找出使用的編譯器版本,用於驗證 etherscan 上的程式碼等?

為了在 MyEtherWallet 上部署合約,您需要字節碼。字節碼包含元數據中的solidity pragma 版本,該版本被轉換為object您自己獲取的字節碼中的參數。

它將使用設置為編譯指示的任何內容進行編譯。

至於驗證。您將需要知道在solidity 程式碼本身中設置了哪些編譯指示。


契約範例:

pragma solidity ^0.4.23;


contract Stack {
   address public owner = msg.sender;
}

範例字節碼:

{
   "linkReferences": {},
   "object": "6080604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005057600080fd5b5060e98061005f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638da5cb5b146044575b600080fd5b348015604f57600080fd5b5060566098565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16815600a165627a7a7230582014af0b7dee656067826398e451ee6dfdad4c1976579492127de9c0b4d9c8c9be0029",
   "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP CALLVALUE DUP1 ISZERO PUSH2 0x50 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0xE9 DUP1 PUSH2 0x5F PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN STOP PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH1 0x3F JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV PUSH4 0xFFFFFFFF AND DUP1 PUSH4 0x8DA5CB5B EQ PUSH1 0x44 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH1 0x4F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x56 PUSH1 0x98 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP1 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP STOP LOG1 PUSH6 0x627A7A723058 KECCAK256 EQ 0xaf SIGNEXTEND PUSH30 0xEE656067826398E451EE6DFDAD4C1976579492127DE9C0B4D9C8C9BE0029 ",
   "sourceMap": "27:57:0:-;;;71:10;48:33;;;;;;;;;;;;;;;;;;;;27:57;8:9:-1;5:2;;;30:1;27;20:12;5:2;27:57:0;;;;;;;"
}

當您在 MyEtherWallet 上部署時,您會發布您的字節碼。無法檢測到哪個編譯器版本生成了提供的字節碼。你可以在這裡找到更多資訊

引用自:https://ethereum.stackexchange.com/questions/48019