ETH Price: $2,292.43 (-5.40%)

Contract

0x8a2a8a2CA5A5BC5E4BE6d5264144427C20b234Ad
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Swap169717222023-04-03 23:24:47531 days ago1680564287IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0021771723.92499946
Swap169717202023-04-03 23:24:23531 days ago1680564263IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0022799325.05428548
Swap168550162023-03-18 13:44:11547 days ago1679147051IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0016839918.80107323
Swap168549852023-03-18 13:37:47547 days ago1679146667IN
0x8a2a8a2C...C20b234Ad
0 ETH0.001744818.48919693
Swap166016492023-02-10 23:29:59583 days ago1676071799IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0022228523.55493796
Swap164829022023-01-25 9:20:47599 days ago1674638447IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0013776315.38281041
Swap164828912023-01-25 9:18:35599 days ago1674638315IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0014359415.21826413
Swap164828912023-01-25 9:18:35599 days ago1674638315IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0014359415.21826413
Swap164054302023-01-14 13:45:59610 days ago1673703959IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0014765516.48510508
Swap162864132022-12-28 23:03:23627 days ago1672268603IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0016009316.96464945
Swap162425402022-12-22 20:09:35633 days ago1671739775IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0020824523.24974046
Swap162400742022-12-22 11:53:59633 days ago1671710039IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0011405412.73370414
Swap160111962022-11-20 12:22:11665 days ago1668946931IN
0x8a2a8a2C...C20b234Ad
0 ETH0.001230713.74034758
Swap159794712022-11-16 2:00:59670 days ago1668564059IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0018818619.94157919
Swap158860452022-11-03 0:54:47683 days ago1667436887IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0015033916.78472933
Swap157312202022-10-12 9:45:11704 days ago1665567911IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0013648514.4629867
Swap157087112022-10-09 6:20:35708 days ago1665296435IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0023855426.63722533
Swap157042082022-10-08 15:15:59708 days ago1665242159IN
0x8a2a8a2C...C20b234Ad
0 ETH0.000843788.94134408
Swap156739682022-10-04 9:45:59712 days ago1664876759IN
0x8a2a8a2C...C20b234Ad
0 ETH0.000763218.08755874
Swap156528602022-10-01 10:57:35715 days ago1664621855IN
0x8a2a8a2C...C20b234Ad
0 ETH0.00061686.53611413
Swap156384562022-09-29 10:38:11717 days ago1664447891IN
0x8a2a8a2C...C20b234Ad
0 ETH0.000780218.26765584
Swap156384522022-09-29 10:37:23717 days ago1664447843IN
0x8a2a8a2C...C20b234Ad
0 ETH0.000800238.47983065
Swap156384392022-09-29 10:34:47717 days ago1664447687IN
0x8a2a8a2C...C20b234Ad
0 ETH0.000845788.96253313
Swap156311262022-09-28 10:05:23718 days ago1664359523IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0010275710.88889313
Swap156311232022-09-28 10:04:47718 days ago1664359487IN
0x8a2a8a2C...C20b234Ad
0 ETH0.0010035410.63421609
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DragonSwapper

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : DragonSwapper.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "../access/BaseAccessControl.sol";
import "../structs/DragonInfo.sol";
import "../DragonToken.sol";

contract DragonSwapper is BaseAccessControl, IERC721Receiver {
    
    using Address for address payable;

    string public constant OWNER_ERROR = "DragonSwapper: caller is not owner";
    string public constant BAD_AMOUNT_ERROR = "DragonSwapper: bad amount";
    string public constant BAD_ADDRESS_ERROR = "DragonSwapper: bad address";
    string public constant NOT_VALID_OPERATOR_ERROR = "DragonSwapper: the caller is not a valid operator";

    address private _tokenContractAddress;
    address private _burnAddress;
    uint private _swapPrice;
    mapping(uint => address) private _lockedTokens;

    event TokenLocked(address indexed owner, uint tokenId, uint dragonValue, address polygonTo);
    event TokenUnlocked(address indexed owner, uint tokenId);
    event TokenBurned(uint tokenId);
    event EthersWithdrawn(address indexed operator, address indexed to, uint amount);

    constructor(uint price, address accessControl, address tokenContractAddress, address burnAddr) 
    BaseAccessControl(accessControl) {
        _swapPrice = price;
        _tokenContractAddress = tokenContractAddress;
        _burnAddress = burnAddr;
    }

    function burnAddress() public view returns (address) {
        return _burnAddress;
    }

    function tokenContract() public view returns (address) {
        return _tokenContractAddress;
    }

    function setTokenContract(address newAddress) external onlyRole(COO_ROLE) {
        address previousAddress = _tokenContractAddress;
        _tokenContractAddress = newAddress;
        emit AddressChanged("tokenContract", previousAddress, newAddress);
    }

    function swapPrice() public view returns (uint) {
        return _swapPrice;
    }

    function setSwapPrice(uint newPrice) external onlyRole(CFO_ROLE) {
        uint previousValue = _swapPrice;
        _swapPrice = newPrice;
        emit ValueChanged("swapPrice", previousValue, newPrice);
    }

    function onERC721Received(address operator, address /*from*/, uint /*tokenId*/, bytes calldata /*data*/) 
        external virtual override returns (bytes4) {
        require(operator == address(this), NOT_VALID_OPERATOR_ERROR);
        return this.onERC721Received.selector;
    }

    function swap(uint tokenId, address polygonTo) payable external {
        DragonToken dt = DragonToken(tokenContract());
        
        require(msg.value >= swapPrice(), BAD_AMOUNT_ERROR);
        require(dt.ownerOf(tokenId) == _msgSender(), OWNER_ERROR);
        require(!Address.isContract(polygonTo), BAD_ADDRESS_ERROR);

        dt.safeTransferFrom(_msgSender(), address(this), tokenId);
        
        DragonInfo.Details memory details = dt.dragonInfo(tokenId);
        _lockedTokens[tokenId] = _msgSender();
        
        emit TokenLocked(_msgSender(), tokenId, DragonInfo.getValue(details), polygonTo);
    }

    function unlock(uint tokenId) external onlyRole(COO_ROLE) {
        address owner = _lockedTokens[tokenId];
        
        if (owner != address(0)) {
            DragonToken dt = DragonToken(tokenContract());
            dt.safeTransferFrom(address(this), owner, tokenId);
            delete _lockedTokens[tokenId];

            emit TokenUnlocked(owner, tokenId);
        }
    }

    function burn(uint tokenId) external onlyRole(COO_ROLE) {
        address owner = _lockedTokens[tokenId];
        
        if (owner != address(0)) {
            DragonToken dt = DragonToken(tokenContract());
            dt.safeTransferFrom(address(this), burnAddress(), tokenId);
            delete _lockedTokens[tokenId];

            emit TokenBurned(tokenId);
        }
    }

    function withdrawEthers(uint amount, address payable to) external onlyRole(CFO_ROLE) {
        to.sendValue(amount);
        emit EthersWithdrawn(_msgSender(), to, amount);
    }
}

