mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			484 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			484 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
|     function f() public {
 | |
|         assert(false);
 | |
|     }
 | |
| 
 | |
|     function g(bool val) public returns (bool) {
 | |
|         assert(val == true);
 | |
|         return true;
 | |
|     }
 | |
| 
 | |
|     function h(bool val) public returns (bool) {
 | |
|         require(val);
 | |
|         return true;
 | |
|     }
 | |
| }
 | |
| 
 | |
| // ====
 | |
| // compileToEwasm: also
 | |
| // ----
 | |
| // f() -> FAILURE, hex"4e487b71", 0x01
 | |
| // g(bool): false -> FAILURE, hex"4e487b71", 0x01
 | |
| // g(bool): true -> true
 | |
| // h(bool): false -> FAILURE
 | |
| // h(bool): true -> true
 |