Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Hardcode discount #443

Merged
merged 4 commits into from
Aug 13, 2024
Merged
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
6 changes: 5 additions & 1 deletion contracts/trade-shield-contract/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ pub fn get_discount(
user_address: String,
) -> StdResult<Decimal> {
let querier = ElysQuerier::new(&querier);
let discount_str = match querier.tier_calculate_discount(user_address) {
let mut discount_str = match querier.tier_calculate_discount(user_address.clone()) {
Ok(resp) => resp.discount,
Err(_) => "0".to_string(),
};

if user_address == "elys1u8c28343vvhwgwhf29w6hlcz73hvq7lwxmrl46" {
discount_str = "20".to_string()
}

let val = Uint128::from_str(&discount_str)?;
let discount_str = match Decimal::from_atomics(val, 2) {
Ok(resp) => resp,
Expand Down
Loading