File 2 of 16 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 3 of 16 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 4 of 16 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 5 of 16 : BaseAccessControl.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/IAccessControl.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../interfaces/IChangeableVariables.sol";

abstract contract BaseAccessControl is Context, IChangeableVariables {

    bytes32 public constant CEO_ROLE = keccak256("CEO");
    bytes32 public constant CFO_ROLE = keccak256("CFO");
    bytes32 public constant COO_ROLE = keccak256("COO");

    address private _accessControl;

    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    constructor (address accessControl) Context() {
        _accessControl = accessControl;
    }

    function accessControlAddress() public view returns (address) {
        return _accessControl;
    }

    function setAccessControlAddress(address newAddress) external onlyRole(COO_ROLE) {
        address previousAddress = _accessControl;
        _accessControl = newAddress;
        emit AddressChanged("accessControl", previousAddress, newAddress);
    }

    function hasRole(bytes32 role, address account) public view returns (bool) {
        IAccessControl accessControl = IAccessControl(accessControlAddress());
        return accessControl.hasRole(role, account) || accessControl.hasRole(CEO_ROLE, account);
    }

    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }
}

File 6 of 16 : DragonInfo.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

library DragonInfo {
    
    uint constant MASK = 0xF000000000000000000000000;

    enum Types { 
        Unknown,
        Common, 
        Rare16, 
        Rare17, 
        Rare18, 
        Rare19,
        Epic20, 
        Epic21,
        Epic22,
        Epic23,
        Epic24, 
        Legendary
    }

    struct Details { 
        uint genes;
        uint eggId;
        uint parent1Id;
        uint parent2Id;
        uint generation;
        uint strength;
        Types dragonType;
    }

    function getDetails(uint value) internal pure returns (Details memory) {
        return Details (
            {
                genes: uint256(uint104(value)),
                parent1Id: uint256(uint32(value >> 104)),
                parent2Id: uint256(uint32(value >> 136)),
                generation: uint256(uint16(value >> 168)),
                strength: uint256(uint16(value >> 184)),
                dragonType: Types(uint16(value >> 200)),
                eggId: uint256(uint32(value >> 216))
            }
        );
    }

    function getValue(Details memory details) internal pure returns (uint) {
        uint result = uint(details.genes);
        result |= details.parent1Id << 104;
        result |= details.parent2Id << 136;
        result |= details.generation << 168;
        result |= details.strength << 184;
        result |= uint(details.dragonType) << 200;
        result |= details.eggId << 216;
        return result;
    }

    function calcType(uint genes) internal pure returns (Types) {
        uint mask = MASK;
        uint numRare = 0;
        uint numEpic = 0;
        for (uint i = 0; i < 10; i++) { //just Rare and Epic genes are important to check
            if (genes & mask > 0) {
                if (i < 5) { //Epic-range
                    numEpic++;
                }
                else { //Rare-range
                    numRare++;
                }
            }
            mask = mask >> 4;
        }
        Types result = Types.Unknown;
        if (numEpic == 5 && numRare == 5) {
            result = Types.Legendary;
        }
        else if (numEpic < 5 && numRare == 5) {
            result = Types(6 + numEpic);
        }
        else if (numEpic == 0 && numRare < 5) {
            result = Types(1 + numRare);
        }
        else if (numEpic == 0 && numRare == 0) {
            result = Types.Common;
        }

        return result;
    }

    function calcStrength(uint genes) internal pure returns (uint) {
        uint mask = MASK;
        uint strength = 0;
        for (uint i = 0; i < 25; i++) { 
            uint gLevel = (genes & mask) >> ((24 - i) * 4);
            if (i < 6) { //Epic
                strength += 3 * (25 - i) * gLevel;
            } 
            else if (i < 10) { //Rare 
                strength += 2 * (25 - i) * gLevel;
            }
            else { //Common-range
                if (gLevel > 0) {
                    strength += (25 - i) * gLevel;
                }
                else {
                    strength += (25 - i);
                }
            }
            mask = mask >> 4;
        }
        return strength;
    }

    function calcGeneration(uint g1, uint g2) internal pure returns (uint) {
        return (g1 >= g2 ? g1 : g2) + 1;
    }
}

File 7 of 16 : DragonToken.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./access/BaseAccessControl.sol";
import "./structs/DragonInfo.sol";

contract DragonToken is ERC721, BaseAccessControl {

    using Address for address;
    using Counters for Counters.Counter;

    string public constant NONEXISTENT_TOKEN_ERROR = "DragonToken: nonexistent token";
    string public constant NOT_ENOUGH_PRIVILEGES_ERROR = "DragonToken: not enough privileges to call the method";
    string public constant DRAGON_EXISTS_ERROR = "DragonToken: a dragon with such ID already exists";
    string public constant BAD_CID_ERROR = "DragonToken: bad CID";
    string public constant CID_SET_ERROR = "DragonToken: CID is already set";
    
    Counters.Counter private _dragonIds;

    // Mapping token id to dragon details
    mapping(uint => uint) private _info;
    // Mapping token id to cid
    mapping(uint => string) private _cids;

    string private _defaultMetadataCid;
    address private _dragonCreator;
    address private _dragonReplicator;

    constructor(uint dragonSeed, string memory defaultCid, address accessControl) 
    ERC721("CryptoDragons", "CD")
    BaseAccessControl(accessControl) {  
        _dragonIds = Counters.Counter({ _value: dragonSeed });
        _defaultMetadataCid = defaultCid;
    }

    function approveAndCall(address spender, uint256 tokenId, bytes calldata extraData) external returns (bool success) {
        require(_exists(tokenId), NONEXISTENT_TOKEN_ERROR);
        _approve(spender, tokenId);
        (bool _success, ) = 
            spender.call(
                abi.encodeWithSignature("receiveApproval(address,uint256,address,bytes)", 
                _msgSender(), 
                tokenId, 
                address(this), 
                extraData) 
            );
        if(!_success) { 
            revert("DragonToken: spender internal error"); 
        }
        return true;
    }

    function tokenURI(uint tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), NONEXISTENT_TOKEN_ERROR);
        string memory cid = _cids[tokenId];
        return string(abi.encodePacked("ipfs://", (bytes(cid).length > 0) ? cid : defaultMetadataCid()));
    }

    function dragonCreatorAddress() public view returns(address) {
        return _dragonCreator;
    }

    function setDragonCreatorAddress(address newAddress) external onlyRole(COO_ROLE) {
        address previousAddress = _dragonCreator;
        _dragonCreator = newAddress;
        emit AddressChanged("dragonCreator", previousAddress, newAddress);
    }

    function dragonReplicatorAddress() public view returns(address) {
        return _dragonReplicator;
    }

    function setDragonReplicatorAddress(address newAddress) external onlyRole(COO_ROLE) {
        address previousAddress = _dragonReplicator;
        _dragonReplicator = newAddress;
        emit AddressChanged("dragonReplicator", previousAddress, newAddress);
    }

    function hasMetadataCid(uint tokenId) public view returns(bool) {
        require(_exists(tokenId), NONEXISTENT_TOKEN_ERROR);
        return bytes(_cids[tokenId]).length > 0;
    }

    function setMetadataCid(uint tokenId, string calldata cid) external onlyRole(COO_ROLE) {
        require(_exists(tokenId), NONEXISTENT_TOKEN_ERROR);
        require(bytes(cid).length >= 46, BAD_CID_ERROR);
        require(!hasMetadataCid(tokenId), CID_SET_ERROR);
        _cids[tokenId] = cid;
    }

    function defaultMetadataCid() public view returns (string memory){
        return _defaultMetadataCid;
    }

    function setDefaultMetadataCid(string calldata newDefaultCid) external onlyRole(COO_ROLE) {
        _defaultMetadataCid = newDefaultCid;
    }

    function dragonInfo(uint dragonId) public view returns (DragonInfo.Details memory) {
        require(_exists(dragonId), NONEXISTENT_TOKEN_ERROR);
        return DragonInfo.getDetails(_info[dragonId]);
    }

    function strengthOf(uint dragonId) external view returns (uint) {
        DragonInfo.Details memory details = dragonInfo(dragonId);
        return details.strength > 0 ? details.strength : DragonInfo.calcStrength(details.genes);
    }

    function isSiblings(uint dragon1Id, uint dragon2Id) external view returns (bool) {
        DragonInfo.Details memory info1 = dragonInfo(dragon1Id);
        DragonInfo.Details memory info2 = dragonInfo(dragon2Id);
        return 
            (info1.generation > 1 && info2.generation > 1) && //the 1st generation of dragons doesn't have siblings
            (info1.parent1Id == info2.parent1Id || info1.parent1Id == info2.parent2Id || 
            info1.parent2Id == info2.parent1Id || info1.parent2Id == info2.parent2Id);
    }

    function isParent(uint dragon1Id, uint dragon2Id) external view returns (bool) {
        DragonInfo.Details memory info = dragonInfo(dragon1Id);
        return info.parent1Id == dragon2Id || info.parent2Id == dragon2Id;
    }

    function mint(address to, DragonInfo.Details calldata info) external returns (uint) {
        require(_msgSender() == dragonCreatorAddress(), NOT_ENOUGH_PRIVILEGES_ERROR);
        
        _dragonIds.increment();
        uint newDragonId = uint(_dragonIds.current());
        
        _info[newDragonId] = DragonInfo.getValue(info);
        _mint(to, newDragonId);

        return newDragonId;
    }

    function mintReplica(address to, uint dragonId, uint value, string memory cid) external returns (uint) {
        require(_msgSender() == dragonReplicatorAddress(), NOT_ENOUGH_PRIVILEGES_ERROR);
        require(_info[dragonId] == 0, DRAGON_EXISTS_ERROR);
        
        _info[dragonId] = value;
        _cids[dragonId] = cid;
        
        _mint(to, dragonId);

        return dragonId;
    }

    function setStrength(uint dragonId) external returns (uint) {
        DragonInfo.Details memory details = dragonInfo(dragonId);
        if (details.strength == 0) {
            details.strength = DragonInfo.calcStrength(details.genes);
            _info[dragonId] = DragonInfo.getValue(details);
        }
        return details.strength;
    }
}

File 8 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

File 9 of 16 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 10 of 16 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 11 of 16 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 12 of 16 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 13 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 14 of 16 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 15 of 16 : IChangeableVariables.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.0;

interface IChangeableVariables {
    event AddressChanged(string fieldName, address previousAddress, address newAddress);
    event ValueChanged(string fieldName, uint previousValue, uint newValue);
    event BoolValueChanged(string fieldName, bool previousValue, bool newValue);
}

