- 07 Mar 2024
- 13 Minutes to read
- DarkLight
- PDF
Manifest Instructions
- Updated on 07 Mar 2024
- 13 Minutes to read
- DarkLight
- PDF
Notes
Addresses on this page are based on the
simulator
network definition.All examples should be compilable, using the
rtmc
CLI. If you spot a broken example, please reach out to the support team on Discord.
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.
TAKE_FROM_WORKTOP
TAKE_FROM_WORKTOP
Takes the entirety of resource from the worktop and creates a bucket.
Example
TAKE_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1.0")
Bucket("xrd_bucket")
;
TAKE_NON_FUNGIBLES_FROM_WORKTOP
TAKE_NON_FUNGIBLES_FROM_WORKTOP
Takes some non-fungibles from the worktop and creates a bucket.
Example
TAKE_NON_FUNGIBLES_FROM_WORKTOP
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Array<NonFungibleLocalId>(NonFungibleLocalId("#1#"), NonFungibleLocalId("#2#"))
Bucket("nfts")
;
TAKE_ALL_FROM_WORKTOP
TAKE_ALL_FROM_WORKTOP
Takes all resource from the worktop and creates a bucket.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("xrd_bucket")
;
RETURN_TO_WORKTOP
RETURN_TO_WORKTOP
Returns a bucket to the worktop.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("xrd_bucket")
;
RETURN_TO_WORKTOP
Bucket("xrd_bucket")
;
ASSERT_WORKTOP_CONTAINS
ASSERT_WORKTOP_CONTAINS
Verifies that the worktop contains at least the given (non-zero) amount of the fungible or non-fungible resource, else aborts the transaction.
Example
ASSERT_WORKTOP_CONTAINS
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1.0")
;
ASSERT_WORKTOP_CONTAINS_NON_FUNGIBLES
ASSERT_WORKTOP_CONTAINS_NON_FUNGIBLES
Verifies that the worktop contains the specified non-fungibles, else aborts the transaction.
Example
ASSERT_WORKTOP_CONTAINS_NON_FUNGIBLES
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Array<NonFungibleLocalId>(NonFungibleLocalId("#1#"), NonFungibleLocalId("#2#"))
;
ASSERT_WORKTOP_CONTAINS_ANY
ASSERT_WORKTOP_CONTAINS_ANY
Verifies that the worktop contains any non-zero amount of the given fungible or non-fungible resource.
Example
ASSERT_WORKTOP_CONTAINS_ANY
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
;
POP_FROM_AUTH_ZONE
POP_FROM_AUTH_ZONE
Pops the most recent proof from the auth zone.
Example
POP_FROM_AUTH_ZONE
Proof("proof")
;
PUSH_TO_AUTH_ZONE
PUSH_TO_AUTH_ZONE
Pushes a proof to the auth zone.
Example
POP_FROM_AUTH_ZONE
Proof("proof")
;
PUSH_TO_AUTH_ZONE
Proof("proof")
;
DROP_ALL_PROOFS
DROP_ALL_PROOFS
Drops all of the proofs in the auth zone and the named proofs.
Example
DROP_ALL_PROOFS
;
DROP_NAMED_PROOFS
DROP_NAMED_PROOFS
Drops all of the named proofs.
Example
DROP_NAMED_PROOFS
;
DROP_AUTH_ZONE_PROOFS
DROP_AUTH_ZONE_PROOFS
Removes all proofs in the auth zone.
Example
DROP_AUTH_ZONE_PROOFS
;
DROP_AUTH_ZONE_REGULAR_PROOFS
DROP_AUTH_ZONE_REGULAR_PROOFS
Removes all regular (non-signature) proofs in the auth zone.
Example
DROP_AUTH_ZONE_REGULAR_PROOFS
;
DROP_AUTH_ZONE_SIGNATURE_PROOFS
DROP_AUTH_ZONE_SIGNATURE_PROOFS
Removes all signature proofs in the auth zone.
Example
DROP_AUTH_ZONE_SIGNATURE_PROOFS
;
CREATE_PROOF_FROM_AUTH_ZONE_OF_AMOUNT
CREATE_PROOF_FROM_AUTH_ZONE_OF_AMOUNT
Creates a proof of some amount of resource from the auth zone.
Example
CREATE_PROOF_FROM_AUTH_ZONE_OF_AMOUNT
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1.0")
Proof("proof")
;
CREATE_PROOF_FROM_AUTH_ZONE_OF_NON_FUNGIBLES
CREATE_PROOF_FROM_AUTH_ZONE_OF_NON_FUNGIBLES
Creates a proof of some non-fungibles from the auth zone.
Example
CREATE_PROOF_FROM_AUTH_ZONE_OF_NON_FUNGIBLES
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"))
Proof("proof")
;
CREATE_PROOF_FROM_AUTH_ZONE_OF_ALL
CREATE_PROOF_FROM_AUTH_ZONE_OF_ALL
Creates the max proof of some resource from the auth zone.
Example
CREATE_PROOF_FROM_AUTH_ZONE_OF_ALL
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Proof("proof");
CREATE_PROOF_FROM_BUCKET_OF_AMOUNT
CREATE_PROOF_FROM_BUCKET_OF_AMOUNT
Creates a proof of some amount from a bucket.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("xrd_bucket")
;
CREATE_PROOF_FROM_BUCKET_OF_AMOUNT
Bucket("xrd_bucket")
Decimal("1.0")
Proof("proof")
;
CREATE_PROOF_FROM_BUCKET_OF_NON_FUNGIBLES
CREATE_PROOF_FROM_BUCKET_OF_NON_FUNGIBLES
Creates a proof of some non-fungibles from a bucket.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Bucket("nfts")
;
CREATE_PROOF_FROM_BUCKET_OF_NON_FUNGIBLES
Bucket("nfts")
Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"))
Proof("proof1b")
;
CREATE_PROOF_FROM_BUCKET_OF_ALL
CREATE_PROOF_FROM_BUCKET_OF_ALL
Create a proof with all the resource in a bucket.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Bucket("nfts")
;
CREATE_PROOF_FROM_BUCKET_OF_ALL
Bucket("nfts")
Proof("proof")
;
CLONE_PROOF
CLONE_PROOF
Clones a proof.
Example
POP_FROM_AUTH_ZONE
Proof("proof")
;
CLONE_PROOF
Proof("proof")
Proof("cloned_proof")
;
CALL_FUNCTION
CALL_FUNCTION
Invokes a function on a blueprint.
Example
CALL_FUNCTION
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
"Hello"
"instantiate_hello"
66u32
;
CALL_METHOD
CALL_METHOD
Invokes a method on a component.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("xrd_bucket")
;
CALL_METHOD
Address("component_sim1cpvs7ulg02ah8mhcc84q7zsj4ta3pfz77uknu29xy50yelakkujqze")
"buy_gumball"
Bucket("xrd_bucket")
;
CALL_ROYALTY_METHOD
Address("component_sim1cpvs7ulg02ah8mhcc84q7zsj4ta3pfz77uknu29xy50yelakkujqze")
"set_royalty"
"my_method"
Enum<0u8>()
;
CALL_METADATA_METHOD
Address("component_sim1cpvs7ulg02ah8mhcc84q7zsj4ta3pfz77uknu29xy50yelakkujqze")
"get"
"HelloWorld"
;
CALL_ROLE_ASSIGNMENT_METHOD
Address("component_sim1cpvs7ulg02ah8mhcc84q7zsj4ta3pfz77uknu29xy50yelakkujqze")
"get"
Enum<0u8>()
"hello"
;
ALLOCATE_GLOBAL_ADDRESS
ALLOCATE_GLOBAL_ADDRESS
Allocate a global address.
Example
ALLOCATE_GLOBAL_ADDRESS
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
"Hello"
AddressReservation("address_reservation")
NamedAddress("address")
;
PUBLISH_PACKAGE_ADVANCED
PUBLISH_PACKAGE_ADVANCED
Publish a package.
Example
PUBLISH_PACKAGE_ADVANCED
Enum<1u8>( # owner rule
Enum<2u8>(
Enum<0u8>(
Enum<0u8>(
Enum<0u8>(
NonFungibleGlobalId("resource_sim1nfzf2h73frult99zd060vfcml5kncq3mxpthusm9lkglvhsr0guahy:#1#")
)
)
)
)
)
Tuple( # package definition
Map<String, Tuple>(
"Hello" => Tuple(
Enum<0u8>(),
false,
Array<String>(),
Array<Address>(),
Tuple(
Array<Enum>(),
Enum<0u8>(
Tuple(
Array<Enum>(
Enum<14u8>(
Array<Enum>(
Enum<0u8>(
167u8
)
)
),
Enum<14u8>(
Array<Enum>()
),
Enum<17u8>(
Enum<0u8>()
),
Enum<14u8>(
Array<Enum>()
)
),
Array<Tuple>(
Tuple(
Enum<1u8>(
"Hello"
),
Enum<1u8>(
Enum<0u8>(
Array<String>(
"sample_vault"
)
)
)
),
Tuple(
Enum<1u8>(
"Hello_instantiate_hello_Input"
),
Enum<1u8>(
Enum<0u8>(
Array<String>()
)
)
),
Tuple(
Enum<1u8>(
"GlobalHello"
),
Enum<0u8>()
),
Tuple(
Enum<1u8>(
"Hello_free_token_Input"
),
Enum<1u8>(
Enum<0u8>(
Array<String>()
)
)
)
),
Array<Enum>(
Enum<0u8>(),
Enum<0u8>(),
Enum<14u8>(
Enum<0u8>(
Enum<4u8>(
Enum<0u8>(),
"Hello"
)
)
),
Enum<0u8>()
)
)
),
Tuple(
Array<Tuple>(
Tuple(
Enum<0u8>(
Enum<1u8>(
0u64
)
),
Enum<0u8>(),
Enum<0u8>()
)
),
Array<Enum>()
),
Map<String, Enum>(),
Map<String, Enum>(),
Tuple(
Map<String, Tuple>(
"instantiate_hello" => Tuple(
Enum<0u8>(),
Enum<0u8>(
Enum<1u8>(
1u64
)
),
Enum<0u8>(
Enum<1u8>(
2u64
)
),
"Hello_instantiate_hello"
),
"free_token" => Tuple(
Enum<1u8>(
Tuple(
Enum<1u8>(),
Tuple(
1u32
)
)
),
Enum<0u8>(
Enum<1u8>(
3u64
)
),
Enum<0u8>(
Enum<0u8>(
161u8
)
),
"Hello_free_token"
)
)
),
Tuple(
Map<Enum, String>()
)
),
Enum<0u8>(),
Tuple(
Enum<0u8>(),
Enum<0u8>()
)
)
)
)
Blob("4cdfc89a539f1cb6fac327c07e95a2f120ea5af6d2e2adfae093f81e1d185925") # code
Map<String, Tuple>() # metadata
Enum<0u8>()
;
BURN_RESOURCE
BURN_RESOURCE
Burns a bucket of resource in the worktop.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("xrd_bucket")
;
BURN_RESOURCE
Bucket("xrd_bucket")
;
SET_METADATA
SET_METADATA
Sets the metadata of a global entity.
Example
# Set String Metadata on Package
SET_METADATA
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
"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_sim1c8zvh2cd59pnwfqkkre0rflfhshrhptkweyf7vzefw08u0l3mk2anh")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::Bool" is equivalent to 1u8
Enum<Metadata::Bool>(
true
)
;
# Set u8 Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::U8" is equivalent to 2u8
Enum<Metadata::U8>(
123u8
)
;
# Set u32 Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::U32" is equivalent to 3u8
Enum<Metadata::U32>(
123u32
)
;
# Set u64 Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::U64" is equivalent to 4u8
Enum<Metadata::U64>(
123u64
)
;
# Set i32 Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::I32" is equivalent to 5u8
Enum<Metadata::I32>(
-123i32
)
;
# Set i64 Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::I64" is equivalent to 6u8
Enum<Metadata::I64>(
-123i64
)
;
# Set Decimal Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::Address" is equivalent to 8u8
Enum<Metadata::Address>(
Address("account_sim1c8zvh2cd59pnwfqkkre0rflfhshrhptkweyf7vzefw08u0l3mk2anh")
)
;
# Set Public Key Metadata on Resource
# NOTE: Also see "PublicKeyHash" further down
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::NonFungibleGlobalId" is equivalent to 10u8
Enum<Metadata::NonFungibleGlobalId>(
NonFungibleGlobalId("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj:<some_string>")
)
;
# Set NonFungibleLocalId Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::Origin" is equivalent to 14u8
Enum<Metadata::Origin>(
"https://radixdlt.com"
)
;
# Set PublicKeyHash Metadata on Resource
SET_METADATA
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
"field_name"
# "Metadata::StringArray" is equivalent to 128u8
Enum<Metadata::StringArray>(
Array<String>(
"some_string",
"another_string",
"yet_another_string"
)
)
;
LOCK_METADATA
LOCK_METADATA
Locks the metadata field value of a global entity from being updated.
Example
LOCK_METADATA
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
"field_name";
LOCK_METADATA
Address("account_sim1c8zvh2cd59pnwfqkkre0rflfhshrhptkweyf7vzefw08u0l3mk2anh")
"field_name";
LOCK_METADATA
Address("resource_sim1nfnwxdfw2tjzzkvyj9kxe64en6nhnelqmrxwrmgnly4a4wugc6e6cu")
"field_name";
REMOVE_METADATA
REMOVE_METADATA
Removes the metadata key and value of a global entity.
Example
REMOVE_METADATA
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
"field_name";
REMOVE_METADATA
Address("account_sim1c8zvh2cd59pnwfqkkre0rflfhshrhptkweyf7vzefw08u0l3mk2anh")
"field_name";
REMOVE_METADATA
Address("resource_sim1nfnwxdfw2tjzzkvyj9kxe64en6nhnelqmrxwrmgnly4a4wugc6e6cu")
"field_name";
MINT_FUNGIBLE
MINT_FUNGIBLE
Mints a fungible resource and deposits it on the worktop.
Example
MINT_FUNGIBLE
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1.0")
;
MINT_NON_FUNGIBLE
MINT_NON_FUNGIBLE
Mint a non-fungible resource and deposit it on the worktop.
Example
# This non-fungible token has no data
MINT_NON_FUNGIBLE
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Map<NonFungibleLocalId, Tuple>(
NonFungibleLocalId("#555#") => Tuple(Tuple())
)
;
MINT_RUID_NON_FUNGIBLE
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.
Example
MINT_RUID_NON_FUNGIBLE
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Array<Tuple>(
Tuple(Tuple("Hello World", Decimal("12")))
)
;
CREATE_FUNGIBLE_RESOURCE
CREATE_FUNGIBLE_RESOURCE
Create a fungible resource and deposit it on the worktop.
Example
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_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
Create a resource with a specified badge for authorization.
Example
CREATE_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
# 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)
Decimal("10000") # Initial supply
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_NON_FUNGIBLE_RESOURCE
Create a non-fungible resource from the worktop.
Example
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)
Enum<0u8>(Enum<0u8>(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_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
Create a non-fungible resource with a specified badge for authorization.
Example
CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
# 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)
Enum<0u8>(Enum<0u8>(Tuple(Array<Enum>(), Array<Tuple>(), Array<Enum>())), Enum<0u8>(66u8), Array<String>()) # Non Fungible Data Schema
Map<NonFungibleLocalId, Tuple>( # Initial supply to mint
NonFungibleLocalId("#1#") => Tuple(Tuple())
)
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
RECALL
Recalls a fungible resource from a vault (if the resource has a recallable behavior).
Example
RECALL_FROM_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Decimal("1.2")
;
RECALL_NON_FUNGIBLE
RECALL_NON_FUNGIBLE
Recalls a non-fungible resource from a vault (if the resource has a recallable behavior).
Example
RECALL_NON_FUNGIBLES_FROM_VAULT
Address("internal_vault_sim1nzvf3xycnzvf3xycnzvf3xycnzvf3xycnzvf3xycnzvf3xyc4apn28")
Array<NonFungibleLocalId>(NonFungibleLocalId("#123#"), NonFungibleLocalId("#456#"))
;
FREEZE_VAULT
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
.
Example
# Freeze Withdraws from a vault
FREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(1u32)
;
# Freeze Deposits into a vault
FREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(2u32)
;
# Freeze Burns in a vault
FREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(4u32)
;
# Freeze Withdraws/Deposits/Burns of a vault
FREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(7u32)
;
UNFREEZE_VAULT
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
.
Example
# Unfreeze Withdraws from a vault
UNFREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(1u32)
;
# Unfreeze Deposits into a vault
UNFREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(2u32)
;
# Unfreeze Burns in a vault
UNFREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(4u32)
;
# Unfreeze Withdraws/Deposits/Burns of a vault
UNFREEZE_VAULT
Address("internal_vault_sim1tpv9skzctpv9skzctpv9skzctpv9skzctpv9skzctpv9skzcuxymgh")
Tuple(7u32)
;
SET_OWNER_ROLE
SET_OWNER_ROLE
Sets an OwnerRole
configuration of a global entity.
Example
SET_OWNER_ROLE
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
Enum<AccessRule::Protected>(
Enum<AccessRuleNode::ProofRule>(
Enum<ProofRule::Require>(
Enum<ResourceOrNonFungible::NonFungible>( # Either NonFungible or Resource, which contains either a NonFungibleGlobalId or a Address("<resource address>")
NonFungibleGlobalId("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj:#123#")
)
)
)
)
;
LOCK_OWNER_ROLE
LOCK_OWNER_ROLE
Locks an OwnerRole
configuration of a global entity.
Example
LOCK_OWNER_ROLE
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
;
SET_ROLE
SET_ROLE
Sets role configuration of a global entity.
Example
SET_ROLE
Address("component_sim1cpvs7ulg02ah8mhcc84q7zsj4ta3pfz77uknu29xy50yelakkujqze")
Enum<ModuleId::Main>() # Main, Metadata, Royalty or RoleAssignment. You typically want "ModuleId::Main" here, unless setting a native role from the Metadata / Royalty modules.
"role_name" # The name of the role to update the access rule for.
Enum<AccessRule::Protected>( # The access rule associated with the role
Enum<AccessRuleNode::ProofRule>(
Enum<ProofRule::Require>(
Enum<ResourceOrNonFungible::NonFungible>( # Either NonFungible or Resource, which contains either a NonFungibleGlobalId or a Address("<resource address>")
NonFungibleGlobalId("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj:#123#")
)
)
)
)
;
CREATE_ACCESS_CONTROLLER
CREATE_ACCESS_CONTROLLER
Create an access controller native component.
Example
TAKE_ALL_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Bucket("bucket1")
;
CREATE_ACCESS_CONTROLLER
Bucket("bucket1")
Tuple(
Enum<1u8>(), # primary role
Enum<1u8>(), # recovery role
Enum<1u8>() # confirmation role
)
None # timed recovery delay in minutes
None # address reservation
;
SET_COMPONENT_ROYALTY
SET_COMPONENT_ROYALTY
Sets the royalty configuration on a component.
Example
SET_COMPONENT_ROYALTY
Address("component_sim1czawvqpwnuwew7zfnsflhyxgmaf4hckjawlfku6jfpet9efa4aeskg")
"my_method"
Enum<RoyaltyAmount::Free>()
;
LOCK_COMPONENT_ROYALTY
LOCK_COMPONENT_ROYALTY
Locks the royalty configuration on a component.
Example
LOCK_COMPONENT_ROYALTY
Address("component_sim1czawvqpwnuwew7zfnsflhyxgmaf4hckjawlfku6jfpet9efa4aeskg")
"my_method"
;
CLAIM_PACKAGE_ROYALTIES
CLAIM_PACKAGE_ROYALTIES
Claims royalty on an owned package
Example
CLAIM_PACKAGE_ROYALTIES
Address("package_sim1p4nk9h5kw2mcmwn5u2xcmlmwap8j6dzet7w7zztzz55p70rgqs4vag")
;
CLAIM_COMPONENT_ROYALTIES
CLAIM_COMPONENT_ROYALTIES
Claims royalty on an owned component.
Example
CLAIM_COMPONENT_ROYALTIES
Address("component_sim1czawvqpwnuwew7zfnsflhyxgmaf4hckjawlfku6jfpet9efa4aeskg")
;
CREATE_ACCOUNT
CREATE_ACCOUNT
Create a native account component.
Example
CREATE_ACCOUNT
;
CREATE_ACCOUNT_ADVANCED
CREATE_ACCOUNT_ADVANCED
Create a native account component with an OwnerRole
configuration.
Example
CREATE_ACCOUNT_ADVANCED
Enum<OwnerRole::Updatable>(
Enum<AccessRule::AllowAll>()
)
None
;
CREATE_IDENTITY
CREATE_IDENTITY
Create a native Identity component.
Example
CREATE_IDENTITY
;
CREATE_IDENTITY_ADVANCED
CREATE_IDENTITY_ADVANCED
Create a native Identity component with an OwnerRole
configuration.
Example
CREATE_IDENTITY_ADVANCED
Enum<OwnerRole::None>()
;
CREATE_VALIDATOR
CREATE_VALIDATOR
Create a native validator component.
Example
TAKE_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1000")
Bucket("bucket1")
;
CREATE_VALIDATOR
Bytes("02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5")
Decimal("1")
Bucket("bucket1")
;
Arguments
In the Radix transaction manifest, all arguments are strongly typed Manifest SBOR Values in Manifest Value Syntax.
When making method/function calls, the Manifest SBOR value is converted by the transaction processor into a Scrypto SBOR value, which is then used to make the engine call. As part of this engine call, the resultant Scrypto value is validated by the Radix Engine against the Component’s interface’s schema at runtime.
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_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("1.0")
Bucket("my_bucket")
;
CALL_METHOD
Address("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"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("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"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("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"create_proof_of_amount"
Address("resource_sim1n2q4le7dpzucmpnksxj5ku28r3t776pgk879cahgm76c2kfpz48fpj")
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("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"lock_fee"
Decimal("10");
CALL_METHOD
Address("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"withdraw"
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
Decimal("10") ;
TAKE_FROM_WORKTOP
Address("resource_sim1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxakj8n3")
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("account_sim1cx0l2jhr3lg8mzg3gp3xsun94vtw3440w77xddvvp4cjte5gdvz35k")
"deposit_batch"
Expression("ENTIRE_WORKTOP");