Issue error for callvalue in nonpayable function

This commit is contained in:
Leonardo Alt
2019-03-19 20:45:27 +01:00
parent 11198cd76a
commit 9acec99c31
11 changed files with 73 additions and 6 deletions
@@ -0,0 +1,11 @@
contract C
{
function () external {
uint x;
assembly {
x := callvalue()
}
}
}
// ----
// TypeError: (92-103): "msg.value" and "callvalue()" can only be used in payable public functions. Make the function "payable" or use an internal function to avoid this error.