File 16 of 16 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"accessControl","type":"address"},{"internalType":"address","name":"tokenContractAddress","type":"address"},{"internalType":"address","name":"burnAddr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"fieldName","type":"string"},{"indexed":false,"internalType":"address","name":"previousAddress","type":"address"},{"indexed":false,"internalType":"address","name":"newAddress","type":"address"}],"name":"AddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"fieldName","type":"string"},{"indexed":false,"internalType":"bool","name":"previousValue","type":"bool"},{"indexed":false,"internalType":"bool","name":"newValue","type":"bool"}],"name":"BoolValueChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EthersWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dragonValue","type":"uint256"},{"indexed":false,"internalType":"address","name":"polygonTo","type":"address"}],"name":"TokenLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"fieldName","type":"string"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ValueChanged","type":"event"},{"inputs":[],"name":"BAD_ADDRESS_ERROR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BAD_AMOUNT_ERROR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CEO_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CFO_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COO_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NOT_VALID_OPERATOR_ERROR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OWNER_ERROR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessControlAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setAccessControlAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"setSwapPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"polygonTo","type":"address"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"swapPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"}],"name":"withdrawEthers","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50604051620026523803806200265283398181016040528101906200003791906200013a565b82806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508360038190555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505062000218565b6000815190506200011d81620001e4565b92915050565b6000815190506200013481620001fe565b92915050565b600080600080608085870312156200015157600080fd5b6000620001618782880162000123565b945050602062000174878288016200010c565b935050604062000187878288016200010c565b92505060606200019a878288016200010c565b91505092959194509250565b6000620001b382620001ba565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620001ef81620001a6565b8114620001fb57600080fd5b50565b6200020981620001da565b81146200021557600080fd5b50565b61242a80620002286000396000f3fe60806040526004361061011f5760003560e01c806370d5ae05116100a0578063b514be6311610064578063b514be63146103c5578063bbcd5bbe146103f0578063d3986f0814610419578063de2f588f14610435578063e8d56b8b146104605761011f565b806370d5ae05146102dc57806391d148541461030757806398fefe60146103445780639f6f50ed1461036f578063a195777c1461039a5761011f565b8063601b1353116100e7578063601b1353146102095780636198e33914610234578063667413771461025d5780636831e0d8146102885780636b3b4810146102b35761011f565b8063150b7a02146101245780632a6e5e11146101615780633acfd44f1461018a57806342966c68146101b557806355a373d6146101de575b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190611968565b610489565b6040516101589190611f0c565b60405180910390f35b34801561016d57600080fd5b5061018860048036038101906101839190611adb565b610528565b005b34801561019657600080fd5b5061019f6105f4565b6040516101ac9190611ec8565b60405180910390f35b3480156101c157600080fd5b506101dc60048036038101906101d79190611a76565b610618565b005b3480156101ea57600080fd5b506101f36107ac565b6040516102009190611e5b565b60405180910390f35b34801561021557600080fd5b5061021e6107d6565b60405161022b9190611f27565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190611a76565b61080f565b005b34801561026957600080fd5b506102726109b3565b60405161027f9190611e5b565b60405180910390f35b34801561029457600080fd5b5061029d6109dc565b6040516102aa919061205d565b60405180910390f35b3480156102bf57600080fd5b506102da60048036038101906102d59190611a76565b6109e6565b005b3480156102e857600080fd5b506102f1610a64565b6040516102fe9190611e5b565b60405180910390f35b34801561031357600080fd5b5061032e60048036038101906103299190611a11565b610a8e565b60405161033b9190611ead565b60405180910390f35b34801561035057600080fd5b50610359610be1565b6040516103669190611f27565b60405180910390f35b34801561037b57600080fd5b50610384610bfd565b6040516103919190611ec8565b60405180910390f35b3480156103a657600080fd5b506103af610c21565b6040516103bc9190611f27565b60405180910390f35b3480156103d157600080fd5b506103da610c3d565b6040516103e79190611ec8565b60405180910390f35b3480156103fc57600080fd5b5061041760048036038101906104129190611916565b610c61565b005b610433600480360381019061042e9190611a9f565b610d39565b005b34801561044157600080fd5b5061044a611126565b6040516104579190611f27565b60405180910390f35b34801561046c57600080fd5b5061048760048036038101906104829190611916565b61115f565b005b60003073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146040518060600160405280603181526020016123c46031913990610514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050b9190611f27565b60405180910390fd5b5063150b7a0260e01b905095945050505050565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc61055a81610555611235565b61123d565b610583838373ffffffffffffffffffffffffffffffffffffffff166112da90919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff166105a2611235565b73ffffffffffffffffffffffffffffffffffffffff167f372bb9ce23c45af0229f3ad425305ebadfb790c0b0453fa3077a02d7d8c987bb856040516105e7919061205d565b60405180910390a3505050565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b1396981565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b1396961064a81610645611235565b61123d565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107a75760006106c06107ac565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e306106e7610a64565b876040518463ffffffff1660e01b815260040161070693929190611e76565b600060405180830381600087803b15801561072057600080fd5b505af1158015610734573d6000803e3d6000fd5b505050506004600085815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f0c526103b8f47af5516191d0c89a598755bd00faa211a3cb52e4c2cc782f7fe28460405161079d919061205d565b60405180910390a1505b505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6040518060400160405280601981526020017f447261676f6e537761707065723a2062616420616d6f756e740000000000000081525081565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b139696108418161083c611235565b61123d565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109ae5760006108b76107ac565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e3084876040518463ffffffff1660e01b81526004016108f693929190611e76565b600060405180830381600087803b15801561091057600080fd5b505af1158015610924573d6000803e3d6000fd5b505050506004600085815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690558173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3856040516109a4919061205d565b60405180910390a2505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600354905090565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc610a1881610a13611235565b61123d565b60006003549050826003819055507fe98e5fcd3d43c7e5dd114bafcc428bc7ff8525b014fe3b51fc721ba5671f98fb8184604051610a57929190611fe5565b60405180910390a1505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080610a996109b3565b90508073ffffffffffffffffffffffffffffffffffffffff166391d1485485856040518363ffffffff1660e01b8152600401610ad6929190611ee3565b60206040518083038186803b158015610aee57600080fd5b505afa158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2691906119e8565b80610bd857508073ffffffffffffffffffffffffffffffffffffffff166391d148547fdc0d7a095c4e917ecbeb7deda7c942ff9744013d419e37549215a413915e421d856040518363ffffffff1660e01b8152600401610b87929190611ee3565b60206040518083038186803b158015610b9f57600080fd5b505afa158015610bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd791906119e8565b5b91505092915050565b6040518060600160405280603181526020016123c46031913981565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc81565b6040518060600160405280602281526020016123a26022913981565b7fdc0d7a095c4e917ecbeb7deda7c942ff9744013d419e37549215a413915e421d81565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b13969610c9381610c8e611235565b61123d565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ca142703425bec1d507d5581fac3a3e61eadcbeafbd7c0a03e2897d96de1cc58184604051610d2c929190612021565b60405180910390a1505050565b6000610d436107ac565b9050610d4d6109dc565b3410156040518060400160405280601981526020017f447261676f6e537761707065723a2062616420616d6f756e740000000000000081525090610dc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbe9190611f27565b60405180910390fd5b50610dd0611235565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b8152600401610e1f919061205d565b60206040518083038186803b158015610e3757600080fd5b505afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f919061193f565b73ffffffffffffffffffffffffffffffffffffffff16146040518060600160405280602281526020016123a26022913990610ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed79190611f27565b60405180910390fd5b50610eea826113ce565b156040518060400160405280601a81526020017f447261676f6e537761707065723a20626164206164647265737300000000000081525090610f62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f599190611f27565b60405180910390fd5b508073ffffffffffffffffffffffffffffffffffffffff166342842e0e610f87611235565b30866040518463ffffffff1660e01b8152600401610fa793929190611e76565b600060405180830381600087803b158015610fc157600080fd5b505af1158015610fd5573d6000803e3d6000fd5b5050505060008173ffffffffffffffffffffffffffffffffffffffff1663225b38fd856040518263ffffffff1660e01b8152600401611014919061205d565b60e06040518083038186803b15801561102c57600080fd5b505afa158015611040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110649190611a4d565b905061106e611235565b6004600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110c7611235565b73ffffffffffffffffffffffffffffffffffffffff167fc1a98bf6d6b667b6a07112e0efab1563e9d4681ece7d6cb0f1d1e841456eb56085611108846113e1565b8660405161111893929190612078565b60405180910390a250505050565b6040518060400160405280601a81526020017f447261676f6e537761707065723a20626164206164647265737300000000000081525081565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b139696111918161118c611235565b61123d565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ca142703425bec1d507d5581fac3a3e61eadcbeafbd7c0a03e2897d96de1cc58184604051611228929190611f69565b60405180910390a1505050565b600033905090565b6112478282610a8e565b6112d65761126c8173ffffffffffffffffffffffffffffffffffffffff16601461147a565b61127a8360001c602061147a565b60405160200161128b929190611e21565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd9190611f27565b60405180910390fd5b5050565b8047101561131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131490611fc5565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161134390611e0c565b60006040518083038185875af1925050503d8060008114611380576040519150601f19603f3d011682016040523d82523d6000602084013e611385565b606091505b50509050806113c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c090611fa5565b60405180910390fd5b505050565b600080823b905060008111915050919050565b6000808260000151905060688360400151901b8117905060888360600151901b8117905060a88360800151901b8117905060b88360a00151901b8117905060c88360c00151600b81111561145e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b901b8117905060d88360200151901b8117905080915050919050565b60606000600283600261148d9190612168565b6114979190612112565b67ffffffffffffffff8111156114d6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156115085781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611566577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026116309190612168565b61163a9190612112565b90505b6001811115611726577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106116a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b8282815181106116df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061171f90612285565b905061163d565b506000841461176a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176190611f49565b60405180910390fd5b8091505092915050565b6000813590506117838161231e565b92915050565b6000815190506117988161231e565b92915050565b6000813590506117ad81612335565b92915050565b6000815190506117c28161234c565b92915050565b6000813590506117d781612363565b92915050565b60008083601f8401126117ef57600080fd5b8235905067ffffffffffffffff81111561180857600080fd5b60208301915083600182028301111561182057600080fd5b9250929050565b6000815190506118368161237a565b92915050565b600060e0828403121561184e57600080fd5b61185860e06120af565b9050600061186884828501611901565b600083015250602061187c84828501611901565b602083015250604061189084828501611901565b60408301525060606118a484828501611901565b60608301525060806118b884828501611901565b60808301525060a06118cc84828501611901565b60a08301525060c06118e084828501611827565b60c08301525092915050565b6000813590506118fb8161238a565b92915050565b6000815190506119108161238a565b92915050565b60006020828403121561192857600080fd5b600061193684828501611774565b91505092915050565b60006020828403121561195157600080fd5b600061195f84828501611789565b91505092915050565b60008060008060006080868803121561198057600080fd5b600061198e88828901611774565b955050602061199f88828901611774565b94505060406119b0888289016118ec565b935050606086013567ffffffffffffffff8111156119cd57600080fd5b6119d9888289016117dd565b92509250509295509295909350565b6000602082840312156119fa57600080fd5b6000611a08848285016117b3565b91505092915050565b60008060408385031215611a2457600080fd5b6000611a32858286016117c8565b9250506020611a4385828601611774565b9150509250929050565b600060e08284031215611a5f57600080fd5b6000611a6d8482850161183c565b91505092915050565b600060208284031215611a8857600080fd5b6000611a96848285016118ec565b91505092915050565b60008060408385031215611ab257600080fd5b6000611ac0858286016118ec565b9250506020611ad185828601611774565b9150509250929050565b60008060408385031215611aee57600080fd5b6000611afc858286016118ec565b9250506020611b0d8582860161179e565b9150509250929050565b611b20816121c2565b82525050565b611b2f816121e6565b82525050565b611b3e816121f2565b82525050565b611b4d816121fc565b82525050565b6000611b5e826120e0565b611b6881856120f6565b9350611b78818560208601612252565b611b818161230d565b840191505092915050565b6000611b97826120e0565b611ba18185612107565b9350611bb1818560208601612252565b80840191505092915050565b6000611bca6020836120f6565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611c0a600d836120f6565b91507f616363657373436f6e74726f6c000000000000000000000000000000000000006000830152602082019050919050565b6000611c4a603a836120f6565b91507f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008301527f6563697069656e74206d617920686176652072657665727465640000000000006020830152604082019050919050565b6000611cb0601d836120f6565b91507f416464726573733a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000611cf06009836120f6565b91507f73776170507269636500000000000000000000000000000000000000000000006000830152602082019050919050565b6000611d30600d836120f6565b91507f746f6b656e436f6e7472616374000000000000000000000000000000000000006000830152602082019050919050565b6000611d706000836120eb565b9150600082019050919050565b6000611d8a601783612107565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b6000611dca601183612107565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b611e0681612248565b82525050565b6000611e1782611d63565b9150819050919050565b6000611e2c82611d7d565b9150611e388285611b8c565b9150611e4382611dbd565b9150611e4f8284611b8c565b91508190509392505050565b6000602082019050611e706000830184611b17565b92915050565b6000606082019050611e8b6000830186611b17565b611e986020830185611b17565b611ea56040830184611dfd565b949350505050565b6000602082019050611ec26000830184611b26565b92915050565b6000602082019050611edd6000830184611b35565b92915050565b6000604082019050611ef86000830185611b35565b611f056020830184611b17565b9392505050565b6000602082019050611f216000830184611b44565b92915050565b60006020820190508181036000830152611f418184611b53565b905092915050565b60006020820190508181036000830152611f6281611bbd565b9050919050565b60006060820190508181036000830152611f8281611bfd565b9050611f916020830185611b17565b611f9e6040830184611b17565b9392505050565b60006020820190508181036000830152611fbe81611c3d565b9050919050565b60006020820190508181036000830152611fde81611ca3565b9050919050565b60006060820190508181036000830152611ffe81611ce3565b905061200d6020830185611dfd565b61201a6040830184611dfd565b9392505050565b6000606082019050818103600083015261203a81611d23565b90506120496020830185611b17565b6120566040830184611b17565b9392505050565b60006020820190506120726000830184611dfd565b92915050565b600060608201905061208d6000830186611dfd565b61209a6020830185611dfd565b6120a76040830184611b17565b949350505050565b6000604051905081810181811067ffffffffffffffff821117156120d6576120d56122de565b5b8060405250919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061211d82612248565b915061212883612248565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561215d5761215c6122af565b5b828201905092915050565b600061217382612248565b915061217e83612248565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156121b7576121b66122af565b5b828202905092915050565b60006121cd82612228565b9050919050565b60006121df82612228565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015612270578082015181840152602081019050612255565b8381111561227f576000848401525b50505050565b600061229082612248565b915060008214156122a4576122a36122af565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b612327816121c2565b811461233257600080fd5b50565b61233e816121d4565b811461234957600080fd5b50565b612355816121e6565b811461236057600080fd5b50565b61236c816121f2565b811461237757600080fd5b50565b600c811061238757600080fd5b50565b61239381612248565b811461239e57600080fd5b5056fe447261676f6e537761707065723a2063616c6c6572206973206e6f74206f776e6572447261676f6e537761707065723a207468652063616c6c6572206973206e6f7420612076616c6964206f70657261746f72a264697066735822122022b5a69ec4e7f80e080d8d5287a41abb73a64901d05e9a7f03ec4e366561540f64736f6c634300080000330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c713a40aa9bff56aee0e8ff9542b758d83af9fea0000000000000000000000003943cf9bd3aca41a66ec911a6395727db274856e000000000000000000000000068376f1a6ecb4c398fafc300712b212d11fa531

