2

Lets say we have contract A

contract A{ function foo(uint8 value) payable{ require(msg.value !=0) do something ... } } and contract B

contract B{ function bar(uint8 value) payable{ calls the function foo of the contract A } } Assume that I have correctly set the addresses and contract B knows the address of contract A. What would be the syntax for calling the function foo?

Doing something like A.foo(value) reverts due to the requirement of A.foo().

marked as duplicate by Achala Dissanayake, eth Aug 28 '18 at 5:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Duplicate of Question 9705. The answer there seems to work perfectly. The syntax is address.func.value(amount)(arg1, arg2, arg3)

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