From 6719346fb198c7a42fe78379c3482621025b30ec Mon Sep 17 00:00:00 2001 From: Thomas Marchand Date: Mon, 29 Apr 2024 16:04:15 +0100 Subject: [PATCH] feat: update pricing of domains (#32) --- src/pricing.cairo | 6 +++--- src/tests/test_pricing.cairo | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pricing.cairo b/src/pricing.cairo index 94b08a9..33a2932 100644 --- a/src/pricing.cairo +++ b/src/pricing.cairo @@ -44,7 +44,7 @@ mod Pricing { impl InternalImpl of InternalTrait { fn get_price_per_day(self: @ContractState, domain_len: usize) -> u128 { if domain_len == 1 { - return 1068493150684932; + return 534246575342466; } if domain_len == 2 { @@ -52,11 +52,11 @@ mod Pricing { } if domain_len == 3 { - return 200000000000000; + return 160000000000000; } if domain_len == 4 { - return 73972602739726; + return 36986301369863; } return 24657534246575; diff --git a/src/tests/test_pricing.cairo b/src/tests/test_pricing.cairo index 42784be..3df6b56 100644 --- a/src/tests/test_pricing.cairo +++ b/src/tests/test_pricing.cairo @@ -24,7 +24,7 @@ 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 == 390000000000000180, 'incorrect price'); + assert(price == 195000000000000090, 'incorrect price'); // Test with "be" / 2 letters and one year let (_erc20, price) = pricing.compute_buy_price(2, 365); @@ -32,11 +32,11 @@ fn test_buy_price() { // Test with "ben" / 3 letters and one year let (_erc20, price) = pricing.compute_buy_price(3, 365); - assert(price == 73000000000000000, 'incorrect price'); + assert(price == 58400000000000000, 'incorrect price'); // Test with "benj" / 4 letters and one year let (_erc20, price) = pricing.compute_buy_price(4, 365); - assert(price == 26999999999999990, 'incorrect price'); + assert(price == 13499999999999995, 'incorrect price'); // Test with "chocolate" / 9 letters and one year let (_erc20, price) = pricing.compute_buy_price(9, 365);