Skip to main content

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

ParameterTypeDescription
roleTRoleThe Role to grant to the address
addressstringThe 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.