ContractRoles.grant() method
Call this to grant a role to a specific address.
Example
await contract.roles.grant(
"minter",
"0x1234567890123456789012345678901234567890",
);
Signature:
grant(role: TRole, address: string): Promise<TransactionResult>;
Parameters
Parameter | Type | Description |
---|---|---|
role | TRole | The Role to grant to the address |
address | string | The address to grant the role to |
Returns:
Promise<TransactionResult>
The transaction receipt
Exceptions
If you are trying to grant does not exist on the contract this will throw an error.
Remarks
Make sure you are sure you want to grant the role to the address.