ETH Price: $2,420.08 (+1.45%)

Contract

0x5546a77DD6dB5C6D23334b9Ff910a2AEF4704364
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Upgrade Device A...180321782023-08-31 4:30:23407 days ago1693456223IN
0x5546a77D...EF4704364
0 ETH0.0011093816.49402409
Set Approval For...176008692023-07-01 18:05:59467 days ago1688234759IN
0x5546a77D...EF4704364
0 ETH0.0006730914.58275372
Claim Mag From M...169737132023-04-04 6:15:59556 days ago1680588959IN
0x5546a77D...EF4704364
0 ETH0.0011678318.87137512
Claim Mag From M...169553342023-04-01 15:57:59558 days ago1680364679IN
0x5546a77D...EF4704364
0 ETH0.0015464624.98980276
Claim Mag From M...169553192023-04-01 15:54:59558 days ago1680364499IN
0x5546a77D...EF4704364
0 ETH0.0014093722.77439765
Upgrade Device A...169553092023-04-01 15:52:59558 days ago1680364379IN
0x5546a77D...EF4704364
0 ETH0.0016383724.36425781
Claim Mag From M...169553072023-04-01 15:52:35558 days ago1680364355IN
0x5546a77D...EF4704364
0 ETH0.0014963224.17953649
Upgrade Device A...168074372023-03-11 21:15:11579 days ago1678569311IN
0x5546a77D...EF4704364
0 ETH0.0029368343.66387481
Claim Mag From M...168074292023-03-11 21:13:23579 days ago1678569203IN
0x5546a77D...EF4704364
0 ETH0.0027559337.55551303
Claim Mag From M...167935172023-03-09 22:09:35581 days ago1678399775IN
0x5546a77D...EF4704364
0 ETH0.002658742.96274075
Upgrade Device A...167916442023-03-09 15:49:35581 days ago1678376975IN
0x5546a77D...EF4704364
0 ETH0.0019363628.78926644
Claim Mag From M...167916402023-03-09 15:48:47581 days ago1678376927IN
0x5546a77D...EF4704364
0 ETH0.0021281529.00072045
Set Approval For...166025782023-02-11 2:36:23608 days ago1676082983IN
0x5546a77D...EF4704364
0 ETH0.000446518.41617494
Upgrade Device A...165630782023-02-05 14:07:47613 days ago1675606067IN
0x5546a77D...EF4704364
0 ETH0.0014490421.54879266
Upgrade Device A...165630752023-02-05 14:07:11613 days ago1675606031IN
0x5546a77D...EF4704364
0 ETH0.001509722.4594483
Claim Mag From M...165630692023-02-05 14:05:59613 days ago1675605959IN
0x5546a77D...EF4704364
0 ETH0.0013126921.21213016
Claim Mag From M...159283492022-11-08 22:38:59702 days ago1667947139IN
0x5546a77D...EF4704364
0 ETH0.0020265732.74789091
Upgrade Device A...158421942022-10-27 21:48:35714 days ago1666907315IN
0x5546a77D...EF4704364
0 ETH0.0008219112.22276598
Claim Mag From M...158421932022-10-27 21:48:23714 days ago1666907303IN
0x5546a77D...EF4704364
0 ETH0.0006807211
Claim Mag From M...158421622022-10-27 21:41:59714 days ago1666906919IN
0x5546a77D...EF4704364
0 ETH0.0006807211
Upgrade Device A...158409342022-10-27 17:34:47714 days ago1666892087IN
0x5546a77D...EF4704364
0 ETH0.0011517817.12822252
Claim Mag From M...158409012022-10-27 17:28:11714 days ago1666891691IN
0x5546a77D...EF4704364
0 ETH0.0006807211
Upgrade Device A...158290732022-10-26 1:50:47716 days ago1666749047IN
0x5546a77D...EF4704364
0 ETH0.0007768311.55232946
Claim Mag From M...158290602022-10-26 1:48:11716 days ago1666748891IN
0x5546a77D...EF4704364
0 ETH0.0008069910.99696415
Set Approval For...157184822022-10-10 15:05:47731 days ago1665414347IN
0x5546a77D...EF4704364
0 ETH0.0014857432.18884751
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:
AncientDevice

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 20 : AncientDevice.sol
// SPDX-License-Identifier: MIT LICENSE  
/*

'########:'##::::'##:'########::::                                                         
... ##..:: ##:::: ##: ##.....:::::                                                         
::: ##:::: ##:::: ##: ##::::::::::                                                         
::: ##:::: #########: ######::::::                                                         
::: ##:::: ##.... ##: ##...:::::::                                                         
::: ##:::: ##:::: ##: ##::::::::::                                                         
::: ##:::: ##:::: ##: ########::::                                                         
:::..:::::..:::::..::........:::::                                                         
'##::::'##:'########:'########:::'######::'##::::'##:'########::'####::::'###::::'##::: ##:
 ###::'###: ##.....:: ##.... ##:'##... ##: ##:::: ##: ##.... ##:. ##::::'## ##::: ###:: ##:
 ####'####: ##::::::: ##:::: ##: ##:::..:: ##:::: ##: ##:::: ##:: ##:::'##:. ##:: ####: ##:
 ## ### ##: ######::: ########:: ##::::::: ##:::: ##: ########::: ##::'##:::. ##: ## ## ##:
 ##. #: ##: ##...:::: ##.. ##::: ##::::::: ##:::: ##: ##.. ##:::: ##:: #########: ##. ####:
 ##:.:: ##: ##::::::: ##::. ##:: ##::: ##: ##:::: ##: ##::. ##::: ##:: ##.... ##: ##:. ###:
 ##:::: ##: ########: ##:::. ##:. ######::. #######:: ##:::. ##:'####: ##:::: ##: ##::. ##:
..:::::..::........::..:::::..:::......::::.......:::..:::::..::....::..:::::..::..::::..::
'########::'########:::'#######::::::::'##:'########::'######::'########:                  
 ##.... ##: ##.... ##:'##.... ##::::::: ##: ##.....::'##... ##:... ##..::                  
 ##:::: ##: ##:::: ##: ##:::: ##::::::: ##: ##::::::: ##:::..::::: ##::::                  
 ########:: ########:: ##:::: ##::::::: ##: ######::: ##:::::::::: ##::::                  
 ##.....::: ##.. ##::: ##:::: ##:'##::: ##: ##...:::: ##:::::::::: ##::::                  
 ##:::::::: ##::. ##:: ##:::: ##: ##::: ##: ##::::::: ##::: ##:::: ##::::                  
 ##:::::::: ##:::. ##:. #######::. ######:: ########:. ######::::: ##::::                  
..:::::::::..:::::..:::.......::::......:::........:::......::::::..:::::                                    
                                                                                
                                             @@@@@@@@@@@@@@                     
                                          @@             ..   @@@@@             
                                       @@@        ....      ,,..   @@@          
                                   @@  ./((((((((%%%%%%%%(((((  .    ,    @     
                                   @@..%%%%%(((.....(((%%%%(%%((   ,,   ,,,@@   
                              @@%%%((...               ..../%%%%(              @
                             @%%%%(..                    ../%%(((          ,,,,@
                         @@%%%((..                         /////(     ,,,,,//,,@
                      @@@look(....                         /%%//     ,,,,,/,,((@
                   @((%%%**.......                       %%%       ,,,//,,(((((@
               @@@@%%%%%*.... ....                     %%//   ,,,,,///,,((,/(@@ 
            @@,%%%%%..          ...     ..     .. ..//(  ,,,,,,,/,,,,,/((((((@@ 
         @@@,,%%%.......          ...       .  ...//((   ,,,////,,,,,,/(((,@@   
     @@  ,%%((........     ...            .....//(    ,,,,,,,,,,,%%,,,/(((@     
  @@@  ,,%  ...    .....   ..             ..///,,   ,,,,,,,%@@%%for,,/(@@      
@@  ,%%%%(((............           .... ..((,  ,,/,,,,,  ,,@@@%%%@@             
@@     ,,%@@(((.......             ....%((,,   ...//,,,  ((@@@@@%@@             
  @clues@,    ,((%%(((...     .....  ((     .///////@@@((((@@@@@                
    @@@@@,((     ,,%((((.....   ...((,,.  ..////////@@@((((@                    
     @@/////,,(,,     ,,(%%(((((((      /////@@((/every@@@
     @@(((((@@(((,,,,,  ,(((((((   ,,,,%////%@@@@/@@@@@                         
            @@(((@@/..@@,          %%%%/////(@@@@(@@                            
              @@@@@(@@@@@,,       /,,@@@////(@@@@@                              
                    @@(((@@/////,,.//@@@////@                                   
                      @@(((//////////@@@@@//@                                   
                           @@where@                                             
                             @%%%%@  

  A Melange Labs Project
  Founder:          @atreidesETH
  Contract Author:  @BlockDaddyy
  Auditor:          @ItsCuzzo      

*/                                                                           

pragma solidity ^0.8.0;
import "./ERC721Enumerable.sol";
import "./OwnableWithAdmin.sol";
import "./Pausable.sol";
import "./Strings.sol";
import "./MAGNESIUM.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

