Skip to content

feat(GrantsMigration): allow permissioned off chain oracles to mint tokens and lock them for grants#46

Merged
aliXsed merged 3 commits intomainfrom
aliX/grants-migration-2
Jul 25, 2024
Merged

feat(GrantsMigration): allow permissioned off chain oracles to mint tokens and lock them for grants#46
aliXsed merged 3 commits intomainfrom
aliX/grants-migration-2

Conversation

@aliXsed
Copy link
Collaborator

@aliXsed aliXsed commented Jul 24, 2024

This contract is zksync side of the bridge from Eden Parachain. The tokens minted here are already burnt on the side of parachain. The implementation follows the same logic as we have had for the migration of free NODL tokens (NODLMigration).
The known limitation of this implementation is that if an oracle creates a vote with wrong parameters the consensus of other oracles can not fix the proposal. This is not expected to happen with our permissioned oracles. But in the worst case scenario, if the bridge doesn't proceed for a proposal, the governance needs to intervene. Until that no unintended consequence is expected.

  • Add basic tests
  • Complete the tests

@aliXsed aliXsed marked this pull request as ready for review July 24, 2024 05:03
@aliXsed aliXsed requested a review from ETeissonniere July 25, 2024 03:41
Copy link
Member

@ETeissonniere ETeissonniere left a comment

Choose a reason for hiding this comment

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

This is looking good. Added one general comment which however does not need to be addressed immediately

Comment on lines +55 to +64
_mustBeAnOracle(msg.sender);
_mustNotHaveExecutedYet(paraTxHash);

if (_proposalExists(paraTxHash)) {
_mustNotHaveVotedYet(paraTxHash, msg.sender);
_mustNotBeChangingParameters(paraTxHash, user, amount, schedules);
_recordVote(paraTxHash, msg.sender);
} else {
_createProposal(paraTxHash, msg.sender, user, amount, schedules);
}
Copy link
Member

Choose a reason for hiding this comment

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

(general comment, not a blocker) I wonder if some of this logic could be moved to your base contract. It sounds very similar to the logic for liquid tokens. It might be a bit too painful/inelegant to do though

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It could, I thought about it. I thought about two solutions. However it would involve more intrusive changes to our audited NODLMigration which I wanted to avoid.

@aliXsed aliXsed merged commit d1c1049 into main Jul 25, 2024
@aliXsed aliXsed deleted the aliX/grants-migration-2 branch July 25, 2024 23:58
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.

2 participants