Here's the code:

contract C {
    function a(uint x){}

I try to call C.a(1000000000000000000);

and get an error:

Error encoding arguments: Error: Assertion failed

while C.a(100000000); is perfectly fine

What's the problem there?

1 Answer 1


The uint is too big for a native Javascript Number, so the Solidity Browser needs the input in quotes ("1000000000000000000") so that it can read the input as a string and manipulate it as a BigNumber.

Thanks for asking and I added it to How to quickly test a Solidity function?

For easy testing, I tested with this code:

contract C {
    function a(uint x) returns(uint) { return x; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.