Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mint metadata to prevent user burning LP due to unknown symbol / … #106

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions programs/amm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,28 @@ overflow-checks = true
[dependencies]
anchor-lang = "0.28.0"
anchor-spl = "0.28.0"
mercurial-vault = { git="https://github.com/mercurial-finance/mercurial_sdk", features= ["cpi" , "no-entrypoint"], rev = "c590d6ba19ecb58d80dbe8b33fa8056a1ddbff43" }
mercurial-vault = { git = "https://github.com/mercurial-finance/mercurial_sdk", features = [
"cpi",
"no-entrypoint",
], rev = "c590d6ba19ecb58d80dbe8b33fa8056a1ddbff43" }
spl-token-swap = { version = "3.0.0", features = ["no-entrypoint"] }
meteora-stable-swap-math = { git="https://github.com/mercurial-finance/stable-swap", rev = "f49a9166fd1b7afd14dded3cdd600fb19b4c6982", package="stable-swap-math"}
meteora-stable-swap-client = { git="https://github.com/mercurial-finance/stable-swap", rev = "f49a9166fd1b7afd14dded3cdd600fb19b4c6982", package="stable-swap-client" }
meteora-stable-swap-math = { git = "https://github.com/mercurial-finance/stable-swap", rev = "f49a9166fd1b7afd14dded3cdd600fb19b4c6982", package = "stable-swap-math" }
meteora-stable-swap-client = { git = "https://github.com/mercurial-finance/stable-swap", rev = "f49a9166fd1b7afd14dded3cdd600fb19b4c6982", package = "stable-swap-client" }
meteora-marinade-sdk = { version = "0.1.0", features = ["cpi"] }
spl-stake-pool = { git = "https://github.com/solana-labs/solana-program-library", rev = "cd79bba17331235ab489bae56600043ea853c70b", features = ["no-entrypoint"] }
spl-stake-pool = { git = "https://github.com/solana-labs/solana-program-library", rev = "cd79bba17331235ab489bae56600043ea853c70b", features = [
"no-entrypoint",
] }
anyhow = "1.0.71"
mpl-token-metadata = "3.2.3"

[dev-dependencies]
solana-program-test = "1.16.12"
solana-sdk = "1.16.12"
solana-account-decoder = "1.16.12"
solana-client = "1.16.12"
spl-associated-token-account = { version = "1.1.2", features = ["no-entrypoint"] }
spl-associated-token-account = { version = "1.1.2", features = [
"no-entrypoint",
] }
serde_json = "1.0.95"
serde = "1.0.159"
bincode = "1.3.3"
bincode = "1.3.3"
16 changes: 16 additions & 0 deletions programs/amm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ pub struct InitializePermissionlessPoolWithFeeTier<'info> {
)]
pub admin_token_b_fee: Box<Account<'info, TokenAccount>>,

/// CHECK: LP mint metadata PDA. Metaplex do the checking.
#[account(mut)]
pub mint_metadata: UncheckedAccount<'info>,

/// CHECK: Metadata program
#[account(address = mpl_token_metadata::ID)]
pub metadata_program: UncheckedAccount<'info>,

/// Admin account. This account will be the admin of the pool, and the payer for PDA during initialize pool.
#[account(mut)]
pub payer: Signer<'info>,
Expand Down Expand Up @@ -466,6 +474,14 @@ pub struct InitializePermissionlessPool<'info> {
)]
pub admin_token_b_fee: Box<Account<'info, TokenAccount>>,

/// CHECK: LP mint metadata PDA. Metaplex do the checking.
#[account(mut)]
pub mint_metadata: UncheckedAccount<'info>,

/// CHECK: Metadata program
#[account(address = mpl_token_metadata::ID)]
pub metadata_program: UncheckedAccount<'info>,

/// Admin account. This account will be the admin of the pool, and the payer for PDA during initialize pool.
#[account(mut)]
pub payer: Signer<'info>,
Expand Down
2 changes: 1 addition & 1 deletion ts-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mercurial-finance/dynamic-amm-sdk",
"version": "0.4.12",
"version": "0.4.13",
"description": "Mercurial Vaults SDK is a typescript library that allows you to interact with Mercurial v2's AMM.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 2 additions & 0 deletions ts-client/src/amm/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@ export const CONSTANT_PRODUCT_ALLOWED_TRADE_FEE_BPS = [25, 100, 400, 600];
export const STABLE_SWAP_DEFAULT_TRADE_FEE_BPS = 1;

export const STABLE_SWAP_ALLOWED_TRADE_FEE_BPS = [1, 4, 10, 100];

export const METAPLEX_PROGRAM = new PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');
Loading
Loading