Conversation
cwsnt
left a comment
There was a problem hiding this comment.
- Consider change the
console.logto use thelogger / node-logsand 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.
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.
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.
Read the address from the deployment file
hardhat/tasks/misc.js
Outdated
| cblock += 10000; | ||
| if (cblock > block) cblock = block; | ||
| const filter = { | ||
| address: "0x5684a06CaB22Db16d901fEe2A5C081b4C91eA40e", |
There was a problem hiding this comment.
Read from the deployment file
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.
can remove unnecessary comment
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.
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",
....
}
@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.