This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
import {ERC721A} from "erc721a/contracts/ERC721A.sol"; | |
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
error MintLimitExceeded(); | |
contract SampleNFT is ERC721A, Ownable { | |
uint256 public constant MINT_LIMIT = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @version 0.3.7 | |
# @dev Implementation of ERC-721 non-fungible token standard. | |
# Modified from: https://github.com/vyperlang/vyper/blob/master/examples/tokens/ERC721.vy | |
from vyper.interfaces import ERC165 | |
from vyper.interfaces import ERC721 | |
implements: ERC721 | |
implements: ERC165 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: GPL-3.0 | |
pragma solidity 0.8.15; | |
import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; | |
import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; | |
contract Award is ERC721 { | |
constructor() ERC721('Award', 'A') { | |
_mint(msg.sender, 1337); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract OptimizedAttacker { | |
constructor(address victim) payable { | |
NotRareToken nrt = NotRareToken(victim); | |
unchecked { | |
uint256 startingId = nrt.balanceOf(nrt.ownerOf(1)); | |
for (uint i = 1; i <= 150; ++i) { | |
nrt.mint(); | |
} | |
for (uint i = 1; i <= 150; ++i) { | |
nrt.transferFrom(address(this), msg.sender, startingId + i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppellin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
contract ERC721VestedWithdrawals is Ownable, ReentrancyGuard, ERC721 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IERC6000 { | |
/// @notice Emitted when a subscription expiration changes | |
/// The zero address for subscriber indicates that the subscription was canceled. | |
/// @dev When a subscription is canceled, the expiration value should also be 0. | |
event SubscriptionUpdate(address indexed subscriber, uint256 indexed tokenId, uint256 expiration); | |
/// @notice Renews the subscription to an NFT | |
/// Throws if `tokenId` is not a valid NFT | |
/// @param tokenId The NFT to renew the subscription for | |
function renewSubscription(uint256 tokenId) external payable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppellin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract ERC721RestrictedMarkets is Ownable, ERC721 { | |
mapping(address => bool) private _approvedMarketplaces; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error SteveAokiNotAllowed(); | |
address public STEVE_AOKI = 0xe4bbcbff51e61d0d95fcc5016609ac8354b177c4; | |
function transferFrom( | |
address from, | |
address to, | |
uint256 tokenId | |
) public override { | |
if (to == STEVE_AOKI) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.4; | |
import "erc721a/contracts/ERC721A.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/token/common/ERC2981.sol"; | |
contract ERC721AMock is Ownable, ERC2981, ERC721A { | |
mapping(uint256 => uint256) private royaltyOverrides; | |
constructor(string memory name_, string memory symbol_) ERC721A(name_, symbol_) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "../token/ERC1155/ERC1155.sol"; | |
/** | |
* @title ERC1155Mock | |
* This mock just publicizes internal functions for testing purposes | |
*/ |
NewerOlder