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
35 lines
873 B
Solidity
35 lines
873 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.17;
|
|
|
|
contract GasLimitTest {
|
|
address payable receiver;
|
|
constructor(){
|
|
address mynew = address(new GasLimitTestReceiver());
|
|
receiver = payable(mynew);
|
|
}
|
|
function send() public payable{
|
|
receiver.transfer(msg.value);
|
|
}
|
|
function expensiveTest() public{
|
|
GasLimitTestReceiver(receiver).expensive();
|
|
}
|
|
function getDataLength() public returns (uint256) {
|
|
return GasLimitTestReceiver(receiver).getDataLength();
|
|
}
|
|
}
|
|
|
|
contract GasLimitTestReceiver {
|
|
uint256[] public data;
|
|
fallback() external payable {
|
|
expensive();
|
|
}
|
|
function expensive() public{
|
|
for (uint256 i = 0; i < 100; i++) {
|
|
data.push(i);
|
|
}
|
|
}
|
|
function getDataLength() public view returns (uint256) {
|
|
return data.length;
|
|
}
|
|
}
|