Skip to content

Instantly share code, notes, and snippets.

@casweeney
Forked from Realkayzee/LibCast.sol
Last active September 16, 2022 17:52
Show Gist options
  • Save casweeney/70b11daba1788a7593010926ecca3d59 to your computer and use it in GitHub Desktop.
Save casweeney/70b11daba1788a7593010926ecca3d59 to your computer and use it in GitHub Desktop.
uint256 constant SALARY=20000;
struct Workers{
uint8 count;
string name;
}
library Arithmetic{
function add(uint a,uint b) internal pure returns(uint){
return a+b;
}
function constructStruct(Workers storage w, uint8 _c,string memory _n,uint256 id,mapping(uint=>Workers) storage workers) internal {
w=workers[id];
w.count=_c;
w.name=_n;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment