Skip to content

Instantly share code, notes, and snippets.

@Realkayzee
Created August 11, 2022 05:44
Show Gist options
  • Save Realkayzee/1947ebdd83dbfc3dfd64ab6f541bc02f to your computer and use it in GitHub Desktop.
Save Realkayzee/1947ebdd83dbfc3dfd64ab6f541bc02f 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