9060c474da
adds the following tests to itests/fevm_test.go: - recursive tests - delegate call tests - delegate call recursive tests - revert tests - destruct tests - contract deploy address tests - send value to contracts - gas limit on value transfer tests - sending value to destroyed contracts adds the test to itests/fevm_address_test.go: - deploy contract and confirm address is different second deploy
22 lines
644 B
Solidity
22 lines
644 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity >=0.8.17;
|
|
|
|
contract RecursiveDelegatecall {
|
|
event RecursiveCallEvent(uint256 count, address self);
|
|
uint256 public totalCalls;
|
|
|
|
function recursiveCall(uint256 count) public returns (uint256) {
|
|
emit RecursiveCallEvent(count, address(this));
|
|
totalCalls += 1;
|
|
if (count > 1) {
|
|
count -= 1;
|
|
(bool success, bytes memory returnedData) = address(this)
|
|
.delegatecall(
|
|
abi.encodeWithSignature("recursiveCall(uint256)", count)
|
|
);
|
|
return count;
|
|
}
|
|
return count;
|
|
}
|
|
}
|