Transaction Manifest Specifications

Grammar

Radix transaction manifest adopts a bash-like grammar. Each manifest consists of a sequence of instructions, each of which contains.

  • A command for the type of operation;

  • A variable number of arguments;

  • A semicolon.

Instruction List

The table below shows all the instructions that all currently supported by Radix Engine.

Instruction Example

TAKE_FROM_WORKTOP

Takes the entirety of resource from the worktop and creates a bucket.

TAKE_FROM_WORKTOP
    Address("foo")
    Decimal("1.0")
    Bucket("xrd_bucket");

TAKE_NON_FUNGIBLES_FROM_WORKTOP

Takes some non-fungibles from the worktop and creates a bucket.

TAKE_NON_FUNGIBLES_FROM_WORKTOP
    Array<NonFungibleLocalId>(NonFungibleLocalId(1u32), NonFungibleLocalId(2u32))
    Address("foo")
    Bucket("xrd_bucket");

TAKE_ALL_FROM_WORKTOP

Takes all resource from the worktop and creates a bucket.

TAKE_ALL_FROM_WORKTOP
    Address("foo")
    Bucket("xrd_bucket");

RETURN_TO_WORKTOP

Returns a bucket to the worktop.

RETURN_TO_WORKTOP
    Bucket("xrd_bucket");

ASSERT_WORKTOP_CONTAINS

Verifies that the worktop contains non-zero amount of the resource, else aborts the transaction.

ASSERT_WORKTOP_CONTAINS
    Address("foo")
    Decimal("1.0");

ASSERT_WORKTOP_CONTAINS_NON_FUNGIBLES

Verifies that the worktop contains the specified non-fungibles, else aborts the transaction.

ASSERT_WORKTOP_CONTAINS_NON_FUNGIBLES
    Address("foo");
    Array<NonFungibleLocalId>(NonFungibleLocalId("#1#"), NonFungibleLocalId("#2#"))

ASSERT_WORKTOP_CONTAINS_ANY
Verifies that the worktop contains the specified fungible resource of any amount greater than 1.

ASSERT_WORKTOP_CONTAINS_ANY
  Address("${gumball_resource_address}");

POP_FROM_AUTH_ZONE

Pops the most recent proof from the auth zone.

POP_FROM_AUTH_ZONE
    Proof("proof");

PUSH_TO_AUTH_ZONE

Pushes a proof to the auth zone.

PUSH_TO_AUTH_ZONE
    Proof("proof");

CLEAR_AUTH_ZONE

Removes all proofs present on the auth zone.

CLEAR_AUTH_ZONE;

DROP_ALL_PROOFS

+ Removes all named proofs in the call frame, and then calls CLEAR_AUTH_ZONE.

DROP_ALL_PROOFS;

CLEAR_SIGNATURE_PROOFS

Removes all signature proofs in the auth zone.

CLEAR_SIGNATURE_PROOFS;

CREATE_PROOF_FROM_AUTH_ZONE_OF_AMOUNT

Creates a proof of some amount of resource from the auth zone.

CREATE_PROOF_FROM_AUTH_ZONE_OF_AMOUNT
    Address("foo")
    Decimal("1.0")
    Proof("proof");

CREATE_PROOF_FROM_AUTH_ZONE_OF_NON_FUNGIBLES

Creates a proof of some non-fungibles from the auth zone.

CREATE_PROOF_FROM_AUTH_ZONE_OF_NON_FUNGIBLES
  Address("${non_fungible_resource_address}")
  Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"))
  Proof("proof");

CREATE_PROOF_FROM_AUTH_ZONE_OF_ALL

CREATE_PROOF_FROM_AUTH_ZONE_OF_ALL
    Address("foo")
    Proof("proof");

CREATE_PROOF_FROM_BUCKET_OF_AMOUNT

CREATE_PROOF_FROM_BUCKET_OF_AMOUNT
    Bucket("bucket")
    Decimal("1.0")
    Proof("proof")

CREATE_PROOF_FROM_BUCKET_OF_NON_FUNGIBLES

CREATE_PROOF_FROM_BUCKET_OF_NON_FUNGIBLES
    Bucket("some_xrd")
    Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"))
    Proof("proof1b");

CREATE_PROOF_FROM_BUCKET_OF_ALL

