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

Porosity enters infinite loop for one of the contracts #22

Open
ghost opened this issue Aug 17, 2017 · 2 comments
Open

Porosity enters infinite loop for one of the contracts #22

ghost opened this issue Aug 17, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 17, 2017

ABI='[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposals","outputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"},{"name":"description","type":"string"},{"name":"votingDeadline","type":"uint256"},{"name":"executed","type":"bool"},{"name":"proposalPassed","type":"bool"},{"name":"numberOfVetos","type":"uint256"},{"name":"proposalHash","type":"bytes32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"proposalNumber","type":"uint256"}],"name":"veto","outputs":[{"name":"voteID","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"proposalNumber","type":"uint256"},{"name":"transactionBytecode","type":"bytes"}],"name":"executeProposal","outputs":[{"name":"result","type":"int256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numProposals","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"debatingPeriodInMinutes","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"minutesForDebate","type":"uint256"}],"name":"changeVotingRules","outputs":[],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"finneyAmount","type":"uint256"},{"name":"JobDescription","type":"string"},{"name":"transactionBytecode","type":"bytes"}],"name":"newProposal","outputs":[{"name":"proposalID","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"inputs":[],"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"recipient","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"description","type":"string"}],"name":"ProposalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"position","type":"bool"},{"indexed":false,"name":"voter","type":"address"}],"name":"Voted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposalID","type":"uint256"},{"indexed":false,"name":"result","type":"int256"},{"indexed":false,"name':"active","type":"bool"}],"name":"ProposalTallied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"debatingPeriodInMinutes","type":"uint256"}],"name":"ChangeOfRules","type":"event"}]
BIN=0x606060405236156100a0576000357c010000000000000000000000000000000000000000000000000000000090048063013cf08b146100a95780631d28dec7146101ab578063237e9492146101dc578063400e39491461025457806369bd34361461027c5780638da5cb5b146102a4578063ac69c09c146102e2578063dfe12c3114610303578063f2fde38b146103c2578063fc0c546a146103df576100a0565b6100a75b5b565b005b34610002576100c4600480803590602001909190505061041d565b604051808973ffffffffffffffffffffffffffffffffffffffff1681526020018881526020018060200187815260200186151581526020018515158152602001848152602001836000191681526020018281038252888181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156101955780601f1061016a57610100808354040283529160200191610195565b820191906000526020600020905b81548152906001019060200180831161017857829003601f168201915b5050995050505050505050505060405180910390f35b34610002576101c660048080359060200190919050506104bd565b6040518082815260200191505060405180910390f35b346100025761023e6004808035906020019091908035906020019082018035906020019191908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509090919050506108b6565b6040518082815260200191505060405180910390f35b34610002576102666004805050610d9e565b6040518082815260200191505060405180910390f35b346100025761028e6004805050610da7565b6040518082815260200191505060405180910390f35b34610002576102b66004805050610db0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103016004808035906020019091908035906020019091905050610dd6565b005b34610002576103ac6004808035906020019091908035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050909091908035906020019082018035906020019191908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050909091905050610ebb565b6040518082815260200191505060405180910390f35b34610002576103dd600480803590602001909190505061143f565b005b34610002576103f160048050506114dd565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600260005081815481101561000257906000526020600020906009020160005b915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101600050549080600201600050908060030160005054908060040160009054906101000a900460ff16908060040160019054906101000a900460ff16908060050160005054908060060160005054905088565b600060006000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a0823133600060405160200152604051827c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b156100025760325a03f1156100025750505060405180519060200150141561058857610002565b600260005083815481101561000257906000526020600020906009020160005b509050600115158160080160005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156105f857610002565b806007016000508054809190600101909081548183558181151161068257818360005260206000209182019101610681919061062f565b8082111561067d5760006000820160006101000a81549060ff02191690556000820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010161062f565b5090565b5b5050509150815060406040519081016040528060018152602001338152602001508160070160005083815481101561000257906000526020600020900160005b5060008201518160000160006101000a81548160ff02191690837f010000000000000000000000000000000000000000000000000000000000000090810204021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c0100000000000000000000000090810204021790555090505060018160080160005060003373ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055506001820181600501600050819055507f86abfce99b7dd908bec0169288797f85049ec73cbe046ed9de818fab3a497ae0836001336040518084815260200183151581526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a1600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634a501381604051817c0100000000000000000000000000000000000000000000000000000000028152600401809050600060405180830381600087803b156100025760325a03f115610002575050505b5b50919050565b600060006000600060006000600260005088815481101561000257906000526020600020906009020160005b509450846003016000505442108061090857508460040160009054906101000a900460ff165b806109b457508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856001016000505488604051808473ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018381526020018280519060200190808383829060006004602084601f0104600302600f01f150905001935050505060405180910390206000191685600601600050546000191614155b156109be57610002565b60009350600092505b8460070160005080549050831015610b08578460070160005083815481101561000257906000526020600020900160005b509150600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082318360000160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600060405160200152604051827c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b156100025760325a03f115610002575050506040518051906020015090508160000160009054906101000a900460ff1615610afa57808401935083505b5b82600101925082506109c7565b6002600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd600060405160200152604051817c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b156100025760325a03f115610002575050506040518051906020015081156100025704841015610cf75760018560040160006101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055508460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1666038d7ea4c6800086600101600050540288604051808280519060200190808383829060006004602084601f0104600302600f01f150905090810190601f168015610c8e5780820380516001836020036101000a031916815260200191505b5091505060006040518083038185876185025a03f1925050501515610cb257610002565b60018560040160016101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000908102040217905550610d38565b60008560040160016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b7fe9de5427a63c4de2f5b13ac1749e48fccf7a58f27348e3013e572b0ece62d01b88878760040160019054906101000a900460ff16604051808481526020018381526020018215158152602001935050505060405180910390a15b505050505092915050565b60036000505481565b60016000505481565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3257610002565b81600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c01000000000000000000000000908102040217905550806001600050819055507fc594bbef86dc6af772d58da5eb4f1d1e3c65feaec732130f40ff6590e28799a86001600050546040518082815260200191505060405180910390a15b5b5050565b60006000600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1b57610002565b6002600050805480919060010190908154818355818115116110cb576009028160090283600052602060002091820191016110ca9190610f56565b808211156110c65760006000820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000506000905560028201600050805460018160011615610100020316600290046000825580601f10610fbe5750610ffb565b601f016020900490600052602060002090810190610ffa9190610fdc565b80821115610ff65760008181506000905550600101610fdc565b5090565b5b5060038201600050600090556004820160006101000a81549060ff02191690556004820160016101000a81549060ff02191690556005820160005060009055600682016000506000905560078201600050805460008255906000526020600020908101906110bb9190611069565b808211156110b75760006000820160006101000a81549060ff02191690556000820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101611069565b5090565b5b5050600901610f56565b5090565b5b50505091508150600260005082815481101561000257906000526020600020906009020160005b509050600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c0100000000000000000000000090810204021790555084816001016000508190555083816002016000509080519060200190828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106111b357805160ff19168380011785556111e4565b828001600101855582156111e4579182015b828111156111e35782518260005055916020019190600101906111c5565b5b50905061120f91906111f1565b8082111561120b57600081815060009055506001016111f1565b5090565b5050600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168584604051808473ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018381526020018280519060200190808383829060006004602084601f0104600302600f01f150905001935050505060405180910390208160060160005081905550603c600160005054024201816003016000508190555060008160040160006101000a81548160ff02191690837f010000000000000000000000000000000000000000000000000000000000000090810204021790555060008160040160016101000a81548160ff02191690837f0100000000000000000000000000000000000000000000000000000000000000908102040217905550600081600501600050819055507f646fec02522b41e7125cfc859a64fd4f4cefd5dc3b6237ca0abe251ded1fa88182600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168787604051808581526020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001806020018281038252838181518152602001915080519060200190808383829060006004602084601f0104600302600f01f150905090810190601f1680156114185780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a1600182016003600050819055505b5b509392505050565b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561149b57610002565b80600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff02191690836c010000000000000000000000009081020402179055505b5b50565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168156

Using the command:

./porosity --abi $ABI --code $BIN --decompile

the only output I get is:

Porosity v0.1 (https://www.comae.io)
Matt Suiche, Comae Technologies <support@comae.io>
The Ethereum bytecode commandline decompiler.
Decompiles the given Ethereum input bytecode and outputs the Solidity code.

Attempting to parse ABI definition...
Success.
Hash: 0x013CF08B
ERROR: JUMPI destination is null.
ERROR: JUMPI destination is null.

End then it gets stuck in some kind of an infinite loop I believe...

@msuiche
Copy link
Owner

msuiche commented Aug 21, 2017

Thanks for sharing the bytecode, will investigate.

@penguin4238
Copy link

yeap, i face the same problem
abi='[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string","value":"Mb3"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8","value":"2"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256","value":"0"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string","value":"m3"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[{"name":"amount","type":"uint256"}],"payable":true,"type":"function"},{"inputs":[{"name":"initialSupply","type":"uint256","index":0,"typeShort":"uint","bits":"256","displayName":"initialSupply","template":"elements_input_uint","value":"1000"},{"name":"tokenName","type":"string","index":1,"typeShort":"string","bits":"","displayName":"tokenName","template":"elements_input_string","value":"Mb3"},{"name":"decimalUnits","type":"uint8","index":2,"typeShort":"uint","bits":"8","displayName":"decimalUnits","template":"elements_input_uint","value":"2"},{"name":"tokenSymbol","type":"string","index":3,"typeShort":"string","bits":"","displayName":"tokenSymbol","template":"elements_input_string","value":"m3"}],"payable":true,"type":"constructor"}]' code="0x606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610069578063313ce567146100f457806370a082311461011d57806395d89b411461015b578063a6f2ae3a146101e6575b600080fd5b341561007457600080fd5b61007c610200565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100b95780820151818401525b6020016100a0565b50505050905090810190601f1680156100e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156100ff57600080fd5b61010761029e565b60405160ff909116815260200160405180910390f35b341561012857600080fd5b61014973ffffffffffffffffffffffffffffffffffffffff600435166102a7565b60405190815260200160405180910390f35b341561016657600080fd5b61007c6102b9565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100b95780820151818401525b6020016100a0565b50505050905090810190601f1680156100e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610149610357565b60405190815260200160405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102965780601f1061026b57610100808354040283529160200191610296565b820191906000526020600020905b81548152906001019060200180831161027957829003601f168201915b505050505081565b60035460ff1681565b60006020819052908152604090205481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102965780601f1061026b57610100808354040283529160200191610296565b820191906000526020600020905b81548152906001019060200180831161027957829003601f168201915b505050505081565b600480546005808201835573ffffffffffffffffffffffffffffffffffffffff331660009081526020819052604090208054909201019055545b905600a165627a7a723058205b9732d831b0211260e684b24378c8789bf6e82e21c10d210706993ac726c2680029"

stuck at :
`The Ethereum bytecode commandline decompiler.
Decompiles the given Ethereum input bytecode and outputs the Solidity code.

Attempting to parse ABI definition...
Success.
Hash: 0x06FDDE03`

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

2 participants