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

refactor: merkle campaign constructors #54

Merged
merged 6 commits into from
Feb 12, 2025

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented Jan 31, 2025

…e Lockups

refactor: refactor shape and camapign name as bytes32 in Merkle campaign constructor arguments
@smol-ninja smol-ninja force-pushed the refactor/merkle-campaign-params branch from df441a9 to 21dcfb9 Compare February 3, 2025 11:16
@andreivladbrg
Copy link
Member

@smol-ninja since we decided to have separate factory for each merkle contract, is this PR still relevant?

@smol-ninja
Copy link
Member Author

Yes. We are only splitting once factory contract into four. That does not mean we will not have the shares data structure. IMO, lets merge this PR and then split the factory on top of the changes.

@andreivladbrg
Copy link
Member

andreivladbrg commented Feb 11, 2025

but do we still need this:

Changing campaignName and shape to bytes32 has reduced the contract size by 3% (23,638 kB with 1000 runs).

i believe having it as string is better for UX

@smol-ninja
Copy link
Member Author

smol-ninja commented Feb 11, 2025

i believe having it as string is better for UX

Thats a good question. Lets ask @sablier-labs/frontend team if they are OK having campaignName as bytes32. I am fine with both., Except ipfsCID, we have other strings returning as bytes32 as well. If the team is fine with the change, I am fine keeping it as bytes32 as it does not offer a bad UX that much and at the same time makes contract code more efficient. The UI will still show the campaign name as string and on etherscan, I do not think the campaign name being string offers much value at all.

@andreivladbrg
Copy link
Member

well, why would we use bytes32 if size is no longer an issue?
the ipfsCID discussion we had yesterday was only relevant to solution 3 from your discussion (proxy pattern). but now, since we will have 3 factories, it's no longer relevant.

@smol-ninja
Copy link
Member Author

well, why would we use bytes32 if size is no longer an issue?

Fair point. I will change it to string but I would want to do it through a separate PR / issue (may be bundle it with factory splitting PR). #58 is built on top of this PR, so changing it would add a lot of work to that PR as well.

Is that OK?

@andreivladbrg
Copy link
Member

andreivladbrg commented Feb 11, 2025

after checking the roadmap for the next airdrops iteration, this change will be the only Hard Breaking Change (when that issue was created we didn't have the classification)

thus, to make things easier for @sablier-labs/frontend team, maybe it would be better to leave them as they are (though there is no need for the shape parameter in Merkle Instant).

i will let you, @razgraf, decide whether we should move forward with this change or not.

Related discussions

  1. Account for string in Create parameters #1 (comment)
  2. Separate out parameters of createMerkleInstant function #16

@razgraf
Copy link
Member

razgraf commented Feb 11, 2025

As discussed on Slack, we're okay moving forward with this.

@smol-ninja
Copy link
Member Author

@andreivladbrg I have pushed the commit as we discussed. I have also rolled back shape and campaignName back to string datatype. I'd request you to review it now.

refactor: remove aggregateAmount and recipientCount from ConstructorParams
docs: add natspec for missing params
@smol-ninja
Copy link
Member Author

@andreivladbrg can you please approve this PR if all looks good now?

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

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

@andreivladbrg can you please approve this PR if all looks good now?

sure, i haven't checked the inherited components, but i trust you on this

image

@smol-ninja smol-ninja merged commit ae31f29 into staging Feb 12, 2025
7 checks passed
@smol-ninja smol-ninja deleted the refactor/merkle-campaign-params branch February 12, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants