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: Improve how the initial allocation is forwarded. #367

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

bowd
Copy link
Contributor

@bowd bowd commented Feb 12, 2024

Description

When we moved to a dynamic initial allocation calculation, we did something that has the potential for confusion: we're passing in two arrays to the GovernanceFactory contract:

  • additionalAllocationRecipients
  • allocationAmounts
    With the implicit idea that allocationAmounts.length == additionalAllocationRecipients.length + 2 and that the first two allocationAmounts relate to the airgrab and the Mento Treasury.

Even tho this is a one time thing I find that this adds the potential for confusion and will also make reviews more complicated.
I propose simplifying this by introducing an initial allocation struct:

  struct MentoTokenAllocationParams {
    uint256 airgrabAllocation;
    uint256 mentoTreasuryAllocation;
    address[] additionalAllocationRecipients;
    uint256[] additionalAllocationAmounts;
  }

This explicitly defines the two "implicit" allocations and then has an array of 1:1 additional recipients and amounts.
It's also nicer to read when reviewing the CGP (in the cgp-viewer app I wrote):
image

Other changes

N/A

Tested

  • Tests covered

Backwards compatibility

N/A

Documentation

N/A

Copy link

feat: Improve how the initial allocation is forwarded.

Generated at commit: fdaafc7c4c1aa597711f5168c9de995fd7a79037

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
1
0
16
40
59
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@baroooo baroooo self-requested a review February 12, 2024 15:20
Copy link
Contributor

@chapati23 chapati23 left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Copy link
Contributor

@baroooo baroooo left a comment

Choose a reason for hiding this comment

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

@bowd bowd merged commit 5ac585c into feat/tokenWork Feb 13, 2024
1 of 15 checks passed
@chapati23 chapati23 deleted the feat/improve-initial-allocation branch February 14, 2024 10:39
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