mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
|     function f() view public {
 | |
|         address(this).transfer(1);
 | |
|     }
 | |
|     function g() view public {
 | |
|         require(address(this).send(2));
 | |
|     }
 | |
|     function h() view public {
 | |
|         selfdestruct(address(this));
 | |
|     }
 | |
|     function i() view public {
 | |
|         (bool success,) = address(this).delegatecall("");
 | |
|         require(success);
 | |
|     }
 | |
|     function j() view public {
 | |
|         (bool success,) = address(this).call("");
 | |
|         require(success);
 | |
|     }
 | |
|     receive() payable external {
 | |
|     }
 | |
| }
 | |
| // ----
 | |
| // TypeError 8961: (52-77): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 | |
| // TypeError 8961: (132-153): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 | |
| // TypeError 8961: (201-228): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 | |
| // TypeError 8961: (293-323): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 | |
| // TypeError 8961: (414-436): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
 |