diff --git a/Anchor.toml b/Anchor.toml index 145e0cb..217ed8b 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -2,7 +2,7 @@ seeds = false skip-lint = false [programs.localnet] -solana_timelock = "TiMEYuk7rCBAFYMvhN3hae9PRc1NUYL71Zu3MCaCBVe" +solana_timelock = "tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF" [registry] url = "https://api.apr.dev" diff --git a/Cargo.lock b/Cargo.lock index 41985bd..32c64a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" dependencies = [ "anchor-syn", - "borsh-derive-internal 0.9.3", + "borsh-derive-internal 0.10.3", "proc-macro2", "quote", "syn 1.0.109", @@ -149,7 +149,7 @@ dependencies = [ "arrayref", "base64 0.13.1", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bytemuck", "getrandom 0.2.10", "solana-program", @@ -412,7 +412,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -765,15 +765,6 @@ dependencies = [ "ahash 0.7.6", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - [[package]] name = "hashbrown" version = "0.13.2" @@ -1456,11 +1447,18 @@ dependencies = [ "syn 2.0.32", ] +[[package]] +name = "solana-security-txt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" + [[package]] name = "solana_timelock" version = "0.1.1" dependencies = [ "anchor-lang", + "solana-security-txt", ] [[package]] diff --git a/README.md b/README.md index 826de24..0d3e9dc 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,12 @@ ![License LGPLv3](https://img.shields.io/badge/License-LGPLv3-violet.svg) A simple program for delayed transaction execution on Solana. Unaudited; use -at your own risk. +at your own risk. ## Why use a timelock? Basically, a timelock can provide extra security and/or decentralization. Benefits include: + - if a deployer key is compromised, users can move their funds out of the protocol before the attacker can upgrade the program - users can verify that new changes to the program or to protocol parameters (e.g., fees) are acceptable - projects can claim some level of decentralization even when a central team (i.e., x Labs) has the ability to update the program and/or protocol parameters @@ -21,8 +22,7 @@ Example usage is demonstrated in [tests/solana_timelock.ts](./tests/solana_timel ## Deployment address -The program is currently live on devnet at -[TiMEYuk7rCBAFYMvhN3hae9PRc1NUYL71Zu3MCaCBVe](https://explorer.solana.com/address/TiMEYuk7rCBAFYMvhN3hae9PRc1NUYL71Zu3MCaCBVe?cluster=devnet). +The program is currently live on +[devnet](https://solscan.io/account/tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF?cluster=custom&customUrl=https%3A%2F%2Fapi.devnet.solana.com) and [mainnet](https://solscan.io/account/tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF) at `tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF`. You may verify that the deployed program matches the source by using the -`anchor verify` command. - +`solana-verify verify-from-repo -um --program-id tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF https://github.com/metaDAOproject/solana-timelock` command. diff --git a/programs/solana_timelock/Cargo.toml b/programs/solana_timelock/Cargo.toml index 9adb47e..ec30323 100644 --- a/programs/solana_timelock/Cargo.toml +++ b/programs/solana_timelock/Cargo.toml @@ -22,3 +22,4 @@ default = [] [dependencies] anchor-lang = "0.29.0" +solana-security-txt = "1.1.1" \ No newline at end of file diff --git a/programs/solana_timelock/src/lib.rs b/programs/solana_timelock/src/lib.rs index c6c2edb..ce3a8c1 100644 --- a/programs/solana_timelock/src/lib.rs +++ b/programs/solana_timelock/src/lib.rs @@ -7,8 +7,24 @@ use anchor_lang::solana_program; use anchor_lang::solana_program::instruction::Instruction; use std::convert::Into; use std::ops::Deref; +#[cfg(not(feature = "no-entrypoint"))] +use solana_security_txt::security_txt; + +#[cfg(not(feature = "no-entrypoint"))] +security_txt! { + name: "solana_timelock", + project_url: "https://themetadao.org", + contacts: "email:metaproph3t@protonmail.com", + policy: "The market will decide whether we pay a bug bounty.", + source_code: "https://github.com/metaDAOproject/solana-timelock", + source_release: "v0", + auditors: "None", + acknowledgements: "DCF = (CF1 / (1 + r)^1) + (CF2 / (1 + r)^2) + ... (CFn / (1 + r)^n)" +} + +declare_id!("tiME1hz9F5C5ZecbvE5z6Msjy8PKfTqo1UuRYXfndKF"); + -declare_id!("TiMEYuk7rCBAFYMvhN3hae9PRc1NUYL71Zu3MCaCBVe"); #[account] pub struct Timelock {