ETH Price: $2,447.20 (+0.76%)
 

Overview

Max Total Supply

10,151

Holders

216

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
0xFCAA3E25e539778edbe28c52483b31F4831708c5
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Mailbomb

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 7 : Mailbomb.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {ERC1155} from "solmate/tokens/ERC1155.sol";
import {Owned} from "solmate/auth/Owned.sol";
import {Main} from "./Main.sol";

/** 
@title Mailbomb
@author lzamenace.eth
@notice This contract contains ERC-1155 Mailbomb tokens (BOMB) which are used as
utility tokens for the Unaboomer NFT project and chain based game.
Mailbombs can be delivered to other players to "kill" tokens they hold, which 
toggles the image to a dead / exploded image, and burns the underlying BOMB token. 
@dev All contract functions regarding token burning and minting are limited to 
the Main interface where the logic and validation resides.
*/
contract Mailbomb is ERC1155, Owned {

    /// Track the total number of bombs assembled (tokens minted)
    uint256 public bombsAssembled;
    /// Track the number of bombs that have exploded (been burned)
    uint256 public bombsExploded;
    /// Base URI for the bomb image - all bombs use the same image
    string public baseURI;
    /// Contract address of the deployed Main contract interface to the game
    Main public main;

    constructor() ERC1155() Owned(msg.sender) {}

    // =========================================================================
    //                              Admin
    // =========================================================================

    /// Set metadata URI for all BOMB (token 1)
    /// @param _baseURI IPFS hash or URL to retrieve JSON metadata
    function setBaseURI(string calldata _baseURI) external onlyOwner {
        baseURI = _baseURI;
    }

    /// Set main contract address for executing functions
    /// @param _address Contract address of the deployed Main contract
    function setMainContract(address _address) external onlyOwner {
        main = Main(_address);
    }

    // =========================================================================
    //                              Modifiers
    // =========================================================================

    /// Limit function execution to deployed Main contract
    modifier onlyMain {
        require(msg.sender == address(main), "invalid msg sender");
        _;
    }

    // =========================================================================
    //                              Tokens
    // =========================================================================

    /// Mint tokens from main contract
    /// @param _to Address to mint BOMB tokens to
    /// @param _amount Amount of BOMB tokens to mint
    function create(address _to, uint256 _amount) external onlyMain {
        bombsAssembled += _amount;
        super._mint(_to, 1, _amount, "");
    }

    /// Burn spent tokens from main contract
    /// @param _from Address to burn BOMB tokens from
    /// @param _amount Amount of BOMB tokens to burn
    function explode(address _from, uint256 _amount) external onlyMain {
        bombsExploded += _amount;
        super._burn(_from, 1, _amount);
    }

    /// Get the total amount of bombs that have been assembled (minted)
    /// @return supply Number of bombs assembled in totality (minted)
    function totalSupply() public view returns (uint256 supply) {
        return bombsAssembled;
    }

    /// Return URI to retrieve JSON metadata from - points to images and descriptions
    /// @param _tokenId Unused as all bombs point to same metadata URI
    /// @return string IPFS or HTTP URI to retrieve JSON metadata from
    function uri(uint256 _tokenId) public view override returns (string memory) {
        return baseURI;
    }

    /// Checks if contract supports a given interface
    /// @param interfaceId The interface ID to check if contract supports
    /// @return bool Boolean value if contract supports interface ID or not
    function supportsInterface(bytes4 interfaceId) public view virtual override (ERC1155) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
}

File 2 of 7 : Owned.sol
// 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);
    }
}

File 3 of 7 : ERC1155.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event TransferSingle(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 id,
        uint256 amount
    );

    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] amounts
    );

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

    event URI(string value, uint256 indexed id);

    /*//////////////////////////////////////////////////////////////
                             ERC1155 STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(address => mapping(uint256 => uint256)) public balanceOf;

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

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

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

    /*//////////////////////////////////////////////////////////////
                              ERC1155 LOGIC
    //////////////////////////////////////////////////////////////*/

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

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

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) public virtual {
        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        balanceOf[from][id] -= amount;
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, from, to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) public virtual {
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

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

        // Storing these outside the loop saves ~15 gas per iteration.
        uint256 id;
        uint256 amount;

        for (uint256 i = 0; i < ids.length; ) {
            id = ids[i];
            amount = amounts[i];

            balanceOf[from][id] -= amount;
            balanceOf[to][id] += amount;

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)
        public
        view
        virtual
        returns (uint256[] memory balances)
    {
        require(owners.length == ids.length, "LENGTH_MISMATCH");

        balances = new uint256[](owners.length);

        // Unchecked because the only math done is incrementing
        // the array index counter which cannot possibly overflow.
        unchecked {
            for (uint256 i = 0; i < owners.length; ++i) {
                balances[i] = balanceOf[owners[i]][ids[i]];
            }
        }
    }

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

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

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

    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, address(0), to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchMint(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[to][ids[i]] += amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, address(0), to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchBurn(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[from][ids[i]] -= amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, address(0), ids, amounts);
    }

    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        balanceOf[from][id] -= amount;

        emit TransferSingle(msg.sender, from, address(0), id, amount);
    }
}

/// @notice A generic interface for a contract which properly accepts ERC1155 tokens.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155TokenReceiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC1155TokenReceiver.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] calldata,
        uint256[] calldata,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC1155TokenReceiver.onERC1155BatchReceived.selector;
    }
}

File 4 of 7 : ERC721.sol
// 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;
    }
}

File 5 of 7 : LibString.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

