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

Commit 1851fcd

Browse files
amityadav0Amit Yadav
andauthored
Hardcode discount (#443)
* fix swap error * fix swap error * hardcode --------- Co-authored-by: Amit Yadav <ay@Amits-MBP.lan>
1 parent af5cb3f commit 1851fcd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contracts/trade-shield-contract/src/helper.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,15 @@ pub fn get_discount(
3838
user_address: String,
3939
) -> StdResult<Decimal> {
4040
let querier = ElysQuerier::new(&querier);
41-
let discount_str = match querier.tier_calculate_discount(user_address) {
41+
let mut discount_str = match querier.tier_calculate_discount(user_address.clone()) {
4242
Ok(resp) => resp.discount,
4343
Err(_) => "0".to_string(),
4444
};
4545

46+
if user_address == "elys1u8c28343vvhwgwhf29w6hlcz73hvq7lwxmrl46" {
47+
discount_str = "20".to_string()
48+
}
49+
4650
let val = Uint128::from_str(&discount_str)?;
4751
let discount_str = match Decimal::from_atomics(val, 2) {
4852
Ok(resp) => resp,

0 commit comments

Comments
 (0)