Skip to content
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

fix(deps): update starknet to 6.18.0 #282

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@uniswap/eslint-config": "^1.2.0",
"prettier": "^3.1.0",
"starknet": "5.24.3",
"starknet": "^6.18.0",
"tsup": "^8.0.2",
"typescript": "^5.4.5",
"vitest": "^1.5.0"
Expand Down
18 changes: 9 additions & 9 deletions packages/core/src/constants/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@ import JediswapPair from '../abis/JediswapPair.json'
import Multicall from '../abis/Multicall.json'

export const TOKEN_CLASS_HASH = {
[constants.StarknetChainId.SN_GOERLI]: '0x05ba9aea47a8dd7073ab82b9e91721bdb3a2c1b259cffd68669da1454faa80ac',
[constants.StarknetChainId.SN_SEPOLIA]: '0x05ba9aea47a8dd7073ab82b9e91721bdb3a2c1b259cffd68669da1454faa80ac',
[constants.StarknetChainId.SN_MAIN]: '0x063ee878d3559583ceae80372c6088140e1180d9893aa65fbefc81f45ddaaa17',
}

export const FACTORY_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x076c3112e95994507c44c72b8dfb7f8d568a370d2f7c2d918ed9f55327671385',
[constants.StarknetChainId.SN_SEPOLIA]: '0x076c3112e95994507c44c72b8dfb7f8d568a370d2f7c2d918ed9f55327671385',
[constants.StarknetChainId.SN_MAIN]: '0x01a46467a9246f45c8c340f1f155266a26a71c07bd55d36e8d1c7d0d438a2dbc',
}

export const EKUBO_POSITIONS_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x073fa8432bf59f8ed535f29acfd89a7020758bda7be509e00dfed8a9fde12ddc',
[constants.StarknetChainId.SN_SEPOLIA]: '0x073fa8432bf59f8ed535f29acfd89a7020758bda7be509e00dfed8a9fde12ddc',
[constants.StarknetChainId.SN_MAIN]: '0x02e0af29598b407c8716b17f6d2795eca1b471413fa03fb145a5e33722184067',
}

export const ETH_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
[constants.StarknetChainId.SN_SEPOLIA]: '0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
[constants.StarknetChainId.SN_MAIN]: '0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7',
}
export const STRK_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d',
[constants.StarknetChainId.SN_SEPOLIA]: '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d',
[constants.StarknetChainId.SN_MAIN]: '0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d',
}

export const USDC_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x5a643907b9a4bc6a55e9069c4fd5fd1f5c79a22470690f75556c4736e34426',
[constants.StarknetChainId.SN_SEPOLIA]: '0x5a643907b9a4bc6a55e9069c4fd5fd1f5c79a22470690f75556c4736e34426',
[constants.StarknetChainId.SN_MAIN]: '0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8',
}

export const MULTICALL_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: '0x01a33330996310a1e3fa1df5b16c1e07f0491fdd20c441126e02613b948f0225',
[constants.StarknetChainId.SN_SEPOLIA]: '0x01a33330996310a1e3fa1df5b16c1e07f0491fdd20c441126e02613b948f0225',
[constants.StarknetChainId.SN_MAIN]: '0x01a33330996310a1e3fa1df5b16c1e07f0491fdd20c441126e02613b948f0225',
}

export const JEDISWAP_ETH_USDC = {
[constants.StarknetChainId.SN_GOERLI]: '0x05a2b2b37f66157f767ea711cb4e034c40d41f2f5acf9ff4a19049fa11c1a884',
[constants.StarknetChainId.SN_SEPOLIA]: '0x05a2b2b37f66157f767ea711cb4e034c40d41f2f5acf9ff4a19049fa11c1a884',
[constants.StarknetChainId.SN_MAIN]: '0x04d0390b777b424e43839cd1e744799f3de6c176c7e32c1812a41dbd9c19db6a',
}

