-
Notifications
You must be signed in to change notification settings - Fork 5k
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
JS ABI Issue #182
Comments
i reformatted you issue it was unreadable. ;) |
web3.js contracts are solely for solidity at the moment and the contracts you're showing there are either incomplete or no solidity contracts i guess. |
Oh yes it's a serpent contract --- Any reason it's giving this error? Even with a solidity contract that takes an array as a parameter it gives me that error when trying to call contract |
the problem is, i have without line numbers no way to tell where this error is generated. |
Latest output it gives:
|
The calls generate very odd output. The |
1
that's not correct. should be - [{ "name": "createMarket(int256,string,int256,int256,int256,int256[])", "type": "function", "inputs": [{ "name": "branch", "type": "int256" }, { "name": "description", "type": "bytes" }, { "name": "alpha", "type": "int256" }, { "name": "initialLiquidity", "type": "int256" }, { "name": "tradingFee", "type": "int256" }, { "name": "events", "type": "int256[]" }], "outputs": [{ "name": "out", "type": "int256" }] }]
+ [{ "name": "createMarket(int256,bytes,int256,int256,int256,int256[])", "type": "function", "inputs": [{ "name": "branch", "type": "int256" }, { "name": "description", "type": "bytes" }, { "name": "alpha", "type": "int256" }, { "name": "initialLiquidity", "type": "int256" }, { "name": "tradingFee", "type": "int256" }, { "name": "events", "type": "int256[]" }], "outputs": [{ "name": "out", "type": "int256" }] }]
2parsing input should be ok. But just to be 100% sure, I've created test for encoding your input params: test({ types: ['int', 'bytes', 'int', 'int', 'int', 'int[]'], values: [1, 'gavofyork', 2, 3, 4, [5, 6, 7]],
expected: '0000000000000000000000000000000000000000000000000000000000000009' +
'0000000000000000000000000000000000000000000000000000000000000003' +
'0000000000000000000000000000000000000000000000000000000000000001' +
'0000000000000000000000000000000000000000000000000000000000000002' +
'0000000000000000000000000000000000000000000000000000000000000003' +
'0000000000000000000000000000000000000000000000000000000000000004' +
'6761766f66796f726b0000000000000000000000000000000000000000000000' +
'0000000000000000000000000000000000000000000000000000000000000005' +
'0000000000000000000000000000000000000000000000000000000000000006' +
'0000000000000000000000000000000000000000000000000000000000000007'}); 3
You are right. I fixed it in latest web3.js develop. Here is test Thanks for reporting it, cause it was critical. |
Does this really work? The expectation should be |
@chriseth why I though length of dynamic params, should be always at the beginning. Look at |
also, I though that constants should be before dynamic contents, #85 |
btw. the proposal looks good, but it would be nice, to have 2-3 examples of encoding to clarify everything. |
The examples on the wiki page of the specification seem to contradict the specification itself. |
Hmmm when i call a contract, getting a different error now
Nvm, was using wrong syntax
|
yes ;) |
Actually, I looked at the sam example again at it does not contradict the specification because all of its parameters are dynamic. |
fixed in #187 |
update: this is changing / being fixed in #194 |
Take the following contract for example:
Its address is
bf1f9a04cb5c85e9538a6f0e6ba15c824808cfee
And its description is:
If called in the web3.js console, e.g.
which is the correct value.
Now if we use this contract:
with address
0xe95aa1829447058201872db6ae3f04c3785a05b0
And description:
We end up getting completely wrong responses:
Edit: now contract.foo().call() is returning
The text was updated successfully, but these errors were encountered: