-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
1,273 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
pub mod contract; | ||
pub mod error; | ||
pub mod query; | ||
pub mod state; | ||
pub mod models; | ||
#[cfg(test)] | ||
mod tests; | ||
mod token_factory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
use std::collections::{HashMap,HashSet}; | ||
use alliance_protocol::{ | ||
alliance_oracle_types::ChainId, alliance_protocol::{ | ||
AllianceDelegateMsg, | ||
AllianceUndelegateMsg, | ||
AllianceRedelegateMsg, | ||
AssetDistribution | ||
}, | ||
}; | ||
use cosmwasm_schema::{QueryResponses, cw_serde}; | ||
use cosmwasm_std::{Addr, Timestamp, Uint128}; | ||
use cw_asset::{AssetInfo, Asset}; | ||
|
||
|
||
#[cw_serde] | ||
pub struct Config { | ||
pub governance: Addr, | ||
pub controller: Addr, | ||
pub oracle: Addr, | ||
pub last_reward_update_timestamp: Timestamp, | ||
pub alliance_token_denom: String, | ||
pub alliance_token_supply: Uint128, | ||
pub reward_denom: String, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct InstantiateMsg { | ||
pub governance: String, | ||
pub controller: String, | ||
pub oracle: String, | ||
pub reward_denom: String, | ||
} | ||
|
||
#[cw_serde] | ||
pub enum ExecuteMsg { | ||
// Public functions | ||
Stake {}, | ||
Unstake(Asset), | ||
ClaimRewards(AssetInfo), | ||
UpdateRewards {}, | ||
|
||
// Privileged functions | ||
WhitelistAssets(HashMap<ChainId, Vec<AssetInfo>>), | ||
RemoveAssets(Vec<AssetInfo>), | ||
UpdateRewardsCallback {}, | ||
AllianceDelegate(AllianceDelegateMsg), | ||
AllianceUndelegate(AllianceUndelegateMsg), | ||
AllianceRedelegate(AllianceRedelegateMsg), | ||
RebalanceEmissions {}, | ||
RebalanceEmissionsCallback {}, | ||
} | ||
|
||
#[cw_serde] | ||
#[derive(QueryResponses)] | ||
pub enum QueryMsg { | ||
#[returns(Config)] | ||
Config {}, | ||
|
||
#[returns(HashSet<Addr>)] | ||
Validators {}, | ||
|
||
#[returns(WhitelistedAssetsResponse)] | ||
WhitelistedAssets {}, | ||
|
||
#[returns(Vec<AssetDistribution>)] | ||
RewardDistribution {}, | ||
|
||
#[returns(StakedBalanceRes)] | ||
StakedBalance(AssetQuery), | ||
|
||
#[returns(PendingRewardsRes)] | ||
PendingRewards(AssetQuery), | ||
|
||
#[returns(Vec<StakedBalanceRes>)] | ||
AllStakedBalances(AllStakedBalancesQuery), | ||
|
||
#[returns(Vec<PendingRewardsRes>)] | ||
AllPendingRewards(AllPendingRewardsQuery), | ||
|
||
#[returns(Vec<StakedBalanceRes>)] | ||
TotalStakedBalances {}, | ||
} | ||
pub type WhitelistedAssetsResponse = HashMap<ChainId, Vec<AssetInfo>>; | ||
|
||
#[cw_serde] | ||
pub struct AllPendingRewardsQuery { | ||
pub address: String, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct AllStakedBalancesQuery { | ||
pub address: String, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct PendingRewardsRes { | ||
pub staked_asset: AssetInfo, | ||
pub reward_asset: AssetInfo, | ||
pub rewards: Uint128, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct AssetQuery { | ||
pub address: String, | ||
pub asset: AssetInfo, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct StakedBalanceRes { | ||
pub asset: AssetInfo, | ||
pub balance: Uint128, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.