Skip to content

Add MetadataRegistry contract#586

Merged
thomas-waite merged 11 commits intofeat-governance-upgradefrom
feat-metadata-contract
Mar 23, 2022
Merged

Add MetadataRegistry contract#586
thomas-waite merged 11 commits intofeat-governance-upgradefrom
feat-metadata-contract

Conversation

@thomas-waite
Copy link
Contributor

@thomas-waite thomas-waite commented Mar 14, 2022

Summary

Adds a MetadataRegistry contract with a single non-permissioned state changing function: registerProposal(uint256 podId,uint256 proposalId,string memory metadata.

Used in order to emit metadata for pod proposals, which the frontend can listen to and display. This is required as Gnosis Safe's do not support adding arbitrary metadata. A spec is available if useful.

It is intended that the first function call in a pod transaction - before the transaction goes to the appropriate timelock - is sent to this contract. The contract can emit the metadata and allow the frontend to show the proposal as it is in the timelock, where it can the be vetoed if appropriate.

TODO

Once permissions PR is in, make the registerProposal() method permissioned to pods only. Will prevent an unlikely DDOS weakness

@thomas-waite thomas-waite requested a review from a team as a code owner March 14, 2022 17:51
@thomas-waite thomas-waite self-assigned this Mar 14, 2022
@thomas-waite thomas-waite changed the base branch from develop to feat-governance-upgrade March 14, 2022 17:51
@thomas-waite thomas-waite changed the base branch from feat-governance-upgrade to feat-deploy-pods March 15, 2022 16:38
Base automatically changed from feat-deploy-pods to feat-governance-upgrade March 15, 2022 21:26
uint256 podId,
uint256 proposalId,
string memory metadata
) external {
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that this function needs to be permissioned, otherwise we are going to get spammed with garbage data.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd take it a step further and possibly enforce that this is done atomically with pod creation. What are the pros and cons of this?

Copy link
Contributor Author

@thomas-waite thomas-waite Mar 21, 2022

Choose a reason for hiding this comment

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

Not sure I follow? My plan is to grant a new role POD_METADATA_REGISTER_ROLE, who's admin is the ROLE_ADMIN, when the pod is deployed.

I will then permission this registerProposal() function to that POD_METADATA_REGISTER_ROLE

@xklob
Copy link
Contributor

xklob commented Mar 18, 2022

@thomas-waite can you change the naming here to be more specific? Ie it would be really easy to confuse this, governance-proposal specific contract with the other, generalized metadata push that we're thinking about.

Something like "GovernanceMetadataRegistry" would suffice imo

@thomas-waite
Copy link
Contributor Author

@thomas-waite can you change the naming here to be more specific? Ie it would be really easy to confuse this, governance-proposal specific contract with the other, generalized metadata push that we're thinking about.

Something like "GovernanceMetadataRegistry" would suffice imo

Totally, have changed

@thomas-waite thomas-waite changed the title Add MetadataRegistry contract 2) Add MetadataRegistry contract Mar 21, 2022
Copy link
Contributor

@ElliotFriedman ElliotFriedman left a comment

Choose a reason for hiding this comment

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

LGTM!

@thomas-waite thomas-waite changed the title 2) Add MetadataRegistry contract Add MetadataRegistry contract Mar 22, 2022
@thomas-waite thomas-waite merged commit 4fe41d9 into feat-governance-upgrade Mar 23, 2022
@thomas-waite thomas-waite deleted the feat-metadata-contract branch March 23, 2022 22:42
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.

4 participants

Comments