0

I created a simple solidity contract in the remix ide. I cannot figure out how to test the payable functions I created.

here is an example of a payable function:

function pay() payable {
}

here is a picture of a payable function buy() which does not accept ether or a value in remix

here is a picture of a payable function buy() which does not accept ether or a value in remix

how can i test payable functions on a test chain?

1 Answer 1

6

It is rather unintuitive on Remix, but there is a value input near the top of the panel (circled red). You can enter the value there before clicking on a function call. You'll need to do it for every call as the input field clears after a transaction.

Screenshot of Remix IDE

1
  • thank you! exactly what I was looking for... I even implemented a simple wallet to no avail! this info about the value field should be made clearer Jan 24, 2022 at 8:40

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.