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

Add status task to hardhat #1437

Merged
merged 7 commits into from
Aug 2, 2021
Merged

Conversation

leomassazza
Copy link
Contributor

@leomassazza leomassazza commented Jul 29, 2021

This PR adds a new script to run from hardhat. Based (copied) on synthetix-scripts's status.js. It allows the user to see state of the system.

Adds two capabilities:

  • get ExchangeRates of all symbols (default) or specify which ones to retrieve.
  • run a subset of actions to get specific system state.

i.e.
npx hardhat status --currency-keys SNX,iCOMP
will get only exchangeRate of SNX and iCOMP instead of the whole list

npx hardhat status --execute-actions Synthetix,SystemSettings,FeePool
will only get status information of Synthetix, SystemSettings and FeePool

or combining both
npx hardhat status --currency-keys SNX,iCOMP --execute-actions ExchangeRates
will only get ExchangeRates for SNX and iCOMP

The complete list of available actions/contracts to query up to now is:

  • Synthetix
  • DebtCache
  • SynthetixState
  • SupplySchedule
  • FeePool
  • FeePoolState
  • AddressResolver
  • SystemSettings
  • ExchangeRates

@leomassazza leomassazza changed the title Add staus task to hardhat Add status task to hardhat Jul 29, 2021
@leomassazza leomassazza marked this pull request as ready for review July 30, 2021 20:43
.addOptionalParam('block', 'Block number to check again')
.addOptionalParam('providerUrl', 'The http provider to use for communicating with the blockchain')
.addOptionalParam('deploymentPath', 'Specify the path to the deployment data directory')
.setAction(async (taskArguments, hre, runSuper) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.setAction(async (taskArguments, hre, runSuper) => {
.setAction(async (taskArguments, hre) => {

Copy link
Contributor

@theethernaut theethernaut left a comment

Choose a reason for hiding this comment

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

Looks awesome @leomassazza !!

A few comments:

  • Can we remove the "get" from actions. Even though including it is more rational, I think it will get in the way in terms of UX.
  • I'd prefer if we did not introduce hardhat task specific utils. We're spreading utils like getContract all over the place - in fact, we will probably need to unify them all soon. I'd rather putting them in place in the script or using things like the interact does, via synthetix.
  • I'd also rather moving statusActions out of utils and instead put this task under a folder "status", where the main file is index.js, next to "actions.js" or something. Like the deploy script declares a folder because its a multi-file script.
  • The latter two opinions would imply the deletion of hardhat/util.

@theethernaut theethernaut merged commit 6c346cf into develop Aug 2, 2021
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.

3 participants