Using Version 0.6.0
pragma solidity ^0.6.0;
contract Test {
function sendValue(address payable recipient, uint256 amount) external {
(bool success, ) = recipient.call{ value: amount }("");
}
}
Test.sol:5:42: ParserError: Expected ';' but got '{' (bool success, ) = recipient.call{ value: amount }(""); ^
Why is this error here?
You're using syntax that was introduced in Solidity 0.7 but isn't yet valid in 0.6.
For 0.6, use this:
(bool success, ) = recipient.call.value(amount)("");
Sources and more info:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With