-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eravm): resets return data after calling CREATE (#62)
- Loading branch information
1 parent
1d95d21
commit 9c80958
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
//! { | ||
//! "cases": [ { | ||
//! { "cases": [ { | ||
//! "name": "require_short", | ||
//! "inputs": [ | ||
//! { | ||
|