Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't appear to work for Serpent sourced bytecode. #16

Open
MicahZoltu opened this issue Jul 23, 2017 · 0 comments
Open

Doesn't appear to work for Serpent sourced bytecode. #16

MicahZoltu opened this issue Jul 23, 2017 · 0 comments

Comments

@MicahZoltu
Copy link

I'm trying to disassemble Augur's REP contract, but the output is way shorter than expected.
https://etherscan.io/address/0x48c80F1f4D53D5951e5D5438B54Cba84f29F32a5#code

Bytecode:

0x600061051f537c01000000000000000000000000000000000000000000000000000000006000350460003413156100495760006000600060003433611388f11515610048576000565b5b63a9059cbb81141561016457365990590160009052366004823760043560605260243560805250335460a05260805160a05112801561008857806100a1565b7401000000000000000000000000000000000000000054155b905080156100af57806100cd565b613a9874010000000000000000000000000000000000000006540142125b9050156100d8576000565b335460805113151580156100ec57806100fc565b6060515460805160605154011215155b905015610107576000565b6080513354033355608051606051540160605155601c60405990590160009052016080518152606051337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602084a3506001610140526020610140f35b6323b872dd8114156103185736599059016000905236600482376004356101605260243560605260443560805250610160515460a05260805160a0511280156101ad57806101d6565b606060605990590160009052600181526101605181602001523381604001528090502054608051135b905080156101e457806101fd565b7401000000000000000000000000000000000000000054155b9050801561020b5780610229565b613a9874010000000000000000000000000000000000000006540142125b905015610234576000565b6101605154608051131515801561024b578061025b565b6060515460805160605154011215155b905015610266576000565b608051606060605990590160009052600181526101605181602001523381604001528090502054036060606059905901600090526001815261016051816020015233816040015280905020556080516101605154036101605155608051606051540160605155601c60405990590160009052016080518152606051610160517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602084a3506001610260526020610260f35b63095ea7b38114156103b4573659905901600090523660048237600435610280526024356102a052506102a051606060605990590160009052600181523381602001526102805181604001528090502055601c60405990590160009052016102a051815261028051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602084a35060016102e05260206102e0f35b63d39d08478114156105fe57365990590160009052366004823760043560208201016103005260243560208201016103205250600061034052602061030051035161036052602061032051035161036051141515610410576000565b740100000000000000000000000000000000000000005480156104335780610452565b613a987401000000000000000000000000000000000000000654014212155b90501561045d576000565b740100000000000000000000000000000000000000055433141515610480576000565b5b6103605161034051121561058157610340516020026103005101515415156104c0577401000000000000000000000000000000000000000054156104c3565b60005b1561057157610340516020026103205101516103405160200261030051015155610340516020026103205101517401000000000000000000000000000000000000000154017401000000000000000000000000000000000000000155601c60405990590160009052016103405160200261032051015181526103405160200261030051015160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602084a3505b6001610340510161034052610481565b6a09195731e2ce35eb000000740100000000000000000000000000000000000000015414156105c457600174010000000000000000000000000000000000000000555b6a09195731e2ce35eb000000740100000000000000000000000000000000000000015413156105f1576000565b60016103a05260206103a0f35b63943f401b8114156106805773668fc8d2004379275357c8d8e2502e19153adeee3314151561062b576000565b6000541561067b576000547401000000000000000000000000000000000000000154037401000000000000000000000000000000000000000155600060005560016103c05260206103c0f361067f565b6000565b5b63dd62ed3e8114156106db5736599059016000905236600482376004356103e0526024356102805250606060605990590160009052600181526103e05181602001526102805181604001528090502054610400526020610400f35b6318160ddd811415610709577401000000000000000000000000000000000000000154610440526020610440f35b6370a0823181141561073b57365990590160009052366004823760043561046052506104605154610480526020610480f35b6306fdde038114156107695774010000000000000000000000000000000000000002546104a05260206104a0f35b63313ce5678114156107975774010000000000000000000000000000000000000004546104c05260206104c0f35b6395d89b418114156107c55774010000000000000000000000000000000000000003546104e05260206104e0f35b63e44b11a28114156107f3577401000000000000000000000000000000000000000054610500526020610500f35b50

evmdis output:

# Stack: []
0x5     MSTORE8(0x51F, 0x0)
0x27    PUSH(CALLDATALOAD(0x0) / 0x100000000000000000000000000000000000000000000000000000000)
0x30    JUMPI(:label0, !SGT(CALLVALUE(), 0x0))

# Stack: [@0x27]
0x44    JUMPI(:label0, !!CALL(0x1388, CALLER(), CALLVALUE(), 0x0, 0x0, 0x0, 0x0))

# Stack: [@0x27]
0x47    JUMP(0x0)

:label0
# Stack: [@0x27]
0x4F    DUP1
0x55    JUMPI(0x164, !(POP() == 0xA9059CBB))

# Stack: [@0x27]
0x57    PUSH(MSIZE())
0x5E    MSTORE(MSIZE() + CALLDATASIZE(), 0x0)
0x62    DUP1
0x63    CALLDATACOPY(POP(), 0x4, CALLDATASIZE())
0x66    PUSH(CALLDATALOAD(0x4))
0x67    STOP()

Original source:
https://github.com/AugurProject/augur-core/blob/develop/src/legacyRepContract.se

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant