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

feat: Basic SpokePool verification task #582

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Aug 14, 2024

This task intends to automate reading a small number of variables from the SpokePool on a given chain. This is currently limited to the set of common variables that are shared amongst all SpokePool deployments, but could be extended to query chain-specific SpokePool variables.

This should be run by any operator deploying a SpokePool to a new chain, and may also be integrated into CI.

This task intends to automate reading a small number of variables from
the SpokePool on a given chain. This is currently limited to the set of
common variables that are shared amongst all SpokePool deployments, but
could be extended to query chain-specific SpokePool variables.

This should be run by any operator deploying a SpokePool to a new chain,
and may also be integrated into CI.

Signed-off-by: Paul <[email protected]>
const spokePool = await SpokePool__factory.connect(spokeAddress, provider);

// Log state from SpokePool
const originChainId = await spokePool.chainId();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wrap these in a multicall to speed up the queries.

import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { getDeployedAddress } from "../src/DeploymentUtils";
import { SpokePool__factory } from "../typechain";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a problem; typechain might not be available at the time this is built.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example output:

~/dev/across-protocol/contracts$ yarn hardhat verify-spokepool --network zora                                                                                       
yarn run v1.22.15
$ /home/phk/dev/across-protocol/contracts/node_modules/.bin/hardhat verify-spokepool --network zora
SpokePool.chainId()                 : 7777777
SpokePool.getCurrentTime()          : 1723675599 (Wed, 14 Aug 2024 22:46:39 GMT)
SpokePool.depositQuoteTimeBuffer()  : 3600
SpokePool.fillDeadlineBuffer()      : 21600
SpokePool.wrappedNativeToken()      : 0x4200000000000000000000000000000000000006
SpokePool.hubPool()                 : 0xc186fA914353c44b2E33eBE05f21846F1048bEda
SpokePool.crossDomainAdmin()        : 0xc186fA914353c44b2E33eBE05f21846F1048bEda
Deposit routes                      : 0
Done in 15.39s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant