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

davinci26
  • 315
  • 1
  • 8

1 Answers1

2

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

davinci26
  • 315
  • 1
  • 8