CREATE_PROOF_FROM_BUCKET_OF_ALL
    Bucket("bucket")
    Proof("proof");

CLONE_PROOF

Clones a proof.

CLONE_PROOF
    Proof("proof")
    Proof("cloned_proof");

CALL_FUNCTION

Invokes a function on a blueprint.

CALL_FUNCTION
    Address("package_address")
    "BlueprintName"
    "function_name"
    "string_arg";

CALL_METHOD

Invokes a method on a component.

CALL_METHOD
    Address("gumball_machine")
    "refill"
    Bucket("withdraw_xrd")
    Proof("admin_auth")
    "hello"
    Decimal("1.2");

ALLOCATE_GLOBAL_ADDRESS

[source, bash] ---- ALLOCATE_GLOBAL_ADDRESS Address("package_address") "Package" AddressReservation("my_reservation") NamedAddress("my_package"); ----

PUBLISH_PACKAGE_ADVANCED

# Publishing a new package and setting some of its royalty and access rules.
PUBLISH_PACKAGE_ADVANCED
    Enum<AccessRule::AllowAll>() # Owner AccessRule
    Tuple(                       # Package Definition
        Map<String, Tuple>()
    )
    Blob("${code_blob_hash}")    # Package Code
    Map<String, Tuple>()         # Metadata
    None;                        # Address Reservation

BURN_RESOURCE

Burns a bucket of resource in the worktop.

BURN_RESOURCE
  Bucket("xrd_bucket");

SET_METADATA

Sets the metadata of a global entity.

# Set String Metadata on Package
SET_METADATA
    Address("${package_address}")
    "field_name"
    # "Metadata::String" is equivalent to 0u8
    Enum<Metadata::String>(
        "Metadata string value, eg description"
    );

# Set String Metadata on Account component
SET_METADATA
    Address("${account_address}")
    "field_name"
    # "Metadata::String" is equivalent to 0u8
    Enum<Metadata::String>(
        "Metadata string value, eg description"
    );

# Set String Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::String" is equivalent to 0u8
    Enum<Metadata::String>(
        "Metadata string value, eg description"
    );

# Set Bool Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Bool" is equivalent to 1u8
    Enum<Metadata::Bool>(
        true
    );

# Set u8 Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::U8" is equivalent to 2u8
    Enum<Metadata::U8>(
        123u8
    );

# Set u32 Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::U32" is equivalent to 3u8
    Enum<Metadata::U32>(
        123u32
    );

# Set u64 Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::U64" is equivalent to 4u8
    Enum<Metadata::U64>(
        123u64
    );

# Set i32 Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::I32" is equivalent to 5u8
    Enum<Metadata::I32>(
        -123i32
    );

# Set i64 Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::I64" is equivalent to 6u8
    Enum<Metadata::I64>(
        -123i64
    );

# Set Decimal Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Decimal" is equivalent to 7u8
    Enum<Metadata::Decimal>( # Single item
        Decimal("10.5")
    );

# Set Address Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Address" is equivalent to 8u8
    Enum<Metadata::Address>(
        Address("${account_address}")
    );

# Set Public Key Metadata on Resource
# NOTE: Also see "PublicKeyHash" further down
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::PublicKey" is equivalent to 9u8
    Enum<Metadata::PublicKey>(
        Enum<PublicKey::Secp256k1>( # 0u8 = Secp256k1, 1u8 = Ed25519
            # Hex-encoded canonical-Radix encoding of the public key
            Bytes("0000000000000000000000000000000000000000000000000000000000000000ff")
        )
    );

# Set NonFungibleGlobalId Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::NonFungibleGlobalId" is equivalent to 10u8
    Enum<Metadata::NonFungibleGlobalId>(
        NonFungibleGlobalId("${non_fungible_resource_address}:<some_string>")
    );

# Set NonFungibleLocalId Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::NonFungibleLocalId" is equivalent to 11u8
    Enum<Metadata::NonFungibleLocalId>(
        NonFungibleLocalId("<some_string>")
    );

# Set Instant (or the value in seconds since unix epoch) Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Instant" is equivalent to 12u8
    Enum<Metadata::Instant>(
        # Value in seconds since Unix Epoch
        10000i64
    );

