0

In solidity 0.6.x, this will work.

bentoBox.deposit{value: value}(token, msg.sender, to, uint256(amount), uint256(share));

I can call other contract's function with value. How can I do this in solidity 0.5.6

When I compile, error comes out. ParserError: Expected ';' but got '{'

Thank you

0

1 Answer 1

1

You need to use yourFunction.value(<wei>)(parameters).

This has been described here for example Using ".value(...)" is deprecated. Use "{value: ...}" instead

The easiest way to also check is to select a specific version in the Solidity docs (e.g. https://docs.soliditylang.org/en/v0.5.6/control-structures.html?highlight=Value#creating-contracts-via-new)

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