useSetAllRoleMembers

Overwrite the list of members for specific roles

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>
);
};

Parameters

Returns

A mutation object to overwrite all roles on the contract