-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from mootz12/main
Update Internal Math to i256 and Add More Tests
- Loading branch information
Showing
34 changed files
with
3,107 additions
and
1,741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
[package] | ||
name = "contracts" | ||
description = "Comet Contracts" | ||
version = "0.0.7" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
soroban-fixed-point-math = "1.0.0" | ||
soroban-fixed-point-math = "1.1.0" | ||
soroban-sdk = { workspace = true } | ||
soroban-token-sdk = { workspace = true } | ||
|
||
[dev-dependencies] | ||
soroban-sdk = { workspace = true, features = ["testutils"] } | ||
sep-41-token = { version = "0.3.0", features = ["testutils"] } | ||
sep-41-token = { version = "1.0.0", features = ["testutils"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
//! Comet Pool Constants | ||
use soroban_fixed_point_math::STROOP; | ||
|
||
pub const BONE: i128 = STROOP as i128; | ||
/// c_math 256 bit constants | ||
/// kept as i128 to avoid requiring `env` to define constants | ||
pub const BONE: i128 = 10i128.pow(18); | ||
pub const MIN_CPOW_BASE: i128 = 1; | ||
pub const MAX_CPOW_BASE: i128 = (2 * BONE) - 1; | ||
pub const CPOW_PRECISION: i128 = 1_000000_i128; | ||
pub const EXIT_FEE: i128 = 0; | ||
pub const MAX_TOTAL_WEIGHT: i128 = BONE * 50; | ||
pub const INIT_POOL_SUPPLY: i128 = BONE * 100; | ||
pub const MIN_FEE: i128 = 10; | ||
pub const MAX_FEE: i128 = 1_000000_i128; | ||
pub const MAX_IN_RATIO: i128 = BONE / 2; | ||
pub const MAX_OUT_RATIO: i128 = (BONE / 3) + 1; | ||
pub const CPOW_PRECISION: i128 = 10i128.pow(8); | ||
|
||
/// constants | ||
pub const STROOP: i128 = 10i128.pow(7); | ||
pub const STROOP_SCALAR: i128 = 10i128.pow(11); | ||
pub const MAX_IN_RATIO: i128 = (STROOP / 3) + 1; | ||
pub const MAX_OUT_RATIO: i128 = (STROOP / 3) + 1; | ||
pub const INIT_POOL_SUPPLY: i128 = STROOP * 100; | ||
pub const MIN_FEE: i128 = 10; // 0.0001% | ||
pub const MAX_FEE: i128 = STROOP / 10; // 10% | ||
pub const MIN_BOUND_TOKENS: u32 = 2; | ||
pub const MAX_BOUND_TOKENS: u32 = 8; | ||
pub const MIN_WEIGHT: i128 = BONE; | ||
pub const MAX_WEIGHT: i128 = BONE * 50; | ||
pub const MIN_BALANCE: i128 = (1_0000000 / 1_00000) as i128; | ||
pub const MAX_TOTAL_WEIGHT: i128 = STROOP * 50; | ||
pub const MIN_WEIGHT: i128 = STROOP / 10; // 10% | ||
pub const MAX_WEIGHT: i128 = MIN_WEIGHT * 9; // 90% | ||
pub const MIN_BALANCE: i128 = 100; |
Oops, something went wrong.