File size: 1,223 Bytes
f998fcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "./ERC721A.sol";
import "./Ownable.sol";

contract FancyRatsInc is ERC721A, Ownable {
    string public baseURI_;

    constructor() ERC721A("FancyRatsInc", "FANCY") Ownable() {}

    function _baseURI() internal view override returns (string memory) {
        return baseURI_;
    }

    function mint(address _to, uint256 _amount) public onlyOwner {
        _safeMint(_to, _amount);
    }

    function burn(uint256 tokenId) public onlyOwner {
        _burn(tokenId);    
    }

    function setBaseURI(string memory __baseURI) public onlyOwner {
        baseURI_ = __baseURI;
    }

    // Soulbind-ish
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable override {
        require(msg.sender == owner(), "Only transferrable by contract owner");
        super.transferFrom(from, to, tokenId);
    }

    function isApprovedForAll(address, address operator) public view override returns (bool) {
        return operator == this.owner();
    }
}