-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ redirect tokens management to token manager contract
- Loading branch information
Quentin Burg
committed
Oct 17, 2023
1 parent
d12cc13
commit 4b29f2d
Showing
10 changed files
with
382 additions
and
258 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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
export type MarketMakerStorage = { | ||
vaults: { | ||
keys: Array<string>; | ||
/** | ||
* Bigmap ID | ||
*/ | ||
values: string; // Bigmap addr | ||
}; | ||
administrator: string; | ||
batcher: string; | ||
tokenmanager: string; | ||
}; | ||
|
||
// OLD types | ||
|
||
// export type UserHoldingKey = [address, string]; | ||
|
||
// export type UserHoldings = Map<UserHoldingKey, number>; | ||
// export type MarketMakerStorage = { | ||
// metadata: unknown; | ||
// valid_tokens: Map<TokenNames, Token>; | ||
// valid_swaps: Map< | ||
// SwapNames, | ||
// { swap: Swap; is_disabled_for_deposits: boolean } | ||
// >; | ||
// vaults: Map<TokenNames, Vault>; | ||
// last_holding_id: number; | ||
// user_holdings: UserHoldings; | ||
// vault_holdings: VaultHoldings; | ||
// }; | ||
|
||
// MARKET MAKER HOLDINGS | ||
|
||
// export type BatcherMarketMakerStorage = { | ||
// metadata: number; //! ID of metadata bigmap | ||
// // valid_tokens: Record<TokenNames, ContractToken>; | ||
// valid_tokens: Record<string, ContractToken>; | ||
// valid_swaps: Record< | ||
// SwapNames, | ||
// { | ||
// swap: Swap; | ||
// is_disabled_for_deposits: boolean; | ||
// oracle_address: string; | ||
// oracle_precision: string; | ||
// oracle_asset_name: string; | ||
// } | ||
// >; | ||
// // rates_current: number; //! ID of rates_current bigmap | ||
// // fee_in_mutez: number; | ||
// // batch_set: { | ||
// // batches: number; //! ID of batches bigmap | ||
// // current_batch_indices: Record<SwapNames, string>; //! Ex: tzBTC/USDT: "300" | ||
// // }; | ||
// administrator: string; //! Address to admin | ||
// // fee_recipient: string; //! Address | ||
// // last_order_number: string; //! number in string | ||
// // user_batch_ordertypes: number; //! ID of order book bigmap | ||
// limit_on_tokens_or_pairs: string; //! 10 per default | ||
// // deposit_time_window_in_seconds: string; //! 600 at this time | ||
// // scale_factor_for_oracle_staleness: string; //! "1" | ||
|
||
// vault_holdings: number; //! ID of vault_holdings bigmap | ||
// vaults: number; //! ID of vaults bigmap | ||
// user_holdings: number; //! ID of user_holdings bigmap | ||
// batcher: string; //! burn address | ||
// }; | ||
|
||
// export type UserHoldingsBigMapItem = { | ||
// key: { | ||
// string: TokenNames; | ||
// address: string; | ||
// }; | ||
// value: string; // number | ||
// }; | ||
|
||
// export type VaultHoldingsBigMapItem = { | ||
// key: string; | ||
// active: boolean; | ||
// value: { | ||
// id: string; | ||
// token: TokenNames; | ||
// holder: string; | ||
// shares: string; // number | ||
// unclaimed: string; // number | ||
// }; // number | ||
// }; | ||
|
||
// export type VaultsBigMapItem = { | ||
// key: TokenNames; | ||
// value: { | ||
// foreign_tokens: Record<TokenNames, { token: Token; amount: string }>; | ||
// total_shares: string; // number | ||
// native_token: { | ||
// token: Token; | ||
// amount: string; | ||
// }; | ||
// holdings: Array<string>; // Array<number> | ||
// }; // number | ||
// }; |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export type TokenManagerStorage = { | ||
valid_swaps: { | ||
/** | ||
* Ex : "tzBTC/USDT" | ||
*/ | ||
keys: Array<string>; | ||
/** | ||
* Bigmap ID | ||
*/ | ||
values: number; | ||
}; | ||
valid_tokens: { | ||
/** | ||
* Ex : "tzBTC" | ||
*/ | ||
keys: Array<string>; | ||
/** | ||
* Bigmap ID | ||
*/ | ||
values: number; | ||
}; | ||
administrator: string; | ||
/** | ||
* Number. Currently 10 | ||
*/ | ||
limit_on_tokens_or_pairs: string; | ||
}; | ||
|
||
export type ValidToken = { | ||
name: string; | ||
address: string; | ||
token_id: string; | ||
decimals: string; | ||
standard: string; | ||
}; | ||
|
||
export type ValidTokensBigmapItem = { | ||
key: string; | ||
value: ValidToken; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export type TokenVaultStorage = { | ||
batcher: string; | ||
marketmaker: string; | ||
native_token: { | ||
token: { | ||
name: string; | ||
address: string; | ||
/** | ||
* Number | ||
*/ | ||
decimals: string; | ||
standard: string; | ||
/** | ||
* Number, in most case 0 | ||
*/ | ||
token_id: string; | ||
}; | ||
/** | ||
* Number | ||
*/ | ||
amount: string; | ||
}; | ||
tokenmanager: string; | ||
/** | ||
* Number | ||
*/ | ||
total_shares: string; | ||
administrator: string; | ||
/** | ||
* TODO types | ||
*/ | ||
foreign_tokens: ''; | ||
/** | ||
* Bigmap ID | ||
*/ | ||
vault_holdings: number; | ||
}; |
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,3 +1,6 @@ | ||
export * from './contract'; | ||
export * from './contracts/batcher'; | ||
export * from './contracts/token-manager'; | ||
export * from './contracts/token-vault'; | ||
export * from './contracts/market-maker'; | ||
export * from './state'; | ||
export * from './events'; | ||
export * from './events'; |
Oops, something went wrong.