ERC-721
Overview
Max Total Supply
995 BOOMER
Holders
284
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 BOOMERLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
Unaboomer
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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); } }
// 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); } }
// 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; } }
// 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; } }
// 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) } } }
// 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); } }
// 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); } }
{ "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
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MAX_MINT_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SURVIVOR_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"die","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"radicalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","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":"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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokensMintedByWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5033604051806040016040528060098152602001682ab730b137b7b6b2b960b91b815250604051806040016040528060068152602001652127a7a6a2a960d11b81525081600090816200006591906200016e565b5060016200007482826200016e565b5050600680546001600160a01b0319166001600160a01b0384169081179091556040519091506000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506200023a565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000f457607f821691505b6020821081036200011557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200016957600081815260208120601f850160051c81016020861015620001445750805b601f850160051c820191505b81811015620001655782815560010162000150565b5050505b505050565b81516001600160401b038111156200018a576200018a620000c9565b620001a2816200019b8454620000df565b846200011b565b602080601f831160018114620001da5760008415620001c15750858301515b600019600386901b1c1916600185901b17855562000165565b600085815260208120601f198616915b828110156200020b57888601518255948401946001909101908401620001ea565b50858210156200022a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b611716806200024a6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80636c0360eb116100f9578063b88d4fde11610097578063dffeadd011610071578063dffeadd0146103c0578063e985e9c5146103d3578063f2fde38b14610401578063fa9b70181461041457600080fd5b8063b88d4fde1461037a578063c4658abe1461038d578063c87b56dd146103ad57600080fd5b80637c652f0c116100d35780637c652f0c146103395780638da5cb5b1461034c57806395d89b411461035f578063a22cb4651461036757600080fd5b80636c0360eb1461031557806370a082311461031d57806373f425611461033057600080fd5b806329aa8e9b1161016657806342842e0e1161014057806342842e0e146102bd5780634f02c420146102d057806355f804b3146102d95780636352211e146102ec57600080fd5b806329aa8e9b1461028e57806332cb6b0c146102a15780633ded33bc146102aa57600080fd5b8063095ea7b3116101a2578063095ea7b31461024757806318160ddd1461025c578063202408231461027257806323b872dd1461027b57600080fd5b806301ffc9a7146101c957806306fdde03146101f1578063081812fc14610206575b600080fd5b6101dc6101d736600461110a565b61041c565b60405190151581526020015b60405180910390f35b6101f961042d565b6040516101e89190611152565b61022f610214366004611185565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61025a6102553660046111b5565b6104bb565b005b6102646105a2565b6040519081526020016101e8565b6102646103e881565b61025a6102893660046111df565b6105b9565b61025a61029c366004611185565b610780565b61026461138881565b61025a6102b836600461121b565b610852565b61025a6102cb3660046111df565b61089e565b61026460095481565b61025a6102e736600461127f565b610973565b61022f6102fa366004611185565b6000908152600260205260409020546001600160a01b031690565b6101f96109aa565b61026461032b36600461121b565b6109b7565b61026460085481565b61025a6103473660046111b5565b610a1a565b60065461022f906001600160a01b031681565b6101f9610b9e565b61025a6103753660046112c1565b610bab565b61025a6103883660046112fd565b610c17565b61026461039b36600461121b565b60076020526000908152604090205481565b6101f96103bb366004611185565b610cdc565b600b5461022f906001600160a01b031681565b6101dc6103e136600461136c565b600560209081526000928352604080842090915290825290205460ff1681565b61025a61040f36600461121b565b610d44565b610264601981565b600061042782610dba565b92915050565b6000805461043a9061139f565b80601f01602080910402602001604051908101604052809291908181526020018280546104669061139f565b80156104b35780601f10610488576101008083540402835291602001916104b3565b820191906000526020600020905b81548152906001019060200180831161049657829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b03163381148061050457506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6105465760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006008546009546105b491906113ef565b905090565b6000818152600260205260409020546001600160a01b0384811691161461060f5760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b604482015260640161053d565b6001600160a01b0382166106595760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015260640161053d565b336001600160a01b038416148061069357506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b806106b457506000818152600460205260409020546001600160a01b031633145b6106f15760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b604482015260640161053d565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b546001600160a01b031633146107cf5760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b604482015260640161053d565b6009548111156108145760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081d1bdad95b881a5960821b604482015260640161053d565b6000818152600260205260409020546001600160a01b03161561084f576008805490600061084183611402565b919050555061084f81610e08565b50565b6006546001600160a01b0316331461087c5760405162461bcd60e51b815260040161053d9061141b565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6108a98383836105b9565b6001600160a01b0382163b15806109525750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109469190611441565b6001600160e01b031916145b61096e5760405162461bcd60e51b815260040161053d9061145e565b505050565b6006546001600160a01b0316331461099d5760405162461bcd60e51b815260040161053d9061141b565b600a61096e8284836114ec565b600a805461043a9061139f565b60006001600160a01b0382166109fe5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015260640161053d565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b03163314610a695760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b604482015260640161053d565b61138881600954610a7a91906115ac565b1115610ab95760405162461bcd60e51b815260206004820152600e60248201526d1cdd5c1c1b1e481c995858da195960921b604482015260640161053d565b6001600160a01b038216600090815260076020526040902054601990610ae09083906115ac565b1115610b2e5760405162461bcd60e51b815260206004820181905260248201527f63616e6e6f7420657863656564206d6178696d756d207065722077616c6c6574604482015260640161053d565b60005b81811015610b6c5760098054906000610b4983611402565b9190505550610b5a83600954610ed5565b80610b6481611402565b915050610b31565b506001600160a01b03821660009081526007602052604081208054839290610b959084906115ac565b90915550505050565b6001805461043a9061139f565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610c228585856105b9565b6001600160a01b0384163b1580610cb95750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610c6a9033908a908990899089906004016115bf565b6020604051808303816000875af1158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad9190611441565b6001600160e01b031916145b610cd55760405162461bcd60e51b815260040161053d9061145e565b5050505050565b6000818152600260205260409020546060906001600160a01b0316610d2357600a604051602001610d0d9190611686565b6040516020818303038152906040529050919050565b600a610d2e83610fa5565b604051602001610d0d9291906116ab565b919050565b6006546001600160a01b03163314610d6e5760405162461bcd60e51b815260040161053d9061141b565b600680546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60006301ffc9a760e01b6001600160e01b031983161480610deb57506380ac58cd60e01b6001600160e01b03198316145b806104275750506001600160e01b031916635b5e139f60e01b1490565b6000818152600260205260409020546001600160a01b031680610e5a5760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b604482015260640161053d565b6001600160a01b038116600081815260036020908152604080832080546000190190558583526002825280832080546001600160a01b031990811690915560049092528083208054909216909155518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610edf8282610fe9565b6001600160a01b0382163b1580610f855750604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f799190611441565b6001600160e01b031916145b610fa15760405162461bcd60e51b815260040161053d9061145e565b5050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480610fbf5750819003601f19909101908152919050565b6001600160a01b0382166110335760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015260640161053d565b6000818152600260205260409020546001600160a01b0316156110895760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b604482015260640161053d565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461084f57600080fd5b60006020828403121561111c57600080fd5b8135611127816110f4565b9392505050565b60005b83811015611149578181015183820152602001611131565b50506000910152565b602081526000825180602084015261117181604085016020870161112e565b601f01601f19169190910160400192915050565b60006020828403121561119757600080fd5b5035919050565b80356001600160a01b0381168114610d3f57600080fd5b600080604083850312156111c857600080fd5b6111d18361119e565b946020939093013593505050565b6000806000606084860312156111f457600080fd5b6111fd8461119e565b925061120b6020850161119e565b9150604084013590509250925092565b60006020828403121561122d57600080fd5b6111278261119e565b60008083601f84011261124857600080fd5b50813567ffffffffffffffff81111561126057600080fd5b60208301915083602082850101111561127857600080fd5b9250929050565b6000806020838503121561129257600080fd5b823567ffffffffffffffff8111156112a957600080fd5b6112b585828601611236565b90969095509350505050565b600080604083850312156112d457600080fd5b6112dd8361119e565b9150602083013580151581146112f257600080fd5b809150509250929050565b60008060008060006080868803121561131557600080fd5b61131e8661119e565b945061132c6020870161119e565b935060408601359250606086013567ffffffffffffffff81111561134f57600080fd5b61135b88828901611236565b969995985093965092949392505050565b6000806040838503121561137f57600080fd5b6113888361119e565b91506113966020840161119e565b90509250929050565b600181811c908216806113b357607f821691505b6020821081036113d357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610427576104276113d9565b600060018201611414576114146113d9565b5060010190565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b60006020828403121561145357600080fd5b8151611127816110f4565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b601f82111561096e57600081815260208120601f850160051c810160208610156114c55750805b601f850160051c820191505b818110156114e4578281556001016114d1565b505050505050565b67ffffffffffffffff83111561150457611504611488565b61151883611512835461139f565b8361149e565b6000601f84116001811461154c57600085156115345750838201355b600019600387901b1c1916600186901b178355610cd5565b600083815260209020601f19861690835b8281101561157d578685013582556020948501946001909201910161155d565b508682101561159a5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b80820180821115610427576104276113d9565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600081546116208161139f565b60018281168015611638576001811461164d5761167c565b60ff198416875282151583028701945061167c565b8560005260208060002060005b858110156116735781548a82015290840190820161165a565b50505082870194505b5050505092915050565b60006116928284611613565b683232b0b2173539b7b760b91b81526009019392505050565b60006116b78285611613565b83516116c781836020880161112e565b64173539b7b760d91b910190815260050194935050505056fea264697066735822122065f94b62bf8e107c34ba0023de1c04a9f6ac1df23e68ae904a7f3e2c1beeb6bf64736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636c0360eb116100f9578063b88d4fde11610097578063dffeadd011610071578063dffeadd0146103c0578063e985e9c5146103d3578063f2fde38b14610401578063fa9b70181461041457600080fd5b8063b88d4fde1461037a578063c4658abe1461038d578063c87b56dd146103ad57600080fd5b80637c652f0c116100d35780637c652f0c146103395780638da5cb5b1461034c57806395d89b411461035f578063a22cb4651461036757600080fd5b80636c0360eb1461031557806370a082311461031d57806373f425611461033057600080fd5b806329aa8e9b1161016657806342842e0e1161014057806342842e0e146102bd5780634f02c420146102d057806355f804b3146102d95780636352211e146102ec57600080fd5b806329aa8e9b1461028e57806332cb6b0c146102a15780633ded33bc146102aa57600080fd5b8063095ea7b3116101a2578063095ea7b31461024757806318160ddd1461025c578063202408231461027257806323b872dd1461027b57600080fd5b806301ffc9a7146101c957806306fdde03146101f1578063081812fc14610206575b600080fd5b6101dc6101d736600461110a565b61041c565b60405190151581526020015b60405180910390f35b6101f961042d565b6040516101e89190611152565b61022f610214366004611185565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016101e8565b61025a6102553660046111b5565b6104bb565b005b6102646105a2565b6040519081526020016101e8565b6102646103e881565b61025a6102893660046111df565b6105b9565b61025a61029c366004611185565b610780565b61026461138881565b61025a6102b836600461121b565b610852565b61025a6102cb3660046111df565b61089e565b61026460095481565b61025a6102e736600461127f565b610973565b61022f6102fa366004611185565b6000908152600260205260409020546001600160a01b031690565b6101f96109aa565b61026461032b36600461121b565b6109b7565b61026460085481565b61025a6103473660046111b5565b610a1a565b60065461022f906001600160a01b031681565b6101f9610b9e565b61025a6103753660046112c1565b610bab565b61025a6103883660046112fd565b610c17565b61026461039b36600461121b565b60076020526000908152604090205481565b6101f96103bb366004611185565b610cdc565b600b5461022f906001600160a01b031681565b6101dc6103e136600461136c565b600560209081526000928352604080842090915290825290205460ff1681565b61025a61040f36600461121b565b610d44565b610264601981565b600061042782610dba565b92915050565b6000805461043a9061139f565b80601f01602080910402602001604051908101604052809291908181526020018280546104669061139f565b80156104b35780601f10610488576101008083540402835291602001916104b3565b820191906000526020600020905b81548152906001019060200180831161049657829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b03163381148061050457506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6105465760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006008546009546105b491906113ef565b905090565b6000818152600260205260409020546001600160a01b0384811691161461060f5760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b604482015260640161053d565b6001600160a01b0382166106595760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015260640161053d565b336001600160a01b038416148061069357506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b806106b457506000818152600460205260409020546001600160a01b031633145b6106f15760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b604482015260640161053d565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b546001600160a01b031633146107cf5760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b604482015260640161053d565b6009548111156108145760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081d1bdad95b881a5960821b604482015260640161053d565b6000818152600260205260409020546001600160a01b03161561084f576008805490600061084183611402565b919050555061084f81610e08565b50565b6006546001600160a01b0316331461087c5760405162461bcd60e51b815260040161053d9061141b565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6108a98383836105b9565b6001600160a01b0382163b15806109525750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610922573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109469190611441565b6001600160e01b031916145b61096e5760405162461bcd60e51b815260040161053d9061145e565b505050565b6006546001600160a01b0316331461099d5760405162461bcd60e51b815260040161053d9061141b565b600a61096e8284836114ec565b600a805461043a9061139f565b60006001600160a01b0382166109fe5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b604482015260640161053d565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b03163314610a695760405162461bcd60e51b815260206004820152601260248201527134b73b30b634b21036b9b39039b2b73232b960711b604482015260640161053d565b61138881600954610a7a91906115ac565b1115610ab95760405162461bcd60e51b815260206004820152600e60248201526d1cdd5c1c1b1e481c995858da195960921b604482015260640161053d565b6001600160a01b038216600090815260076020526040902054601990610ae09083906115ac565b1115610b2e5760405162461bcd60e51b815260206004820181905260248201527f63616e6e6f7420657863656564206d6178696d756d207065722077616c6c6574604482015260640161053d565b60005b81811015610b6c5760098054906000610b4983611402565b9190505550610b5a83600954610ed5565b80610b6481611402565b915050610b31565b506001600160a01b03821660009081526007602052604081208054839290610b959084906115ac565b90915550505050565b6001805461043a9061139f565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610c228585856105b9565b6001600160a01b0384163b1580610cb95750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610c6a9033908a908990899089906004016115bf565b6020604051808303816000875af1158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad9190611441565b6001600160e01b031916145b610cd55760405162461bcd60e51b815260040161053d9061145e565b5050505050565b6000818152600260205260409020546060906001600160a01b0316610d2357600a604051602001610d0d9190611686565b6040516020818303038152906040529050919050565b600a610d2e83610fa5565b604051602001610d0d9291906116ab565b919050565b6006546001600160a01b03163314610d6e5760405162461bcd60e51b815260040161053d9061141b565b600680546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b60006301ffc9a760e01b6001600160e01b031983161480610deb57506380ac58cd60e01b6001600160e01b03198316145b806104275750506001600160e01b031916635b5e139f60e01b1490565b6000818152600260205260409020546001600160a01b031680610e5a5760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b604482015260640161053d565b6001600160a01b038116600081815260036020908152604080832080546000190190558583526002825280832080546001600160a01b031990811690915560049092528083208054909216909155518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b610edf8282610fe9565b6001600160a01b0382163b1580610f855750604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af1158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f799190611441565b6001600160e01b031916145b610fa15760405162461bcd60e51b815260040161053d9061145e565b5050565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480610fbf5750819003601f19909101908152919050565b6001600160a01b0382166110335760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015260640161053d565b6000818152600260205260409020546001600160a01b0316156110895760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b604482015260640161053d565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b03198116811461084f57600080fd5b60006020828403121561111c57600080fd5b8135611127816110f4565b9392505050565b60005b83811015611149578181015183820152602001611131565b50506000910152565b602081526000825180602084015261117181604085016020870161112e565b601f01601f19169190910160400192915050565b60006020828403121561119757600080fd5b5035919050565b80356001600160a01b0381168114610d3f57600080fd5b600080604083850312156111c857600080fd5b6111d18361119e565b946020939093013593505050565b6000806000606084860312156111f457600080fd5b6111fd8461119e565b925061120b6020850161119e565b9150604084013590509250925092565b60006020828403121561122d57600080fd5b6111278261119e565b60008083601f84011261124857600080fd5b50813567ffffffffffffffff81111561126057600080fd5b60208301915083602082850101111561127857600080fd5b9250929050565b6000806020838503121561129257600080fd5b823567ffffffffffffffff8111156112a957600080fd5b6112b585828601611236565b90969095509350505050565b600080604083850312156112d457600080fd5b6112dd8361119e565b9150602083013580151581146112f257600080fd5b809150509250929050565b60008060008060006080868803121561131557600080fd5b61131e8661119e565b945061132c6020870161119e565b935060408601359250606086013567ffffffffffffffff81111561134f57600080fd5b61135b88828901611236565b969995985093965092949392505050565b6000806040838503121561137f57600080fd5b6113888361119e565b91506113966020840161119e565b90509250929050565b600181811c908216806113b357607f821691505b6020821081036113d357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610427576104276113d9565b600060018201611414576114146113d9565b5060010190565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b60006020828403121561145357600080fd5b8151611127816110f4565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b601f82111561096e57600081815260208120601f850160051c810160208610156114c55750805b601f850160051c820191505b818110156114e4578281556001016114d1565b505050505050565b67ffffffffffffffff83111561150457611504611488565b61151883611512835461139f565b8361149e565b6000601f84116001811461154c57600085156115345750838201355b600019600387901b1c1916600186901b178355610cd5565b600083815260209020601f19861690835b8281101561157d578685013582556020948501946001909201910161155d565b508682101561159a5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b80820180821115610427576104276113d9565b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600081546116208161139f565b60018281168015611638576001811461164d5761167c565b60ff198416875282151583028701945061167c565b8560005260208060002060005b858110156116735781548a82015290840190820161165a565b50505082870194505b5050505092915050565b60006116928284611613565b683232b0b2173539b7b760b91b81526009019392505050565b60006116b78285611613565b83516116c781836020880161112e565b64173539b7b760d91b910190815260050194935050505056fea264697066735822122065f94b62bf8e107c34ba0023de1c04a9f6ac1df23e68ae904a7f3e2c1beeb6bf64736f6c63430008110033
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.