forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ethereum#11763 from ethereum/basefee-hasOpcode
Allow basefee as Yul identifier for EVMVersion < london
- Loading branch information
Showing
7 changed files
with
53 additions
and
13 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
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
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
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
22 changes: 22 additions & 0 deletions
22
test/libsolidity/semanticTests/inlineAssembly/basefee_berlin_function.sol
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,22 @@ | ||
contract C { | ||
function f() public view returns (uint ret) { | ||
assembly { | ||
let basefee := sload(0) | ||
ret := basefee | ||
} | ||
} | ||
function g() public pure returns (uint ret) { | ||
assembly { | ||
function basefee() -> r { | ||
r := 1000 | ||
} | ||
ret := basefee() | ||
} | ||
} | ||
} | ||
// ==== | ||
// compileViaYul: also | ||
// EVMVersion: <=berlin | ||
// ---- | ||
// f() -> 0 | ||
// g() -> 1000 |
12 changes: 12 additions & 0 deletions
12
test/libsolidity/syntaxTests/inlineAssembly/basefee_reserved_london.sol
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,12 @@ | ||
contract C { | ||
function f() public view returns (uint ret) { | ||
assembly { | ||
let basefee := sload(0) | ||
ret := basefee | ||
} | ||
} | ||
} | ||
// ==== | ||
// EVMVersion: =london | ||
// ---- | ||
// ParserError 5568: (98-105): Cannot use builtin function name "basefee" as identifier name. |
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