Online Solidity Decompiler

« Decompile another contract

Address

0x40947dcdc33ee9ca6305495aa39a03b9036d5602 [etherscan.io | etherchain.org]

Public Methods

No public methods detected.

Internal Methods

func_0097() returns (r0)

Decompilation

This might be constructor bytecode - to get at the deployed contract, go back and remove the constructor prefix, usually up to the next 6060 or 6080.
contract Contract { function main() { memory[0x40:0x60] = 0x80; if (msg.data.length >= 0x04) { var0 = msg.data[0x00:0x20] >> 0xe0; if (var0 != 0x5c60da1b) { goto label_002B; } var1 = msg.value; if (var1) { revert(memory[0x00:0x00]); } var1 = 0x43; var1 = func_0097(); var temp3 = memory[0x40:0x60]; memory[temp3:temp3 + 0x20] = var1 & (0x01 << 0xa0) - 0x01; var temp4 = memory[0x40:0x60]; return memory[temp4:temp4 + (temp3 + 0x20) - temp4]; } else if (msg.data.length) { label_002B: var var0 = 0x29; label_005F: var var1 = 0x95; var var2 = storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] & (0x01 << 0xa0) - 0x01; var temp0 = msg.data.length; memory[0x00:0x00 + temp0] = msg.data[0x00:0x00 + temp0]; var temp1; temp1, memory[0x00:0x00] = address(var2).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]); var temp2 = returndata.length; memory[0x00:0x00 + temp2] = returndata[0x00:0x00 + temp2]; if (!temp1) { revert(memory[0x00:0x00 + returndata.length]); } else { return memory[0x00:0x00 + returndata.length]; } } else { var0 = 0x29; goto label_005F; } } function func_0097() returns (var r0) { var var0 = 0x00; var var1 = storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] & (0x01 << 0xa0) - 0x01; return var1; } }

Disassembly