/// @notice Efficient library for creating string representations of integers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
/// @author Modified from Solady (https://github.com/Vectorized/solady/blob/main/src/utils/LibString.sol)
library LibString {
    function toString(uint256 value) internal pure returns (string memory str) {
        /// @solidity memory-safe-assembly
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but we allocate 160 bytes
            // to keep the free memory pointer word aligned. We'll need 1 word for the length, 1 word for the
            // trailing zeros padding, and 3 other words for a max of 78 digits. In total: 5 * 32 = 160 bytes.
            let newFreeMemoryPointer := add(mload(0x40), 160)

            // Update the free memory pointer to avoid overriding our string.
            mstore(0x40, newFreeMemoryPointer)

            // Assign str to the end of the zone of newly allocated memory.
            str := sub(newFreeMemoryPointer, 32)

            // Clean the last word of memory it may not be overwritten.
            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 {} {
                // Move the pointer 1 byte to the left.
                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 }
            }

            // Compute and cache the final total length of the string.
            let length := sub(end, str)

            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 32)

            // Store the string's length at the start of memory allocated for our string.
            mstore(str, length)
        }
    }
}

File 6 of 7 : Main.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

//                                     ___ooo_..._.                                         
//                                 .___.  o_      __.                                       
//                             ._.._   ._o.         ..o_.                                   
//                         _oo_...._._.              .._.                                 
//                     __..      o.   ._               __                                
//                     ._..       .o.....                  .o.                              
//                 .o.     ....___.                        __.                            
//                 __.     .... _o                             __.                          
//             __       ..._.______..                   .__   _x_.                       
//             __      .....   ..._ooxo__..                .__.  oo.                      
//             o. .      .__ooo_.    ..__oxo__.              ..oo_xo                      
//             ._...  ._oxxxxxoxxxx__.       ______._..          .oxx_                     
//             __.  .oxx_ooo__oxo.xooxoo___.         .___          .oo                     
//             __  _o__o_._.____o ____.oo_.oxx___.       .           .oo.                   
//         ._. _oxoo_.o_ .x   o_....____. .xxoxx__.        ._        _o                   
//         ._o._oxx_.o..o_ _xo  oo.._. o.    .x..o_xo__      .x_        __                  
//     __._oxxo__.o..o.  __o_. .o.  o_o   o_o .._o_ox__    .oo.       __                 
//     .o _xxxxo_  _o.oo_..._o___.._x__xoox_.___. ...ooxx_    oo_       _.                
//     o _xxxxxo.......__.........     .._oooooo____.....___   .oo_     ..                
//     _. _xxxxxo.._ooxxxxxxxxxxxxx_..__xxxxxxxxxxxxxxxxxx__.__   .o_                      
//     _..oxxxxo._xooxxxxxxxxxxxxxxx.  _xo   ..oxxxxxxxxxxxxx._x_   .x.                    
//     _..xxxxxxox..  ._.oxxxxxxxxxo...._xo.    ...oxxxxxxxxxx.xxo   .o.                   
//     _..xxxxxxxxxx_.._xxxxxxxxxxo._..___xxo__oxxxxxxxxxxxxxx.xxx    _.                   
//     _..xxoxxxxxxxxxxxxxxxxxxxxx o.   o_.xxxxxxxxxxxxxxxxxx_ xxx    _.                   
//     _o.ox .xxoxxxxxxxxxxxxxxxx.__.   ox_.oxxxxxxxxxxxxxxx_  xxx_  .o.                   
//     .._xo ox_ _xxxxxxxxxxxx_..._.  _ooo_._oxxxxxxxxxxxx_...xoxo  ._   ..               
//     .._o.._o. ._oxxxxxx___...o_   .  ._..._ooxxxxxxo_..o o..ox.  _.  .o               
//         _.xxo.o_ ...._oo_... .o._         __ _..._oo_..__. ._.oxxo  .o  __               
//         xxx._x    .....   _oo.oo_..._o_.__     .....  ._ _xxxxxo     .o.               
//         xxx._x           _..ox_oxxxxxxxxxx_         .ox. _xxxxxo     .x.               
//         o.o_.x_       ...  .. . _oo_ _oxxo_..       oxx. _xxxxo.   oo _.               
//         .o.oooo      ._ .__ ..__o._..___.___.      .xxx. _xxo.    ox_._                
//             .xxxo       .x__._.______...____.__     _xx_ .ox.   .oox_ o.                
//             .xxx_       _..    .......____._ _    .oxo..oo   .oxxxo  o                 
//             _._xx_.            .._o_.            _xo_.oxo   _xxxxx_ _.                 
//             .o_.oxx_.        ._________        .oo_.oxx_   oxxxo__ ._                  
//                 __ _xxx_                       .oo_.oxxx_   _xo_ ._oo_                   
//                 ._ .oxxx_.                  .oo__oxxxo.   ._  _oxxo.                    
//                 __  _xx___              .____.oxxo_. __    .xxxxo                      
//                 __  oxx _o_.  ........__..ooxo_. ___.   ._xxxooxo_..                  
//                 ._xoo_xx_  _ox__________oxxx_. .__.    ..oxxxx_.  ._oo_.               
//             ......_o__o_xox_  .o__...oxxxxxo__._oo______oxxxxxo_.__..  ..___.            
//         ...... .___   .o_.ox_         oxxo. .o oxxxxxxooooooo_.     ___.   ..__.         
// ._....   ._._       o_. .o_  _.  .oxo__oxx_.oo__                    .__.    ._..      
// ...     .._.          o_.   __.xxxoo__xxo__o _.                          ._.    .._.    
//         ..             o_.    .o._ooo__.   o__.                                          
//                     o_.    .._.o.      _.__                                           
//                     o_.    ..x_o.      o o                                            