# Set Url Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Url" is equivalent to 13u8
    Enum<Metadata::Url>( # Single item
        "https://radixdlt.com/index.html"
    );

# Set Origin Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::Origin" is equivalent to 14u8
    Enum<Metadata::Origin>(
        "https://radixdlt.com"
    );

# Set PublicKeyHash Metadata on Resource
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::PublicKeyHash" is equivalent to 15u8
    Enum<Metadata::PublicKeyHash>(
        Enum<PublicKeyHash::Secp256k1>( # 0u8 = Secp256k1, 1u8 = Ed25519
            # The hex-encoded final 29 bytes of the Blake2b-256 hash of the public key bytes (in the canonical Radix encoding)
            Bytes("0000000000000000000000000000000000000000000000000000000000")
        )
    );

# Setting list-based metadata:
# ============================
# If using enum discriminator aliases: Take "Metadata::X" and add Array to the end, eg "Metadata::XArray"
# If using u8 enum discriminators: Add 128 to the single values
#
# Then just make the content an Array<X>.
#
# For example, for strings:
SET_METADATA
    Address("${resource_address}")
    "field_name"
    # "Metadata::StringArray" is equivalent to 128u8
    Enum<Metadata::StringArray>(
        Array<String>(
            "some_string",
            "another_string",
            "yet_another_string"
        )
    );

LOCK_METADATA

Locks the metadata field value of a global entity from being updated.

LOCK_METADATA
    Address("${package_address}")
    "field_name";

LOCK_METADATA
    Address("${account_address}")
    "field_name";

LOCK_METADATA
    Address("${resource_address}")
    "field_name";

REMOVE_METADATA
    Address("${package_address}")
    "field_name";

REMOVE_METADATA
    Address("${account_address}")
    "field_name";

REMOVE_METADATA
    Address("${resource_address}")
    "field_name";

REMOVE_METADATA
Removes the metadata key and value of a global entity.

REMOVE_METADATA
    Address("${package_address}")
    "field_name";

REMOVE_METADATA
    Address("${account_address}")
    "field_name";

REMOVE_METADATA
    Address("${resource_address}")
    "field_name";

MINT_FUNGIBLE

Mints a fungible resource and deposits it on the worktop.

MINT_FUNGIBLE
    Address("foo")
    Decimal("1.0");

MINT_NON_FUNGIBLE

Mint a non-fungible resource and deposit it on the worktop.

# This non-fungible token has no data
MINT_NON_FUNGIBLE
    Address("${mintable_non_fungible_resource_address}")
    Map<NonFungibleLocalId, Tuple>(
        NonFungibleLocalId("${non_fungible_local_id}") => Tuple(Tuple())
    );

MINT_RUID_NON_FUNGIBLE

Mint non-fungible resource with a random Radix Unique IDentifier (RUID). Using this instruction, you only have to provide the data. A random UUID will be attached to each entry.

MINT_RUID_NON_FUNGIBLE
    Address("foo")
    Array<Tuple>(
        Tuple(
            Tuple("Hello World", Decimal("12")), # The immutable part of the data
            Tuple(12u8, 19u128)  # The mutable part of the data
        )
    );

CREATE_FUNGIBLE_RESOURCE

Create a fungible resource and deposit it on the worktop.

# Creating a new resource with a divisibility of 18 and a name of `MyResource`. The resource has
# default resource behavior where it can be withdrawn and deposited by anybody.
CREATE_FUNGIBLE_RESOURCE
    # Owner role - This gets metadata permissions, and is the default for other permissions
    # Can set as Enum<OwnerRole::Fixed>(access_rule)  or Enum<OwnerRole::Updatable>(access_rule)
    Enum<OwnerRole::None>()
    true             # Whether the engine should track supply (avoid for massively parallelizable tokens)
    18u8             # Divisibility (between 0u8 and 18u8)
    Tuple(
        Some(         # Mint Roles (if None: defaults to DenyAll, DenyAll)
            Tuple(
                Some(Enum<AccessRule::AllowAll>()),  # Minter (if None: defaults to Owner)
                Some(Enum<AccessRule::DenyAll>())    # Minter Updater (if None: defaults to Owner)
            )
        ),
        None,        # Burn Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Freeze Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Recall Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Withdraw Roles (if None: defaults to AllowAll, DenyAll)
        None         # Deposit Roles (if None: defaults to AllowAll, DenyAll)
    )
    Tuple(                                                                   # Metadata initialization
        Map<String, Tuple>(                                                  # Initial metadata values
            "name" => Tuple(
                Some(Enum<Metadata::String>("MyResource")),                  # Resource Name
                true                                                         # Locked
            )
        ),
        Map<String, Enum>(                                                   # Metadata roles
            "metadata_setter" => Some(Enum<AccessRule::AllowAll>()),         # Metadata setter role
            "metadata_setter_updater" => None,                               # Metadata setter updater role as None defaults to OWNER
            "metadata_locker" => Some(Enum<AccessRule::DenyAll>()),          # Metadata locker role
            "metadata_locker_updater" => None                                # Metadata locker updater role as None defaults to OWNER
        )
    )
    None;                                                                    # No Address Reservation

