Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 282 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 18628113 | 852 days ago | IN | 0 ETH | 0.00106164 | ||||
| Set Approval For... | 18388625 | 885 days ago | IN | 0 ETH | 0.00022804 | ||||
| Withdraw FMAN | 18379037 | 887 days ago | IN | 0 ETH | 0.00115886 | ||||
| Set Approval For... | 18378690 | 887 days ago | IN | 0 ETH | 0.00036112 | ||||
| Set Approval For... | 18370356 | 888 days ago | IN | 0 ETH | 0.0005348 | ||||
| Set Approval For... | 18370319 | 888 days ago | IN | 0 ETH | 0.00042408 | ||||
| Set Approval For... | 18370145 | 888 days ago | IN | 0 ETH | 0.00034 | ||||
| Set Approval For... | 18370022 | 888 days ago | IN | 0 ETH | 0.00030674 | ||||
| Set Approval For... | 18369902 | 888 days ago | IN | 0 ETH | 0.00037286 | ||||
| Safe Transfer Fr... | 18369894 | 888 days ago | IN | 0 ETH | 0.00046905 | ||||
| Safe Transfer Fr... | 18369892 | 888 days ago | IN | 0 ETH | 0.00046707 | ||||
| Set Approval For... | 18369892 | 888 days ago | IN | 0 ETH | 0.00038134 | ||||
| Set Approval For... | 18365698 | 888 days ago | IN | 0 ETH | 0.00051447 | ||||
| Set Approval For... | 18365442 | 889 days ago | IN | 0 ETH | 0.00055077 | ||||
| Set Approval For... | 18302472 | 897 days ago | IN | 0 ETH | 0.00023483 | ||||
| Mint Mystery Pac... | 18292906 | 899 days ago | IN | 0 ETH | 0.01083946 | ||||
| Mint Mystery Pac... | 18292758 | 899 days ago | IN | 0 ETH | 0.01045179 | ||||
| Safe Transfer Fr... | 18270975 | 902 days ago | IN | 0 ETH | 0.00107231 | ||||
| Mint Mystery Pac... | 18242326 | 906 days ago | IN | 0 ETH | 0.01010487 | ||||
| Mint Mystery Pac... | 18242243 | 906 days ago | IN | 0 ETH | 0.0130996 | ||||
| Safe Transfer Fr... | 18238570 | 906 days ago | IN | 0 ETH | 0.00044517 | ||||
| Safe Transfer Fr... | 18238565 | 906 days ago | IN | 0 ETH | 0.00032609 | ||||
| Safe Transfer Fr... | 18238564 | 906 days ago | IN | 0 ETH | 0.00044005 | ||||
| Safe Transfer Fr... | 18238561 | 906 days ago | IN | 0 ETH | 0.00044381 | ||||
| Mint Batch | 18219847 | 909 days ago | IN | 0 ETH | 0.00067745 |
Latest 8 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 18219839 | 909 days ago | 0.08448434 ETH | ||||
| Transfer | 18219839 | 909 days ago | 0.00938714 ETH | ||||
| Transfer | 18191385 | 913 days ago | 0.42214738 ETH | ||||
| Transfer | 18191385 | 913 days ago | 0.04690526 ETH | ||||
| Transfer | 18150684 | 919 days ago | 0.41058479 ETH | ||||
| Transfer | 18150684 | 919 days ago | 0.04562053 ETH | ||||
| Transfer | 18142919 | 920 days ago | 0.4127311 ETH | ||||
| Transfer | 18142919 | 920 days ago | 0.04585901 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
FloridaManCard
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;
import "openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol";
import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/utils/Context.sol";
import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "openzeppelin-contracts/contracts/utils/math/SafeMath.sol";
import "openzeppelin-contracts/contracts/utils/Strings.sol";
import "v2-periphery/interfaces/IUniswapV2Router02.sol";
import "./IFloridaManCard.sol";
import "./IFloridaManCardStaking.sol";
contract FloridaManCard is ERC1155, Ownable, IFloridaManCard {
using SafeMath for uint256;
struct Card {
uint256 id;
uint256 price;
uint256 totalSupply;
uint256 maxOwnable;
uint256 level;
}
struct Season {
uint256 id;
uint256 level1Probability;
uint256 level2Probability;
uint256 level3Probability;
uint256 level4Probability;
uint256 level5Probability;
uint256 mysteryPack1Price;
uint256 mysteryPack5Price;
uint256 mysteryPack10Price;
uint256[] cardIds;
}
string public name = "Florida Man Card";
string public symbol = "FMANCARD";
address payable private _developerAddress;
address internal _tokenAddress = 0xD56990D60A7Abf3a7945F0565A98A708234b802C;
address internal _wethAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address internal _usdcAddress = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address internal _routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address internal _stakingAddress = address(0);
// Can we mint or nah?
bool internal _mintingActive = false;
// Hold lists of seasons and cards
uint256[] internal _cardIds;
uint256[] internal _seasonIds;
mapping(uint256 => Card) internal _cardMap;
mapping(uint256 => Season) internal _seasonMap;
// Hold minted supply of each card
mapping(uint256 => uint256) internal _cardSupply;
// Hold mint droppable bool of each card
mapping(uint256 => bool) internal _mintDroppableMap;
modifier onlyDeveloper() {
require(_developerAddress == _msgSender(), "Caller is not the developer");
_;
}
modifier onlyOwnerOrDeveloper() {
require(owner() == _msgSender() || _developerAddress == _msgSender(), "Caller is not owner or developer");
_;
}
event CreateCard(address indexed _firom, uint256 indexed _id, uint256 _level);
event CreateSeason(address indexed _from, uint256 indexed _id, uint256[] _cardIds);
event Purchase(address indexed _from, uint256 _amount, string _token);
event SeasonProbabilitesUpdate(
address indexed _from,
uint256 indexed _id,
uint256 _level1Probability,
uint256 _level2Probability,
uint256 _level3Probability,
uint256 _level4Probability,
uint256 _level5Probability
);
event SeasonPackPricesUpdate(
address indexed _from, uint256 indexed _id, uint256 _pack1Price, uint256 _pack5Price, uint256 _pack10Price
);
event SeasonCardsUpdate(address indexed _from, uint256 indexed _id, uint256[] _cardIds);
constructor(address __developerAddress, address __tokenAddress) ERC1155("https://nft.floridamantoken.com/jsons/") {
_developerAddress = payable(__developerAddress);
_tokenAddress = __tokenAddress;
}
// /////////////////////////////////////////////
// PUBLIC - OWNER ONLY
// /////////////////////////////////////////////
function setDeveloperAddress(address payable newAddress) external onlyDeveloper {
_developerAddress = newAddress;
}
function setTokenAddress(address newTokenAddress) external onlyOwner {
_tokenAddress = newTokenAddress;
}
function setUsdcAddress(address newAddress) external onlyOwner {
_usdcAddress = newAddress;
}
function setRouterAddress(address newRouterAddress) external onlyOwner {
_routerAddress = newRouterAddress;
}
function setMintingActive(bool newState) external onlyOwner {
_mintingActive = newState;
}
function setMintDroppable(uint256 _cardId, bool droppable) external onlyOwner {
require(isCardValid(_cardId), "Card does not exist");
_mintDroppableMap[_cardId] = droppable;
}
function createCard(uint256 _id, uint256 _priceUSD, uint256 _totalSupply, uint256 _maxOwnable, uint256 _level)
external
onlyOwner
{
require(!isCardValid(_id), "Card with id already exists");
require(_totalSupply >= 1, "Total available must be > 0");
require(_maxOwnable >= 1, "Max ownable must be > 0");
require(_level >= 1 && _level <= 5, "Level must be between 1 & 5");
Card memory newCard =
Card({id: _id, price: _priceUSD, totalSupply: _totalSupply, maxOwnable: _maxOwnable, level: _level});
_cardMap[_id] = newCard;
_cardIds.push(_id);
emit CreateCard(_msgSender(), _id, _level);
}
function updateCard(uint256 _id, uint256 _priceUSD, uint256 _totalSupply, uint256 _maxOwnable, uint256 _level)
external
onlyOwner
{
require(isCardValid(_id), "Card does not exist");
require(_totalSupply >= 1, "Total available must be > 0");
require(_totalSupply >= _cardSupply[_id], "Total available must be more than minted supply");
require(_maxOwnable >= 1, "Max ownable must be > 0");
require(_level >= 1 && _level <= 5, "Level must be between 1 & 5");
Card storage fetchedCard = _cardMap[_id];
fetchedCard.price = _priceUSD;
fetchedCard.totalSupply = _totalSupply;
fetchedCard.maxOwnable = _maxOwnable;
fetchedCard.level = _level;
}
function createSeason(
uint256 _id,
uint256[] memory __cardIds,
uint256 _level1Probability,
uint256 _level2Probability,
uint256 _level3Probability,
uint256 _level4Probability,
uint256 _level5Probability,
uint256 _mysteryPack1PriceUSD,
uint256 _mysteryPack5PriceUSD,
uint256 _mysteryPack10PriceUSD
) external onlyOwner {
require(!_seasonExists(_id), "Season with id already exists");
require(
_level1Probability + _level2Probability + _level3Probability + _level4Probability + _level5Probability
== 100,
"Probabilities must equal 100"
);
Season storage season = _seasonMap[_id];
season.id = _id;
for (uint256 i = 0; i < __cardIds.length; i++) {
uint256 _cardId = __cardIds[i];
require(isCardValid(_cardId), "Card does not exist");
season.cardIds.push(_cardId);
}
season.level1Probability = _level1Probability;
season.level2Probability = _level2Probability;
season.level3Probability = _level3Probability;
season.level4Probability = _level4Probability;
season.level5Probability = _level5Probability;
season.mysteryPack1Price = _mysteryPack1PriceUSD;
season.mysteryPack5Price = _mysteryPack5PriceUSD;
season.mysteryPack10Price = _mysteryPack10PriceUSD;
_seasonIds.push(_id);
emit CreateSeason(_msgSender(), _id, _cardIds);
}
function updateSeasonProbabilities(
uint256 _id,
uint256 _level1Probability,
uint256 _level2Probability,
uint256 _level3Probability,
uint256 _level4Probability,
uint256 _level5Probability
) external onlyOwner {
require(_seasonExists(_id), "Season does not exist");
require(
_level1Probability + _level2Probability + _level3Probability + _level4Probability + _level5Probability
== 100,
"Probabilities must equal 100"
);
Season storage season = _seasonMap[_id];
season.level1Probability = _level1Probability;
season.level2Probability = _level2Probability;
season.level3Probability = _level3Probability;
season.level4Probability = _level4Probability;
season.level5Probability = _level5Probability;
emit SeasonProbabilitesUpdate(
_msgSender(),
_id,
_level1Probability,
_level2Probability,
_level3Probability,
_level4Probability,
_level5Probability
);
}
function updateSeasonPackPrices(
uint256 _id,
uint256 _mysteryPack1PriceUSD,
uint256 _mysteryPack5PriceUSD,
uint256 _mysteryPack10PriceUSD
) external onlyOwner {
require(_seasonExists(_id), "Season does not exist");
Season storage season = _seasonMap[_id];
season.mysteryPack1Price = _mysteryPack1PriceUSD;
season.mysteryPack5Price = _mysteryPack5PriceUSD;
season.mysteryPack10Price = _mysteryPack10PriceUSD;
emit SeasonPackPricesUpdate(
_msgSender(), _id, _mysteryPack1PriceUSD, _mysteryPack5PriceUSD, _mysteryPack10PriceUSD
);
}
function updateSeasonCards(uint256 _id, uint256[] memory __cardIds) external onlyOwner {
require(_seasonExists(_id), "Season does not exist");
Season storage season = _seasonMap[_id];
season.cardIds = new uint256[](__cardIds.length);
for (uint256 i = 0; i < __cardIds.length; i++) {
uint256 _cardId = __cardIds[i];
require(isCardValid(_cardId), "Card does not exist");
Card memory fetchedCard = _cardMap[_cardId];
// solhint-disable-next-line reason-string
require(_cardSupply[_cardId] < fetchedCard.totalSupply, "Card supply exhausted, update card's totalSupply");
season.cardIds[i] = _cardId;
}
emit SeasonCardsUpdate(_msgSender(), _id, __cardIds);
}
function mintBatch(address _to, uint256[] memory _ids, uint256[] memory _amounts) public onlyOwner {
_mintBatch(_to, _ids, _amounts, "0x");
for (uint256 i = 0; i < _ids.length; i++) {
_cardSupply[_ids[i]] = _cardSupply[_ids[i]].add(_amounts[i]);
}
}
function mintStakeBatch(address _for, uint256[] memory _ids, uint256[] memory _amounts) external onlyOwner {
require(_stakingAddress != address(0), "Staking contract address not set");
mintBatch(_for, _ids, _amounts);
IFloridaManCardStaking(payable(address(_stakingAddress))).stakeBatch(_for, _ids, _amounts);
}
function withdrawFMAN() public onlyOwner {
uint256 balance = IERC20(_tokenAddress).balanceOf(address(this));
require(IERC20(_tokenAddress).transfer(owner(), balance), "Failed to withdraw to owner");
}
function withdrawETH() public onlyOwner {
uint256 balance = address(this).balance;
uint256 developerBalance = balance.mul(1000).div(10000);
uint256 ownerBalance = balance.sub(developerBalance);
payable(_developerAddress).transfer(developerBalance);
payable(owner()).transfer(ownerBalance);
}
// /////////////////////////////////////////////
// PUBLIC - ALL
// /////////////////////////////////////////////
function uri(uint256 _id) public view override returns (string memory) {
return string(abi.encodePacked(super.uri(_id), Strings.toString(_id)));
}
function isCardValid(uint256 _id) public view returns (bool) {
Card memory fetchedCard = _cardMap[_id];
if (fetchedCard.id > 0) {
return true;
}
return false;
}
function isSeasonValid(uint256 _id) public view returns (bool) {
Season memory fetchedSeason = _seasonMap[_id];
if (fetchedSeason.id > 0) {
return true;
}
return false;
}
function isMintingActive() external view returns (bool active) {
return _mintingActive;
}
function isMintDroppable(uint256 _cardId) external view returns (bool droppable) {
require(isCardValid(_cardId), "Card does not exist");
return _mintDroppableMap[_cardId];
}
function getMintedSupply(uint256 _cardId) external view returns (uint256 supply) {
require(isCardValid(_cardId), "Card does not exist");
return _cardSupply[_cardId];
}
function getAvailableSupply(uint256 _cardId) public view returns (uint256 supply) {
require(isCardValid(_cardId), "Card does not exist");
// If we've minted more than available supply, dont panic
if (_cardSupply[_cardId] > _cardMap[_cardId].totalSupply) {
return 0;
}
return _cardMap[_cardId].totalSupply - _cardSupply[_cardId];
}
function getMysterPackPrices(uint256 _seasonId)
external
view
returns (uint256 pack1, uint256 pack5, uint256 pack10)
{
require(_seasonExists(_seasonId), "Season does not exist");
Season memory season = _seasonMap[_seasonId];
uint256 pack1Price = _getFMANFromUSD(season.mysteryPack1Price);
uint256 pack5Price = _getFMANFromUSD(season.mysteryPack5Price);
uint256 pack10Price = _getFMANFromUSD(season.mysteryPack10Price);
return (pack1Price, pack5Price, pack10Price);
}
function getAvailableSeasonSupply(uint256 _id) external view returns (uint256 supply) {
require(_seasonExists(_id), "Season does not exist");
uint256[] memory seasonCardIds = _seasonMap[_id].cardIds;
uint256 available = 0;
for (uint256 i = 0; i < seasonCardIds.length; i++) {
available += getAvailableSupply(seasonCardIds[i]);
}
return available;
}
function getCard(uint256 _id)
external
view
returns (
uint256 id,
uint256 level,
uint256 usdPrice,
uint256 totalSupply,
uint256 maxOwnable,
uint256 availableAmount,
uint256 ownedAmount
)
{
require(isCardValid(_id), "Card does not exist");
Card memory fetchedCard = _cardMap[_id];
uint256 available = getAvailableSupply(fetchedCard.id);
uint256 owned = 0;
if (_msgSender() != address(0)) {
balanceOf(_msgSender(), fetchedCard.id);
}
return (
fetchedCard.id,
fetchedCard.level,
fetchedCard.price,
fetchedCard.totalSupply,
fetchedCard.maxOwnable,
available,
owned
);
}
function getSeasonIds() external view returns (uint256[] memory allSeasonIds) {
return _seasonIds;
}
function getCardIds() external view returns (uint256[] memory allCardIds) {
return _cardIds;
}
function getSeasonCards(uint256 _id) external view returns (uint256[] memory seasonCardIds) {
require(_seasonExists(_id), "Season does not exist");
return _seasonMap[_id].cardIds;
}
function mintMysteryPack(address _to, uint256 _seasonId, uint256 _quantity)
external
returns (uint256[] memory minted)
{
require(_mintingActive, "Minting is not active");
require(_seasonExists(_seasonId), "Season does not exist");
require(_quantity == 1 || _quantity == 5 || _quantity == 10, "Quantity must be 1,5, or 10");
Season memory season = _seasonMap[_seasonId];
// Verify there are actually enough cards left to mint
uint256 seasonCardSupply = 0;
for (uint256 i = 0; i < season.cardIds.length; i++) {
uint256 cardId = season.cardIds[i];
seasonCardSupply = seasonCardSupply + getAvailableSupply(cardId);
}
require(seasonCardSupply >= _quantity, "Not enough cards left to mint");
// Figure out total token amount
uint256 usdAmount = season.mysteryPack10Price;
if (_quantity == 5) {
usdAmount = season.mysteryPack5Price;
} else if (_quantity == 1) {
usdAmount = season.mysteryPack1Price;
}
// Get the price of the pack
uint256 tokenAmount = _getFMANFromUSD(usdAmount);
// Verify balance and transfer tokens
require(IERC20(_tokenAddress).balanceOf(_msgSender()) >= tokenAmount, "Insufficient balance to mint");
require(IERC20(_tokenAddress).transferFrom(_msgSender(), address(this), tokenAmount), "Failed to transfer FMAN");
emit Purchase(_msgSender(), tokenAmount, "FMAN");
// Start the mint
uint256[] memory randomSeeds = __generateRandomMulti(_generateRandom(), _quantity);
uint256[] memory mintedCardIds = new uint256[](_quantity);
for (uint256 i = 0; i < _quantity; i++) {
uint256 seed = randomSeeds[i];
uint256 cardId = _getMysteryPackCard(_to, _seasonId, seed);
_mint(_to, cardId, 1, "0x");
_cardSupply[cardId] = _cardSupply[cardId].add(1);
mintedCardIds[i] = cardId;
}
return mintedCardIds;
}
function mintDrop(address _to, uint256 _cardId, uint256 _quantity) external payable returns (uint256 minted) {
require(_mintingActive, "Minting is not active");
require(isCardValid(_cardId), "Card does not exist");
require(_mintDroppableMap[_cardId], "Card is not mint droppable");
Card memory fetchedCard = _cardMap[_cardId];
uint256 supply = getAvailableSupply(_cardId);
uint256 ownedBalance = balanceOf(_to, _cardId);
require(supply > 0, "Card has no supply left");
require(ownedBalance < fetchedCard.maxOwnable, "Owned max supply of card");
uint256 tokenAmount = _getETHFromUSD(fetchedCard.price * _quantity);
// Verify balance and transfer tokens
require(msg.value >= tokenAmount, "Insufficient balance to mint");
emit Purchase(_msgSender(), tokenAmount, "ETH");
_mint(_to, _cardId, _quantity, "0x");
_cardSupply[_cardId] = _cardSupply[_cardId].add(1);
return _cardId;
}
function transfer(address _to, uint256 _id, uint256 _quantity) external {
safeTransferFrom(_msgSender(), _to, _id, _quantity, "0x");
}
// /////////////////////////////////////////////
// INTERNAL
// /////////////////////////////////////////////
function _getFMANFromUSD(uint256 _usd) internal view returns (uint256 amount) {
address[] memory path = new address[](3);
path[0] = _usdcAddress;
path[1] = _wethAddress;
path[2] = _tokenAddress;
uint256[] memory amounts = IUniswapV2Router02(_routerAddress).getAmountsOut(_usd * (10 ** 6), path);
return amounts[2];
}
function _getETHFromUSD(uint256 _usd) public view returns (uint256 amount) {
address[] memory path = new address[](2);
path[0] = _usdcAddress;
path[1] = _wethAddress;
uint256[] memory amounts = IUniswapV2Router02(_routerAddress).getAmountsOut(_usd * (10 ** 6), path);
return amounts[1];
}
function _seasonExists(uint256 _id) internal view returns (bool) {
Season memory season = _seasonMap[_id];
if (season.id > 0) {
return true;
}
return false;
}
function _getSeasonLevelProbability(uint256 _id, uint256 _level) internal view returns (uint256 probability) {
require(_seasonExists(_id), "Season does not exist");
Season memory season = _seasonMap[_id];
if (_level == 1) {
return season.level1Probability;
} else if (_level == 2) {
return season.level2Probability;
} else if (_level == 3) {
return season.level3Probability;
} else if (_level == 4) {
return season.level4Probability;
} else if (_level == 5) {
return season.level5Probability;
}
}
function _getMysteryPackMintableCardIds(address _owner, uint256 _seasonId)
internal
view
returns (uint256[] memory ids)
{
require(_seasonExists(_seasonId), "Season does not exist");
Season memory season = _seasonMap[_seasonId];
uint256[] memory seasonCardIds = season.cardIds;
uint256[] memory mintableCardIds = new uint256[](seasonCardIds.length);
for (uint256 i = 0; i < seasonCardIds.length; i++) {
Card memory fetchedCard = _cardMap[seasonCardIds[i]];
uint256 supply = getAvailableSupply(fetchedCard.id);
uint256 ownedBalance = balanceOf(_owner, fetchedCard.id);
if (supply > 0 && ownedBalance < fetchedCard.maxOwnable) {
mintableCardIds[i] = fetchedCard.id;
} else {
mintableCardIds[i] = 0;
}
}
return mintableCardIds;
}
function _getMysteryPackCard(address _owner, uint256 _seasonId, uint256 _targetNumberSeed)
internal
view
returns (uint256 id)
{
require(_seasonExists(_seasonId), "Season does not exist");
Season memory season = _seasonMap[_seasonId];
uint256 level = _getMysteryPackLevel(_owner, _seasonId, _targetNumberSeed);
for (uint256 i = 0; i < season.cardIds.length; i++) {
Card memory fetchedCard = _cardMap[season.cardIds[i]];
if (fetchedCard.level == level) {
return fetchedCard.id;
}
}
return _getMysteryPackCard(_owner, _seasonId, _targetNumberSeed);
}
function _getMysteryPackLevel(address _owner, uint256 _seasonId, uint256 _targetNumberSeed)
internal
view
returns (uint256 level)
{
uint256[] memory mintableCardIds = _getMysteryPackMintableCardIds(_owner, _seasonId);
uint256 totalWeight = 0;
uint256[] memory levels = new uint256[](_cardIds.length);
for (uint256 i = 0; i < mintableCardIds.length; i++) {
if (mintableCardIds[i] > 0) {
uint256 probability = _getSeasonLevelProbability(_seasonId, mintableCardIds[i]);
totalWeight = totalWeight + probability;
levels[i] = probability;
}
}
// Final number were working with here
uint256 targetNumber = _targetNumberSeed.mod(totalWeight).add(1);
for (uint256 i = 0; i < levels.length; i++) {
if (targetNumber <= levels[i]) {
// Since we 0 index, just add 1 to get a real level
return i + 1;
}
// Subtract the weight and continue
targetNumber = targetNumber - levels[i];
}
// Call again if we drop through
return _getMysteryPackLevel(_owner, _seasonId, _targetNumberSeed);
}
// /////////////////////////////////////////////
// PRIVATE
// /////////////////////////////////////////////
function _generateRandom() private view returns (uint256) {
return uint256(keccak256(abi.encodePacked(block.prevrandao, block.timestamp)));
}
function __generateRandomMulti(uint256 _seed, uint256 _times) private pure returns (uint256[] memory generated) {
generated = new uint256[](_times);
for (uint256 i = 0; i < _times; i++) {
generated[i] = uint256(keccak256(abi.encode(_seed, i)));
}
return generated;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.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
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, 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) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
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 override returns (uint256[] memory) {
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` 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 `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 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, 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.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, 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 amounts 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 {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token 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 amount, bytes memory data) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - 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 amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(address from, uint256 id, uint256 amount) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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 addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @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), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(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) {
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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
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 keccak256(bytes(a)) == keccak256(bytes(b));
}
}pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}// SPDX-License-Identifier: UNLICENSED
import "openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol";
pragma solidity ^0.8.19;
interface IFloridaManCard is IERC1155 {
function mintMysteryPack(address _to, uint256 _seasonId, uint256 _quantity)
external
returns (uint256[] memory minted);
function withdrawFMAN() external;
function transfer(address _to, uint256 _id, uint256 _quantity) external;
function isCardValid(uint256 _id) external view returns (bool);
function isSeasonValid(uint256 _id) external view returns (bool);
function getSeasonCards(uint256 _id) external view returns (uint256[] memory seasonCardIds);
function getSeasonIds() external view returns (uint256[] memory allSeasonIds);
function getCardIds() external view returns (uint256[] memory allCardIds);
function getCard(uint256 _id)
external
view
returns (
uint256 id,
uint256 level,
uint256 usdPrice,
uint256 totalSupply,
uint256 maxOwnable,
uint256 availableAmount,
uint256 ownedAmount
);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.19;
interface IFloridaManCardStaking {
event Stake(address indexed _from, uint256 indexed _id, uint256 _quantity);
event Unstake(address indexed _from, uint256 indexed _id, uint256 _quantity);
function stakeBatch(address _for, uint256[] memory _ids, uint256[] memory _quantities) external;
function distribute(uint256 _startIndex) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token 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 amount 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 `amount` tokens of token type `id` from `from` to `to`.
*
* 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 `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 amount, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` 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 amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
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 v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
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 v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @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 up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (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; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
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.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 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.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
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 (rounding == Rounding.Up && 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 down.
*
* 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
}
}pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"v2-core/=lib/v2-core/contracts/",
"v2-periphery/=lib/v2-periphery/contracts/",
"lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/",
"lib/openzeppelin-contracts:ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/openzeppelin-contracts:erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/openzeppelin-contracts:forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/",
"lib/openzeppelin-contracts:openzeppelin/=lib/openzeppelin-contracts/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"__developerAddress","type":"address"},{"internalType":"address","name":"__tokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"_firom","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level","type":"uint256"}],"name":"CreateCard","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_cardIds","type":"uint256[]"}],"name":"CreateSeason","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":true,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"_token","type":"string"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"_cardIds","type":"uint256[]"}],"name":"SeasonCardsUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_pack1Price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_pack5Price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_pack10Price","type":"uint256"}],"name":"SeasonPackPricesUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level1Probability","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level2Probability","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level3Probability","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level4Probability","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_level5Probability","type":"uint256"}],"name":"SeasonProbabilitesUpdate","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"},{"inputs":[{"internalType":"uint256","name":"_usd","type":"uint256"}],"name":"_getETHFromUSD","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"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":"_priceUSD","type":"uint256"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_maxOwnable","type":"uint256"},{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"createCard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256[]","name":"__cardIds","type":"uint256[]"},{"internalType":"uint256","name":"_level1Probability","type":"uint256"},{"internalType":"uint256","name":"_level2Probability","type":"uint256"},{"internalType":"uint256","name":"_level3Probability","type":"uint256"},{"internalType":"uint256","name":"_level4Probability","type":"uint256"},{"internalType":"uint256","name":"_level5Probability","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack1PriceUSD","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack5PriceUSD","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack10PriceUSD","type":"uint256"}],"name":"createSeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getAvailableSeasonSupply","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"}],"name":"getAvailableSupply","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getCard","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"usdPrice","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"maxOwnable","type":"uint256"},{"internalType":"uint256","name":"availableAmount","type":"uint256"},{"internalType":"uint256","name":"ownedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCardIds","outputs":[{"internalType":"uint256[]","name":"allCardIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"}],"name":"getMintedSupply","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_seasonId","type":"uint256"}],"name":"getMysterPackPrices","outputs":[{"internalType":"uint256","name":"pack1","type":"uint256"},{"internalType":"uint256","name":"pack5","type":"uint256"},{"internalType":"uint256","name":"pack10","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getSeasonCards","outputs":[{"internalType":"uint256[]","name":"seasonCardIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSeasonIds","outputs":[{"internalType":"uint256[]","name":"allSeasonIds","type":"uint256[]"}],"stateMutability":"view","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":"_id","type":"uint256"}],"name":"isCardValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"}],"name":"isMintDroppable","outputs":[{"internalType":"bool","name":"droppable","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMintingActive","outputs":[{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"isSeasonValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"mintDrop","outputs":[{"internalType":"uint256","name":"minted","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_seasonId","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"mintMysteryPack","outputs":[{"internalType":"uint256[]","name":"minted","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"mintStakeBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"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":"amounts","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":"amount","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":"address payable","name":"newAddress","type":"address"}],"name":"setDeveloperAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cardId","type":"uint256"},{"internalType":"bool","name":"droppable","type":"bool"}],"name":"setMintDroppable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newState","type":"bool"}],"name":"setMintingActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRouterAddress","type":"address"}],"name":"setRouterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTokenAddress","type":"address"}],"name":"setTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setUsdcAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_priceUSD","type":"uint256"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"uint256","name":"_maxOwnable","type":"uint256"},{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"updateCard","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256[]","name":"__cardIds","type":"uint256[]"}],"name":"updateSeasonCards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack1PriceUSD","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack5PriceUSD","type":"uint256"},{"internalType":"uint256","name":"_mysteryPack10PriceUSD","type":"uint256"}],"name":"updateSeasonPackPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_level1Probability","type":"uint256"},{"internalType":"uint256","name":"_level2Probability","type":"uint256"},{"internalType":"uint256","name":"_level3Probability","type":"uint256"},{"internalType":"uint256","name":"_level4Probability","type":"uint256"},{"internalType":"uint256","name":"_level5Probability","type":"uint256"}],"name":"updateSeasonProbabilities","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFMAN","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60c0604052601060809081526f119b1bdc9a59184813585b8810d85c9960821b60a05260049062000031908262000291565b506040805180820190915260088152671193505390d0549160c21b602082015260059062000060908262000291565b50600780546001600160a01b031990811673d56990d60a7abf3a7945f0565a98a708234b802c1790915560088054821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc217905560098054821673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48179055600a8054909116737a250d5630b4cf539739df2c5dacb4c659f2488d179055600b80546001600160a81b03191690553480156200010257600080fd5b50604051620052633803806200526383398101604081905262000125916200037a565b6040518060600160405280602681526020016200523d602691396200014a8162000188565b5062000156336200019a565b600680546001600160a01b039384166001600160a01b03199182161790915560078054929093169116179055620003b2565b600262000196828262000291565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200021757607f821691505b6020821081036200023857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028c57600081815260208120601f850160051c81016020861015620002675750805b601f850160051c820191505b81811015620002885782815560010162000273565b5050505b505050565b81516001600160401b03811115620002ad57620002ad620001ec565b620002c581620002be845462000202565b846200023e565b602080601f831160018114620002fd5760008415620002e45750858301515b600019600386901b1c1916600185901b17855562000288565b600085815260208120601f198616915b828110156200032e578886015182559484019460019091019084016200030d565b50858210156200034d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80516001600160a01b03811681146200037557600080fd5b919050565b600080604083850312156200038e57600080fd5b62000399836200035d565b9150620003a9602084016200035d565b90509250929050565b614e7b80620003c26000396000f3fe6080604052600436106102715760003560e01c80636ed786951161014f578063b2826512116100c1578063dcc345f21161007a578063dcc345f2146107a8578063e086e5ec146107c8578063e985e9c5146107dd578063f242432a14610826578063f2fde38b14610846578063fd940eab1461086657600080fd5b8063b2826512146106f5578063c07bf52a14610708578063d04ef28514610728578063d38bcdee14610748578063d415943414610768578063d81d0a151461078857600080fd5b80638a5357a8116101135780638a5357a8146106035780638da5cb5b146106235780639188d3121461064b57806395d89b41146106a0578063a22cb465146106b5578063a64d9acd146106d557600080fd5b80636ed7869514610553578063715018a6146105735780637662fcd5146105885780637d7e7a56146105c35780638051522d146105e357600080fd5b80633927dc1e116101e85780634603e684116101ac5780634603e6841461049f57806348dcd10c146104bf5780634e1273f4146104d457806359f46f14146104f45780636ac437b0146105145780636eb14bb11461053357600080fd5b80633927dc1e146103f25780633a325405146104125780633cab3db01461043257806341cb87fc14610452578063429c39391461047257600080fd5b8063095bcdb61161023a578063095bcdb61461033d5780630e89341c1461035d578063129369451461037d57806326a4e8d2146103925780632eb2c2d6146103b257806331875b2d146103d257600080fd5b8062fdd58e1461027657806301ffc9a7146102a957806304601dc0146102d957806306fdde03146102fb578063084e6adf1461031d575b600080fd5b34801561028257600080fd5b506102966102913660046140a6565b61087b565b6040519081526020015b60405180910390f35b3480156102b557600080fd5b506102c96102c43660046140e8565b610914565b60405190151581526020016102a0565b3480156102e557600080fd5b506102f96102f43660046141db565b610964565b005b34801561030757600080fd5b50610310610a3a565b6040516102a091906142a0565b34801561032957600080fd5b506102966103383660046142b3565b610ac8565b34801561034957600080fd5b506102f96103583660046142cc565b610b02565b34801561036957600080fd5b506103106103783660046142b3565b610b2e565b34801561038957600080fd5b506102f9610b69565b34801561039e57600080fd5b506102f96103ad366004614301565b610cc4565b3480156103be57600080fd5b506102f96103cd366004614391565b610cee565b3480156103de57600080fd5b506102f96103ed36600461443e565b610d3a565b3480156103fe57600080fd5b506102c961040d3660046142b3565b610dd6565b34801561041e57600080fd5b5061029661042d3660046142b3565b610ebb565b34801561043e57600080fd5b5061029661044d3660046142b3565b610f97565b34801561045e57600080fd5b506102f961046d366004614301565b6110c5565b34801561047e57600080fd5b5061049261048d3660046142cc565b6110ef565b6040516102a091906144ab565b3480156104ab57600080fd5b506102f96104ba3660046144be565b6116a5565b3480156104cb57600080fd5b506104926117d9565b3480156104e057600080fd5b506104926104ef366004614501565b611831565b34801561050057600080fd5b506102f961050f3660046145cd565b611952565b34801561052057600080fd5b50600b54600160a01b900460ff166102c9565b34801561053f57600080fd5b5061049261054e3660046142b3565b611b6e565b34801561055f57600080fd5b506102f961056e366004614669565b611bf8565b34801561057f57600080fd5b506102f9611c45565b34801561059457600080fd5b506105a86105a33660046142b3565b611c59565b604080519384526020840192909252908201526060016102a0565b3480156105cf57600080fd5b506102c96105de3660046142b3565b611d8d565b3480156105ef57600080fd5b506102966105fe3660046142b3565b611de5565b34801561060f57600080fd5b506102c961061e3660046142b3565b611e60565b34801561062f57600080fd5b506003546040516001600160a01b0390911681526020016102a0565b34801561065757600080fd5b5061066b6106663660046142b3565b611e9d565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016102a0565b3480156106ac57600080fd5b50610310611f65565b3480156106c157600080fd5b506102f96106d0366004614699565b611f72565b3480156106e157600080fd5b506102f96106f03660046146c7565b611f81565b6102966107033660046142cc565b61219d565b34801561071457600080fd5b506102f9610723366004614703565b612499565b34801561073457600080fd5b506102f961074336600461473e565b6126c9565b34801561075457600080fd5b506102f9610763366004614301565b6126ef565b34801561077457600080fd5b506102f9610783366004614703565b612719565b34801561079457600080fd5b506102f96107a33660046141db565b6128e0565b3480156107b457600080fd5b506102f96107c3366004614301565b6129bb565b3480156107d457600080fd5b506102f9612a37565b3480156107e957600080fd5b506102c96107f836600461475b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561083257600080fd5b506102f9610841366004614789565b612ade565b34801561085257600080fd5b506102f9610861366004614301565b612b23565b34801561087257600080fd5b50610492612b99565b60006001600160a01b0383166108eb5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061094557506001600160e01b031982166303a24d0760e21b145b8061090e57506301ffc9a760e01b6001600160e01b031983161461090e565b61096c612bef565b600b546001600160a01b03166109c45760405162461bcd60e51b815260206004820181905260248201527f5374616b696e6720636f6e74726163742061646472657373206e6f742073657460448201526064016108e2565b6109cf8383836128e0565b600b546040516305a08f7760e21b81526001600160a01b03909116906316823ddc90610a03908690869086906004016147f1565b600060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b50505050505050565b60048054610a4790614827565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7390614827565b8015610ac05780601f10610a9557610100808354040283529160200191610ac0565b820191906000526020600020905b815481529060010190602001808311610aa357829003601f168201915b505050505081565b6000610ad382611d8d565b610aef5760405162461bcd60e51b81526004016108e290614861565b5060009081526010602052604090205490565b610b293384848460405180604001604052806002815260200161060f60f31b815250612ade565b505050565b6060610b3982612c49565b610b4283612cd3565b604051602001610b5392919061488e565b6040516020818303038152906040529050919050565b610b71612bef565b6007546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bde91906148bd565b6007549091506001600160a01b031663a9059cbb610c046003546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7591906148d6565b610cc15760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f20776974686472617720746f206f776e6572000000000060448201526064016108e2565b50565b610ccc612bef565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038516331480610d0a5750610d0a85336107f8565b610d265760405162461bcd60e51b81526004016108e2906148f3565b610d338585858585612d65565b5050505050565b610d42612bef565b610d4b84610dd6565b610d675760405162461bcd60e51b81526004016108e290614941565b6000848152600f602090815260409182902060068101869055600781018590556008810184905582518681529182018590528183018490529151869133917f71fdfef9ade7f1261c653731ed141a279490bc2bfa62c7373832035aa6bfe81d9181900360600190a35050505050565b6000818152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085528695929461012086019390929190830182828015610e9557602002820191906000526020600020905b815481526020019060010190808311610e81575b50505091909252505081519192505015610eb25750600192915050565b50600092915050565b6000610ec682610dd6565b610ee25760405162461bcd60e51b81526004016108e290614941565b6000828152600f6020908152604080832060090180548251818502810185019093528083529192909190830182828015610f3b57602002820191906000526020600020905b815481526020019060010190808311610f27575b505050505090506000805b8251811015610f8f57610f71838281518110610f6457610f64614970565b6020026020010151611de5565b610f7b908361499c565b915080610f87816149af565b915050610f46565b509392505050565b60408051600280825260608201835260009283929190602083019080368337505060095482519293506001600160a01b031691839150600090610fdc57610fdc614970565b6001600160a01b03928316602091820292909201015260085482519116908290600190811061100d5761100d614970565b6001600160a01b039283166020918202929092010152600a546000911663d06ca61f61103c86620f42406149c8565b846040518363ffffffff1660e01b815260040161105a9291906149df565b600060405180830381865afa158015611077573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261109f9190810190614a36565b9050806001815181106110b4576110b4614970565b602002602001015192505050919050565b6110cd612bef565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600b54606090600160a01b900460ff166111435760405162461bcd60e51b81526020600482015260156024820152744d696e74696e67206973206e6f742061637469766560581b60448201526064016108e2565b61114c83610dd6565b6111685760405162461bcd60e51b81526004016108e290614941565b81600114806111775750816005145b80611182575081600a145b6111ce5760405162461bcd60e51b815260206004820152601b60248201527f5175616e74697479206d75737420626520312c352c206f72203130000000000060448201526064016108e2565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085529194929361012086019390929083018282801561128c57602002820191906000526020600020905b815481526020019060010190808311611278575b50505050508152505090506000805b826101200151518110156112f557600083610120015182815181106112c2576112c2614970565b602002602001015190506112d581611de5565b6112df908461499c565b92505080806112ed906149af565b91505061129b565b50838110156113465760405162461bcd60e51b815260206004820152601d60248201527f4e6f7420656e6f756768206361726473206c65667420746f206d696e7400000060448201526064016108e2565b6101008201516005859003611360575060e082015161136f565b8460010361136f575060c08201515b600061137a82612f01565b60075490915081906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156113d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f991906148bd565b10156114475760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742062616c616e636520746f206d696e740000000060448201526064016108e2565b6007546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af11580156114ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d091906148d6565b61151c5760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f207472616e7366657220464d414e00000000000000000060448201526064016108e2565b336001600160a01b03167fd3aa7599e4b0c574b10dc23d7bf5acf28f2193861951c1ba95a90f8a68073fa082604051611573918152604060208201819052600490820152632326a0a760e11b606082015260800190565b60405180910390a2600061158e611588613050565b8861308c565b90506000876001600160401b038111156115aa576115aa614105565b6040519080825280602002602001820160405280156115d3578160200160208202803683370190505b50905060005b888110156116955760008382815181106115f5576115f5614970565b60200260200101519050600061160c8d8d84613140565b90506116358d82600160405180604001604052806002815260200161060f60f31b815250613302565b60008181526010602052604090205461164f9060016133d3565b6000828152601060205260409020558351819085908590811061167457611674614970565b6020026020010181815250505050808061168d906149af565b9150506115d9565b50955050505050505b9392505050565b6116ad612bef565b6116b686610dd6565b6116d25760405162461bcd60e51b81526004016108e290614941565b8082846116df878961499c565b6116e9919061499c565b6116f3919061499c565b6116fd919061499c565b60641461174c5760405162461bcd60e51b815260206004820152601c60248201527f50726f626162696c6974696573206d75737420657175616c203130300000000060448201526064016108e2565b6000868152600f60209081526040918290206001810188905560028101879055600381018690556004810185905560058101849055825188815291820187905281830186905260608201859052608082018490529151889133917f9e41bff5959b28d73be1df72b2b93fcb6eb06c50787787a52c1cbecd68ae79c89181900360a00190a350505050505050565b6060600c80548060200260200160405190810160405280929190818152602001828054801561182757602002820191906000526020600020905b815481526020019060010190808311611813575b5050505050905090565b606081518351146118965760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108e2565b600083516001600160401b038111156118b1576118b1614105565b6040519080825280602002602001820160405280156118da578160200160208202803683370190505b50905060005b8451811015610f8f576119258582815181106118fe576118fe614970565b602002602001015185838151811061191857611918614970565b602002602001015161087b565b82828151811061193757611937614970565b602090810291909101015261194b816149af565b90506118e0565b61195a612bef565b6119638a610dd6565b156119b05760405162461bcd60e51b815260206004820152601d60248201527f536561736f6e207769746820696420616c72656164792065786973747300000060448201526064016108e2565b8385876119bd8a8c61499c565b6119c7919061499c565b6119d1919061499c565b6119db919061499c565b606414611a2a5760405162461bcd60e51b815260206004820152601c60248201527f50726f626162696c6974696573206d75737420657175616c203130300000000060448201526064016108e2565b60008a8152600f602052604081208b8155905b8a51811015611ab35760008b8281518110611a5a57611a5a614970565b60200260200101519050611a6d81611d8d565b611a895760405162461bcd60e51b81526004016108e290614861565b60098301805460018101825560009182526020909120015580611aab816149af565b915050611a3d565b5060018181018a905560028201899055600382018890556004820187905560058201869055600682018590556007820184905560088201839055600d805491820181556000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5018b90558a336001600160a01b03167f9b0413a42145d1c201ec9c4edc02bb80f80e8c70238368bb03f610ffef905145600c604051611b599190614ad1565b60405180910390a35050505050505050505050565b6060611b7982610dd6565b611b955760405162461bcd60e51b81526004016108e290614941565b6000828152600f602090815260409182902060090180548351818402810184019094528084529091830182828015611bec57602002820191906000526020600020905b815481526020019060010190808311611bd8575b50505050509050919050565b611c00612bef565b611c0982611d8d565b611c255760405162461bcd60e51b81526004016108e290614861565b600091825260116020526040909120805460ff1916911515919091179055565b611c4d612bef565b611c5760006133df565b565b6000806000611c6784610dd6565b611c835760405162461bcd60e51b81526004016108e290614941565b6000848152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015611d4157602002820191906000526020600020905b815481526020019060010190808311611d2d575b50505050508152505090506000611d5b8260c00151612f01565b90506000611d6c8360e00151612f01565b90506000611d7e846101000151612f01565b92989197509195509350505050565b6000818152600e60209081526040808320815160a0810183528154808252600183015494820194909452600282015492810192909252600381015460608301526004015460808201529015610eb25750600192915050565b6000611df082611d8d565b611e0c5760405162461bcd60e51b81526004016108e290614861565b6000828152600e60209081526040808320600201546010909252909120541115611e3857506000919050565b600082815260106020908152604080832054600e9092529091206002015461090e9190614b18565b6000611e6b82611d8d565b611e875760405162461bcd60e51b81526004016108e290614861565b5060009081526011602052604090205460ff1690565b6000806000806000806000611eb188611d8d565b611ecd5760405162461bcd60e51b81526004016108e290614861565b6000888152600e60209081526040808320815160a0810183528154808252600183015494820194909452600282015492810192909252600381015460608301526004015460808201529190611f2190611de5565b905060003315611f3857611f3633845161087b565b505b8251608084015160208501516040860151606090960151929e919d509b5093995097509095509350915050565b60058054610a4790614827565b611f7d338383613431565b5050565b611f89612bef565b611f9282610dd6565b611fae5760405162461bcd60e51b81526004016108e290614941565b6000828152600f6020526040902081516001600160401b03811115611fd557611fd5614105565b604051908082528060200260200182016040528015611ffe578160200160208202803683370190505b508051612015916009840191602090910190614031565b5060005b825181101561215557600083828151811061203657612036614970565b6020026020010151905061204981611d8d565b6120655760405162461bcd60e51b81526004016108e290614861565b6000818152600e60209081526040808320815160a081018352815481526001820154818501526002820154818401819052600383015460608301526004909201546080820152858552601090935292205490911161211e5760405162461bcd60e51b815260206004820152603060248201527f4361726420737570706c79206578686175737465642c2075706461746520636160448201526f7264277320746f74616c537570706c7960801b60648201526084016108e2565b8184600901848154811061213457612134614970565b6000918252602090912001555081905061214d816149af565b915050612019565b5082336001600160a01b03167fe73a5835cf90e53a96e2452ddb9ac091476315e55501d8ceee6f821e3dfae1c08460405161219091906144ab565b60405180910390a3505050565b600b54600090600160a01b900460ff166121f15760405162461bcd60e51b81526020600482015260156024820152744d696e74696e67206973206e6f742061637469766560581b60448201526064016108e2565b6121fa83611d8d565b6122165760405162461bcd60e51b81526004016108e290614861565b60008381526011602052604090205460ff166122745760405162461bcd60e51b815260206004820152601a60248201527f43617264206973206e6f74206d696e742064726f707061626c6500000000000060448201526064016108e2565b6000838152600e60209081526040808320815160a0810183528154815260018201549381019390935260028101549183019190915260038101546060830152600401546080820152906122c685611de5565b905060006122d4878761087b565b9050600082116123265760405162461bcd60e51b815260206004820152601760248201527f4361726420686173206e6f20737570706c79206c65667400000000000000000060448201526064016108e2565b826060015181106123795760405162461bcd60e51b815260206004820152601860248201527f4f776e6564206d617820737570706c79206f662063617264000000000000000060448201526064016108e2565b600061238e86856020015161044d91906149c8565b9050803410156123e05760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742062616c616e636520746f206d696e740000000060448201526064016108e2565b336001600160a01b03167fd3aa7599e4b0c574b10dc23d7bf5acf28f2193861951c1ba95a90f8a68073fa0826040516124369181526040602082018190526003908201526208aa8960eb1b606082015260800190565b60405180910390a261246488888860405180604001604052806002815260200161060f60f31b815250613302565b60008781526010602052604090205461247e9060016133d3565b60008881526010602052604090205550949695505050505050565b6124a1612bef565b6124aa85611d8d565b156124f75760405162461bcd60e51b815260206004820152601b60248201527f43617264207769746820696420616c726561647920657869737473000000000060448201526064016108e2565b60018310156125485760405162461bcd60e51b815260206004820152601b60248201527f546f74616c20617661696c61626c65206d757374206265203e2030000000000060448201526064016108e2565b60018210156125935760405162461bcd60e51b815260206004820152601760248201527604d6178206f776e61626c65206d757374206265203e203604c1b60448201526064016108e2565b600181101580156125a5575060058111155b6125f15760405162461bcd60e51b815260206004820152601b60248201527f4c6576656c206d757374206265206265747765656e203120262035000000000060448201526064016108e2565b6040805160a0810182528681526020808201878152828401878152606084018781526080850187815260008c8152600e909552958420855181559251600180850191909155915160028401555160038301559351600490910155600c8054938401815590527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790910186905585336001600160a01b03167fcdd98e681d282a492b25ad0d8a6ecf0a931dab5894d19038df77e397b61257b7846040516126b991815260200190565b60405180910390a3505050505050565b6126d1612bef565b600b8054911515600160a01b0260ff60a01b19909216919091179055565b6126f7612bef565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b612721612bef565b61272a85611d8d565b6127465760405162461bcd60e51b81526004016108e290614861565b60018310156127975760405162461bcd60e51b815260206004820152601b60248201527f546f74616c20617661696c61626c65206d757374206265203e2030000000000060448201526064016108e2565b60008581526010602052604090205483101561280d5760405162461bcd60e51b815260206004820152602f60248201527f546f74616c20617661696c61626c65206d757374206265206d6f72652074686160448201526e6e206d696e74656420737570706c7960881b60648201526084016108e2565b60018210156128585760405162461bcd60e51b815260206004820152601760248201527604d6178206f776e61626c65206d757374206265203e203604c1b60448201526064016108e2565b6001811015801561286a575060058111155b6128b65760405162461bcd60e51b815260206004820152601b60248201527f4c6576656c206d757374206265206265747765656e203120262035000000000060448201526064016108e2565b6000948552600e602052604090942060018101939093556002830191909155600382015560040155565b6128e8612bef565b61290e83838360405180604001604052806002815260200161060f60f31b815250613509565b60005b82518110156129b55761297282828151811061292f5761292f614970565b60200260200101516010600086858151811061294d5761294d614970565b60200260200101518152602001908152602001600020546133d390919063ffffffff16565b6010600085848151811061298857612988614970565b602002602001015181526020019081526020016000208190555080806129ad906149af565b915050612911565b50505050565b6006546001600160a01b03163314612a155760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f742074686520646576656c6f706572000000000060448201526064016108e2565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b612a3f612bef565b476000612a5a612710612a54846103e8613654565b90613660565b90506000612a68838361366c565b6006546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050158015612aa3573d6000803e3d6000fd5b506003546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156129b5573d6000803e3d6000fd5b6001600160a01b038516331480612afa5750612afa85336107f8565b612b165760405162461bcd60e51b81526004016108e2906148f3565b610d338585858585613678565b612b2b612bef565b6001600160a01b038116612b905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e2565b610cc1816133df565b6060600d8054806020026020016040519081016040528092919081815260200182805480156118275760200282019190600052602060002090815481526020019060010190808311611813575050505050905090565b6003546001600160a01b03163314611c575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108e2565b606060028054612c5890614827565b80601f0160208091040260200160405190810160405280929190818152602001828054612c8490614827565b8015611bec5780601f10612ca657610100808354040283529160200191611bec565b820191906000526020600020905b815481529060010190602001808311612cb45750939695505050505050565b60606000612ce0836137a2565b60010190506000816001600160401b03811115612cff57612cff614105565b6040519080825280601f01601f191660200182016040528015612d29576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d3357509392505050565b8151835114612d865760405162461bcd60e51b81526004016108e290614b41565b6001600160a01b038416612dac5760405162461bcd60e51b81526004016108e290614b89565b3360005b8451811015612e93576000858281518110612dcd57612dcd614970565b602002602001015190506000858381518110612deb57612deb614970565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612e3b5760405162461bcd60e51b81526004016108e290614bce565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e7890849061499c565b9250508190555050505080612e8c906149af565b9050612db0565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612ee3929190614c18565b60405180910390a4612ef981878787878761387a565b505050505050565b6040805160038082526080820190925260009182919060208201606080368337505060095482519293506001600160a01b031691839150600090612f4757612f47614970565b6001600160a01b039283166020918202929092010152600854825191169082906001908110612f7857612f78614970565b6001600160a01b039283166020918202929092010152600754825191169082906002908110612fa957612fa9614970565b6001600160a01b039283166020918202929092010152600a546000911663d06ca61f612fd886620f42406149c8565b846040518363ffffffff1660e01b8152600401612ff69291906149df565b600060405180830381865afa158015613013573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261303b9190810190614a36565b9050806002815181106110b4576110b4614970565b6000444260405160200161306e929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905090565b6060816001600160401b038111156130a6576130a6614105565b6040519080825280602002602001820160405280156130cf578160200160208202803683370190505b50905060005b828110156131395760408051602081018690529081018290526060016040516020818303038152906040528051906020012060001c82828151811061311c5761311c614970565b602090810291909101015280613131816149af565b9150506130d5565b5092915050565b600061314b83610dd6565b6131675760405162461bcd60e51b81526004016108e290614941565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085529194929361012086019390929083018282801561322557602002820191906000526020600020905b815481526020019060010190808311613211575b5050505050815250509050600061323d8686866139d5565b905060005b826101200151518110156132ec576000600e6000856101200151848151811061326d5761326d614970565b602002602001015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050828160800151036132d95751935061169e92505050565b50806132e4816149af565b915050613242565b506132f8868686613140565b9695505050505050565b6001600160a01b0384166133285760405162461bcd60e51b81526004016108e290614c46565b33600061333485613b72565b9050600061334185613b72565b90506000868152602081815260408083206001600160a01b038b1684529091528120805487929061337390849061499c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610a3183600089898989613bbd565b600061169e828461499c565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036134a45760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108e2565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101612190565b6001600160a01b03841661352f5760405162461bcd60e51b81526004016108e290614c46565b81518351146135505760405162461bcd60e51b81526004016108e290614b41565b3360005b84518110156135ec5783818151811061356f5761356f614970565b602002602001015160008087848151811061358c5761358c614970565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135d4919061499c565b909155508190506135e4816149af565b915050613554565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161363d929190614c18565b60405180910390a4610d338160008787878761387a565b600061169e82846149c8565b600061169e8284614c87565b600061169e8284614b18565b6001600160a01b03841661369e5760405162461bcd60e51b81526004016108e290614b89565b3360006136aa85613b72565b905060006136b785613b72565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156136fa5760405162461bcd60e51b81526004016108e290614bce565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061373790849061499c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613797848a8a8a8a8a613bbd565b505050505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137e15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061380d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061382b57662386f26fc10000830492506010015b6305f5e1008310613843576305f5e100830492506008015b612710831061385757612710830492506004015b60648310613869576064830492506002015b600a831061090e5760010192915050565b6001600160a01b0384163b15612ef95760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906138be9089908990889088908890600401614c9b565b6020604051808303816000875af19250505080156138f9575060408051601f3d908101601f191682019092526138f691810190614ced565b60015b6139a557613905614d0a565b806308c379a00361393e5750613919614d26565b806139245750613940565b8060405162461bcd60e51b81526004016108e291906142a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108e2565b6001600160e01b0319811663bc197c8160e01b14610a315760405162461bcd60e51b81526004016108e290614daf565b6000806139e28585613c78565b9050600080600c805490506001600160401b03811115613a0457613a04614105565b604051908082528060200260200182016040528015613a2d578160200160208202803683370190505b50905060005b8351811015613ac4576000848281518110613a5057613a50614970565b60200260200101511115613ab2576000613a8388868481518110613a7657613a76614970565b6020026020010151613ed6565b9050613a8f818561499c565b935080838381518110613aa457613aa4614970565b602002602001018181525050505b80613abc816149af565b915050613a33565b506000613adc6001613ad68886614025565b906133d3565b905060005b8251811015613b5a57828181518110613afc57613afc614970565b60200260200101518211613b2157613b1581600161499c565b9550505050505061169e565b828181518110613b3357613b33614970565b602002602001015182613b469190614b18565b915080613b52816149af565b915050613ae1565b50613b668888886139d5565b98975050505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613bac57613bac614970565b602090810291909101015292915050565b6001600160a01b0384163b15612ef95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613c019089908990889088908890600401614df7565b6020604051808303816000875af1925050508015613c3c575060408051601f3d908101601f19168201909252613c3991810190614ced565b60015b613c4857613905614d0a565b6001600160e01b0319811663f23a6e6160e01b14610a315760405162461bcd60e51b81526004016108e290614daf565b6060613c8382610dd6565b613c9f5760405162461bcd60e51b81526004016108e290614941565b6000828152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015613d5d57602002820191906000526020600020905b815481526020019060010190808311613d49575b505050505081525050905060008161012001519050600081516001600160401b03811115613d8d57613d8d614105565b604051908082528060200260200182016040528015613db6578160200160208202803683370190505b50905060005b8251811015613ecc576000600e6000858481518110613ddd57613ddd614970565b602002602001015181526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090506000613e418260000151611de5565b90506000613e538a846000015161087b565b9050600082118015613e685750826060015181105b15613e95578260000151858581518110613e8457613e84614970565b602002602001018181525050613eb6565b6000858581518110613ea957613ea9614970565b6020026020010181815250505b5050508080613ec4906149af565b915050613dbc565b5095945050505050565b6000613ee183610dd6565b613efd5760405162461bcd60e51b81526004016108e290614941565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015613fbb57602002820191906000526020600020905b815481526020019060010190808311613fa7575b505050505081525050905082600103613fd95760200151905061090e565b82600203613fec5760400151905061090e565b82600303613fff5760600151905061090e565b826004036140125760800151905061090e565b826005036131395760a00151905061090e565b600061169e8284614e31565b82805482825590600052602060002090810192821561406c579160200282015b8281111561406c578251825591602001919060010190614051565b5061407892915061407c565b5090565b5b80821115614078576000815560010161407d565b6001600160a01b0381168114610cc157600080fd5b600080604083850312156140b957600080fd5b82356140c481614091565b946020939093013593505050565b6001600160e01b031981168114610cc157600080fd5b6000602082840312156140fa57600080fd5b813561169e816140d2565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561414057614140614105565b6040525050565b60006001600160401b0382111561416057614160614105565b5060051b60200190565b600082601f83011261417b57600080fd5b8135602061418882614147565b604051614195828261411b565b83815260059390931b85018201928281019150868411156141b557600080fd5b8286015b848110156141d057803583529183019183016141b9565b509695505050505050565b6000806000606084860312156141f057600080fd5b83356141fb81614091565b925060208401356001600160401b038082111561421757600080fd5b6142238783880161416a565b9350604086013591508082111561423957600080fd5b506142468682870161416a565b9150509250925092565b60005b8381101561426b578181015183820152602001614253565b50506000910152565b6000815180845261428c816020860160208601614250565b601f01601f19169290920160200192915050565b60208152600061169e6020830184614274565b6000602082840312156142c557600080fd5b5035919050565b6000806000606084860312156142e157600080fd5b83356142ec81614091565b95602085013595506040909401359392505050565b60006020828403121561431357600080fd5b813561169e81614091565b600082601f83011261432f57600080fd5b81356001600160401b0381111561434857614348614105565b60405161435f601f8301601f19166020018261411b565b81815284602083860101111561437457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156143a957600080fd5b85356143b481614091565b945060208601356143c481614091565b935060408601356001600160401b03808211156143e057600080fd5b6143ec89838a0161416a565b9450606088013591508082111561440257600080fd5b61440e89838a0161416a565b9350608088013591508082111561442457600080fd5b506144318882890161431e565b9150509295509295909350565b6000806000806080858703121561445457600080fd5b5050823594602084013594506040840135936060013592509050565b600081518084526020808501945080840160005b838110156144a057815187529582019590820190600101614484565b509495945050505050565b60208152600061169e6020830184614470565b60008060008060008060c087890312156144d757600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b6000806040838503121561451457600080fd5b82356001600160401b038082111561452b57600080fd5b818501915085601f83011261453f57600080fd5b8135602061454c82614147565b604051614559828261411b565b83815260059390931b850182019282810191508984111561457957600080fd5b948201945b838610156145a057853561459181614091565b8252948201949082019061457e565b965050860135925050808211156145b657600080fd5b506145c38582860161416a565b9150509250929050565b6000806000806000806000806000806101408b8d0312156145ed57600080fd5b8a35995060208b01356001600160401b0381111561460a57600080fd5b6146168d828e0161416a565b9a9d9a9c505050506040890135986060810135986080820135985060a0820135975060c0820135965060e0820135955061010082013594506101209091013592509050565b8015158114610cc157600080fd5b6000806040838503121561467c57600080fd5b82359150602083013561468e8161465b565b809150509250929050565b600080604083850312156146ac57600080fd5b82356146b781614091565b9150602083013561468e8161465b565b600080604083850312156146da57600080fd5b8235915060208301356001600160401b038111156146f757600080fd5b6145c38582860161416a565b600080600080600060a0868803121561471b57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60006020828403121561475057600080fd5b813561169e8161465b565b6000806040838503121561476e57600080fd5b823561477981614091565b9150602083013561468e81614091565b600080600080600060a086880312156147a157600080fd5b85356147ac81614091565b945060208601356147bc81614091565b9350604086013592506060860135915060808601356001600160401b038111156147e557600080fd5b6144318882890161431e565b6001600160a01b038416815260606020820181905260009061481590830185614470565b82810360408401526132f88185614470565b600181811c9082168061483b57607f821691505b60208210810361485b57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526013908201527210d85c9908191bd95cc81b9bdd08195e1a5cdd606a1b604082015260600190565b600083516148a0818460208801614250565b8351908301906148b4818360208801614250565b01949350505050565b6000602082840312156148cf57600080fd5b5051919050565b6000602082840312156148e857600080fd5b815161169e8161465b565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526015908201527414d9585cdbdb88191bd95cc81b9bdd08195e1a5cdd605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561090e5761090e614986565b6000600182016149c1576149c1614986565b5060010190565b808202811582820484141761090e5761090e614986565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015614a295784516001600160a01b031683529383019391830191600101614a04565b5090979650505050505050565b60006020808385031215614a4957600080fd5b82516001600160401b03811115614a5f57600080fd5b8301601f81018513614a7057600080fd5b8051614a7b81614147565b604051614a88828261411b565b82815260059290921b8301840191848101915087831115614aa857600080fd5b928401925b82841015614ac657835182529284019290840190614aad565b979650505050505050565b6020808252825482820181905260008481528281209092916040850190845b81811015614b0c57835483526001938401939285019201614af0565b50909695505050505050565b8181038181111561090e5761090e614986565b634e487b7160e01b600052601260045260246000fd5b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000614c2b6040830185614470565b8281036020840152614c3d8185614470565b95945050505050565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b600082614c9657614c96614b2b565b500490565b6001600160a01b0386811682528516602082015260a060408201819052600090614cc790830186614470565b8281036060840152614cd98186614470565b90508281036080840152613b668185614274565b600060208284031215614cff57600080fd5b815161169e816140d2565b600060033d1115614d235760046000803e5060005160e01c5b90565b600060443d1015614d345790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614d6357505050505090565b8285019150815181811115614d7b5750505050505090565b843d8701016020828501011115614d955750505050505090565b614da46020828601018761411b565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614ac690830184614274565b600082614e4057614e40614b2b565b50069056fea264697066735822122046605ac1a6cc5f5de2b3b521951e900df62225f84a48bcd46b97217e11f0819964736f6c6343000813003368747470733a2f2f6e66742e666c6f726964616d616e746f6b656e2e636f6d2f6a736f6e732f000000000000000000000000c780e679b4ca9c9cc72b50a39e5ee06316af6d52000000000000000000000000d56990d60a7abf3a7945f0565a98a708234b802c
Deployed Bytecode
0x6080604052600436106102715760003560e01c80636ed786951161014f578063b2826512116100c1578063dcc345f21161007a578063dcc345f2146107a8578063e086e5ec146107c8578063e985e9c5146107dd578063f242432a14610826578063f2fde38b14610846578063fd940eab1461086657600080fd5b8063b2826512146106f5578063c07bf52a14610708578063d04ef28514610728578063d38bcdee14610748578063d415943414610768578063d81d0a151461078857600080fd5b80638a5357a8116101135780638a5357a8146106035780638da5cb5b146106235780639188d3121461064b57806395d89b41146106a0578063a22cb465146106b5578063a64d9acd146106d557600080fd5b80636ed7869514610553578063715018a6146105735780637662fcd5146105885780637d7e7a56146105c35780638051522d146105e357600080fd5b80633927dc1e116101e85780634603e684116101ac5780634603e6841461049f57806348dcd10c146104bf5780634e1273f4146104d457806359f46f14146104f45780636ac437b0146105145780636eb14bb11461053357600080fd5b80633927dc1e146103f25780633a325405146104125780633cab3db01461043257806341cb87fc14610452578063429c39391461047257600080fd5b8063095bcdb61161023a578063095bcdb61461033d5780630e89341c1461035d578063129369451461037d57806326a4e8d2146103925780632eb2c2d6146103b257806331875b2d146103d257600080fd5b8062fdd58e1461027657806301ffc9a7146102a957806304601dc0146102d957806306fdde03146102fb578063084e6adf1461031d575b600080fd5b34801561028257600080fd5b506102966102913660046140a6565b61087b565b6040519081526020015b60405180910390f35b3480156102b557600080fd5b506102c96102c43660046140e8565b610914565b60405190151581526020016102a0565b3480156102e557600080fd5b506102f96102f43660046141db565b610964565b005b34801561030757600080fd5b50610310610a3a565b6040516102a091906142a0565b34801561032957600080fd5b506102966103383660046142b3565b610ac8565b34801561034957600080fd5b506102f96103583660046142cc565b610b02565b34801561036957600080fd5b506103106103783660046142b3565b610b2e565b34801561038957600080fd5b506102f9610b69565b34801561039e57600080fd5b506102f96103ad366004614301565b610cc4565b3480156103be57600080fd5b506102f96103cd366004614391565b610cee565b3480156103de57600080fd5b506102f96103ed36600461443e565b610d3a565b3480156103fe57600080fd5b506102c961040d3660046142b3565b610dd6565b34801561041e57600080fd5b5061029661042d3660046142b3565b610ebb565b34801561043e57600080fd5b5061029661044d3660046142b3565b610f97565b34801561045e57600080fd5b506102f961046d366004614301565b6110c5565b34801561047e57600080fd5b5061049261048d3660046142cc565b6110ef565b6040516102a091906144ab565b3480156104ab57600080fd5b506102f96104ba3660046144be565b6116a5565b3480156104cb57600080fd5b506104926117d9565b3480156104e057600080fd5b506104926104ef366004614501565b611831565b34801561050057600080fd5b506102f961050f3660046145cd565b611952565b34801561052057600080fd5b50600b54600160a01b900460ff166102c9565b34801561053f57600080fd5b5061049261054e3660046142b3565b611b6e565b34801561055f57600080fd5b506102f961056e366004614669565b611bf8565b34801561057f57600080fd5b506102f9611c45565b34801561059457600080fd5b506105a86105a33660046142b3565b611c59565b604080519384526020840192909252908201526060016102a0565b3480156105cf57600080fd5b506102c96105de3660046142b3565b611d8d565b3480156105ef57600080fd5b506102966105fe3660046142b3565b611de5565b34801561060f57600080fd5b506102c961061e3660046142b3565b611e60565b34801561062f57600080fd5b506003546040516001600160a01b0390911681526020016102a0565b34801561065757600080fd5b5061066b6106663660046142b3565b611e9d565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016102a0565b3480156106ac57600080fd5b50610310611f65565b3480156106c157600080fd5b506102f96106d0366004614699565b611f72565b3480156106e157600080fd5b506102f96106f03660046146c7565b611f81565b6102966107033660046142cc565b61219d565b34801561071457600080fd5b506102f9610723366004614703565b612499565b34801561073457600080fd5b506102f961074336600461473e565b6126c9565b34801561075457600080fd5b506102f9610763366004614301565b6126ef565b34801561077457600080fd5b506102f9610783366004614703565b612719565b34801561079457600080fd5b506102f96107a33660046141db565b6128e0565b3480156107b457600080fd5b506102f96107c3366004614301565b6129bb565b3480156107d457600080fd5b506102f9612a37565b3480156107e957600080fd5b506102c96107f836600461475b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561083257600080fd5b506102f9610841366004614789565b612ade565b34801561085257600080fd5b506102f9610861366004614301565b612b23565b34801561087257600080fd5b50610492612b99565b60006001600160a01b0383166108eb5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061094557506001600160e01b031982166303a24d0760e21b145b8061090e57506301ffc9a760e01b6001600160e01b031983161461090e565b61096c612bef565b600b546001600160a01b03166109c45760405162461bcd60e51b815260206004820181905260248201527f5374616b696e6720636f6e74726163742061646472657373206e6f742073657460448201526064016108e2565b6109cf8383836128e0565b600b546040516305a08f7760e21b81526001600160a01b03909116906316823ddc90610a03908690869086906004016147f1565b600060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b50505050505050565b60048054610a4790614827565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7390614827565b8015610ac05780601f10610a9557610100808354040283529160200191610ac0565b820191906000526020600020905b815481529060010190602001808311610aa357829003601f168201915b505050505081565b6000610ad382611d8d565b610aef5760405162461bcd60e51b81526004016108e290614861565b5060009081526010602052604090205490565b610b293384848460405180604001604052806002815260200161060f60f31b815250612ade565b505050565b6060610b3982612c49565b610b4283612cd3565b604051602001610b5392919061488e565b6040516020818303038152906040529050919050565b610b71612bef565b6007546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610bba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bde91906148bd565b6007549091506001600160a01b031663a9059cbb610c046003546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015610c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7591906148d6565b610cc15760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f20776974686472617720746f206f776e6572000000000060448201526064016108e2565b50565b610ccc612bef565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038516331480610d0a5750610d0a85336107f8565b610d265760405162461bcd60e51b81526004016108e2906148f3565b610d338585858585612d65565b5050505050565b610d42612bef565b610d4b84610dd6565b610d675760405162461bcd60e51b81526004016108e290614941565b6000848152600f602090815260409182902060068101869055600781018590556008810184905582518681529182018590528183018490529151869133917f71fdfef9ade7f1261c653731ed141a279490bc2bfa62c7373832035aa6bfe81d9181900360600190a35050505050565b6000818152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085528695929461012086019390929190830182828015610e9557602002820191906000526020600020905b815481526020019060010190808311610e81575b50505091909252505081519192505015610eb25750600192915050565b50600092915050565b6000610ec682610dd6565b610ee25760405162461bcd60e51b81526004016108e290614941565b6000828152600f6020908152604080832060090180548251818502810185019093528083529192909190830182828015610f3b57602002820191906000526020600020905b815481526020019060010190808311610f27575b505050505090506000805b8251811015610f8f57610f71838281518110610f6457610f64614970565b6020026020010151611de5565b610f7b908361499c565b915080610f87816149af565b915050610f46565b509392505050565b60408051600280825260608201835260009283929190602083019080368337505060095482519293506001600160a01b031691839150600090610fdc57610fdc614970565b6001600160a01b03928316602091820292909201015260085482519116908290600190811061100d5761100d614970565b6001600160a01b039283166020918202929092010152600a546000911663d06ca61f61103c86620f42406149c8565b846040518363ffffffff1660e01b815260040161105a9291906149df565b600060405180830381865afa158015611077573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261109f9190810190614a36565b9050806001815181106110b4576110b4614970565b602002602001015192505050919050565b6110cd612bef565b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b600b54606090600160a01b900460ff166111435760405162461bcd60e51b81526020600482015260156024820152744d696e74696e67206973206e6f742061637469766560581b60448201526064016108e2565b61114c83610dd6565b6111685760405162461bcd60e51b81526004016108e290614941565b81600114806111775750816005145b80611182575081600a145b6111ce5760405162461bcd60e51b815260206004820152601b60248201527f5175616e74697479206d75737420626520312c352c206f72203130000000000060448201526064016108e2565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085529194929361012086019390929083018282801561128c57602002820191906000526020600020905b815481526020019060010190808311611278575b50505050508152505090506000805b826101200151518110156112f557600083610120015182815181106112c2576112c2614970565b602002602001015190506112d581611de5565b6112df908461499c565b92505080806112ed906149af565b91505061129b565b50838110156113465760405162461bcd60e51b815260206004820152601d60248201527f4e6f7420656e6f756768206361726473206c65667420746f206d696e7400000060448201526064016108e2565b6101008201516005859003611360575060e082015161136f565b8460010361136f575060c08201515b600061137a82612f01565b60075490915081906001600160a01b03166370a08231336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa1580156113d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f991906148bd565b10156114475760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742062616c616e636520746f206d696e740000000060448201526064016108e2565b6007546001600160a01b03166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018490526064016020604051808303816000875af11580156114ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d091906148d6565b61151c5760405162461bcd60e51b815260206004820152601760248201527f4661696c656420746f207472616e7366657220464d414e00000000000000000060448201526064016108e2565b336001600160a01b03167fd3aa7599e4b0c574b10dc23d7bf5acf28f2193861951c1ba95a90f8a68073fa082604051611573918152604060208201819052600490820152632326a0a760e11b606082015260800190565b60405180910390a2600061158e611588613050565b8861308c565b90506000876001600160401b038111156115aa576115aa614105565b6040519080825280602002602001820160405280156115d3578160200160208202803683370190505b50905060005b888110156116955760008382815181106115f5576115f5614970565b60200260200101519050600061160c8d8d84613140565b90506116358d82600160405180604001604052806002815260200161060f60f31b815250613302565b60008181526010602052604090205461164f9060016133d3565b6000828152601060205260409020558351819085908590811061167457611674614970565b6020026020010181815250505050808061168d906149af565b9150506115d9565b50955050505050505b9392505050565b6116ad612bef565b6116b686610dd6565b6116d25760405162461bcd60e51b81526004016108e290614941565b8082846116df878961499c565b6116e9919061499c565b6116f3919061499c565b6116fd919061499c565b60641461174c5760405162461bcd60e51b815260206004820152601c60248201527f50726f626162696c6974696573206d75737420657175616c203130300000000060448201526064016108e2565b6000868152600f60209081526040918290206001810188905560028101879055600381018690556004810185905560058101849055825188815291820187905281830186905260608201859052608082018490529151889133917f9e41bff5959b28d73be1df72b2b93fcb6eb06c50787787a52c1cbecd68ae79c89181900360a00190a350505050505050565b6060600c80548060200260200160405190810160405280929190818152602001828054801561182757602002820191906000526020600020905b815481526020019060010190808311611813575b5050505050905090565b606081518351146118965760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016108e2565b600083516001600160401b038111156118b1576118b1614105565b6040519080825280602002602001820160405280156118da578160200160208202803683370190505b50905060005b8451811015610f8f576119258582815181106118fe576118fe614970565b602002602001015185838151811061191857611918614970565b602002602001015161087b565b82828151811061193757611937614970565b602090810291909101015261194b816149af565b90506118e0565b61195a612bef565b6119638a610dd6565b156119b05760405162461bcd60e51b815260206004820152601d60248201527f536561736f6e207769746820696420616c72656164792065786973747300000060448201526064016108e2565b8385876119bd8a8c61499c565b6119c7919061499c565b6119d1919061499c565b6119db919061499c565b606414611a2a5760405162461bcd60e51b815260206004820152601c60248201527f50726f626162696c6974696573206d75737420657175616c203130300000000060448201526064016108e2565b60008a8152600f602052604081208b8155905b8a51811015611ab35760008b8281518110611a5a57611a5a614970565b60200260200101519050611a6d81611d8d565b611a895760405162461bcd60e51b81526004016108e290614861565b60098301805460018101825560009182526020909120015580611aab816149af565b915050611a3d565b5060018181018a905560028201899055600382018890556004820187905560058201869055600682018590556007820184905560088201839055600d805491820181556000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5018b90558a336001600160a01b03167f9b0413a42145d1c201ec9c4edc02bb80f80e8c70238368bb03f610ffef905145600c604051611b599190614ad1565b60405180910390a35050505050505050505050565b6060611b7982610dd6565b611b955760405162461bcd60e51b81526004016108e290614941565b6000828152600f602090815260409182902060090180548351818402810184019094528084529091830182828015611bec57602002820191906000526020600020905b815481526020019060010190808311611bd8575b50505050509050919050565b611c00612bef565b611c0982611d8d565b611c255760405162461bcd60e51b81526004016108e290614861565b600091825260116020526040909120805460ff1916911515919091179055565b611c4d612bef565b611c5760006133df565b565b6000806000611c6784610dd6565b611c835760405162461bcd60e51b81526004016108e290614941565b6000848152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015611d4157602002820191906000526020600020905b815481526020019060010190808311611d2d575b50505050508152505090506000611d5b8260c00151612f01565b90506000611d6c8360e00151612f01565b90506000611d7e846101000151612f01565b92989197509195509350505050565b6000818152600e60209081526040808320815160a0810183528154808252600183015494820194909452600282015492810192909252600381015460608301526004015460808201529015610eb25750600192915050565b6000611df082611d8d565b611e0c5760405162461bcd60e51b81526004016108e290614861565b6000828152600e60209081526040808320600201546010909252909120541115611e3857506000919050565b600082815260106020908152604080832054600e9092529091206002015461090e9190614b18565b6000611e6b82611d8d565b611e875760405162461bcd60e51b81526004016108e290614861565b5060009081526011602052604090205460ff1690565b6000806000806000806000611eb188611d8d565b611ecd5760405162461bcd60e51b81526004016108e290614861565b6000888152600e60209081526040808320815160a0810183528154808252600183015494820194909452600282015492810192909252600381015460608301526004015460808201529190611f2190611de5565b905060003315611f3857611f3633845161087b565b505b8251608084015160208501516040860151606090960151929e919d509b5093995097509095509350915050565b60058054610a4790614827565b611f7d338383613431565b5050565b611f89612bef565b611f9282610dd6565b611fae5760405162461bcd60e51b81526004016108e290614941565b6000828152600f6020526040902081516001600160401b03811115611fd557611fd5614105565b604051908082528060200260200182016040528015611ffe578160200160208202803683370190505b508051612015916009840191602090910190614031565b5060005b825181101561215557600083828151811061203657612036614970565b6020026020010151905061204981611d8d565b6120655760405162461bcd60e51b81526004016108e290614861565b6000818152600e60209081526040808320815160a081018352815481526001820154818501526002820154818401819052600383015460608301526004909201546080820152858552601090935292205490911161211e5760405162461bcd60e51b815260206004820152603060248201527f4361726420737570706c79206578686175737465642c2075706461746520636160448201526f7264277320746f74616c537570706c7960801b60648201526084016108e2565b8184600901848154811061213457612134614970565b6000918252602090912001555081905061214d816149af565b915050612019565b5082336001600160a01b03167fe73a5835cf90e53a96e2452ddb9ac091476315e55501d8ceee6f821e3dfae1c08460405161219091906144ab565b60405180910390a3505050565b600b54600090600160a01b900460ff166121f15760405162461bcd60e51b81526020600482015260156024820152744d696e74696e67206973206e6f742061637469766560581b60448201526064016108e2565b6121fa83611d8d565b6122165760405162461bcd60e51b81526004016108e290614861565b60008381526011602052604090205460ff166122745760405162461bcd60e51b815260206004820152601a60248201527f43617264206973206e6f74206d696e742064726f707061626c6500000000000060448201526064016108e2565b6000838152600e60209081526040808320815160a0810183528154815260018201549381019390935260028101549183019190915260038101546060830152600401546080820152906122c685611de5565b905060006122d4878761087b565b9050600082116123265760405162461bcd60e51b815260206004820152601760248201527f4361726420686173206e6f20737570706c79206c65667400000000000000000060448201526064016108e2565b826060015181106123795760405162461bcd60e51b815260206004820152601860248201527f4f776e6564206d617820737570706c79206f662063617264000000000000000060448201526064016108e2565b600061238e86856020015161044d91906149c8565b9050803410156123e05760405162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e742062616c616e636520746f206d696e740000000060448201526064016108e2565b336001600160a01b03167fd3aa7599e4b0c574b10dc23d7bf5acf28f2193861951c1ba95a90f8a68073fa0826040516124369181526040602082018190526003908201526208aa8960eb1b606082015260800190565b60405180910390a261246488888860405180604001604052806002815260200161060f60f31b815250613302565b60008781526010602052604090205461247e9060016133d3565b60008881526010602052604090205550949695505050505050565b6124a1612bef565b6124aa85611d8d565b156124f75760405162461bcd60e51b815260206004820152601b60248201527f43617264207769746820696420616c726561647920657869737473000000000060448201526064016108e2565b60018310156125485760405162461bcd60e51b815260206004820152601b60248201527f546f74616c20617661696c61626c65206d757374206265203e2030000000000060448201526064016108e2565b60018210156125935760405162461bcd60e51b815260206004820152601760248201527604d6178206f776e61626c65206d757374206265203e203604c1b60448201526064016108e2565b600181101580156125a5575060058111155b6125f15760405162461bcd60e51b815260206004820152601b60248201527f4c6576656c206d757374206265206265747765656e203120262035000000000060448201526064016108e2565b6040805160a0810182528681526020808201878152828401878152606084018781526080850187815260008c8152600e909552958420855181559251600180850191909155915160028401555160038301559351600490910155600c8054938401815590527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790910186905585336001600160a01b03167fcdd98e681d282a492b25ad0d8a6ecf0a931dab5894d19038df77e397b61257b7846040516126b991815260200190565b60405180910390a3505050505050565b6126d1612bef565b600b8054911515600160a01b0260ff60a01b19909216919091179055565b6126f7612bef565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b612721612bef565b61272a85611d8d565b6127465760405162461bcd60e51b81526004016108e290614861565b60018310156127975760405162461bcd60e51b815260206004820152601b60248201527f546f74616c20617661696c61626c65206d757374206265203e2030000000000060448201526064016108e2565b60008581526010602052604090205483101561280d5760405162461bcd60e51b815260206004820152602f60248201527f546f74616c20617661696c61626c65206d757374206265206d6f72652074686160448201526e6e206d696e74656420737570706c7960881b60648201526084016108e2565b60018210156128585760405162461bcd60e51b815260206004820152601760248201527604d6178206f776e61626c65206d757374206265203e203604c1b60448201526064016108e2565b6001811015801561286a575060058111155b6128b65760405162461bcd60e51b815260206004820152601b60248201527f4c6576656c206d757374206265206265747765656e203120262035000000000060448201526064016108e2565b6000948552600e602052604090942060018101939093556002830191909155600382015560040155565b6128e8612bef565b61290e83838360405180604001604052806002815260200161060f60f31b815250613509565b60005b82518110156129b55761297282828151811061292f5761292f614970565b60200260200101516010600086858151811061294d5761294d614970565b60200260200101518152602001908152602001600020546133d390919063ffffffff16565b6010600085848151811061298857612988614970565b602002602001015181526020019081526020016000208190555080806129ad906149af565b915050612911565b50505050565b6006546001600160a01b03163314612a155760405162461bcd60e51b815260206004820152601b60248201527f43616c6c6572206973206e6f742074686520646576656c6f706572000000000060448201526064016108e2565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b612a3f612bef565b476000612a5a612710612a54846103e8613654565b90613660565b90506000612a68838361366c565b6006546040519192506001600160a01b03169083156108fc029084906000818181858888f19350505050158015612aa3573d6000803e3d6000fd5b506003546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156129b5573d6000803e3d6000fd5b6001600160a01b038516331480612afa5750612afa85336107f8565b612b165760405162461bcd60e51b81526004016108e2906148f3565b610d338585858585613678565b612b2b612bef565b6001600160a01b038116612b905760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016108e2565b610cc1816133df565b6060600d8054806020026020016040519081016040528092919081815260200182805480156118275760200282019190600052602060002090815481526020019060010190808311611813575050505050905090565b6003546001600160a01b03163314611c575760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108e2565b606060028054612c5890614827565b80601f0160208091040260200160405190810160405280929190818152602001828054612c8490614827565b8015611bec5780601f10612ca657610100808354040283529160200191611bec565b820191906000526020600020905b815481529060010190602001808311612cb45750939695505050505050565b60606000612ce0836137a2565b60010190506000816001600160401b03811115612cff57612cff614105565b6040519080825280601f01601f191660200182016040528015612d29576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d3357509392505050565b8151835114612d865760405162461bcd60e51b81526004016108e290614b41565b6001600160a01b038416612dac5760405162461bcd60e51b81526004016108e290614b89565b3360005b8451811015612e93576000858281518110612dcd57612dcd614970565b602002602001015190506000858381518110612deb57612deb614970565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612e3b5760405162461bcd60e51b81526004016108e290614bce565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e7890849061499c565b9250508190555050505080612e8c906149af565b9050612db0565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612ee3929190614c18565b60405180910390a4612ef981878787878761387a565b505050505050565b6040805160038082526080820190925260009182919060208201606080368337505060095482519293506001600160a01b031691839150600090612f4757612f47614970565b6001600160a01b039283166020918202929092010152600854825191169082906001908110612f7857612f78614970565b6001600160a01b039283166020918202929092010152600754825191169082906002908110612fa957612fa9614970565b6001600160a01b039283166020918202929092010152600a546000911663d06ca61f612fd886620f42406149c8565b846040518363ffffffff1660e01b8152600401612ff69291906149df565b600060405180830381865afa158015613013573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261303b9190810190614a36565b9050806002815181106110b4576110b4614970565b6000444260405160200161306e929190918252602082015260400190565b6040516020818303038152906040528051906020012060001c905090565b6060816001600160401b038111156130a6576130a6614105565b6040519080825280602002602001820160405280156130cf578160200160208202803683370190505b50905060005b828110156131395760408051602081018690529081018290526060016040516020818303038152906040528051906020012060001c82828151811061311c5761311c614970565b602090810291909101015280613131816149af565b9150506130d5565b5092915050565b600061314b83610dd6565b6131675760405162461bcd60e51b81526004016108e290614941565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201546101008201526009820180548451818702810187019095528085529194929361012086019390929083018282801561322557602002820191906000526020600020905b815481526020019060010190808311613211575b5050505050815250509050600061323d8686866139d5565b905060005b826101200151518110156132ec576000600e6000856101200151848151811061326d5761326d614970565b602002602001015181526020019081526020016000206040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050828160800151036132d95751935061169e92505050565b50806132e4816149af565b915050613242565b506132f8868686613140565b9695505050505050565b6001600160a01b0384166133285760405162461bcd60e51b81526004016108e290614c46565b33600061333485613b72565b9050600061334185613b72565b90506000868152602081815260408083206001600160a01b038b1684529091528120805487929061337390849061499c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610a3183600089898989613bbd565b600061169e828461499c565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036134a45760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016108e2565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101612190565b6001600160a01b03841661352f5760405162461bcd60e51b81526004016108e290614c46565b81518351146135505760405162461bcd60e51b81526004016108e290614b41565b3360005b84518110156135ec5783818151811061356f5761356f614970565b602002602001015160008087848151811061358c5761358c614970565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135d4919061499c565b909155508190506135e4816149af565b915050613554565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161363d929190614c18565b60405180910390a4610d338160008787878761387a565b600061169e82846149c8565b600061169e8284614c87565b600061169e8284614b18565b6001600160a01b03841661369e5760405162461bcd60e51b81526004016108e290614b89565b3360006136aa85613b72565b905060006136b785613b72565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156136fa5760405162461bcd60e51b81526004016108e290614bce565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061373790849061499c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613797848a8a8a8a8a613bbd565b505050505050505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137e15772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061380d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061382b57662386f26fc10000830492506010015b6305f5e1008310613843576305f5e100830492506008015b612710831061385757612710830492506004015b60648310613869576064830492506002015b600a831061090e5760010192915050565b6001600160a01b0384163b15612ef95760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906138be9089908990889088908890600401614c9b565b6020604051808303816000875af19250505080156138f9575060408051601f3d908101601f191682019092526138f691810190614ced565b60015b6139a557613905614d0a565b806308c379a00361393e5750613919614d26565b806139245750613940565b8060405162461bcd60e51b81526004016108e291906142a0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016108e2565b6001600160e01b0319811663bc197c8160e01b14610a315760405162461bcd60e51b81526004016108e290614daf565b6000806139e28585613c78565b9050600080600c805490506001600160401b03811115613a0457613a04614105565b604051908082528060200260200182016040528015613a2d578160200160208202803683370190505b50905060005b8351811015613ac4576000848281518110613a5057613a50614970565b60200260200101511115613ab2576000613a8388868481518110613a7657613a76614970565b6020026020010151613ed6565b9050613a8f818561499c565b935080838381518110613aa457613aa4614970565b602002602001018181525050505b80613abc816149af565b915050613a33565b506000613adc6001613ad68886614025565b906133d3565b905060005b8251811015613b5a57828181518110613afc57613afc614970565b60200260200101518211613b2157613b1581600161499c565b9550505050505061169e565b828181518110613b3357613b33614970565b602002602001015182613b469190614b18565b915080613b52816149af565b915050613ae1565b50613b668888886139d5565b98975050505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613bac57613bac614970565b602090810291909101015292915050565b6001600160a01b0384163b15612ef95760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613c019089908990889088908890600401614df7565b6020604051808303816000875af1925050508015613c3c575060408051601f3d908101601f19168201909252613c3991810190614ced565b60015b613c4857613905614d0a565b6001600160e01b0319811663f23a6e6160e01b14610a315760405162461bcd60e51b81526004016108e290614daf565b6060613c8382610dd6565b613c9f5760405162461bcd60e51b81526004016108e290614941565b6000828152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015613d5d57602002820191906000526020600020905b815481526020019060010190808311613d49575b505050505081525050905060008161012001519050600081516001600160401b03811115613d8d57613d8d614105565b604051908082528060200260200182016040528015613db6578160200160208202803683370190505b50905060005b8251811015613ecc576000600e6000858481518110613ddd57613ddd614970565b602002602001015181526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820154815260200160048201548152505090506000613e418260000151611de5565b90506000613e538a846000015161087b565b9050600082118015613e685750826060015181105b15613e95578260000151858581518110613e8457613e84614970565b602002602001018181525050613eb6565b6000858581518110613ea957613ea9614970565b6020026020010181815250505b5050508080613ec4906149af565b915050613dbc565b5095945050505050565b6000613ee183610dd6565b613efd5760405162461bcd60e51b81526004016108e290614941565b6000838152600f60209081526040808320815161014081018352815481526001820154818501526002820154818401526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e0820152600882015461010082015260098201805484518187028101870190955280855291949293610120860193909290830182828015613fbb57602002820191906000526020600020905b815481526020019060010190808311613fa7575b505050505081525050905082600103613fd95760200151905061090e565b82600203613fec5760400151905061090e565b82600303613fff5760600151905061090e565b826004036140125760800151905061090e565b826005036131395760a00151905061090e565b600061169e8284614e31565b82805482825590600052602060002090810192821561406c579160200282015b8281111561406c578251825591602001919060010190614051565b5061407892915061407c565b5090565b5b80821115614078576000815560010161407d565b6001600160a01b0381168114610cc157600080fd5b600080604083850312156140b957600080fd5b82356140c481614091565b946020939093013593505050565b6001600160e01b031981168114610cc157600080fd5b6000602082840312156140fa57600080fd5b813561169e816140d2565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561414057614140614105565b6040525050565b60006001600160401b0382111561416057614160614105565b5060051b60200190565b600082601f83011261417b57600080fd5b8135602061418882614147565b604051614195828261411b565b83815260059390931b85018201928281019150868411156141b557600080fd5b8286015b848110156141d057803583529183019183016141b9565b509695505050505050565b6000806000606084860312156141f057600080fd5b83356141fb81614091565b925060208401356001600160401b038082111561421757600080fd5b6142238783880161416a565b9350604086013591508082111561423957600080fd5b506142468682870161416a565b9150509250925092565b60005b8381101561426b578181015183820152602001614253565b50506000910152565b6000815180845261428c816020860160208601614250565b601f01601f19169290920160200192915050565b60208152600061169e6020830184614274565b6000602082840312156142c557600080fd5b5035919050565b6000806000606084860312156142e157600080fd5b83356142ec81614091565b95602085013595506040909401359392505050565b60006020828403121561431357600080fd5b813561169e81614091565b600082601f83011261432f57600080fd5b81356001600160401b0381111561434857614348614105565b60405161435f601f8301601f19166020018261411b565b81815284602083860101111561437457600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a086880312156143a957600080fd5b85356143b481614091565b945060208601356143c481614091565b935060408601356001600160401b03808211156143e057600080fd5b6143ec89838a0161416a565b9450606088013591508082111561440257600080fd5b61440e89838a0161416a565b9350608088013591508082111561442457600080fd5b506144318882890161431e565b9150509295509295909350565b6000806000806080858703121561445457600080fd5b5050823594602084013594506040840135936060013592509050565b600081518084526020808501945080840160005b838110156144a057815187529582019590820190600101614484565b509495945050505050565b60208152600061169e6020830184614470565b60008060008060008060c087890312156144d757600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b6000806040838503121561451457600080fd5b82356001600160401b038082111561452b57600080fd5b818501915085601f83011261453f57600080fd5b8135602061454c82614147565b604051614559828261411b565b83815260059390931b850182019282810191508984111561457957600080fd5b948201945b838610156145a057853561459181614091565b8252948201949082019061457e565b965050860135925050808211156145b657600080fd5b506145c38582860161416a565b9150509250929050565b6000806000806000806000806000806101408b8d0312156145ed57600080fd5b8a35995060208b01356001600160401b0381111561460a57600080fd5b6146168d828e0161416a565b9a9d9a9c505050506040890135986060810135986080820135985060a0820135975060c0820135965060e0820135955061010082013594506101209091013592509050565b8015158114610cc157600080fd5b6000806040838503121561467c57600080fd5b82359150602083013561468e8161465b565b809150509250929050565b600080604083850312156146ac57600080fd5b82356146b781614091565b9150602083013561468e8161465b565b600080604083850312156146da57600080fd5b8235915060208301356001600160401b038111156146f757600080fd5b6145c38582860161416a565b600080600080600060a0868803121561471b57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b60006020828403121561475057600080fd5b813561169e8161465b565b6000806040838503121561476e57600080fd5b823561477981614091565b9150602083013561468e81614091565b600080600080600060a086880312156147a157600080fd5b85356147ac81614091565b945060208601356147bc81614091565b9350604086013592506060860135915060808601356001600160401b038111156147e557600080fd5b6144318882890161431e565b6001600160a01b038416815260606020820181905260009061481590830185614470565b82810360408401526132f88185614470565b600181811c9082168061483b57607f821691505b60208210810361485b57634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526013908201527210d85c9908191bd95cc81b9bdd08195e1a5cdd606a1b604082015260600190565b600083516148a0818460208801614250565b8351908301906148b4818360208801614250565b01949350505050565b6000602082840312156148cf57600080fd5b5051919050565b6000602082840312156148e857600080fd5b815161169e8161465b565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60208082526015908201527414d9585cdbdb88191bd95cc81b9bdd08195e1a5cdd605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561090e5761090e614986565b6000600182016149c1576149c1614986565b5060010190565b808202811582820484141761090e5761090e614986565b6000604082018483526020604081850152818551808452606086019150828701935060005b81811015614a295784516001600160a01b031683529383019391830191600101614a04565b5090979650505050505050565b60006020808385031215614a4957600080fd5b82516001600160401b03811115614a5f57600080fd5b8301601f81018513614a7057600080fd5b8051614a7b81614147565b604051614a88828261411b565b82815260059290921b8301840191848101915087831115614aa857600080fd5b928401925b82841015614ac657835182529284019290840190614aad565b979650505050505050565b6020808252825482820181905260008481528281209092916040850190845b81811015614b0c57835483526001938401939285019201614af0565b50909695505050505050565b8181038181111561090e5761090e614986565b634e487b7160e01b600052601260045260246000fd5b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000614c2b6040830185614470565b8281036020840152614c3d8185614470565b95945050505050565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b600082614c9657614c96614b2b565b500490565b6001600160a01b0386811682528516602082015260a060408201819052600090614cc790830186614470565b8281036060840152614cd98186614470565b90508281036080840152613b668185614274565b600060208284031215614cff57600080fd5b815161169e816140d2565b600060033d1115614d235760046000803e5060005160e01c5b90565b600060443d1015614d345790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614d6357505050505090565b8285019150815181811115614d7b5750505050505090565b843d8701016020828501011115614d955750505050505090565b614da46020828601018761411b565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614ac690830184614274565b600082614e4057614e40614b2b565b50069056fea264697066735822122046605ac1a6cc5f5de2b3b521951e900df62225f84a48bcd46b97217e11f0819964736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c780e679b4ca9c9cc72b50a39e5ee06316af6d52000000000000000000000000d56990d60a7abf3a7945f0565a98a708234b802c
-----Decoded View---------------
Arg [0] : __developerAddress (address): 0xc780e679B4ca9c9cC72b50A39E5Ee06316AF6D52
Arg [1] : __tokenAddress (address): 0xD56990D60A7Abf3a7945F0565A98A708234b802C
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c780e679b4ca9c9cc72b50a39e5ee06316af6d52
Arg [1] : 000000000000000000000000d56990d60a7abf3a7945f0565a98a708234b802c
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.