Verified contractExactMIT
MintedAndBoughtEligibility
Address0x45541ae91849b84a9e172219e90f0a70d25d2bfa
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.17
- Same code
Only this contract
Details
- Compiler
- solc 0.8.17+commit.8df45f5f
- Language
- solidity
- Optimization
- Yes, 1,000 runs
- EVM version
- london
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,330,265
- Creation transaction
- 0x81c0945a00…be1b9e060b
src/eligibility/MintedAndBoughtEligibility.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import {IEligibilityCondition} from "../interfaces/IEligibilityCondition.sol";
import {IOwnerOf} from "../interfaces/IOwnerOf.sol";
import {IBalanceOf} from "../interfaces/IBalanceOf.sol";
import {IGetMintStats} from "../interfaces/IGetMintStats.sol";
/// @notice "Selbst gemintet UND vom Sekundaermarkt gekauft" (Beard::Classy). Erfuellt, wenn der
/// AKTUELLE HALTER mindestens einen Auditor selbst gemintet hat (`minterNumMinted >= 1`) UND
/// aktuell MEHR Auditors haelt, als er je gemintet hat (`balanceOf > minterNumMinted`).
///
/// @dev NAEHERUNG, weil der NFT-Contract keinen Minter pro Token speichert: Wer mehr haelt als
/// er gemintet hat, muss mindestens einen Auditor auf anderem Weg bekommen haben, also gekauft
/// oder geschenkt bekommen (der Contract sieht den Unterschied zwischen Kauf und Geschenk nicht).
/// FALSE NEGATIVE: Wer ein selbst gemintetes Token verkauft und dafuer ein anderes gekauft
/// hat, haelt genauso viele wie er gemintet hat und wird NICHT erkannt. Es gibt keine falschen
/// Treffer in die andere Richtung, `minterNumMinted` ist kumulativ und sinkt nie.
contract MintedAndBoughtEligibility is IEligibilityCondition {
address public immutable nft;
constructor(address nft_) {
nft = nft_;
}
function isEligible(address, uint256 tokenId) external view returns (bool) {
address holder = IOwnerOf(nft).ownerOf(tokenId);
(uint256 minterNumMinted,,) = IGetMintStats(nft).getMintStats(holder);
return minterNumMinted >= 1 && IBalanceOf(nft).balanceOf(holder) > minterNumMinted;
}
}
src/interfaces/IBalanceOf.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Minimales gemeinsames Interface fuer balanceOf(address) -- identisch fuer
/// ERC-20 und ERC-721, deshalb hier nur einmal definiert statt zwei fast identische
/// Interfaces zu pflegen.
interface IBalanceOf {
function balanceOf(address account) external view returns (uint256);
}
src/interfaces/IEligibilityCondition.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Ja/Nein-Gegenstueck zu ITraitCondition: statt eine Tier-Stufe liefert
/// isEligible() nur "erfuellt der Halter diese eine Bedingung gerade oder nicht" --
/// Grundlage fuer TraitManagers freischaltbare Wahl-Traits (equipTrait).
interface IEligibilityCondition {
function isEligible(address tba, uint256 tokenId) external view returns (bool);
}
src/interfaces/IGetMintStats.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Minimales Interface fuer `getMintStats()`, Teil des `INonFungibleSeaDropToken`-
/// Interfaces, das `ERC721SeaDrop` (und damit `EigeneKollektionNFT`) bereits mitbringt.
/// `minterNumMinted` ist KUMULATIV (ERC721A `_numberMinted`) und bleibt bestehen, auch wenn
/// das Token spaeter verkauft oder verbrannt wird -- live gegen den echten Sepolia-Contract
/// verifiziert (2026-09-09/13, `getMintStats(minter)` liefert korrekt `(minterNumMinted,
/// currentTotalSupply, maxSupply)`, kein Revert bei unbeteiligter Adresse).
interface IGetMintStats {
function getMintStats(address minter)
external
view
returns (uint256 minterNumMinted, uint256 currentTotalSupply, uint256 maxSupply);
}
src/interfaces/IOwnerOf.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Minimales gemeinsames Interface fuer ownerOf(uint256) -- fuer JEDEN ERC-721,
/// nicht nur die eigene Kollektion (anders als INftTraitView, das zusaetzlich tbaOf()
/// verlangt und damit nur fuer den eigenen NFT-Contract passt). Gleiches Minimalprinzip
/// wie IBalanceOf.
interface IOwnerOf {
function ownerOf(uint256 tokenId) external view returns (address);
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 1000,
"enabled": true
},
"evmVersion": "london",
"remappings": [
"solady/=lib/solady/src/",
"forge-std/=lib/forge-std/src/",
"ERC721A/=lib/ERC721A/contracts/",
"solmate/=lib/solmate/src/",
"utility-contracts/=lib/utility-contracts/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
"seadrop/=lib/seadrop/",
"ds-test/=/home/philipp/Schreibtisch/Projekte/Crypto/Auditors-EigeneKollektion/contract/contracts/lib/solmate/lib/ds-test/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.