Skip to content

Commit

Permalink
fix(eravm): resets return data after calling CREATE (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 authored Nov 22, 2024
1 parent 1d95d21 commit 9c80958
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
46 changes: 46 additions & 0 deletions solidity/simple/create/return_data_clear.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//! { "cases": [ {
//! "name": "default",
//! "inputs": [
//! {
//! "method": "main",
//! "calldata": []
//! }
//! ],
//! "expected": [
//! "0x60",
//! "0x00"
//! ]
//! } ] }

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

contract Qux {}

contract Bar {
function returnsSomething() public pure returns (bytes memory) {
return ("this is returned");
}
}

contract Test {
Bar bar;

constructor() {
bar = new Bar();
}

function main() public returns (uint256 returnsize1, uint256 returnsize2) {
address(bar).call(abi.encodeWithSelector(Bar.returnsSomething.selector));
assembly {
returnsize1 := returndatasize()
}

new Qux();

assembly {
returnsize2 := returndatasize()
}
}
}
3 changes: 1 addition & 2 deletions solidity/simple/error/default.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! {
//! "cases": [ {
//! { "cases": [ {
//! "name": "require_short",
//! "inputs": [
//! {
Expand Down

0 comments on commit 9c80958

Please sign in to comment.