From 6f7cb14676ebf50b13b2d40aa405d3c8fdb574b2 Mon Sep 17 00:00:00 2001 From: Kai Hirota <34954529+kaihirota@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:37:31 +1100 Subject: [PATCH] update --- src/exportContracts.ts | 2 +- src/workflows/deposit/depositERC20.ts | 10 +++++----- src/workflows/deposit/depositERC721.ts | 8 ++++---- src/workflows/deposit/depositEth.ts | 12 ++++++++---- src/workflows/withdrawal/completeERC20Withdrawal.ts | 8 ++++---- src/workflows/withdrawal/completeERC721Withdrawal.ts | 12 ++++++------ src/workflows/withdrawal/completeEthWithdrawal.ts | 8 ++++---- 7 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/exportContracts.ts b/src/exportContracts.ts index e667955e..dce0e68e 100644 --- a/src/exportContracts.ts +++ b/src/exportContracts.ts @@ -1,5 +1,5 @@ export { - Core__factory as Core, + StarkV3__factory as StarkV3, Registration__factory as Registration, IERC20__factory as IERC20, IERC721__factory as IERC721, diff --git a/src/workflows/deposit/depositERC20.ts b/src/workflows/deposit/depositERC20.ts index 1a452fa1..5705df2c 100644 --- a/src/workflows/deposit/depositERC20.ts +++ b/src/workflows/deposit/depositERC20.ts @@ -3,8 +3,8 @@ import { TransactionResponse } from '@ethersproject/providers'; import { DepositsApi, EncodingApi, TokensApi, UsersApi } from '../../api'; import { parseUnits } from '@ethersproject/units'; import { - Core, - Core__factory, + StarkV3, + StarkV3__factory, IERC20__factory, Registration__factory, } from '../../contracts'; @@ -27,7 +27,7 @@ async function executeDepositERC20( assetType: string, starkPublicKey: string, vaultId: number, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.depositERC20( starkPublicKey, @@ -45,7 +45,7 @@ async function executeRegisterAndDepositERC20( assetType: string, starkPublicKey: string, vaultId: number, - contract: Core, + contract: StarkV3, usersApi: UsersApi, ): Promise { const etherKey = await signer.getAddress(); @@ -130,7 +130,7 @@ export async function depositERC20Workflow( const vaultId = signableDepositResult.data.vault_id; const quantizedAmount = BigNumber.from(signableDepositResult.data.amount); - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); diff --git a/src/workflows/deposit/depositERC721.ts b/src/workflows/deposit/depositERC721.ts index 64e8209f..0c0a8420 100644 --- a/src/workflows/deposit/depositERC721.ts +++ b/src/workflows/deposit/depositERC721.ts @@ -2,8 +2,8 @@ import { Signer } from '@ethersproject/abstract-signer'; import { TransactionResponse } from '@ethersproject/providers'; import { DepositsApi, EncodingApi, UsersApi } from '../../api'; import { - Core, - Core__factory, + StarkV3, + StarkV3__factory, IERC721__factory, Registration__factory, } from '../../contracts'; @@ -25,7 +25,7 @@ async function executeDepositERC721( assetType: string, starkPublicKey: string, vaultId: number, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.depositNft( starkPublicKey, @@ -85,7 +85,7 @@ export async function depositERC721Workflow( const starkPublicKey = signableDepositResult.data.stark_key; const vaultId = signableDepositResult.data.vault_id; - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); diff --git a/src/workflows/deposit/depositEth.ts b/src/workflows/deposit/depositEth.ts index b04502c6..9f3dddbb 100644 --- a/src/workflows/deposit/depositEth.ts +++ b/src/workflows/deposit/depositEth.ts @@ -2,7 +2,11 @@ import { Signer } from '@ethersproject/abstract-signer'; import { TransactionResponse } from '@ethersproject/providers'; import { DepositsApi, EncodingApi, UsersApi } from '../../api'; import { parseUnits } from '@ethersproject/units'; -import { Core, Core__factory, Registration__factory } from '../../contracts'; +import { + StarkV3, + StarkV3__factory, + Registration__factory, +} from '../../contracts'; import { getSignableRegistrationOnchain, isRegisteredOnChainWorkflow, @@ -21,7 +25,7 @@ async function executeRegisterAndDepositEth( assetType: string, starkPublicKey: string, vaultId: number, - contract: Core, + contract: StarkV3, usersApi: UsersApi, ): Promise { const etherKey = await signer.getAddress(); @@ -50,7 +54,7 @@ async function executeDepositEth( assetType: string, starkPublicKey: string, vaultId: number, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction[ 'deposit(uint256,uint256,uint256)' @@ -99,7 +103,7 @@ export async function depositEthWorkflow( const starkPublicKey = signableDepositResult.data.stark_key; const vaultId = signableDepositResult.data.vault_id; - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); diff --git a/src/workflows/withdrawal/completeERC20Withdrawal.ts b/src/workflows/withdrawal/completeERC20Withdrawal.ts index de237098..a92083a3 100644 --- a/src/workflows/withdrawal/completeERC20Withdrawal.ts +++ b/src/workflows/withdrawal/completeERC20Withdrawal.ts @@ -3,8 +3,8 @@ import { TransactionResponse } from '@ethersproject/providers'; import { EncodingApi, UsersApi } from '../../api'; import { ImmutableXConfiguration } from '../../config'; import { - Core, - Core__factory, + StarkV3, + StarkV3__factory, Registration, Registration__factory, } from '../../contracts'; @@ -45,7 +45,7 @@ async function executeWithdrawERC20( signer: Signer, assetType: string, starkPublicKey: string, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.withdraw( starkPublicKey, @@ -67,7 +67,7 @@ export async function completeERC20WithdrawalWorkflow( token_address: token.tokenAddress, }); - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); diff --git a/src/workflows/withdrawal/completeERC721Withdrawal.ts b/src/workflows/withdrawal/completeERC721Withdrawal.ts index 9e09cda9..bf7a0b38 100644 --- a/src/workflows/withdrawal/completeERC721Withdrawal.ts +++ b/src/workflows/withdrawal/completeERC721Withdrawal.ts @@ -1,8 +1,8 @@ import { Signer } from '@ethersproject/abstract-signer'; import { EncodingApi, MintsApi, UsersApi } from '../../api'; import { - Core, - Core__factory, + StarkV3, + StarkV3__factory, Registration, Registration__factory, } from '../../contracts'; @@ -30,7 +30,7 @@ async function executeWithdrawMintableERC721( assetType: string, starkPublicKey: string, mintingBlob: string, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.withdrawAndMint( @@ -95,7 +95,7 @@ async function completeMintableERC721Withdrawal( ); const mintingBlob = getMintingBlob(token); - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); @@ -163,7 +163,7 @@ async function executeWithdrawERC721( assetType: string, starkPublicKey: string, tokenId: string, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.withdrawNft( starkPublicKey, @@ -186,7 +186,7 @@ async function completeERC721Withdrawal( token_address: token.tokenAddress, }); - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, ); diff --git a/src/workflows/withdrawal/completeEthWithdrawal.ts b/src/workflows/withdrawal/completeEthWithdrawal.ts index 130207b3..e906ba86 100644 --- a/src/workflows/withdrawal/completeEthWithdrawal.ts +++ b/src/workflows/withdrawal/completeEthWithdrawal.ts @@ -3,8 +3,8 @@ import { TransactionResponse } from '@ethersproject/providers'; import { EncodingApi, UsersApi } from '../../api'; import { ImmutableXConfiguration } from '../../config'; import { - Core, - Core__factory, + StarkV3, + StarkV3__factory, Registration, Registration__factory, } from '../../contracts'; @@ -44,7 +44,7 @@ async function executeWithdrawEth( signer: Signer, assetType: string, starkPublicKey: string, - contract: Core, + contract: StarkV3, ): Promise { const populatedTransaction = await contract.populateTransaction.withdraw( starkPublicKey, @@ -63,7 +63,7 @@ export async function completeEthWithdrawalWorkflow( ) { const assetType = await getEncodeAssetInfo('asset', 'ETH', encodingApi); - const coreContract = Core__factory.connect( + const coreContract = StarkV3__factory.connect( config.ethConfiguration.coreContractAddress, signer, );