integration: add delegate call corner case test (#243)

Closes #235

---------

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2025-02-27 11:10:00 +01:00
committed by GitHub
parent 84deb3a29d
commit 296a226d0b
5 changed files with 415 additions and 371 deletions
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
/* runner.json
{
"differential": true,
"actions": [
{
"Instantiate": {
"code": {
"Solidity": {
"contract": "DelegateCaller"
}
}
}
},
{
"Call": {
"dest": {
"Instantiated": 0
},
"data": "e466c6c9"
}
}
]
}
*/
contract DelegateCaller {
function delegateNoContract() external returns (bool) {
address testAddress = 0x0000000000000000000000000000000000000000;
(bool success, ) = testAddress.delegatecall(
abi.encodeWithSignature("test()")
);
return success;
}
}
+1
View File
@@ -56,6 +56,7 @@ test_spec!(transfer, "Transfer", "Transfer.sol");
test_spec!(send, "Send", "Send.sol");
test_spec!(function_pointer, "FunctionPointer", "FunctionPointer.sol");
test_spec!(mload, "MLoad", "MLoad.sol");
test_spec!(delegate_no_contract, "DelegateCaller", "DelegateCaller.sol");
test_spec!(function_type, "FunctionType", "FunctionType.sol");
fn instantiate(path: &str, contract: &str) -> Vec<SpecsAction> {