call
delegatecall
staticcall
callcode
call
call
CALL
call
abi.encodeWithSignature
success
data
call
success
call
SafeERC20
delegatecall
delegatecall
delegatecall
msg.sender
msg.value
call
delegatecall
staticcall
staticcall
SSTORE
LOG
CREATE
view
pure
call
call
staticcall
staticcall
callcode
callcode
delegatecall
msg.sender
callcode
-
EVM 返回数据的存储与访问机制
returndata
returndatasize()
returndatacopy()
returndatasize()
returndatacopy()
returndatasize()
-
ABI 解码规则与异常处理
abi.decode()
uint256
address
string
bytes
uint256
bool
try/catch
returndata
uint256
returndatasize() == 32
try/catch
SafeERC20
-
返回数据截断攻击(Return Data Truncation)与防御
abi.decode()
transfer()
bool
true
transfer()
returndatasize() == 0
success
false
true
call
success
success
false
returndata
bool
returndatasize() == 32
OpenZeppelin.SafeERC20
safeTransfer
tx.origin
receive()
fallback()
fallback()
fallback()
fallback()
fallback
-
主流异常触发方式的核心特征
revert()
try/catch
require()
try/catch
assert()
try/catch
invalid
out-of-gas
try/catch
try/catch
revert()
require()
assert()
try/catch
try/catch
-
异常处理的安全原则
require()
assert()
catch
msg.sender
msg.value
msg.sender
msg.value
msg.sender
msg.sender
msg.sender
msg.sender
fallback()
fallback()
fallback()
msg.value
msg.value
receive()
fallback()
value
nonReentrant
msg.value
delegatecall
fallback
delegatecall
delegatecall
delegatecall
delegatecall
delegatecall
fallback
fallback()
fallback()
fallback
call
success
delegatecall
fallback

