diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40a0a84c..a8c588b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: - name: Lint programs env: RISC0_SKIP_BUILD: "1" - run: cargo clippy -p "*programs" -- -D warnings + run: cargo clippy -p "*program" -- -D warnings unit-tests: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 4664b8ce..3f973541 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,17 +106,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "amm" -version = "0.1.0" -dependencies = [ - "amm_core", - "lee", - "lee_core", - "programs", - "token_core", -] - [[package]] name = "amm_core" version = "0.1.0" @@ -127,6 +116,17 @@ dependencies = [ "serde", ] +[[package]] +name = "amm_program" +version = "0.1.0" +dependencies = [ + "amm_core", + "lee", + "lee_core", + "programs", + "token_core", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -514,15 +514,6 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4858a9d740c5007a9069007c3b4e91152d0506f13c1b31dd49051fd537656156" -[[package]] -name = "associated_token_account" -version = "0.1.0" -dependencies = [ - "associated_token_account_core", - "lee_core", - "token_core", -] - [[package]] name = "associated_token_account_core" version = "0.1.0" @@ -532,6 +523,15 @@ dependencies = [ "serde", ] +[[package]] +name = "associated_token_account_program" +version = "0.1.0" +dependencies = [ + "associated_token_account_core", + "lee_core", + "token_core", +] + [[package]] name = "astral-tokio-tar" version = "0.6.2" @@ -752,14 +752,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "authenticated_transfer" -version = "0.1.0" -dependencies = [ - "authenticated_transfer_core", - "lee_core", -] - [[package]] name = "authenticated_transfer_core" version = "0.1.0" @@ -767,6 +759,14 @@ dependencies = [ "serde", ] +[[package]] +name = "authenticated_transfer_program" +version = "0.1.0" +dependencies = [ + "authenticated_transfer_core", + "lee_core", +] + [[package]] name = "autocfg" version = "1.5.1" @@ -1147,7 +1147,15 @@ dependencies = [ ] [[package]] -name = "bridge" +name = "bridge_core" +version = "0.1.0" +dependencies = [ + "lee_core", + "serde", +] + +[[package]] +name = "bridge_program" version = "0.1.0" dependencies = [ "authenticated_transfer_core", @@ -1156,14 +1164,6 @@ dependencies = [ "vault_core", ] -[[package]] -name = "bridge_core" -version = "0.1.0" -dependencies = [ - "lee_core", - "serde", -] - [[package]] name = "bs58" version = "0.5.1" @@ -1471,14 +1471,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" -[[package]] -name = "clock" -version = "0.1.0" -dependencies = [ - "clock_core", - "lee_core", -] - [[package]] name = "clock_core" version = "0.1.0" @@ -1487,6 +1479,14 @@ dependencies = [ "lee_core", ] +[[package]] +name = "clock_program" +version = "0.1.0" +dependencies = [ + "clock_core", + "lee_core", +] + [[package]] name = "cmov" version = "0.5.4" @@ -2672,7 +2672,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] -name = "faucet" +name = "faucet_core" +version = "0.1.0" +dependencies = [ + "lee_core", + "serde", +] + +[[package]] +name = "faucet_program" version = "0.1.0" dependencies = [ "authenticated_transfer_core", @@ -2681,14 +2689,6 @@ dependencies = [ "vault_core", ] -[[package]] -name = "faucet_core" -version = "0.1.0" -dependencies = [ - "lee_core", - "serde", -] - [[package]] name = "fd-lock" version = "4.0.4" @@ -7161,7 +7161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] -name = "pinata" +name = "pinata_program" version = "0.1.0" dependencies = [ "lee_core", @@ -7169,7 +7169,7 @@ dependencies = [ ] [[package]] -name = "pinata_token" +name = "pinata_token_program" version = "0.1.0" dependencies = [ "lee_core", @@ -7331,7 +7331,7 @@ dependencies = [ ] [[package]] -name = "privacy_preserving_circuit" +name = "privacy_preserving_circuit_program" version = "0.1.0" dependencies = [ "lee_core", @@ -7443,10 +7443,10 @@ dependencies = [ name = "programs" version = "0.1.0" dependencies = [ - "amm", "amm_core", - "associated_token_account", + "amm_program", "associated_token_account_core", + "associated_token_account_program", "authenticated_transfer_core", "bridge_core", "build_utils", @@ -7455,8 +7455,8 @@ dependencies = [ "lee", "lee_core", "risc0-zkvm", - "token", "token_core", + "token_program", "vault_core", ] @@ -9973,14 +9973,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "token" -version = "0.1.0" -dependencies = [ - "lee_core", - "token_core", -] - [[package]] name = "token_core" version = "0.1.0" @@ -9990,6 +9982,14 @@ dependencies = [ "serde", ] +[[package]] +name = "token_program" +version = "0.1.0" +dependencies = [ + "lee_core", + "token_core", +] + [[package]] name = "tokio" version = "1.52.3" @@ -10786,15 +10786,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "vault" -version = "0.1.0" -dependencies = [ - "authenticated_transfer_core", - "lee_core", - "vault_core", -] - [[package]] name = "vault_core" version = "0.1.0" @@ -10804,6 +10795,15 @@ dependencies = [ "serde", ] +[[package]] +name = "vault_program" +version = "0.1.0" +dependencies = [ + "authenticated_transfer_core", + "lee_core", + "vault_core", +] + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin index 19016a87..e0a383b5 100644 Binary files a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin and b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin differ diff --git a/artifacts/lez/programs/amm.bin b/artifacts/lez/programs/amm.bin index 6fbb20b1..1cd07ff0 100644 Binary files a/artifacts/lez/programs/amm.bin and b/artifacts/lez/programs/amm.bin differ diff --git a/artifacts/lez/programs/associated_token_account.bin b/artifacts/lez/programs/associated_token_account.bin index 81ff6f6c..0a5310b4 100644 Binary files a/artifacts/lez/programs/associated_token_account.bin and b/artifacts/lez/programs/associated_token_account.bin differ diff --git a/artifacts/lez/programs/authenticated_transfer.bin b/artifacts/lez/programs/authenticated_transfer.bin index 11d9e58c..5e2cf804 100644 Binary files a/artifacts/lez/programs/authenticated_transfer.bin and b/artifacts/lez/programs/authenticated_transfer.bin differ diff --git a/artifacts/lez/programs/bridge.bin b/artifacts/lez/programs/bridge.bin index f4465fda..2c45ef05 100644 Binary files a/artifacts/lez/programs/bridge.bin and b/artifacts/lez/programs/bridge.bin differ diff --git a/artifacts/lez/programs/clock.bin b/artifacts/lez/programs/clock.bin index 21a6ce26..2141c3bc 100644 Binary files a/artifacts/lez/programs/clock.bin and b/artifacts/lez/programs/clock.bin differ diff --git a/artifacts/lez/programs/faucet.bin b/artifacts/lez/programs/faucet.bin index 40057802..8f79b4a5 100644 Binary files a/artifacts/lez/programs/faucet.bin and b/artifacts/lez/programs/faucet.bin differ diff --git a/artifacts/lez/programs/pinata.bin b/artifacts/lez/programs/pinata.bin index 5c0da828..47aedc8d 100644 Binary files a/artifacts/lez/programs/pinata.bin and b/artifacts/lez/programs/pinata.bin differ diff --git a/artifacts/lez/programs/pinata_token.bin b/artifacts/lez/programs/pinata_token.bin index ebeb449a..51b744e1 100644 Binary files a/artifacts/lez/programs/pinata_token.bin and b/artifacts/lez/programs/pinata_token.bin differ diff --git a/artifacts/lez/programs/token.bin b/artifacts/lez/programs/token.bin index c773fe90..8285ab49 100644 Binary files a/artifacts/lez/programs/token.bin and b/artifacts/lez/programs/token.bin differ diff --git a/artifacts/lez/programs/vault.bin b/artifacts/lez/programs/vault.bin index 5b27b9ce..77250083 100644 Binary files a/artifacts/lez/programs/vault.bin and b/artifacts/lez/programs/vault.bin differ diff --git a/lee/privacy_preserving_circuit/Cargo.toml b/lee/privacy_preserving_circuit/Cargo.toml index 2004fc77..26dfa132 100644 --- a/lee/privacy_preserving_circuit/Cargo.toml +++ b/lee/privacy_preserving_circuit/Cargo.toml @@ -1,9 +1,14 @@ [package] -name = "privacy_preserving_circuit" +name = "privacy_preserving_circuit_program" version = "0.1.0" edition = "2024" license = { workspace = true } +# Renaming binary to privacy_preserving_circuit for better looking. +[[bin]] +name = "privacy_preserving_circuit" +path = "src/main.rs" + [lints] workspace = true diff --git a/lez/programs/Cargo.toml b/lez/programs/Cargo.toml index bd232628..06038d7f 100644 --- a/lez/programs/Cargo.toml +++ b/lez/programs/Cargo.toml @@ -67,9 +67,9 @@ artifacts = ["dep:build_utils", "dep:lee"] programs = [ "dep:lee_core", "dep:risc0-zkvm", - "dep:amm", - "dep:associated_token_account", - "dep:token", + "dep:amm_program", + "dep:associated_token_account_program", + "dep:token_program", "dep:amm_core", "dep:associated_token_account_core", "dep:authenticated_transfer_core", @@ -93,9 +93,9 @@ faucet_core = { workspace = true, optional = true } token_core = { workspace = true, optional = true } vault_core = { workspace = true, optional = true } -amm = { path = "amm", optional = true } -associated_token_account = { path = "associated_token_account", optional = true } -token = { path = "token", optional = true } +amm_program = { path = "amm", optional = true } +associated_token_account_program = { path = "associated_token_account", optional = true } +token_program = { path = "token", optional = true } [build-dependencies] build_utils = { workspace = true, optional = true } diff --git a/lez/programs/amm/Cargo.toml b/lez/programs/amm/Cargo.toml index 3a182a34..171efbd9 100644 --- a/lez/programs/amm/Cargo.toml +++ b/lez/programs/amm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "amm" +name = "amm_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/amm/src/main.rs b/lez/programs/amm/src/main.rs index 2ab90e09..9d4afc63 100644 --- a/lez/programs/amm/src/main.rs +++ b/lez/programs/amm/src/main.rs @@ -41,7 +41,7 @@ fn main() { ] = pre_states .try_into() .expect("Transfer instruction requires exactly seven accounts"); - amm::new_definition::new_definition( + amm_program::new_definition::new_definition( pool, vault_a, vault_b, @@ -70,7 +70,7 @@ fn main() { ] = pre_states .try_into() .expect("Transfer instruction requires exactly seven accounts"); - amm::add::add_liquidity( + amm_program::add::add_liquidity( pool, vault_a, vault_b, @@ -100,7 +100,7 @@ fn main() { ] = pre_states .try_into() .expect("Transfer instruction requires exactly seven accounts"); - amm::remove::remove_liquidity( + amm_program::remove::remove_liquidity( pool, vault_a, vault_b, @@ -122,7 +122,7 @@ fn main() { let [pool, vault_a, vault_b, user_holding_a, user_holding_b] = pre_states .try_into() .expect("SwapExactInput instruction requires exactly five accounts"); - amm::swap::swap_exact_input( + amm_program::swap::swap_exact_input( pool, vault_a, vault_b, @@ -141,7 +141,7 @@ fn main() { let [pool, vault_a, vault_b, user_holding_a, user_holding_b] = pre_states .try_into() .expect("SwapExactOutput instruction requires exactly five accounts"); - amm::swap::swap_exact_output( + amm_program::swap::swap_exact_output( pool, vault_a, vault_b, diff --git a/lez/programs/associated_token_account/Cargo.toml b/lez/programs/associated_token_account/Cargo.toml index 08eff627..494b179f 100644 --- a/lez/programs/associated_token_account/Cargo.toml +++ b/lez/programs/associated_token_account/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "associated_token_account" +name = "associated_token_account_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/associated_token_account/src/main.rs b/lez/programs/associated_token_account/src/main.rs index 9f96b0d2..2eaa2f3c 100644 --- a/lez/programs/associated_token_account/src/main.rs +++ b/lez/programs/associated_token_account/src/main.rs @@ -19,7 +19,7 @@ fn main() { let [owner, token_definition, ata_account] = pre_states .try_into() .expect("Create instruction requires exactly three accounts"); - associated_token_account::create::create_associated_token_account( + associated_token_account_program::create::create_associated_token_account( owner, token_definition, ata_account, @@ -33,7 +33,7 @@ fn main() { let [owner, sender_ata, recipient] = pre_states .try_into() .expect("Transfer instruction requires exactly three accounts"); - associated_token_account::transfer::transfer_from_associated_token_account( + associated_token_account_program::transfer::transfer_from_associated_token_account( owner, sender_ata, recipient, @@ -48,7 +48,7 @@ fn main() { let [owner, holder_ata, token_definition] = pre_states .try_into() .expect("Burn instruction requires exactly three accounts"); - associated_token_account::burn::burn_from_associated_token_account( + associated_token_account_program::burn::burn_from_associated_token_account( owner, holder_ata, token_definition, diff --git a/lez/programs/authenticated_transfer/Cargo.toml b/lez/programs/authenticated_transfer/Cargo.toml index 3da54204..d586acdc 100644 --- a/lez/programs/authenticated_transfer/Cargo.toml +++ b/lez/programs/authenticated_transfer/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "authenticated_transfer" +name = "authenticated_transfer_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/bridge/Cargo.toml b/lez/programs/bridge/Cargo.toml index 7c8d59ee..d7762f1f 100644 --- a/lez/programs/bridge/Cargo.toml +++ b/lez/programs/bridge/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bridge" +name = "bridge_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/clock/Cargo.toml b/lez/programs/clock/Cargo.toml index 9b39dbbd..0c51a69d 100644 --- a/lez/programs/clock/Cargo.toml +++ b/lez/programs/clock/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "clock" +name = "clock_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/faucet/Cargo.toml b/lez/programs/faucet/Cargo.toml index b915372f..c1f4f426 100644 --- a/lez/programs/faucet/Cargo.toml +++ b/lez/programs/faucet/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "faucet" +name = "faucet_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/pinata/Cargo.toml b/lez/programs/pinata/Cargo.toml index 58deb6e4..7a6ad121 100644 --- a/lez/programs/pinata/Cargo.toml +++ b/lez/programs/pinata/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pinata" +name = "pinata_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/pinata_token/Cargo.toml b/lez/programs/pinata_token/Cargo.toml index 4de01639..476409ec 100644 --- a/lez/programs/pinata_token/Cargo.toml +++ b/lez/programs/pinata_token/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pinata_token" +name = "pinata_token_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/token/Cargo.toml b/lez/programs/token/Cargo.toml index 4eb26969..2b23a9eb 100644 --- a/lez/programs/token/Cargo.toml +++ b/lez/programs/token/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "token" +name = "token_program" version = "0.1.0" edition = "2024" license = { workspace = true } diff --git a/lez/programs/token/src/main.rs b/lez/programs/token/src/main.rs index ec33aef8..6e5cb8df 100644 --- a/lez/programs/token/src/main.rs +++ b/lez/programs/token/src/main.rs @@ -7,7 +7,7 @@ //! for more details. use lee_core::program::{ProgramInput, ProgramOutput, read_lee_inputs}; -use token::core::Instruction; +use token_program::core::Instruction; fn main() { let ( @@ -29,13 +29,13 @@ fn main() { let [sender, recipient] = pre_states .try_into() .expect("Transfer instruction requires exactly two accounts"); - token::transfer::transfer(sender, recipient, balance_to_move) + token_program::transfer::transfer(sender, recipient, balance_to_move) } Instruction::NewFungibleDefinition { name, total_supply } => { let [definition_account, holding_account] = pre_states .try_into() .expect("NewFungibleDefinition instruction requires exactly two accounts"); - token::new_definition::new_fungible_definition( + token_program::new_definition::new_fungible_definition( definition_account, holding_account, name, @@ -49,7 +49,7 @@ fn main() { let [definition_account, holding_account, metadata_account] = pre_states .try_into() .expect("NewDefinitionWithMetadata instruction requires exactly three accounts"); - token::new_definition::new_definition_with_metadata( + token_program::new_definition::new_definition_with_metadata( definition_account, holding_account, metadata_account, @@ -61,25 +61,25 @@ fn main() { let [definition_account, account_to_initialize] = pre_states .try_into() .expect("InitializeAccount instruction requires exactly two accounts"); - token::initialize::initialize_account(definition_account, account_to_initialize) + token_program::initialize::initialize_account(definition_account, account_to_initialize) } Instruction::Burn { amount_to_burn } => { let [definition_account, user_holding_account] = pre_states .try_into() .expect("Burn instruction requires exactly two accounts"); - token::burn::burn(definition_account, user_holding_account, amount_to_burn) + token_program::burn::burn(definition_account, user_holding_account, amount_to_burn) } Instruction::Mint { amount_to_mint } => { let [definition_account, user_holding_account] = pre_states .try_into() .expect("Mint instruction requires exactly two accounts"); - token::mint::mint(definition_account, user_holding_account, amount_to_mint) + token_program::mint::mint(definition_account, user_holding_account, amount_to_mint) } Instruction::PrintNft => { let [master_account, printed_account] = pre_states .try_into() .expect("PrintNft instruction requires exactly two accounts"); - token::print_nft::print_nft(master_account, printed_account) + token_program::print_nft::print_nft(master_account, printed_account) } }; diff --git a/lez/programs/vault/Cargo.toml b/lez/programs/vault/Cargo.toml index 48eee689..4faed055 100644 --- a/lez/programs/vault/Cargo.toml +++ b/lez/programs/vault/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vault" +name = "vault_program" version = "0.1.0" edition = "2024" license = { workspace = true }