IAUT_TokenGated_Roles_v1.sol
Last updated
Last updated
Inherits: IAuthorizer_v1
Checks if an account qualifies for a token-gated role.
Parameters
role
bytes32
The role to be checked.
who
address
The account to be checked.
Returns
<none>
bool
True if the account qualifies for the role.
Returns the threshold balance for a given token necessary to qualify for a specific role. If the value is 0, the supplied token is not part of the. role's token gating.
In case the queried role is not token gated, all calls will return 0.
Parameters
roleId
bytes32
The role to be checked on.
token
address
The token to check the threshold for.
Returns
<none>
uint256
The threshold amount necessary to qualify for a given token role.
Sets up a token-gated empty role.
This function is only callable by an active Module for itself. Admin should use setTokenGated()
.
Calling this function does not specify WHICH token to use for gating. That has to be done with 'grantTokenFromModule()'.
Parameters
role
bytes32
The role to be made token-gated.
One-step setup for Modules to create a token-gated role and set its threshold. Please be aware that using tokens that are transferable and have active markets could make the token-gated authorization vulnerable to flash loans, potentially bypassing. the authorization mechanism.
Parameters
role
bytes32
The role to be made token-gated.
token
address
The token for which the threshold will be set.
threshold
uint256
The minimum balance of the token required to qualify for the role.
Allows a Module to set the threshold of one of it's roles.
Parameters
role
bytes32
The token-gated role.
token
address
The token for which the threshold will be set.
threshold
uint256
The new minimum balance of the token required to qualify for the role.
Sets if a role is token-gated or not.
Admin access for rescue purposes. If the role has active members, they need to be reovked first.
Parameters
role
bytes32
The ID of the role to be modified.
to
bool
The new value to be set.
Sets the minimum threshold for a token-gated role.
This function does not validate the threshold. It is technically possible to set a threshold above the total supply of the token.
Parameters
roleId
bytes32
The ID of the role to be modified.
token
address
The token for which to the threshold.
threshold
uint256
The user will need to have at least this number to qualify for the role.
Event emitted when the token-gating of a role changes.
Parameters
role
bytes32
The role that was modified.
newValue
bool
The new value of the role.
Event emitted when the threshold of a token-gated role changes.
Parameters
role
bytes32
The role that was modified.
token
address
The token for which the threshold was modified.
newValue
uint256
The new value of the threshold.
The function is only callable by an active Module.
The function is only callable if the Module is self-managing its roles.
The token doesn't support balance query.
Parameters
token
address
The token address that is not supported.
The given threshold is invalid.
Parameters
threshold
uint256
The threshold that is not valid.
The role is token-gated but no threshold is set.
Parameters
role
bytes32
The role that doesnt have threshold.
token
address
The token for which the threshold was not set.