Home > @3rdweb/sdk > ModuleWithRoles > grantRole
Call this to grant a role to a specific address.
Signature:
grantRole(role: Role, address: string): Promise<TransactionReceipt>;
Parameter | Type | Description |
---|---|---|
role | Role | The role to grant to the address |
address | string | The address to grant the role to |
Returns:
Promise<TransactionReceipt>
The transaction receipt
If you are trying to grant does not exist on the module this will throw an InvariantError.
Make sure you are sure you want to grant the role to the address.