'嗨,我把代码升级到了solidity 0.6.0;我有这样的错误:应为“(”,但得到的实性为“)”。
我想不通!
如果有人能帮我理解为什么会发生这种事。
函数如下:
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize)
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize, 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize) // error
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize) }
default { return(0, returndatasize) }
}
}
如果有人能弄明白的话!我一定要把完整的代码发出去吗?“
1条答案
按热度按时间l2osamch1#
Solidity 0.6中的Assembly要求所有函数调用都带括号,即使它们不接受任何参数。
例如,
calldatasize()
代替calldatasize
,returndatasize()
代替returndatasize
。