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

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kaihirota committed Feb 25, 2024
1 parent d557a51 commit 6f7cb14
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/exportContracts.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
10 changes: 5 additions & 5 deletions src/workflows/deposit/depositERC20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -27,7 +27,7 @@ async function executeDepositERC20(
assetType: string,
starkPublicKey: string,
vaultId: number,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction.depositERC20(
starkPublicKey,
Expand All @@ -45,7 +45,7 @@ async function executeRegisterAndDepositERC20(
assetType: string,
starkPublicKey: string,
vaultId: number,
contract: Core,
contract: StarkV3,
usersApi: UsersApi,
): Promise<TransactionResponse> {
const etherKey = await signer.getAddress();
Expand Down Expand Up @@ -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,
);
Expand Down
8 changes: 4 additions & 4 deletions src/workflows/deposit/depositERC721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -25,7 +25,7 @@ async function executeDepositERC721(
assetType: string,
starkPublicKey: string,
vaultId: number,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction.depositNft(
starkPublicKey,
Expand Down Expand Up @@ -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,
);
Expand Down
12 changes: 8 additions & 4 deletions src/workflows/deposit/depositEth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,7 +25,7 @@ async function executeRegisterAndDepositEth(
assetType: string,
starkPublicKey: string,
vaultId: number,
contract: Core,
contract: StarkV3,
usersApi: UsersApi,
): Promise<TransactionResponse> {
const etherKey = await signer.getAddress();
Expand Down Expand Up @@ -50,7 +54,7 @@ async function executeDepositEth(
assetType: string,
starkPublicKey: string,
vaultId: number,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction[
'deposit(uint256,uint256,uint256)'
Expand Down Expand Up @@ -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,
);
Expand Down
8 changes: 4 additions & 4 deletions src/workflows/withdrawal/completeERC20Withdrawal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -45,7 +45,7 @@ async function executeWithdrawERC20(
signer: Signer,
assetType: string,
starkPublicKey: string,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction.withdraw(
starkPublicKey,
Expand All @@ -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,
);
Expand Down
12 changes: 6 additions & 6 deletions src/workflows/withdrawal/completeERC721Withdrawal.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -30,7 +30,7 @@ async function executeWithdrawMintableERC721(
assetType: string,
starkPublicKey: string,
mintingBlob: string,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction =
await contract.populateTransaction.withdrawAndMint(
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -163,7 +163,7 @@ async function executeWithdrawERC721(
assetType: string,
starkPublicKey: string,
tokenId: string,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction.withdrawNft(
starkPublicKey,
Expand All @@ -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,
);
Expand Down
8 changes: 4 additions & 4 deletions src/workflows/withdrawal/completeEthWithdrawal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -44,7 +44,7 @@ async function executeWithdrawEth(
signer: Signer,
assetType: string,
starkPublicKey: string,
contract: Core,
contract: StarkV3,
): Promise<TransactionResponse> {
const populatedTransaction = await contract.populateTransaction.withdraw(
starkPublicKey,
Expand All @@ -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,
);
Expand Down

0 comments on commit 6f7cb14

Please sign in to comment.