export const JEDISWAP_STRK_USDC = {
[constants.StarknetChainId.SN_GOERLI]: '0x018b129b1a372b3288077521ad8749f5a2b2ddfb67ef5a37e2d02190fa11c40f',
[constants.StarknetChainId.SN_SEPOLIA]: '0x018b129b1a372b3288077521ad8749f5a2b2ddfb67ef5a37e2d02190fa11c40f',
[constants.StarknetChainId.SN_MAIN]: '0x5726725e9507c3586cc0516449e2c74d9b201ab2747752bb0251aaa263c9a26',
}

Expand Down
32 changes: 16 additions & 16 deletions packages/core/src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export enum QUOTE_TOKEN_SYMBOL {

// ETH
export const Ether: MultichainToken = {
[constants.StarknetChainId.SN_GOERLI]: {
address: ETH_ADDRESSES[constants.StarknetChainId.SN_GOERLI],
[constants.StarknetChainId.SN_SEPOLIA]: {
address: ETH_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA],
symbol: QUOTE_TOKEN_SYMBOL.ETH,
name: 'Ether',
decimals: 18,
camelCased: true,
usdcPair: {
address: JEDISWAP_ETH_USDC[constants.StarknetChainId.SN_GOERLI],
address: JEDISWAP_ETH_USDC[constants.StarknetChainId.SN_SEPOLIA],
reversed: true,
},
},
Expand All @@ -37,14 +37,14 @@ export const Ether: MultichainToken = {

// STRK
export const Stark: MultichainToken = {
[constants.StarknetChainId.SN_GOERLI]: {
address: STRK_ADDRESSES[constants.StarknetChainId.SN_GOERLI],
[constants.StarknetChainId.SN_SEPOLIA]: {
address: STRK_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA],
symbol: QUOTE_TOKEN_SYMBOL.STRK,
name: 'Stark',
decimals: 18,
camelCased: true,
usdcPair: {
address: JEDISWAP_STRK_USDC[constants.StarknetChainId.SN_GOERLI],
address: JEDISWAP_STRK_USDC[constants.StarknetChainId.SN_SEPOLIA],
reversed: true,
},
},
Expand All @@ -63,8 +63,8 @@ export const Stark: MultichainToken = {

// USDC
export const USDCoin: MultichainToken = {
[constants.StarknetChainId.SN_GOERLI]: {
address: USDC_ADDRESSES[constants.StarknetChainId.SN_GOERLI],
[constants.StarknetChainId.SN_SEPOLIA]: {
address: USDC_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA],
symbol: QUOTE_TOKEN_SYMBOL.USDC,
name: 'USD Coin',
decimals: 6,
Expand All @@ -82,15 +82,15 @@ export const USDCoin: MultichainToken = {
// Quote tokens

export const QUOTE_TOKENS: { [chainId in constants.StarknetChainId]: Record<string, Token> } = {
[constants.StarknetChainId.SN_GOERLI]: {
[getChecksumAddress(ETH_ADDRESSES[constants.StarknetChainId.SN_GOERLI])]:
Ether[constants.StarknetChainId.SN_GOERLI],
[constants.StarknetChainId.SN_SEPOLIA]: {
[getChecksumAddress(ETH_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA])]:
Ether[constants.StarknetChainId.SN_SEPOLIA],

[getChecksumAddress(STRK_ADDRESSES[constants.StarknetChainId.SN_GOERLI])]:
Stark[constants.StarknetChainId.SN_GOERLI],
[getChecksumAddress(STRK_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA])]:
Stark[constants.StarknetChainId.SN_SEPOLIA],

[getChecksumAddress(USDC_ADDRESSES[constants.StarknetChainId.SN_GOERLI])]:
USDCoin[constants.StarknetChainId.SN_GOERLI],
[getChecksumAddress(USDC_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA])]:
USDCoin[constants.StarknetChainId.SN_SEPOLIA],
},

[constants.StarknetChainId.SN_MAIN]: {
Expand All @@ -101,6 +101,6 @@ export const QUOTE_TOKENS: { [chainId in constants.StarknetChainId]: Record<stri
}

export const DEFAULT_QUOTE_TOKEN_ADDRESSES = {
[constants.StarknetChainId.SN_GOERLI]: getChecksumAddress(ETH_ADDRESSES[constants.StarknetChainId.SN_GOERLI]),
[constants.StarknetChainId.SN_SEPOLIA]: getChecksumAddress(ETH_ADDRESSES[constants.StarknetChainId.SN_SEPOLIA]),
[constants.StarknetChainId.SN_MAIN]: getChecksumAddress(ETH_ADDRESSES[constants.StarknetChainId.SN_MAIN]),
}
6 changes: 3 additions & 3 deletions packages/core/src/factory/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Factory implements FactoryInterface {
//

private async getJediswapLiquidityLockPosition(liquidity: Pick<JediswapLiquidity, 'lockManager' | 'lockPosition'>) {
const { result } = await this.config.provider.callContract({
const result = await this.config.provider.callContract({
contractAddress: liquidity.lockManager,
entrypoint: Entrypoint.GET_LOCK_DETAILS,
calldata: [liquidity.lockPosition],
Expand All @@ -205,7 +205,7 @@ export class Factory implements FactoryInterface {
}

private async getEkuboLiquidityLockPosition(liquidity: Pick<EkuboLiquidity, 'lockManager' | 'ekuboId'>) {
const { result } = await this.config.provider.callContract({
const result = await this.config.provider.callContract({
contractAddress: liquidity.lockManager,
entrypoint: Entrypoint.LIQUIDITY_POSITION_DETAILS,
calldata: [liquidity.ekuboId],
Expand Down Expand Up @@ -250,7 +250,7 @@ export class Factory implements FactoryInterface {
])

// call ekubo position to get collectable fees details
const { result } = await this.config.provider.callContract({
const result = await this.config.provider.callContract({
contractAddress: EKUBO_POSITIONS_ADDRESSES[this.config.chainId],
entrypoint: Entrypoint.GET_TOKEN_INFOS,
calldata,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { decimalsScale } from './helpers'
export async function getPairPrice(
provider: ProviderInterface,
pair?: USDCPair,
blockNumber: BlockNumber = BlockTag.latest,
blockNumber: BlockNumber = BlockTag.LATEST,
) {
if (!pair) return new Fraction(1, 1)

const { result } = await provider.callContract(
const result = await provider.callContract(
{
contractAddress: pair.address,
entrypoint: Entrypoint.GET_RESERVES,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"react-dom": "^18.2.0",
"react-hook-form": "^7.49.0",
"react-router-dom": "^6.11.0",
"starknet": "^5.10.0",
"starknet": "^6.18.0",
"starknetkit": "^1.0.22",
"ua-parser-js": "^1.0.35",
"zod": "^3.22.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export default function LaunchTemplate({ liquidityPrice, teamAllocationPrice, pr
loading
? 'Loading...'
: hasEnoughQuoteTokenBalance
? `Launch on ${amm}`
: `Insufficient ${quoteToken.symbol} balance`
? `Launch on ${amm}`
: `Insufficient ${quoteToken.symbol} balance`
}
onNext={next}
disableNext={loading || !hasEnoughQuoteTokenBalance}
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"prettier": "^3.1.0",
"react": "^18.2.0",
"react-test-renderer": "^18.2.0",
"starknet": "^5.24.3",
"starknet": "^6.18.0",
"tsup": "^8.0.2",
"typescript": "~5.4.0",
"vitest": "^1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/hooks/usePairPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type UsePairPriceProps = UseQueryProps & {

export function usePairPrice({
pair,
blockNumber = BlockTag.latest,
blockNumber = BlockTag.LATEST,
...props
}: UsePairPriceProps): UseQueryResult<Fraction | undefined, Error | null> {
const { provider } = useProvider()
Expand Down
Loading
Loading