label_0000: // Inputs[1] { @0007 msg.data.length } 0000 60 PUSH1 0x80 0002 60 PUSH1 0x40 0004 52 MSTORE 0005 60 PUSH1 0x04 0007 36 CALLDATASIZE 0008 10 LT 0009 60 PUSH1 0x1f 000B 57 *JUMPI // Stack delta = +0 // Outputs[1] { @0004 memory[0x40:0x60] = 0x80 } // Block ends with conditional jump to 0x001f, if msg.data.length < 0x04 label_000C: // Incoming jump from 0x000B, if not msg.data.length < 0x04 // Inputs[1] { @000E msg.data[0x00:0x20] } 000C 60 PUSH1 0x00 000E 35 CALLDATALOAD 000F 60 PUSH1 0xe0 0011 1C SHR 0012 80 DUP1 0013 63 PUSH4 0x5c60da1b 0018 14 EQ 0019 60 PUSH1 0x31 001B 57 *JUMPI // Stack delta = +1 // Outputs[1] { @0011 stack[0] = msg.data[0x00:0x20] >> 0xe0 } // Block ends with conditional jump to 0x0031, if 0x5c60da1b == msg.data[0x00:0x20] >> 0xe0 label_001C: // Incoming jump from 0x001B, if not 0x5c60da1b == msg.data[0x00:0x20] >> 0xe0 001C 60 PUSH1 0x2b 001E 56 *JUMP // Stack delta = +0 // Block ends with unconditional jump to 0x002b label_001F: // Incoming jump from 0x000B, if msg.data.length < 0x04 // Inputs[1] { @0020 msg.data.length } 001F 5B JUMPDEST 0020 36 CALLDATASIZE 0021 60 PUSH1 0x2b 0023 57 *JUMPI // Stack delta = +0 // Block ends with conditional jump to 0x002b, if msg.data.length label_0024: // Incoming jump from 0x0023, if not msg.data.length 0024 60 PUSH1 0x29 0026 60 PUSH1 0x5f 0028 56 *JUMP // Stack delta = +1 // Outputs[1] { @0024 stack[0] = 0x29 } // Block ends with unconditional jump to 0x005f 0029 5B JUMPDEST 002A 00 *STOP label_002B: // Incoming jump from 0x0023, if msg.data.length // Incoming jump from 0x001E 002B 5B JUMPDEST 002C 60 PUSH1 0x29 002E 60 PUSH1 0x5f 0030 56 *JUMP // Stack delta = +1 // Outputs[1] { @002C stack[0] = 0x29 } // Block ends with unconditional jump to 0x005f label_0031: // Incoming jump from 0x001B, if 0x5c60da1b == msg.data[0x00:0x20] >> 0xe0 // Inputs[1] { @0032 msg.value } 0031 5B JUMPDEST 0032 34 CALLVALUE 0033 80 DUP1 0034 15 ISZERO 0035 60 PUSH1 0x3c 0037 57 *JUMPI // Stack delta = +1 // Outputs[1] { @0032 stack[0] = msg.value } // Block ends with conditional jump to 0x003c, if !msg.value label_0038: // Incoming jump from 0x0037, if not !msg.value // Inputs[1] { @003B memory[0x00:0x00] } 0038 60 PUSH1 0x00 003A 80 DUP1 003B FD *REVERT // Stack delta = +0 // Outputs[1] { @003B revert(memory[0x00:0x00]); } // Block terminates label_003C: // Incoming jump from 0x0037, if !msg.value 003C 5B JUMPDEST 003D 50 POP 003E 60 PUSH1 0x43 0040 60 PUSH1 0x97 0042 56 *JUMP // Stack delta = +0 // Outputs[1] { @003E stack[-1] = 0x43 } // Block ends with call to 0x0097, returns to 0x0043 label_0043: // Incoming return from call to 0x0097 at 0x0042 // Inputs[4] // { // @0046 memory[0x40:0x60] // @0050 stack[-1] // @0059 memory[0x40:0x60] // @005E memory[memory[0x40:0x60]:memory[0x40:0x60] + (0x20 + memory[0x40:0x60]) - memory[0x40:0x60]] // } 0043 5B JUMPDEST 0044 60 PUSH1 0x40 0046 51 MLOAD 0047 60 PUSH1 0x01 0049 60 PUSH1 0x01 004B 60 PUSH1 0xa0 004D 1B SHL 004E 03 SUB 004F 90 SWAP1 0050 91 SWAP2 0051 16 AND 0052 81 DUP2 0053 52 MSTORE 0054 60 PUSH1 0x20 0056 01 ADD 0057 60 PUSH1 0x40 0059 51 MLOAD 005A 80 DUP1 005B 91 SWAP2 005C 03 SUB 005D 90 SWAP1 005E F3 *RETURN // Stack delta = -1 // Outputs[2] // { // @0053 memory[memory[0x40:0x60]:memory[0x40:0x60] + 0x20] = stack[-1] & (0x01 << 0xa0) - 0x01 // @005E return memory[memory[0x40:0x60]:memory[0x40:0x60] + (0x20 + memory[0x40:0x60]) - memory[0x40:0x60]]; // } // Block terminates label_005F: // Incoming jump from 0x0028 // Incoming jump from 0x0030 // Inputs[1] { @0085 storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] } 005F 5B JUMPDEST 0060 60 PUSH1 0x95 0062 60 PUSH1 0x91 0064 7F PUSH32 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc 0085 54 SLOAD 0086 60 PUSH1 0x01 0088 60 PUSH1 0x01 008A 60 PUSH1 0xa0 008C 1B SHL 008D 03 SUB 008E 16 AND 008F 90 SWAP1 0090 56 *JUMP // Stack delta = +2 // Outputs[2] // { // @0060 stack[0] = 0x95 // @008F stack[1] = (0x01 << 0xa0) - 0x01 & storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] // } // Block ends with unconditional jump to 0x0091 label_0091: // Incoming jump from 0x0090 0091 5B JUMPDEST 0092 60 PUSH1 0xd1 0094 56 *JUMP // Stack delta = +0 // Block ends with unconditional jump to 0x00d1 0095 5B JUMPDEST 0096 56 *JUMP label_0097: // Incoming call from 0x0042, returns to 0x0043 // Inputs[1] { @00BD storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] } 0097 5B JUMPDEST 0098 60 PUSH1 0x00 009A 60 PUSH1 0xc9 009C 7F PUSH32 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc 00BD 54 SLOAD 00BE 60 PUSH1 0x01 00C0 60 PUSH1 0x01 00C2 60 PUSH1 0xa0 00C4 1B SHL 00C5 03 SUB 00C6 16 AND 00C7 90 SWAP1 00C8 56 *JUMP // Stack delta = +2 // Outputs[2] // { // @0098 stack[0] = 0x00 // @00C7 stack[1] = (0x01 << 0xa0) - 0x01 & storage[0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc] // } // Block ends with unconditional jump to 0x00c9 label_00C9: // Incoming jump from 0x00C8 // Inputs[3] // { // @00CA stack[-1] // @00CA stack[-2] // @00CC stack[-3] // } 00C9 5B JUMPDEST 00CA 90 SWAP1 00CB 50 POP 00CC 90 SWAP1 00CD 56 *JUMP // Stack delta = -2 // Outputs[1] { @00CC stack[-3] = stack[-1] } // Block ends with unconditional jump to stack[-3] 00CE 5B JUMPDEST 00CF 90 SWAP1 00D0 56 *JUMP label_00D1: // Incoming jump from 0x0094 // Inputs[9] // { // @00D2 msg.data.length // @00D6 msg.data[0x00:0x00 + msg.data.length] // @00DA msg.data.length // @00DD stack[-1] // @00DE msg.gas // @00DF memory[0x00:0x00 + msg.data.length] // @00DF address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // @00E0 returndata.length // @00E4 returndata[0x00:0x00 + returndata.length] // } 00D1 5B JUMPDEST 00D2 36 CALLDATASIZE 00D3 60 PUSH1 0x00 00D5 80 DUP1 00D6 37 CALLDATACOPY 00D7 60 PUSH1 0x00 00D9 80 DUP1 00DA 36 CALLDATASIZE 00DB 60 PUSH1 0x00 00DD 84 DUP5 00DE 5A GAS 00DF F4 DELEGATECALL 00E0 3D RETURNDATASIZE 00E1 60 PUSH1 0x00 00E3 80 DUP1 00E4 3E RETURNDATACOPY 00E5 80 DUP1 00E6 80 DUP1 00E7 15 ISZERO 00E8 60 PUSH1 0xef 00EA 57 *JUMPI // Stack delta = +2 // Outputs[5] // { // @00D6 memory[0x00:0x00 + msg.data.length] = msg.data[0x00:0x00 + msg.data.length] // @00DF memory[0x00:0x00] = address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // @00DF stack[0] = address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // @00E4 memory[0x00:0x00 + returndata.length] = returndata[0x00:0x00 + returndata.length] // @00E5 stack[1] = address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // } // Block ends with conditional jump to 0x00ef, if !address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) label_00EB: // Incoming jump from 0x00EA, if not !address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // Inputs[2] // { // @00EB returndata.length // @00EE memory[0x00:0x00 + returndata.length] // } 00EB 3D RETURNDATASIZE 00EC 60 PUSH1 0x00 00EE F3 *RETURN // Stack delta = +0 // Outputs[1] { @00EE return memory[0x00:0x00 + returndata.length]; } // Block terminates label_00EF: // Incoming jump from 0x00EA, if !address(stack[-1]).delegatecall.gas(msg.gas)(memory[0x00:0x00 + msg.data.length]) // Inputs[2] // { // @00F0 returndata.length // @00F3 memory[0x00:0x00 + returndata.length] // } 00EF 5B JUMPDEST 00F0 3D RETURNDATASIZE 00F1 60 PUSH1 0x00 00F3 FD *REVERT // Stack delta = +0 // Outputs[1] { @00F3 revert(memory[0x00:0x00 + returndata.length]); } // Block terminates 00F4 FE *ASSERT 00F5 A2 LOG2 00F6 64 PUSH5 0x6970667358 00FC 22 22 00FD 12 SLT 00FE 20 SHA3 00FF 59 MSIZE 0100 0A EXP 0101 8D DUP14 0102 EE EE 0103 90 SWAP1 0104 45 GASLIMIT 0105 D2 D2 0106 CA CA 0107 DC DC 0108 69 PUSH10 0x71c877cbc8c41b60d8aa 0113 7A PUSH27 0x6aecdd2f83e45dffa45bdd64736f6c63430008110033
Found this site useful?
Donations are greatly appreciated!
ETH: 0xB3F04f0c276fa1177c1779f6E1E156B2738ea392
Contact/hire: [email protected]