-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Uniswap v3 pools #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
| tssKeypair, | ||
| tssKeypair.publicKey, | ||
| null, | ||
| 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question for createEVMToken, just to double check, there is no need to customize decimals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import { uniswapV2AddLiquidity } from "./uniswapV2"; | ||
| import { uniswapV3AddLiquidity } from "./uniswapV3"; | ||
|
|
||
| export const createToken = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up to you, but i think it would be helpful to add some doc comments for functions, maybe just for exported since there is a lot of going on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const suiNotSupported = chainID === NetworkID.Sui && !contracts.suiContracts; | ||
|
|
||
| if (solanaNotSupported || suiNotSupported) { | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see below other networks token are created, why do we return if solana or sui are not supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function returns if we're creating a Solana token and Solana has not been initialized. Same for Sui.
|
|
||
| let asset; | ||
|
|
||
| if (isGasToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe its more clear to use switch for chain id part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| foreignCoins.push({ | ||
| asset, | ||
| coin_type: isGasToken ? "Gas" : chainID === NetworkID.Sui ? "SUI" : "ERC20", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here for solana would be SPL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| wzetaAmount: any, | ||
| uniswapV3Factory: any, | ||
| uniswapV3PositionManager: any, | ||
| verbose: boolean = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this flag used around localnet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not used yet, but we'll need to add support for this.
| console.error("Error adding liquidity to Uniswap V3:", error); | ||
| if (error.message?.includes("LOK")) { | ||
| console.error( | ||
| "Pool initialization error - pool may already be initialized" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but maybe in case pool is created we still allow liq to be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inside catch, so we're not throwing an error if a pool has been initialized, we're just explaining why adding liquidity may have failed.
--verboseflag.Can be tested with: