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().


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.