Skip to content

Commit

Permalink
chore: use SpokePoolVerifier typechain bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dohaki committed Oct 6, 2023
1 parent 42a8198 commit 8e265b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export async function sendAcrossDeposit(
const tx = shouldUseSpokePoolVerifier
? await config
.getSpokePoolVerifier(fromChain)
.populateTransaction.deposit(...commonArgs)
.populateTransaction.deposit(spokePool.address, ...commonArgs)
: await config
.getSpokePool(fromChain)
.populateTransaction.deposit(...commonArgs);
Expand Down
9 changes: 7 additions & 2 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
HubPool__factory,
SpokePool,
SpokePool__factory,
SpokePoolVerifier,
SpokePoolVerifier__factory,
AcrossMerkleDistributor,
AcrossMerkleDistributor__factory,
AcceleratingDistributor,
Expand Down Expand Up @@ -121,10 +123,13 @@ export class ConfigClient {
);
return enabledSpokePoolVerifier.address;
}
getSpokePoolVerifier(chainId: constants.ChainId, signer?: Signer): SpokePool {
getSpokePoolVerifier(
chainId: constants.ChainId,
signer?: Signer
): SpokePoolVerifier {
const address = this.getSpokePoolVerifierAddress(chainId);
const provider = signer ?? providerUtils.getProvider(chainId);
return SpokePool__factory.connect(address, provider); // TODO: Use SpokePoolVerifier when new contracts-v2 package is released
return SpokePoolVerifier__factory.connect(address, provider);
}
getHubPoolChainId(): constants.ChainId {
return this.config.hubPoolChain;
Expand Down
2 changes: 2 additions & 0 deletions src/utils/typechain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
export { AcrossMerkleDistributor__factory } from "@across-protocol/contracts-v2/dist/typechain/factories/contracts/merkle-distributor/AcrossMerkleDistributor__factory";
export { HubPool__factory } from "@across-protocol/contracts-v2/dist/typechain/factories/contracts/HubPool__factory";
export { SpokePool__factory } from "@across-protocol/contracts-v2/dist/typechain/factories/contracts/SpokePool.sol/SpokePool__factory";
export { SpokePoolVerifier__factory } from "@across-protocol/contracts-v2/dist/typechain/factories/contracts/SpokePoolVerifier__factory";
export { ERC20__factory } from "@across-protocol/contracts-v2/dist/typechain/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory";
export { AcceleratingDistributor__factory } from "@across-protocol/across-token/dist/typechain/factories/AcceleratingDistributor__factory";
export { ClaimAndStake__factory } from "@across-protocol/across-token/dist/typechain/factories/ClaimAndStake__factory";

export type { AcrossMerkleDistributor } from "@across-protocol/contracts-v2/dist/typechain/contracts/merkle-distributor/AcrossMerkleDistributor";
export type { HubPool } from "@across-protocol/contracts-v2/dist/typechain/contracts/HubPool";
export type { SpokePool } from "@across-protocol/contracts-v2/dist/typechain/contracts/SpokePool.sol/SpokePool";
export type { SpokePoolVerifier } from "@across-protocol/contracts-v2/dist/typechain/contracts/SpokePoolVerifier";
export type { AcceleratingDistributor } from "@across-protocol/across-token/dist/typechain/AcceleratingDistributor";
export type { ClaimAndStake } from "@across-protocol/across-token/dist/typechain/ClaimAndStake";
export type {
Expand Down

0 comments on commit 8e265b0

Please sign in to comment.