Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xABeA2710271E7294dffE6a02B90489309a9AfA8e
Balance 0.000000000 ETH
Nonce 1
Code Size 4675 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4675 bytes
0x6080604052600436106101355760003560e01c80639d3da28a116100ab578063c03afb591161006f578063c03afb5914610344578063e8a528c814610364578063eba145eb14610377578063f2fde38b14610397578063fc0c546a146103b7578063febced5d146103d757600080fd5b80639d3da28a146102b4578063a3477d1b146102ca578063afc3cb49146102dd578063b1c9fe6e146102fd578063ba5feb261461032457600080fd5b80633ccfd60b116100fd5780633ccfd60b146102025780634d1555611461020a57806350008e4a146102205780635e52f06a14610261578063715018a6146102815780638da5cb5b1461029657600080fd5b806307f0bac11461013a5780631133d2fa1461017d578063163999a61461019f578063339860c1146101bf57806335a05ad5146101d5575b600080fd5b34801561014657600080fd5b50610167610155366004610b2e565b60036020526000908152604090205481565b6040516101749190610b5f565b60405180910390f35b34801561018957600080fd5b5061019d610198366004610b7e565b6103fc565b005b3480156101ab57600080fd5b5061019d6101ba366004610d17565b610409565b3480156101cb57600080fd5b5061016760065481565b3480156101e157600080fd5b506101f56101f0366004610b7e565b610504565b6040516101749190610d92565b61019d61052e565b34801561021657600080fd5b5061016760075481565b34801561022c57600080fd5b506102547f0000000000000000000000003bc86b35ed7d617498da6f8dc351d71749dc595a81565b6040516101749190610dbf565b34801561026d57600080fd5b5061019d61027c366004610de1565b610541565b34801561028d57600080fd5b5061019d61056b565b3480156102a257600080fd5b506000546001600160a01b03166101f5565b3480156102c057600080fd5b5061016760055481565b6101676102d8366004610e02565b61057d565b3480156102e957600080fd5b5061019d6102f8366004610b7e565b610593565b34801561030957600080fd5b506008546103179060ff1681565b6040516101749190610e79565b34801561033057600080fd5b5061019d61033f366004610b7e565b6105a0565b34801561035057600080fd5b5061019d61035f366004610e9f565b6105ad565b610167610372366004610ec0565b6105dc565b34801561038357600080fd5b5061019d610392366004610b2e565b61087e565b3480156103a357600080fd5b5061019d6103b2366004610b2e565b6108ae565b3480156103c357600080fd5b50600154610254906001600160a01b031681565b3480156103e357600080fd5b506008546101f59061010090046001600160a01b031681565b6104046108e8565b600655565b6104116108e8565b805182511461043b5760405162461bcd60e51b815260040161043290610f3c565b60405180910390fd5b815161044e906002906020850190610a84565b50600060048190555b82518110156104ff5781818151811061047257610472610f4c565b60200260200101516003600085848151811061049057610490610f4c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508181815181106104ce576104ce610f4c565b6020026020010151600460008282546104e79190610f78565b909155508190506104f781610f8b565b915050610457565b505050565b6002818154811061051457600080fd5b6000918252602090912001546001600160a01b0316905081565b6105366108e8565b61053f47610912565b565b6105496108e8565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6105736108e8565b61053f60006109c1565b600061058a8383336105dc565b90505b92915050565b61059b6108e8565b600755565b6105a86108e8565b600555565b6105b56108e8565b6008805482919060ff191660018360028111156105d4576105d4610e35565b021790555050565b60008060085460ff1660028111156105f6576105f6610e35565b036106135760405162461bcd60e51b815260040161043290610fc7565b600160085460ff16600281111561062c5761062c610e35565b036106de576040516370a0823160e01b81526000906001600160a01b037f0000000000000000000000003bc86b35ed7d617498da6f8dc351d71749dc595a16906370a0823190610680903390600401610d92565b602060405180830381865afa15801561069d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c19190610fe2565b116106de5760405162461bcd60e51b815260040161043290611035565b600754600154604080516304b0bc6160e51b8152905186926001600160a01b0316916396178c2091600480830192602092919082900301816000875af115801561072c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107509190610fe2565b61075a9190610f78565b11156107785760405162461bcd60e51b81526004016104329061106d565b60008460000361078b5750600654610790565b506005545b61079a848261107d565b3410156107b95760405162461bcd60e51b8152600401610432906110c6565b6001546040516306ff7eaf60e31b81526001600160a01b03909116906337fbf578906107ed908690899089906004016110d6565b6020604051808303816000875af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108309190610fe2565b915061083b34610912565b7f2fe12938c13ec72b32a79334e19b236fff49d12ce10bc75c28554dd13452537285858560405161086e939291906110fe565b60405180910390a1509392505050565b6108866108e8565b600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6108b66108e8565b6001600160a01b0381166108dc5760405162461bcd60e51b815260040161043290611126565b6108e5816109c1565b50565b6000546001600160a01b0316331461053f5760405162461bcd60e51b8152600401610432906111a0565b60005b6002548110156109bd576109ab6002828154811061093557610935610f4c565b9060005260206000200160009054906101000a90046001600160a01b0316600454600360006002868154811061096d5761096d610f4c565b60009182526020808320909101546001600160a01b0316835282019290925260400190205461099c908661107d565b6109a691906111c6565b610a11565b806109b581610f8b565b915050610915565b5050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610a5e576040519150601f19603f3d011682016040523d82523d6000602084013e610a63565b606091505b50509050806104ff5760405162461bcd60e51b8152600401610432906111fd565b828054828255906000526020600020908101928215610ad9579160200282015b82811115610ad957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610aa4565b50610ae5929150610ae9565b5090565b5b80821115610ae55760008155600101610aea565b60006001600160a01b03821661058d565b610b1881610afe565b81146108e557600080fd5b803561058d81610b0f565b600060208284031215610b4357610b43600080fd5b6000610b4f8484610b23565b949350505050565b805b82525050565b6020810161058d8284610b57565b80610b18565b803561058d81610b6d565b600060208284031215610b9357610b93600080fd5b6000610b4f8484610b73565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715610bdb57610bdb610b9f565b6040525050565b6000610bed60405190565b9050610bf98282610bb5565b919050565b600067ffffffffffffffff821115610c1857610c18610b9f565b5060209081020190565b6000610c35610c3084610bfe565b610be2565b83815290506020808201908402830185811115610c5457610c54600080fd5b835b81811015610c7657610c688782610b23565b835260209283019201610c56565b5050509392505050565b600082601f830112610c9457610c94600080fd5b8135610b4f848260208601610c22565b6000610cb2610c3084610bfe565b83815290506020808201908402830185811115610cd157610cd1600080fd5b835b81811015610c7657610ce58782610b73565b835260209283019201610cd3565b600082601f830112610d0757610d07600080fd5b8135610b4f848260208601610ca4565b60008060408385031215610d2d57610d2d600080fd5b823567ffffffffffffffff811115610d4757610d47600080fd5b610d5385828601610c80565b925050602083013567ffffffffffffffff811115610d7357610d73600080fd5b610d7f85828601610cf3565b9150509250929050565b610b5981610afe565b6020810161058d8284610d89565b600061058d82610afe565b600061058d82610da0565b610b5981610dab565b6020810161058d8284610db6565b610b1881610da0565b803561058d81610dcd565b600060208284031215610df657610df6600080fd5b6000610b4f8484610dd6565b60008060408385031215610e1857610e18600080fd5b6000610e248585610b73565b9250506020610d7f85828601610b73565b634e487b7160e01b600052602160045260246000fd5b600381106108e5576108e5610e35565b80610bf981610e4b565b600061058d82610e5b565b610b5981610e65565b6020810161058d8284610e70565b600381106108e557600080fd5b803561058d81610e87565b600060208284031215610eb457610eb4600080fd5b6000610b4f8484610e94565b600080600060608486031215610ed857610ed8600080fd5b6000610ee48686610b73565b9350506020610ef586828701610b73565b9250506040610f0686828701610b23565b9150509250925092565b601581526020810174092dcecc2d8d2c84082e4e4c2f2e640d8cadccee8d605b1b815290505b60200190565b6020808252810161058d81610f10565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561058d5761058d610f62565b600060018201610f9d57610f9d610f62565b5060010190565b600e8152602081016d14d85b19481a5cc81b1bd8dad95960921b81529050610f36565b6020808252810161058d81610fa4565b805161058d81610b6d565b600060208284031215610ff757610ff7600080fd5b6000610b4f8484610fd7565b60198152602081017f546f6b656e4761746520746f6b656e206973206e65656465640000000000000081529050610f36565b6020808252810161058d81611003565b60138152602081017213dd995c881d1a19481b5a5b9d081b1a5b5a5d606a1b81529050610f36565b6020808252810161058d81611045565b818102811582820484141761058d5761058d610f62565b60188152602081017f4d7573742073656e6420746865206d696e74207072696365000000000000000081529050610f36565b6020808252810161058d81611094565b606081016110e48286610d89565b6110f16020830185610b57565b610b4f6040830184610b57565b6060810161110c8286610b57565b6111196020830185610b57565b610b4f6040830184610d89565b6020808252810161058d81602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152610f36565b6020808252810161058d81611170565b634e487b7160e01b600052601260045260246000fd5b6000826111d5576111d56111b0565b500490565b600e8152602081016d11985a5b1959081d1bc81cd95b9960921b81529050610f36565b6020808252810161058d816111da56fea26469706673582212202d0e17e24f47685e2972904095f55fd5055bf8855fc6242c4abb26483c00a99a64736f6c63430008110033

