Skip to content

Commit 32ba5ac

Browse files
author
CodeWallet Engineering
committed
removed token from program names, added security.txt
1 parent 2dc5d54 commit 32ba5ac

File tree

202 files changed

+129
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+129
-94
lines changed

README.md

Lines changed: 2 additions & 2 deletions

SECURITY.md

Lines changed: 2 additions & 2 deletions

splitter-token/.ammanrc.js renamed to splitter/.ammanrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const fs = require('fs');
66
// Run `yarn run build` to generate the `.js` file
77

88
const localDeployDir = path.join(__dirname, 'target', 'deploy');
9-
const PROGRAM_ADDRESS_SPLITTER = require("./client/idl/splitter_token.json").metadata.address;
9+
const PROGRAM_ADDRESS_SPLITTER = require("./client/idl/splitter.json").metadata.address;
1010

1111
function localDeployPath(programName) {
1212
return path.join(localDeployDir, `${programName}.so`);
@@ -16,7 +16,7 @@ const programs = {
1616
splitter: {
1717
label: 'Splitter Program',
1818
programId: PROGRAM_ADDRESS_SPLITTER,
19-
deployPath: localDeployPath('splitter_token')
19+
deployPath: localDeployPath('splitter')
2020
},
2121
};
2222

File renamed without changes.
File renamed without changes.

splitter-token/Anchor.toml renamed to splitter/Anchor.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
seeds = false
33

44
[programs.localnet]
5-
splitter_token = "spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW"
5+
splitter = "spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW"
66

77
[programs.devnet]
8-
splitter_token = "spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW"
8+
splitter = "spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW"
99

1010
[registry]
1111
url = "https://anchor.projectserum.com"
@@ -19,5 +19,5 @@ test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
1919

2020
[workspace]
2121
members = [
22-
"programs/splitter-token",
22+
"programs/splitter",
2323
]
File renamed without changes.

splitter-token/README.md renamed to splitter/README.md

Lines changed: 4 additions & 4 deletions
File renamed without changes.
File renamed without changes.

splitter-token/client/golang/pkg/accounts_pool.go renamed to splitter/client/golang/pkg/accounts_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/accounts_proof.go renamed to splitter/client/golang/pkg/accounts_proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/address.go renamed to splitter/client/golang/pkg/address.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"crypto/ed25519"

splitter-token/client/golang/pkg/errors.go renamed to splitter/client/golang/pkg/errors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package splitter_token
1+
package splitter
22

3-
type SplitterTokenError uint32
3+
type SplitterError uint32
44

55
const (
66
// Invalid pool state for this instruction
7-
ErrInvalidPoolState SplitterTokenError = iota + 0x1770
7+
ErrInvalidPoolState SplitterError = iota + 0x1770
88

99
//Invalid commitment state for this instruction
1010
ErrInvalidCommitmentState

splitter-token/client/golang/pkg/instructions_close_proof.go renamed to splitter/client/golang/pkg/instructions_close_proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_close_token_account.go renamed to splitter/client/golang/pkg/instructions_close_token_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_initialize_pool.go renamed to splitter/client/golang/pkg/instructions_initialize_pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_initialize_proof.go renamed to splitter/client/golang/pkg/instructions_initialize_proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_open_token_account.go renamed to splitter/client/golang/pkg/instructions_open_token_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_save_recent_root.go renamed to splitter/client/golang/pkg/instructions_save_recent_root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_transfer_with_commitment.go renamed to splitter/client/golang/pkg/instructions_transfer_with_commitment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_update_proof.go renamed to splitter/client/golang/pkg/instructions_update_proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/instructions_verify_proof.go renamed to splitter/client/golang/pkg/instructions_verify_proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"bytes"

splitter-token/client/golang/pkg/program.go renamed to splitter/client/golang/pkg/program.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"crypto/ed25519"

splitter-token/client/golang/pkg/types.go renamed to splitter/client/golang/pkg/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
type DataVersion uint8
44

splitter-token/client/golang/pkg/types_hash.go renamed to splitter/client/golang/pkg/types_hash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import "fmt"
44

splitter-token/client/golang/pkg/types_merkletree.go renamed to splitter/client/golang/pkg/types_merkletree.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"errors"

splitter-token/client/golang/pkg/utils.go renamed to splitter/client/golang/pkg/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package splitter_token
1+
package splitter
22

33
import (
44
"crypto/ed25519"

splitter-token/client/idl/splitter_token.json renamed to splitter/client/idl/splitter.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "0.1.0",
3-
"name": "splitter_token",
3+
"name": "splitter",
44
"instructions": [
55
{
66
"name": "initializePool",
@@ -104,7 +104,15 @@
104104
{
105105
"name": "commitment",
106106
"isMut": false,
107-
"isSigner": false
107+
"isSigner": false,
108+
"docs": [
109+
"If everything is successful, this commitment is added as a leaf node to",
110+
"the program merkle tree.",
111+
"",
112+
"Note: this value is hashed with itself internally to discern between",
113+
"leaf and intermediate nodes; to prevent trivial second pre-image attacks.",
114+
"https://flawed.net.nz/2018/02/21/attacking-merkle-trees-with-a-second-preimage-attack)."
115+
]
108116
},
109117
{
110118
"name": "authority",
@@ -172,7 +180,10 @@
172180
{
173181
"name": "proof",
174182
"isMut": true,
175-
"isSigner": false
183+
"isSigner": false,
184+
"docs": [
185+
"The location of our merkle proof state."
186+
]
176187
},
177188
{
178189
"name": "authority",

splitter-token/client/typescript/package-lock.json renamed to splitter/client/typescript/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

splitter-token/client/typescript/package.json renamed to splitter/client/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "splitter-token",
2+
"name": "splitter",
33
"version": "0.1.0",
44
"description": "",
55
"main": "dist/src/splitter.js",
File renamed without changes.

splitter-token/package-lock.json renamed to splitter/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

splitter-token/programs/splitter-token/Cargo.toml renamed to splitter/programs/splitter/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "splitter-token"
2+
name = "splitter"
33
version = "0.1.0"
44
description = "Created with Anchor"
55
edition = "2021"
66

77
[lib]
88
crate-type = ["cdylib", "lib"]
9-
name = "splitter_token"
9+
name = "splitter"
1010

1111
[features]
1212
no-entrypoint = []
@@ -23,3 +23,4 @@ anchor-lang = "=0.24.2"
2323
anchor-spl = "=0.24.2"
2424
spl-token = "=3.2.0"
2525
solana-program = "=1.9.29"
26+
solana-security-txt = "1.1.0"

splitter-token/programs/splitter-token/src/lib.rs renamed to splitter/programs/splitter/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,24 @@ pub mod error;
1616
pub mod state;
1717
pub mod utils;
1818

19+
#[cfg(not(feature = "no-entrypoint"))]
20+
use {solana_security_txt::security_txt};
21+
22+
#[cfg(not(feature = "no-entrypoint"))]
23+
security_txt! {
24+
name: "Splitter",
25+
project_url: "https://getcode.com",
26+
contacts: "email:[email protected],email:[email protected]",
27+
policy: "https://github.com/code-wallet/code-program-library/blob/main/SECURITY.md",
28+
preferred_languages: "en",
29+
source_code: "https://github.com/code-wallet/code-program-library",
30+
auditors: "OtterSec"
31+
}
32+
1933
declare_id!("spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW");
2034

2135
#[program]
22-
pub mod splitter_token {
36+
pub mod splitter {
2337
use super::*;
2438

2539
pub fn initialize_pool(
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
exports.PROGRAM_NAME = 'splitter_token';
1+
exports.PROGRAM_NAME = 'splitter';
22
exports.PROGRAM_ID = 'spLit2eb13Tz93if6aJM136nUWki5PVUsoEjcUjwpwW';

splitter-token/tests/cases/env.ts renamed to splitter/tests/cases/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as anchor from "@project-serum/anchor";
22
import { Program } from "@project-serum/anchor";
3-
import { TimelockToken } from "../../target/types/timelock_token";
3+
import { Timelock } from "../../target/types/timelock";
44
import { TOKEN_PROGRAM_ID, Token } from "@solana/spl-token";
55
import { Keypair, PublicKey } from "@solana/web3.js";
66
import { logEnvironment, TestEnv } from "../utils/test-env";
@@ -10,7 +10,7 @@ import { PREFIX_MERKLE_TREE } from "../utils/config";
1010
import { MerkleTree } from "../utils/merkle-tree";
1111

1212
export async function newTestEnv(provider: anchor.AnchorProvider): Promise<TestEnv> {
13-
const program = anchor.workspace.TimelockToken as Program<TimelockToken>;
13+
const program = anchor.workspace.Timelock as Program<Timelock>;
1414
const mintAuthority = Keypair.generate();
1515

1616
const payer = Keypair.generate();

splitter-token/tests/main.ts renamed to splitter/tests/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { setEnvironment } from "./utils/config";
55

66
setEnvironment();
77

8-
describe("timelock-token", () => {
8+
describe("timelock", () => {
99
const provider = anchor.AnchorProvider.env()
1010
anchor.setProvider(provider);
1111

File renamed without changes.
File renamed without changes.
File renamed without changes.

splitter-token/tests/utils/test-env.ts renamed to splitter/tests/utils/test-env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as anchor from "@project-serum/anchor";
2-
import { TimelockToken } from "../../target/types/timelock_token";
2+
import { Timelock } from "../../target/types/timelock";
33
import { PublicKey, Keypair } from "@solana/web3.js";
44
import { MerkleTree } from "./merkle-tree";
55

@@ -19,7 +19,7 @@ export interface Pool {
1919

2020
export interface TestEnv {
2121
provider: anchor.AnchorProvider;
22-
program: anchor.Program<TimelockToken>;
22+
program: anchor.Program<Timelock>;
2323
mint: PublicKey;
2424
mintTo: (dest: PublicKey, amount: number) => Promise<void>;
2525

File renamed without changes.
File renamed without changes.
File renamed without changes.

timelock-token/.ammanrc.js renamed to timelock/.ammanrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fs = require('fs');
77
const accountProviders = require("./client/typescript/dist/generated/accounts")
88

99
const localDeployDir = path.join(__dirname, 'target', 'deploy');
10-
const PROGRAM_ADDRESS = require("./client/idl/timelock_token.json").metadata.address;
10+
const PROGRAM_ADDRESS = require("./client/idl/timelock.json").metadata.address;
1111

1212
function localDeployPath(programName) {
1313
return path.join(localDeployDir, `${programName}.so`);
@@ -17,7 +17,7 @@ const programs = {
1717
timelock: {
1818
label: 'Timelock Program',
1919
programId: PROGRAM_ADDRESS,
20-
deployPath: localDeployPath('timelock_token')
20+
deployPath: localDeployPath('timelock')
2121
},
2222
};
2323

File renamed without changes.
File renamed without changes.

timelock-token/Anchor.toml renamed to timelock/Anchor.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
seeds = false
33

44
[programs.localnet]
5-
timelock_token = "time2Z2SCnn3qYg3ULKVtdkh8YmZ5jFdKicnA1W2YnJ"
5+
timelock = "time2Z2SCnn3qYg3ULKVtdkh8YmZ5jFdKicnA1W2YnJ"
66

77
[programs.devnet]
8-
timelock_token = "time2Z2SCnn3qYg3ULKVtdkh8YmZ5jFdKicnA1W2YnJ"
8+
timelock = "time2Z2SCnn3qYg3ULKVtdkh8YmZ5jFdKicnA1W2YnJ"
99

1010
[registry]
1111
url = "https://anchor.projectserum.com"
File renamed without changes.

0 commit comments

Comments
 (0)