CREATE_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY

Create a resource with a specified badge for authorization.

# Creating a new resource with a divisibility of 18 and a name of `MyResource`. The resource has
# default resource behavior where it can be withdrawn and deposited by anybody.
CREATE_FUNGIBLE_RESOURCE
    # Owner role - This gets metadata permissions, and is the default for other permissions
    # Can set as Enum<OwnerRole::Fixed>(access_rule)  or Enum<OwnerRole::Updatable>(access_rule)
    Enum<OwnerRole::None>()
    true             # Whether the engine should track supply (avoid for massively parallelizable tokens)
    18u8             # Divisibility (between 0u8 and 18u8)
    Tuple(
        Some(         # Mint Roles (if None: defaults to DenyAll, DenyAll)
            Tuple(
                Some(Enum<AccessRule::AllowAll>()),  # Minter (if None: defaults to Owner)
                Some(Enum<AccessRule::DenyAll>())    # Minter Updater (if None: defaults to Owner)
            )
        ),
        None,        # Burn Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Freeze Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Recall Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Withdraw Roles (if None: defaults to AllowAll, DenyAll)
        None         # Deposit Roles (if None: defaults to AllowAll, DenyAll)
    )
    Tuple(                                                                   # Metadata initialization
        Map<String, Tuple>(                                                  # Initial metadata values
            "name" => Tuple(
                Some(Enum<Metadata::String>("MyResource")),                  # Resource Name
                true                                                         # Locked
            )
        ),
        Map<String, Enum>(                                                   # Metadata roles
            "metadata_setter" => Some(Enum<AccessRule::AllowAll>()),         # Metadata setter role
            "metadata_setter_updater" => None,                               # Metadata setter updater role as None defaults to OWNER
            "metadata_locker" => Some(Enum<AccessRule::DenyAll>()),          # Metadata locker role
            "metadata_locker_updater" => None                                # Metadata locker updater role as None defaults to OWNER
        )
    )
    None;                                                                    # No Address Reservation

CREATE_NON_FUNGIBLE_RESOURCE

Create a non-fungible resource from the worktop.

# Creating a new resource
CREATE_NON_FUNGIBLE_RESOURCE
    # Owner role - This gets metadata permissions, and is the default for other permissions
    # Can set as Enum<OwnerRole::Fixed>(access_rule)  or Enum<OwnerRole::Updatable>(access_rule)
    Enum<OwnerRole::None>()
    Enum<NonFungibleIdType::Integer>()                                                                  # The type of NonFungible Id
    true                                                                                                # Whether the engine should track supply (avoid for massively parallelizable tokens)
    Tuple(Tuple(Array<Enum>(), Array<Tuple>(), Array<Enum>()), Enum<0u8>(66u8), Array<String>())        # Non Fungible Data Schema
    Tuple(
        Some(         # Mint Roles (if None: defaults to DenyAll, DenyAll)
            Tuple(
                Some(Enum<AccessRule::AllowAll>()),  # Minter (if None: defaults to Owner)
                Some(Enum<AccessRule::DenyAll>())    # Minter Updater (if None: defaults to Owner)
            )
        ),
        None,        # Burn Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Freeze Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Recall Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Withdraw Roles (if None: defaults to AllowAll, DenyAll)
        None,        # Deposit Roles (if None: defaults to AllowAll, DenyAll)
        None         # Non Fungible Data Update Roles (if None: defaults to DenyAll, DenyAll)
    )
    Tuple(                                                                   # Metadata initialization
        Map<String, Tuple>(                                                  # Initial metadata values
            "name" => Tuple(
                Some(Enum<Metadata::String>("MyResource")),                  # Resource Name
                true                                                         # Locked
            )
        ),
        Map<String, Enum>(                                                   # Metadata roles
            "metadata_setter" => Some(Enum<AccessRule::AllowAll>()),         # Metadata setter role
            "metadata_setter_updater" => None,                               # Metadata setter updater role as None defaults to OWNER
            "metadata_locker" => Some(Enum<AccessRule::DenyAll>()),          # Metadata locker role
            "metadata_locker_updater" => None                                # Metadata locker updater role as None defaults to OWNER
        )
    )
    None;                                                                    # No Address Reservation

CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY

Create a non-fungible resource with a specified badge for authorization.

# Creating a new resource
CREATE_NON_FUNGIBLE_RESOURCE
    # Owner role - This gets metadata permissions, and is the default for other permissions
    # Can set as Enum<OwnerRole::Fixed>(access_rule)  or Enum<OwnerRole::Updatable>(access_rule)
    Enum<OwnerRole::None>()
    Enum<NonFungibleIdType::Integer>()                                                                  # The type of NonFungible Id
    true                                                                                                # Whether the engine should track supply (avoid for massively parallelizable tokens)
    Tuple(Tuple(Array<Enum>(), Array<Tuple>(), Array<Enum>()), Enum<0u8>(66u8), Array<String>())        # Non Fungible Data Schema
    Tuple(
        Some(         # Mint Roles (if None: defaults to DenyAll, DenyAll)
            Tuple(
                Some(Enum<AccessRule::AllowAll>()),  # Minter (if None: defaults to Owner)
                Some(Enum<AccessRule::DenyAll>())    # Minter Updater (if None: defaults to Owner)
            )
        ),
        None,        # Burn Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Freeze Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Recall Roles (if None: defaults to DenyAll, DenyAll)
        None,        # Withdraw Roles (if None: defaults to AllowAll, DenyAll)
        None,        # Deposit Roles (if None: defaults to AllowAll, DenyAll)
        None         # Non Fungible Data Update Roles (if None: defaults to DenyAll, DenyAll)
    )
    Tuple(                                                                   # Metadata initialization
        Map<String, Tuple>(                                                  # Initial metadata values
            "name" => Tuple(
                Some(Enum<Metadata::String>("MyResource")),                  # Resource Name
                true                                                         # Locked
            )
        ),
        Map<String, Enum>(                                                   # Metadata roles
            "metadata_setter" => Some(Enum<AccessRule::AllowAll>()),         # Metadata setter role
            "metadata_setter_updater" => None,                               # Metadata setter updater role as None defaults to OWNER
            "metadata_locker" => Some(Enum<AccessRule::DenyAll>()),          # Metadata locker role
            "metadata_locker_updater" => None                                # Metadata locker updater role as None defaults to OWNER
        )
    )
    None;                                                                    # No Address Reservation

RECALL

Recalls a fungible resource from a vault (if the resource has a recallable behavior).

RECALL_FROM_VAULT Address("${vault_address}") Decimal("1.2");

RECALL_NON_FUNGIBLE
Recalls a non-fungible resource from a vault (if the resource has a recallable behavior).

RECALL_NON_FUNGIBLES_FROM_VAULT Address("${vault_address}") Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"), NonFungibleLocalId("#456#"));

FREEZE_VAULT
FREEZE_VAULT manifest instruction has several configurations:

  • Freeze withdraws of a Vault.

  • Freeze deposits of a Vault.

  • Freeze resource burns of a Vault.

  • Freeze withdraws/deposits/burn resource(s) of a `Vault.

# Freeze Withdraws from a vault
FREEZE_VAULT Address("${vault_address}") Tuple(1u32);

# Freeze Deposits into a vault
FREEZE_VAULT Address("${vault_address}") Tuple(2u32);

# Freeze Burns in a vault
FREEZE_VAULT Address("${vault_address}") Tuple(4u32);

# Freeze Withdraws/Deposits/Burns of a vault
FREEZE_VAULT Address("${vault_address}") Tuple(7u32);

UNFREEZE_VAULT
UNFREEZE_VAULT manifest instruction has several configurations:

  • Unfreeze withdraws of a Vault.

  • Unfreeze deposits of a Vault.

  • Unfreeze resource burns of a Vault.

  • Unfreeze withdraws/deposits/burn resource(s) of a `Vault.

