Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

HOLO-1536 save init payload (WIP)#318

Open
Yashiru wants to merge 9 commits intodevelopfrom
feature/HOLO-1536-save-init-payload
Open

HOLO-1536 save init payload (WIP)#318
Yashiru wants to merge 9 commits intodevelopfrom
feature/HOLO-1536-save-init-payload

Conversation

@Yashiru
Copy link
Copy Markdown
Contributor

@Yashiru Yashiru commented May 24, 2024

Describe Changes

I updated all the ERC721 sources contracts to make them store the payload used in their initialization.

For each source contracts

  • Add INIT_PAYLOAD private storage variable
  • Update init function to store the init payload in the INIT_PAYLOAD
  • Add a getter function that decode the INIT_PAYLOAD

Note

The initPayload could be directly storaged ass a struct type for each contracts, but in the CountdownERC721 and the CustomERC721 contracts, build failed with a stack too deep error in the constructors. So to create a "standard" in all contracts, I opted for a private storage variable of type bytes and a getter function to decode the bytes. This also made it possible to have a getter function named according to each contract.

Checklist before requesting a review

  • I have performed a self-review of my code
  • Code styles have been enforced
  • All Foundry tests are passing

@Yashiru Yashiru self-assigned this May 24, 2024
@@ -0,0 +1,218 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice. Thanks for adding this fixture. I think it'll be great if we can make all the tests relatively consistent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes you are right, I'd like to improve/refactor the entire foundry test base to standardize everything and make it consistent.

But we'll have to wait until everything has been migrated from hardhat to foundry I think.

wdyt ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah probably. we can do what we can on the tests we're writing but we probably shouldn't touch what the Think and Dev team are done until they reach a good stopping point

@alexanderattar alexanderattar marked this pull request as ready for review May 28, 2024 19:11
Copy link
Copy Markdown
Contributor

@alexanderattar alexanderattar left a comment

Choose a reason for hiding this comment

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

Nice. This looks good!

Copy link
Copy Markdown
Contributor

@sogoiii sogoiii left a comment

Choose a reason for hiding this comment

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

Can this also be applied to the ERC20 contracts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants