Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x026234c69cdFa4dc0c7f01806Df6B9d63E238B80
Balance 0 ETH
Nonce 1
Code Size 8251 bytes
Last Active
Indexed Transactions 3 (24,291,02524,314,928)
Gas Used (indexed) 326,449
External Etherscan · Sourcify

Contract Bytecode

8251 bytes
0x608060405234801561001057600080fd5b50600436106102325760003560e01c80638ddabcf511610130578063a840a7e7116100b8578063d1e4c6661161007c578063d1e4c666146105c2578063df88e8f7146105d5578063e985e9c5146105e1578063f2fde38b1461060f578063fa2816ca1461062257600080fd5b8063a840a7e714610536578063acd52e8d1461055d578063b80f55c914610589578063b88d4fde1461059c578063c87b56dd146105af57600080fd5b806394856295116100ff57806394856295146104be578063956fd85b146104e557806395d89b41146104f85780639c33ecb214610500578063a22cb4651461052357600080fd5b80638ddabcf5146104685780638e29adec146104805780638f37c6201461048857806391ff7e01146104ab57600080fd5b80636352211e116101be578063725bf99911610182578063725bf9991461039f578063855d67bc146103c657806389db52b2146103f95780638a0dac4a146104425780638da5cb5b1461045557600080fd5b80636352211e1461032c578063654f97a31461033f578063664dbc6b14610352578063680b50931461037957806370a082311461038c57600080fd5b806318160ddd1161020557806318160ddd146102ca57806323b872dd146102e057806334b7d7e4146102f357806342842e0e1461030657806355f804b31461031957600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b3146102b5575b600080fd5b61024a61024536600461194d565b61062a565b60405190151581526020015b60405180910390f35b610267610655565b6040516102569190611995565b61029d6102823660046119c8565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610256565b6102c86102c33660046119f6565b6106e3565b005b6102d2610728565b604051908152602001610256565b6102c86102ee366004611a22565b61075a565b6102c8610301366004611a63565b610926565b6102c8610314366004611a22565b6109d3565b6102c8610327366004611a96565b610acb565b61029d61033a3660046119c8565b610b01565b6102c861034d366004611b55565b610b58565b61029d7f000000000000000000000000120305aace78052a967182b277f6392670ee987381565b6102c86103873660046119f6565b610ba0565b6102d261039a366004611a63565b610bf5565b61029d7f0000000000000000000000000f78c6eee3c89ff37fd9ef96bd685830993636f281565b600c546103de9061ffff808216916201000090041682565b6040805161ffff938416815292909116602083015201610256565b600b5461041d9061ffff808216916201000081048216916401000000009091041683565b6040805161ffff94851681529284166020840152921691810191909152606001610256565b6102c8610450366004611a63565b610c58565b60085461029d906001600160a01b031681565b600d546103de9061ffff808216916201000090041682565b6102d2610ceb565b61024a6104963660046119c8565b60096020526000908152604090205460ff1681565b6102c86104b93660046119f6565b610d11565b61029d7f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b81565b6102c86104f33660046119f6565b610d70565b610267610dc5565b61024a61050e3660046119c8565b600a6020526000908152604090205460ff1681565b6102c8610531366004611b72565b610dd2565b61029d7f000000000000000000000000c3aa9bc72bd623168860a1e5c6a4530d3d80456c81565b61029d61056b366004611a63565b6001600160a01b039081166000908152600660205260409020541690565b6102c8610597366004611bab565b610e1e565b6102c86105aa366004611c20565b610f17565b6102676105bd3660046119c8565b610fff565b6102c86105d0366004611bab565b611033565b600b5461ffff166102d2565b61024a6105ef366004611cbf565b600560209081526000928352604080842090915290825290205460ff1681565b6102c861061d366004611a63565b6111c0565b6102d2611236565b600063126f552360e01b6001600160e01b03198316148061064f575061064f82611253565b92915050565b6000805461066290611ced565b80601f016020809104026020016040519081016040528092919081815260200182805461068e90611ced565b80156106db5780601f106106b0576101008083540402835291602001916106db565b820191906000526020600020905b8154815290600101906020018083116106be57829003601f168201915b505050505081565b336000908152600660205260409020546001600160a01b03161561071a5760405163c066bae760e01b815260040160405180910390fd5b61072482826112a1565b5050565b6000610732611236565b61073a610ceb565b600b5461ffff1661074b9190611d3d565b6107559190611d3d565b905090565b6000818152600260205260409020546001600160a01b038481169116146107b55760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b60448201526064015b60405180910390fd5b6001600160a01b0382166107ff5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107ac565b336001600160a01b038416148061083957506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b8061085a57506000818152600460205260409020546001600160a01b031633145b6108975760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016107ac565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b03818116600090815260066020526040902054163314610984576001600160a01b038181166000908152600660205260409081902054905163731b25c760e11b8152336004820152911660248201526044016107ac565b6001600160a01b03811660008181526006602052604080822080546001600160a01b0319169055517fb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c529190a250565b6109de83838361075a565b6001600160a01b0382163b1580610a875750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610a57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7b9190611d50565b6001600160e01b031916145b610ac65760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b60448201526064016107ac565b505050565b6008546001600160a01b03163314610af55760405162461bcd60e51b81526004016107ac90611d6d565b60076107248282611de1565b6000818152600260205260409020546001600160a01b031680610b535760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107ac565b919050565b6008546001600160a01b03163314610b825760405162461bcd60e51b81526004016107ac90611d6d565b60088054911515600160a01b0260ff60a01b19909216919091179055565b336001600160a01b037f000000000000000000000000120305aace78052a967182b277f6392670ee98731614610be9576040516348f5c3ed60e01b815260040160405180910390fd5b610724600d8284611383565b60006001600160a01b038216610c3c5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016107ac565b506001600160a01b031660009081526003602052604090205490565b336001600160a01b0382161480610c7657506001600160a01b038116155b15610c945760405163a6c1146b60e01b815260040160405180910390fd5b3360008181526006602052604080822080546001600160a01b0319166001600160a01b03861690811790915590519092917fbc3292102fa77e083913064b282926717cdfaede4d35f553d66366c0a3da755a91a350565b600c54600090610d089061ffff8082169162010000900416611ea1565b61ffff16905090565b336001600160a01b037f000000000000000000000000120305aace78052a967182b277f6392670ee98731614610d5a576040516348f5c3ed60e01b815260040160405180910390fd5b610be9600c610d6a836002611ec3565b84611383565b336001600160a01b037f000000000000000000000000120305aace78052a967182b277f6392670ee98731614610db9576040516348f5c3ed60e01b815260040160405180910390fd5b610724600c8284611383565b6001805461066290611ced565b336000908152600660205260409020546001600160a01b031615801590610df65750805b15610e145760405163c066bae760e01b815260040160405180910390fd5b61072482826113d6565b60005b81811015610ac6576000610e4c848484818110610e4057610e40611eda565b90506020020135610b01565b9050336001600160a01b03821614801590610e8b57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff16155b8015610ecf575060046000858585818110610ea857610ea8611eda565b60209081029290920135835250810191909152604001600020546001600160a01b03163314155b15610eed576040516348f5c3ed60e01b815260040160405180910390fd5b610f0e848484818110610f0257610f02611eda565b90506020020135611442565b50600101610e21565b610f2285858561075a565b6001600160a01b0384163b1580610fb95750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610f6a9033908a90899089908990600401611ef0565b6020604051808303816000875af1158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190611d50565b6001600160e01b031916145b610ff85760405162461bcd60e51b815260206004820152601060248201526f155394d0519157d49150d2541251539560821b60448201526064016107ac565b5050505050565b6060600761100c8361150f565b60405160200161101d929190611f44565b6040516020818303038152906040529050919050565b600854600160a01b900460ff1661105d57604051635874e70f60e11b815260040160405180910390fd5b60005b81811015610ac657600083838381811061107c5761107c611eda565b90506020020135905061108e81611553565b6110ab5760405163b23a568360e01b815260040160405180910390fd5b60008181526009602052604090205460ff16156110db57604051630c8d9eab60e31b815260040160405180910390fd5b6000818152600960205260409020805460ff191660011790556110fe3382611829565b6000818152600a602052604090205460ff161561119e57600b5461ffff640100000000820481166201000090920416111561114c576040516317a6c99160e31b815260040160405180910390fd5b600b5461116490339062010000900461ffff16611829565b600b8054600161ffff6201000080840482168301821602808216828516179092011661ffff1990911663ffffffff19909216919091171790555b50600b805461ffff198116600161ffff92831681019092161790915501611060565b6008546001600160a01b031633146111ea5760405162461bcd60e51b81526004016107ac90611d6d565b600880546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b600d54600090610d089061ffff8082169162010000900416611ea1565b60006301ffc9a760e01b6001600160e01b03198316148061128457506380ac58cd60e01b6001600160e01b03198316145b8061064f5750506001600160e01b031916635b5e139f60e01b1490565b6000818152600260205260409020546001600160a01b0316338114806112ea57506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6113275760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016107ac565b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60005b828110156113d05783546113a590839062010000900461ffff16611829565b8354600161ffff62010000808404821683019091160263ffff00001990921691909117855501611386565b50505050565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000818152600260205260409020546001600160a01b0316806114945760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107ac565b6001600160a01b038116600081815260036020908152604080832080546000190190558583526002825280832080546001600160a01b031990811690915560049092528083208054909216909155518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a9004806115295750819003601f19909101908152919050565b6040516331a9108f60e11b8152600481018290526000907f0000000000000000000000000f78c6eee3c89ff37fd9ef96bd685830993636f26001600160a01b031690636352211e90602401602060405180830381865afa1580156115bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115df9190611fcb565b6001600160a01b0316336001600160a01b0316148061175857507f00000000000000000000000000000000000076a84fef008cdabe6409d2fe638b6001600160a01b031663aba69cf8337f0000000000000000000000000f78c6eee3c89ff37fd9ef96bd685830993636f26001600160a01b0316636352211e866040518263ffffffff1660e01b815260040161167791815260200190565b602060405180830381865afa158015611694573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b89190611fcb565b60405160e084901b6001600160e01b03191681526001600160a01b03928316600482015290821660248201527f0000000000000000000000000f78c6eee3c89ff37fd9ef96bd685830993636f2909116604482015260648101859052608401602060405180830381865afa158015611734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117589190611fe8565b8061064f57506040516307ca74b760e21b81526001600160a01b037f0000000000000000000000000f78c6eee3c89ff37fd9ef96bd685830993636f281166004830152602482018490527f000000000000000000000000c3aa9bc72bd623168860a1e5c6a4530d3d80456c1690631f29d2dc90604401602060405180830381865afa1580156117eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180f9190611fcb565b6001600160a01b0316336001600160a01b03161492915050565b6001600160a01b0382166118735760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107ac565b6000818152600260205260409020546001600160a01b0316156118c95760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b60448201526064016107ac565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461194a57600080fd5b50565b60006020828403121561195f57600080fd5b813561196a81611934565b9392505050565b60005b8381101561198c578181015183820152602001611974565b50506000910152565b60208152600082518060208401526119b4816040850160208701611971565b601f01601f19169190910160400192915050565b6000602082840312156119da57600080fd5b5035919050565b6001600160a01b038116811461194a57600080fd5b60008060408385031215611a0957600080fd5b8235611a14816119e1565b946020939093013593505050565b600080600060608486031215611a3757600080fd5b8335611a42816119e1565b92506020840135611a52816119e1565b929592945050506040919091013590565b600060208284031215611a7557600080fd5b813561196a816119e1565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611aa857600080fd5b813567ffffffffffffffff80821115611ac057600080fd5b818401915084601f830112611ad457600080fd5b813581811115611ae657611ae6611a80565b604051601f8201601f19908116603f01168101908382118183101715611b0e57611b0e611a80565b81604052828152876020848701011115611b2757600080fd5b826020860160208301376000928101602001929092525095945050505050565b801515811461194a57600080fd5b600060208284031215611b6757600080fd5b813561196a81611b47565b60008060408385031215611b8557600080fd5b8235611b90816119e1565b91506020830135611ba081611b47565b809150509250929050565b60008060208385031215611bbe57600080fd5b823567ffffffffffffffff80821115611bd657600080fd5b818501915085601f830112611bea57600080fd5b813581811115611bf957600080fd5b8660208260051b8501011115611c0e57600080fd5b60209290920196919550909350505050565b600080600080600060808688031215611c3857600080fd5b8535611c43816119e1565b94506020860135611c53816119e1565b935060408601359250606086013567ffffffffffffffff80821115611c7757600080fd5b818801915088601f830112611c8b57600080fd5b813581811115611c9a57600080fd5b896020828501011115611cac57600080fd5b9699959850939650602001949392505050565b60008060408385031215611cd257600080fd5b8235611cdd816119e1565b91506020830135611ba0816119e1565b600181811c90821680611d0157607f821691505b602082108103611d2157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561064f5761064f611d27565b600060208284031215611d6257600080fd5b815161196a81611934565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b601f821115610ac657600081815260208120601f850160051c81016020861015611dba5750805b601f850160051c820191505b81811015611dd957828155600101611dc6565b505050505050565b815167ffffffffffffffff811115611dfb57611dfb611a80565b611e0f81611e098454611ced565b84611d93565b602080601f831160018114611e445760008415611e2c5750858301515b600019600386901b1c1916600185901b178555611dd9565b600085815260208120601f198616915b82811015611e7357888601518255948401946001909101908401611e54565b5085821015611e915787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61ffff828116828216039080821115611ebc57611ebc611d27565b5092915050565b808202811582820484141761064f5761064f611d27565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b6000808454611f5281611ced565b60018281168015611f6a5760018114611f7f57611fae565b60ff1984168752821515830287019450611fae565b8860005260208060002060005b85811015611fa55781548a820152908401908201611f8c565b50505082870194505b505050508351611fc2818360208801611971565b01949350505050565b600060208284031215611fdd57600080fd5b815161196a816119e1565b600060208284031215611ffa57600080fd5b815161196a81611b4756fea2646970667358221220adb6875fc7588043d384fd387f224adff1a194db083415573c4e4a7b90955b2b64736f6c63430008120033

Verified Source Code Full Match

Compiler: v0.8.18+commit.87f61d96 EVM: london Optimization: Yes (200 runs)
INuclearNerds.sol 7 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface INuclearNerds {
  function isOwnerOf(address account, uint256[] calldata _tokenIds) external view returns (bool);
  function ownerOf(uint256 tokenid) external view returns (address);
}
IWarm.sol 9 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IWarm {
    function ownerOf(
        address contractAddress,
        uint256 tokenId
    ) external view returns (address);
}
MarauderErrors.sol 19 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

error InvalidProof();
error WrongValueSent();
error ExceedMaxSupply();
error InvalidCaller();
error TokenTypeSoldOut();
error MustOwnMatchingNerd();
error AllBerserkersMinted();
error AlreadyClaimed();
error ConsumerAlreadySet();
error SaleNotActive();
error ArrayLengthMismatch();
error ExceedMaxPerWallet();
error SmashingNotActive();
error FailedToMint();
error ClaimNotStarted();
error MintZeroAmount();
MarauderStructs.sol 35 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

struct MintableTokenDetails {
  uint16 startTokenId;
  uint16 currentTokenId;
}

struct ClaimableTokenDetails {
  uint16 totalSupply;
  uint16 currentBonusTokenId;
  uint16 maxBonusTokenId;
}

struct PhaseDetails {
  bytes32 root;
  uint64 startTime;
}

struct ItemDetails {
  bytes4 mintFunctionSelector;
  uint16 numUnitsSold;
  uint16 maxUnitsAllowed;
  uint16 maxNerdPhaseUnitsAllowedPerWallet;
  address mintContractAddress;
  uint64 price;
  uint64 discountedPrice;
}

struct MintTracker {
  uint32 numBoxesMinted;
  uint32 numEnforcersMinted;
  uint32 numWarlordsMinted;
  uint32 numSerumsMinted;
}
IGuardable.sol 22 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.13;

import "openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IGuardable is IERC165 {
  // Interface ID 0x126f5523

  error TokenIsLocked();
  error CallerGuardianMismatch(address caller, address guardian);
  error InvalidGuardian();

  event GuardianAdded(address indexed addressGuarded, address indexed guardian);
  event GuardianRemoved(address indexed addressGuarded);

  function setGuardian(address guardian) external;

  function removeGuardianOf(address tokenOwner) external;

  function guardianOf(address tokenOwner) external view returns (address);
}
ERC721Guardable.sol 98 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "solmate/tokens/ERC721.sol";
import "../Guardable.sol";

/**
 * @dev Contract module which provides added security functionality, where
 * where an account can assign a guardian to protect their NFTs. While a guardian
 * is assigned, setApprovalForAll and approve are both locked. New approvals cannot be set. There can
 * only ever be one guardian per account, and setting a new guardian will overwrite
 * any existing one.
 *
 * Existing approvals can still be leveraged as normal, and it is expected that this
 * functionality be used after a user has set the approvals they want to set. Approvals
 * can still be removed while a guardian is set.
 * 
 * Setting a guardian has no effect on transfers, so users can move assets to a new wallet
 * to effectively "clear" guardians if a guardian is maliciously set, or keys to a guardian
 * are lost.
 *
 * It is not recommended to use _lockToSelf, as removing this lock would be easily added to
 * a malicious workflow, whereas removing a traditional lock from a guardian account would
 * be sufficiently prohibitive.
 */

contract ERC721Guardable is ERC721, Guardable {
  string internal baseUri;

  constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {}

  function supportsInterface(bytes4 interfaceId) public view virtual override(Guardable, ERC721) returns (bool) {
    return Guardable.supportsInterface(interfaceId) || ERC721.supportsInterface(interfaceId);
  }

  function approve(address to, uint256 tokenId) public override {
    if (locks[msg.sender] != address(0)) {
      revert TokenIsLocked();
    }

    super.approve(to, tokenId);
  }

  function setApprovalForAll(address operator, bool approved) public override {
    if (locks[msg.sender] != address(0) && approved) {
      revert TokenIsLocked();
    }

    super.setApprovalForAll(operator, approved);
  }

  function tokenURI(uint256 id) public view virtual override returns (string memory) {
    return string(abi.encodePacked(baseUri, _toString(id)));
  }

  // From ERC721A
  /**
    * @dev Converts a uint256 to its ASCII string decimal representation.
  */
  function _toString(uint256 value) internal pure virtual returns (string memory str) {
      assembly {
          // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
          // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
          // We will need 1 word for the trailing zeros padding, 1 word for the length,
          // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
          let m := add(mload(0x40), 0xa0)
          // Update the free memory pointer to allocate.
          mstore(0x40, m)
          // Assign the `str` to the end.
          str := sub(m, 0x20)
          // Zeroize the slot after the string.
          mstore(str, 0)

          // Cache the end of the memory to calculate the length later.
          let end := str

          // We write the string from rightmost digit to leftmost digit.
          // The following is essentially a do-while loop that also handles the zero case.
          // prettier-ignore
          for { let temp := value } 1 {} {
              str := sub(str, 1)
              // Write the character to the pointer.
              // The ASCII index of the '0' character is 48.
              mstore8(str, add(48, mod(temp, 10)))
              // Keep dividing `temp` until zero.
              temp := div(temp, 10)
              // prettier-ignore
              if iszero(temp) { break }
          }

          let length := sub(end, str)
          // Move the pointer 32 bytes leftwards to make room for the length.
          str := sub(str, 0x20)
          // Store the length.
          mstore(str, length)
      }
  }
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
Owned.sol 44 lines
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event OwnershipTransferred(address indexed user, address indexed newOwner);

    /*//////////////////////////////////////////////////////////////
                            OWNERSHIP STORAGE
    //////////////////////////////////////////////////////////////*/

    address public owner;

    modifier onlyOwner() virtual {
        require(msg.sender == owner, "UNAUTHORIZED");

        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address _owner) {
        owner = _owner;

        emit OwnershipTransferred(address(0), _owner);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNERSHIP LOGIC
    //////////////////////////////////////////////////////////////*/

    function transferOwnership(address newOwner) public virtual onlyOwner {
        owner = newOwner;

        emit OwnershipTransferred(msg.sender, newOwner);
    }
}
IDelegateCash.sol 11 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

interface IDelegateCash {
    function checkDelegateForToken(
        address delegate,
        address vault,
        address contract_,
        uint256 tokenId
    ) external view returns (bool);
}
Guardable.sol 44 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "./IGuardable.sol";

/**
* Abstract contract to be used with ERC1155 or ERC721 or their extensions.
* See ERC721Guardable or ERC1155Guardable for examples of how to overwrite
* setApprovalForAll and approve to be Guardable. Overwriting other functions
* is possible but not recommended.
*/
abstract contract Guardable is IGuardable {
  mapping(address => address) internal locks;

  function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
    return interfaceId == type(IGuardable).interfaceId;
  }

  function setGuardian(address guardian) public {
    if (msg.sender == guardian || guardian == address(0)) {
      revert InvalidGuardian();
    }

    locks[msg.sender] = guardian;
    emit GuardianAdded(msg.sender, guardian);
  }

  function guardianOf(address tokenOwner) public view returns (address) {
    return locks[tokenOwner];
  }

  function removeGuardianOf(address tokenOwner) external {
    if (msg.sender != guardianOf(tokenOwner)) {
      revert CallerGuardianMismatch(msg.sender, guardianOf(tokenOwner));
    }
    delete locks[tokenOwner];
    emit GuardianRemoved(tokenOwner);
  }

  function _lockToSelf() internal virtual {
    locks[msg.sender] = msg.sender;
    emit GuardianAdded(msg.sender, msg.sender);
  }
}
ERC721.sol 231 lines
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern, minimalist, and gas efficient ERC-721 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol)
abstract contract ERC721 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 indexed id);

    event Approval(address indexed owner, address indexed spender, uint256 indexed id);

    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /*//////////////////////////////////////////////////////////////
                         METADATA STORAGE/LOGIC
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    function tokenURI(uint256 id) public view virtual returns (string memory);

    /*//////////////////////////////////////////////////////////////
                      ERC721 BALANCE/OWNER STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(uint256 => address) internal _ownerOf;

    mapping(address => uint256) internal _balanceOf;

    function ownerOf(uint256 id) public view virtual returns (address owner) {
        require((owner = _ownerOf[id]) != address(0), "NOT_MINTED");
    }

    function balanceOf(address owner) public view virtual returns (uint256) {
        require(owner != address(0), "ZERO_ADDRESS");

        return _balanceOf[owner];
    }

    /*//////////////////////////////////////////////////////////////
                         ERC721 APPROVAL STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(uint256 => address) public getApproved;

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(string memory _name, string memory _symbol) {
        name = _name;
        symbol = _symbol;
    }

    /*//////////////////////////////////////////////////////////////
                              ERC721 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 id) public virtual {
        address owner = _ownerOf[id];

        require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED");

        getApproved[id] = spender;

        emit Approval(owner, spender, id);
    }

    function setApprovalForAll(address operator, bool approved) public virtual {
        isApprovedForAll[msg.sender][operator] = approved;

        emit ApprovalForAll(msg.sender, operator, approved);
    }

    function transferFrom(
        address from,
        address to,
        uint256 id
    ) public virtual {
        require(from == _ownerOf[id], "WRONG_FROM");

        require(to != address(0), "INVALID_RECIPIENT");

        require(
            msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],
            "NOT_AUTHORIZED"
        );

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        unchecked {
            _balanceOf[from]--;

            _balanceOf[to]++;
        }

        _ownerOf[id] = to;

        delete getApproved[id];

        emit Transfer(from, to, id);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id
    ) public virtual {
        transferFrom(from, to, id);

        require(
            to.code.length == 0 ||
                ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") ==
                ERC721TokenReceiver.onERC721Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        bytes calldata data
    ) public virtual {
        transferFrom(from, to, id);

        require(
            to.code.length == 0 ||
                ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) ==
                ERC721TokenReceiver.onERC721Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    /*//////////////////////////////////////////////////////////////
                              ERC165 LOGIC
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721
            interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 id) internal virtual {
        require(to != address(0), "INVALID_RECIPIENT");

        require(_ownerOf[id] == address(0), "ALREADY_MINTED");

        // Counter overflow is incredibly unrealistic.
        unchecked {
            _balanceOf[to]++;
        }

        _ownerOf[id] = to;

        emit Transfer(address(0), to, id);
    }

    function _burn(uint256 id) internal virtual {
        address owner = _ownerOf[id];

        require(owner != address(0), "NOT_MINTED");

        // Ownership check above ensures no underflow.
        unchecked {
            _balanceOf[owner]--;
        }

        delete _ownerOf[id];

        delete getApproved[id];

        emit Transfer(owner, address(0), id);
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL SAFE MINT LOGIC
    //////////////////////////////////////////////////////////////*/

    function _safeMint(address to, uint256 id) internal virtual {
        _mint(to, id);

        require(
            to.code.length == 0 ||
                ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "") ==
                ERC721TokenReceiver.onERC721Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _safeMint(
        address to,
        uint256 id,
        bytes memory data
    ) internal virtual {
        _mint(to, id);

        require(
            to.code.length == 0 ||
                ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) ==
                ERC721TokenReceiver.onERC721Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }
}

/// @notice A generic interface for a contract which properly accepts ERC721 tokens.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol)
abstract contract ERC721TokenReceiver {
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC721TokenReceiver.onERC721Received.selector;
    }
}
MadMaraudersOfTheAccidentalApocalypse.sol 209 lines
import "Guardable/ERC721Guardable.sol";
import "solmate/auth/Owned.sol";
import "./lib/MarauderErrors.sol";
import "./lib/MarauderStructs.sol";
import "./interfaces/INuclearNerds.sol";
import "./interfaces/IWarm.sol";
import "./interfaces/IDelegateCash.sol";

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

contract MadMaraudersOfTheAccidentalApocalypse is ERC721Guardable, Owned {
    address public immutable BOX_O_BAD_GUYS_CONTRACT_ADDRESS;
    address public immutable NERDS_CONTRACT_ADDRESS;

    bool claimOpen;

    IWarm public immutable warm;
    IDelegateCash public immutable delegateCash;
    INuclearNerds private immutable nerds;

    mapping(uint256 => bool) public nerdHasClaimed;
    mapping(uint256 => bool) public berserkersEligibleForClaim;

    // max supply 7843 (1:1 nerds + bonus for berserkers - 900 enforcers - 300 warlords)
    ClaimableTokenDetails public raiderTokenDetails;

    /**
     * @notice max supply 5907 (enforced by MadMarauderBoxOBadGuys contract)
     * ------------------------
     * box supply = 2 * 969
     * a la carte supply = 3069
     * claimable supply = 900
     * ------------------------
     * 2 * 969 + 2069 + 900 = 5907
     * ------------------------
     */
    MintableTokenDetails public enforcerTokenDetails;

    /**
     * @notice max supply 3338 (enforced by MadMarauderBoxOBadGuys contract)
     * ------------------------
     * box supply = 969
     * a la carte supply = 2069
     * claimable supply = 300
     * ------------------------
     * 969 + 3069 + 300 = 3338
     * ------------------------
     */
    MintableTokenDetails public warlordTokenDetails;

    constructor(
      address _mintPassContractAddress,
      address _nerdsContractAddress,
      address _warmWalletContractAddress,
      address _delegateCashContract,
      uint256[43] memory berserkerTokenIds,
      string memory _uri
    ) ERC721Guardable("Marauders Of The Accidental Apocalypse", "MARAUDERS") Owned(msg.sender) {
      BOX_O_BAD_GUYS_CONTRACT_ADDRESS = _mintPassContractAddress;
      NERDS_CONTRACT_ADDRESS = _nerdsContractAddress;
      warm = IWarm(_warmWalletContractAddress);
      delegateCash = IDelegateCash(_delegateCashContract);
      nerds = INuclearNerds(NERDS_CONTRACT_ADDRESS);

      enforcerTokenDetails.startTokenId = enforcerTokenDetails.currentTokenId = 9043;
      warlordTokenDetails.startTokenId = warlordTokenDetails.currentTokenId = 14050;

      raiderTokenDetails.currentBonusTokenId = 9000;
      raiderTokenDetails.maxBonusTokenId = 9042;

      for (uint256 i = 0; i < berserkerTokenIds.length;) {
        berserkersEligibleForClaim[berserkerTokenIds[i]] = true;
        unchecked {++i;}
      }

      baseUri = _uri;
    }

    /**
     * @notice function to claim a raider for each nerd you own
     * @param _tokenIds Nerd IDs to claim for. Must own each nerd token, supports delegation through delegate.cash and warm.xyz
     */
    function claimRaiders(uint256[] calldata _tokenIds) external {
      if (!claimOpen) revert ClaimNotStarted();

      for (uint256 i = 0; i < _tokenIds.length;) {
        uint256 tokenId = _tokenIds[i];
        if (!ownerOrDelegateOf(tokenId)) revert MustOwnMatchingNerd();
        if (nerdHasClaimed[tokenId]) revert AlreadyClaimed();
        nerdHasClaimed[tokenId] = true;
        _mint(msg.sender, tokenId);

        if (berserkersEligibleForClaim[tokenId]) {
          if (raiderTokenDetails.currentBonusTokenId > raiderTokenDetails.maxBonusTokenId) revert AllBerserkersMinted();
          _mint(msg.sender, raiderTokenDetails.currentBonusTokenId);
          unchecked { 
            ++raiderTokenDetails.currentBonusTokenId;
            ++raiderTokenDetails.totalSupply;
          }
        }

        unchecked { 
          ++i;
          ++raiderTokenDetails.totalSupply;
        }
      }
    }

    function tokenURI(uint256 id) public view virtual override returns (string memory) {
      return string(abi.encodePacked(baseUri, _toString(id)));
    }

    /**
     * @notice The total number of minted raiders
     */
    function totalRaiderSupply() public view returns (uint256) {
      return raiderTokenDetails.totalSupply;
    }

    /**
     * @notice The total number of minted enforcers
     */
    function totalEnforcerSupply() public view returns (uint256) {
      return enforcerTokenDetails.currentTokenId - enforcerTokenDetails.startTokenId;
    }

    /**
     * @notice The total number of minted warlords
     */
    function totalWarlordSupply() public view returns (uint256) {
      return warlordTokenDetails.currentTokenId - warlordTokenDetails.startTokenId;
    }

    /**
     * @notice The total number of all minted tokens combined: raiders, enforcers, and warlords.
     */
    function totalSupply() public view returns (uint256) {
      return totalRaiderSupply() + totalEnforcerSupply() + totalWarlordSupply();
    }

    /**
     * @notice Token burn callable by token owner or approved address
     */
    function burn(uint256[] calldata tokenIds) external {
      for (uint256 i = 0; i < tokenIds.length;) {
        address from = ownerOf(tokenIds[i]);

        if (msg.sender != from && !isApprovedForAll[from][msg.sender] && msg.sender != getApproved[tokenIds[i]]) {
          revert InvalidCaller();
        }

        _burn(tokenIds[i]);
        unchecked { ++i; }
      }
    }

    /**
     * @dev Checks for ownership or delegated ownership of a given token. Supports Warm and Delegate.cash
     */
    function ownerOrDelegateOf(uint256 tokenId) internal view returns (bool) {
      return
        msg.sender == nerds.ownerOf(tokenId) ||
        delegateCash.checkDelegateForToken(msg.sender, nerds.ownerOf(tokenId), NERDS_CONTRACT_ADDRESS, tokenId) ||
        msg.sender == warm.ownerOf(NERDS_CONTRACT_ADDRESS, tokenId);
    }

    /* BOX FUNCTIONS (callable from Box Of Bad Guys contract) */

    function mintFromBox(address recipient, uint256 amount) external onlyBox {
      _mint(enforcerTokenDetails, amount * 2, recipient);
      _mint(warlordTokenDetails, amount, recipient);
    }

    function mintEnforcer(address recipient, uint256 amount) external onlyBox {
      _mint(enforcerTokenDetails, amount, recipient);
    }

    function mintWarlord(address recipient, uint256 amount) external onlyBox {
      _mint(warlordTokenDetails, amount, recipient);
    }

    modifier onlyBox {
      if (msg.sender != BOX_O_BAD_GUYS_CONTRACT_ADDRESS) revert InvalidCaller();
      _;
    }

    /* ADMIN FUNCTIONS */

    function setBaseURI(string memory _uri) external onlyOwner {
      baseUri = _uri;
    }

    function setClaimStatus(bool status) external onlyOwner {
      claimOpen = status;
    }

    /* INTERNAL HELPERS */

    function _mint(MintableTokenDetails storage tokenDetails, uint256 amount, address recipient) internal {
      for (uint256 i = 0; i < amount;) {
        _mint(recipient, tokenDetails.currentTokenId);
        unchecked { 
          ++tokenDetails.currentTokenId;
          ++i; 
        }
      }
    }
}

Read Contract

BOX_O_BAD_GUYS_CONTRACT_ADDRESS 0x664dbc6b → address
NERDS_CONTRACT_ADDRESS 0x725bf999 → address
balanceOf 0x70a08231 → uint256
berserkersEligibleForClaim 0x9c33ecb2 → bool
delegateCash 0x94856295 → address
enforcerTokenDetails 0x855d67bc → uint16, uint16
getApproved 0x081812fc → address
guardianOf 0xacd52e8d → address
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
nerdHasClaimed 0x8f37c620 → bool
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
raiderTokenDetails 0x89db52b2 → uint16, uint16, uint16
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalEnforcerSupply 0x8e29adec → uint256
totalRaiderSupply 0xdf88e8f7 → uint256
totalSupply 0x18160ddd → uint256
totalWarlordSupply 0xfa2816ca → uint256
warlordTokenDetails 0x8ddabcf5 → uint16, uint16
warm 0xa840a7e7 → address

Write Contract 15 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address to
uint256 tokenId
burn 0xb80f55c9
uint256[] tokenIds
claimRaiders 0xd1e4c666
uint256[] _tokenIds
mintEnforcer 0x956fd85b
address recipient
uint256 amount
mintFromBox 0x91ff7e01
address recipient
uint256 amount
mintWarlord 0x680b5093
address recipient
uint256 amount
removeGuardianOf 0x34b7d7e4
address tokenOwner
safeTransferFrom 0x42842e0e
address from
address to
uint256 id
safeTransferFrom 0xb88d4fde
address from
address to
uint256 id
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string _uri
setClaimStatus 0x654f97a3
bool status
setGuardian 0x8a0dac4a
address guardian
transferFrom 0x23b872dd
address from
address to
uint256 id
transferOwnership 0xf2fde38b
address newOwner

Top Interactions

AddressTxnsSentReceived
0xAe179481...bB0E 3 3

Recent Transactions

CSV
|
Hash Method Block Age From/To Value Txn Fee Type
0x8853889f...627a19 0xd1e4c666 24,314,928 IN 0xAe179481...bB0E 0 ETH 0.000037623568 ETH EIP-1559
0xa73ebe40...33f362 0xd1e4c666 24,292,566 IN 0xAe179481...bB0E 0 ETH 0.000013998229 ETH EIP-1559
0x2d06bedc...b54c22 0xd1e4c666 24,291,025 IN 0xAe179481...bB0E 0 ETH 0.000025539574 ETH EIP-1559