diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/.gitignore b/tokens/transfer-tokens/poseidon/transfer_tokens/.gitignore new file mode 100644 index 000000000..2e0446b07 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/.gitignore @@ -0,0 +1,7 @@ +.anchor +.DS_Store +target +**/*.rs.bk +node_modules +test-ledger +.yarn diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/.prettierignore b/tokens/transfer-tokens/poseidon/transfer_tokens/.prettierignore new file mode 100644 index 000000000..414258343 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/.prettierignore @@ -0,0 +1,7 @@ +.anchor +.DS_Store +target +node_modules +dist +build +test-ledger diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/Anchor.toml b/tokens/transfer-tokens/poseidon/transfer_tokens/Anchor.toml new file mode 100644 index 000000000..8f09b3075 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/Anchor.toml @@ -0,0 +1,18 @@ +[toolchain] + +[features] +resolution = true +skip-lint = false + +[programs.localnet] +transfer_tokens = "4vjYF5HL4xS6sehyeAGhTGExTomDBKPfTWFS5eHj2aqu" + +[registry] +url = "https://api.apr.dev" + +[provider] +cluster = "Localnet" +wallet = "~/.config/solana/id.json" + +[scripts] +test = "pnpm run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/Cargo.toml b/tokens/transfer-tokens/poseidon/transfer_tokens/Cargo.toml new file mode 100644 index 000000000..f39770481 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +members = [ + "programs/*" +] +resolver = "2" + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/migrations/deploy.ts b/tokens/transfer-tokens/poseidon/transfer_tokens/migrations/deploy.ts new file mode 100644 index 000000000..82fb175fa --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/migrations/deploy.ts @@ -0,0 +1,12 @@ +// Migrations are an early feature. Currently, they're nothing more than this +// single deploy script that's invoked from the CLI, injecting a provider +// configured from the workspace's Anchor.toml. + +const anchor = require("@coral-xyz/anchor"); + +module.exports = async function (provider) { + // Configure client to use the provider. + anchor.setProvider(provider); + + // Add your deploy script here. +}; diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/package.json b/tokens/transfer-tokens/poseidon/transfer_tokens/package.json new file mode 100644 index 000000000..6bccacf63 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/package.json @@ -0,0 +1,21 @@ +{ + "license": "ISC", + "scripts": { + "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", + "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check", + "ts-mocha": "ts-mocha --project tsconfig.json" + }, + "dependencies": { + "@coral-xyz/anchor": "^0.30.1" + }, + "devDependencies": { + "chai": "^4.3.4", + "mocha": "^9.0.3", + "ts-mocha": "^10.0.0", + "@types/bn.js": "^5.1.0", + "@types/chai": "^4.3.0", + "@types/mocha": "^9.0.0", + "typescript": "^4.3.5", + "prettier": "^2.6.2" + } +} diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Cargo.toml b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Cargo.toml new file mode 100644 index 000000000..08d5af560 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "transfer_tokens" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "transfer_tokens" + +[features] +default = [] +cpi = ["no-entrypoint"] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +idl-build = ["anchor-lang/idl-build"] + +[dependencies] +anchor-lang = "0.30.1" diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Xargo.toml b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Xargo.toml new file mode 100644 index 000000000..475fb71ed --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/src/lib.rs b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/src/lib.rs new file mode 100644 index 000000000..e1cd481e9 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/programs/transfer_tokens/src/lib.rs @@ -0,0 +1,16 @@ +use anchor_lang::prelude::*; + +declare_id!("4vjYF5HL4xS6sehyeAGhTGExTomDBKPfTWFS5eHj2aqu"); + +#[program] +pub mod transfer_tokens { + use super::*; + + pub fn initialize(ctx: Context) -> Result<()> { + msg!("Greetings from: {:?}", ctx.program_id); + Ok(()) + } +} + +#[derive(Accounts)] +pub struct Initialize {} diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/tests/transfer_tokens.ts b/tokens/transfer-tokens/poseidon/transfer_tokens/tests/transfer_tokens.ts new file mode 100644 index 000000000..5fcb01d73 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/tests/transfer_tokens.ts @@ -0,0 +1,16 @@ +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { TransferTokens } from "../target/types/transfer_tokens"; + +describe("transfer_tokens", () => { + // Configure the client to use the local cluster. + anchor.setProvider(anchor.AnchorProvider.env()); + + const program = anchor.workspace.TransferTokens as Program; + + it("Is initialized!", async () => { + // Add your test here. + const tx = await program.methods.initialize().rpc(); + console.log("Your transaction signature", tx); + }); +}); diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/package.json b/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/package.json new file mode 100644 index 000000000..966692b97 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/package.json @@ -0,0 +1,15 @@ +{ + "name": "ts-programs", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@solanaturbine/poseidon": "^0.0.8" + } +} diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/pnpm-lock.yaml b/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/pnpm-lock.yaml new file mode 100644 index 000000000..8fc3e5cf4 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/pnpm-lock.yaml @@ -0,0 +1,22 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@solanaturbine/poseidon': + specifier: ^0.0.8 + version: 0.0.8 + +packages: + + '@solanaturbine/poseidon@0.0.8': + resolution: {integrity: sha512-/zlEU0OG8MhnlrFqd1Paq9XyPs22z4Xub7Fldh2wH3QaBmHTsTbtaF/tC1PjbCrLnk69FSGSC7kiFsccAWufsw==} + +snapshots: + + '@solanaturbine/poseidon@0.0.8': {} diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/src/transfer_tokens.ts b/tokens/transfer-tokens/poseidon/transfer_tokens/ts-programs/src/transfer_tokens.ts new file mode 100644 index 000000000..e69de29bb diff --git a/tokens/transfer-tokens/poseidon/transfer_tokens/tsconfig.json b/tokens/transfer-tokens/poseidon/transfer_tokens/tsconfig.json new file mode 100644 index 000000000..cd5d2e3d0 --- /dev/null +++ b/tokens/transfer-tokens/poseidon/transfer_tokens/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": ["mocha", "chai"], + "typeRoots": ["./node_modules/@types"], + "lib": ["es2015"], + "module": "commonjs", + "target": "es6", + "esModuleInterop": true + } +}