0

How to call a method in another contract with given value?

contract A {
  function f(int256 a, string b) { ... }
}

How to call A.f from another contract B with say 0.5 ETH value (if B was called with say 1 ETH value)?

2
  • 1
    a.f.value(500000000000000000)(6, 7); Jul 15 '20 at 9:44
  • 3
    a.f.value(500000000000000000)(6, "7"); to be more accurate. Jul 15 '20 at 9:50
2

Note: Function f must be payable to receive Wei.

3
  • 1
    While this is true, it does not answer the question. Jul 15 '20 at 10:16
  • 1
    @goodvibration You have already answered the question in the comments, this was an addition to your answer. I unfortunately can not add comments yet...
    – MentatX
    Jul 15 '20 at 10:20
  • Oh... got it :) Jul 15 '20 at 10:30

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.