-
Notifications
You must be signed in to change notification settings - Fork 49
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
SOV-4378 utils hh tasks #550
base: bobDevelopment
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Consider change the
console.log
to use thelogger / node-logs
and apply the severity respectively (e.g: logger.warn() / logger.error() / logger.info()) - Remove the unnecessary comment
hardhat/tasks/misc.js
Outdated
"0x5684a06CaB22Db16d901fEe2A5C081b4C91eA40e" | ||
); | ||
//const abi = (await deployments.getArtifact("Staking")).abi; | ||
const abi = ["event VestingStakeSet(uint256,uint96)"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get the ABI from the deployment file instead? to be more reliable in case the event is changing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about who the original author of this hh task was (was me? crap!)
But seems that this abi element is never used in the current task. The only thing I did in this commit was to improve the name of the task to fit the format. Also seems the task needs additional refactor, coz is not working.
P.S.: Seems the key is in the "cblock" parameter. It may require a function to automatically detect what the right block is, but I'm affraid it is beyond the acceptance criteria of this Jira task
hardhat/tasks/misc.js
Outdated
} = hre; | ||
const staking = await ethers.getContractAt( | ||
"IStaking", | ||
"0x5684a06CaB22Db16d901fEe2A5C081b4C91eA40e" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read the address from the deployment file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
hardhat/tasks/misc.js
Outdated
cblock += 10000; | ||
if (cblock > block) cblock = block; | ||
const filter = { | ||
address: "0x5684a06CaB22Db16d901fEe2A5C081b4C91eA40e", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read from the deployment file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
hardhat/tasks/misc.js
Outdated
//console.log(await getEthersLog(staking, filter)); | ||
if (cres[0]) { | ||
console.log("index: ", index++, "\n", cres); | ||
//break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove unnecessary comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
hardhat/tasks/misc.js
Outdated
.setAction(async (taskArgs, hre) => { | ||
const { NODE_REAL_API_KEY } = process.env; | ||
const forkParams = { | ||
jsonRpcUrl: `https://eth-mainnet.nodereal.io/v1/${NODE_REAL_API_KEY}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably it's a good idea to put all of the fork rpc base url to a config. So that it can be reused, and easier to update.
Something like
const forkRpcUrls = {
"ethMainnet": "https:xxx",
"bobMainnet": "https:xxx",
....
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved
@cwsnt : Please check last commit: |
As required in the Description of the SOV-4378 Jira ticket, a pull request is shared for review.
In this PR the hh tasks utils:send-direct, canceltx and droptx were included in utils.js, among other changes in hardhat config, and package.json to enable an easier access to the commands.