Open AvishaiW opened 5 years ago
Perhaps an incorrect handling of conversions in ethabi
.
As I've experienced, U256 isn't compatible with Solidity Int
variable type. The Se/Deserialization does not work/it's not implemented. I've not had time to review it.
I don't know if there's any workarround to work with Int
.
ethereum_types crate on it's new release 0.4.0. maybe has something to solve it. I've not seen anything about it.. but I've not reiwed it.
So maybe @debris can bring some light here.
so, there is no conversion between U256
and Int
because... we never needed it. I'm happy to add it, but tbh I'm not sure how out of range values should be handled. Any suggestions?
@debris I think it should be handled the same way it's handled by the evm.
In the end everything in the evm is u256, so what how is -150
represented? (I'll guess it's some sort of underflowing...)
As @elichai says it can be solved by implementing the 2's Complement as evm does. The solution can be then loose a bit to gain the symbol property.
I think it's important to point out that with non huge numbers like X < 10^77
aprox. it should handle the signs, otherwise, I think we can experience unexpected behaviors.
I've used quite a bit the BigInt/BigUint crate. Maybe contains something helpful.
Hi, If I have a contract with a function like:
I Can't call it using:
Or even:
I must do:
Otherwise I get this error:
I can't explain why this happens, but it means I must import ethabi to use this.