Skip to content

Commit

Permalink
[framework][examples] compressed ambassador token
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-aptos committed Dec 16, 2024
1 parent 4901a8b commit e1cf0b6
Show file tree
Hide file tree
Showing 8 changed files with 932 additions and 210 deletions.
3 changes: 3 additions & 0 deletions aptos-move/e2e-benchmark/data/calibration_values.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ ResourceGroupsSenderWriteTag { string_length: 1024 } 60 0.918 1.075 15.8
ResourceGroupsSenderMultiChange { string_length: 1024 } 60 0.909 1.169 32.9
TokenV1MintAndTransferFT 60 0.953 1.069 384.6
TokenV1MintAndTransferNFTSequential 60 0.938 1.064 600.3
TokenV2AmbassadorMint { numbered: false } 60 0.951 1.057 516.6
TokenV2AmbassadorMint { numbered: true } 60 0.951 1.057 516.6
CompressedTokenAmbassadorMint { numbered: false } 60 0.951 1.057 516.6
CompressedTokenAmbassadorMint { numbered: true } 60 0.951 1.057 516.6
LiquidityPoolSwap { is_stable: true } 60 0.961 1.139 582.6
LiquidityPoolSwap { is_stable: false } 60 0.929 1.099 563.0
CoinInitAndMint 60 0.928 1.130 205.0
Expand Down
1 change: 1 addition & 0 deletions aptos-move/e2e-benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ fn main() {
EntryPoints::TokenV1MintAndTransferFT,
EntryPoints::TokenV1MintAndTransferNFTSequential,
EntryPoints::TokenV2AmbassadorMint { numbered: true },
EntryPoints::CompressedTokenAmbassadorMint { numbered: true },
EntryPoints::LiquidityPoolSwap { is_stable: true },
EntryPoints::LiquidityPoolSwap { is_stable: false },
EntryPoints::CoinInitAndMint,
Expand Down
8 changes: 6 additions & 2 deletions aptos-move/move-examples/token_objects/ambassador/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ version = '1.0.0'
ambassador = "0xCAFE"

[dependencies]
AptosFramework = { git = "https://github.com/aptos-labs/aptos-framework.git", subdir = "aptos-framework", rev = "mainnet" }
AptosTokenObjects = { git = "https://github.com/aptos-labs/aptos-framework.git", subdir = "aptos-token-objects", rev = "mainnet" }

AptosFramework = { local = "../../../../aptos-move/framework/aptos-framework" }
AptosTokenObjects = { local = "../../../../aptos-move/framework/aptos-token-objects" }

# AptosFramework = { git = "https://github.com/aptos-labs/aptos-framework.git", subdir = "aptos-framework", rev = "mainnet" }
# AptosTokenObjects = { git = "https://github.com/aptos-labs/aptos-framework.git", subdir = "aptos-token-objects", rev = "mainnet" }

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions crates/transaction-generator-lib/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub enum TransactionTypeArg {
FungibleAssetMint,
TokenV2AmbassadorMint,
TokenV2AmbassadorMintAndBurn1M,
CompressedTokenAmbassadorMint,
LiquidityPoolSwap,
LiquidityPoolSwapStable,
VectorPictureCreate30k,
Expand Down Expand Up @@ -294,6 +295,9 @@ impl TransactionTypeArg {
use_account_pool: sender_use_account_pool,
progress_type: workflow_progress_type,
},
TransactionTypeArg::CompressedTokenAmbassadorMint => {
call_custom_module(EntryPoints::CompressedTokenAmbassadorMint { numbered: false })
},
TransactionTypeArg::LiquidityPoolSwap => {
call_custom_module(EntryPoints::LiquidityPoolSwap { is_stable: false })
},
Expand Down
30 changes: 18 additions & 12 deletions crates/transaction-generator-lib/src/publishing/module_simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ pub enum EntryPoints {
/// Burn an NFT token, only works with numbered=false tokens.
TokenV2AmbassadorBurn,

CompressedTokenAmbassadorMint {
numbered: bool,
},

LiquidityPoolSwapInit {
is_stable: bool,
},
Expand Down Expand Up @@ -357,9 +361,9 @@ impl EntryPoints {
| EntryPoints::ResourceGroupsSenderMultiChange { .. }
| EntryPoints::CoinInitAndMint
| EntryPoints::FungibleAssetMint => "framework_usecases",
EntryPoints::TokenV2AmbassadorMint { .. } | EntryPoints::TokenV2AmbassadorBurn => {
"ambassador_token"
},
EntryPoints::TokenV2AmbassadorMint { .. }
| EntryPoints::TokenV2AmbassadorBurn
| EntryPoints::CompressedTokenAmbassadorMint { .. } => "ambassador_token",
EntryPoints::LiquidityPoolSwapInit { .. }
| EntryPoints::LiquidityPoolSwap { .. }
| EntryPoints::InitializeVectorPicture { .. }
Expand Down Expand Up @@ -423,6 +427,7 @@ impl EntryPoints {
EntryPoints::TokenV2AmbassadorMint { .. } | EntryPoints::TokenV2AmbassadorBurn => {
"ambassador"
},
EntryPoints::CompressedTokenAmbassadorMint { .. } => "compressed_ambassador",
EntryPoints::LiquidityPoolSwapInit { .. } | EntryPoints::LiquidityPoolSwap { .. } => {
"liquidity_pool_wrapper"
},
Expand Down Expand Up @@ -751,7 +756,8 @@ impl EntryPoints {
bcs::to_bytes(&1000u64).unwrap(), // amount
])
},
EntryPoints::TokenV2AmbassadorMint { numbered: true } => {
EntryPoints::TokenV2AmbassadorMint { numbered: true }
| EntryPoints::CompressedTokenAmbassadorMint { numbered: true } => {
let rng: &mut StdRng = rng.expect("Must provide RNG");
get_payload(
module_id,
Expand All @@ -763,7 +769,8 @@ impl EntryPoints {
],
)
},
EntryPoints::TokenV2AmbassadorMint { numbered: false } => {
EntryPoints::TokenV2AmbassadorMint { numbered: false }
| EntryPoints::CompressedTokenAmbassadorMint { numbered: false } => {
let rng: &mut StdRng = rng.expect("Must provide RNG");
get_payload(
module_id,
Expand All @@ -779,7 +786,6 @@ impl EntryPoints {
ident_str!("burn_named_by_user").to_owned(),
vec![],
),

EntryPoints::LiquidityPoolSwapInit { is_stable } => get_payload(
module_id,
ident_str!("initialize_liquid_pair").to_owned(),
Expand Down Expand Up @@ -895,9 +901,9 @@ impl EntryPoints {
EntryPoints::CoinInitAndMint | EntryPoints::FungibleAssetMint => {
MultiSigConfig::Publisher
},
EntryPoints::TokenV2AmbassadorMint { .. } | EntryPoints::TokenV2AmbassadorBurn => {
MultiSigConfig::Publisher
},
EntryPoints::TokenV2AmbassadorMint { .. }
| EntryPoints::TokenV2AmbassadorBurn
| EntryPoints::CompressedTokenAmbassadorMint { .. } => MultiSigConfig::Publisher,
EntryPoints::LiquidityPoolSwap { .. } => MultiSigConfig::Publisher,
EntryPoints::CreateGlobalMilestoneAggV2 { .. } => MultiSigConfig::Publisher,
_ => MultiSigConfig::None,
Expand Down Expand Up @@ -953,9 +959,9 @@ impl EntryPoints {
EntryPoints::CoinInitAndMint | EntryPoints::FungibleAssetMint => {
AutomaticArgs::SignerAndMultiSig
},
EntryPoints::TokenV2AmbassadorMint { .. } | EntryPoints::TokenV2AmbassadorBurn => {
AutomaticArgs::SignerAndMultiSig
},
EntryPoints::TokenV2AmbassadorMint { .. }
| EntryPoints::TokenV2AmbassadorBurn
| EntryPoints::CompressedTokenAmbassadorMint { .. } => AutomaticArgs::SignerAndMultiSig,
EntryPoints::LiquidityPoolSwapInit { .. } => AutomaticArgs::Signer,
EntryPoints::LiquidityPoolSwap { .. } => AutomaticArgs::SignerAndMultiSig,
EntryPoints::InitializeVectorPicture { .. } => AutomaticArgs::Signer,
Expand Down
Loading

0 comments on commit e1cf0b6

Please sign in to comment.