Created
April 4, 2023 20:33
-
-
Save amarachiugwu/f1dfdab8f8663fe5d69b018b99da0ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity 0.8.9; | |
| library MathLibrary { | |
| function add(uint a, uint b) external pure returns(uint){ | |
| return a + b; | |
| } | |
| } | |
| contract A { | |
| uint _a = 20; | |
| function getA() public view returns (uint){ | |
| return _a; | |
| } | |
| function getSumA(uint a, uint b) public pure returns (uint sum){ | |
| sum = MathLibrary.add(a, b); | |
| } | |
| } | |
| contract B { | |
| function getSumB(uint a, uint b) public pure returns (uint sum){ | |
| sum = MathLibrary.add(a, b); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment