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: add script and task for migration #208

Merged
merged 67 commits into from
Dec 6, 2023
Merged

Conversation

0xCardinalError
Copy link
Contributor

No description provided.

Copy link
Member

@nugaon nugaon left a 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.

Comment on lines +1241 to +1264
// 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);
// });
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

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.

Copy link
Member

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?

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 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.

Copy link
Member

@nugaon nugaon left a 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.

hardhat.config.ts Outdated Show resolved Hide resolved
hardhat.config.ts Show resolved Hide resolved
hardhat.config.ts Show resolved Hide resolved
Comment on lines +1241 to +1264
// 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);
// });
Copy link
Member

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?

tasks/copybatch.ts Outdated Show resolved Hide resolved
scripts/blocks.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,92 @@
// Run this only when you have NEW Tenderly FORK and what to do a new SETUP for it.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, will do better.

await deleteFiles(filesToDelete);
await deleteDirectory(directoryToDelete);

const forkId = network.config.url.split('/').slice(-2).join('/');
Copy link
Member

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'.

Copy link
Contributor Author

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',
Copy link
Member

Choose a reason for hiding this comment

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

what is this exactly?

Copy link
Contributor Author

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.

scripts/tenderly_reset.ts Outdated Show resolved Hide resolved
@0xCardinalError 0xCardinalError merged commit c868680 into master Dec 6, 2023
1 check passed
@0xCardinalError 0xCardinalError deleted the feat/stamp_migration branch December 6, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants