Skip to content

Commit

Permalink
refactor: updated the code acc to new poseidon changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikbhatt20 committed Oct 30, 2024
1 parent 102e7f0 commit b97de0f
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tokens/create-token/poseidon/create-token/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolution = true
skip-lint = false

[programs.localnet]
create_token = "FThBfjqE8JBZYX8SdiJtDZwwGuVaQVMFfcR9JEsxS2A"
create_token = "7ZpQnmMWwNbuSRnBpq2E4RTKMgN5tDNopF7BHvSJZfwU"

[registry]
url = "https://api.apr.dev"
Expand Down
5 changes: 3 additions & 2 deletions tokens/create-token/poseidon/create-token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
},
"dependencies": {
"@coral-xyz/anchor": "^0.30.0",
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.95.2"
},
"devDependencies": {
"anchor-bankrun": "^0.4.0",
"solana-bankrun": "^0.3.0",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"anchor-bankrun": "^0.4.0",
"chai": "^4.4.1",
"mocha": "^9.0.3",
"prettier": "^2.6.2",
"solana-bankrun": "^0.3.0",
"ts-mocha": "^10.0.0",
"typescript": "^4.3.5"
}
Expand Down
194 changes: 187 additions & 7 deletions tokens/create-token/poseidon/create-token/pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
use anchor_lang::prelude::*;
use anchor_spl::token::{Mint, Token};

declare_id!("FThBfjqE8JBZYX8SdiJtDZwwGuVaQVMFfcR9JEsxS2A");
declare_id!("7ZpQnmMWwNbuSRnBpq2E4RTKMgN5tDNopF7BHvSJZfwU");

#[program]
pub mod create_token {
use super::*;

pub fn create_token_mint(_ctx: Context<CreateTokenMintContext>, _decimals: u8) -> Result<()> {
// Workaround implementation for initializing the token mint
// Note: Poseidon's transpiler does not support initializeMint yet,
// so this is done manually using Anchor's InitializeMint.

Ok(())
}
Expand All @@ -26,6 +23,9 @@ pub struct CreateTokenMintContext<'info> {
#[account(mut)]
pub payer: Signer<'info>,
// Create new mint account
// Workaround implementation for initializing the token mint
// Note: Poseidon's transpiler does not support initializeMint yet,
// so this is done manually using Anchor's InitializeMint.
#[account(
init,
payer = payer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"license": "ISC",
"description": "",
"dependencies": {
"@solanaturbine/poseidon": "^0.0.4"
"@solanaturbine/poseidon": "^0.0.10"
}
}
Loading

0 comments on commit b97de0f

Please sign in to comment.