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(eas-gatekeeper): implement an EAS gatekeeper for MACI #1109

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Jan 26, 2024

Description

Implement a MACI gatekeeper which allows signups only to users which have an attestation from a certain schema.

Additional Notes

The schema must be specified in the contract's constructor and it is immutable.

Related issue(s)

fix #1090

Confirmation

Copy link

netlify bot commented Jan 26, 2024

Deploy Preview for maci-typedoc ready!

Name Link
🔨 Latest commit 8b25d94
🔍 Latest deploy log https://app.netlify.com/sites/maci-typedoc/deploys/65b7d7531ebc730008d5063d
😎 Deploy Preview https://deploy-preview-1109--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.

contracts/contracts/gatekeepers/EASGatekeeper.sol Dismissed Show dismissed Hide dismissed
contracts/contracts/gatekeepers/SignUpTokenGatekeeper.sol Dismissed Show dismissed Hide dismissed
contracts/contracts/gatekeepers/EASGatekeeper.sol Fixed Show resolved Hide resolved
@@ -33,7 +33,7 @@

/// @notice Adds an uninitialised MACI instance to allow for token signups
/// @param _maci The MACI contract interface to be stored
function setMaciInstance(MACI _maci) public override onlyOwner {
function setMaciInstance(address _maci) public override onlyOwner {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch 3 times, most recently from a6c86d4 to 5465cde Compare January 26, 2024 18:14
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from 5465cde to da346ec Compare January 26, 2024 18:34
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch 2 times, most recently from 48989c0 to bf238bc Compare January 26, 2024 18:56
contracts/contracts/interfaces/IEAS.sol Fixed Show fixed Hide fixed
@@ -0,0 +1,85 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

Check warning

Code scanning / Slither

Incorrect versions of Solidity Warning

Pragma version^0.8.10 allows old versions
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

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

@ctrlc03 thanks, just some comments

contracts/contracts/gatekeepers/EASGatekeeper.sol Fixed Show resolved Hide resolved
contracts/contracts/gatekeepers/EASGatekeeper.sol Fixed Show resolved Hide resolved
contracts/contracts/interfaces/IEAS.sol Outdated Show resolved Hide resolved
contracts/package.json Outdated Show resolved Hide resolved
.github/workflows/contracts-build.yml Show resolved Hide resolved
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch 2 times, most recently from 7a1b625 to 302f3c1 Compare January 27, 2024 18:35
* @param _user The user's Ethereum address.
* @param _data The ABI-encoded schemaId as a uint256.
*/
function register(address _user, bytes memory _data) public override {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Parameter EASGatekeeper.register(address,bytes)._data is not in mixedCase

/// @notice Adds an uninitialised MACI instance to allow for token signups
/// @param _maci The MACI contract interface to be stored
function setMaciInstance(address _maci) public override onlyOwner {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Parameter EASGatekeeper.setMaciInstance(address)._maci is not in mixedCase
* @param _user The user's Ethereum address.
* @param _data The ABI-encoded schemaId as a uint256.
*/
function register(address _user, bytes memory _data) public override {

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

Parameter EASGatekeeper.register(address,bytes)._user is not in mixedCase
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from 302f3c1 to e430237 Compare January 28, 2024 21:02
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

Check warning

Code scanning / Slither

Incorrect versions of Solidity Warning

Pragma version^0.8.10 allows old versions
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from e33dc60 to dfeff26 Compare January 29, 2024 15:30
@ctrlc03 ctrlc03 requested a review from 0xmad January 29, 2024 15:55
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from dfeff26 to 2d3e25a Compare January 29, 2024 15:55
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from 2d3e25a to 91b74a7 Compare January 29, 2024 16:11
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

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

@ctrlc03 thanks, just one suggestion for tests.

contracts/tests/EASGatekeeper.test.ts Outdated Show resolved Hide resolved
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from 91b74a7 to b694dc5 Compare January 29, 2024 16:29
@ctrlc03 ctrlc03 requested a review from samajammin January 29, 2024 16:34
@ctrlc03 ctrlc03 force-pushed the feat/eas-gatekeeper branch from b694dc5 to 8b25d94 Compare January 29, 2024 16:50
@ctrlc03 ctrlc03 enabled auto-merge January 29, 2024 16:50
@ctrlc03 ctrlc03 merged commit 22a0e27 into dev Jan 29, 2024
19 checks passed
@ctrlc03 ctrlc03 deleted the feat/eas-gatekeeper branch January 29, 2024 17:06
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.

Create an EAS SignUpGatekeeper contract for OP badgeholders to sign up
4 participants