Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Remove some dead code (#4)
Browse files Browse the repository at this point in the history
* Remove balances storage slot, which is unused.

* Remove usused struct.
  • Loading branch information
adlerjohn authored Feb 18, 2022
1 parent 6710501 commit bc21616
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions contracts/src/main.sw
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ struct RemoveLiquidityParams {
deadline: u64,
}

struct RemoveLiquidityReturn {
eth_amount: u64,
token_amount: u64,
}

struct SwapWithMinimumParams {
min: u64,
deadline: u64,
Expand Down Expand Up @@ -132,8 +127,7 @@ abi Exchange {

/// Storage delimited
const S_DEPOSITS: b256 = 0x0000000000000000000000000000000000000000000000000000000000000000;
const S_BALANCES: b256 = 0x0000000000000000000000000000000000000000000000000000000000000001;
const S_TOTAL_SUPPLY: b256 = 0x0000000000000000000000000000000000000000000000000000000000000002;
const S_TOTAL_SUPPLY: b256 = 0x0000000000000000000000000000000000000000000000000000000000000001;

////////////////////////////////////////
// Helper functions
Expand All @@ -145,11 +139,6 @@ fn key_deposits(a: Address, asset_id: b256) -> b256 {
hash_pair(S_DEPOSITS, inner, HashMethod::Sha256)
}

/// Compute the storage slot for an address's balance.
fn key_balances(delim: b256, a: Address) -> b256 {
hash_pair(S_BALANCES, a.into(), HashMethod::Sha256)
}

/// Pricing function for converting between ETH and Tokens.
fn get_input_price(input_amount: u64, input_reserve: u64, output_reserve: u64) -> u64 {
assert(input_reserve > 0 && output_reserve > 0);
Expand Down

0 comments on commit bc21616

Please sign in to comment.