4

Lets supose i got a contract named Contract (already an instance). And this contract got a method/function named function with the payable clause.

This method gets the address of the caller and the amount paid to do some stuff.

I've tried calling it by: Contract.function.value(x)(arguments) but it throws me TypeError: 'value' is not a function.

How can i call this contract and send (as example) 5 ether to this function?

Thank you.

2

New way:

Contract.function({from:"address goes here", value:"amount goes here"})

And that's the way to do it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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