File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
semanticTests/inlineAssembly
syntaxTests/inlineAssembly Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,9 @@ bool EVMVersion::hasOpcode(Instruction _opcode) const
4646 return hasChainID ();
4747 case Instruction::SELFBALANCE:
4848 return hasSelfBalance ();
49+ case Instruction::BASEFEE:
50+ return hasBaseFee ();
4951 default :
5052 return true ;
5153 }
5254}
53-
Original file line number Diff line number Diff line change 1+ contract C {
2+ function f () public view returns (uint ret ) {
3+ assembly {
4+ let basefee := sload (0 )
5+ ret := basefee
6+ }
7+ }
8+ function g () public pure returns (uint ret ) {
9+ assembly {
10+ function basefee () -> r {
11+ r := 1000
12+ }
13+ ret := basefee ()
14+ }
15+ }
16+ }
17+ // ====
18+ // compileViaYul: also
19+ // EVMVersion: =berlin
20+ // ----
21+ // f() -> 0
22+ // g() -> 1000
Original file line number Diff line number Diff line change 1+ contract C {
2+ function f () public view returns (uint ret ) {
3+ assembly {
4+ let basefee := sload (0 )
5+ ret := basefee
6+ }
7+ }
8+ }
9+ // ====
10+ // EVMVersion: =london
11+ // ----
12+ // ParserError 5568: (98-105): Cannot use builtin function name "basefee" as identifier name.
You can’t perform that action at this time.
0 commit comments