# Unfreeze Withdraws from a vault
UNFREEZE_VAULT Address("${vault_address}") Tuple(1u32);

# Unfreeze Deposits into a vault
UNFREEZE_VAULT Address("${vault_address}") Tuple(2u32);

# Unfreeze Burns in a vault
UNFREEZE_VAULT Address("${vault_address}") Tuple(4u32);

# Unfreeze Withdraws/Deposits/Burns of a vault
UNFREEZE_VAULT Address("${vault_address}") Tuple(7u32);

SET_OWNER_ROLE
Sets an OwnerRole configuration of a global entity.

SET_OWNER_ROLE
    Address("${resource_address}")
    Enum<OwnerRole::None>(); # The rule associated with the role

LOCK_OWNER_ROLE
Locks an OwnerRole configuration of a global entity.

LOCK_OWNER_ROLE
    Address("${resource_address}");

SET_ROLE
Sets role configuration of a global entity.

SET_ROLE
    Address("${resource_address}")
    Enum<0u8>()
    "hello"      # The name of the role to update the access rule for.
    Enum<0u8>(); # The rule associated with the role
UPDATE_ROLE
    Address("resource_address")
    Enum<0u8>()
    "hello"     # The name of the role to update the access rule for.
    None        # The rule associated with the role, can either be Some `AccessRule` or none.
    None;       # The mutability of the role, `None` means that its immutable while `Some` means that it's mutable.

CREATE_ACCESS_CONTROLLER

Create an access controller native component.

TAKE_ALL_FROM_WORKTOP
    Address("${badge_resource_address}")
    Bucket("some_xrd");

CREATE_ACCESS_CONTROLLER
    Bucket("some_xrd")
    Tuple(
        Enum<AccessRule::DenyAll>(),
        Enum<AccessRule::DenyAll>(),
        Enum<AccessRule::DenyAll>()
    )
    None;

SET_COMPONENT_ROYALTY

Sets the royalty configuration on a component.

SET_COMPONENT_ROYALTY
    Address("${account_address}")
    "my_method"
    Enum<RoyaltyAmount::Free>();

LOCK_COMPONENT_ROYALTY
Locks the royalty configuration on a component.

LOCK_COMPONENT_ROYALTY
    Address("${account_address}")
    "my_method";

CLAIM_PACKAGE_ROYALTIES

Claims royalty on an owned package

CLAIM_PACKAGE_ROYALTIES
    Address("package_address");

CLAIM_COMPONENT_ROYALTIES

Claims royalty on an owned component.

CLAIM_COMPONENT_ROYALTIES
    Address("component_address");

CREATE_ACCOUNT

Create a native account component.

CREATE_ACCOUNT;

CREATE_ACCOUNT_ADVANCED

Create a native account component with an OwnerRole configuration.

CREATE_ACCOUNT_ADVANCED
    Enum<OwnerRole::Updatable>(
        Enum<AccessRule::AllowAll>()
    );

CREATE_IDENTITY

Create a native Identity component.

CREATE_IDENTITY;

CREATE_IDENTITY_ADVANCED

Create a native Identity component with an OwnerRole configuration.

CREATE_IDENTITY_ADVANCED
    Enum<OwnerRole::None>();

CREATE_VALIDATOR

Create a native validator component.

Value Types

In Radix transaction manifest, all arguments are strongly typed. Below are all the types that are currently supported.

Type Example

Unit

()

Bool

true
false

I8, I16, I32, I64, I128

5i8
-412i32
12345678i128

U8, U16, U32, U64, U128

5u8
412u32
12345678u128

String

"I like \"quoted message\"!\n"

Enum

If you want to reference the MouseMove (index 1) variant in this enum:

#[scrypto(ScryptoSbor)]
pub enum Event {
    PageLoad,
    MouseMove(u32, u32),
    KeyPress(String)
}

You would write this in your transaction manifest:
Enum(1u8, 320u32, 480u32)

