Put it in this repo and others
Ideally you should start using subrepos in git to avoid maintaining multiple versions of libraries and shared classes. Google the github tutorials and learn to do that!!
It would be like this:
const METHOD_HASROLEPACKED = 0xabcdef; // takes uint8 roleCount, followed by uint256 up to 32 roles
struct Whitelist
{
address contract, // 160
uint16 method, // 16
uint8 roleCount // 8
bytes8 roles // up to 8 roles here
}
Whitelist public whitelist;
function whitelisted(address) public view returns (bool) {
if (whitelist.roleCount == 0) {
result = call(abi.encodeWithParams(whitelist.contract, whitelist.method), address)
} else {
result = call(abi.encodeWithParams(whitelist.contract, METHOD_HASROLEPACKED), address, whitelist.roleCount, whitelist.roles);
}
if error revert(exact error)
else return result
}
also please implement the following in CommunityContract:
Make a mixin class so people can do
class Foo is Bar, Whitelist
Put it in this repo and others Ideally you should start using subrepos in git to avoid maintaining multiple versions of libraries and shared classes. Google the github tutorials and learn to do that!!
It would be like this:
also please implement the following in CommunityContract: