Skip to content
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

Stake: using tag v1.0.0 impl #429

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c169fc8
adds stake from tag v1.0.0
gangov Jan 27, 2025
9936644
deletes stake_rewards contract
gangov Jan 27, 2025
dc545a6
lints
gangov Jan 27, 2025
037b49f
brings back the TTL extension in storage of Stake
gangov Jan 27, 2025
81b3934
keys for admin
gangov Jan 27, 2025
fe10053
instance bump for every msg
gangov Jan 27, 2025
a2f8c23
extends the ttl in distribution
gangov Jan 27, 2025
915a048
assertion in test
gangov Jan 27, 2025
64a3082
assertions about auth in bond
gangov Jan 27, 2025
bd4cdf3
better math in stake
gangov Jan 28, 2025
d7a73ff
fixes .unwrap()
gangov Jan 28, 2025
b45597e
logs
gangov Jan 28, 2025
b89193f
more logs
gangov Jan 28, 2025
9c10207
adds missing Error
gangov Jan 28, 2025
bcedbc8
[no ci] test for stake upgrade
gangov Jan 29, 2025
8e0fb59
[no ci] adds old deprecated methods
gangov Jan 29, 2025
c9b14c4
wip
gangov Jan 29, 2025
8dac7b3
[no ci] wip
gangov Jan 30, 2025
dff85f7
solves the distribute rewards err
gangov Jan 30, 2025
e69a2af
[no ci] before migration
gangov Jan 30, 2025
f5640eb
[no ci]] adds deprecated methods for rewards query
gangov Jan 30, 2025
6d5a3cb
migration works and users are able to withdraw old rewards
gangov Jan 30, 2025
ec32a56
wip unbonding fails
gangov Jan 31, 2025
dc503f6
[no ci] new error
gangov Jan 31, 2025
83db94c
[no ci] wip
gangov Jan 31, 2025
fbeded9
Merge pull request #432 from Phoenix-Protocol-Group/430-test-for-migr…
gangov Jan 31, 2025
c4edfc7
new error
gangov Jan 31, 2025
21a19b0
wip - bond fails because of missing distribution
gangov Jan 31, 2025
0c39fb9
adds migration for the distributions
gangov Feb 3, 2025
3c36690
migration test in bash
gangov Feb 4, 2025
106fb62
[no ci] gitignore update
gangov Feb 4, 2025
cc5063a
migration bash
gangov Feb 4, 2025
8785bc3
tesyts
gangov Feb 4, 2025
fab4a5f
adds finala assertion
gangov Feb 4, 2025
62c48bc
adds missing 0
gangov Feb 4, 2025
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
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ target/
cobertura.xml

**/test_snapshots
.stellar/
11 changes: 0 additions & 11 deletions Cargo.lock

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

8 changes: 0 additions & 8 deletions contracts/pool_stable/src/tests/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ pub fn install_stake_wasm(env: &Env) -> BytesN<32> {
env.deployer().upload_contract_wasm(WASM)
}

pub fn install_stake_rewards_wasm(env: &Env) -> BytesN<32> {
soroban_sdk::contractimport!(
file = "../../target/wasm32-unknown-unknown/release/phoenix_stake_rewards.wasm"
);
env.deployer().upload_contract_wasm(WASM)
}

#[allow(clippy::too_many_arguments)]
pub fn deploy_stable_liquidity_pool_contract<'a>(
env: &Env,
Expand Down Expand Up @@ -69,7 +62,6 @@ pub fn deploy_stable_liquidity_pool_contract<'a>(

let token_wasm_hash = install_token_wasm(env);
let stake_wasm_hash = install_stake_wasm(env);
let _stake_rewards_wasm_hash = install_stake_rewards_wasm(env);

let lp_init_info = LiquidityPoolInitInfo {
admin,
Expand Down
6 changes: 1 addition & 5 deletions contracts/pool_stable/src/tests/stake_deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ extern crate std;
use phoenix::utils::{LiquidityPoolInitInfo, StakeInitInfo, TokenInitInfo};
use soroban_sdk::{testutils::Address as _, Address, Env, String};

use super::setup::{
deploy_stable_liquidity_pool_contract, deploy_token_contract, install_stake_rewards_wasm,
};
use super::setup::{deploy_stable_liquidity_pool_contract, deploy_token_contract};
use crate::contract::{StableLiquidityPool, StableLiquidityPoolClient};
use crate::tests::setup::{install_stake_wasm, install_token_wasm};
use crate::{
Expand Down Expand Up @@ -101,7 +99,6 @@ fn second_pool_stable_deployment_should_fail() {

let token_wasm_hash = install_token_wasm(&env);
let stake_wasm_hash = install_stake_wasm(&env);
let _stake_reward_wasm_hash = install_stake_rewards_wasm(&env);
let fee_recipient = user;
let max_allowed_slippage = 5_000i64; // 50% if not specified
let max_allowed_spread = 500i64; // 5% if not specified
Expand Down Expand Up @@ -178,7 +175,6 @@ fn pool_stable_initialization_should_fail_with_token_a_bigger_than_token_b() {

let token_wasm_hash = install_token_wasm(&env);
let stake_wasm_hash = install_stake_wasm(&env);
let _stake_reward_wasm_hash = install_stake_rewards_wasm(&env);
let fee_recipient = user;
let max_allowed_slippage = 5_000i64; // 50% if not specified
let max_allowed_spread = 500i64; // 5% if not specified
Expand Down
2 changes: 0 additions & 2 deletions contracts/stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ crate-type = ["cdylib"]

[features]
testutils = ["soroban-sdk/testutils"]
upgrade = []

[dependencies]
soroban-decimal = { workspace = true }
curve = { workspace = true }
phoenix = { workspace = true }
soroban-sdk = { workspace = true }
itoa = { version = "1.0", default-features = false }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
Expand Down
1 change: 0 additions & 1 deletion contracts/stake/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test: build

build:
$(MAKE) -C ../token build || break;
$(MAKE) -C ../stake_rewards build || break;
cargo build --target wasm32-unknown-unknown --release

lint: fmt clippy
Expand Down
Loading
Loading