Skip to content

Commit 83e0967

Browse files
author
Edward
committed
tokens/stop-loss-vault: initial Anchor + LiteSVM scaffold
1 parent 5540080 commit 83e0967

16 files changed

Lines changed: 199 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
**/*.rs.bk
5+
node_modules
6+
test-ledger
7+
.yarn
8+
.surfpool
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.anchor
2+
.DS_Store
3+
target
4+
node_modules
5+
dist
6+
build
7+
test-ledger
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[toolchain]
2+
package_manager = "npm"
3+
4+
[features]
5+
resolution = true
6+
skip-lint = false
7+
8+
[programs.localnet]
9+
stop_loss_vault = "Hc3STUtyD3fQJgZ2qek8GGddY3TRTdtaapwXFFP1gsYj"
10+
11+
[provider]
12+
cluster = "localnet"
13+
wallet = "~/.config/solana/id.json"
14+
15+
[scripts]
16+
test = "cargo test"
17+
18+
[hooks]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[workspace]
2+
members = [
3+
"programs/*"
4+
]
5+
resolver = "2"
6+
7+
[profile.release]
8+
overflow-checks = true
9+
lto = "fat"
10+
codegen-units = 1
11+
[profile.release.build-override]
12+
opt-level = 3
13+
incremental = false
14+
codegen-units = 1
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Migrations are an early feature. Currently, they're nothing more than this
2+
// single deploy script that's invoked from the CLI, injecting a provider
3+
// configured from the workspace's Anchor.toml.
4+
5+
import * as anchor from "@anchor-lang/core";
6+
7+
module.exports = async function (provider: anchor.AnchorProvider) {
8+
// Configure client to use the provider.
9+
anchor.setProvider(provider);
10+
11+
// Add your deploy script here.
12+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"license": "ISC",
3+
"scripts": {
4+
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
5+
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
6+
},
7+
"dependencies": {
8+
"@anchor-lang/core": "^1.0.0-rc.5"
9+
},
10+
"devDependencies": {
11+
"@types/bn.js": "^5.1.0",
12+
"typescript": "^5.7.3",
13+
"prettier": "^2.6.2"
14+
}
15+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[package]
2+
name = "stop-loss-vault"
3+
version = "0.1.0"
4+
description = "Created with Anchor"
5+
edition = "2021"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "stop_loss_vault"
10+
11+
[features]
12+
default = []
13+
cpi = ["no-entrypoint"]
14+
no-entrypoint = []
15+
no-idl = []
16+
no-log-ix-name = []
17+
idl-build = ["anchor-lang/idl-build"]
18+
anchor-debug = []
19+
custom-heap = []
20+
custom-panic = []
21+
22+
23+
[dependencies]
24+
anchor-lang = "1.0.0-rc.5"
25+
26+
[dev-dependencies]
27+
litesvm = "0.10.0"
28+
solana-message = "3.0.1"
29+
solana-transaction = "3.0.2"
30+
solana-signer = "3.0.0"
31+
solana-keypair = "3.0.1"
32+
33+
34+
[lints.rust]
35+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
use anchor_lang::prelude::*;
2+
3+
#[constant]
4+
pub const SEED: &str = "anchor";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use anchor_lang::prelude::*;
2+
3+
#[error_code]
4+
pub enum ErrorCode {
5+
#[msg("Custom error message")]
6+
CustomError,
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub mod initialize;
2+
3+
pub use initialize::*;

0 commit comments

Comments
 (0)