contract AncientDevice is ERC721Enumerable, OwnableWithAdmin, Pausable, ReentrancyGuard {
  
  using Strings for uint256;

  bytes32 public whitelistMerkleRoot;
  mapping(address => bool) public addressHasClaimed; // track whitelisters

  uint256 constant MAX_DEVICES_SUPPLY = 1390;
  uint256 constant SECONDS_PER_DAY    = 1 days;
  uint256 public   yieldEndTime       = 1742839200; // March 24, 2025, 19:00 UTC: Mercury's first Inferior Conjunction of 2025

  string public baseURI;
  string public baseExtension;

  uint256 private lineOfClue;

  mapping(uint256 => Device) public devices;

  struct Device {
    uint16 level; // maxval 255 ... yield = (2**(uint256(level-1))) ether
    uint240 lastClaimTimestamp; // stored in seconds, no chance of overflow
  }

  event AncientDevicesClaimed(address recipient, uint256 amount);
  event MagnesiumClaimed(address recipient, uint256 tokenId, uint256 amount);
  event DeviceUpgradedMagClaimed(address user, uint256 tokenId, uint256 targetLevel, uint256 amount);

  MAGNESIUM public magnesium;

  constructor(address _magnesium) ERC721("Ancient Devices", "ANCIENT DEVICES") {
      magnesium = MAGNESIUM(_magnesium);
      _pause();
  }

  /**
    * @dev include trailing /
    */
  function setBaseURI(string memory _baseURI) external onlyOwnerOrAdmin {
      baseURI = _baseURI;
  }

  function setBaseExtension(string memory _newBaseExtension) external onlyOwnerOrAdmin {
      baseExtension = _newBaseExtension;
  }

  function setWhitelistMerkleRoot(bytes32 _whitelistMerkleRoot) external onlyOwnerOrAdmin {
      whitelistMerkleRoot = _whitelistMerkleRoot;
  }

  function setMagnesiumAddress(address _newMagAddress) external onlyOwnerOrAdmin {
      magnesium = MAGNESIUM(_newMagAddress);
  }

  function setYieldEndTime(uint256 _newTime) external onlyOwnerOrAdmin {
      uint256 currentTime = block.timestamp;
      require(currentTime < yieldEndTime, "yieldEndTime can't be changed once the end time has past");
      require(currentTime < _newTime, "yieldEndTime can only be changed to a time in the future");
      yieldEndTime = _newTime;
  }

  function setLineOfClue(uint256 _lineNumber) external onlyOwnerOrAdmin {
      lineOfClue = _lineNumber;
  }

  /**
   * enables owner or admin to pause / unpause minting, claiming mag, and upgrading
   */
  function setPaused(bool _paused) external onlyOwnerOrAdmin {
    if (_paused) _pause(); // Pausable
    else _unpause();
  }

  /**
   * it's a secret
   */
  function setSecretUnlockEnabled(bool _enable) external onlyOwnerOrAdmin {
    if (_enable) _enableSecretUnlock(); // Pausable
    else _disableSecretUnlock();
  }

  // CLAIMING DEVICES

  function claimDevices(uint256 _amount, bytes32[] calldata _merkleProof, uint256 _allowance) external whenNotPaused nonReentrant {
    uint256 totalSupply = _owners.length;
    require(totalSupply + _amount <= MAX_DEVICES_SUPPLY, "Exceeds max supply");
    require(_amount > 0, "You must claim an amount greater than 0");
    require(_amount <= _allowance, "You cant mint more than your allowance");
    bytes32 leaf = keccak256(abi.encodePacked(_msgSender(), _allowance));
    require(MerkleProof.verify(_merkleProof, whitelistMerkleRoot, leaf), "Invalid Merkle Tree proof supplied.");
    require(!addressHasClaimed[_msgSender()], "You have already claimed devices"); // User can only claim once
    addressHasClaimed[_msgSender()] = true; // can only claim once
    for(uint i; i < _amount; i++) { 
      devices[totalSupply + i] = Device({
        level: uint16(1),
        lastClaimTimestamp: uint240(block.timestamp)
      });
      _mint(_msgSender(), totalSupply + i);
    }
    emit AncientDevicesClaimed(_msgSender(), _amount);
  }

  function claimReserves(address _to, uint _amount) external onlyOwner {
    uint256 totalSupply = _owners.length;
    require(totalSupply + _amount <= MAX_DEVICES_SUPPLY, "Exceeds max supply.");
    for(uint i; i < _amount; i++) { 
      devices[totalSupply + i] = Device({
        level: uint16(1),
        lastClaimTimestamp: uint240(block.timestamp)
      });
      _mint(_to, totalSupply + i);
    }
    emit AncientDevicesClaimed(_to, _amount);
  }

  // Claiming MAG

  /**
   * the amount of MAG currently available to claim in a device
   * @param tokenId the token to check the MAG for
   */
  function magnesiumAvailable(uint256 tokenId) public view returns (uint256) {
    require(_exists(tokenId), "Token does not exist");
    Device memory device = devices[tokenId];
    uint256 currentTimestamp = block.timestamp;
    
    if (currentTimestamp > yieldEndTime) // if its past the yield end time
      currentTimestamp = yieldEndTime; // stop the yield at yield end time
    if (device.lastClaimTimestamp > currentTimestamp) return 0; 

    uint256 elapsedSeconds = currentTimestamp - device.lastClaimTimestamp;
    uint256 earnedPerSecond = (2**((uint256(device.level))-1)) * 1 ether / SECONDS_PER_DAY;
    return earnedPerSecond * elapsedSeconds;
  }

  /**
   * the amount of MAG currently available to claim in a set of device
   * @param tokenIds the tokens to check MAG for
   */
  function magnesiumAvailableInMany(uint256[] calldata tokenIds) external view returns (uint256) {
    uint256 available;
    uint256 totalAvailable;
    require(tokenIds.length > 0, "You cannot pass an empty array");
    for (uint i = 0; i < tokenIds.length; i++) {
      available = magnesiumAvailable(tokenIds[i]);
      totalAvailable += available;
    }
    return totalAvailable;
  }

  function claimMagFromMany(uint256[] calldata _tokenIds) external whenNotPaused nonReentrant {
    uint256 available;
    uint256 totalAvailable;
    require(_tokenIds.length > 0, "You cannot pass an empty array");
    for (uint i = 0; i < _tokenIds.length; i++) {
      require(ownerOf(_tokenIds[i]) == _msgSender(), "NOT YOUR DEVICE(S)");
      available = magnesiumAvailable(_tokenIds[i]);
      Device storage device = devices[_tokenIds[i]];
      device.lastClaimTimestamp = uint240(block.timestamp);
      emit MagnesiumClaimed(_msgSender(), _tokenIds[i], available);
      totalAvailable += available;
    }
    require(totalAvailable > 0, "NO MAG AVAILABLE");
    magnesium.mint(_msgSender(), totalAvailable); // trusted
  }

  // DEVICE UPGRADES

  /** 
   * Upgrade a device (One device at a time. You can upgrade multiple levels at once)
   */
  function upgradeDeviceAndClaim(uint256 _tokenId, uint256 _targetLevel) external whenNotPaused nonReentrant {
    require(_msgSender() == ownerOf(_tokenId), "NOT YOUR DEVICE");
    Device storage device = devices[_tokenId];
    require(device.level < _targetLevel, "Must be an upgrade");
    require(_targetLevel < 6, "Max known level is 5");

    // if there's mag, claim it
    uint256 available = magnesiumAvailable(_tokenId);
    if (available > 0) {
      device.lastClaimTimestamp = uint240(block.timestamp);
      magnesium.mint(_msgSender(), available);
    }

    // upgrade
    uint256 magCost = upgradeCost(device.level, _targetLevel);
    require(magnesium.balanceOf(_msgSender()) > magCost, "You do not have enough MAG for this upgrade");
    magnesium.burn(_msgSender(), magCost);
    device.level = uint16(_targetLevel);
    emit DeviceUpgradedMagClaimed(_msgSender(), _tokenId, _targetLevel, available);
  } 

  /*
   * User can upgrade 1 level at a time or multiple levels at a time
   * 1 to 2 : 7 MAG
   * 2 to 3 : 35 MAG
   * 3 to 4 : 350 MAG
   * 4 to 5 : 3000 MAG
   * @param _level current level of device
   * @param _targetLevel the level the user would like to upgrade to
   * @return the cost of upgrade
   */
  function upgradeCost(uint _level, uint _targetLevel) internal pure returns (uint256) {
    uint256 totalCost;
    while(_level < _targetLevel){ // 377981
      if (_level == 1)      totalCost += 7 ether;
      else if (_level == 2) totalCost += 35 ether;
      else if (_level == 3) totalCost += 350 ether;
      else if (_level == 4) totalCost += 3000 ether;
      _level++;
    }
    return totalCost;
  }

  function getUpgradeCost(uint256 _tokenId, uint _targetLevel) external view returns (uint256) {
    uint256 totalCost;
    uint16 level = devices[_tokenId].level;
    while(level < _targetLevel){
      if (level == 1)      totalCost += 7 ether;
      else if (level == 2) totalCost += 35 ether;
      else if (level == 3) totalCost += 350 ether;
      else if (level == 4) totalCost += 3000 ether;
      level++;
    }
    return totalCost;
  }

  function getLevel(uint256 _tokenId) external view returns (uint16) {
    require(_exists(_tokenId), "Token does not exist");
    return devices[_tokenId].level;
  }

  function secretUnlockWithClaimIfNeeded(uint256 _tokenId) external whenNotPaused whenSecretUnlockEnabled nonReentrant {
    require(_msgSender() == ownerOf(_tokenId), "Not your device");
    require(block.timestamp > yieldEndTime, "Device not ready");
    Device storage device = devices[_tokenId];
    require(device.level == 5, "Must be level 5 to unlock a device");
    uint256 available = magnesiumAvailable(_tokenId); // placed here intentionally
    device.level = uint16(6);
    if (available > 0) { //if there is mag in the device, claim it
      device.lastClaimTimestamp = uint240(block.timestamp);
      magnesium.mint(_msgSender(), available); // trusted
    }
  }

  function getClue() external view returns (string memory) {
    return string(abi.encodePacked("Line #", Strings.toString(lineOfClue))); 
  }

  // Overrides

  /** 
   Override to make sure that transfers can't be frontrun
  */
  function transferFrom(address from, address to, uint256 tokenId) public override nonReentrant {
    require(devices[tokenId].lastClaimTimestamp < block.timestamp, "Cannot claim immediately before a transfer");
    super.transferFrom(from, to, tokenId);
  }

  /** 
   Override to make sure that transfers can't be frontrun
  */
  function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override nonReentrant {
    require(devices[tokenId].lastClaimTimestamp < block.timestamp, "Cannot claim immediately before a transfer");
    super.safeTransferFrom(from, to, tokenId, _data);
  }

  function tokenURI(uint256 _tokenId) public view override returns (string memory) {
    require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token");
    return string(abi.encodePacked(baseURI, Strings.toString(_tokenId), baseExtension));
  }

  function _mint(address to, uint256 tokenId) internal virtual override {
    _owners.push(to);
    emit Transfer(address(0), to, tokenId);
  }

}

File 2 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 3 of 20 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 4 of 20 : MAGNESIUM.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;
import "./ERC20.sol";
import "./OwnableWithAdmin.sol";

contract MAGNESIUM is ERC20, OwnableWithAdmin {

  // a mapping from an address to whether or not it can mint / burn. Melange Labs contracts only
  mapping(address => bool) public controllers;
  
  constructor() ERC20("MAGNESIUM", "MAG") { } 

  /**
   * mints $MAG to a recipient
   * @param to - the recipient of the $MAG
   * @param amount - the amount of $MAG to mint
   */
  function mint(address to, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can mint");
    _mint(to, amount);
  }

  /**
   * burns $MAG from a holder
   * @param from the holder of the $MAG
   * @param amount the amount of $MAG to burn
   */
  function burn(address from, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can burn");
    _burn(from, amount);
  }

  /**
   * enables an address to mint / burn (Melange Labs contracts only)
   * @param controller the address to enable
   */
  function addController(address controller) external onlyOwner {
    controllers[controller] = true;
  }

  /**
   * disables an address from minting / burning
   * @param controller the address to disable
   */
  function removeController(address controller) external onlyOwner {
    controllers[controller] = false;
  }
}

File 5 of 20 : 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 6 of 20 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;
    bool private _secretUnlockEnabled;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
        _secretUnlockEnabled = true;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    modifier whenSecretUnlockEnabled() {
        require(_secretUnlockEnabled, "Secret Unlock Disabled");
        _;
    }

    modifier whenSecretUnlockDisabled() {
        require(!_secretUnlockEnabled, "Secret Unlock Enabled");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

    function _enableSecretUnlock() internal virtual whenSecretUnlockDisabled {
        _secretUnlockEnabled = true;
    }

    function _disableSecretUnlock() internal virtual whenSecretUnlockEnabled {
        _secretUnlockEnabled = false;
    }
}

File 7 of 20 : OwnableWithAdmin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableWithAdmin is Context {
    address private _owner;
    address private _admin;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event NewAdmin(address indexed previousAdmin, address indexed newAdmin);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Returns the address of the current admin.
     */
    function admin() public view virtual returns (address) {
        return _admin;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "OwnableWithAdmin: caller is not the owner");
        _;
    }

    /**
     * @dev Throws if called by any account other than the owner or the admin.
     */
    modifier onlyOwnerOrAdmin() {
        require(owner() == _msgSender() || admin() == _msgSender(), "OwnableWithAdmin: caller is not the owner or admin");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner forever.
     * NOTE: This function does not remove the admin, so onlyOwnerOrAdmin function 
     * can still be called if an admin was set prior to the renouncing of ownership.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Leaves the contract without owner or admin. It will not be possible to call
     * onlyOwner or onlyOwnerOrAdmin functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership and adminship will leave the contract without an owner or an admin,
     * thereby removing any functionality that is only available to the owner or admin forever.
     */
    function renounceOwnershipandAdminship() public virtual onlyOwner {
        _setOwner(address(0));
        _setAdmin(address(0));
    }

    

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner can't be the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    function setAdmin(address newAdmin) public virtual onlyOwner {
        require(newAdmin != address(0), "Ownable: new admin can't be the zero address");
        _setAdmin(newAdmin);
    }
    function _setAdmin(address newAdmin) private {
        address oldAdmin = _admin;
        _admin = newAdmin;
        emit NewAdmin(oldAdmin, newAdmin);
    }
}

File 8 of 20 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

import "./ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account but rips out the core of the gas-wasting processing that comes from OpenZeppelin.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _owners.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < _owners.length, "ERC721Enumerable: global index out of bounds");
        return index;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * Calling this function on-chain is discouraged
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");

        uint count;
        for(uint i; i < _owners.length; i++){
            if(owner == _owners[i]){
                if(count == index) return i;
                else count++;
            }
        }

        revert("ERC721Enumerable: owner index out of bounds");
    }
}

File 9 of 20 : 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 10 of 20 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./IERC20Metadata.sol";
import "./Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }
        _transfer(sender, recipient, amount);

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 11 of 20 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 12 of 20 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "./Context.sol";
import "./Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./Address.sol";

abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;
    
    string private _name;
    string private _symbol;

    // Mapping from token ID to owner address
    address[] internal _owners;

    mapping(uint256 => address) private _tokenApprovals;
    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}.
     * Calling this function on-chain is discouraged
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        require(owner != address(0), "ERC721: balance query for the zero address");

        uint count;
        for( uint i; i < _owners.length; ++i ){
          if( owner == _owners[i] )
            ++count;
        }
        return count;
    }

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

    /**
     * @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 {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 tokenId < _owners.length && _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);
        _owners.push(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);
        _owners[tokenId] = address(0);

        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);
        _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 13 of 20 : Address.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

library Address {
    function isContract(address account) internal view returns (bool) {
        uint size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }
}

File 14 of 20 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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 15 of 20 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

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 16 of 20 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

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 17 of 20 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

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 18 of 20 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 19 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 20 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_magnesium","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AncientDevicesClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetLevel","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DeviceUpgradedMagClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MagnesiumClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"addressHasClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseExtension","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_allowance","type":"uint256"}],"name":"claimDevices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"claimMagFromMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"claimReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"devices","outputs":[{"internalType":"uint16","name":"level","type":"uint16"},{"internalType":"uint240","name":"lastClaimTimestamp","type":"uint240"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getClue","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getLevel","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_targetLevel","type":"uint256"}],"name":"getUpgradeCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magnesium","outputs":[{"internalType":"contract MAGNESIUM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"magnesiumAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"magnesiumAvailableInMany","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnershipandAdminship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"secretUnlockWithClaimIfNeeded","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseExtension","type":"string"}],"name":"setBaseExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lineNumber","type":"uint256"}],"name":"setLineOfClue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMagAddress","type":"address"}],"name":"setMagnesiumAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_enable","type":"bool"}],"name":"setSecretUnlockEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_whitelistMerkleRoot","type":"bytes32"}],"name":"setWhitelistMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newTime","type":"uint256"}],"name":"setYieldEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_targetLevel","type":"uint256"}],"name":"upgradeDeviceAndClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526367e19da0600a553480156200001957600080fd5b5060405162003caf38038062003caf8339810160408190526200003c91620002cc565b6040518060400160405280600f81526020016e416e6369656e74204465766963657360881b8152506040518060400160405280600f81526020016e414e4349454e54204445564943455360881b8152508160009080519060200190620000a492919062000226565b508051620000ba90600190602084019062000226565b505050620000d7620000d16200011e60201b60201c565b62000122565b6006805461ffff60a01b1916600160a81b1790556001600755600f80546001600160a01b0383166001600160a01b03199091161790556200011762000174565b506200033b565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b62000188600654600160a01b900460ff1690565b15620001cd5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258620002093390565b6040516001600160a01b03909116815260200160405180910390a1565b8280546200023490620002fe565b90600052602060002090601f016020900481019282620002585760008555620002a3565b82601f106200027357805160ff1916838001178555620002a3565b82800160010185558215620002a3579182015b82811115620002a357825182559160200191906001019062000286565b50620002b1929150620002b5565b5090565b5b80821115620002b15760008155600101620002b6565b600060208284031215620002df57600080fd5b81516001600160a01b0381168114620002f757600080fd5b9392505050565b600181811c908216806200031357607f821691505b602082108114156200033557634e487b7160e01b600052602260045260246000fd5b50919050565b613964806200034b6000396000f3fe608060405234801561001057600080fd5b50600436106102a05760003560e01c80636c0360eb11610167578063b88d4fde116100ce578063c87b56dd11610087578063c87b56dd14610605578063cab8fa2214610618578063da3ef23f1461062b578063e985e9c51461063e578063f2fde38b1461067a578063f851a4401461068d57600080fd5b8063b88d4fde146105a9578063bd32fb66146105bc578063be01ac8b146105cf578063c58e5be8146105d7578063c5b3d078146105ea578063c6682862146105fd57600080fd5b80638da5cb5b116101205780638da5cb5b1461054e578063915ee6e91461055f57806395d89b4114610572578063a22cb4651461057a578063a697fe311461058d578063aa98e0c6146105a057600080fd5b80636c0360eb146104df578063704b6c02146104e757806370a08231146104fa57806370b5ae9c1461050d578063715018a61461052057806386481d401461052857600080fd5b80633c4c51c91161020b5780634c7bce6b116101c45780634c7bce6b1461046e5780634f6ccce71461048157806355f804b3146104945780635c975abb146104a75780635f1aca81146104b95780636352211e146104cc57600080fd5b80633c4c51c9146103f757806342842e0e146103ff57806344944f311461041257806346c22429146104355780634830dfa51461044857806348c3b2471461045b57600080fd5b80631394818e1161025d5780631394818e1461039a57806316c38b3c146103ad57806318160ddd146103c057806323b872dd146103c85780632f745c59146103db578063314ca039146103ee57600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063081812fc146102e2578063095ea7b31461030d5780630cc670fa1461032257806310ff8e3114610343575b600080fd5b6102b86102b3366004613209565b61069e565b60405190151581526020015b60405180910390f35b6102d56106c9565b6040516102c49190613474565b6102f56102f03660046131f0565b61075b565b6040516001600160a01b0390911681526020016102c4565b61032061031b366004613169565b6107e8565b005b610335610330366004613193565b6108fe565b6040519081526020016102c4565b6103786103513660046131f0565b600e6020526000908152604090205461ffff8116906201000090046001600160f01b031682565b6040805161ffff90931683526001600160f01b039091166020830152016102c4565b6103206103a83660046131f0565b6109a4565b6103206103bb3660046131d5565b610ad7565b600254610335565b6103206103d6366004613087565b610b2f565b6103356103e9366004613169565b610ba9565b610335600a5481565b6102d5610c5c565b61032061040d366004613087565b610c8d565b6102b8610420366004613039565b60096020526000908152604090205460ff1681565b610320610443366004613169565b610ca8565b6103356104563660046132f8565b610dfb565b6103206104693660046131f0565b610ec0565b61032061047c3660046132f8565b611124565b61033561048f3660046131f0565b6114e4565b6103206104a2366004613243565b611551565b600654600160a01b900460ff166102b8565b6103206104c73660046131d5565b6115a7565b6102f56104da3660046131f0565b6115fc565b6102d5611690565b6103206104f5366004613039565b61171e565b610335610508366004613039565b6117bc565b61032061051b3660046132a5565b61188a565b610320611c1e565b61053b6105363660046131f0565b611c54565b60405161ffff90911681526020016102c4565b6005546001600160a01b03166102f5565b600f546102f5906001600160a01b031681565b6102d5611cb9565b61032061058836600461313f565b611cc8565b61032061059b366004613039565b611d8d565b61033560085481565b6103206105b73660046130c3565b611dee565b6103206105ca3660046131f0565b611e6a565b610320611eae565b6103206105e53660046131f0565b611eec565b6103206105f8366004613193565b611f30565b6102d56121f1565b6102d56106133660046131f0565b6121fe565b6103356106263660046131f0565b6122a2565b610320610639366004613243565b6123ca565b6102b861064c366004613054565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b610320610688366004613039565b61241c565b6006546001600160a01b03166102f5565b60006001600160e01b0319821663780e9d6360e01b14806106c357506106c3826124ba565b92915050565b6060600080546106d890613834565b80601f016020809104026020016040519081016040528092919081815260200182805461070490613834565b80156107515780601f1061072657610100808354040283529160200191610751565b820191906000526020600020905b81548152906001019060200180831161073457829003601f168201915b5050505050905090565b60006107668261250a565b6107cc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600360205260409020546001600160a01b031690565b60006107f3826115fc565b9050806001600160a01b0316836001600160a01b031614156108615760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107c3565b336001600160a01b038216148061087d575061087d813361064c565b6108ef5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107c3565b6108f98383612554565b505050565b600080808361094f5760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e6e6f74207061737320616e20656d707479206172726179000060448201526064016107c3565b60005b8481101561099b5761097b86868381811061096f5761096f6138ec565b905060200201356122a2565b925061098783836136bb565b91508061099381613891565b915050610952565b50949350505050565b6005546001600160a01b03163314806109c757506006546001600160a01b031633145b6109e35760405162461bcd60e51b81526004016107c390613632565b600a5442908110610a5c5760405162461bcd60e51b815260206004820152603860248201527f7969656c64456e6454696d652063616e2774206265206368616e676564206f6e60448201527f63652074686520656e642074696d65206861732070617374000000000000000060648201526084016107c3565b818110610ad15760405162461bcd60e51b815260206004820152603860248201527f7969656c64456e6454696d652063616e206f6e6c79206265206368616e67656460448201527f20746f20612074696d6520696e2074686520667574757265000000000000000060648201526084016107c3565b50600a55565b6005546001600160a01b0316331480610afa57506006546001600160a01b031633145b610b165760405162461bcd60e51b81526004016107c390613632565b8015610b2757610b246125c2565b50565b610b24612644565b60026007541415610b525760405162461bcd60e51b81526004016107c390613684565b60026007556000818152600e602052604090205442620100009091046001600160f01b031610610b945760405162461bcd60e51b81526004016107c390613597565b610b9f8383836126c8565b5050600160075550565b6000610bb4836117bc565b8210610bd25760405162461bcd60e51b81526004016107c390613487565b6000805b600254811015610c435760028181548110610bf357610bf36138ec565b6000918252602090912001546001600160a01b0386811691161415610c315783821415610c235791506106c39050565b81610c2d81613891565b9250505b80610c3b81613891565b915050610bd6565b5060405162461bcd60e51b81526004016107c390613487565b6060610c69600d546126f9565b604051602001610c799190613413565b604051602081830303815290604052905090565b6108f983838360405180602001604052806000815250611dee565b6005546001600160a01b03163314610cd25760405162461bcd60e51b81526004016107c390613524565b60025461056e610ce283836136bb565b1115610d265760405162461bcd60e51b815260206004820152601360248201527222bc31b2b2b2399036b0bc1039bab838363c9760691b60448201526064016107c3565b60005b82811015610db35760408051808201909152600181526001600160f01b0342166020820152600e6000610d5c84866136bb565b8152602080820192909252604001600020825192909101516001600160f01b0316620100000261ffff909216919091179055610da184610d9c83856136bb565b6127ff565b80610dab81613891565b915050610d29565b50604080516001600160a01b0385168152602081018490527fe679db040ba59b1f69e7f641211c64f95375b7e16597440a91e56e56e71104f2910160405180910390a1505050565b6000828152600e6020526040812054819061ffff165b838161ffff161015610eb8578061ffff1660011415610e4357610e3c676124fee993bc0000836136bb565b9150610ea6565b8061ffff1660021415610e6357610e3c6801e5b8fa8fe2ac0000836136bb565b8061ffff1660031415610e8357610e3c6812f939c99edab80000836136bb565b8061ffff1660041415610ea657610ea368a2a15d09519be00000836136bb565b91505b80610eb08161386f565b915050610e11565b509392505050565b600654600160a01b900460ff1615610eea5760405162461bcd60e51b81526004016107c39061356d565b600654600160a81b900460ff16610f3c5760405162461bcd60e51b815260206004820152601660248201527514d958dc995d08155b9b1bd8dac8111a5cd8589b195960521b60448201526064016107c3565b60026007541415610f5f5760405162461bcd60e51b81526004016107c390613684565b6002600755610f6d816115fc565b6001600160a01b0316336001600160a01b031614610fbf5760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420796f75722064657669636560881b60448201526064016107c3565b600a5442116110035760405162461bcd60e51b815260206004820152601060248201526f446576696365206e6f7420726561647960801b60448201526064016107c3565b6000818152600e60205260409020805461ffff166005146110715760405162461bcd60e51b815260206004820152602260248201527f4d757374206265206c6576656c203520746f20756e6c6f636b20612064657669604482015261636560f01b60648201526084016107c3565b600061107c836122a2565b825461ffff1916600617835590508015610b9f57815461ffff1662010000426001600160f01b031602178255600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561110257600080fd5b505af1158015611116573d6000803e3d6000fd5b505050505050600160075550565b600654600160a01b900460ff161561114e5760405162461bcd60e51b81526004016107c39061356d565b600260075414156111715760405162461bcd60e51b81526004016107c390613684565b600260075561117f826115fc565b6001600160a01b0316336001600160a01b0316146111d15760405162461bcd60e51b815260206004820152600f60248201526e4e4f5420594f55522044455649434560881b60448201526064016107c3565b6000828152600e60205260409020805461ffff1682116112285760405162461bcd60e51b81526020600482015260126024820152714d75737420626520616e207570677261646560701b60448201526064016107c3565b6006821061126f5760405162461bcd60e51b81526020600482015260146024820152734d6178206b6e6f776e206c6576656c206973203560601b60448201526064016107c3565b600061127a846122a2565b9050801561130d57815461ffff1662010000426001600160f01b031602178255600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b505050505b81546000906113209061ffff168561287b565b600f5490915081906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae919061328c565b1161140f5760405162461bcd60e51b815260206004820152602b60248201527f596f7520646f206e6f74206861766520656e6f756768204d414720666f72207460448201526a686973207570677261646560a81b60648201526084016107c3565b600f546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050845461ffff191661ffff8716178555505060408051338152602081018790528082018690526060810184905290517f5bd44927bb6f69e7fbbca757c673a4b5b2ccae7f2382208157a95f598a0564f8916080908290030190a150506001600755505050565b600254600090821061154d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107c3565b5090565b6005546001600160a01b031633148061157457506006546001600160a01b031633145b6115905760405162461bcd60e51b81526004016107c390613632565b80516115a390600b906020840190612ebb565b5050565b6005546001600160a01b03163314806115ca57506006546001600160a01b031633145b6115e65760405162461bcd60e51b81526004016107c390613632565b80156115f457610b24612919565b610b24612980565b60025460009082106116625760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107c3565b60028281548110611675576116756138ec565b6000918252602090912001546001600160a01b031692915050565b600b805461169d90613834565b80601f01602080910402602001604051908101604052809291908181526020018280546116c990613834565b80156117165780601f106116eb57610100808354040283529160200191611716565b820191906000526020600020905b8154815290600101906020018083116116f957829003601f168201915b505050505081565b6005546001600160a01b031633146117485760405162461bcd60e51b81526004016107c390613524565b6001600160a01b0381166117b35760405162461bcd60e51b815260206004820152602c60248201527f4f776e61626c653a206e65772061646d696e2063616e2774206265207468652060448201526b7a65726f206164647265737360a01b60648201526084016107c3565b610b24816129e1565b60006001600160a01b0382166118275760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107c3565b6000805b6002548110156118835760028181548110611848576118486138ec565b6000918252602090912001546001600160a01b03858116911614156118735761187082613891565b91505b61187c81613891565b905061182b565b5092915050565b600654600160a01b900460ff16156118b45760405162461bcd60e51b81526004016107c39061356d565b600260075414156118d75760405162461bcd60e51b81526004016107c390613684565b600260078190555461056e6118ec86836136bb565b111561192f5760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b60448201526064016107c3565b6000851161198f5760405162461bcd60e51b815260206004820152602760248201527f596f75206d75737420636c61696d20616e20616d6f756e7420677265617465726044820152660207468616e20360cc1b60648201526084016107c3565b818511156119ee5760405162461bcd60e51b815260206004820152602660248201527f596f752063616e74206d696e74206d6f7265207468616e20796f757220616c6c6044820152656f77616e636560d01b60648201526084016107c3565b6040516bffffffffffffffffffffffff193360601b16602082015260348101839052600090605401604051602081830303815290604052805190602001209050611a6f858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506008549150849050612a33565b611ac75760405162461bcd60e51b815260206004820152602360248201527f496e76616c6964204d65726b6c6520547265652070726f6f6620737570706c6960448201526232b21760e91b60648201526084016107c3565b3360009081526009602052604090205460ff1615611b275760405162461bcd60e51b815260206004820181905260248201527f596f75206861766520616c726561647920636c61696d6564206465766963657360448201526064016107c3565b336000908152600960205260408120805460ff191660011790555b86811015611bcd5760408051808201909152600181526001600160f01b0342166020820152600e6000611b7584876136bb565b8152602080820192909252604001600020825192909101516001600160f01b0316620100000261ffff909216919091179055611bbb611bb13390565b610d9c83866136bb565b80611bc581613891565b915050611b42565b507fe679db040ba59b1f69e7f641211c64f95375b7e16597440a91e56e56e71104f233604080516001600160a01b039092168252602082018990520160405180910390a15050600160075550505050565b6005546001600160a01b03163314611c485760405162461bcd60e51b81526004016107c390613524565b611c526000612a49565b565b6000611c5f8261250a565b611ca25760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016107c3565b506000908152600e602052604090205461ffff1690565b6060600180546106d890613834565b6001600160a01b038216331415611d215760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107c3565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6005546001600160a01b0316331480611db057506006546001600160a01b031633145b611dcc5760405162461bcd60e51b81526004016107c390613632565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60026007541415611e115760405162461bcd60e51b81526004016107c390613684565b60026007556000828152600e602052604090205442620100009091046001600160f01b031610611e535760405162461bcd60e51b81526004016107c390613597565b611e5f84848484612a9b565b505060016007555050565b6005546001600160a01b0316331480611e8d57506006546001600160a01b031633145b611ea95760405162461bcd60e51b81526004016107c390613632565b600855565b6005546001600160a01b03163314611ed85760405162461bcd60e51b81526004016107c390613524565b611ee26000612a49565b611c5260006129e1565b6005546001600160a01b0316331480611f0f57506006546001600160a01b031633145b611f2b5760405162461bcd60e51b81526004016107c390613632565b600d55565b600654600160a01b900460ff1615611f5a5760405162461bcd60e51b81526004016107c39061356d565b60026007541415611f7d5760405162461bcd60e51b81526004016107c390613684565b600260075560008082611fd25760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e6e6f74207061737320616e20656d707479206172726179000060448201526064016107c3565b60005b838110156121305733611fff868684818110611ff357611ff36138ec565b905060200201356115fc565b6001600160a01b03161461204a5760405162461bcd60e51b81526020600482015260126024820152714e4f5420594f55522044455649434528532960701b60448201526064016107c3565b61205f85858381811061096f5761096f6138ec565b92506000600e6000878785818110612079576120796138ec565b60209081029290920135835250810191909152604001600020805461ffff1662010000426001600160f01b03160217815590507fe8a6ce7e6a997a08ef9e7e8d523c86cba031ffa80ed979876264e1ba1435c09b338787858181106120e0576120e06138ec565b604080516001600160a01b039095168552602091820293909301359084015250810186905260600160405180910390a161211a84846136bb565b925050808061212890613891565b915050611fd5565b50600081116121745760405162461bcd60e51b815260206004820152601060248201526f4e4f204d414720415641494c41424c4560801b60448201526064016107c3565b600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156121ce57600080fd5b505af11580156121e2573d6000803e3d6000fd5b50506001600755505050505050565b600c805461169d90613834565b60606122098261250a565b61226d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107c3565b600b612278836126f9565b600c60405160200161228c939291906133e0565b6040516020818303038152906040529050919050565b60006122ad8261250a565b6122f05760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016107c3565b6000828152600e602090815260409182902082518084019093525461ffff811683526201000090046001600160f01b031690820152600a5442908111156123365750600a545b8082602001516001600160f01b03161115612355575060009392505050565b600082602001516001600160f01b03168261237091906137f1565b90506000620151806001856000015161ffff1661238d91906137f1565b61239890600261372a565b6123aa90670de0b6b3a76400006137d2565b6123b491906136d3565b90506123c082826137d2565b9695505050505050565b6005546001600160a01b03163314806123ed57506006546001600160a01b031633145b6124095760405162461bcd60e51b81526004016107c390613632565b80516115a390600c906020840190612ebb565b6005546001600160a01b031633146124465760405162461bcd60e51b81526004016107c390613524565b6001600160a01b0381166124b15760405162461bcd60e51b815260206004820152602c60248201527f4f776e61626c653a206e6577206f776e65722063616e2774206265207468652060448201526b7a65726f206164647265737360a01b60648201526084016107c3565b610b2481612a49565b60006001600160e01b031982166380ac58cd60e01b14806124eb57506001600160e01b03198216635b5e139f60e01b145b806106c357506301ffc9a760e01b6001600160e01b03198316146106c3565b600254600090821080156106c3575060006001600160a01b031660028381548110612537576125376138ec565b6000918252602090912001546001600160a01b0316141592915050565b600081815260036020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612589826115fc565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600654600160a01b900460ff16156125ec5760405162461bcd60e51b81526004016107c39061356d565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586126273390565b6040516001600160a01b03909116815260200160405180910390a1565b600654600160a01b900460ff166126945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107c3565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612627565b6126d23382612ad3565b6126ee5760405162461bcd60e51b81526004016107c3906135e1565b6108f9838383612bb9565b60608161271d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612747578061273181613891565b91506127409050600a836136d3565b9150612721565b60008167ffffffffffffffff81111561276257612762613902565b6040519080825280601f01601f19166020018201604052801561278c576020820181803683370190505b5090505b84156127f7576127a16001836137f1565b91506127ae600a866138ac565b6127b99060306136bb565b60f81b8183815181106127ce576127ce6138ec565b60200101906001600160f81b031916908160001a9053506127f0600a866136d3565b9450612790565b949350505050565b6002805460018101825560009182527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000805b828410156129125783600114156128a9576128a2676124fee993bc0000826136bb565b9050612900565b83600214156128c5576128a26801e5b8fa8fe2ac0000826136bb565b83600314156128e1576128a26812f939c99edab80000826136bb565b8360041415612900576128fd68a2a15d09519be00000826136bb565b90505b8361290a81613891565b94505061287f565b9392505050565b600654600160a81b900460ff161561296b5760405162461bcd60e51b815260206004820152601560248201527414d958dc995d08155b9b1bd8dac8115b98589b1959605a1b60448201526064016107c3565b6006805460ff60a81b1916600160a81b179055565b600654600160a81b900460ff166129d25760405162461bcd60e51b815260206004820152601660248201527514d958dc995d08155b9b1bd8dac8111a5cd8589b195960521b60448201526064016107c3565b6006805460ff60a81b19169055565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc90600090a35050565b600082612a408584612d0f565b14949350505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612aa53383612ad3565b612ac15760405162461bcd60e51b81526004016107c3906135e1565b612acd84848484612d7b565b50505050565b6000612ade8261250a565b612b3f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107c3565b6000612b4a836115fc565b9050806001600160a01b0316846001600160a01b03161480612b855750836001600160a01b0316612b7a8461075b565b6001600160a01b0316145b806127f757506001600160a01b0380821660009081526004602090815260408083209388168352929052205460ff166127f7565b826001600160a01b0316612bcc826115fc565b6001600160a01b031614612c345760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107c3565b6001600160a01b038216612c965760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107c3565b612ca1600082612554565b8160028281548110612cb557612cb56138ec565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b600081815b8451811015610eb8576000858281518110612d3157612d316138ec565b60200260200101519050808311612d575760008381526020829052604090209250612d68565b600081815260208490526040902092505b5080612d7381613891565b915050612d14565b612d86848484612bb9565b612d9284848484612dae565b612acd5760405162461bcd60e51b81526004016107c3906134d2565b60006001600160a01b0384163b15612eb057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612df2903390899088908890600401613441565b602060405180830381600087803b158015612e0c57600080fd5b505af1925050508015612e3c575060408051601f3d908101601f19168201909252612e3991810190613226565b60015b612e96573d808015612e6a576040519150601f19603f3d011682016040523d82523d6000602084013e612e6f565b606091505b508051612e8e5760405162461bcd60e51b81526004016107c3906134d2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127f7565b506001949350505050565b828054612ec790613834565b90600052602060002090601f016020900481019282612ee95760008555612f2f565b82601f10612f0257805160ff1916838001178555612f2f565b82800160010185558215612f2f579182015b82811115612f2f578251825591602001919060010190612f14565b5061154d9291505b8082111561154d5760008155600101612f37565b600067ffffffffffffffff80841115612f6657612f66613902565b604051601f8501601f19908116603f01168101908282118183101715612f8e57612f8e613902565b81604052809350858152868686011115612fa757600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612fd857600080fd5b919050565b60008083601f840112612fef57600080fd5b50813567ffffffffffffffff81111561300757600080fd5b6020830191508360208260051b850101111561302257600080fd5b9250929050565b80358015158114612fd857600080fd5b60006020828403121561304b57600080fd5b61291282612fc1565b6000806040838503121561306757600080fd5b61307083612fc1565b915061307e60208401612fc1565b90509250929050565b60008060006060848603121561309c57600080fd5b6130a584612fc1565b92506130b360208501612fc1565b9150604084013590509250925092565b600080600080608085870312156130d957600080fd5b6130e285612fc1565b93506130f060208601612fc1565b925060408501359150606085013567ffffffffffffffff81111561311357600080fd5b8501601f8101871361312457600080fd5b61313387823560208401612f4b565b91505092959194509250565b6000806040838503121561315257600080fd5b61315b83612fc1565b915061307e60208401613029565b6000806040838503121561317c57600080fd5b61318583612fc1565b946020939093013593505050565b600080602083850312156131a657600080fd5b823567ffffffffffffffff8111156131bd57600080fd5b6131c985828601612fdd565b90969095509350505050565b6000602082840312156131e757600080fd5b61291282613029565b60006020828403121561320257600080fd5b5035919050565b60006020828403121561321b57600080fd5b813561291281613918565b60006020828403121561323857600080fd5b815161291281613918565b60006020828403121561325557600080fd5b813567ffffffffffffffff81111561326c57600080fd5b8201601f8101841361327d57600080fd5b6127f784823560208401612f4b565b60006020828403121561329e57600080fd5b5051919050565b600080600080606085870312156132bb57600080fd5b84359350602085013567ffffffffffffffff8111156132d957600080fd5b6132e587828801612fdd565b9598909750949560400135949350505050565b6000806040838503121561330b57600080fd5b50508035926020909101359150565b60008151808452613332816020860160208601613808565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061336057607f831692505b602080841082141561338257634e487b7160e01b600052602260045260246000fd5b81801561339657600181146133a7576133d4565b60ff198616895284890196506133d4565b60008881526020902060005b868110156133cc5781548b8201529085019083016133b3565b505084890196505b50505050505092915050565b60006133ec8286613346565b84516133fc818360208901613808565b61340881830186613346565b979650505050505050565b654c696e65202360d01b815260008251613434816006850160208701613808565b9190910160060192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906123c09083018461331a565b602081526000612912602083018461331a565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526029908201527f4f776e61626c655769746841646d696e3a2063616c6c6572206973206e6f74206040820152683a34329037bbb732b960b91b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252602a908201527f43616e6e6f7420636c61696d20696d6d6564696174656c79206265666f72652060408201526930903a3930b739b332b960b11b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526032908201527f4f776e61626c655769746841646d696e3a2063616c6c6572206973206e6f74206040820152713a34329037bbb732b91037b91030b236b4b760711b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600082198211156136ce576136ce6138c0565b500190565b6000826136e2576136e26138d6565b500490565b600181815b80851115613722578160001904821115613708576137086138c0565b8085161561371557918102915b93841c93908002906136ec565b509250929050565b60006129128383600082613740575060016106c3565b8161374d575060006106c3565b8160018114613763576002811461376d57613789565b60019150506106c3565b60ff84111561377e5761377e6138c0565b50506001821b6106c3565b5060208310610133831016604e8410600b84101617156137ac575081810a6106c3565b6137b683836136e7565b80600019048211156137ca576137ca6138c0565b029392505050565b60008160001904831182151516156137ec576137ec6138c0565b500290565b600082821015613803576138036138c0565b500390565b60005b8381101561382357818101518382015260200161380b565b83811115612acd5750506000910152565b600181811c9082168061384857607f821691505b6020821081141561386957634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415613887576138876138c0565b6001019392505050565b60006000198214156138a5576138a56138c0565b5060010190565b6000826138bb576138bb6138d6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610b2457600080fdfea26469706673582212209e57b7c0becd01f9eee52b9ec16f8d54acd9502ad88cce4fdee90be04a4f37d764736f6c63430008070033000000000000000000000000b84088e1e917e64ff947b4da002d4e2dd4bfc4ab

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102a05760003560e01c80636c0360eb11610167578063b88d4fde116100ce578063c87b56dd11610087578063c87b56dd14610605578063cab8fa2214610618578063da3ef23f1461062b578063e985e9c51461063e578063f2fde38b1461067a578063f851a4401461068d57600080fd5b8063b88d4fde146105a9578063bd32fb66146105bc578063be01ac8b146105cf578063c58e5be8146105d7578063c5b3d078146105ea578063c6682862146105fd57600080fd5b80638da5cb5b116101205780638da5cb5b1461054e578063915ee6e91461055f57806395d89b4114610572578063a22cb4651461057a578063a697fe311461058d578063aa98e0c6146105a057600080fd5b80636c0360eb146104df578063704b6c02146104e757806370a08231146104fa57806370b5ae9c1461050d578063715018a61461052057806386481d401461052857600080fd5b80633c4c51c91161020b5780634c7bce6b116101c45780634c7bce6b1461046e5780634f6ccce71461048157806355f804b3146104945780635c975abb146104a75780635f1aca81146104b95780636352211e146104cc57600080fd5b80633c4c51c9146103f757806342842e0e146103ff57806344944f311461041257806346c22429146104355780634830dfa51461044857806348c3b2471461045b57600080fd5b80631394818e1161025d5780631394818e1461039a57806316c38b3c146103ad57806318160ddd146103c057806323b872dd146103c85780632f745c59146103db578063314ca039146103ee57600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063081812fc146102e2578063095ea7b31461030d5780630cc670fa1461032257806310ff8e3114610343575b600080fd5b6102b86102b3366004613209565b61069e565b60405190151581526020015b60405180910390f35b6102d56106c9565b6040516102c49190613474565b6102f56102f03660046131f0565b61075b565b6040516001600160a01b0390911681526020016102c4565b61032061031b366004613169565b6107e8565b005b610335610330366004613193565b6108fe565b6040519081526020016102c4565b6103786103513660046131f0565b600e6020526000908152604090205461ffff8116906201000090046001600160f01b031682565b6040805161ffff90931683526001600160f01b039091166020830152016102c4565b6103206103a83660046131f0565b6109a4565b6103206103bb3660046131d5565b610ad7565b600254610335565b6103206103d6366004613087565b610b2f565b6103356103e9366004613169565b610ba9565b610335600a5481565b6102d5610c5c565b61032061040d366004613087565b610c8d565b6102b8610420366004613039565b60096020526000908152604090205460ff1681565b610320610443366004613169565b610ca8565b6103356104563660046132f8565b610dfb565b6103206104693660046131f0565b610ec0565b61032061047c3660046132f8565b611124565b61033561048f3660046131f0565b6114e4565b6103206104a2366004613243565b611551565b600654600160a01b900460ff166102b8565b6103206104c73660046131d5565b6115a7565b6102f56104da3660046131f0565b6115fc565b6102d5611690565b6103206104f5366004613039565b61171e565b610335610508366004613039565b6117bc565b61032061051b3660046132a5565b61188a565b610320611c1e565b61053b6105363660046131f0565b611c54565b60405161ffff90911681526020016102c4565b6005546001600160a01b03166102f5565b600f546102f5906001600160a01b031681565b6102d5611cb9565b61032061058836600461313f565b611cc8565b61032061059b366004613039565b611d8d565b61033560085481565b6103206105b73660046130c3565b611dee565b6103206105ca3660046131f0565b611e6a565b610320611eae565b6103206105e53660046131f0565b611eec565b6103206105f8366004613193565b611f30565b6102d56121f1565b6102d56106133660046131f0565b6121fe565b6103356106263660046131f0565b6122a2565b610320610639366004613243565b6123ca565b6102b861064c366004613054565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b610320610688366004613039565b61241c565b6006546001600160a01b03166102f5565b60006001600160e01b0319821663780e9d6360e01b14806106c357506106c3826124ba565b92915050565b6060600080546106d890613834565b80601f016020809104026020016040519081016040528092919081815260200182805461070490613834565b80156107515780601f1061072657610100808354040283529160200191610751565b820191906000526020600020905b81548152906001019060200180831161073457829003601f168201915b5050505050905090565b60006107668261250a565b6107cc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600360205260409020546001600160a01b031690565b60006107f3826115fc565b9050806001600160a01b0316836001600160a01b031614156108615760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016107c3565b336001600160a01b038216148061087d575061087d813361064c565b6108ef5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016107c3565b6108f98383612554565b505050565b600080808361094f5760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e6e6f74207061737320616e20656d707479206172726179000060448201526064016107c3565b60005b8481101561099b5761097b86868381811061096f5761096f6138ec565b905060200201356122a2565b925061098783836136bb565b91508061099381613891565b915050610952565b50949350505050565b6005546001600160a01b03163314806109c757506006546001600160a01b031633145b6109e35760405162461bcd60e51b81526004016107c390613632565b600a5442908110610a5c5760405162461bcd60e51b815260206004820152603860248201527f7969656c64456e6454696d652063616e2774206265206368616e676564206f6e60448201527f63652074686520656e642074696d65206861732070617374000000000000000060648201526084016107c3565b818110610ad15760405162461bcd60e51b815260206004820152603860248201527f7969656c64456e6454696d652063616e206f6e6c79206265206368616e67656460448201527f20746f20612074696d6520696e2074686520667574757265000000000000000060648201526084016107c3565b50600a55565b6005546001600160a01b0316331480610afa57506006546001600160a01b031633145b610b165760405162461bcd60e51b81526004016107c390613632565b8015610b2757610b246125c2565b50565b610b24612644565b60026007541415610b525760405162461bcd60e51b81526004016107c390613684565b60026007556000818152600e602052604090205442620100009091046001600160f01b031610610b945760405162461bcd60e51b81526004016107c390613597565b610b9f8383836126c8565b5050600160075550565b6000610bb4836117bc565b8210610bd25760405162461bcd60e51b81526004016107c390613487565b6000805b600254811015610c435760028181548110610bf357610bf36138ec565b6000918252602090912001546001600160a01b0386811691161415610c315783821415610c235791506106c39050565b81610c2d81613891565b9250505b80610c3b81613891565b915050610bd6565b5060405162461bcd60e51b81526004016107c390613487565b6060610c69600d546126f9565b604051602001610c799190613413565b604051602081830303815290604052905090565b6108f983838360405180602001604052806000815250611dee565b6005546001600160a01b03163314610cd25760405162461bcd60e51b81526004016107c390613524565b60025461056e610ce283836136bb565b1115610d265760405162461bcd60e51b815260206004820152601360248201527222bc31b2b2b2399036b0bc1039bab838363c9760691b60448201526064016107c3565b60005b82811015610db35760408051808201909152600181526001600160f01b0342166020820152600e6000610d5c84866136bb565b8152602080820192909252604001600020825192909101516001600160f01b0316620100000261ffff909216919091179055610da184610d9c83856136bb565b6127ff565b80610dab81613891565b915050610d29565b50604080516001600160a01b0385168152602081018490527fe679db040ba59b1f69e7f641211c64f95375b7e16597440a91e56e56e71104f2910160405180910390a1505050565b6000828152600e6020526040812054819061ffff165b838161ffff161015610eb8578061ffff1660011415610e4357610e3c676124fee993bc0000836136bb565b9150610ea6565b8061ffff1660021415610e6357610e3c6801e5b8fa8fe2ac0000836136bb565b8061ffff1660031415610e8357610e3c6812f939c99edab80000836136bb565b8061ffff1660041415610ea657610ea368a2a15d09519be00000836136bb565b91505b80610eb08161386f565b915050610e11565b509392505050565b600654600160a01b900460ff1615610eea5760405162461bcd60e51b81526004016107c39061356d565b600654600160a81b900460ff16610f3c5760405162461bcd60e51b815260206004820152601660248201527514d958dc995d08155b9b1bd8dac8111a5cd8589b195960521b60448201526064016107c3565b60026007541415610f5f5760405162461bcd60e51b81526004016107c390613684565b6002600755610f6d816115fc565b6001600160a01b0316336001600160a01b031614610fbf5760405162461bcd60e51b815260206004820152600f60248201526e4e6f7420796f75722064657669636560881b60448201526064016107c3565b600a5442116110035760405162461bcd60e51b815260206004820152601060248201526f446576696365206e6f7420726561647960801b60448201526064016107c3565b6000818152600e60205260409020805461ffff166005146110715760405162461bcd60e51b815260206004820152602260248201527f4d757374206265206c6576656c203520746f20756e6c6f636b20612064657669604482015261636560f01b60648201526084016107c3565b600061107c836122a2565b825461ffff1916600617835590508015610b9f57815461ffff1662010000426001600160f01b031602178255600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561110257600080fd5b505af1158015611116573d6000803e3d6000fd5b505050505050600160075550565b600654600160a01b900460ff161561114e5760405162461bcd60e51b81526004016107c39061356d565b600260075414156111715760405162461bcd60e51b81526004016107c390613684565b600260075561117f826115fc565b6001600160a01b0316336001600160a01b0316146111d15760405162461bcd60e51b815260206004820152600f60248201526e4e4f5420594f55522044455649434560881b60448201526064016107c3565b6000828152600e60205260409020805461ffff1682116112285760405162461bcd60e51b81526020600482015260126024820152714d75737420626520616e207570677261646560701b60448201526064016107c3565b6006821061126f5760405162461bcd60e51b81526020600482015260146024820152734d6178206b6e6f776e206c6576656c206973203560601b60448201526064016107c3565b600061127a846122a2565b9050801561130d57815461ffff1662010000426001600160f01b031602178255600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b505050505b81546000906113209061ffff168561287b565b600f5490915081906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae919061328c565b1161140f5760405162461bcd60e51b815260206004820152602b60248201527f596f7520646f206e6f74206861766520656e6f756768204d414720666f72207460448201526a686973207570677261646560a81b60648201526084016107c3565b600f546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561146957600080fd5b505af115801561147d573d6000803e3d6000fd5b5050845461ffff191661ffff8716178555505060408051338152602081018790528082018690526060810184905290517f5bd44927bb6f69e7fbbca757c673a4b5b2ccae7f2382208157a95f598a0564f8916080908290030190a150506001600755505050565b600254600090821061154d5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016107c3565b5090565b6005546001600160a01b031633148061157457506006546001600160a01b031633145b6115905760405162461bcd60e51b81526004016107c390613632565b80516115a390600b906020840190612ebb565b5050565b6005546001600160a01b03163314806115ca57506006546001600160a01b031633145b6115e65760405162461bcd60e51b81526004016107c390613632565b80156115f457610b24612919565b610b24612980565b60025460009082106116625760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016107c3565b60028281548110611675576116756138ec565b6000918252602090912001546001600160a01b031692915050565b600b805461169d90613834565b80601f01602080910402602001604051908101604052809291908181526020018280546116c990613834565b80156117165780601f106116eb57610100808354040283529160200191611716565b820191906000526020600020905b8154815290600101906020018083116116f957829003601f168201915b505050505081565b6005546001600160a01b031633146117485760405162461bcd60e51b81526004016107c390613524565b6001600160a01b0381166117b35760405162461bcd60e51b815260206004820152602c60248201527f4f776e61626c653a206e65772061646d696e2063616e2774206265207468652060448201526b7a65726f206164647265737360a01b60648201526084016107c3565b610b24816129e1565b60006001600160a01b0382166118275760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016107c3565b6000805b6002548110156118835760028181548110611848576118486138ec565b6000918252602090912001546001600160a01b03858116911614156118735761187082613891565b91505b61187c81613891565b905061182b565b5092915050565b600654600160a01b900460ff16156118b45760405162461bcd60e51b81526004016107c39061356d565b600260075414156118d75760405162461bcd60e51b81526004016107c390613684565b600260078190555461056e6118ec86836136bb565b111561192f5760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b60448201526064016107c3565b6000851161198f5760405162461bcd60e51b815260206004820152602760248201527f596f75206d75737420636c61696d20616e20616d6f756e7420677265617465726044820152660207468616e20360cc1b60648201526084016107c3565b818511156119ee5760405162461bcd60e51b815260206004820152602660248201527f596f752063616e74206d696e74206d6f7265207468616e20796f757220616c6c6044820152656f77616e636560d01b60648201526084016107c3565b6040516bffffffffffffffffffffffff193360601b16602082015260348101839052600090605401604051602081830303815290604052805190602001209050611a6f858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506008549150849050612a33565b611ac75760405162461bcd60e51b815260206004820152602360248201527f496e76616c6964204d65726b6c6520547265652070726f6f6620737570706c6960448201526232b21760e91b60648201526084016107c3565b3360009081526009602052604090205460ff1615611b275760405162461bcd60e51b815260206004820181905260248201527f596f75206861766520616c726561647920636c61696d6564206465766963657360448201526064016107c3565b336000908152600960205260408120805460ff191660011790555b86811015611bcd5760408051808201909152600181526001600160f01b0342166020820152600e6000611b7584876136bb565b8152602080820192909252604001600020825192909101516001600160f01b0316620100000261ffff909216919091179055611bbb611bb13390565b610d9c83866136bb565b80611bc581613891565b915050611b42565b507fe679db040ba59b1f69e7f641211c64f95375b7e16597440a91e56e56e71104f233604080516001600160a01b039092168252602082018990520160405180910390a15050600160075550505050565b6005546001600160a01b03163314611c485760405162461bcd60e51b81526004016107c390613524565b611c526000612a49565b565b6000611c5f8261250a565b611ca25760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016107c3565b506000908152600e602052604090205461ffff1690565b6060600180546106d890613834565b6001600160a01b038216331415611d215760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016107c3565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6005546001600160a01b0316331480611db057506006546001600160a01b031633145b611dcc5760405162461bcd60e51b81526004016107c390613632565b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60026007541415611e115760405162461bcd60e51b81526004016107c390613684565b60026007556000828152600e602052604090205442620100009091046001600160f01b031610611e535760405162461bcd60e51b81526004016107c390613597565b611e5f84848484612a9b565b505060016007555050565b6005546001600160a01b0316331480611e8d57506006546001600160a01b031633145b611ea95760405162461bcd60e51b81526004016107c390613632565b600855565b6005546001600160a01b03163314611ed85760405162461bcd60e51b81526004016107c390613524565b611ee26000612a49565b611c5260006129e1565b6005546001600160a01b0316331480611f0f57506006546001600160a01b031633145b611f2b5760405162461bcd60e51b81526004016107c390613632565b600d55565b600654600160a01b900460ff1615611f5a5760405162461bcd60e51b81526004016107c39061356d565b60026007541415611f7d5760405162461bcd60e51b81526004016107c390613684565b600260075560008082611fd25760405162461bcd60e51b815260206004820152601e60248201527f596f752063616e6e6f74207061737320616e20656d707479206172726179000060448201526064016107c3565b60005b838110156121305733611fff868684818110611ff357611ff36138ec565b905060200201356115fc565b6001600160a01b03161461204a5760405162461bcd60e51b81526020600482015260126024820152714e4f5420594f55522044455649434528532960701b60448201526064016107c3565b61205f85858381811061096f5761096f6138ec565b92506000600e6000878785818110612079576120796138ec565b60209081029290920135835250810191909152604001600020805461ffff1662010000426001600160f01b03160217815590507fe8a6ce7e6a997a08ef9e7e8d523c86cba031ffa80ed979876264e1ba1435c09b338787858181106120e0576120e06138ec565b604080516001600160a01b039095168552602091820293909301359084015250810186905260600160405180910390a161211a84846136bb565b925050808061212890613891565b915050611fd5565b50600081116121745760405162461bcd60e51b815260206004820152601060248201526f4e4f204d414720415641494c41424c4560801b60448201526064016107c3565b600f546001600160a01b03166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b1580156121ce57600080fd5b505af11580156121e2573d6000803e3d6000fd5b50506001600755505050505050565b600c805461169d90613834565b60606122098261250a565b61226d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084016107c3565b600b612278836126f9565b600c60405160200161228c939291906133e0565b6040516020818303038152906040529050919050565b60006122ad8261250a565b6122f05760405162461bcd60e51b8152602060048201526014602482015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b60448201526064016107c3565b6000828152600e602090815260409182902082518084019093525461ffff811683526201000090046001600160f01b031690820152600a5442908111156123365750600a545b8082602001516001600160f01b03161115612355575060009392505050565b600082602001516001600160f01b03168261237091906137f1565b90506000620151806001856000015161ffff1661238d91906137f1565b61239890600261372a565b6123aa90670de0b6b3a76400006137d2565b6123b491906136d3565b90506123c082826137d2565b9695505050505050565b6005546001600160a01b03163314806123ed57506006546001600160a01b031633145b6124095760405162461bcd60e51b81526004016107c390613632565b80516115a390600c906020840190612ebb565b6005546001600160a01b031633146124465760405162461bcd60e51b81526004016107c390613524565b6001600160a01b0381166124b15760405162461bcd60e51b815260206004820152602c60248201527f4f776e61626c653a206e6577206f776e65722063616e2774206265207468652060448201526b7a65726f206164647265737360a01b60648201526084016107c3565b610b2481612a49565b60006001600160e01b031982166380ac58cd60e01b14806124eb57506001600160e01b03198216635b5e139f60e01b145b806106c357506301ffc9a760e01b6001600160e01b03198316146106c3565b600254600090821080156106c3575060006001600160a01b031660028381548110612537576125376138ec565b6000918252602090912001546001600160a01b0316141592915050565b600081815260036020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612589826115fc565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600654600160a01b900460ff16156125ec5760405162461bcd60e51b81526004016107c39061356d565b6006805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586126273390565b6040516001600160a01b03909116815260200160405180910390a1565b600654600160a01b900460ff166126945760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107c3565b6006805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33612627565b6126d23382612ad3565b6126ee5760405162461bcd60e51b81526004016107c3906135e1565b6108f9838383612bb9565b60608161271d5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612747578061273181613891565b91506127409050600a836136d3565b9150612721565b60008167ffffffffffffffff81111561276257612762613902565b6040519080825280601f01601f19166020018201604052801561278c576020820181803683370190505b5090505b84156127f7576127a16001836137f1565b91506127ae600a866138ac565b6127b99060306136bb565b60f81b8183815181106127ce576127ce6138ec565b60200101906001600160f81b031916908160001a9053506127f0600a866136d3565b9450612790565b949350505050565b6002805460018101825560009182527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000805b828410156129125783600114156128a9576128a2676124fee993bc0000826136bb565b9050612900565b83600214156128c5576128a26801e5b8fa8fe2ac0000826136bb565b83600314156128e1576128a26812f939c99edab80000826136bb565b8360041415612900576128fd68a2a15d09519be00000826136bb565b90505b8361290a81613891565b94505061287f565b9392505050565b600654600160a81b900460ff161561296b5760405162461bcd60e51b815260206004820152601560248201527414d958dc995d08155b9b1bd8dac8115b98589b1959605a1b60448201526064016107c3565b6006805460ff60a81b1916600160a81b179055565b600654600160a81b900460ff166129d25760405162461bcd60e51b815260206004820152601660248201527514d958dc995d08155b9b1bd8dac8111a5cd8589b195960521b60448201526064016107c3565b6006805460ff60a81b19169055565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc90600090a35050565b600082612a408584612d0f565b14949350505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612aa53383612ad3565b612ac15760405162461bcd60e51b81526004016107c3906135e1565b612acd84848484612d7b565b50505050565b6000612ade8261250a565b612b3f5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016107c3565b6000612b4a836115fc565b9050806001600160a01b0316846001600160a01b03161480612b855750836001600160a01b0316612b7a8461075b565b6001600160a01b0316145b806127f757506001600160a01b0380821660009081526004602090815260408083209388168352929052205460ff166127f7565b826001600160a01b0316612bcc826115fc565b6001600160a01b031614612c345760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b60648201526084016107c3565b6001600160a01b038216612c965760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016107c3565b612ca1600082612554565b8160028281548110612cb557612cb56138ec565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b600081815b8451811015610eb8576000858281518110612d3157612d316138ec565b60200260200101519050808311612d575760008381526020829052604090209250612d68565b600081815260208490526040902092505b5080612d7381613891565b915050612d14565b612d86848484612bb9565b612d9284848484612dae565b612acd5760405162461bcd60e51b81526004016107c3906134d2565b60006001600160a01b0384163b15612eb057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612df2903390899088908890600401613441565b602060405180830381600087803b158015612e0c57600080fd5b505af1925050508015612e3c575060408051601f3d908101601f19168201909252612e3991810190613226565b60015b612e96573d808015612e6a576040519150601f19603f3d011682016040523d82523d6000602084013e612e6f565b606091505b508051612e8e5760405162461bcd60e51b81526004016107c3906134d2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127f7565b506001949350505050565b828054612ec790613834565b90600052602060002090601f016020900481019282612ee95760008555612f2f565b82601f10612f0257805160ff1916838001178555612f2f565b82800160010185558215612f2f579182015b82811115612f2f578251825591602001919060010190612f14565b5061154d9291505b8082111561154d5760008155600101612f37565b600067ffffffffffffffff80841115612f6657612f66613902565b604051601f8501601f19908116603f01168101908282118183101715612f8e57612f8e613902565b81604052809350858152868686011115612fa757600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114612fd857600080fd5b919050565b60008083601f840112612fef57600080fd5b50813567ffffffffffffffff81111561300757600080fd5b6020830191508360208260051b850101111561302257600080fd5b9250929050565b80358015158114612fd857600080fd5b60006020828403121561304b57600080fd5b61291282612fc1565b6000806040838503121561306757600080fd5b61307083612fc1565b915061307e60208401612fc1565b90509250929050565b60008060006060848603121561309c57600080fd5b6130a584612fc1565b92506130b360208501612fc1565b9150604084013590509250925092565b600080600080608085870312156130d957600080fd5b6130e285612fc1565b93506130f060208601612fc1565b925060408501359150606085013567ffffffffffffffff81111561311357600080fd5b8501601f8101871361312457600080fd5b61313387823560208401612f4b565b91505092959194509250565b6000806040838503121561315257600080fd5b61315b83612fc1565b915061307e60208401613029565b6000806040838503121561317c57600080fd5b61318583612fc1565b946020939093013593505050565b600080602083850312156131a657600080fd5b823567ffffffffffffffff8111156131bd57600080fd5b6131c985828601612fdd565b90969095509350505050565b6000602082840312156131e757600080fd5b61291282613029565b60006020828403121561320257600080fd5b5035919050565b60006020828403121561321b57600080fd5b813561291281613918565b60006020828403121561323857600080fd5b815161291281613918565b60006020828403121561325557600080fd5b813567ffffffffffffffff81111561326c57600080fd5b8201601f8101841361327d57600080fd5b6127f784823560208401612f4b565b60006020828403121561329e57600080fd5b5051919050565b600080600080606085870312156132bb57600080fd5b84359350602085013567ffffffffffffffff8111156132d957600080fd5b6132e587828801612fdd565b9598909750949560400135949350505050565b6000806040838503121561330b57600080fd5b50508035926020909101359150565b60008151808452613332816020860160208601613808565b601f01601f19169290920160200192915050565b8054600090600181811c908083168061336057607f831692505b602080841082141561338257634e487b7160e01b600052602260045260246000fd5b81801561339657600181146133a7576133d4565b60ff198616895284890196506133d4565b60008881526020902060005b868110156133cc5781548b8201529085019083016133b3565b505084890196505b50505050505092915050565b60006133ec8286613346565b84516133fc818360208901613808565b61340881830186613346565b979650505050505050565b654c696e65202360d01b815260008251613434816006850160208701613808565b9190910160060192915050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906123c09083018461331a565b602081526000612912602083018461331a565b6020808252602b908201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560408201526a74206f6620626f756e647360a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526029908201527f4f776e61626c655769746841646d696e3a2063616c6c6572206973206e6f74206040820152683a34329037bbb732b960b91b606082015260800190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252602a908201527f43616e6e6f7420636c61696d20696d6d6564696174656c79206265666f72652060408201526930903a3930b739b332b960b11b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526032908201527f4f776e61626c655769746841646d696e3a2063616c6c6572206973206e6f74206040820152713a34329037bbb732b91037b91030b236b4b760711b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600082198211156136ce576136ce6138c0565b500190565b6000826136e2576136e26138d6565b500490565b600181815b80851115613722578160001904821115613708576137086138c0565b8085161561371557918102915b93841c93908002906136ec565b509250929050565b60006129128383600082613740575060016106c3565b8161374d575060006106c3565b8160018114613763576002811461376d57613789565b60019150506106c3565b60ff84111561377e5761377e6138c0565b50506001821b6106c3565b5060208310610133831016604e8410600b84101617156137ac575081810a6106c3565b6137b683836136e7565b80600019048211156137ca576137ca6138c0565b029392505050565b60008160001904831182151516156137ec576137ec6138c0565b500290565b600082821015613803576138036138c0565b500390565b60005b8381101561382357818101518382015260200161380b565b83811115612acd5750506000910152565b600181811c9082168061384857607f821691505b6020821081141561386957634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415613887576138876138c0565b6001019392505050565b60006000198214156138a5576138a56138c0565b5060010190565b6000826138bb576138bb6138d6565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b031981168114610b2457600080fdfea26469706673582212209e57b7c0becd01f9eee52b9ec16f8d54acd9502ad88cce4fdee90be04a4f37d764736f6c63430008070033

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

000000000000000000000000b84088e1e917e64ff947b4da002d4e2dd4bfc4ab

-----Decoded View---------------
Arg [0] : _magnesium (address): 0xb84088E1E917E64Ff947B4Da002D4e2dd4BfC4Ab

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b84088e1e917e64ff947b4da002d4e2dd4bfc4ab


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.