Function useRevokeRole

  • Beta

    Revoke a role from a specific address

    Type Parameters

    • TContract extends ContractWithRoles

    Parameters

    • contract: RequiredParam<TContract>

      an instance of a SmartContract

    Returns UseMutationResult

    a mutation object that can be used to revoke a role from a member on the contract

    Example

    const Component = () => {
    const { contract } = useContract("{{contract_address}}");
    const {
    mutate: revokeRole,
    isLoading,
    error,
    } = useRevokeRole(contract);

    if (error) {
    console.error("failed to revoke role", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => revokeRole({ role: "admin", address: {{wallet_address}} })}
    >
    Revoke Role
    </button>
    );
    };

    Twfeature

    Permissions | PermissionsEnumerable

    See

    Documentation

Generated using TypeDoc