mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			422 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			422 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| 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()
 | |
|         }
 | |
|     }
 | |
| }
 | |
| // ====
 | |
| // EVMVersion: <=berlin
 | |
| // ----
 | |
| // f() -> 0
 | |
| // g() -> 1000
 |