-
Notifications
You must be signed in to change notification settings - Fork 10
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: add script and task for migration #208
Conversation
…tives into feat/stamp_migration
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.
seems fine, but batches.json and stamp_migration.sh should be placed somewhere else in a separate folder (maybe in tasks?).
Also fix the test please that was commented out.
// it('should transfer the token', async function () { | ||
// await postageStampStamper.copyBatch( | ||
// stamper, | ||
// batch.initialPaymentPerChunk, | ||
// batch.depth, | ||
// batch.bucketDepth, | ||
// batch.nonce, | ||
// batch.immutable | ||
// ); | ||
// expect(await token.balanceOf(stamper)).to.equal(0); | ||
// }); | ||
|
||
// it('should not create batch if insufficient funds', async function () { | ||
// await expect( | ||
// postageStampStamper.copyBatch( | ||
// stamper, | ||
// batch.initialPaymentPerChunk + 1, | ||
// batch.depth, | ||
// batch.bucketDepth, | ||
// batch.nonce, | ||
// batch.immutable | ||
// ) | ||
// ).to.be.revertedWith(errors.erc20.exceedsBalance); | ||
// }); |
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.
?
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.
Because we are removing erc20 transfers, if you remember we talked about withdrawing funds, if we withdraw then we just fund the new contract with that amount we dont transfer erc20 with each trx and there is really no need to as we dont track amount of funds each person has, its all pooled together.
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.
and what will ensure that we have the sufficient amount of funds in the new contract?
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.
This was not ensuring we had a sufficient amount of funds in the new contract anyway. Was just checking if basic erc20 methods are working.
We talked about this many times on synchs, we can go over it again if needed and discuss it if there are some concerns.
The summary is that we are not going to do erc20 token transfers on each batch migration. With that, we can't have these tests as they won't work.
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.
The amount of copy/pasted and generated data in this repository is unsettling.
please check my comments regarding that.
// it('should transfer the token', async function () { | ||
// await postageStampStamper.copyBatch( | ||
// stamper, | ||
// batch.initialPaymentPerChunk, | ||
// batch.depth, | ||
// batch.bucketDepth, | ||
// batch.nonce, | ||
// batch.immutable | ||
// ); | ||
// expect(await token.balanceOf(stamper)).to.equal(0); | ||
// }); | ||
|
||
// it('should not create batch if insufficient funds', async function () { | ||
// await expect( | ||
// postageStampStamper.copyBatch( | ||
// stamper, | ||
// batch.initialPaymentPerChunk + 1, | ||
// batch.depth, | ||
// batch.bucketDepth, | ||
// batch.nonce, | ||
// batch.immutable | ||
// ) | ||
// ).to.be.revertedWith(errors.erc20.exceedsBalance); | ||
// }); |
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.
and what will ensure that we have the sufficient amount of funds in the new contract?
scripts/tenderly_reset.ts
Outdated
@@ -0,0 +1,92 @@ | |||
// Run this only when you have NEW Tenderly FORK and what to do a new SETUP for it. |
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.
could you rephrase this description please? it is a bit vague for me what tenderly fork is, when I have new one and and what should I do with its setup
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.
yes, will do better.
scripts/tenderly_reset.ts
Outdated
await deleteFiles(filesToDelete); | ||
await deleteDirectory(directoryToDelete); | ||
|
||
const forkId = network.config.url.split('/').slice(-2).join('/'); |
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.
Property 'url' does not exist on type 'NetworkConfig'.
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.
yeah, it does exist but type is
export type NetworkConfig = HardhatNetworkConfig | HttpNetworkConfig;
I made type check now.
from: networkConfig['mainnet'].multisig, | ||
to: staking.address, | ||
input: | ||
'0x2f2ff15d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1c7f17ed88189abf269bf68a3b2ed83c5276aae', |
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.
what is this exactly?
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.
There is a comment above this what does this do.
No description provided.