mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			215 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			215 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
|     function getOne() public payable nonFree returns (uint256 r) {
 | |
|         return 1;
 | |
|     }
 | |
| 
 | |
|     modifier nonFree {
 | |
|         if (msg.value > 0) _;
 | |
|     }
 | |
| }
 | |
| // ----
 | |
| // getOne() -> 0
 | |
| // getOne(), 1 wei -> 1
 |