From 9b1e27eb31cb73a8767465b9cc8219d70f24ddcd Mon Sep 17 00:00:00 2001 From: Fricoben Date: Mon, 25 Nov 2024 16:13:06 +0800 Subject: [PATCH 1/2] ref: changes prices --- src/pricing.cairo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pricing.cairo b/src/pricing.cairo index 9e80e93..18b48a7 100644 --- a/src/pricing.cairo +++ b/src/pricing.cairo @@ -44,15 +44,15 @@ mod Pricing { impl InternalImpl of InternalTrait { fn get_price_per_day(self: @ContractState, domain_len: usize) -> u128 { if domain_len == 1 { - return 801369863013699; + return 273972602739726; } if domain_len == 2 { - return 657534246575343; + return 136986301369863; } if domain_len == 3 { - return 160000000000000; + return 68493150684931; } if domain_len == 4 { From 56bd30d15d36f4e10ab889c2ba5459dd3fd183c9 Mon Sep 17 00:00:00 2001 From: Fricoben Date: Mon, 25 Nov 2024 18:03:56 +0800 Subject: [PATCH 2/2] fix: test --- src/tests/test_pricing.cairo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/test_pricing.cairo b/src/tests/test_pricing.cairo index d82662d..7685a82 100644 --- a/src/tests/test_pricing.cairo +++ b/src/tests/test_pricing.cairo @@ -24,15 +24,15 @@ fn test_buy_price() { // Test with "b" / 1 letter and one year let (erc20, price) = pricing.compute_buy_price(1, 365); assert(erc20.into() == 0x123, 'wrong erc20 address'); - assert(price == 292500000000000135, 'incorrect price'); + assert(price == 99999999999999990, 'incorrect price'); // Test with "be" / 2 letters and one year let (_erc20, price) = pricing.compute_buy_price(2, 365); - assert(price == 240000000000000195, 'incorrect price'); + assert(price == 49999999999999995, 'incorrect price'); // Test with "ben" / 3 letters and one year let (_erc20, price) = pricing.compute_buy_price(3, 365); - assert(price == 58400000000000000, 'incorrect price'); + assert(price == 24999999999999815, 'incorrect price'); // Test with "benj" / 4 letters and one year let (_erc20, price) = pricing.compute_buy_price(4, 365);