Verified Source Code Full Match

Compiler: v0.8.17+commit.8df45f5f EVM: london
ITokenGate.sol 12 lines
// SPDX-License-Identifier: MIT

/*
 * Created by Satoshi Nakajima (@snakajima)
 */

pragma solidity ^0.8.6;

interface ITokenGate {
  // Intentially same as ERC721's balanceOf
  function balanceOf(address _wallet) external view returns (uint256 balance);
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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;
    }
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/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 Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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 is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
LocalNounsMinter2.sol 145 lines
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for NounsSeeder

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.6;

import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol';
import './interfaces/ILocalNounsToken.sol';
import '../interfaces/ITokenGate.sol';

contract LocalNounsMinter2 is Ownable {
  // Fires when the purchase executed
  event MintSelectedPrefecture(uint256 prefectureId, uint256 amount, address minter);

  ILocalNounsToken public token;
  ITokenGate public immutable tokenGate;
  
  address[] public royaltyAddresses; // ロイヤリティ送信先ウォレット
  mapping(address => uint256) public royaltyRatio; // ロイヤリティ送信先ウォレットごとの割合
  uint256 royaltyRatioTotal; // royaltyRatioの合計(割戻用)

  uint256 public mintPriceForSpecified = 0.03 ether;
  uint256 public mintPriceForNotSpecified = 0.01 ether;

  uint256 public mintMax = 1500;

  enum SalePhase {
    Locked,
    PreSale,
    PublicSale
  }

  SalePhase public phase = SalePhase.PublicSale; // セールフェーズ

  address public administratorsAddress; // 運営ウォレット

  constructor(ILocalNounsToken _token, ITokenGate _tokenGate) {
    token = _token;
    administratorsAddress = msg.sender;
    tokenGate = _tokenGate;

    // ロイヤリティ送信先(コンストラクタではデプロイアドレス100%)
    royaltyAddresses = [msg.sender];
    royaltyRatio[msg.sender] = 1;
    royaltyRatioTotal = 1;
  }

  function setMintMax(uint256 _mintMax) external onlyOwner {
    mintMax = _mintMax;
  }

  function setLocalNounsToken(ILocalNounsToken _token) external onlyOwner {
    token = _token;
  }

  function setMintPriceForSpecified(uint256 _price) external onlyOwner {
    mintPriceForSpecified = _price;
  }

  function setMintPriceForNotSpecified(uint256 _price) external onlyOwner {
    mintPriceForNotSpecified = _price;
  }

  function setPhase(SalePhase _phase) external onlyOwner {
    phase = _phase;
  }

  function setAdministratorsAddress(address _admin) external onlyOwner {
    administratorsAddress = _admin;
  }

  function mintSelectedPrefecture(uint256 _prefectureId, uint256 _amount) public payable returns (uint256 tokenId) {
    return mintSelectedPrefecture2(_prefectureId, _amount, msg.sender);
  }

  function mintSelectedPrefecture2(
    uint256 _prefectureId,
    uint256 _amount,
    address _mintTo
  ) public payable returns (uint256 tokenId) {
    if (phase == SalePhase.Locked) {
      revert('Sale is locked');
    } else if (phase == SalePhase.PreSale) {
      require(tokenGate.balanceOf(msg.sender) > 0, 'TokenGate token is needed');
    }

    require(token.totalSupply2() + _amount <= mintMax, 'Over the mint limit');

    uint256 mintPrice;
    if (_prefectureId == 0) {
      mintPrice = mintPriceForNotSpecified;
    } else {
      mintPrice = mintPriceForSpecified;
    }
    require(msg.value >= mintPrice * _amount, 'Must send the mint price');

    tokenId = token.mintSelectedPrefecture(_mintTo, _prefectureId, _amount);

    _sendRoyalty(msg.value);

    emit MintSelectedPrefecture(_prefectureId, _amount, _mintTo);
  }

  function withdraw() external payable onlyOwner {
    _sendRoyalty(address(this).balance);
  }

  // send royalties to admin and developper
  function _sendRoyalty(uint _royalty) internal {
    for (uint256 i = 0; i < royaltyAddresses.length; i++) {
      _trySendRoyalty(royaltyAddresses[i], (_royalty * royaltyRatio[royaltyAddresses[i]]) / royaltyRatioTotal);
    }
  }

  function _trySendRoyalty(address to, uint amount) internal {
    (bool sent, ) = payable(to).call{ value: amount }('');
    require(sent, 'Failed to send');
  }

  function setRoyaltyAddresses(address[] memory _addr, uint256[] memory ratio) external onlyOwner {
    // 引数の整合性チェック
    require(_addr.length == ratio.length, 'Invalid Arrays length');
    royaltyAddresses = _addr;
    royaltyRatioTotal = 0;

    for (uint256 i = 0; i < _addr.length; i++) {
      royaltyRatio[_addr[i]] = ratio[i];
      royaltyRatioTotal += ratio[i];
    }
  }

}
ILocalNounsToken.sol 40 lines
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for NounsSeeder

