mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			320 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			320 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
library Lib {
 | 
						|
    function foo(uint256 value) internal pure returns (uint256) {
 | 
						|
        return value + 42;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
contract A {
 | 
						|
    using Lib for uint256;
 | 
						|
}
 | 
						|
 | 
						|
contract B is A {
 | 
						|
    using Lib for uint256;
 | 
						|
    function bar(uint256 value) public pure returns (uint256) {
 | 
						|
        return value.foo(); // Usage of Lib
 | 
						|
    }
 | 
						|
}
 |