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); Commented Jul 15, 2020 at 9:44
  • 3
    a.f.value(500000000000000000)(6, "7"); to be more accurate. Commented Jul 15, 2020 at 9:50

1 Answer 1

2

Note: Function f must be payable to receive Wei.

3
  • 1
    While this is true, it does not answer the question. Commented Jul 15, 2020 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
    Commented Jul 15, 2020 at 10:20
  • Oh... got it :) Commented Jul 15, 2020 at 10:30

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.