Source Code
Overview
ETH Balance
0.020979 ETH
Eth Value
$58.77 (@ $2,801.21/ETH)More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 28 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Mint | 23136234 | 164 days ago | IN | 0.000777 ETH | 0.0000613 | ||||
| Mint | 23060117 | 175 days ago | IN | 0.000777 ETH | 0.00005057 | ||||
| Mint | 23022190 | 180 days ago | IN | 0.000777 ETH | 0.00005242 | ||||
| Mint | 22289650 | 283 days ago | IN | 0.000777 ETH | 0.00002463 | ||||
| Mint | 22014388 | 321 days ago | IN | 0.000777 ETH | 0.00001728 | ||||
| Mint | 21747684 | 359 days ago | IN | 0.000777 ETH | 0.00008805 | ||||
| Mint | 20399825 | 547 days ago | IN | 0.000777 ETH | 0.00008788 | ||||
| Mint | 20311115 | 559 days ago | IN | 0.000777 ETH | 0.00008682 | ||||
| Mint | 20295707 | 561 days ago | IN | 0.000777 ETH | 0.00004114 | ||||
| Mint | 20288891 | 562 days ago | IN | 0.000777 ETH | 0.00008516 | ||||
| Mint | 20283197 | 563 days ago | IN | 0.000777 ETH | 0.00016762 | ||||
| Mint | 20263170 | 566 days ago | IN | 0.000777 ETH | 0.00015631 | ||||
| Mint | 20263167 | 566 days ago | IN | 0.000777 ETH | 0.0001704 | ||||
| Mint | 20248515 | 568 days ago | IN | 0.000777 ETH | 0.00010114 | ||||
| Mint | 20246896 | 568 days ago | IN | 0.000777 ETH | 0.00008029 | ||||
| Mint | 20199127 | 575 days ago | IN | 0.000777 ETH | 0.00006371 | ||||
| Mint | 20193030 | 576 days ago | IN | 0.000777 ETH | 0.00005347 | ||||
| Mint | 20189647 | 576 days ago | IN | 0.000777 ETH | 0.00012689 | ||||
| Mint | 20185207 | 577 days ago | IN | 0.000777 ETH | 0.00018561 | ||||
| Mint | 20171279 | 579 days ago | IN | 0.000777 ETH | 0.00010243 | ||||
| Mint | 20163567 | 580 days ago | IN | 0.000777 ETH | 0.00015238 | ||||
| Mint | 20162551 | 580 days ago | IN | 0.000777 ETH | 0.00017318 | ||||
| Mint | 20162443 | 580 days ago | IN | 0.000777 ETH | 0.00014522 | ||||
| Mint | 20162301 | 580 days ago | IN | 0.000777 ETH | 0.00020639 | ||||
| Mint | 20156728 | 581 days ago | IN | 0.000777 ETH | 0.00004542 |
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x1f08bA76...4aa6bcdbf The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
MegaBadgeImplV1
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 500 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import {ERC1155Upgradeable} from "@openzeppelin-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol";
import {Initializable} from "@openzeppelin-upgradeable/contracts/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin-upgradeable/contracts/utils/PausableUpgradeable.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MegaBadgeManagement} from "./MegaBadgeManagement.sol";
/*
##########################################
#############################################
#################################################
########## #####
############ #####
################ #####
##################### #####
############################ #####
################################ #####
################################# #####
################################# #####
################################# ###### ###### #####
################################# ###### ####### #####
################################# ###### ####### #####
################################# ###### ####### #####
################################# #### ##### #####
################################# #####
################################# #####
################################# #####
################################ #####
############################ #####
###### #################### #####
###### ################## #####
################ ####################################################
############### ###############################################
############# ##########################################
*/
/**
* @title MegaBadgeImplV1
* @notice Implementation contract for Megaphone Registration Badges.
*/
/// @custom:oz-upgrades-from src/MegaBadgeImplV1.sol:MegaBadgeImplV1
contract MegaBadgeImplV1 is
Initializable,
ERC1155Upgradeable,
UUPSUpgradeable,
PausableUpgradeable,
MegaBadgeManagement
{
// Events
event ContractInitialized(
address indexed owner,
address indexed platform,
address platformTreasury,
uint256 defaultPlatformFee,
string uri
);
event CustomPlatformFeeSet(uint256 indexed tokenId, uint256 fee);
event DefaultPlatformFeeSet(uint256 fee);
event MaxMintCountForTokenIdSet(uint256 indexed tokenId, uint256 maxMintCount);
event MaxMintCountPerAddressSet(uint256 indexed tokenId, uint256 maxMintsAllowed);
event MintLaunched(
uint256 indexed tokenId,
address indexed mintPriceRecipient,
uint256 mintPrice,
uint256 customPlatformFee,
bool isSoulbound
);
event MintPriceSet(uint256 indexed tokenId, uint256 price);
event MintPriceRecipientSet(uint256 indexed tokenId, address recipient);
event PlatformTreasurySet(address indexed platformTreasury);
event SoulboundStatusSet(uint256 indexed tokenId, bool status);
event StartTimeSet(uint256 indexed tokenId, uint256 _startTime);
event EndTimeSet(uint256 indexed tokenId, uint256 _endTime);
event PlatformOwnershipTransferred(address indexed previousPlatform, address indexed newPlatform);
/**
* @notice Initializes the contract setting the platformTreasury, defaultPlatformFee and the URI for the ERC1155 token.
* @param _owner The address to set as the owner. If zero address, defaults to _msgSender().
* @param _platform The address to set as the Megaphone backend admin.
* @param _platformTreasury The address of the Megaphone treasury.
* @param _defaultPlatformFee The default Megaphone service fee.
* @param _uri The URI for the ERC1155 token.
*/
function initialize(
address _owner,
address _platform,
address _platformTreasury,
uint256 _defaultPlatformFee,
string memory _uri
) public initializer {
require(_platformTreasury != address(0), "Platform treasury cannot be zero address");
__ERC1155_init(_uri);
address _o = _owner != address(0) ? _owner : _msgSender();
__Ownable_init(_o);
__UUPSUpgradeable_init();
__Pausable_init();
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
$P.platform = _platform;
$P.platformTreasury = _platformTreasury;
$P.defaultPlatformFee = _defaultPlatformFee;
emit ContractInitialized(_owner, _platform, _platformTreasury, _defaultPlatformFee, _uri);
}
/**
* @notice Throws if the proxy upgrade is called by any account other than the owner.
*/
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
/**
* @notice Transfer Megaphone Platform address to a new address.
* @param newPlatformAddress The new address to transfer the Megaphone platform admin to.
*/
function transferPlatformOwnership(address newPlatformAddress) public onlyOwner {
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
address oldPlatformAddress = $P.platform;
$P.platform = newPlatformAddress;
emit PlatformOwnershipTransferred(oldPlatformAddress, newPlatformAddress);
}
function _processPayment(uint256 _tokenId, uint256 _amount) internal {
require(msg.value >= _totalFee(_tokenId) * _amount, "Wrong amount of ETH sent");
// Transfer mintprice.
uint256 mintprice = mintPrice(_tokenId);
address recipient = mintPriceRecipient(_tokenId);
address platformTreasury = platformTreasury();
uint256 remaining = msg.value;
if (mintprice > 0 && recipient != address(0)) {
remaining -= mintprice;
(bool sent,) = recipient.call{value: mintprice}("");
require(sent, "Failed to send Ether");
}
if (remaining > 0) {
(bool sent,) = platformTreasury.call{value: remaining}("");
require(sent, "Failed to send Ether");
}
}
function _mintTokens(address _to, uint256 _tokenId, uint256 _amount, bytes calldata _data) private {
// Check mint status.
uint256 s = startTime(_tokenId);
require(s != 0 && block.timestamp >= s, "Minting not started");
uint256 e = endTime(_tokenId);
require(e == 0 || block.timestamp <= e, "Minting ended");
// Check max supply per tokenId.
uint256 maxPerToken = maxMintCountPerTokenId(_tokenId);
uint256 currentSupply = totalSupply(_tokenId);
require(maxPerToken == 0 || currentSupply + _amount <= maxPerToken, "Reached max supply for tokenId");
// Check max mints per address.
uint256 currentMintCount = mintCount(_tokenId, _to);
uint256 maxPerAddress = maxMintCountPerAddress(_tokenId);
require(maxPerAddress == 0 || currentMintCount + _amount <= maxPerAddress, "Reached max mints for address");
// Process the mint fee payment.
_processPayment(_tokenId, _amount);
// Increment total supply and mint count.
MintStatusStorage storage $MS = _getMintStatusStorage();
$MS.totalSupply[_tokenId] = currentSupply + _amount;
$MS.mintCount[_tokenId][_to] = currentMintCount + _amount;
// Mint the tokens.
_mint(_to, _tokenId, _amount, _data);
}
/**
* @notice Mints a new token to the caller of the mint function.
* @param _tokenId The ID of the token to mint.
* @param _amount The number of tokens to mint.
* @param _data Additional data with no specified format.
*/
function mint(uint256 _tokenId, uint256 _amount, bytes calldata _data) public payable whenNotPaused {
_mintTokens(_msgSender(), _tokenId, _amount, _data);
}
/**
* @notice Configure an optional max limit on the number of possible mints per
* tokenId. If 0 (default), then we assume no cap.
* @param tokenId The ID of the token to set the max mint count for.
* @param maxMintCount The max mint count to set.
*/
function setMaxMintCountForTokenId(uint256 tokenId, uint256 maxMintCount) public onlyPlatformOrOwner {
MintStatusStorage storage $MS = _getMintStatusStorage();
require(
maxMintCount == 0 || maxMintCount >= $MS.totalSupply[tokenId],
"Max mint count cannot be less than totalSupply"
);
$MS.maxMintCountPerTokenId[tokenId] = maxMintCount;
emit MaxMintCountForTokenIdSet(tokenId, maxMintCount);
}
/**
* @notice Update the max mints allowed for any given address on a token id.
* @param tokenId The ID of the token to set the max mint count for.
* @param maxMintsAllowed The max mint count to set.
*/
function setMaxMintCountForAddress(uint256 tokenId, uint256 maxMintsAllowed) public onlyPlatformOrOwner {
MintStatusStorage storage $MS = _getMintStatusStorage();
if ($MS.totalSupply[tokenId] > 0) {
require(
maxMintsAllowed >= $MS.maxMintCountPerAddress[tokenId],
"Only increases are supported once minting has begun"
);
}
$MS.maxMintCountPerAddress[tokenId] = maxMintsAllowed;
emit MaxMintCountPerAddressSet(tokenId, maxMintsAllowed);
}
/**
* @notice Returns the next tokenId to be launched, and then increments the pointer.
* @return The tokenId to be launched.
*/
function _useNextTokenId() internal returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
uint256 currentId = $MS.nextTokenId;
$MS.nextTokenId++;
return currentId;
}
/**
* @notice Launches a new mint.
* @param mintPrice The price of the mint.
* @param mintPriceRecipient The address to receive the mint price.
* @param startTime The start time of the mint.
* @param endTime The end time of the mint.
* @param customPlatformFee The custom platform fee.
* @param isSoulbound The soulbound status of the mint.
* @return The tokenId of the newly launched token.
*/
function launchMint(
uint256 mintPrice,
address mintPriceRecipient,
uint256 startTime,
uint256 endTime,
uint256 customPlatformFee,
bool isSoulbound
) public onlyPlatformOrOwner returns (uint256) {
require(startTime > 0, "startTime must be non-zero");
return _launchMint(mintPrice, mintPriceRecipient, startTime, endTime, customPlatformFee, isSoulbound);
}
function _launchMint(
uint256 mintPrice,
address mintPriceRecipient,
uint256 startTime,
uint256 endTime,
uint256 customPlatformFee,
bool isSoulbound
) internal returns (uint256) {
require(startTime > 0, "startTime must be non-zero");
uint256 id = _useNextTokenId();
// Additional price to charge for the mint beyond the platform fee.
if (mintPrice > 0) _setMintPrice(id, mintPrice);
// Address to receive the mintPrice.
if (mintPriceRecipient != address(0)) _setMintPriceRecipient(id, mintPriceRecipient);
// Start time of the mint.
_setStartTime(id, startTime);
// End time of the mint.
if (endTime > 0) _setEndTime(id, endTime);
// Custom platform fee to charge for the mint.
if (customPlatformFee > 0) _setCustomPlatformFee(id, customPlatformFee);
// Soulbound status of the mint.
if (isSoulbound) _setSoulbound(id, isSoulbound);
emit MintLaunched(id, mintPriceRecipient, mintPrice, customPlatformFee, isSoulbound);
return id;
}
/**
* @notice Sets the mint price for a token ID.
* @param id The ID of the token to set the mint price for.
* @param price The price to set.
*/
function setMintPrice(uint256 id, uint256 price) public onlyPlatformOrOwner {
_setMintPrice(id, price);
}
function _setMintPrice(uint256 id, uint256 price) internal {
MintPriceStorage storage $MP = _getMintPriceStorage();
$MP.mintPrice[id] = price;
emit MintPriceSet(id, price);
}
/**
* @notice Sets the mint price recipient for a token ID.
* @param id The ID of the token to set the mint price recipient for.
* @param recipient The address to set as the mint price recipient.
*/
function setMintPriceRecipient(uint256 id, address recipient) public onlyPlatformOrOwner {
_setMintPriceRecipient(id, recipient);
}
function _setMintPriceRecipient(uint256 id, address recipient) internal {
MintPriceStorage storage $MP = _getMintPriceStorage();
$MP.mintPriceRecipient[id] = recipient;
emit MintPriceRecipientSet(id, recipient);
}
/**
* @notice Returns the platform fee for a token ID. If customPlatformFee is 0, then use default fee.
* @param tokenId The ID of the token to return the platform fee for.
* @return uint256 representing the platform fee.
*/
function getPlatformFee(uint256 tokenId) public view returns (uint256) {
MintPriceStorage storage $MP = _getMintPriceStorage();
return $MP.customPlatformFee[tokenId] != 0 ? $MP.customPlatformFee[tokenId] : defaultPlatformFee();
}
/**
* @notice Sets the platform fee for a token ID.
* @param tokenId The ID of the token to set the platform fee for.
* @param fee The platform fee to set.
*/
function setCustomPlatformFee(uint256 tokenId, uint256 fee) public onlyPlatformOrOwner {
_setCustomPlatformFee(tokenId, fee);
}
function _setCustomPlatformFee(uint256 id, uint256 fee) internal {
MintPriceStorage storage $MP = _getMintPriceStorage();
$MP.customPlatformFee[id] = fee;
emit CustomPlatformFeeSet(id, fee);
}
/**
* @notice Updates the default platform fee for all token IDs.
* @param fee The new default platform fee.
*/
function setDefaultPlatformFee(uint256 fee) public onlyPlatformOrOwner {
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
$P.defaultPlatformFee = fee;
emit DefaultPlatformFeeSet(fee);
}
/**
* @notice Returns the total fee for a token ID.
* @param _id The ID of the token to return the total fee for.
* @param _amount The amount of tokens to return the total fee for.
* @return uint256 representing the total fee.
*/
function totalFee(uint256 _id, uint256 _amount) public view returns (uint256) {
return _totalFee(_id) * _amount;
}
function _totalFee(uint256 _tokenId) internal view returns (uint256) {
MintPriceStorage storage $MP = _getMintPriceStorage();
uint256 _mintPrice = $MP.mintPrice[_tokenId];
uint256 _customPlatformFee = $MP.customPlatformFee[_tokenId];
if (_customPlatformFee == 0) {
return _mintPrice + defaultPlatformFee();
}
return _mintPrice + _customPlatformFee;
}
/**
* @notice Sets the platform treasury address.
* @param _platformTreasury The address to set as the platform treasury payout address.
*/
function setPlatformTreasury(address _platformTreasury) public onlyOwner {
require(_platformTreasury != address(0), "Platform treasury cannot be zero address");
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
$P.platformTreasury = _platformTreasury;
emit PlatformTreasurySet(_platformTreasury);
}
function setStartTime(uint256 id, uint256 _startTime) public onlyPlatformOrOwner {
_setStartTime(id, _startTime);
}
function _setStartTime(uint256 id, uint256 _startTime) internal {
MintTimingStorage storage $MT = _getMintTimingStorage();
$MT.startTime[id] = _startTime;
emit StartTimeSet(id, _startTime);
}
function setEndTime(uint256 id, uint256 _endTime) public onlyPlatformOrOwner {
_setEndTime(id, _endTime);
}
function _setEndTime(uint256 id, uint256 _endTime) internal {
MintTimingStorage storage $MT = _getMintTimingStorage();
$MT.endTime[id] = _endTime;
emit EndTimeSet(id, _endTime);
}
/**
* @notice Sets the base URI for the metadata.
*
* We expect base uri to be in a format like this: https://badges.megaphone.xyz/v1/chain/:chainId
* Note: no trailing backslash
*
* @param newuri The new base URI.
*/
function setBaseURI(string memory newuri) public onlyOwner {
_setURI(newuri);
}
/**
* @notice Returns the URI for the contract's metadata: https://badges.megaphone.xyz/v1/chain/:chainId
* @return A string representing the URI.
*/
function contractURI() public view returns (string memory) {
return super.uri(0);
}
/**
* @notice Returns the URI for a token ID: https://badges.megaphone.xyz/v1/chain/:chainId/token/:tokenId
*
* We expect base uri to be in a format like this: https://badges.megaphone.xyz/v1/chain/:chainId
* Note: no trailing backslash
*
* @param id The ID of the token to return the URI for.
* @return A string representing the URI.
*/
function uri(uint256 id) public view override returns (string memory) {
require(id < nextTokenId(), "Unlaunched tokenId");
return string(abi.encodePacked(super.uri(id), "/token/", Strings.toString(id)));
}
/**
* @notice Burns a token. The sender must have enough tokens to burn.
* @param id The ID of the token to burn.
* @param amount The amount of tokens to burn.
*/
function burn(uint256 id, uint256 amount) public {
address account = _msgSender();
// Call the inherited _burn function
super._burn(account, id, amount);
}
/**
* @notice Sets the soulbound status of a token ID.
* @param tokenId The ID of the token to set the soulbound status for.
* @param status The soulbound status to set.
*/
function setSoulbound(uint256 tokenId, bool status) public onlyPlatformOrOwner {
_setSoulbound(tokenId, status);
}
function _setSoulbound(uint256 tokenId, bool status) internal {
MintStatusStorage storage $MS = _getMintStatusStorage();
$MS.isSoulbound[tokenId] = status;
emit SoulboundStatusSet(tokenId, status);
}
/**
* @notice Override the _update function to implement soulbound check based on isSoulbound status per tokenId.
*/
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal override {
MintStatusStorage storage $MS = _getMintStatusStorage();
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
if ($MS.isSoulbound[id]) {
require(from == address(0) || to == address(0), "Soulbound token id cannot be transferred.");
}
}
super._update(from, to, ids, values);
}
/**
* @notice Triggers stop state on the contract. The main thing we care about
* pausing is all mints across all tokenIds. Useful for emergency situations.
*/
function pause() public onlyOwner {
_pause();
}
/**
* @notice Triggers start state on the contract. The main thing we care about
* unpausing is all mints across all tokenIds.
*/
function unpause() public onlyOwner {
_unpause();
}
struct TokenInfo {
// Minting
uint256 mintPrice;
address mintPriceRecipient;
uint256 customPlatformFee;
uint256 totalFee;
// Timing
uint256 startTime;
uint256 endTime;
// Supply & limits
uint256 totalSupply;
uint256 maxMintCountPerTokenId;
uint256 maxMintCountPerAddress;
// Status
bool isSoulbound;
// computed: tokenId < nextTokenId
bool isLaunched;
}
/**
* @notice Convenience helper to return token info for a single tokenId.
* @param tokenId The ID of the token to return the info for.
* @return TokenInfo struct containing the token info.
*/
function getTokenInfo(uint256 tokenId) external view returns (TokenInfo memory) {
return _getTokenInfo(tokenId);
}
/**
* @notice Convenience helper to return token info for a batch of tokenIds.
* @param tokenIds The IDs of the tokens to return the info for.
* @return TokenInfo[] array of TokenInfo structs containing the token info.
*/
function getTokenInfo(uint256[] calldata tokenIds) external view returns (TokenInfo[] memory) {
TokenInfo[] memory infos = new TokenInfo[](tokenIds.length);
for (uint256 i = 0; i < tokenIds.length; i++) {
infos[i] = _getTokenInfo(tokenIds[i]);
}
return infos;
}
function _getTokenInfo(uint256 tokenId) internal view returns (TokenInfo memory) {
MintPriceStorage storage $MP = _getMintPriceStorage();
MintTimingStorage storage $MT = _getMintTimingStorage();
MintStatusStorage storage $MS = _getMintStatusStorage();
uint256 start = $MT.startTime[tokenId];
uint256 end = $MT.endTime[tokenId];
return TokenInfo({
mintPrice: $MP.mintPrice[tokenId],
mintPriceRecipient: $MP.mintPriceRecipient[tokenId],
customPlatformFee: $MP.customPlatformFee[tokenId],
totalFee: _totalFee(tokenId),
startTime: start,
endTime: end,
totalSupply: $MS.totalSupply[tokenId],
maxMintCountPerTokenId: $MS.maxMintCountPerTokenId[tokenId],
maxMintCountPerAddress: $MS.maxMintCountPerAddress[tokenId],
isSoulbound: $MS.isSoulbound[tokenId],
isLaunched: tokenId < $MS.nextTokenId
});
}
struct UserInfo {
// how many tokens the user currently has for this tokenId
uint256 userCurrentBalance;
// how many times the user has minted this tokenId
uint256 userMintCount;
}
/**
* @notice Convenience helper to return user info for a single tokenId.
* @param tokenId The ID of the token to return the user info for.
* @param user The address of the user to return the info for.
* @return UserInfo struct containing the user info.
*/
function getUserInfo(uint256 tokenId, address user) external view returns (UserInfo memory) {
return _getUserInfo(tokenId, user);
}
function _getUserInfo(uint256 tokenId, address user) internal view returns (UserInfo memory) {
uint256 userMintCount = mintCount(tokenId, user);
uint256 userBalance = balanceOf(user, tokenId);
return UserInfo({userCurrentBalance: userBalance, userMintCount: userMintCount});
}
/**
* @notice Returns the contract name.
*/
function name() public pure returns (string memory) {
return "Megaphone Registration Badge";
}
/**
* @notice Returns the contract symbol.
*/
function symbol() public pure returns (string memory) {
return "MB";
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import {ContextUpgradeable} from "../../utils/ContextUpgradeable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165Upgradeable} from "../../utils/introspection/ERC165Upgradeable.sol";
import {Arrays} from "@openzeppelin/contracts/utils/Arrays.sol";
import {IERC1155Errors} from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*/
abstract contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155, IERC1155MetadataURI, IERC1155Errors {
using Arrays for uint256[];
using Arrays for address[];
/// @custom:storage-location erc7201:openzeppelin.storage.ERC1155
struct ERC1155Storage {
mapping(uint256 id => mapping(address account => uint256)) _balances;
mapping(address account => mapping(address operator => bool)) _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string _uri;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ERC1155")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant ERC1155StorageLocation = 0x88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500;
function _getERC1155Storage() private pure returns (ERC1155Storage storage $) {
assembly {
$.slot := ERC1155StorageLocation
}
}
/**
* @dev See {_setURI}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256 /* id */) public view virtual returns (string memory) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*/
function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] memory accounts,
uint256[] memory ids
) public view virtual returns (uint256[] memory) {
if (accounts.length != ids.length) {
revert ERC1155InvalidArrayLength(ids.length, accounts.length);
}
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
ERC1155Storage storage $ = _getERC1155Storage();
return $._operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeTransferFrom(from, to, id, value, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeBatchTransferFrom(from, to, ids, values, data);
}
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
* (or `to`) is the zero address.
*
* Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
* or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
* - `ids` and `values` must have the same length.
*
* NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
*/
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
if (ids.length != values.length) {
revert ERC1155InvalidArrayLength(ids.length, values.length);
}
address operator = _msgSender();
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids.unsafeMemoryAccess(i);
uint256 value = values.unsafeMemoryAccess(i);
if (from != address(0)) {
uint256 fromBalance = $._balances[id][from];
if (fromBalance < value) {
revert ERC1155InsufficientBalance(from, fromBalance, value, id);
}
unchecked {
// Overflow not possible: value <= fromBalance
$._balances[id][from] = fromBalance - value;
}
}
if (to != address(0)) {
$._balances[id][to] += value;
}
}
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
emit TransferSingle(operator, from, to, id, value);
} else {
emit TransferBatch(operator, from, to, ids, values);
}
}
/**
* @dev Version of {_update} that performs the token acceptance check by calling
* {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
* contains code (eg. is a smart contract at the moment of execution).
*
* IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
* update to the contract state after this function would break the check-effect-interaction pattern. Consider
* overriding {_update} instead.
*/
function _updateWithAcceptanceCheck(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal virtual {
_update(from, to, ids, values);
if (to != address(0)) {
address operator = _msgSender();
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
_doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
} else {
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
}
}
}
/**
* @dev Transfers a `value` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
* - `ids` and `values` must have the same length.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, to, ids, values, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the values in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
$._uri = newuri;
}
/**
* @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(address to, uint256 id, uint256 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev Destroys a `value` amount of tokens of type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
*/
function _burn(address from, uint256 id, uint256 value) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
* - `ids` and `values` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the zero address.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
ERC1155Storage storage $ = _getERC1155Storage();
if (operator == address(0)) {
revert ERC1155InvalidOperator(address(0));
}
$._operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 value,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Creates an array in memory with only one value for each of the elements provided.
*/
function _asSingletonArrays(
uint256 element1,
uint256 element2
) private pure returns (uint256[] memory array1, uint256[] memory array2) {
/// @solidity memory-safe-assembly
assembly {
// Load the free memory pointer
array1 := mload(0x40)
// Set array length to 1
mstore(array1, 1)
// Store the single element at the next word after the length (where content starts)
mstore(add(array1, 0x20), element1)
// Repeat for next array locating it right after the first array
array2 := add(array1, 0x40)
mstore(array2, 1)
mstore(add(array2, 0x20), element2)
// Update the free memory pointer by pointing after the second array
mstore(0x40, add(array2, 0x40))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.20;
import {IERC1822Proxiable} from "@openzeppelin/contracts/interfaces/draft-IERC1822.sol";
import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable __self = address(this);
/**
* @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`
* and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,
* while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.
* If the getter returns `"5.0.0"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must
* be the empty byte string if no function should be called, making it impossible to invoke the `receive` function
* during an upgrade.
*/
string public constant UPGRADE_INTERFACE_VERSION = "5.0.0";
/**
* @dev The call is from an unauthorized context.
*/
error UUPSUnauthorizedCallContext();
/**
* @dev The storage `slot` is unsupported as a UUID.
*/
error UUPSUnsupportedProxiableUUID(bytes32 slot);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
_checkProxy();
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
_checkNotDelegated();
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual notDelegated returns (bytes32) {
return ERC1967Utils.IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data);
}
/**
* @dev Reverts if the execution is not performed via delegatecall or the execution
* context is not of a proxy with an ERC1967-compliant implementation pointing to self.
* See {_onlyProxy}.
*/
function _checkProxy() internal view virtual {
if (
address(this) == __self || // Must be called through delegatecall
ERC1967Utils.getImplementation() != __self // Must be called through an active proxy
) {
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Reverts if the execution is performed via delegatecall.
* See {notDelegated}.
*/
function _checkNotDelegated() internal view virtual {
if (address(this) != __self) {
// Must not be called through delegatecall
revert UUPSUnauthorizedCallContext();
}
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.
*
* As a security check, {proxiableUUID} is invoked in the new implementation, and the return value
* is expected to be the implementation slot in ERC1967.
*
* Emits an {IERC1967-Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {
revert UUPSUnsupportedProxiableUUID(slot);
}
ERC1967Utils.upgradeToAndCall(newImplementation, data);
} catch {
// The implementation is not UUPS
revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Pausable
struct PausableStorage {
bool _paused;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Pausable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;
function _getPausableStorage() private pure returns (PausableStorage storage $) {
assembly {
$.slot := PausableStorageLocation
}
}
/**
* @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);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
PausableStorage storage $ = _getPausableStorage();
$._paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
PausableStorage storage $ = _getPausableStorage();
return $._paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
PausableStorage storage $ = _getPausableStorage();
$._paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
PausableStorage storage $ = _getPausableStorage();
$._paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
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_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";
/*
##########################################
#############################################
#################################################
########## #####
############ #####
################ #####
##################### #####
############################ #####
################################ #####
################################# #####
################################# #####
################################# ###### ###### #####
################################# ###### ####### #####
################################# ###### ####### #####
################################# ###### ####### #####
################################# #### ##### #####
################################# #####
################################# #####
################################# #####
################################ #####
############################ #####
###### #################### #####
###### ################## #####
################ ####################################################
############### ###############################################
############# ##########################################
*/
contract MegaBadgeManagement is OwnableUpgradeable {
// Errors
error PlatformUnauthorizedAccount(address sender);
error UnauthorizedAccount(address account);
/// @custom:storage-location erc7201:PlatformManagementStorage
struct PlatformManagementStorage {
// Megaphone platform admin address
address platform;
// Megaphone platform treasury address
address platformTreasury;
// Megaphone platform fee
uint256 defaultPlatformFee;
}
// keccak256(abi.encode(uint256(keccak256("PlatformManagementStorage")) - 1)) & ~bytes32(uint256(0xff));
bytes32 private constant PlatformManagementStorageLocation =
0x9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba800;
function _getPlatformManagementStorage() internal pure returns (PlatformManagementStorage storage $) {
assembly {
$.slot := PlatformManagementStorageLocation
}
}
/**
* @notice Returns the Megaphone platform admin address.
*/
function platform() public view virtual returns (address) {
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
return $P.platform;
}
/**
* @notice Returns the Megaphone platform treasury address.
*/
function platformTreasury() public view virtual returns (address) {
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
return $P.platformTreasury;
}
/**
* @notice Returns the default Megaphone platform fee that applies to all mints across all tokenIds.
*/
function defaultPlatformFee() public view virtual returns (uint256) {
PlatformManagementStorage storage $P = _getPlatformManagementStorage();
return $P.defaultPlatformFee;
}
/// @custom:storage-location erc7201:MintStatusStorage
struct MintStatusStorage {
// The next un-launched tokenId. We auto-increment this when launching a new mint.
uint256 nextTokenId;
// Total count of tokens with a given id
mapping(uint256 => uint256) totalSupply;
// Mapping from token ID to its soulbound status
mapping(uint256 => bool) isSoulbound;
// Max mint configs per token id -- if 0, there is no cap
mapping(uint256 => uint256) maxMintCountPerTokenId;
// Mint counts for each token id by address
mapping(uint256 => mapping(address => uint256)) mintCount;
// Max mint count allowed per address for a given token id (two-layered map)
mapping(uint256 => uint256) maxMintCountPerAddress;
}
// keccak256(abi.encode(uint256(keccak256("MintStatusStorage")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant MintConfigStorageLocation =
0x9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3900;
function _getMintStatusStorage() internal pure returns (MintStatusStorage storage $) {
assembly {
$.slot := MintConfigStorageLocation
}
}
/**
* @notice Returns the next tokenId to be launched.
*/
function nextTokenId() public view returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.nextTokenId;
}
/**
* @notice Returns the total supply that has been minted for a given token id.
*/
function totalSupply(uint256 tokenId) public view returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.totalSupply[tokenId];
}
/**
* @notice Returns the soulbound status for a given token id. True means the
* token is soulbound and cannot be transfered.
*/
function isSoulbound(uint256 tokenId) public view returns (bool) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.isSoulbound[tokenId];
}
/**
* @notice Returns the max mint count for a given token id.
*/
function maxMintCountPerTokenId(uint256 tokenId) public view returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.maxMintCountPerTokenId[tokenId];
}
/**
* @notice Returns the total mints performed by a given wallet address on each
* token id.
*/
function mintCount(uint256 tokenId, address account) public view returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.mintCount[tokenId][account];
}
/**
* @notice Returns a value > 0 if there is a max cap on the number of mints
* that a single wallet address is allowed to perform for a specific token
* id. If 0, there is no cap.
*/
function maxMintCountPerAddress(uint256 tokenId) public view returns (uint256) {
MintStatusStorage storage $MS = _getMintStatusStorage();
return $MS.maxMintCountPerAddress[tokenId];
}
/// @custom:storage-location erc7201:MintPriceStorage
struct MintPriceStorage {
// Mapping from token ID to its price
mapping(uint256 => uint256) mintPrice;
// Custom DeForm platform fee for each token id
mapping(uint256 => uint256) customPlatformFee;
// Unique mintPrice recipient address for each token id
mapping(uint256 => address) mintPriceRecipient;
}
// keccak256(abi.encode(uint256(keccak256("MintPriceStorage")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant MintPriceStorageLocation =
0x5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a00;
function _getMintPriceStorage() internal pure returns (MintPriceStorage storage $) {
assembly {
$.slot := MintPriceStorageLocation
}
}
/**
* @notice Returns the mint price for a given token id.
*/
function mintPrice(uint256 tokenId) public view returns (uint256) {
MintPriceStorage storage $MP = _getMintPriceStorage();
return $MP.mintPrice[tokenId];
}
/**
* @notice Returns the custom platform fee for a given token id.
*/
function customPlatformFee(uint256 tokenId) public view returns (uint256) {
MintPriceStorage storage $MP = _getMintPriceStorage();
return $MP.customPlatformFee[tokenId];
}
/**
* @notice Returns the unique mint price recipient address for a given token id.
*/
function mintPriceRecipient(uint256 tokenId) public view returns (address) {
MintPriceStorage storage $MP = _getMintPriceStorage();
return $MP.mintPriceRecipient[tokenId];
}
/// @custom:storage-location erc7201:MintTimingStorage
struct MintTimingStorage {
// Mapping from token ID to its start and end time
mapping(uint256 => uint256) startTime;
mapping(uint256 => uint256) endTime;
}
// keccak256(abi.encode(uint256(keccak256("MintTimingStorage")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant MintTimingStorageLocation =
0x932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e4800;
function _getMintTimingStorage() internal pure returns (MintTimingStorage storage $) {
assembly {
$.slot := MintTimingStorageLocation
}
}
/**
* @notice Returns the start time to open minting for a given token id.
*/
function startTime(uint256 tokenId) public view returns (uint256) {
MintTimingStorage storage $MT = _getMintTimingStorage();
return $MT.startTime[tokenId];
}
/**
* @notice Returns the end time to stop minting for a given token id.
*/
function endTime(uint256 tokenId) public view returns (uint256) {
MintTimingStorage storage $MT = _getMintTimingStorage();
return $MT.endTime[tokenId];
}
/**
* @notice Throws if the sender is not the DeForm platform admin.
*/
function _checkPlatform() internal view {
if (platform() != _msgSender()) {
revert PlatformUnauthorizedAccount(_msgSender());
}
}
/**
* @notice Throws if called by any account other than the DeForm platform admin.
*/
modifier onlyPlatform() {
_checkPlatform();
_;
}
/**
* @notice Throws if called by any account other than the owner or the DeForm platform admin.
*/
modifier onlyPlatformOrOwner() {
if (_msgSender() != owner() && _msgSender() != platform()) {
revert UnauthorizedAccount(_msgSender());
}
_;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the value of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.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);
* }
* ```
*/
abstract contract ERC165Upgradeable is Initializable, IERC165 {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";
/**
* @dev Collection of functions related to array types.
*/
library Arrays {
using StorageSlot for bytes32;
/**
* @dev Searches a sorted `array` and returns the first index that contains
* a value greater or equal to `element`. If no such index exists (i.e. all
* values in the array are strictly less than `element`), the array length is
* returned. Time complexity O(log n).
*
* `array` is expected to be sorted in ascending order, and to contain no
* repeated elements.
*/
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
uint256 low = 0;
uint256 high = array.length;
if (high == 0) {
return 0;
}
while (low < high) {
uint256 mid = Math.average(low, high);
// Note that mid will always be strictly less than high (i.e. it will be a valid array index)
// because Math.average rounds towards zero (it does integer division with truncation).
if (unsafeAccess(array, mid).value > element) {
high = mid;
} else {
low = mid + 1;
}
}
// At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
if (low > 0 && unsafeAccess(array, low - 1).value == element) {
return low - 1;
} else {
return low;
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getAddressSlot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getBytes32Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getUint256Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.20;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/ERC1967/ERC1967Utils.sol)
pragma solidity ^0.8.20;
import {IBeacon} from "../beacon/IBeacon.sol";
import {Address} from "../../utils/Address.sol";
import {StorageSlot} from "../../utils/StorageSlot.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*/
library ERC1967Utils {
// We re-declare ERC-1967 events here because they can't be used directly from IERC1967.
// This will be fixed in Solidity 0.8.21. At that point we should remove these events.
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev The `implementation` of the proxy is invalid.
*/
error ERC1967InvalidImplementation(address implementation);
/**
* @dev The `admin` of the proxy is invalid.
*/
error ERC1967InvalidAdmin(address admin);
/**
* @dev The `beacon` of the proxy is invalid.
*/
error ERC1967InvalidBeacon(address beacon);
/**
* @dev An upgrade function sees `msg.value > 0` that may be lost.
*/
error ERC1967NonPayable();
/**
* @dev Returns the current implementation address.
*/
function getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
if (newImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(newImplementation);
}
StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Performs implementation upgrade with additional setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
if (data.length > 0) {
Address.functionDelegateCall(newImplementation, data);
} else {
_checkNonPayable();
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*
* TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using
* the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.
* `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`
*/
function getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
if (newAdmin == address(0)) {
revert ERC1967InvalidAdmin(address(0));
}
StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {IERC1967-AdminChanged} event.
*/
function changeAdmin(address newAdmin) internal {
emit AdminChanged(getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is the keccak-256 hash of "eip1967.proxy.beacon" subtracted by 1.
*/
// solhint-disable-next-line private-vars-leading-underscore
bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
if (newBeacon.code.length == 0) {
revert ERC1967InvalidBeacon(newBeacon);
}
StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;
address beaconImplementation = IBeacon(newBeacon).implementation();
if (beaconImplementation.code.length == 0) {
revert ERC1967InvalidImplementation(beaconImplementation);
}
}
/**
* @dev Change the beacon and trigger a setup call if data is nonempty.
* This function is payable only if the setup call is performed, otherwise `msg.value` is rejected
* to avoid stuck value in the contract.
*
* Emits an {IERC1967-BeaconUpgraded} event.
*
* CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since
* it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for
* efficiency.
*/
function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
} else {
_checkNonPayable();
}
}
/**
* @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract
* if an upgrade doesn't perform an initialization call.
*/
function _checkNonPayable() private {
if (msg.value > 0) {
revert ERC1967NonPayable();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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.
*
* The initial owner is set to the address provided by the deployer. 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 OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.20;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {UpgradeableBeacon} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}{
"remappings": [
"@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/"
],
"optimizer": {
"enabled": true,
"runs": 500
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "shanghai",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"ERC1967InvalidImplementation","type":"error"},{"inputs":[],"name":"ERC1967NonPayable","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"PlatformUnauthorizedAccount","type":"error"},{"inputs":[],"name":"UUPSUnauthorizedCallContext","type":"error"},{"inputs":[{"internalType":"bytes32","name":"slot","type":"bytes32"}],"name":"UUPSUnsupportedProxiableUUID","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"UnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"platform","type":"address"},{"indexed":false,"internalType":"address","name":"platformTreasury","type":"address"},{"indexed":false,"internalType":"uint256","name":"defaultPlatformFee","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"ContractInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"CustomPlatformFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"DefaultPlatformFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"EndTimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintCount","type":"uint256"}],"name":"MaxMintCountForTokenIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintsAllowed","type":"uint256"}],"name":"MaxMintCountPerAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"mintPriceRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"customPlatformFee","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isSoulbound","type":"bool"}],"name":"MintLaunched","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"MintPriceRecipientSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"MintPriceSet","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":"previousPlatform","type":"address"},{"indexed":true,"internalType":"address","name":"newPlatform","type":"address"}],"name":"PlatformOwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"platformTreasury","type":"address"}],"name":"PlatformTreasurySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SoulboundStatusSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"StartTimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"UPGRADE_INTERFACE_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"customPlatformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultPlatformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPlatformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenInfo","outputs":[{"components":[{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"address","name":"mintPriceRecipient","type":"address"},{"internalType":"uint256","name":"customPlatformFee","type":"uint256"},{"internalType":"uint256","name":"totalFee","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"maxMintCountPerTokenId","type":"uint256"},{"internalType":"uint256","name":"maxMintCountPerAddress","type":"uint256"},{"internalType":"bool","name":"isSoulbound","type":"bool"},{"internalType":"bool","name":"isLaunched","type":"bool"}],"internalType":"struct MegaBadgeImplV1.TokenInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getTokenInfo","outputs":[{"components":[{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"address","name":"mintPriceRecipient","type":"address"},{"internalType":"uint256","name":"customPlatformFee","type":"uint256"},{"internalType":"uint256","name":"totalFee","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"maxMintCountPerTokenId","type":"uint256"},{"internalType":"uint256","name":"maxMintCountPerAddress","type":"uint256"},{"internalType":"bool","name":"isSoulbound","type":"bool"},{"internalType":"bool","name":"isLaunched","type":"bool"}],"internalType":"struct MegaBadgeImplV1.TokenInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"getUserInfo","outputs":[{"components":[{"internalType":"uint256","name":"userCurrentBalance","type":"uint256"},{"internalType":"uint256","name":"userMintCount","type":"uint256"}],"internalType":"struct MegaBadgeImplV1.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_platform","type":"address"},{"internalType":"address","name":"_platformTreasury","type":"address"},{"internalType":"uint256","name":"_defaultPlatformFee","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isSoulbound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"address","name":"mintPriceRecipient","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"customPlatformFee","type":"uint256"},{"internalType":"bool","name":"isSoulbound","type":"bool"}],"name":"launchMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"maxMintCountPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"maxMintCountPerTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"mintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintPriceRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platform","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newuri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setCustomPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setDefaultPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"maxMintsAllowed","type":"uint256"}],"name":"setMaxMintCountForAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"maxMintCount","type":"uint256"}],"name":"setMaxMintCountForTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"setMintPriceRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformTreasury","type":"address"}],"name":"setPlatformTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setSoulbound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"totalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPlatformAddress","type":"address"}],"name":"transferPlatformOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60a060405230608052348015610013575f80fd5b5060805161459761003a5f395f818161241c0152818161244501526125aa01526145975ff3fe60806040526004361061034f575f3560e01c8063804b6ba3116101bd578063b8867332116100f2578063e138818c11610092578063e985e9c51161006d578063e985e9c514610b27578063f242432a14610b8d578063f2fde38b14610bac578063fdd950c114610bcb575f80fd5b8063e138818c14610ab8578063e6a72acf14610af4578063e8a3d48514610b13575f80fd5b8063c0fe8a39116100cd578063c0fe8a39146109c7578063c61df6a6146109e6578063d144844c14610a46578063d97939eb14610a99575f80fd5b8063b88673321461093f578063ba278e0814610989578063bd85b039146109a8575f80fd5b8063966d964b1161015d578063abfbac4b11610138578063abfbac4b146108a5578063ad3cb1cc146108c4578063b346cbfc146108f4578063b390c0ab14610920575f80fd5b8063966d964b146108485780639aa3b05614610867578063a22cb46514610886575f80fd5b80638c7a63ae116101985780638c7a63ae146107915780638da5cb5b146107bd578063911ec470146107d157806395d89b411461081e575f80fd5b8063804b6ba31461073f5780638456cb591461075e57806384d70c4114610772575f80fd5b80633ec4c9681161029357806352d1902d116102335780636cfa2a821161020e5780636cfa2a82146106cd578063715018a6146106ec57806375794a3c146107005780637cd86d6014610720575f80fd5b806352d1902d1461066457806355f804b3146106785780635c975abb14610697575f80fd5b806348b9994e1161026e57806348b9994e146105da5780634bde38c8146105f95780634e1273f4146106255780634f1ef28614610651575f80fd5b80633ec4c968146105885780633f4ba83a146105a757806344c816fa146105bb575f80fd5b80630e89341c116102fe5780631c34212c116102d95780631c34212c146104f85780632eb2c2d61461052b578063387fa5491461054a578063395d613414610569575f80fd5b80630e89341c146104555780631069f3b51461047457806311f09249146104ae575f80fd5b8063046c15531161032e578063046c1553146103d557806306fdde03146103f457806308dc9f4214610442575f80fd5b8062fdd58e1461035357806301ffc9a7146103855780630442bfa8146103b4575b5f80fd5b34801561035e575f80fd5b5061037261036d366004613a0a565b610bea565b6040519081526020015b60405180910390f35b348015610390575f80fd5b506103a461039f366004613a47565b610c32565b604051901515815260200161037c565b3480156103bf575f80fd5b506103d36103ce366004613a62565b610c81565b005b3480156103e0575f80fd5b506103d36103ef366004613a82565b610d02565b3480156103ff575f80fd5b5060408051808201909152601c81527f4d65676170686f6e6520526567697374726174696f6e2042616467650000000060208201525b60405161037c9190613ae8565b6103d3610450366004613afa565b610d79565b348015610460575f80fd5b5061043561046f366004613b73565b610d94565b34801561047f575f80fd5b5061049361048e366004613b8a565b610e32565b6040805182518152602092830151928101929092520161037c565b3480156104b9575f80fd5b506103726104c8366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3903602052604090205490565b348015610503575f80fd5b507f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80254610372565b348015610536575f80fd5b506103d3610545366004613cf0565b610e56565b348015610555575f80fd5b506103d3610564366004613a62565b610efa565b348015610574575f80fd5b50610372610583366004613a62565b611036565b348015610593575f80fd5b506103726105a2366004613b73565b61104b565b3480156105b2575f80fd5b506103d3611080565b3480156105c6575f80fd5b506103726105d5366004613b73565b611092565b3480156105e5575f80fd5b506103726105f4366004613b73565b6110ca565b348015610604575f80fd5b5061060d6110df565b6040516001600160a01b03909116815260200161037c565b348015610630575f80fd5b5061064461063f366004613d93565b611113565b60405161037c9190613e86565b6103d361065f366004613e98565b6111e6565b34801561066f575f80fd5b50610372611201565b348015610683575f80fd5b506103d3610692366004613ed9565b61122f565b3480156106a2575f80fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166103a4565b3480156106d8575f80fd5b506103d36106e7366004613f13565b611243565b3480156106f7575f80fd5b506103d36114d5565b34801561070b575f80fd5b505f8051602061452283398151915254610372565b34801561072b575f80fd5b506103d361073a366004613a82565b6114e6565b34801561074a575f80fd5b50610372610759366004613f89565b6115e1565b348015610769575f80fd5b506103d3611697565b34801561077d575f80fd5b506103d361078c366004613a62565b6116a7565b34801561079c575f80fd5b506107b06107ab366004613b73565b611800565b60405161037c919061406d565b3480156107c8575f80fd5b5061060d611811565b3480156107dc575f80fd5b506103a46107eb366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3902602052604090205460ff1690565b348015610829575f80fd5b5060408051808201909152600281526126a160f11b6020820152610435565b348015610853575f80fd5b506103d361086236600461407c565b611839565b348015610872575f80fd5b506103d3610881366004613a62565b611890565b348015610891575f80fd5b506103d36108a036600461409d565b6118e7565b3480156108b0575f80fd5b506103d36108bf366004613a62565b6118f2565b3480156108cf575f80fd5b50610435604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156108ff575f80fd5b5061091361090e3660046140c5565b611949565b60405161037c9190614134565b34801561092b575f80fd5b506103d361093a366004613a62565b6119fc565b34801561094a575f80fd5b50610372610959366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3905602052604090205490565b348015610994575f80fd5b506103d36109a3366004613a62565b611a0d565b3480156109b3575f80fd5b506103726109c2366004613b73565b611a64565b3480156109d2575f80fd5b506103d36109e1366004613b8a565b611a79565b3480156109f1575f80fd5b50610372610a00366004613b8a565b5f9182527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3904602090815260408084206001600160a01b0393909316845291905290205490565b348015610a51575f80fd5b5061060d610a60366004613b73565b5f9081527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0260205260409020546001600160a01b031690565b348015610aa4575f80fd5b50610372610ab3366004613b73565b611ad0565b348015610ac3575f80fd5b507f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba801546001600160a01b031661060d565b348015610aff575f80fd5b50610372610b0e366004613b73565b611b51565b348015610b1e575f80fd5b50610435611b66565b348015610b32575f80fd5b506103a4610b41366004614182565b6001600160a01b039182165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45016020908152604080832093909416825291909152205460ff1690565b348015610b98575f80fd5b506103d3610ba73660046141aa565b611b76565b348015610bb7575f80fd5b506103d3610bc6366004613a82565b611c12565b348015610bd6575f80fd5b506103d3610be5366004613b73565b611c4c565b5f8181527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500602090815260408083206001600160a01b03861684529091529020545b92915050565b5f6001600160e01b03198216636cdb3d1360e11b1480610c6257506001600160e01b031982166303a24d0760e21b145b80610c2c57506301ffc9a760e01b6001600160e01b0319831614610c2c565b610c89611811565b6001600160a01b0316336001600160a01b031614158015610cc35750610cad6110df565b6001600160a01b0316336001600160a01b031614155b15610cf457335b6040516332b2baa360e01b81526001600160a01b0390911660048201526024015b60405180910390fd5b610cfe8282611d17565b5050565b610d0a611d68565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80080546001600160a01b031981166001600160a01b03848116918217845560405192169182907ecda3fc6236f0a99e24b2f8e8c6b93be387848c064134c81e09a52ffde031dd905f90a3505050565b610d81611d9a565b610d8e3385858585611ddd565b50505050565b6060610dab5f805160206145228339815191525490565b8210610df95760405162461bcd60e51b815260206004820152601260248201527f556e6c61756e6368656420746f6b656e496400000000000000000000000000006044820152606401610ceb565b610e02826120c5565b610e0b8361219a565b604051602001610e1c9291906141fe565b6040516020818303038152906040529050919050565b604080518082019091525f8082526020820152610e4f8383612237565b9392505050565b336001600160a01b0386168114801590610eb457506001600160a01b038087165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4501602090815260408083209385168352929052205460ff16155b15610ee55760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610ceb565b610ef286868686866122b0565b505050505050565b610f02611811565b6001600160a01b0316336001600160a01b031614158015610f3c5750610f266110df565b6001600160a01b0316336001600160a01b031614155b15610f475733610cca565b5f80516020614522833981519152811580610f7157505f8381526001820160205260409020548210155b610fe35760405162461bcd60e51b815260206004820152602e60248201527f4d6178206d696e7420636f756e742063616e6e6f74206265206c65737320746860448201527f616e20746f74616c537570706c790000000000000000000000000000000000006064820152608401610ceb565b5f838152600382016020526040908190208390555183907f5c65b22b406e1f2f84a1811edea90ce0857a5332b193617170bcec027ee2ab60906110299085815260200190565b60405180910390a2505050565b5f8161104184612315565b610e4f9190614253565b5f807f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48005b5f9384526020525050604090205490565b611088611d68565b61109061239f565b565b5f807f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48005b5f9384526001016020525050604090205490565b5f805f805160206145428339815191526110b6565b5f807f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8005b546001600160a01b031692915050565b606081518351146111445781518351604051635b05999160e01b815260048101929092526024820152604401610ceb565b5f835167ffffffffffffffff81111561115f5761115f613bb4565b604051908082528060200260200182016040528015611188578160200160208202803683370190505b5090505f5b84518110156111de576020808202860101516111b190602080840287010151610bea565b8282815181106111c3576111c361426a565b60209081029190910101526111d78161427e565b905061118d565b509392505050565b6111ee612411565b6111f7826124c8565b610cfe82826124d0565b5f61120a61259f565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611237611d68565b611240816125e8565b50565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f8115801561128d5750825b90505f8267ffffffffffffffff1660011480156112a95750303b155b9050811580156112b7575080155b156112d55760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561130957845468ff00000000000000001916680100000000000000001785555b6001600160a01b0388166113705760405162461bcd60e51b815260206004820152602860248201527f506c6174666f726d2074726561737572792063616e6e6f74206265207a65726f604482015267206164647265737360c01b6064820152608401610ceb565b61137986612634565b5f6001600160a01b038b1661138e5733611390565b8a5b905061139b81612645565b6113a3612656565b6113ab61265e565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80080546001600160a01b038c81166001600160a01b0319928316811784557f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80180548e84169416939093179092557f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8028b9055604051908e16907fc49ed4d6a81dc74cf9d314816ff9aac82459bf2df1d09deeea325926db8dad2390611474908e908e908e90614296565b60405180910390a3505083156114c957845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050505050565b6114dd611d68565b6110905f61266e565b6114ee611d68565b6001600160a01b0381166115555760405162461bcd60e51b815260206004820152602860248201527f506c6174666f726d2074726561737572792063616e6e6f74206265207a65726f604482015267206164647265737360c01b6064820152608401610ceb565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80180546001600160a01b0319166001600160a01b0383169081179091556040517f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80091907f12de9f176be7b6937fc09a862c8e2c1bed929fa02f522d115e46b71bcce032e6905f90a25050565b5f6115ea611811565b6001600160a01b0316336001600160a01b031614158015611624575061160e6110df565b6001600160a01b0316336001600160a01b031614155b1561162f5733610cca565b5f851161167e5760405162461bcd60e51b815260206004820152601a60248201527f737461727454696d65206d757374206265206e6f6e2d7a65726f0000000000006044820152606401610ceb565b61168c8787878787876126de565b979650505050505050565b61169f611d68565b6110906127f5565b6116af611811565b6001600160a01b0316336001600160a01b0316141580156116e957506116d36110df565b6001600160a01b0316336001600160a01b031614155b156116f45733610cca565b5f8281527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390160205260409020545f8051602061452283398151915290156117ba575f8381526005820160205260409020548210156117ba5760405162461bcd60e51b815260206004820152603360248201527f4f6e6c7920696e637265617365732061726520737570706f72746564206f6e6360448201527f65206d696e74696e672068617320626567756e000000000000000000000000006064820152608401610ceb565b5f838152600582016020526040908190208390555183907fb17e9c61928affca049fcda275468c6b630d0e16341d53638ae55cbab206e64c906110299085815260200190565b611808613993565b610c2c82612850565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300611103565b611841611811565b6001600160a01b0316336001600160a01b03161415801561187b57506118656110df565b6001600160a01b0316336001600160a01b031614155b156118865733610cca565b610cfe82826129d0565b611898611811565b6001600160a01b0316336001600160a01b0316141580156118d257506118bc6110df565b6001600160a01b0316336001600160a01b031614155b156118dd5733610cca565b610cfe8282612a4d565b610cfe338383612abe565b6118fa611811565b6001600160a01b0316336001600160a01b031614158015611934575061191e6110df565b6001600160a01b0316336001600160a01b031614155b1561193f5733610cca565b610cfe8282612b76565b60605f8267ffffffffffffffff81111561196557611965613bb4565b60405190808252806020026020018201604052801561199e57816020015b61198b613993565b8152602001906001900390816119835790505b5090505f5b838110156111de576119cc8585838181106119c0576119c061426a565b90506020020135612850565b8282815181106119de576119de61426a565b602002602001018190525080806119f49061427e565b9150506119a3565b33611a08818484612bfa565b505050565b611a15611811565b6001600160a01b0316336001600160a01b031614158015611a4f5750611a396110df565b6001600160a01b0316336001600160a01b031614155b15611a5a5733610cca565b610cfe8282612c60565b5f805f805160206145228339815191526110b6565b611a81611811565b6001600160a01b0316336001600160a01b031614158015611abb5750611aa56110df565b6001600160a01b0316336001600160a01b031614155b15611ac65733610cca565b610cfe8282612cc4565b5f8181527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0160205260408120545f80516020614542833981519152908203611b3e577f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80254610e4f565b610e4f565b5f92835260010160205250604090205490565b5f805f8051602061454283398151915261106f565b6060611b715f6120c5565b905090565b336001600160a01b0386168114801590611bd457506001600160a01b038087165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4501602090815260408083209385168352929052205460ff16155b15611c055760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610ceb565b610ef28686868686612d4e565b611c1a611d68565b6001600160a01b038116611c4357604051631e4fbdf760e01b81525f6004820152602401610ceb565b6112408161266e565b611c54611811565b6001600160a01b0316336001600160a01b031614158015611c8e5750611c786110df565b6001600160a01b0316336001600160a01b031614155b15611c995733610cca565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8028190556040805182815290517f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba800917fe02707b071dad6ab281cf8160bde69412592c2d43f9e37013ca878a41e15e4d1919081900360200190a15050565b5f8281525f8051602061454283398151915260208181526040928390208490559151838152909184917ffa860dd63d85902fc0ba4ae2b8f64c4343dec1bae82e1506af15116baf165b179101611029565b33611d71611811565b6001600160a01b0316146110905760405163118cdaa760e01b8152336004820152602401610ceb565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156110905760405163d93c066560e01b815260040160405180910390fd5b5f611de78561104b565b90508015801590611df85750804210155b611e445760405162461bcd60e51b815260206004820152601360248201527f4d696e74696e67206e6f742073746172746564000000000000000000000000006044820152606401610ceb565b5f611e4e86611092565b9050801580611e5d5750804211155b611e995760405162461bcd60e51b815260206004820152600d60248201526c135a5b9d1a5b99c8195b991959609a1b6044820152606401610ceb565b5f8681527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3903602052604081205490611ed088611a64565b9050811580611ee8575081611ee588836142bd565b11155b611f345760405162461bcd60e51b815260206004820152601e60248201527f52656163686564206d617820737570706c7920666f7220746f6b656e496400006044820152606401610ceb565b5f8881527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3904602090815260408083206001600160a01b038d1684528252808320548b84527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390590925290912054801580611fb6575080611fb38a846142bd565b11155b6120025760405162461bcd60e51b815260206004820152601d60248201527f52656163686564206d6178206d696e747320666f7220616464726573730000006044820152606401610ceb565b61200c8a8a612dda565b5f805160206145228339815191526120248a856142bd565b5f8c815260018301602052604090205561203e8a846142bd565b816004015f8d81526020019081526020015f205f8e6001600160a01b03166001600160a01b031681526020019081526020015f20819055506120b78c8c8c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061300392505050565b505050505050505050505050565b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450280546060917f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450091612116906142d0565b80601f0160208091040260200160405190810160405280929190818152602001828054612142906142d0565b801561218d5780601f106121645761010080835404028352916020019161218d565b820191905f5260205f20905b81548152906001019060200180831161217057829003601f168201915b5050505050915050919050565b60605f6121a68361305e565b60010190505f8167ffffffffffffffff8111156121c5576121c5613bb4565b6040519080825280601f01601f1916602001820160405280156121ef576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846121f957509392505050565b6040805180820182525f80825260208083018290528582527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390481528382206001600160a01b038616835290529182205490916122938486610bea565b604080518082019091529081526020810192909252509392505050565b6001600160a01b0384166122d957604051632bfa23e760e11b81525f6004820152602401610ceb565b6001600160a01b03851661230157604051626a0d4560e21b81525f6004820152602401610ceb565b61230e858585858561313f565b5050505050565b5f8181525f8051602061454283398151915260208181526040808420547f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a01909252832054808403612395577f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8025461238c90836142bd565b95945050505050565b61238c81836142bd565b6123a7613192565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806124aa57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661249e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b156110905760405163703e46dd60e11b815260040160405180910390fd5b611240611d68565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561252a575060408051601f3d908101601f1916820190925261252791810190614308565b60015b61255257604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610ceb565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461259557604051632a87526960e21b815260048101829052602401610ceb565b611a0883836131d4565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146110905760405163703e46dd60e11b815260040160405180910390fd5b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4502611a088382614364565b61263c613229565b61124081613277565b61264d613229565b6112408161327f565b611090613229565b612666613229565b611090613287565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f80851161272e5760405162461bcd60e51b815260206004820152601a60248201527f737461727454696d65206d757374206265206e6f6e2d7a65726f0000000000006044820152606401610ceb565b5f6127376132ba565b90508715612749576127498189611d17565b6001600160a01b03871615612762576127628188612cc4565b61276c8187612c60565b841561277c5761277c8186612b76565b831561278c5761278c8185612a4d565b821561279c5761279c81846129d0565b60408051898152602081018690528415158183015290516001600160a01b0389169183917f518e2426b7fd057dfa47b4fddd222c8e6ba75b7f68fc5f7cb3c852784a57c04c9181900360600190a3979650505050505050565b6127fd611d9a565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336123f3565b612858613993565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e480060208181526040808420547f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48018352818520548251610160810184525f805160206145428339815191528086528488205482528988527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a028652848820546001600160a01b0316828701528988527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0190955295839020549286019290925291935f805160206145228339815191529291906060810161295989612315565b81526020808201949094526040808201939093525f8981526001860185528381205460608301528981526003860185528381205460808301528981526005860185528381205460a083015289815260028601909452919092205460ff16151560c0820152915490951060e090910152509192915050565b5f8281527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f39026020908152604091829020805460ff191684151590811790915591519182525f805160206145228339815191529184917fc0c9609e8b2ddd6a2bd13fa65cf4fa35f10ad14f8694c462c87b1d0ac4e026789101611029565b5f8281527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a01602090815260409182902083905590518281525f805160206145428339815191529184917f7532cd4c28b9e7d588651209836f585939f7a99bc6c24869d999b0784db590e39101611029565b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45006001600160a01b038316612b075760405162ced3e160e81b81525f6004820152602401610ceb565b6001600160a01b038481165f818152600184016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e4801602090815260409182902083905590518281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48009184917fe9ae05cc1582d9ee99cf7d6369687bad563b1a420fd5e9de38f5e063457a99069101611029565b6001600160a01b038316612c2257604051626a0d4560e21b81525f6004820152602401610ceb565b604080516001808252602082018590528183019081526060820184905260a082019092525f6080820181815291929161230e9187918590859061313f565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e480060208181526040928390208490559151838152909184917f229a47a590a5e543f42b381d9c7913437d6a22cbea20cdaa6c3fb425ce9ac28a9101611029565b5f8281527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a02602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915591519182525f805160206145428339815191529184917f0eb30f2a8ae69d9fb08320abde90746b2b7637ffcfc3c768448d1469d17c37a19101611029565b6001600160a01b038416612d7757604051632bfa23e760e11b81525f6004820152602401610ceb565b6001600160a01b038516612d9f57604051626a0d4560e21b81525f6004820152602401610ceb565b60408051600180825260208201869052818301908152606082018590526080820190925290612dd1878784848761313f565b50505050505050565b80612de483612315565b612dee9190614253565b341015612e3d5760405162461bcd60e51b815260206004820152601860248201527f57726f6e6720616d6f756e74206f66204554482073656e7400000000000000006044820152606401610ceb565b5f612e4783611b51565b5f8481527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0260205260409020547f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba801549192506001600160a01b039081169116348315801590612ebe57506001600160a01b03831615155b15612f6757612ecd8482614420565b90505f836001600160a01b0316856040515f6040518083038185875af1925050503d805f8114612f18576040519150601f19603f3d011682016040523d82523d5f602084013e612f1d565b606091505b5050905080612f655760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610ceb565b505b8015610ef2575f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612fb6576040519150601f19603f3d011682016040523d82523d5f602084013e612fbb565b606091505b5050905080612dd15760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610ceb565b6001600160a01b03841661302c57604051632bfa23e760e11b81525f6004820152602401610ceb565b60408051600180825260208201869052818301908152606082018590526080820190925290610ef25f8784848761313f565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106130a6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106130d2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106130f057662386f26fc10000830492506010015b6305f5e1008310613108576305f5e100830492506008015b612710831061311c57612710830492506004015b6064831061312e576064830492506002015b600a8310610c2c5760010192915050565b61314b858585856132e5565b6001600160a01b0384161561230e5782513390600103613184576020848101519084015161317d8389898585896133d2565b5050610ef2565b610ef28187878787876134f3565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1661109057604051638dfc202b60e01b815260040160405180910390fd5b6131dd826135da565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561322157611a088282613650565b610cfe6136b9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1661109057604051631afcd79f60e31b815260040160405180910390fd5b611237613229565b611c1a613229565b61328f613229565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff19169055565b5f8051602061452283398151915280545f91908082846132d98361427e565b90915550909392505050565b5f805160206145228339815191525f5b83518110156133c5575f8482815181106133115761331161426a565b6020908102919091018101515f8181526002860190925260409091205490915060ff16156133b4576001600160a01b038716158061335657506001600160a01b038616155b6133b45760405162461bcd60e51b815260206004820152602960248201527f536f756c626f756e6420746f6b656e2069642063616e6e6f74206265207472616044820152683739b332b93932b21760b91b6064820152608401610ceb565b506133be8161427e565b90506132f5565b5061230e858585856136d8565b6001600160a01b0384163b15610ef25760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906134169089908990889088908890600401614433565b6020604051808303815f875af1925050508015613450575060408051601f3d908101601f1916820190925261344d9181019061446a565b60015b6134b7573d80801561347d576040519150601f19603f3d011682016040523d82523d5f602084013e613482565b606091505b5080515f036134af57604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b14612dd157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b6001600160a01b0384163b15610ef25760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906135379089908990889088908890600401614485565b6020604051808303815f875af1925050508015613571575060408051601f3d908101601f1916820190925261356e9181019061446a565b60015b61359e573d80801561347d576040519150601f19603f3d011682016040523d82523d5f602084013e613482565b6001600160e01b0319811663bc197c8160e01b14612dd157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b806001600160a01b03163b5f0361360f57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610ceb565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161366c91906144e2565b5f60405180830381855af49150503d805f81146136a4576040519150601f19603f3d011682016040523d82523d5f602084013e6136a9565b606091505b509150915061238c858383613913565b34156110905760405163b398979f60e01b815260040160405180910390fd5b805182517f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450091146137295782518251604051635b05999160e01b815260048101929092526024820152604401610ceb565b335f5b8451811015613834576020818102868101820151908601909101516001600160a01b038916156137dd575f828152602086815260408083206001600160a01b038d168452909152902054818110156137b7576040516303dee4c560e01b81526001600160a01b038b166004820152602481018290526044810183905260648101849052608401610ceb565b5f838152602087815260408083206001600160a01b038e16845290915290209082900390555b6001600160a01b03881615613821575f828152602086815260408083206001600160a01b038c1684529091528120805483929061381b9084906142bd565b90915550505b50508061382d9061427e565b905061372c565b5083516001036138b45760208401515f906020850151909150866001600160a01b0316886001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6285856040516138a5929190918252602082015260400190565b60405180910390a45050610ef2565b846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516139039291906144fd565b60405180910390a4505050505050565b60608261392357611b398261396a565b815115801561393a57506001600160a01b0384163b155b1561396357604051639996b31560e01b81526001600160a01b0385166004820152602401610ceb565b5092915050565b80511561397a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518061016001604052805f81526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f151581526020015f151581525090565b80356001600160a01b0381168114613a05575f80fd5b919050565b5f8060408385031215613a1b575f80fd5b613a24836139ef565b946020939093013593505050565b6001600160e01b031981168114611240575f80fd5b5f60208284031215613a57575f80fd5b8135610e4f81613a32565b5f8060408385031215613a73575f80fd5b50508035926020909101359150565b5f60208284031215613a92575f80fd5b610e4f826139ef565b5f5b83811015613ab5578181015183820152602001613a9d565b50505f910152565b5f8151808452613ad4816020860160208601613a9b565b601f01601f19169290920160200192915050565b602081525f610e4f6020830184613abd565b5f805f8060608587031215613b0d575f80fd5b8435935060208501359250604085013567ffffffffffffffff80821115613b32575f80fd5b818701915087601f830112613b45575f80fd5b813581811115613b53575f80fd5b886020828501011115613b64575f80fd5b95989497505060200194505050565b5f60208284031215613b83575f80fd5b5035919050565b5f8060408385031215613b9b575f80fd5b82359150613bab602084016139ef565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613bf157613bf1613bb4565b604052919050565b5f67ffffffffffffffff821115613c1257613c12613bb4565b5060051b60200190565b5f82601f830112613c2b575f80fd5b81356020613c40613c3b83613bf9565b613bc8565b82815260059290921b84018101918181019086841115613c5e575f80fd5b8286015b84811015613c795780358352918301918301613c62565b509695505050505050565b5f82601f830112613c93575f80fd5b813567ffffffffffffffff811115613cad57613cad613bb4565b613cc0601f8201601f1916602001613bc8565b818152846020838601011115613cd4575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f60a08688031215613d04575f80fd5b613d0d866139ef565b9450613d1b602087016139ef565b9350604086013567ffffffffffffffff80821115613d37575f80fd5b613d4389838a01613c1c565b94506060880135915080821115613d58575f80fd5b613d6489838a01613c1c565b93506080880135915080821115613d79575f80fd5b50613d8688828901613c84565b9150509295509295909350565b5f8060408385031215613da4575f80fd5b823567ffffffffffffffff80821115613dbb575f80fd5b818501915085601f830112613dce575f80fd5b81356020613dde613c3b83613bf9565b82815260059290921b84018101918181019089841115613dfc575f80fd5b948201945b83861015613e2157613e12866139ef565b82529482019490820190613e01565b96505086013592505080821115613e36575f80fd5b50613e4385828601613c1c565b9150509250929050565b5f8151808452602080850194508084015f5b83811015613e7b57815187529582019590820190600101613e5f565b509495945050505050565b602081525f610e4f6020830184613e4d565b5f8060408385031215613ea9575f80fd5b613eb2836139ef565b9150602083013567ffffffffffffffff811115613ecd575f80fd5b613e4385828601613c84565b5f60208284031215613ee9575f80fd5b813567ffffffffffffffff811115613eff575f80fd5b613f0b84828501613c84565b949350505050565b5f805f805f60a08688031215613f27575f80fd5b613f30866139ef565b9450613f3e602087016139ef565b9350613f4c604087016139ef565b925060608601359150608086013567ffffffffffffffff811115613f6e575f80fd5b613d8688828901613c84565b80358015158114613a05575f80fd5b5f805f805f8060c08789031215613f9e575f80fd5b86359550613fae602088016139ef565b9450604087013593506060870135925060808701359150613fd160a08801613f7a565b90509295509295509295565b805182526020810151613ffb60208401826001600160a01b03169052565b5060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516140588285018215159052565b50506101408181015180151584830152610d8e565b6101608101610c2c8284613fdd565b5f806040838503121561408d575f80fd5b82359150613bab60208401613f7a565b5f80604083850312156140ae575f80fd5b6140b7836139ef565b9150613bab60208401613f7a565b5f80602083850312156140d6575f80fd5b823567ffffffffffffffff808211156140ed575f80fd5b818501915085601f830112614100575f80fd5b81358181111561410e575f80fd5b8660208260051b8501011115614122575f80fd5b60209290920196919550909350505050565b602080825282518282018190525f9190848201906040850190845b8181101561417657614162838551613fdd565b92840192610160929092019160010161414f565b50909695505050505050565b5f8060408385031215614193575f80fd5b61419c836139ef565b9150613bab602084016139ef565b5f805f805f60a086880312156141be575f80fd5b6141c7866139ef565b94506141d5602087016139ef565b93506040860135925060608601359150608086013567ffffffffffffffff811115613f6e575f80fd5b5f835161420f818460208801613a9b565b662f746f6b656e2f60c81b9083019081528351614233816007840160208801613a9b565b01600701949350505050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610c2c57610c2c61423f565b634e487b7160e01b5f52603260045260245ffd5b5f6001820161428f5761428f61423f565b5060010190565b6001600160a01b0384168152826020820152606060408201525f61238c6060830184613abd565b80820180821115610c2c57610c2c61423f565b600181811c908216806142e457607f821691505b60208210810361430257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215614318575f80fd5b5051919050565b601f821115611a08575f81815260208120601f850160051c810160208610156143455750805b601f850160051c820191505b81811015610ef257828155600101614351565b815167ffffffffffffffff81111561437e5761437e613bb4565b6143928161438c84546142d0565b8461431f565b602080601f8311600181146143c5575f84156143ae5750858301515b5f19600386901b1c1916600185901b178555610ef2565b5f85815260208120601f198616915b828110156143f3578886015182559484019460019091019084016143d4565b508582101561441057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610c2c57610c2c61423f565b5f6001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261168c60a0830184613abd565b5f6020828403121561447a575f80fd5b8151610e4f81613a32565b5f6001600160a01b03808816835280871660208401525060a060408301526144b060a0830186613e4d565b82810360608401526144c28186613e4d565b905082810360808401526144d68185613abd565b98975050505050505050565b5f82516144f3818460208701613a9b565b9190910192915050565b604081525f61450f6040830185613e4d565b828103602084015261238c8185613e4d56fe9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f39005d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a00a2646970667358221220cd5064c058affc276956e7e0c3a57a03ed89fd1a9cfb20808274c6839ad0b41f64736f6c63430008140033
Deployed Bytecode
0x60806040526004361061034f575f3560e01c8063804b6ba3116101bd578063b8867332116100f2578063e138818c11610092578063e985e9c51161006d578063e985e9c514610b27578063f242432a14610b8d578063f2fde38b14610bac578063fdd950c114610bcb575f80fd5b8063e138818c14610ab8578063e6a72acf14610af4578063e8a3d48514610b13575f80fd5b8063c0fe8a39116100cd578063c0fe8a39146109c7578063c61df6a6146109e6578063d144844c14610a46578063d97939eb14610a99575f80fd5b8063b88673321461093f578063ba278e0814610989578063bd85b039146109a8575f80fd5b8063966d964b1161015d578063abfbac4b11610138578063abfbac4b146108a5578063ad3cb1cc146108c4578063b346cbfc146108f4578063b390c0ab14610920575f80fd5b8063966d964b146108485780639aa3b05614610867578063a22cb46514610886575f80fd5b80638c7a63ae116101985780638c7a63ae146107915780638da5cb5b146107bd578063911ec470146107d157806395d89b411461081e575f80fd5b8063804b6ba31461073f5780638456cb591461075e57806384d70c4114610772575f80fd5b80633ec4c9681161029357806352d1902d116102335780636cfa2a821161020e5780636cfa2a82146106cd578063715018a6146106ec57806375794a3c146107005780637cd86d6014610720575f80fd5b806352d1902d1461066457806355f804b3146106785780635c975abb14610697575f80fd5b806348b9994e1161026e57806348b9994e146105da5780634bde38c8146105f95780634e1273f4146106255780634f1ef28614610651575f80fd5b80633ec4c968146105885780633f4ba83a146105a757806344c816fa146105bb575f80fd5b80630e89341c116102fe5780631c34212c116102d95780631c34212c146104f85780632eb2c2d61461052b578063387fa5491461054a578063395d613414610569575f80fd5b80630e89341c146104555780631069f3b51461047457806311f09249146104ae575f80fd5b8063046c15531161032e578063046c1553146103d557806306fdde03146103f457806308dc9f4214610442575f80fd5b8062fdd58e1461035357806301ffc9a7146103855780630442bfa8146103b4575b5f80fd5b34801561035e575f80fd5b5061037261036d366004613a0a565b610bea565b6040519081526020015b60405180910390f35b348015610390575f80fd5b506103a461039f366004613a47565b610c32565b604051901515815260200161037c565b3480156103bf575f80fd5b506103d36103ce366004613a62565b610c81565b005b3480156103e0575f80fd5b506103d36103ef366004613a82565b610d02565b3480156103ff575f80fd5b5060408051808201909152601c81527f4d65676170686f6e6520526567697374726174696f6e2042616467650000000060208201525b60405161037c9190613ae8565b6103d3610450366004613afa565b610d79565b348015610460575f80fd5b5061043561046f366004613b73565b610d94565b34801561047f575f80fd5b5061049361048e366004613b8a565b610e32565b6040805182518152602092830151928101929092520161037c565b3480156104b9575f80fd5b506103726104c8366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3903602052604090205490565b348015610503575f80fd5b507f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80254610372565b348015610536575f80fd5b506103d3610545366004613cf0565b610e56565b348015610555575f80fd5b506103d3610564366004613a62565b610efa565b348015610574575f80fd5b50610372610583366004613a62565b611036565b348015610593575f80fd5b506103726105a2366004613b73565b61104b565b3480156105b2575f80fd5b506103d3611080565b3480156105c6575f80fd5b506103726105d5366004613b73565b611092565b3480156105e5575f80fd5b506103726105f4366004613b73565b6110ca565b348015610604575f80fd5b5061060d6110df565b6040516001600160a01b03909116815260200161037c565b348015610630575f80fd5b5061064461063f366004613d93565b611113565b60405161037c9190613e86565b6103d361065f366004613e98565b6111e6565b34801561066f575f80fd5b50610372611201565b348015610683575f80fd5b506103d3610692366004613ed9565b61122f565b3480156106a2575f80fd5b507fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff166103a4565b3480156106d8575f80fd5b506103d36106e7366004613f13565b611243565b3480156106f7575f80fd5b506103d36114d5565b34801561070b575f80fd5b505f8051602061452283398151915254610372565b34801561072b575f80fd5b506103d361073a366004613a82565b6114e6565b34801561074a575f80fd5b50610372610759366004613f89565b6115e1565b348015610769575f80fd5b506103d3611697565b34801561077d575f80fd5b506103d361078c366004613a62565b6116a7565b34801561079c575f80fd5b506107b06107ab366004613b73565b611800565b60405161037c919061406d565b3480156107c8575f80fd5b5061060d611811565b3480156107dc575f80fd5b506103a46107eb366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3902602052604090205460ff1690565b348015610829575f80fd5b5060408051808201909152600281526126a160f11b6020820152610435565b348015610853575f80fd5b506103d361086236600461407c565b611839565b348015610872575f80fd5b506103d3610881366004613a62565b611890565b348015610891575f80fd5b506103d36108a036600461409d565b6118e7565b3480156108b0575f80fd5b506103d36108bf366004613a62565b6118f2565b3480156108cf575f80fd5b50610435604051806040016040528060058152602001640352e302e360dc1b81525081565b3480156108ff575f80fd5b5061091361090e3660046140c5565b611949565b60405161037c9190614134565b34801561092b575f80fd5b506103d361093a366004613a62565b6119fc565b34801561094a575f80fd5b50610372610959366004613b73565b5f9081527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3905602052604090205490565b348015610994575f80fd5b506103d36109a3366004613a62565b611a0d565b3480156109b3575f80fd5b506103726109c2366004613b73565b611a64565b3480156109d2575f80fd5b506103d36109e1366004613b8a565b611a79565b3480156109f1575f80fd5b50610372610a00366004613b8a565b5f9182527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3904602090815260408084206001600160a01b0393909316845291905290205490565b348015610a51575f80fd5b5061060d610a60366004613b73565b5f9081527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0260205260409020546001600160a01b031690565b348015610aa4575f80fd5b50610372610ab3366004613b73565b611ad0565b348015610ac3575f80fd5b507f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba801546001600160a01b031661060d565b348015610aff575f80fd5b50610372610b0e366004613b73565b611b51565b348015610b1e575f80fd5b50610435611b66565b348015610b32575f80fd5b506103a4610b41366004614182565b6001600160a01b039182165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45016020908152604080832093909416825291909152205460ff1690565b348015610b98575f80fd5b506103d3610ba73660046141aa565b611b76565b348015610bb7575f80fd5b506103d3610bc6366004613a82565b611c12565b348015610bd6575f80fd5b506103d3610be5366004613b73565b611c4c565b5f8181527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4500602090815260408083206001600160a01b03861684529091529020545b92915050565b5f6001600160e01b03198216636cdb3d1360e11b1480610c6257506001600160e01b031982166303a24d0760e21b145b80610c2c57506301ffc9a760e01b6001600160e01b0319831614610c2c565b610c89611811565b6001600160a01b0316336001600160a01b031614158015610cc35750610cad6110df565b6001600160a01b0316336001600160a01b031614155b15610cf457335b6040516332b2baa360e01b81526001600160a01b0390911660048201526024015b60405180910390fd5b610cfe8282611d17565b5050565b610d0a611d68565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80080546001600160a01b031981166001600160a01b03848116918217845560405192169182907ecda3fc6236f0a99e24b2f8e8c6b93be387848c064134c81e09a52ffde031dd905f90a3505050565b610d81611d9a565b610d8e3385858585611ddd565b50505050565b6060610dab5f805160206145228339815191525490565b8210610df95760405162461bcd60e51b815260206004820152601260248201527f556e6c61756e6368656420746f6b656e496400000000000000000000000000006044820152606401610ceb565b610e02826120c5565b610e0b8361219a565b604051602001610e1c9291906141fe565b6040516020818303038152906040529050919050565b604080518082019091525f8082526020820152610e4f8383612237565b9392505050565b336001600160a01b0386168114801590610eb457506001600160a01b038087165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4501602090815260408083209385168352929052205460ff16155b15610ee55760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610ceb565b610ef286868686866122b0565b505050505050565b610f02611811565b6001600160a01b0316336001600160a01b031614158015610f3c5750610f266110df565b6001600160a01b0316336001600160a01b031614155b15610f475733610cca565b5f80516020614522833981519152811580610f7157505f8381526001820160205260409020548210155b610fe35760405162461bcd60e51b815260206004820152602e60248201527f4d6178206d696e7420636f756e742063616e6e6f74206265206c65737320746860448201527f616e20746f74616c537570706c790000000000000000000000000000000000006064820152608401610ceb565b5f838152600382016020526040908190208390555183907f5c65b22b406e1f2f84a1811edea90ce0857a5332b193617170bcec027ee2ab60906110299085815260200190565b60405180910390a2505050565b5f8161104184612315565b610e4f9190614253565b5f807f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48005b5f9384526020525050604090205490565b611088611d68565b61109061239f565b565b5f807f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48005b5f9384526001016020525050604090205490565b5f805f805160206145428339815191526110b6565b5f807f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8005b546001600160a01b031692915050565b606081518351146111445781518351604051635b05999160e01b815260048101929092526024820152604401610ceb565b5f835167ffffffffffffffff81111561115f5761115f613bb4565b604051908082528060200260200182016040528015611188578160200160208202803683370190505b5090505f5b84518110156111de576020808202860101516111b190602080840287010151610bea565b8282815181106111c3576111c361426a565b60209081029190910101526111d78161427e565b905061118d565b509392505050565b6111ee612411565b6111f7826124c8565b610cfe82826124d0565b5f61120a61259f565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b611237611d68565b611240816125e8565b50565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff165f8115801561128d5750825b90505f8267ffffffffffffffff1660011480156112a95750303b155b9050811580156112b7575080155b156112d55760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561130957845468ff00000000000000001916680100000000000000001785555b6001600160a01b0388166113705760405162461bcd60e51b815260206004820152602860248201527f506c6174666f726d2074726561737572792063616e6e6f74206265207a65726f604482015267206164647265737360c01b6064820152608401610ceb565b61137986612634565b5f6001600160a01b038b1661138e5733611390565b8a5b905061139b81612645565b6113a3612656565b6113ab61265e565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80080546001600160a01b038c81166001600160a01b0319928316811784557f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80180548e84169416939093179092557f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8028b9055604051908e16907fc49ed4d6a81dc74cf9d314816ff9aac82459bf2df1d09deeea325926db8dad2390611474908e908e908e90614296565b60405180910390a3505083156114c957845468ff000000000000000019168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050505050565b6114dd611d68565b6110905f61266e565b6114ee611d68565b6001600160a01b0381166115555760405162461bcd60e51b815260206004820152602860248201527f506c6174666f726d2074726561737572792063616e6e6f74206265207a65726f604482015267206164647265737360c01b6064820152608401610ceb565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80180546001600160a01b0319166001600160a01b0383169081179091556040517f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80091907f12de9f176be7b6937fc09a862c8e2c1bed929fa02f522d115e46b71bcce032e6905f90a25050565b5f6115ea611811565b6001600160a01b0316336001600160a01b031614158015611624575061160e6110df565b6001600160a01b0316336001600160a01b031614155b1561162f5733610cca565b5f851161167e5760405162461bcd60e51b815260206004820152601a60248201527f737461727454696d65206d757374206265206e6f6e2d7a65726f0000000000006044820152606401610ceb565b61168c8787878787876126de565b979650505050505050565b61169f611d68565b6110906127f5565b6116af611811565b6001600160a01b0316336001600160a01b0316141580156116e957506116d36110df565b6001600160a01b0316336001600160a01b031614155b156116f45733610cca565b5f8281527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390160205260409020545f8051602061452283398151915290156117ba575f8381526005820160205260409020548210156117ba5760405162461bcd60e51b815260206004820152603360248201527f4f6e6c7920696e637265617365732061726520737570706f72746564206f6e6360448201527f65206d696e74696e672068617320626567756e000000000000000000000000006064820152608401610ceb565b5f838152600582016020526040908190208390555183907fb17e9c61928affca049fcda275468c6b630d0e16341d53638ae55cbab206e64c906110299085815260200190565b611808613993565b610c2c82612850565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300611103565b611841611811565b6001600160a01b0316336001600160a01b03161415801561187b57506118656110df565b6001600160a01b0316336001600160a01b031614155b156118865733610cca565b610cfe82826129d0565b611898611811565b6001600160a01b0316336001600160a01b0316141580156118d257506118bc6110df565b6001600160a01b0316336001600160a01b031614155b156118dd5733610cca565b610cfe8282612a4d565b610cfe338383612abe565b6118fa611811565b6001600160a01b0316336001600160a01b031614158015611934575061191e6110df565b6001600160a01b0316336001600160a01b031614155b1561193f5733610cca565b610cfe8282612b76565b60605f8267ffffffffffffffff81111561196557611965613bb4565b60405190808252806020026020018201604052801561199e57816020015b61198b613993565b8152602001906001900390816119835790505b5090505f5b838110156111de576119cc8585838181106119c0576119c061426a565b90506020020135612850565b8282815181106119de576119de61426a565b602002602001018190525080806119f49061427e565b9150506119a3565b33611a08818484612bfa565b505050565b611a15611811565b6001600160a01b0316336001600160a01b031614158015611a4f5750611a396110df565b6001600160a01b0316336001600160a01b031614155b15611a5a5733610cca565b610cfe8282612c60565b5f805f805160206145228339815191526110b6565b611a81611811565b6001600160a01b0316336001600160a01b031614158015611abb5750611aa56110df565b6001600160a01b0316336001600160a01b031614155b15611ac65733610cca565b610cfe8282612cc4565b5f8181527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0160205260408120545f80516020614542833981519152908203611b3e577f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba80254610e4f565b610e4f565b5f92835260010160205250604090205490565b5f805f8051602061454283398151915261106f565b6060611b715f6120c5565b905090565b336001600160a01b0386168114801590611bd457506001600160a01b038087165f9081527f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4501602090815260408083209385168352929052205460ff16155b15611c055760405163711bec9160e11b81526001600160a01b03808316600483015287166024820152604401610ceb565b610ef28686868686612d4e565b611c1a611d68565b6001600160a01b038116611c4357604051631e4fbdf760e01b81525f6004820152602401610ceb565b6112408161266e565b611c54611811565b6001600160a01b0316336001600160a01b031614158015611c8e5750611c786110df565b6001600160a01b0316336001600160a01b031614155b15611c995733610cca565b7f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8028190556040805182815290517f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba800917fe02707b071dad6ab281cf8160bde69412592c2d43f9e37013ca878a41e15e4d1919081900360200190a15050565b5f8281525f8051602061454283398151915260208181526040928390208490559151838152909184917ffa860dd63d85902fc0ba4ae2b8f64c4343dec1bae82e1506af15116baf165b179101611029565b33611d71611811565b6001600160a01b0316146110905760405163118cdaa760e01b8152336004820152602401610ceb565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff16156110905760405163d93c066560e01b815260040160405180910390fd5b5f611de78561104b565b90508015801590611df85750804210155b611e445760405162461bcd60e51b815260206004820152601360248201527f4d696e74696e67206e6f742073746172746564000000000000000000000000006044820152606401610ceb565b5f611e4e86611092565b9050801580611e5d5750804211155b611e995760405162461bcd60e51b815260206004820152600d60248201526c135a5b9d1a5b99c8195b991959609a1b6044820152606401610ceb565b5f8681527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3903602052604081205490611ed088611a64565b9050811580611ee8575081611ee588836142bd565b11155b611f345760405162461bcd60e51b815260206004820152601e60248201527f52656163686564206d617820737570706c7920666f7220746f6b656e496400006044820152606401610ceb565b5f8881527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f3904602090815260408083206001600160a01b038d1684528252808320548b84527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390590925290912054801580611fb6575080611fb38a846142bd565b11155b6120025760405162461bcd60e51b815260206004820152601d60248201527f52656163686564206d6178206d696e747320666f7220616464726573730000006044820152606401610ceb565b61200c8a8a612dda565b5f805160206145228339815191526120248a856142bd565b5f8c815260018301602052604090205561203e8a846142bd565b816004015f8d81526020019081526020015f205f8e6001600160a01b03166001600160a01b031681526020019081526020015f20819055506120b78c8c8c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061300392505050565b505050505050505050505050565b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450280546060917f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450091612116906142d0565b80601f0160208091040260200160405190810160405280929190818152602001828054612142906142d0565b801561218d5780601f106121645761010080835404028352916020019161218d565b820191905f5260205f20905b81548152906001019060200180831161217057829003601f168201915b5050505050915050919050565b60605f6121a68361305e565b60010190505f8167ffffffffffffffff8111156121c5576121c5613bb4565b6040519080825280601f01601f1916602001820160405280156121ef576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846121f957509392505050565b6040805180820182525f80825260208083018290528582527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f390481528382206001600160a01b038616835290529182205490916122938486610bea565b604080518082019091529081526020810192909252509392505050565b6001600160a01b0384166122d957604051632bfa23e760e11b81525f6004820152602401610ceb565b6001600160a01b03851661230157604051626a0d4560e21b81525f6004820152602401610ceb565b61230e858585858561313f565b5050505050565b5f8181525f8051602061454283398151915260208181526040808420547f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a01909252832054808403612395577f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba8025461238c90836142bd565b95945050505050565b61238c81836142bd565b6123a7613192565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a150565b306001600160a01b037f000000000000000000000000f4782430466abaaf8ed81eed5ba75bf976a5c17e1614806124aa57507f000000000000000000000000f4782430466abaaf8ed81eed5ba75bf976a5c17e6001600160a01b031661249e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b156110905760405163703e46dd60e11b815260040160405180910390fd5b611240611d68565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561252a575060408051601f3d908101601f1916820190925261252791810190614308565b60015b61255257604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610ceb565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461259557604051632a87526960e21b815260048101829052602401610ceb565b611a0883836131d4565b306001600160a01b037f000000000000000000000000f4782430466abaaf8ed81eed5ba75bf976a5c17e16146110905760405163703e46dd60e11b815260040160405180910390fd5b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45007f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c4502611a088382614364565b61263c613229565b61124081613277565b61264d613229565b6112408161327f565b611090613229565b612666613229565b611090613287565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b5f80851161272e5760405162461bcd60e51b815260206004820152601a60248201527f737461727454696d65206d757374206265206e6f6e2d7a65726f0000000000006044820152606401610ceb565b5f6127376132ba565b90508715612749576127498189611d17565b6001600160a01b03871615612762576127628188612cc4565b61276c8187612c60565b841561277c5761277c8186612b76565b831561278c5761278c8185612a4d565b821561279c5761279c81846129d0565b60408051898152602081018690528415158183015290516001600160a01b0389169183917f518e2426b7fd057dfa47b4fddd222c8e6ba75b7f68fc5f7cb3c852784a57c04c9181900360600190a3979650505050505050565b6127fd611d9a565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336123f3565b612858613993565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e480060208181526040808420547f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48018352818520548251610160810184525f805160206145428339815191528086528488205482528988527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a028652848820546001600160a01b0316828701528988527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0190955295839020549286019290925291935f805160206145228339815191529291906060810161295989612315565b81526020808201949094526040808201939093525f8981526001860185528381205460608301528981526003860185528381205460808301528981526005860185528381205460a083015289815260028601909452919092205460ff16151560c0820152915490951060e090910152509192915050565b5f8281527f9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f39026020908152604091829020805460ff191684151590811790915591519182525f805160206145228339815191529184917fc0c9609e8b2ddd6a2bd13fa65cf4fa35f10ad14f8694c462c87b1d0ac4e026789101611029565b5f8281527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a01602090815260409182902083905590518281525f805160206145428339815191529184917f7532cd4c28b9e7d588651209836f585939f7a99bc6c24869d999b0784db590e39101611029565b7f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c45006001600160a01b038316612b075760405162ced3e160e81b81525f6004820152602401610ceb565b6001600160a01b038481165f818152600184016020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a350505050565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e4801602090815260409182902083905590518281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e48009184917fe9ae05cc1582d9ee99cf7d6369687bad563b1a420fd5e9de38f5e063457a99069101611029565b6001600160a01b038316612c2257604051626a0d4560e21b81525f6004820152602401610ceb565b604080516001808252602082018590528183019081526060820184905260a082019092525f6080820181815291929161230e9187918590859061313f565b5f8281527f932271af65da9899f9889545f7ce8d309206d75dcf6d9497e56ce02d3a3e480060208181526040928390208490559151838152909184917f229a47a590a5e543f42b381d9c7913437d6a22cbea20cdaa6c3fb425ce9ac28a9101611029565b5f8281527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a02602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915591519182525f805160206145428339815191529184917f0eb30f2a8ae69d9fb08320abde90746b2b7637ffcfc3c768448d1469d17c37a19101611029565b6001600160a01b038416612d7757604051632bfa23e760e11b81525f6004820152602401610ceb565b6001600160a01b038516612d9f57604051626a0d4560e21b81525f6004820152602401610ceb565b60408051600180825260208201869052818301908152606082018590526080820190925290612dd1878784848761313f565b50505050505050565b80612de483612315565b612dee9190614253565b341015612e3d5760405162461bcd60e51b815260206004820152601860248201527f57726f6e6720616d6f756e74206f66204554482073656e7400000000000000006044820152606401610ceb565b5f612e4783611b51565b5f8481527f5d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a0260205260409020547f9af2472612ec9d25305fc4d4f804c4a94480956068442be2c16c929b990ba801549192506001600160a01b039081169116348315801590612ebe57506001600160a01b03831615155b15612f6757612ecd8482614420565b90505f836001600160a01b0316856040515f6040518083038185875af1925050503d805f8114612f18576040519150601f19603f3d011682016040523d82523d5f602084013e612f1d565b606091505b5050905080612f655760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610ceb565b505b8015610ef2575f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114612fb6576040519150601f19603f3d011682016040523d82523d5f602084013e612fbb565b606091505b5050905080612dd15760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610ceb565b6001600160a01b03841661302c57604051632bfa23e760e11b81525f6004820152602401610ceb565b60408051600180825260208201869052818301908152606082018590526080820190925290610ef25f8784848761313f565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106130a6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106130d2576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106130f057662386f26fc10000830492506010015b6305f5e1008310613108576305f5e100830492506008015b612710831061311c57612710830492506004015b6064831061312e576064830492506002015b600a8310610c2c5760010192915050565b61314b858585856132e5565b6001600160a01b0384161561230e5782513390600103613184576020848101519084015161317d8389898585896133d2565b5050610ef2565b610ef28187878787876134f3565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033005460ff1661109057604051638dfc202b60e01b815260040160405180910390fd5b6131dd826135da565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561322157611a088282613650565b610cfe6136b9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005468010000000000000000900460ff1661109057604051631afcd79f60e31b815260040160405180910390fd5b611237613229565b611c1a613229565b61328f613229565b7fcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300805460ff19169055565b5f8051602061452283398151915280545f91908082846132d98361427e565b90915550909392505050565b5f805160206145228339815191525f5b83518110156133c5575f8482815181106133115761331161426a565b6020908102919091018101515f8181526002860190925260409091205490915060ff16156133b4576001600160a01b038716158061335657506001600160a01b038616155b6133b45760405162461bcd60e51b815260206004820152602960248201527f536f756c626f756e6420746f6b656e2069642063616e6e6f74206265207472616044820152683739b332b93932b21760b91b6064820152608401610ceb565b506133be8161427e565b90506132f5565b5061230e858585856136d8565b6001600160a01b0384163b15610ef25760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906134169089908990889088908890600401614433565b6020604051808303815f875af1925050508015613450575060408051601f3d908101601f1916820190925261344d9181019061446a565b60015b6134b7573d80801561347d576040519150601f19603f3d011682016040523d82523d5f602084013e613482565b606091505b5080515f036134af57604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b14612dd157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b6001600160a01b0384163b15610ef25760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906135379089908990889088908890600401614485565b6020604051808303815f875af1925050508015613571575060408051601f3d908101601f1916820190925261356e9181019061446a565b60015b61359e573d80801561347d576040519150601f19603f3d011682016040523d82523d5f602084013e613482565b6001600160e01b0319811663bc197c8160e01b14612dd157604051632bfa23e760e11b81526001600160a01b0386166004820152602401610ceb565b806001600160a01b03163b5f0361360f57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610ceb565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161366c91906144e2565b5f60405180830381855af49150503d805f81146136a4576040519150601f19603f3d011682016040523d82523d5f602084013e6136a9565b606091505b509150915061238c858383613913565b34156110905760405163b398979f60e01b815260040160405180910390fd5b805182517f88be536d5240c274a3b1d3a1be54482fd9caa294f08c62a7cde569f49a3c450091146137295782518251604051635b05999160e01b815260048101929092526024820152604401610ceb565b335f5b8451811015613834576020818102868101820151908601909101516001600160a01b038916156137dd575f828152602086815260408083206001600160a01b038d168452909152902054818110156137b7576040516303dee4c560e01b81526001600160a01b038b166004820152602481018290526044810183905260648101849052608401610ceb565b5f838152602087815260408083206001600160a01b038e16845290915290209082900390555b6001600160a01b03881615613821575f828152602086815260408083206001600160a01b038c1684529091528120805483929061381b9084906142bd565b90915550505b50508061382d9061427e565b905061372c565b5083516001036138b45760208401515f906020850151909150866001600160a01b0316886001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6285856040516138a5929190918252602082015260400190565b60405180910390a45050610ef2565b846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516139039291906144fd565b60405180910390a4505050505050565b60608261392357611b398261396a565b815115801561393a57506001600160a01b0384163b155b1561396357604051639996b31560e01b81526001600160a01b0385166004820152602401610ceb565b5092915050565b80511561397a5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518061016001604052805f81526020015f6001600160a01b031681526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f151581526020015f151581525090565b80356001600160a01b0381168114613a05575f80fd5b919050565b5f8060408385031215613a1b575f80fd5b613a24836139ef565b946020939093013593505050565b6001600160e01b031981168114611240575f80fd5b5f60208284031215613a57575f80fd5b8135610e4f81613a32565b5f8060408385031215613a73575f80fd5b50508035926020909101359150565b5f60208284031215613a92575f80fd5b610e4f826139ef565b5f5b83811015613ab5578181015183820152602001613a9d565b50505f910152565b5f8151808452613ad4816020860160208601613a9b565b601f01601f19169290920160200192915050565b602081525f610e4f6020830184613abd565b5f805f8060608587031215613b0d575f80fd5b8435935060208501359250604085013567ffffffffffffffff80821115613b32575f80fd5b818701915087601f830112613b45575f80fd5b813581811115613b53575f80fd5b886020828501011115613b64575f80fd5b95989497505060200194505050565b5f60208284031215613b83575f80fd5b5035919050565b5f8060408385031215613b9b575f80fd5b82359150613bab602084016139ef565b90509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613bf157613bf1613bb4565b604052919050565b5f67ffffffffffffffff821115613c1257613c12613bb4565b5060051b60200190565b5f82601f830112613c2b575f80fd5b81356020613c40613c3b83613bf9565b613bc8565b82815260059290921b84018101918181019086841115613c5e575f80fd5b8286015b84811015613c795780358352918301918301613c62565b509695505050505050565b5f82601f830112613c93575f80fd5b813567ffffffffffffffff811115613cad57613cad613bb4565b613cc0601f8201601f1916602001613bc8565b818152846020838601011115613cd4575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f60a08688031215613d04575f80fd5b613d0d866139ef565b9450613d1b602087016139ef565b9350604086013567ffffffffffffffff80821115613d37575f80fd5b613d4389838a01613c1c565b94506060880135915080821115613d58575f80fd5b613d6489838a01613c1c565b93506080880135915080821115613d79575f80fd5b50613d8688828901613c84565b9150509295509295909350565b5f8060408385031215613da4575f80fd5b823567ffffffffffffffff80821115613dbb575f80fd5b818501915085601f830112613dce575f80fd5b81356020613dde613c3b83613bf9565b82815260059290921b84018101918181019089841115613dfc575f80fd5b948201945b83861015613e2157613e12866139ef565b82529482019490820190613e01565b96505086013592505080821115613e36575f80fd5b50613e4385828601613c1c565b9150509250929050565b5f8151808452602080850194508084015f5b83811015613e7b57815187529582019590820190600101613e5f565b509495945050505050565b602081525f610e4f6020830184613e4d565b5f8060408385031215613ea9575f80fd5b613eb2836139ef565b9150602083013567ffffffffffffffff811115613ecd575f80fd5b613e4385828601613c84565b5f60208284031215613ee9575f80fd5b813567ffffffffffffffff811115613eff575f80fd5b613f0b84828501613c84565b949350505050565b5f805f805f60a08688031215613f27575f80fd5b613f30866139ef565b9450613f3e602087016139ef565b9350613f4c604087016139ef565b925060608601359150608086013567ffffffffffffffff811115613f6e575f80fd5b613d8688828901613c84565b80358015158114613a05575f80fd5b5f805f805f8060c08789031215613f9e575f80fd5b86359550613fae602088016139ef565b9450604087013593506060870135925060808701359150613fd160a08801613f7a565b90509295509295509295565b805182526020810151613ffb60208401826001600160a01b03169052565b5060408101516040830152606081015160608301526080810151608083015260a081015160a083015260c081015160c083015260e081015160e0830152610100808201518184015250610120808201516140588285018215159052565b50506101408181015180151584830152610d8e565b6101608101610c2c8284613fdd565b5f806040838503121561408d575f80fd5b82359150613bab60208401613f7a565b5f80604083850312156140ae575f80fd5b6140b7836139ef565b9150613bab60208401613f7a565b5f80602083850312156140d6575f80fd5b823567ffffffffffffffff808211156140ed575f80fd5b818501915085601f830112614100575f80fd5b81358181111561410e575f80fd5b8660208260051b8501011115614122575f80fd5b60209290920196919550909350505050565b602080825282518282018190525f9190848201906040850190845b8181101561417657614162838551613fdd565b92840192610160929092019160010161414f565b50909695505050505050565b5f8060408385031215614193575f80fd5b61419c836139ef565b9150613bab602084016139ef565b5f805f805f60a086880312156141be575f80fd5b6141c7866139ef565b94506141d5602087016139ef565b93506040860135925060608601359150608086013567ffffffffffffffff811115613f6e575f80fd5b5f835161420f818460208801613a9b565b662f746f6b656e2f60c81b9083019081528351614233816007840160208801613a9b565b01600701949350505050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610c2c57610c2c61423f565b634e487b7160e01b5f52603260045260245ffd5b5f6001820161428f5761428f61423f565b5060010190565b6001600160a01b0384168152826020820152606060408201525f61238c6060830184613abd565b80820180821115610c2c57610c2c61423f565b600181811c908216806142e457607f821691505b60208210810361430257634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215614318575f80fd5b5051919050565b601f821115611a08575f81815260208120601f850160051c810160208610156143455750805b601f850160051c820191505b81811015610ef257828155600101614351565b815167ffffffffffffffff81111561437e5761437e613bb4565b6143928161438c84546142d0565b8461431f565b602080601f8311600181146143c5575f84156143ae5750858301515b5f19600386901b1c1916600185901b178555610ef2565b5f85815260208120601f198616915b828110156143f3578886015182559484019460019091019084016143d4565b508582101561441057878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115610c2c57610c2c61423f565b5f6001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261168c60a0830184613abd565b5f6020828403121561447a575f80fd5b8151610e4f81613a32565b5f6001600160a01b03808816835280871660208401525060a060408301526144b060a0830186613e4d565b82810360608401526144c28186613e4d565b905082810360808401526144d68185613abd565b98975050505050505050565b5f82516144f3818460208701613a9b565b9190910192915050565b604081525f61450f6040830185613e4d565b828103602084015261238c8185613e4d56fe9cac802523ed2adf87967f3a268e708337bb814a3c8016df473fba78fb8f39005d8949d08484e3f3d7b1cf8cc9ade051ca36884db5dabdeaee573bcffb573a00a2646970667358221220cd5064c058affc276956e7e0c3a57a03ed89fd1a9cfb20808274c6839ad0b41f64736f6c63430008140033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$111.34
Net Worth in ETH
0.039749
Token Allocations
ETH
98.19%
BNB
1.81%
POL
0.00%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
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.