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

docs: add ScrollBadgeEligibilityCheck to ScrollBadgePermissionless #41

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/badge/examples/ScrollBadgePermissionless.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {Attestation} from "@eas/contracts/IEAS.sol";

import {ScrollBadge} from "../ScrollBadge.sol";
import {ScrollBadgeSelfAttest} from "../extensions/ScrollBadgeSelfAttest.sol";
import {ScrollBadgeEligibilityCheck} from "../extensions/ScrollBadgeEligibilityCheck.sol";
import {ScrollBadgeSingleton} from "../extensions/ScrollBadgeSingleton.sol";

/// @title ScrollBadgePermissionless
/// @notice A simple badge that anyone can mint in a permissionless manner.
contract ScrollBadgePermissionless is ScrollBadgeSelfAttest, ScrollBadgeSingleton {
contract ScrollBadgePermissionless is ScrollBadgeSelfAttest, ScrollBadgeEligibilityCheck, ScrollBadgeSingleton {
constructor(address resolver_) ScrollBadge(resolver_) {
// empty
}
Expand All @@ -19,7 +20,7 @@ contract ScrollBadgePermissionless is ScrollBadgeSelfAttest, ScrollBadgeSingleto
function onIssueBadge(Attestation calldata attestation)
internal
virtual
override (ScrollBadgeSelfAttest, ScrollBadgeSingleton)
override (ScrollBadge, ScrollBadgeSelfAttest, ScrollBadgeSingleton)
returns (bool)
{
return super.onIssueBadge(attestation);
Expand All @@ -29,7 +30,7 @@ contract ScrollBadgePermissionless is ScrollBadgeSelfAttest, ScrollBadgeSingleto
function onRevokeBadge(Attestation calldata attestation)
internal
virtual
override (ScrollBadgeSelfAttest, ScrollBadgeSingleton)
override (ScrollBadge, ScrollBadgeSelfAttest, ScrollBadgeSingleton)
returns (bool)
{
return super.onRevokeBadge(attestation);
Expand Down
14 changes: 3 additions & 11 deletions src/badge/examples/ScrollBadgeWhale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ import {Unauthorized} from "../../Errors.sol";

/// @title ScrollBadgeWhale
/// @notice A badge that shows that the user had 1000 ETH or more at the time of minting.
contract ScrollBadgeWhale is ScrollBadgePermissionless, ScrollBadgeEligibilityCheck {
contract ScrollBadgeWhale is ScrollBadgePermissionless {
constructor(address resolver_) ScrollBadgePermissionless(resolver_) {
// empty
}

/// @inheritdoc ScrollBadge
function onIssueBadge(Attestation calldata attestation)
internal
override (ScrollBadge, ScrollBadgePermissionless)
returns (bool)
{
function onIssueBadge(Attestation calldata attestation) internal override returns (bool) {
if (!super.onIssueBadge(attestation)) {
return false;
}
Expand All @@ -34,11 +30,7 @@ contract ScrollBadgeWhale is ScrollBadgePermissionless, ScrollBadgeEligibilityCh
}

/// @inheritdoc ScrollBadge
function onRevokeBadge(Attestation calldata attestation)
internal
override (ScrollBadge, ScrollBadgePermissionless)
returns (bool)
{
function onRevokeBadge(Attestation calldata attestation) internal override returns (bool) {
if (!super.onRevokeBadge(attestation)) {
return false;
}
Expand Down
Loading