Skip to content

Commit

Permalink
feat: update pricing of domains (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Th0rgal authored Apr 29, 2024
1 parent 8abe7e0 commit 6719346
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pricing.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ 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 {
return 657534246575343;
}

if domain_len == 3 {
return 200000000000000;
return 160000000000000;
}

if domain_len == 4 {
return 73972602739726;
return 36986301369863;
}

return 24657534246575;
Expand Down
6 changes: 3 additions & 3 deletions src/tests/test_pricing.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ 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);
assert(price == 240000000000000195, 'incorrect 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);
Expand Down

0 comments on commit 6719346

Please sign in to comment.