Skip to content

Commit

Permalink
docs: add ScrollBadgeEligibilityCheck to ScrollBadgePermissionless (#41)
Browse files Browse the repository at this point in the history
* docs: add ScrollBadgeEligibilityCheck to ScrollBadgePermissionless example

* remove function
  • Loading branch information
Thegaram authored Apr 29, 2024
1 parent 6361dd0 commit 61f5724
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
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

0 comments on commit 61f5724

Please sign in to comment.