Function useSetAllRoleMembers

  • Beta

    Overwrite the list of members for specific roles

    Type Parameters

    • TContract extends ContractWithRoles

    Parameters

    • contract: RequiredParam<TContract>

      an instance of a SmartContract

    Returns UseMutationResult

    a mutation object that can be used to overwrite all roles on the contract

    Example

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

    if (error) {
    console.error("failed to overwrite roles", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => overwriteRoles({ rolesWithAddresses: { minter: ["{{wallet_address}"] } })}
    >
    Overwrite Roles
    </button>
    );
    };

    Twfeature

    Permissions

Generated using TypeDoc