import {Owned} from "solmate/auth/Owned.sol";
import {Unaboomer} from "./Unaboomer.sol";
import {Mailbomb} from "./Mailbomb.sol";

/** 
@title UnaboomerNFT
@author lzamenace.eth
@notice This is the main contract interface for the Unaboomer NFT project drop and chain based game.
It contains the logic between an ERC-721 contract containing Unaboomer tokens (pixelated Unabomber 
inspired profile pictures) and an ERC-1155 contract containing Mailbomb tokens (utility tokens).
Unaboomer is a chain based game with some mechanics based around "killing" other players by sending 
them mailbombs until a certain amount of players or "survivors" remain. The motif was inspired by 
the real life story of Theodore Kaczynski, known as the Unabomber, who conducted a nationwide 
mail bombing campaign against people he believed to be advancing modern technology and the 
destruction of the environment. Ironic, isn't it? 
*/
contract Main is Owned {

    /// Track the number of kills for each address
    mapping(address => uint256) public killCount;
    /// Index addresses to form a basic leaderboard
    mapping(uint256 => address) public leaderboard;
    /// Point to the latest leaderboard update
    uint256 public leaderboardPointer;
    /// Price of the Unaboomer ERC-721 token
    uint256 public unaboomerPrice = 0.005 ether;
    /// Price of the Mailbomb ERC-1155 token
    uint256 public bombPrice = 0.0025 ether;
    /// If mail bombs can be sent by players
    bool public mayhem;
    /// Unaboomer contract
    Unaboomer public unaboomer;
    /// Mailbomb contract
    Mailbomb public mailbomb;

    /// SentBomb event is for recording the results of sendBombs for real-time feedback to a frontend interface
    /// @param from Sender of the bombs
    /// @param tokenId Unaboomer token which was targeted
    /// @param hit Whether or not the bomb killed the token or not (was a dud / already killed)
    /// @param owned Whether or not the sender was the owner of the BOOMER token
    event SentBomb(address indexed from, uint256 indexed tokenId, bool hit, bool owned);

    constructor() Owned(msg.sender) {}

    // =========================================================================
    //                              Admin
    // =========================================================================

    /// Withdraw funds to contract owner
    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;
        (bool success, ) = payable(msg.sender).call{value: balance}("");
        require(success, "failed to withdraw");
    }

    /// Set price per BOOMER
    /// @param _price Price in wei to mint BOOMER token
    function setBoomerPrice(uint256 _price) external onlyOwner {
        unaboomerPrice = _price;
    }

    /// Set price per BOMB
    /// @param _price Price in wei to mint BOMB token
    function setBombPrice(uint256 _price) external onlyOwner {
        bombPrice = _price;
    }

    /// Set contract address for Unaboomer tokens
    /// @param _address Address of the Unaboomer / BOOMER contract
    function setUnaboomerContract(address _address) external onlyOwner {
        unaboomer = Unaboomer(_address);
    }

    /// Set contract address for Mailbomb tokens
    /// @param _address Address of the Mailbomb / BOMB contract
    function setMailbombContract(address _address) external onlyOwner {
        mailbomb = Mailbomb(_address);
    }

    /// Toggle mayhem switch to enable mail bomb sending
    function toggleMayhem() external onlyOwner {
        mayhem = !mayhem;
    }

    // =========================================================================
    //                              Modifiers
    // =========================================================================

    /// This modifier prevents actions once the Unaboomer survivor count is breached.
    /// The game stops; no more bombing/killing. Survivors make it to the next round.
    modifier missionNotCompleted {
        require(
            unaboomer.burned() < (unaboomer.MAX_SUPPLY() - unaboomer.MAX_SURVIVOR_COUNT()), 
            "mission already completed"
        );
        _;
    }

    // =========================================================================
    //                              Getters
    // =========================================================================

    /// Get BOOMER token balance of wallet 
    /// @param _address Wallet address to query balance of BOOMER token
    /// @return balance Amount of BOOMER tokens owned by _address
    function unaboomerBalance(address _address) public view returns (uint256) {
        return unaboomer.balanceOf(_address);
    }

    /// Get BOOMER amount minted (including ones that have been burned/killed)
    /// @param _address Wallet address to query the amount of BOOMER token minted
    /// @return balance Amount of BOOMER tokens that have been minted by _address
    function unaboomersMinted(address _address) public view returns (uint256) {
        return unaboomer.tokensMintedByWallet(_address);
    }

    /// Get BOOMER token total supply
    /// @return supply Amount of BOOMER tokens minted in total
    function unaboomersRadicalized() public view returns (uint256) {
        return unaboomer.minted();
    }

    /// Get BOOMER kill count (unaboomers killed)
    /// @return killCount Amount of BOOMER tokens "killed" (dead pfp)
    function unaboomersKilled() public view returns (uint256) {
        return unaboomer.burned();
    }

    /// Get BOOMER token max supply
    /// @return maxSupply Maximum amount of BOOMER tokens that can ever exist
    function unaboomerMaxSupply() public view returns (uint256) {
        return unaboomer.MAX_SUPPLY();
    }

    /// Get BOOMER token survivor count
    /// @return survivorCount Maximum amount of BOOMER survivor tokens that can ever exist
    function unaboomerMaxSurvivorCount() public view returns (uint256) {
        return unaboomer.MAX_SURVIVOR_COUNT();
    }

    /// Get BOOMER token max mint amount per wallet
    /// @return mintAmount Maximum amount of BOOMER tokens that can be minted per wallet
    function unaboomerMaxMintPerWallet() public view returns (uint256) {
        return unaboomer.MAX_MINT_AMOUNT();
    }

    /// Get BOMB token balance of wallet
    /// @param _address Wallet address to query balance of BOMB token
    /// @return balance Amount of BOMB tokens owned by _address
    function bombBalance(address _address) public view returns (uint256) {
        return mailbomb.balanceOf(_address, 1);
    }

    /// Get BOMB token supply
    /// @return supply Amount of BOMB tokens ever minted / "assembled"
    function bombsAssembled() public view returns (uint256) {
        return mailbomb.bombsAssembled();
    }

    /// Get BOMB exploded amount
    /// @return exploded Amount of BOMB tokens that have burned / "exploded"
    function bombsExploded() public view returns (uint256) {
        return mailbomb.bombsExploded();
    }

    // =========================================================================
    //                              Tokens
    // =========================================================================

    /// Radicalize a boomer to become a Unaboomer - start with 1 bomb
    /// @param _amount Amount of Unaboomers to mint / "radicalize"
    function radicalizeBoomers(uint256 _amount) external payable missionNotCompleted {
        require(msg.value >= _amount * unaboomerPrice, "not enough ether");
        unaboomer.radicalize(msg.sender, _amount);
        mailbomb.create(msg.sender, _amount);
    }

    /// Assemble additional mailbombs to kill targets
    /// @param _amount Amount of bombs mint / "assemble"
    function assembleBombs(uint256 _amount) external payable missionNotCompleted {
        require(msg.value >= _amount * bombPrice, "not enough ether");
        mailbomb.create(msg.sender, _amount);
    }

    /// Send N bombs to pseudo-random Unaboomer tokenIds to kill them.
    /// If the Unaboomer is already dead, the bomb is considered a dud.
    /// Update a leaderboard with updated kill counts.
    /// @dev Pick a pseudo-random tokenID from Unaboomer contract and toggle a mapping value  
    /// @dev The likelihood of killing a boomer decreases as time goes on - i.e. more duds
    /// @param _amount Amount of bombs to send to kill Unaboomers (dead pfps)
    function sendBombs(uint256 _amount) external missionNotCompleted {
        // Require mayhem is set (allow time to mint and trade)
        require(mayhem, "not ready for mayhem");
        // Ensure _amount will not exceed wallet balance of bombs, Unaboomer supply, and active Unaboomers
        uint256 supply = unaboomersRadicalized();
        uint256 bal = bombBalance(msg.sender);
        require(_amount <= bal, "not enough bombs");
        for (uint256 i; i < _amount; i++) {
            // Pick a pseudo-random Unaboomer token - imperfectly derives token IDs so that repeats are probable
            uint256 randomBoomer = (uint256(keccak256(abi.encodePacked(i, supply, bal, msg.sender))) % supply) + 1;
            // Capture owner
            address _owner = unaboomer.ownerOf(randomBoomer);
            // Check if it was already killed
            bool dud = _owner == address(0);
            // Check if the sender owns it (misfired, killed own pfp)
            bool senderOwned = msg.sender == _owner;
            // Kill it (does nothing if already toggled as dead)
            unaboomer.die(randomBoomer);
            // Emit event for displaying in web app
            emit SentBomb(msg.sender, randomBoomer, !dud, senderOwned);
            // Increment kill count if successfully killed another player's Unaboomer
            if(!dud && !senderOwned) {
                killCount[msg.sender]++;
            }
        }
        // Update the leaderboard and pointer for tracking the highest amount of kills for wallets
        uint256 kills = killCount[msg.sender];
        address leader = leaderboard[leaderboardPointer];
        if (kills > killCount[leader]) {
            if (leader != msg.sender) {
                leaderboardPointer++;
                leaderboard[leaderboardPointer] = msg.sender;
            }
        }
        // Burn ERC-1155 BOMB tokens (bombs go away after sending / exploding)
        mailbomb.explode(msg.sender, _amount);
    }

}

