# CONSTANTS # ================================================================================================= # The number of elements in a Word const.WORD_SIZE=4 # The maximum number of input values associated with a single note. const.MAX_INPUTS_PER_NOTE=128 # The maximum number of assets that can be stored in a single note. const.MAX_ASSETS_PER_NOTE=256 # The maximum number of notes that can be consumed in a single transaction. const.MAX_INPUT_NOTES_PER_TX=1024 # The size of the memory segment allocated to each note. const.NOTE_MEM_SIZE=512 # The depth of the Merkle tree used to commit to notes produced in a block. const.NOTE_TREE_DEPTH=16 # The maximum number of notes that can be created in a single transaction. const.MAX_OUTPUT_NOTES_PER_TX=1024 # Specifies a modulus used to asses if an account seed digest has the required number of trailing # zeros for a regular account (2^23). const.REGULAR_ACCOUNT_SEED_DIGEST_MODULUS=8388608 # Specifies a modulus used to asses if an account seed digest has the required number of trailing # zeros for a faucet account (2^31). const.FAUCET_ACCOUNT_SEED_DIGEST_MODULUS=2147483648 # TYPES # ================================================================================================= # Type of storage slot item in the account storage const.STORAGE_SLOT_TYPE_VALUE=0 const.STORAGE_SLOT_TYPE_MAP=1 const.STORAGE_SLOT_TYPE_ARRAY=2 # PROCEDURES # ================================================================================================= #! Returns the number of elements in a Word. #! #! Stack: [] #! Output: [word_size] #! #! - word_size is the number of elements in a Word. export.get_word_size push.WORD_SIZE end #! Returns the max allowed number of input values per note. #! #! Stack: [] #! Output: [max_inputs_per_note] #! #! - max_inputs_per_note is the max inputs per note. export.get_max_inputs_per_note push.MAX_INPUTS_PER_NOTE end #! Returns the max allowed number of assets per note. #! #! Stack: [] #! Output: [max_assets_per_note] #! #! - max_assets_per_note is the max assets per note. export.get_max_assets_per_note push.MAX_ASSETS_PER_NOTE end #! Returns the maximum number of notes that can be consumed in a single transaction. #! #! Stack: [] #! Output: [max_num_input_notes] #! #! - max_num_input_notes is the max number of input notes. export.get_max_num_input_notes push.MAX_INPUT_NOTES_PER_TX end #! Returns the size of the memory segment allocated to each note. #! #! Stack: [] #! Output: [note_mem_size] #! #! - note_mem_size is the size of the memory segment allocated to each note. export.get_note_mem_size push.NOTE_MEM_SIZE end #! Returns the depth of the Merkle tree used to commit to notes produced in a block. #! #! Stack: [] #! Output: [note_tree_depth] #! #! - note_tree_depth is the depth of the Merkle tree used to commit to notes produced in a block. export.get_note_tree_depth push.NOTE_TREE_DEPTH end #! Returns the maximum number of notes that can be created in a single transaction. #! #! Stack: [] #! Output: [max_num_output_notes] #! #! - max_num_output_notes is the max number of notes that can be created in a single transaction. export.get_max_num_output_notes push.MAX_OUTPUT_NOTES_PER_TX end #! Returns a modulus used to asses if an account seed digest has the required number of trailing #! zeros for a regular account (2^23). #! #! Stack: [] #! Output: [REGULAR_ACCOUNT_SEED_DIGEST_MODULUS] #! #! - REGULAR_ACCOUNT_SEED_DIGEST_MODULUS is a modulus used to asses if a seed digest has the #! required number of trailing zeros for a regular account. export.get_regular_account_seed_digest_modulus push.REGULAR_ACCOUNT_SEED_DIGEST_MODULUS end #! Returns a modulus used to asses if an account seed digest has the required number of trailing #! zeros for a faucet account (2^31). #! #! Stack: [] #! Output: [FAUCET_ACCOUNT_SEED_DIGEST_MODULUS] #! #! - FAUCET_ACCOUNT_SEED_DIGEST_MODULUS is a modulus used to asses if a seed digest has the #! required number of trailing zeros for a faucet account. export.get_faucet_seed_digest_modulus push.FAUCET_ACCOUNT_SEED_DIGEST_MODULUS end #! Returns the root of an empty Sparse Merkle Tree. #! #! Stack: [] #! Output: [EMPTY_SMT_ROOT] #! #! - EMPTY_SMT_ROOT is the root of an empty Sparse Merkle Tree. export.get_empty_smt_root push.15321474589252129342.17373224439259377994.15071539326562317628.3312677166725950353 end #! Returns the type of storage slot value in the account storage. #! #! Stack: [] #! Output: [type_storage_value] #! #! - type_storage_value is the type of storage slot item in the account storage. export.get_storage_slot_type_value push.STORAGE_SLOT_TYPE_VALUE end #! Returns the type of storage slot map in the account storage. #! #! Stack: [] #! Output: [type_storage_map] #! #! - type_storage_map is the type of storage slot item in the account storage. export.get_storage_slot_type_map push.STORAGE_SLOT_TYPE_MAP end #! Returns the type of storage slot array in the account storage. #! #! Stack: [] #! Output: [type_storage_array] #! #! - type_storage_array is the type of storage slot item in the account storage. export.get_storage_slot_type_array push.STORAGE_SLOT_TYPE_ARRAY end