Test ERC20 OutInstructions

This commit is contained in:
Luke Parker
2025-01-27 02:08:01 -05:00
parent 5164a710a2
commit e742a6b0ec
4 changed files with 83 additions and 27 deletions

View File

@@ -169,8 +169,14 @@ impl Router {
// Clear the existing return data
interpreter.return_data_buffer.clear();
// If calling an ERC20, trigger the return data's worst-case by returning `true`
// (as expected by compliant ERC20s)
/*
If calling an ERC20, trigger the return data's worst-case by returning `true`
(as expected by compliant ERC20s). Else return none, as we expect none or won't bother
copying/decoding the return data.
This doesn't affect calls to ecrecover as those use STATICCALL and this overrides CALL
alone.
*/
if Some(address_called) == erc20 {
interpreter.return_data_buffer = true.abi_encode().into();
}