pub trait UpdateAuthBuilder {
    // Required methods
    fn mint_roles(self, mint_roles: Option<MintRoles<RoleDefinition>>) -> Self;
    fn burn_roles(self, burn_roles: Option<BurnRoles<RoleDefinition>>) -> Self;
    fn recall_roles(
        self,
        recall_roles: Option<RecallRoles<RoleDefinition>>
    ) -> Self;
    fn freeze_roles(
        self,
        freeze_roles: Option<FreezeRoles<RoleDefinition>>
    ) -> Self;
    fn withdraw_roles(
        self,
        withdraw_roles: Option<WithdrawRoles<RoleDefinition>>
    ) -> Self;
    fn deposit_roles(
        self,
        deposit_roles: Option<DepositRoles<RoleDefinition>>
    ) -> Self;
}

Required Methods§

source

fn mint_roles(self, mint_roles: Option<MintRoles<RoleDefinition>>) -> Self

Sets the resource to be mintable

  • The first parameter is the access rule which allows minting of the resource.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use radix_engine_interface::mint_roles;
use scrypto::prelude::*;

// Sets the resource to be mintable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .mint_roles(mint_roles! {
        minter => rule!(require(resource_address));
        minter_updater => rule!(deny_all);
    });

// Sets the resource to not be mintable, but this is can be changed in future by the second rule
ResourceBuilder::new_fungible(OwnerRole::None)
   .mint_roles(mint_roles! {
        minter => rule!(deny_all);
        minter_updater => rule!(require(resource_address));
   });
source

fn burn_roles(self, burn_roles: Option<BurnRoles<RoleDefinition>>) -> Self

Sets the resource to be burnable.

  • The first parameter is the access rule which allows minting of the resource.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use radix_engine_interface::burn_roles;
use scrypto::prelude::*;

// Sets the resource to be burnable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .burn_roles(burn_roles! {
       burner => rule!(require(resource_address));
       burner_updater => rule!(deny_all);
   });

// Sets the resource to be freely burnable, but this is can be changed in future by the second rule.
ResourceBuilder::new_fungible(OwnerRole::None)
   .burn_roles(burn_roles! {
       burner => rule!(allow_all);
       burner_updater => rule!(require(resource_address));
   });
source

fn recall_roles(self, recall_roles: Option<RecallRoles<RoleDefinition>>) -> Self

Sets the resource to be recallable from vaults.

  • The first parameter is the access rule which allows recalling of the resource.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use scrypto::prelude::*;

// Sets the resource to be recallable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .recall_roles(recall_roles! {
       recaller => rule!(require(resource_address));
       recaller_updater => rule!(deny_all);
   });

// Sets the resource to not be recallable, but this is can be changed in future by the second rule
ResourceBuilder::new_fungible(OwnerRole::None)
   .recall_roles(recall_roles! {
       recaller => rule!(deny_all);
       recaller_updater => rule!(require(resource_address));
   });
source

fn freeze_roles(self, freeze_roles: Option<FreezeRoles<RoleDefinition>>) -> Self

Sets the resource to have vaults be freezable.

  • The first parameter is the access rule which allows freezing of the vault.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use radix_engine_interface::freeze_roles;
use scrypto::prelude::*;

// Sets the resource to be freezeable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .freeze_roles(freeze_roles! {
       freezer => rule!(require(resource_address));
       freezer_updater => rule!(deny_all);
   });

// Sets the resource to not be freezeable, but this is can be changed in future by the second rule
ResourceBuilder::new_fungible(OwnerRole::None)
   .freeze_roles(freeze_roles! {
       freezer => rule!(deny_all);
       freezer_updater => rule!(require(resource_address));
   });
source

fn withdraw_roles( self, withdraw_roles: Option<WithdrawRoles<RoleDefinition>> ) -> Self

Sets the role rules of withdrawing from a vault of this resource.

  • The first parameter is the access rule which allows withdrawing from a vault.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use radix_engine_interface::withdraw_roles;
use scrypto::prelude::*;

// Sets the resource to be withdrawable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .withdraw_roles(withdraw_roles! {
       withdrawer => rule!(require(resource_address));
       withdrawer_updater => rule!(deny_all);
   });

// Sets the resource to not be withdrawable, but this is can be changed in future by the second rule
ResourceBuilder::new_fungible(OwnerRole::None)
   .withdraw_roles(withdraw_roles! {
       withdrawer => rule!(deny_all);
       withdrawer_updater => rule!(require(resource_address));
   });
source

fn deposit_roles( self, deposit_roles: Option<DepositRoles<RoleDefinition>> ) -> Self

Sets the roles rules of depositing this resource into a vault.

  • The first parameter is the access rule which allows depositing into a vault.
  • The second parameter is the mutability / access rule which controls if and how the access rule can be updated.
Examples
use scrypto::prelude::*;

// Sets the resource to be depositable with a proof of a specific resource, and this is locked forever.
ResourceBuilder::new_fungible(OwnerRole::None)
   .deposit_roles(deposit_roles! {
       depositor => rule!(require(resource_address));
       depositor_updater => rule!(deny_all);
   });

// Sets the resource to not be depositable, but this is can be changed in future by the second rule
ResourceBuilder::new_fungible(OwnerRole::None)
   .deposit_roles(deposit_roles! {
       depositor => rule!(deny_all);
       depositor_updater => rule!(require(resource_address));
   });

Implementors§