Skip to content

Instantly share code, notes, and snippets.

@amarachiugwu
Created April 4, 2023 20:33
Show Gist options
  • Select an option

  • Save amarachiugwu/f1dfdab8f8663fe5d69b018b99da0ca8 to your computer and use it in GitHub Desktop.

Select an option

Save amarachiugwu/f1dfdab8f8663fe5d69b018b99da0ca8 to your computer and use it in GitHub Desktop.
// 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