File 7 of 7 : Unaboomer.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {ERC721} from "solmate/tokens/ERC721.sol";
import {Owned} from "solmate/auth/Owned.sol";
import {LibString} from "solmate/utils/LibString.sol";
import {Main} from "./Main.sol";

/** 
@title Unaboomer
@author lzamenace.eth
@notice This contract contains ERC-721 Unaboomer tokens (BOOMER) which are the profile 
picture and membership tokens for the Unaboomer NFT project and chain based game.
Each Unaboomer is a unique, dynamically generated pixel avatar in the likeness
of the real-life Unabomber, Theodore Kaczynski. Unaboomers can be "killed" by
other players by "sending" (burning) mailbombs. When Unaboomers are killed their
corresponding image is replaced with an explosion, rendering it worthless as any
rarity associated with it ceases to exist. The game stops when MAX_SURVIVOR_COUNT
threshold is breached. The surviving players (any address which holds an "alive"
Unaboomer) will advance to the next round of gameplay.
@dev All contract functions regarding token burning and minting are limited to 
the Main interface where the logic and validation resides.
*/
contract Unaboomer is ERC721, Owned {
    using LibString for uint256;

    /// Track mints per wallet to enforce maximum
    mapping(address => uint256) public tokensMintedByWallet;
    /// Maximum supply of BOOMER tokens
    uint256 public constant MAX_SUPPLY = 5000;
    /// Maximum amount of survivors remaining to advance to the next round
    uint256 public constant MAX_SURVIVOR_COUNT = 1000;
    /// Maximum amount of mints per wallet - cut down on botters
    uint256 public constant MAX_MINT_AMOUNT = 25;
    /// Amount of Unaboomers killed (tokens burned)
    uint256 public burned;
    /// Amount of Unaboomers radicalized (tokens minted)
    uint256 public minted;
    /// Base URI for Unaboomers - original pixelated avatars and pixelated explosions
    string public baseURI;
    /// Contract address of the deployed Main contract interface to the game
    Main public main;

    constructor() ERC721("Unaboomer", "BOOMER") Owned(msg.sender) {}

    // =========================================================================
    //                              Admin
    // =========================================================================

    /// Set metadata URI for Unaboomer PFPs and explosions
    /// @param _baseURI IPFS hash or URL to retrieve JSON metadata for living Unaboomer tokens
    function setBaseURI(string calldata _baseURI) external onlyOwner {
        baseURI = _baseURI;
    }

    /// Set main contract address for executing functions
    /// @param _address Contract address of the deployed Main contract
    function setMainContract(address _address) external onlyOwner {
        main = Main(_address);
    }

    // =========================================================================
    //                              Modifiers
    // =========================================================================
    
    /// Limit function execution to deployed Main contract
    modifier onlyMain {
        require(msg.sender == address(main), "invalid msg sender");
        _;
    }

    // =========================================================================
    //                              Tokens
    // =========================================================================

    /// Helper function to get supply minted
    /// @return supply Number of Unaboomers radicalized in totality (minted)
    function totalSupply() public view returns (uint256) {
        return minted - burned;
    }

    /// Mint tokens from main contract
    /// @param _to Address to mint BOOMER tokens to
    /// @param _amount Amount of BOOMER tokens to mint
    function radicalize(address _to, uint256 _amount) external onlyMain {
        require(minted + _amount <= MAX_SUPPLY, "supply reached");
        require(tokensMintedByWallet[_to] + _amount <= MAX_MINT_AMOUNT, "cannot exceed maximum per wallet");
        for (uint256 i; i < _amount; i++) {
            minted++;
            _safeMint(_to, minted);
        }
        tokensMintedByWallet[_to] += _amount;
    }

    /// Toggle token state from living to dead
    /// @param _tokenId Token ID of BOOMER to toggle living -> dead and increment kill count
    function die(uint256 _tokenId) external onlyMain {
        require(_tokenId <= minted, "invalid token id");
        if (ownerOf(_tokenId) != address(0)) {
            burned++;
            _burn(_tokenId);
        }
    }

    /// Retrieve owner of given token ID
    /// @param _tokenId Token ID to check owner of
    /// @return owner Address of owner
    /// @dev Overridden from Solmate contract to allow zero address returns 
    function ownerOf(uint256 _tokenId) public view override returns (address owner) {
        return _ownerOf[_tokenId];
    }

    // Return URI to retrieve JSON metadata from - points to images and descriptions
    /// @param _tokenId Token ID of BOOMER to fetch URI for
    /// @return string IPFS or HTTP URI to retrieve JSON metadata from
    function tokenURI(uint256 _tokenId) public view override returns (string memory) {
        if (ownerOf(_tokenId) == address(0)) {
            return string(abi.encodePacked(baseURI, "dead.json"));
        } else {
            return string(abi.encodePacked(baseURI, _tokenId.toString(), ".json"));
        }
    }

    /// Checks if contract supports a given interface
    /// @param interfaceId The interface ID to check if contract supports
    /// @return bool Boolean value if contract supports interface ID or not
    function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "erc721a/=lib/erc721a/contracts/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bombsAssembled","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bombsExploded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"explode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"main","outputs":[{"internalType":"contract Main","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setMainContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600280546001600160a01b0319163390811790915560405181906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350611664806100636000396000f3fe608060405234801561001057600080fd5b50600436106101205760003560e01c80635cc128b0116100ad578063a22cb46511610071578063a22cb46514610271578063dffeadd014610284578063e985e9c514610297578063f242432a146102c5578063f2fde38b146102d857600080fd5b80635cc128b0146102195780636c0360eb14610222578063880d6cdc1461022a5780638da5cb5b1461023d578063a049c9421461026857600080fd5b806318160ddd116100f457806318160ddd146101b85780632eb2c2d6146101c05780633ded33bc146101d35780634e1273f4146101e657806355f804b31461020657600080fd5b8062fdd58e1461012557806301ffc9a7146101605780630e89341c146101835780630ecaea73146101a3575b600080fd5b61014d610133366004610e90565b600060208181529281526040808220909352908152205481565b6040519081526020015b60405180910390f35b61017361016e366004610ed3565b6102eb565b6040519015158152602001610157565b610196610191366004610ef7565b6102fc565b6040516101579190610f56565b6101b66101b1366004610e90565b610390565b005b60035461014d565b6101b66101ce366004610ff7565b61041d565b6101b66101e13660046110b2565b6106c0565b6101f96101f43660046110cd565b61070c565b6040516101579190611139565b6101b661021436600461117d565b610841565b61014d60035481565b61019661087d565b6101b6610238366004610e90565b61090b565b600254610250906001600160a01b031681565b6040516001600160a01b039091168152602001610157565b61014d60045481565b6101b661027f3660046111bf565b61097e565b600654610250906001600160a01b031681565b6101736102a53660046111fb565b600160209081526000928352604080842090915290825290205460ff1681565b6101b66102d336600461122e565b6109ea565b6101b66102e63660046110b2565b610be4565b60006102f682610c5a565b92915050565b60606005805461030b906112a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610337906112a6565b80156103845780601f1061035957610100808354040283529160200191610384565b820191906000526020600020905b81548152906001019060200180831161036757829003601f168201915b50505050509050919050565b6006546001600160a01b031633146103e45760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b60448201526064015b60405180910390fd5b80600360008282546103f691906112f6565b925050819055506104198260018360405180602001604052806000815250610ca8565b5050565b84831461045e5760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b60448201526064016103db565b336001600160a01b038916148061049857506001600160a01b038816600090815260016020908152604080832033845290915290205460ff165b6104d55760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016103db565b60008060005b87811015610590578888828181106104f5576104f5611309565b90506020020135925086868281811061051057610510611309565b6001600160a01b038e166000908152602081815260408083208984528252822080549390910294909401359550859392509061054d90849061131f565b90915550506001600160a01b038a16600090815260208181526040808320868452909152812080548492906105839084906112f6565b90915550506001016104db565b50886001600160a01b03168a6001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8b8b8b8b6040516105e49493929190611364565b60405180910390a46001600160a01b0389163b1561068b5760405163bc197c8160e01b808252906001600160a01b038b169063bc197c81906106389033908f908e908e908e908e908e908e906004016113bf565b6020604051808303816000875af1158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b9190611423565b6001600160e01b03191614610698565b6001600160a01b03891615155b6106b45760405162461bcd60e51b81526004016103db90611440565b50505050505050505050565b6002546001600160a01b031633146106ea5760405162461bcd60e51b81526004016103db9061146a565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b606083821461074f5760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b60448201526064016103db565b8367ffffffffffffffff81111561076857610768611490565b604051908082528060200260200182016040528015610791578160200160208202803683370190505b50905060005b84811015610838576000808787848181106107b4576107b4611309565b90506020020160208101906107c991906110b2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008585848181106107fd576107fd611309565b9050602002013581526020019081526020016000205482828151811061082557610825611309565b6020908102919091010152600101610797565b50949350505050565b6002546001600160a01b0316331461086b5760405162461bcd60e51b81526004016103db9061146a565b60056108788284836114ec565b505050565b6005805461088a906112a6565b80601f01602080910402602001604051908101604052809291908181526020018280546108b6906112a6565b80156109035780601f106108d857610100808354040283529160200191610903565b820191906000526020600020905b8154815290600101906020018083116108e657829003601f168201915b505050505081565b6006546001600160a01b0316331461095a5760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b60448201526064016103db565b806004600082825461096c91906112f6565b90915550610419905082600183610df0565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b336001600160a01b0387161480610a2457506001600160a01b038616600090815260016020908152604080832033845290915290205460ff165b610a615760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016103db565b6001600160a01b03861660009081526020818152604080832087845290915281208054859290610a9290849061131f565b90915550506001600160a01b03851660009081526020818152604080832087845290915281208054859290610ac89084906112f6565b909155505060408051858152602081018590526001600160a01b03808816929089169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0385163b15610bb35760405163f23a6e6160e01b808252906001600160a01b0387169063f23a6e6190610b609033908b908a908a908a908a906004016115ad565b6020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611423565b6001600160e01b03191614610bc0565b6001600160a01b03851615155b610bdc5760405162461bcd60e51b81526004016103db90611440565b505050505050565b6002546001600160a01b03163314610c0e5760405162461bcd60e51b81526004016103db9061146a565b600280546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60006301ffc9a760e01b6001600160e01b031983161480610c8b5750636cdb3d1360e11b6001600160e01b03198316145b806102f65750506001600160e01b0319166303a24d0760e21b1490565b6001600160a01b03841660009081526020818152604080832086845290915281208054849290610cd99084906112f6565b909155505060408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0384163b15610dc15760405163f23a6e6160e01b808252906001600160a01b0386169063f23a6e6190610d6e9033906000908990899089906004016115f4565b6020604051808303816000875af1158015610d8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db19190611423565b6001600160e01b03191614610dce565b6001600160a01b03841615155b610dea5760405162461bcd60e51b81526004016103db90611440565b50505050565b6001600160a01b03831660009081526020818152604080832085845290915281208054839290610e2190849061131f565b909155505060408051838152602081018390526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b80356001600160a01b0381168114610e8b57600080fd5b919050565b60008060408385031215610ea357600080fd5b610eac83610e74565b946020939093013593505050565b6001600160e01b031981168114610ed057600080fd5b50565b600060208284031215610ee557600080fd5b8135610ef081610eba565b9392505050565b600060208284031215610f0957600080fd5b5035919050565b6000815180845260005b81811015610f3657602081850181015186830182015201610f1a565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610ef06020830184610f10565b60008083601f840112610f7b57600080fd5b50813567ffffffffffffffff811115610f9357600080fd5b6020830191508360208260051b8501011115610fae57600080fd5b9250929050565b60008083601f840112610fc757600080fd5b50813567ffffffffffffffff811115610fdf57600080fd5b602083019150836020828501011115610fae57600080fd5b60008060008060008060008060a0898b03121561101357600080fd5b61101c89610e74565b975061102a60208a01610e74565b9650604089013567ffffffffffffffff8082111561104757600080fd5b6110538c838d01610f69565b909850965060608b013591508082111561106c57600080fd5b6110788c838d01610f69565b909650945060808b013591508082111561109157600080fd5b5061109e8b828c01610fb5565b999c989b5096995094979396929594505050565b6000602082840312156110c457600080fd5b610ef082610e74565b600080600080604085870312156110e357600080fd5b843567ffffffffffffffff808211156110fb57600080fd5b61110788838901610f69565b9096509450602087013591508082111561112057600080fd5b5061112d87828801610f69565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561117157835183529284019291840191600101611155565b50909695505050505050565b6000806020838503121561119057600080fd5b823567ffffffffffffffff8111156111a757600080fd5b6111b385828601610fb5565b90969095509350505050565b600080604083850312156111d257600080fd5b6111db83610e74565b9150602083013580151581146111f057600080fd5b809150509250929050565b6000806040838503121561120e57600080fd5b61121783610e74565b915061122560208401610e74565b90509250929050565b60008060008060008060a0878903121561124757600080fd5b61125087610e74565b955061125e60208801610e74565b94506040870135935060608701359250608087013567ffffffffffffffff81111561128857600080fd5b61129489828a01610fb5565b979a9699509497509295939492505050565b600181811c908216806112ba57607f821691505b6020821081036112da57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102f6576102f66112e0565b634e487b7160e01b600052603260045260246000fd5b818103818111156102f6576102f66112e0565b81835260006001600160fb1b0383111561134b57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000611378604083018688611332565b828103602084015261138b818587611332565b979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682528816602082015260a0604082018190526000906113ec908301888a611332565b82810360608401526113ff818789611332565b90508281036080840152611414818587611396565b9b9a5050505050505050505050565b60006020828403121561143557600080fd5b8151610ef081610eba565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b601f82111561087857600081815260208120601f850160051c810160208610156114cd5750805b601f850160051c820191505b81811015610bdc578281556001016114d9565b67ffffffffffffffff83111561150457611504611490565b6115188361151283546112a6565b836114a6565b6000601f84116001811461154c57600085156115345750838201355b600019600387901b1c1916600186901b1783556115a6565b600083815260209020601f19861690835b8281101561157d578685013582556020948501946001909201910161155d565b508682101561159a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190526000906115e89083018486611396565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061138b90830184610f1056fea26469706673582212208389a3e7b782add0ff98eff529b958f0203824c759cf23a8fa76957024ee551264736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101205760003560e01c80635cc128b0116100ad578063a22cb46511610071578063a22cb46514610271578063dffeadd014610284578063e985e9c514610297578063f242432a146102c5578063f2fde38b146102d857600080fd5b80635cc128b0146102195780636c0360eb14610222578063880d6cdc1461022a5780638da5cb5b1461023d578063a049c9421461026857600080fd5b806318160ddd116100f457806318160ddd146101b85780632eb2c2d6146101c05780633ded33bc146101d35780634e1273f4146101e657806355f804b31461020657600080fd5b8062fdd58e1461012557806301ffc9a7146101605780630e89341c146101835780630ecaea73146101a3575b600080fd5b61014d610133366004610e90565b600060208181529281526040808220909352908152205481565b6040519081526020015b60405180910390f35b61017361016e366004610ed3565b6102eb565b6040519015158152602001610157565b610196610191366004610ef7565b6102fc565b6040516101579190610f56565b6101b66101b1366004610e90565b610390565b005b60035461014d565b6101b66101ce366004610ff7565b61041d565b6101b66101e13660046110b2565b6106c0565b6101f96101f43660046110cd565b61070c565b6040516101579190611139565b6101b661021436600461117d565b610841565b61014d60035481565b61019661087d565b6101b6610238366004610e90565b61090b565b600254610250906001600160a01b031681565b6040516001600160a01b039091168152602001610157565b61014d60045481565b6101b661027f3660046111bf565b61097e565b600654610250906001600160a01b031681565b6101736102a53660046111fb565b600160209081526000928352604080842090915290825290205460ff1681565b6101b66102d336600461122e565b6109ea565b6101b66102e63660046110b2565b610be4565b60006102f682610c5a565b92915050565b60606005805461030b906112a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610337906112a6565b80156103845780601f1061035957610100808354040283529160200191610384565b820191906000526020600020905b81548152906001019060200180831161036757829003601f168201915b50505050509050919050565b6006546001600160a01b031633146103e45760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b60448201526064015b60405180910390fd5b80600360008282546103f691906112f6565b925050819055506104198260018360405180602001604052806000815250610ca8565b5050565b84831461045e5760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b60448201526064016103db565b336001600160a01b038916148061049857506001600160a01b038816600090815260016020908152604080832033845290915290205460ff165b6104d55760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016103db565b60008060005b87811015610590578888828181106104f5576104f5611309565b90506020020135925086868281811061051057610510611309565b6001600160a01b038e166000908152602081815260408083208984528252822080549390910294909401359550859392509061054d90849061131f565b90915550506001600160a01b038a16600090815260208181526040808320868452909152812080548492906105839084906112f6565b90915550506001016104db565b50886001600160a01b03168a6001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8b8b8b8b6040516105e49493929190611364565b60405180910390a46001600160a01b0389163b1561068b5760405163bc197c8160e01b808252906001600160a01b038b169063bc197c81906106389033908f908e908e908e908e908e908e906004016113bf565b6020604051808303816000875af1158015610657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067b9190611423565b6001600160e01b03191614610698565b6001600160a01b03891615155b6106b45760405162461bcd60e51b81526004016103db90611440565b50505050505050505050565b6002546001600160a01b031633146106ea5760405162461bcd60e51b81526004016103db9061146a565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b606083821461074f5760405162461bcd60e51b815260206004820152600f60248201526e0988a9c8ea890be9a92a69a82a8869608b1b60448201526064016103db565b8367ffffffffffffffff81111561076857610768611490565b604051908082528060200260200182016040528015610791578160200160208202803683370190505b50905060005b84811015610838576000808787848181106107b4576107b4611309565b90506020020160208101906107c991906110b2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008585848181106107fd576107fd611309565b9050602002013581526020019081526020016000205482828151811061082557610825611309565b6020908102919091010152600101610797565b50949350505050565b6002546001600160a01b0316331461086b5760405162461bcd60e51b81526004016103db9061146a565b60056108788284836114ec565b505050565b6005805461088a906112a6565b80601f01602080910402602001604051908101604052809291908181526020018280546108b6906112a6565b80156109035780601f106108d857610100808354040283529160200191610903565b820191906000526020600020905b8154815290600101906020018083116108e657829003601f168201915b505050505081565b6006546001600160a01b0316331461095a5760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b60448201526064016103db565b806004600082825461096c91906112f6565b90915550610419905082600183610df0565b3360008181526001602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b336001600160a01b0387161480610a2457506001600160a01b038616600090815260016020908152604080832033845290915290205460ff165b610a615760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016103db565b6001600160a01b03861660009081526020818152604080832087845290915281208054859290610a9290849061131f565b90915550506001600160a01b03851660009081526020818152604080832087845290915281208054859290610ac89084906112f6565b909155505060408051858152602081018590526001600160a01b03808816929089169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0385163b15610bb35760405163f23a6e6160e01b808252906001600160a01b0387169063f23a6e6190610b609033908b908a908a908a908a906004016115ad565b6020604051808303816000875af1158015610b7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba39190611423565b6001600160e01b03191614610bc0565b6001600160a01b03851615155b610bdc5760405162461bcd60e51b81526004016103db90611440565b505050505050565b6002546001600160a01b03163314610c0e5760405162461bcd60e51b81526004016103db9061146a565b600280546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60006301ffc9a760e01b6001600160e01b031983161480610c8b5750636cdb3d1360e11b6001600160e01b03198316145b806102f65750506001600160e01b0319166303a24d0760e21b1490565b6001600160a01b03841660009081526020818152604080832086845290915281208054849290610cd99084906112f6565b909155505060408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46001600160a01b0384163b15610dc15760405163f23a6e6160e01b808252906001600160a01b0386169063f23a6e6190610d6e9033906000908990899089906004016115f4565b6020604051808303816000875af1158015610d8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db19190611423565b6001600160e01b03191614610dce565b6001600160a01b03841615155b610dea5760405162461bcd60e51b81526004016103db90611440565b50505050565b6001600160a01b03831660009081526020818152604080832085845290915281208054839290610e2190849061131f565b909155505060408051838152602081018390526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4505050565b80356001600160a01b0381168114610e8b57600080fd5b919050565b60008060408385031215610ea357600080fd5b610eac83610e74565b946020939093013593505050565b6001600160e01b031981168114610ed057600080fd5b50565b600060208284031215610ee557600080fd5b8135610ef081610eba565b9392505050565b600060208284031215610f0957600080fd5b5035919050565b6000815180845260005b81811015610f3657602081850181015186830182015201610f1a565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610ef06020830184610f10565b60008083601f840112610f7b57600080fd5b50813567ffffffffffffffff811115610f9357600080fd5b6020830191508360208260051b8501011115610fae57600080fd5b9250929050565b60008083601f840112610fc757600080fd5b50813567ffffffffffffffff811115610fdf57600080fd5b602083019150836020828501011115610fae57600080fd5b60008060008060008060008060a0898b03121561101357600080fd5b61101c89610e74565b975061102a60208a01610e74565b9650604089013567ffffffffffffffff8082111561104757600080fd5b6110538c838d01610f69565b909850965060608b013591508082111561106c57600080fd5b6110788c838d01610f69565b909650945060808b013591508082111561109157600080fd5b5061109e8b828c01610fb5565b999c989b5096995094979396929594505050565b6000602082840312156110c457600080fd5b610ef082610e74565b600080600080604085870312156110e357600080fd5b843567ffffffffffffffff808211156110fb57600080fd5b61110788838901610f69565b9096509450602087013591508082111561112057600080fd5b5061112d87828801610f69565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b8181101561117157835183529284019291840191600101611155565b50909695505050505050565b6000806020838503121561119057600080fd5b823567ffffffffffffffff8111156111a757600080fd5b6111b385828601610fb5565b90969095509350505050565b600080604083850312156111d257600080fd5b6111db83610e74565b9150602083013580151581146111f057600080fd5b809150509250929050565b6000806040838503121561120e57600080fd5b61121783610e74565b915061122560208401610e74565b90509250929050565b60008060008060008060a0878903121561124757600080fd5b61125087610e74565b955061125e60208801610e74565b94506040870135935060608701359250608087013567ffffffffffffffff81111561128857600080fd5b61129489828a01610fb5565b979a9699509497509295939492505050565b600181811c908216806112ba57607f821691505b6020821081036112da57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156102f6576102f66112e0565b634e487b7160e01b600052603260045260246000fd5b818103818111156102f6576102f66112e0565b81835260006001600160fb1b0383111561134b57600080fd5b8260051b80836020870137939093016020019392505050565b604081526000611378604083018688611332565b828103602084015261138b818587611332565b979650505050505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0389811682528816602082015260a0604082018190526000906113ec908301888a611332565b82810360608401526113ff818789611332565b90508281036080840152611414818587611396565b9b9a5050505050505050505050565b60006020828403121561143557600080fd5b8151610ef081610eba565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b601f82111561087857600081815260208120601f850160051c810160208610156114cd5750805b601f850160051c820191505b81811015610bdc578281556001016114d9565b67ffffffffffffffff83111561150457611504611490565b6115188361151283546112a6565b836114a6565b6000601f84116001811461154c57600085156115345750838201355b600019600387901b1c1916600186901b1783556115a6565b600083815260209020601f19861690835b8281101561157d578685013582556020948501946001909201910161155d565b508682101561159a5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a0608082018190526000906115e89083018486611396565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061138b90830184610f1056fea26469706673582212208389a3e7b782add0ff98eff529b958f0203824c759cf23a8fa76957024ee551264736f6c63430008110033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.