/*********************************
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░██░░░████░░██░░░████░░░ *
 * ░░██████░░░████████░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░██░░██░░░████░░██░░░████░░░ *
 * ░░░░░░█████████░░█████████░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 * ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
 *********************************/

pragma solidity ^0.8.6;

interface ILocalNounsToken {
  function mintSelectedPrefecture(address to, uint256 prefectureId, uint256 _amount) external returns (uint256 tokenId);

  function setMinter(address _minter) external;

  // iLocalNounsTokenでERC721のtotalSupplyを使用したいけど、二重継承でエラーになるので個別関数を準備
  function totalSupply2() external returns (uint256);

  // Fires when the owner puts the trade
  event PutTradePrefecture(uint256 indexed tokenId, uint256[] _prefectures, address _tradeAddress);

  // Fires when the owner cancel the trade
  event CancelTradePrefecture(uint256 indexed tokenId);

  // Fires when the purchase executed
  event Purchase(uint256 indexed tokenId, address _buyer);

  // Fires when the trade executed
  event ExecuteTrade(uint256 indexed targetTokenId, address _lister, uint256 indexed ownedTokenId, address _executer);

}

Read Contract

administratorsAddress 0xfebced5d → address
mintMax 0x4d155561 → uint256
mintPriceForNotSpecified 0x339860c1 → uint256
mintPriceForSpecified 0x9d3da28a → uint256
owner 0x8da5cb5b → address
phase 0xb1c9fe6e → uint8
royaltyAddresses 0x35a05ad5 → address
royaltyRatio 0x07f0bac1 → uint256
token 0xfc0c546a → address
tokenGate 0x50008e4a → address

Write Contract 12 functions

These functions modify contract state and require a wallet transaction to execute.

mintSelectedPrefecture 0xa3477d1b
uint256 _prefectureId
uint256 _amount
returns: uint256
mintSelectedPrefecture2 0xe8a528c8
uint256 _prefectureId
uint256 _amount
address _mintTo
returns: uint256
renounceOwnership 0x715018a6
No parameters
setAdministratorsAddress 0xeba145eb
address _admin
setLocalNounsToken 0x5e52f06a
address _token
setMintMax 0xafc3cb49
uint256 _mintMax
setMintPriceForNotSpecified 0x1133d2fa
uint256 _price
setMintPriceForSpecified 0xba5feb26
uint256 _price
setPhase 0xc03afb59
uint8 _phase
setRoyaltyAddresses 0x163999a6
address[] _addr
uint256[] ratio
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address