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(contracts): refactor contracts code #913

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Dec 13, 2023

Description

Refactor by removing dead code, and various optimizations.

  • Remove dead code
  • Remove VkRegistry from ExtContracts and pass it directly to Mp, Tally and Subsidy - Poll does not need it and we save on external calls on these contracts
  • Remove onlyOwner from pollFactory to save on gas - It's fine if anyone deploys a Poll using the PollFactory - only Polls that have access to privileged MACI's functions are Polls deployed via MACI's deployPoll function
  • Remove init function from MACI's contract as this is not needed: If PollFactory is open to all, there is no need to check that ownership is assigned to the MACI contract, so we can remove the init function and modifiers to save gas, and just pass the top up credit address in the constructor.

Related issue(s)

Re #843

Confirmation

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for maci-typedoc ready!

Name Link
🔨 Latest commit 7cbe5bd
🔍 Latest deploy log https://app.netlify.com/sites/maci-typedoc/deploys/6579ed52e5ae33000810848f
😎 Deploy Preview https://deploy-preview-913--maci-typedoc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ctrlc03 ctrlc03 force-pushed the refactor/contracts-code branch from db37882 to a9a4a3c Compare December 13, 2023 10:27
@ctrlc03 ctrlc03 self-assigned this Dec 13, 2023
@ctrlc03 ctrlc03 force-pushed the refactor/contracts-code branch from a9a4a3c to 2deaa96 Compare December 13, 2023 11:34
…nd various optimizations

Remove dead code, remove VkRegistry from ExtContracts and pass it directly to Mp, Tally and Subsidy.
Remove onlyOwner from pollFactory to save on gas and remove init function from MACI's contract.
@ctrlc03 ctrlc03 force-pushed the refactor/contracts-code branch from 2deaa96 to 7cbe5bd Compare December 13, 2023 17:43
@ctrlc03 ctrlc03 added this to the MACI v1.1.1 refactor milestone Dec 13, 2023
Copy link
Member

@baumstern baumstern left a comment

Choose a reason for hiding this comment

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

decentralizing PollFactory +1

@ctrlc03 ctrlc03 merged commit 40e3cb2 into dev Dec 14, 2023
12 checks passed
@ctrlc03 ctrlc03 deleted the refactor/contracts-code branch December 14, 2023 08:39
@ctrlc03 ctrlc03 mentioned this pull request Jan 5, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants