interledger-deprecated / ilp-plugin-ethereum

Other
10 stars 12 forks source link

feat: remove value:0 from abi #9

Closed michielbdejong closed 7 years ago

michielbdejong commented 7 years ago

I compiled ledger.sol using https://ethereum.github.io/browser-solidity/ and got a slightly different abi; the difference (after vim :%s/},/},\r/g for readability), is just removing value: 0 a number of times:

4,10c4,10
< {"constant":true,"inputs":[{"name":"","type":"bytes16"}],"name":"memos","outputs":[{"name":"","type":"bytes","value":"0x"}],"payable":false,"type":"function"},
< {"constant":true,"inputs":[{"name":"","type":"bytes16"}],"name":"transfers","outputs":[{"name":"sender","type":"address","value":"0x0000000000000000000000000000000000000000"},
< {"name":"receiver","type":"address","value":"0x0000000000000000000000000000000000000000"},
< {"name":"amount","type":"uint256","value":"0"},
< {"name":"condition","type":"bytes32","value":"0x0000000000000000000000000000000000000000000000000000000000000000"},
< {"name":"expiry","type":"uint256","value":"0"},
< {"name":"state","type":"uint8","value":"0"}],"payable":false,"type":"function"},
---
> {"constant":true,"inputs":[{"name":"","type":"bytes16"}],"name":"memos","outputs":[{"name":"","type":"bytes"}],"payable":false,"type":"function"},
> {"constant":true,"inputs":[{"name":"","type":"bytes16"}],"name":"transfers","outputs":[{"name":"sender","type":"address"},
> {"name":"receiver","type":"address"},
> {"name":"amount","type":"uint256"},
> {"name":"condition","type":"bytes32"},
> {"name":"expiry","type":"uint256"},
> {"name":"state","type":"uint8"}],"payable":false,"type":"function"},

I'm not sure which abi we should use in the official plugin, but the one I deployed to Rinkeby is the one without zeroes, so I assume that's needed in order for web3 to subscribe to contract events.

sharafian commented 7 years ago

What did you use to recompile this? And have you tested to make sure it works?

michielbdejong commented 7 years ago

https://ethereum.github.io/browser-solidity/ is what I used, it's an online Solidity compiler. You can click 'Contract details (bytecode, interface etc.)' on there to get the Web3 deploy commands.

I checked that this works for https://rinkeby.etherscan.io/address/0x8B3fBD781096b51e68448C6e5B53B240f663199F, which is the contract instance I'm using on the ethereum testnet, but probably, fixing this for my contract instance will break it for your contract instance?

sharafian commented 7 years ago

yeah, if the ABI changes it won't be able to use the instance on the livenet anymore. If that version is working, I don't see a compelling reason to change it

michielbdejong commented 7 years ago

ok, I'll try to deploy a contract with the same ABI as the one on the live net.

michielbdejong commented 7 years ago

This is the ABI deployed and used on the testnet. But I had some trouble using etherscan's Verify And Publish function, so I think I'll end up deploying a new contract at a new address at some point anyway, and then I can also use the one from master.

So yeah, I'll keep the branch, but the PR can be closed!

michielbdejong commented 7 years ago

btw, ping me on Slack if you want me to add your ssh key to the testnet bootstrap server, it has a synced full geth node connected to Rinkeby, might be useful in case you want to deploy a different contract to there, so people can connect to the Interledger-testnet-of-testnets with the latest ethereum plugin :)