Skip to content

Commit

Permalink
Merge pull request #377 from securesecrets/itsHaseebSaeed-LiquidityBook
Browse files Browse the repository at this point in the history
Time based and Volume based staking rewards + Merged changes from Kent
  • Loading branch information
itsHaseebSaeed authored Nov 30, 2023
2 parents c2b4173 + 6173a25 commit e70de5b
Show file tree
Hide file tree
Showing 25 changed files with 1,630 additions and 316 deletions.
2 changes: 2 additions & 0 deletions contracts/dao/treasury_manager/tests/integration/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub fn query() {
.timestamp() as u64,
),
chain_id: "chain_id".to_string(),
random: None,
});
init_dao(
&mut app,
Expand Down Expand Up @@ -366,6 +367,7 @@ pub fn query() {
.timestamp() as u64,
),
chain_id: "chain_id".to_string(),
random: None,
});
update_dao(&mut app, "admin", &contracts, "SSCRT", 1).unwrap();
update_dao(&mut app, "admin", &contracts, "SSCRT", 1).unwrap();
Expand Down
8 changes: 5 additions & 3 deletions contracts/liquidity_book/lb_factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ use shade_protocol::{
lb_pair::ExecuteMsg::{ForceDecay as LbPairForceDecay, SetStaticFeeParameters},
},
swap::core::TokenType,
utils::{
callback::ExecuteCallback,
},
utils::callback::ExecuteCallback,
};

pub static _OFFSET_IS_PRESET_OPEN: u8 = 255;
Expand Down Expand Up @@ -75,6 +73,8 @@ pub fn instantiate(
lb_pair_implementation: ContractInstantiationInfo::default(),
lb_token_implementation: ContractInstantiationInfo::default(),
admin_auth: msg.admin_auth.into_valid(deps.api)?,
total_reward_bins: msg.total_reward_bins,
rewards_distribution_algorithm: msg.rewards_distribution_algorithm,
};

CONFIG.save(deps.storage, &config)?;
Expand Down Expand Up @@ -378,6 +378,8 @@ fn try_create_lb_pair(
entropy,
protocol_fee_recipient: config.fee_recipient,
admin_auth: config.admin_auth.into(),
total_reward_bins: Some(config.total_reward_bins),
rewards_distribution_algorithm: config.rewards_distribution_algorithm,
})?,
code_hash: config.lb_pair_implementation.code_hash.clone(),
funds: vec![],
Expand Down
3 changes: 3 additions & 0 deletions contracts/liquidity_book/lb_factory/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use shade_protocol::{
c_std::{Addr, ContractInfo, Storage},
cosmwasm_schema::cw_serde,
lb_libraries::{pair_parameter_helper::PairParameters, types::ContractInstantiationInfo},
liquidity_book::lb_pair::RewardsDistributionAlgorithm,
secret_storage_plus::{AppendStore, Item, Map},
storage::{singleton, singleton_read, ReadonlySingleton, Singleton},
swap::core::TokenType,
Expand Down Expand Up @@ -53,6 +54,8 @@ pub struct Config {
pub lb_pair_implementation: ContractInstantiationInfo,
pub lb_token_implementation: ContractInstantiationInfo,
pub admin_auth: Contract,
pub total_reward_bins: u32,
pub rewards_distribution_algorithm: RewardsDistributionAlgorithm,
}

pub fn ephemeral_storage_w(storage: &mut dyn Storage) -> Singleton<NextPairKey> {
Expand Down
Loading

0 comments on commit e70de5b

Please sign in to comment.