Deployed Bytecode

0x60806040526004361061011f5760003560e01c806370d5ae05116100a0578063b514be6311610064578063b514be63146103c5578063bbcd5bbe146103f0578063d3986f0814610419578063de2f588f14610435578063e8d56b8b146104605761011f565b806370d5ae05146102dc57806391d148541461030757806398fefe60146103445780639f6f50ed1461036f578063a195777c1461039a5761011f565b8063601b1353116100e7578063601b1353146102095780636198e33914610234578063667413771461025d5780636831e0d8146102885780636b3b4810146102b35761011f565b8063150b7a02146101245780632a6e5e11146101615780633acfd44f1461018a57806342966c68146101b557806355a373d6146101de575b600080fd5b34801561013057600080fd5b5061014b60048036038101906101469190611968565b610489565b6040516101589190611f0c565b60405180910390f35b34801561016d57600080fd5b5061018860048036038101906101839190611adb565b610528565b005b34801561019657600080fd5b5061019f6105f4565b6040516101ac9190611ec8565b60405180910390f35b3480156101c157600080fd5b506101dc60048036038101906101d79190611a76565b610618565b005b3480156101ea57600080fd5b506101f36107ac565b6040516102009190611e5b565b60405180910390f35b34801561021557600080fd5b5061021e6107d6565b60405161022b9190611f27565b60405180910390f35b34801561024057600080fd5b5061025b60048036038101906102569190611a76565b61080f565b005b34801561026957600080fd5b506102726109b3565b60405161027f9190611e5b565b60405180910390f35b34801561029457600080fd5b5061029d6109dc565b6040516102aa919061205d565b60405180910390f35b3480156102bf57600080fd5b506102da60048036038101906102d59190611a76565b6109e6565b005b3480156102e857600080fd5b506102f1610a64565b6040516102fe9190611e5b565b60405180910390f35b34801561031357600080fd5b5061032e60048036038101906103299190611a11565b610a8e565b60405161033b9190611ead565b60405180910390f35b34801561035057600080fd5b50610359610be1565b6040516103669190611f27565b60405180910390f35b34801561037b57600080fd5b50610384610bfd565b6040516103919190611ec8565b60405180910390f35b3480156103a657600080fd5b506103af610c21565b6040516103bc9190611f27565b60405180910390f35b3480156103d157600080fd5b506103da610c3d565b6040516103e79190611ec8565b60405180910390f35b3480156103fc57600080fd5b5061041760048036038101906104129190611916565b610c61565b005b610433600480360381019061042e9190611a9f565b610d39565b005b34801561044157600080fd5b5061044a611126565b6040516104579190611f27565b60405180910390f35b34801561046c57600080fd5b5061048760048036038101906104829190611916565b61115f565b005b60003073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16146040518060600160405280603181526020016123c46031913990610514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050b9190611f27565b60405180910390fd5b5063150b7a0260e01b905095945050505050565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc61055a81610555611235565b61123d565b610583838373ffffffffffffffffffffffffffffffffffffffff166112da90919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff166105a2611235565b73ffffffffffffffffffffffffffffffffffffffff167f372bb9ce23c45af0229f3ad425305ebadfb790c0b0453fa3077a02d7d8c987bb856040516105e7919061205d565b60405180910390a3505050565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b1396981565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b1396961064a81610645611235565b61123d565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146107a75760006106c06107ac565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e306106e7610a64565b876040518463ffffffff1660e01b815260040161070693929190611e76565b600060405180830381600087803b15801561072057600080fd5b505af1158015610734573d6000803e3d6000fd5b505050506004600085815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f0c526103b8f47af5516191d0c89a598755bd00faa211a3cb52e4c2cc782f7fe28460405161079d919061205d565b60405180910390a1505b505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6040518060400160405280601981526020017f447261676f6e537761707065723a2062616420616d6f756e740000000000000081525081565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b139696108418161083c611235565b61123d565b60006004600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146109ae5760006108b76107ac565b90508073ffffffffffffffffffffffffffffffffffffffff166342842e0e3084876040518463ffffffff1660e01b81526004016108f693929190611e76565b600060405180830381600087803b15801561091057600080fd5b505af1158015610924573d6000803e3d6000fd5b505050506004600085815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690558173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3856040516109a4919061205d565b60405180910390a2505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600354905090565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc610a1881610a13611235565b61123d565b60006003549050826003819055507fe98e5fcd3d43c7e5dd114bafcc428bc7ff8525b014fe3b51fc721ba5671f98fb8184604051610a57929190611fe5565b60405180910390a1505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600080610a996109b3565b90508073ffffffffffffffffffffffffffffffffffffffff166391d1485485856040518363ffffffff1660e01b8152600401610ad6929190611ee3565b60206040518083038186803b158015610aee57600080fd5b505afa158015610b02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2691906119e8565b80610bd857508073ffffffffffffffffffffffffffffffffffffffff166391d148547fdc0d7a095c4e917ecbeb7deda7c942ff9744013d419e37549215a413915e421d856040518363ffffffff1660e01b8152600401610b87929190611ee3565b60206040518083038186803b158015610b9f57600080fd5b505afa158015610bb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd791906119e8565b5b91505092915050565b6040518060600160405280603181526020016123c46031913981565b7f33fa24d9aab6b79237248a16094d5f78ea83bb51e42c123ce925a264e7d816cc81565b6040518060600160405280602281526020016123a26022913981565b7fdc0d7a095c4e917ecbeb7deda7c942ff9744013d419e37549215a413915e421d81565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b13969610c9381610c8e611235565b61123d565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ca142703425bec1d507d5581fac3a3e61eadcbeafbd7c0a03e2897d96de1cc58184604051610d2c929190612021565b60405180910390a1505050565b6000610d436107ac565b9050610d4d6109dc565b3410156040518060400160405280601981526020017f447261676f6e537761707065723a2062616420616d6f756e740000000000000081525090610dc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbe9190611f27565b60405180910390fd5b50610dd0611235565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b8152600401610e1f919061205d565b60206040518083038186803b158015610e3757600080fd5b505afa158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f919061193f565b73ffffffffffffffffffffffffffffffffffffffff16146040518060600160405280602281526020016123a26022913990610ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed79190611f27565b60405180910390fd5b50610eea826113ce565b156040518060400160405280601a81526020017f447261676f6e537761707065723a20626164206164647265737300000000000081525090610f62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f599190611f27565b60405180910390fd5b508073ffffffffffffffffffffffffffffffffffffffff166342842e0e610f87611235565b30866040518463ffffffff1660e01b8152600401610fa793929190611e76565b600060405180830381600087803b158015610fc157600080fd5b505af1158015610fd5573d6000803e3d6000fd5b5050505060008173ffffffffffffffffffffffffffffffffffffffff1663225b38fd856040518263ffffffff1660e01b8152600401611014919061205d565b60e06040518083038186803b15801561102c57600080fd5b505afa158015611040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110649190611a4d565b905061106e611235565b6004600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506110c7611235565b73ffffffffffffffffffffffffffffffffffffffff167fc1a98bf6d6b667b6a07112e0efab1563e9d4681ece7d6cb0f1d1e841456eb56085611108846113e1565b8660405161111893929190612078565b60405180910390a250505050565b6040518060400160405280601a81526020017f447261676f6e537761707065723a20626164206164647265737300000000000081525081565b7fefa080c67ecf4a6bf40c9dc64173420c08f359250ca6562d7c80f7c7b9b139696111918161118c611235565b61123d565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ca142703425bec1d507d5581fac3a3e61eadcbeafbd7c0a03e2897d96de1cc58184604051611228929190611f69565b60405180910390a1505050565b600033905090565b6112478282610a8e565b6112d65761126c8173ffffffffffffffffffffffffffffffffffffffff16601461147a565b61127a8360001c602061147a565b60405160200161128b929190611e21565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd9190611f27565b60405180910390fd5b5050565b8047101561131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131490611fc5565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161134390611e0c565b60006040518083038185875af1925050503d8060008114611380576040519150601f19603f3d011682016040523d82523d6000602084013e611385565b606091505b50509050806113c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c090611fa5565b60405180910390fd5b505050565b600080823b905060008111915050919050565b6000808260000151905060688360400151901b8117905060888360600151901b8117905060a88360800151901b8117905060b88360a00151901b8117905060c88360c00151600b81111561145e577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b901b8117905060d88360200151901b8117905080915050919050565b60606000600283600261148d9190612168565b6114979190612112565b67ffffffffffffffff8111156114d6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156115085781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611566577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106115f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026116309190612168565b61163a9190612112565b90505b6001811115611726577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106116a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b8282815181106116df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061171f90612285565b905061163d565b506000841461176a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176190611f49565b60405180910390fd5b8091505092915050565b6000813590506117838161231e565b92915050565b6000815190506117988161231e565b92915050565b6000813590506117ad81612335565b92915050565b6000815190506117c28161234c565b92915050565b6000813590506117d781612363565b92915050565b60008083601f8401126117ef57600080fd5b8235905067ffffffffffffffff81111561180857600080fd5b60208301915083600182028301111561182057600080fd5b9250929050565b6000815190506118368161237a565b92915050565b600060e0828403121561184e57600080fd5b61185860e06120af565b9050600061186884828501611901565b600083015250602061187c84828501611901565b602083015250604061189084828501611901565b60408301525060606118a484828501611901565b60608301525060806118b884828501611901565b60808301525060a06118cc84828501611901565b60a08301525060c06118e084828501611827565b60c08301525092915050565b6000813590506118fb8161238a565b92915050565b6000815190506119108161238a565b92915050565b60006020828403121561192857600080fd5b600061193684828501611774565b91505092915050565b60006020828403121561195157600080fd5b600061195f84828501611789565b91505092915050565b60008060008060006080868803121561198057600080fd5b600061198e88828901611774565b955050602061199f88828901611774565b94505060406119b0888289016118ec565b935050606086013567ffffffffffffffff8111156119cd57600080fd5b6119d9888289016117dd565b92509250509295509295909350565b6000602082840312156119fa57600080fd5b6000611a08848285016117b3565b91505092915050565b60008060408385031215611a2457600080fd5b6000611a32858286016117c8565b9250506020611a4385828601611774565b9150509250929050565b600060e08284031215611a5f57600080fd5b6000611a6d8482850161183c565b91505092915050565b600060208284031215611a8857600080fd5b6000611a96848285016118ec565b91505092915050565b60008060408385031215611ab257600080fd5b6000611ac0858286016118ec565b9250506020611ad185828601611774565b9150509250929050565b60008060408385031215611aee57600080fd5b6000611afc858286016118ec565b9250506020611b0d8582860161179e565b9150509250929050565b611b20816121c2565b82525050565b611b2f816121e6565b82525050565b611b3e816121f2565b82525050565b611b4d816121fc565b82525050565b6000611b5e826120e0565b611b6881856120f6565b9350611b78818560208601612252565b611b818161230d565b840191505092915050565b6000611b97826120e0565b611ba18185612107565b9350611bb1818560208601612252565b80840191505092915050565b6000611bca6020836120f6565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611c0a600d836120f6565b91507f616363657373436f6e74726f6c000000000000000000000000000000000000006000830152602082019050919050565b6000611c4a603a836120f6565b91507f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008301527f6563697069656e74206d617920686176652072657665727465640000000000006020830152604082019050919050565b6000611cb0601d836120f6565b91507f416464726573733a20696e73756666696369656e742062616c616e63650000006000830152602082019050919050565b6000611cf06009836120f6565b91507f73776170507269636500000000000000000000000000000000000000000000006000830152602082019050919050565b6000611d30600d836120f6565b91507f746f6b656e436f6e7472616374000000000000000000000000000000000000006000830152602082019050919050565b6000611d706000836120eb565b9150600082019050919050565b6000611d8a601783612107565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b6000611dca601183612107565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b611e0681612248565b82525050565b6000611e1782611d63565b9150819050919050565b6000611e2c82611d7d565b9150611e388285611b8c565b9150611e4382611dbd565b9150611e4f8284611b8c565b91508190509392505050565b6000602082019050611e706000830184611b17565b92915050565b6000606082019050611e8b6000830186611b17565b611e986020830185611b17565b611ea56040830184611dfd565b949350505050565b6000602082019050611ec26000830184611b26565b92915050565b6000602082019050611edd6000830184611b35565b92915050565b6000604082019050611ef86000830185611b35565b611f056020830184611b17565b9392505050565b6000602082019050611f216000830184611b44565b92915050565b60006020820190508181036000830152611f418184611b53565b905092915050565b60006020820190508181036000830152611f6281611bbd565b9050919050565b60006060820190508181036000830152611f8281611bfd565b9050611f916020830185611b17565b611f9e6040830184611b17565b9392505050565b60006020820190508181036000830152611fbe81611c3d565b9050919050565b60006020820190508181036000830152611fde81611ca3565b9050919050565b60006060820190508181036000830152611ffe81611ce3565b905061200d6020830185611dfd565b61201a6040830184611dfd565b9392505050565b6000606082019050818103600083015261203a81611d23565b90506120496020830185611b17565b6120566040830184611b17565b9392505050565b60006020820190506120726000830184611dfd565b92915050565b600060608201905061208d6000830186611dfd565b61209a6020830185611dfd565b6120a76040830184611b17565b949350505050565b6000604051905081810181811067ffffffffffffffff821117156120d6576120d56122de565b5b8060405250919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061211d82612248565b915061212883612248565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561215d5761215c6122af565b5b828201905092915050565b600061217382612248565b915061217e83612248565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156121b7576121b66122af565b5b828202905092915050565b60006121cd82612228565b9050919050565b60006121df82612228565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015612270578082015181840152602081019050612255565b8381111561227f576000848401525b50505050565b600061229082612248565b915060008214156122a4576122a36122af565b5b600182039050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b612327816121c2565b811461233257600080fd5b50565b61233e816121d4565b811461234957600080fd5b50565b612355816121e6565b811461236057600080fd5b50565b61236c816121f2565b811461237757600080fd5b50565b600c811061238757600080fd5b50565b61239381612248565b811461239e57600080fd5b5056fe447261676f6e537761707065723a2063616c6c6572206973206e6f74206f776e6572447261676f6e537761707065723a207468652063616c6c6572206973206e6f7420612076616c6964206f70657261746f72a264697066735822122022b5a69ec4e7f80e080d8d5287a41abb73a64901d05e9a7f03ec4e366561540f64736f6c63430008000033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c713a40aa9bff56aee0e8ff9542b758d83af9fea0000000000000000000000003943cf9bd3aca41a66ec911a6395727db274856e000000000000000000000000068376f1a6ecb4c398fafc300712b212d11fa531

-----Decoded View---------------
Arg [0] : price (uint256): 0
Arg [1] : accessControl (address): 0xc713A40AA9bfF56aeE0E8fF9542b758d83af9fEa
Arg [2] : tokenContractAddress (address): 0x3943cF9BD3ACA41a66eC911A6395727DB274856E
Arg [3] : burnAddr (address): 0x068376F1a6ECb4C398FAFC300712b212D11FA531

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 000000000000000000000000c713a40aa9bff56aee0e8ff9542b758d83af9fea
Arg [2] : 0000000000000000000000003943cf9bd3aca41a66ec911a6395727db274856e
Arg [3] : 000000000000000000000000068376f1a6ecb4c398fafc300712b212d11fa531


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.