What is the has()
function in Solidity?
struct Role {
mapping (address => bool) bearer;
}
function add(Role storage role, address account) internal {
require(account != address(0), "The account cannot be an uninitialized address");
require(!has(role, account)); // right here
role.bearer[account] = true;
}
Intuitively, I think it's determining whether the account
exists in role
or not and returning a boolean value, but can't seem to find the documentation.