Skip to content

To tidy up the update script #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to

## [Unreleased]

## [2.0.0] - 2025-06-07

## Changed

- All: Updates the soroban SDK to latest stable version 22 ([#411])
Expand Down Expand Up @@ -34,6 +36,7 @@ and this project adheres to
- All: Adds a mechanism to change the admin of a contract that ensures safety of transition ([#448])
- All: Adds constructors instead of using `initialize` (#[455])
- Factory, Trader, Vesting: adds `update_config` ([#457])
- Set phoenix version v2.0.0 ([#461])

## Fixed

Expand Down Expand Up @@ -66,6 +69,7 @@ and this project adheres to
[#455]: https://github.com/Phoenix-Protocol-Group/phoenix-contracts/pull/455
[#457]: https://github.com/Phoenix-Protocol-Group/phoenix-contracts/pull/457
[#458]: https://github.com/Phoenix-Protocol-Group/phoenix-contracts/pull/458
[#461]: https://github.com/Phoenix-Protocol-Group/phoenix-contracts/pull/461

## [1.1.0] - 2024-08-27

Expand Down
23 changes: 12 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["contracts/*", "packages/*"]
resolver = "2"

[workspace.package]
version = "1.1.0"
version = "2.0.0"
edition = "2021"
license = "GPL-3.0"
repository = "https://github.com/Phoenix-Protocol-Group/phoenix-contracts"
Expand All @@ -20,6 +20,12 @@ soroban-token-sdk = "22.0.7"
test-case = "3.3"
pretty_assertions = "1.4.0"

[workspace.lints.clippy]
too_many_arguments = "allow"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }

[profile.release]
opt-level = "z"
overflow-checks = true
Expand Down
6 changes: 3 additions & 3 deletions contracts/factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ crate-type = ["cdylib"]
testutils = ["soroban-sdk/testutils"]
upgrade = []

[lints]
workspace = true

[dependencies]
soroban-sdk = { workspace = true }
phoenix = { workspace = true }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
test-case = { workspace = true }
4 changes: 0 additions & 4 deletions contracts/factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub struct Factory;

#[allow(dead_code)]
pub trait FactoryTrait {
#[allow(clippy::too_many_arguments)]
fn create_liquidity_pool(
env: Env,
sender: Address,
Expand Down Expand Up @@ -84,7 +83,6 @@ pub trait FactoryTrait {

#[contractimpl]
impl FactoryTrait for Factory {
#[allow(clippy::too_many_arguments)]
fn create_liquidity_pool(
env: Env,
sender: Address,
Expand Down Expand Up @@ -182,7 +180,6 @@ impl FactoryTrait for Factory {
lp_contract_address
}

#[allow(clippy::too_many_arguments)]
fn update_config(
env: Env,
multihop_address: Option<Address>,
Expand Down Expand Up @@ -543,7 +540,6 @@ impl FactoryTrait for Factory {

#[contractimpl]
impl Factory {
#[allow(clippy::too_many_arguments)]
pub fn __constructor(
env: Env,
admin: Address,
Expand Down
1 change: 0 additions & 1 deletion contracts/factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub mod token_contract {
);
}

#[allow(clippy::too_many_arguments)]
pub mod stake_contract {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_stake.wasm"
Expand Down
11 changes: 0 additions & 11 deletions contracts/factory/src/tests/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,70 +10,60 @@ pub const ONE_DAY: u64 = 86400;
const TOKEN_WASM: &[u8] =
include_bytes!("../../../../target/wasm32-unknown-unknown/release/soroban_token_contract.wasm");

#[allow(clippy::too_many_arguments)]
#[cfg(feature = "upgrade")]
pub mod old_factory {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_factory.wasm");
}

#[allow(clippy::too_many_arguments)]
#[cfg(feature = "upgrade")]
pub fn install_old_multihop_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_multihop.wasm");
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
#[cfg(feature = "upgrade")]
pub fn install_old_token_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_token_contract.wasm");
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
#[cfg(feature = "upgrade")]
pub fn old_lp_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_pho_usdc_pool.wasm");
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
#[cfg(feature = "upgrade")]
pub fn old_stake_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_pho_usdc_stake.wasm");
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
pub(crate) fn install_latest_factory(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_factory.wasm"
);
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
pub mod lp_contract {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_pool.wasm"
);
}

#[allow(clippy::too_many_arguments)]
pub mod stable_lp {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_pool_stable.wasm"
);
}

#[allow(clippy::too_many_arguments)]
pub mod stake_contract {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_stake.wasm"
);
}

#[allow(clippy::too_many_arguments)]
pub fn install_multihop_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_multihop.wasm"
Expand All @@ -93,7 +83,6 @@ pub fn install_token_wasm(env: &Env) -> BytesN<32> {
env.deployer().upload_contract_wasm(token_contract::WASM)
}

#[allow(clippy::too_many_arguments)]
pub fn install_stake_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_stake.wasm"
Expand Down
6 changes: 3 additions & 3 deletions contracts/multihop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ crate-type = ["cdylib"]
testutils = ["soroban-sdk/testutils"]
upgrade = []

[lints]
workspace = true

[dependencies]
soroban-sdk = { workspace = true }
phoenix = { workspace = true }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
2 changes: 0 additions & 2 deletions contracts/multihop/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub struct Multihop;

#[allow(dead_code)]
pub trait MultihopTrait {
#[allow(clippy::too_many_arguments)]
fn swap(
env: Env,
recipient: Address,
Expand Down Expand Up @@ -74,7 +73,6 @@ pub trait MultihopTrait {

#[contractimpl]
impl MultihopTrait for Multihop {
#[allow(clippy::too_many_arguments)]
fn swap(
env: Env,
recipient: Address,
Expand Down
3 changes: 0 additions & 3 deletions contracts/multihop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ mod error;
mod storage;
mod utils;

#[allow(clippy::too_many_arguments)]
pub mod xyk_pool {
// The import will code generate:
// - A ContractClient type that can be used to invoke functions on the contract.
Expand All @@ -14,14 +13,12 @@ pub mod xyk_pool {
);
}

#[allow(clippy::too_many_arguments)]
pub mod stable_pool {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_pool_stable.wasm"
);
}

#[allow(clippy::too_many_arguments)]
pub mod factory_contract {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_factory.wasm"
Expand Down
5 changes: 0 additions & 5 deletions contracts/multihop/src/tests/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ use soroban_sdk::{
};
use soroban_sdk::{vec, String};

#[allow(clippy::too_many_arguments)]
pub mod old_multihop {
soroban_sdk::contractimport!(file = "../../.wasm_binaries_mainnet/live_multihop.wasm");
}

#[allow(clippy::too_many_arguments)]
pub mod latest_multihop {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_multihop.wasm"
Expand Down Expand Up @@ -57,15 +55,13 @@ pub fn deploy_token_contract<'a>(env: &Env, admin: &Address) -> token_contract::
)
}

#[allow(clippy::too_many_arguments)]
pub fn install_stake_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_stake.wasm"
);
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
pub fn install_multihop_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_multihop.wasm"
Expand Down Expand Up @@ -124,7 +120,6 @@ pub fn deploy_and_initialize_factory(env: &Env, admin: Address) -> factory_contr
factory_client
}

#[allow(clippy::too_many_arguments)]
pub fn deploy_and_initialize_pool(
env: &Env,
factory: &factory_contract::Client,
Expand Down
6 changes: 3 additions & 3 deletions contracts/pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ crate-type = ["cdylib"]
testutils = ["soroban-sdk/testutils"]
upgrade = []

[lints]
workspace = true

[dependencies]
soroban-decimal = { workspace = true }
phoenix = { workspace = true }
num-integer = { workspace = true }
soroban-sdk = { workspace = true }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
pretty_assertions = { workspace = true }
Expand Down
Loading
Loading