Tuple

If you want to reference a structure or tuple:

#[derive(ScryptoSbor)]
pub struct Student {
    id: u64,
    name: String,
}

(u64, String)

You would write this in your transaction manifest: Tuple(55u64, "David")

Array

Array<String>("foo", "bar")

Map

Map<U8, U16>(1u8 ⇒ 5u16)
You can also nest Map:

Map<String, Tuple>(
    "Blueprint",
    Tuple(
        Map<String, U32>(
            "method", 1u32
        ),
        0u32
    )
);

AddressReservation

AddressReservation("address_reservation")

NamedAddress

NamedAddress("my_package")

PackageAddress

Address("package_address")

ComponentAddress

Address("account_address")

ResourceAddress

Address("resource_address")

Bucket

For named bucket, Bucket("my_awesome_xrd_bucket").
For unnamed bucket, Bucket(5u32)

Proof

For named proof, Proof("auth").
For unnamed proof, Proof(100u32)

Expression

Expression("ENTIRE_WORKTOP")
Expression("ENTIRE_AUTH_ZONE")

Blob

Blob("<sha256_hash_of_the_blob_contents>")

NonFungibleGlobalId

  • NonFungibleGlobalId("${non_fungible_resource_address}:<value>")

  • NonFungibleGlobalId("${non_fungible_resource_address}:#123#")

  • NonFungibleGlobalId("${non_fungible_resource_address}:#456#")

  • NonFungibleGlobalId("${non_fungible_resource_address}:[031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f]")

  • NonFungibleGlobalId("${non_fungible_resource_address}:#1234567890#")

  • Tuple(Address("${non_fungible_resource_address}"), NonFungibleLocalId("1"))

Hash

Hash("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824")

Bytes

Bytes("deadbeef")

Decimal

Decimal("-123.456")

PreciseDecimal

PreciseDecimal("1231232342342.123213123123")

NonFungibleLocalId

  • NonFungibleLocalId("<SomeId>")

  • NonFungibleLocalId("12")

  • NonFungibleLocalId("[031b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f]")

  • NonFungibleLocalId("{43968a72-5954-45da-9678-8659dd399faa}")

Expressions

At the moment, two expressions are available. Expression("ENTIRE_WORKTOP") takes all resources present on the worktop and puts them in a vector of buckets that can then be used as an argument. Expression("ENTIRE_AUTH_ZONE") works similarly but with proofs present on the AuthZone.

Named buckets

Buckets and proofs created in manifest can be referred by name.

To create a named bucket and use it for method call,

TAKE_FROM_WORKTOP
    Address("[resource_address]")
    Decimal("1.0")
    Bucket("my_bucket");
CALL_METHOD
    Address("[resource_address]")
    "deposit"
    Bucket("my_bucket");

Named proofs

There are multiple ways to create a named proof to pass it by intent to a method.

Most of the times, this is the syntax you would use:

# Lock fees
CALL_METHOD
  Address("[your_account_address]")
  "lock_fee"
  Decimal("10");

# Create a proof of a badge on your account. The "create_proof_of_amount" method returns a Proof to the authzone.
CALL_METHOD
  Address("[your_account_address]")
  "create_proof_of_amount"
  Address("[badge_address]")
  Decimal("1");

# Get a named proof from the last proof to have been inserted in the authzone.
POP_FROM_AUTH_ZONE Proof("my_proof");

# You can now pass this proof to a method/function

You can also create a proof from a bucket:

# Lock fees
CALL_METHOD
  Address("[your_account_address]")
  "lock_fee"
  Decimal("10");

CALL_METHOD
  Address("[your_account_address]")
  "withdraw"
  Address("[xrd_address]")
  Decimal("10") ;

TAKE_FROM_WORKTOP
  Address("[xrd_address]")
  Decimal("10")
  Bucket("my_bucket");

# Create a proof from the bucket
CREATE_PROOF_FROM_BUCKET_OF_ALL
  Bucket("my_bucket")
  Proof("my_proof");

# You can now pass this proof to a method/function

# Because we withdrew tokens from our account and they are still on the
# worktop, we have to deposit them back into your account
CALL_METHOD
  Address("[your_account_address]")
  "deposit_batch"
  Expression("ENTIRE_WORKTOP");