Source Code
Latest 25 from a total of 6,742 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Open Chest | 6208097 | 557 days ago | IN | 0.000025 ETH | 0.00000102 | ||||
| Claim Gas | 6036563 | 561 days ago | IN | 0 ETH | 0.00001323 | ||||
| Claim Gas | 5773619 | 567 days ago | IN | 0 ETH | 0.00000002 | ||||
| Claim Gas | 5732169 | 568 days ago | IN | 0 ETH | 0.00001323 | ||||
| Claim Gas | 5730316 | 568 days ago | IN | 0 ETH | 0 | ||||
| Claim Gas | 5709693 | 568 days ago | IN | 0 ETH | 0.00000003 | ||||
| Claim Gas | 5706410 | 569 days ago | IN | 0 ETH | 0.0000001 | ||||
| Claim Gas | 5706094 | 569 days ago | IN | 0 ETH | 0.00000011 | ||||
| Claim Gas | 5705968 | 569 days ago | IN | 0 ETH | 0.00000005 | ||||
| Claim Gas | 5705777 | 569 days ago | IN | 0 ETH | 0.00000011 | ||||
| Claim Gas | 5704940 | 569 days ago | IN | 0 ETH | 0.00000014 | ||||
| Claim Gas | 5700661 | 569 days ago | IN | 0 ETH | 0.00000048 | ||||
| Claim Gas | 5700028 | 569 days ago | IN | 0 ETH | 0.00000046 | ||||
| Claim Gas | 5691575 | 569 days ago | IN | 0 ETH | 0.00000163 | ||||
| Claim Gas | 5684755 | 569 days ago | IN | 0 ETH | 0.00000072 | ||||
| Claim Gas | 5682944 | 569 days ago | IN | 0 ETH | 0.0000006 | ||||
| Claim Gas | 5678662 | 569 days ago | IN | 0 ETH | 0.00000065 | ||||
| Claim Gas | 5675057 | 569 days ago | IN | 0 ETH | 0.00000207 | ||||
| Claim Gas | 5671218 | 569 days ago | IN | 0 ETH | 0.00000553 | ||||
| Claim Gas | 5664600 | 570 days ago | IN | 0 ETH | 0.00000011 | ||||
| Claim Gas | 5657341 | 570 days ago | IN | 0 ETH | 0.00000009 | ||||
| Claim Gas | 5649604 | 570 days ago | IN | 0 ETH | 0.00000064 | ||||
| Claim Gas | 5649248 | 570 days ago | IN | 0 ETH | 0.0000006 | ||||
| Claim Gas | 5648879 | 570 days ago | IN | 0 ETH | 0.00000057 | ||||
| Claim Gas | 5647505 | 570 days ago | IN | 0 ETH | 0.0000011 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 6208097 | 557 days ago | 0.000025 ETH | ||||
| 5479903 | 574 days ago | 0.000025 ETH | ||||
| 5181840 | 581 days ago | 0.000025 ETH | ||||
| 5166929 | 581 days ago | 0.000025 ETH | ||||
| 5166306 | 581 days ago | 0.000025 ETH | ||||
| 5165895 | 581 days ago | 0.000025 ETH | ||||
| 5164916 | 581 days ago | 0.000025 ETH | ||||
| 5164856 | 581 days ago | 0.000025 ETH | ||||
| 5164453 | 581 days ago | 0.000025 ETH | ||||
| 5154851 | 581 days ago | 0.000025 ETH | ||||
| 5154820 | 581 days ago | 0.000025 ETH | ||||
| 5154764 | 581 days ago | 0.000025 ETH | ||||
| 5152727 | 581 days ago | 0.000025 ETH | ||||
| 5151864 | 581 days ago | 0.00012 ETH | ||||
| 5149980 | 581 days ago | 0.000025 ETH | ||||
| 5149525 | 581 days ago | 0.000025 ETH | ||||
| 5148616 | 581 days ago | 0.000025 ETH | ||||
| 5148366 | 581 days ago | 0.000025 ETH | ||||
| 5147739 | 581 days ago | 0.000025 ETH | ||||
| 5147327 | 581 days ago | 0.00005 ETH | ||||
| 5147016 | 582 days ago | 0.00012 ETH | ||||
| 5146870 | 582 days ago | 0.00012 ETH | ||||
| 5146835 | 582 days ago | 0.000075 ETH | ||||
| 5146730 | 582 days ago | 0.00005 ETH | ||||
| 5146720 | 582 days ago | 0.000075 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MonoChest
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropy.sol";
import "@pythnetwork/entropy-sdk-solidity/IEntropyConsumer.sol";
import "../base/BaseBlast.sol";
import "../interface/IMonoSwapNFT.sol";
import "../interface/IXMono.sol";
import "../interface/IMUSD.sol";
import "../interface/IMonoPass.sol";
import "../pot/interfaces/IMonoSwapPot.sol";
contract MonoChest is
Ownable,
ReentrancyGuard,
IEntropyConsumer,
IERC721Receiver,
BaseBlast
{
using EnumerableSet for EnumerableSet.AddressSet;
using Address for address;
uint256 public constant MONO_TICKET_ID = 1;
uint256 public constant MONO_COMMON_KEY_ID = 2;
uint256 public constant MONO_UNCOMMON_KEY_ID = 3;
uint256 public constant MONO_RARE_KEY_ID = 4;
uint256 public constant MONO_EPIC_KEY_ID = 5;
uint256 public constant MONO_MYTHICAL_KEY_ID = 6;
uint256 public potInjectPercent = 10;
uint256 public chestRefillPercent = 40;
IMonoSwapNFT public monoNFT;
IMonoPass public monoPass;
IERC20Metadata public usdb;
IMonoSwapPot public pot;
IMUSD public musd;
IXMono public xMono;
IEntropy private entropy;
address private entropyProvider;
address public devWallet;
mapping(ChestType => uint256) public chestPrice;
mapping(ChestType => uint256) public chestKey;
mapping(uint64 => RequestRandom) public requestRandoms;
mapping(ChestType => uint256) public ticketRewards;
mapping(ChestType => uint256[]) public chestRewardsThreshold;
mapping(ChestType => ChestReward[]) public chestRewards;
mapping(ChestType => uint256) public totalChestOpened;
uint256 public totalParticipant;
mapping(address => bool) public isParticipant;
mapping(address => mapping(ChestType => uint256))
public totalChestOpenedByUser;
TotalReward public totalRewardEarned;
mapping(ChestType => uint256) public txFees;
struct TotalReward {
uint256 totalXMono;
uint256 totalUSD;
uint256 totalMonoPass;
}
struct ChestReward {
uint256 xMonoAmount;
uint256 usdAmount;
bool availableMonoPass;
}
struct RequestRandom {
address user;
ChestType chestType;
uint256 amount;
uint64 sequenceNumber;
}
enum ChestType {
Common,
Uncommon,
Rare,
Epic,
Mythical
}
enum PaymentToken {
USDB,
MUSD,
KEY
}
event RandomNumberRequested(
address indexed user,
ChestType chestType,
uint256 amount,
uint64 indexed sequenceNumber
);
event ChestOpened(
address indexed user,
uint256 amountXMono,
uint256 amountUsd,
uint256 amountTicket,
bool availableMonoPass
);
event TransferReward(
address indexed user,
uint256 amountTicket,
uint256 amountXMono,
uint256 amountUsd,
uint256 amountMonoPass
);
event RandomChest(uint64 indexed sequenceNumber, uint256 randomNumber);
constructor(
address _blast,
IMonoSwapNFT _monoNFT,
IMonoPass _monoPass,
IMUSD _musd,
IXMono _xMono,
IERC20Metadata _usdb,
address _entropy,
address _entropyProvider,
address _devWallet,
IMonoSwapPot _pot
) Ownable(msg.sender) BaseBlast(_blast) {
monoNFT = _monoNFT;
monoPass = _monoPass;
musd = _musd;
xMono = _xMono;
usdb = _usdb;
pot = _pot;
txFees[ChestType.Common] = 0.000025 ether;
txFees[ChestType.Uncommon] = 0.00005 ether;
txFees[ChestType.Rare] = 0.000075 ether;
txFees[ChestType.Epic] = 0.0001 ether;
txFees[ChestType.Mythical] = 0.00012 ether;
musd.approve(address(_pot), type(uint256).max);
usdb.approve(address(_musd), type(uint256).max);
entropy = IEntropy(_entropy);
entropyProvider = _entropyProvider;
devWallet = _devWallet;
// Set up ticket rewards for each chest type
ticketRewards[ChestType.Common] = 1;
ticketRewards[ChestType.Uncommon] = 2;
ticketRewards[ChestType.Rare] = 3;
ticketRewards[ChestType.Epic] = 4;
ticketRewards[ChestType.Mythical] = 5;
// Set up chest price for each chest type
chestPrice[ChestType.Common] = 1 ether;
chestPrice[ChestType.Uncommon] = 2 ether;
chestPrice[ChestType.Rare] = 3 ether;
chestPrice[ChestType.Epic] = 4 ether;
chestPrice[ChestType.Mythical] = 5 ether;
// Set up chest type for each ticket
chestKey[ChestType.Common] = MONO_COMMON_KEY_ID;
chestKey[ChestType.Uncommon] = MONO_UNCOMMON_KEY_ID;
chestKey[ChestType.Rare] = MONO_RARE_KEY_ID;
chestKey[ChestType.Epic] = MONO_EPIC_KEY_ID;
chestKey[ChestType.Mythical] = MONO_MYTHICAL_KEY_ID;
// Set up chest rewards threshold for each chest type
// Common
chestRewardsThreshold[ChestType.Common].push(750);
chestRewardsThreshold[ChestType.Common].push(12750);
chestRewardsThreshold[ChestType.Common].push(32750);
chestRewardsThreshold[ChestType.Common].push(34250);
chestRewardsThreshold[ChestType.Common].push(36750);
chestRewardsThreshold[ChestType.Common].push(48750);
chestRewardsThreshold[ChestType.Common].push(103750);
chestRewardsThreshold[ChestType.Common].push(183750);
chestRewardsThreshold[ChestType.Common].push(283750);
chestRewardsThreshold[ChestType.Common].push(403750);
chestRewardsThreshold[ChestType.Common].push(503750);
chestRewardsThreshold[ChestType.Common].push(578750);
chestRewards[ChestType.Common].push(
ChestReward({availableMonoPass: true, usdAmount: 0, xMonoAmount: 0})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.2 ether
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.1 ether
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 10 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 7 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 5 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 3 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 1 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.4 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Common].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.1 ether,
xMonoAmount: 0
})
);
// Uncommon
chestRewardsThreshold[ChestType.Uncommon].push(750);
chestRewardsThreshold[ChestType.Uncommon].push(6750);
chestRewardsThreshold[ChestType.Uncommon].push(18750);
chestRewardsThreshold[ChestType.Uncommon].push(38750);
chestRewardsThreshold[ChestType.Uncommon].push(39250);
chestRewardsThreshold[ChestType.Uncommon].push(40250);
chestRewardsThreshold[ChestType.Uncommon].push(42250);
chestRewardsThreshold[ChestType.Uncommon].push(44250);
chestRewardsThreshold[ChestType.Uncommon].push(54250);
chestRewardsThreshold[ChestType.Uncommon].push(104250);
chestRewardsThreshold[ChestType.Uncommon].push(204250);
chestRewardsThreshold[ChestType.Uncommon].push(254250);
chestRewardsThreshold[ChestType.Uncommon].push(354250);
chestRewardsThreshold[ChestType.Uncommon].push(454250);
chestRewardsThreshold[ChestType.Uncommon].push(504250);
chestRewardsThreshold[ChestType.Uncommon].push(514250);
chestRewards[ChestType.Uncommon].push(
ChestReward({availableMonoPass: true, usdAmount: 0, xMonoAmount: 0})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.5 ether
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.3 ether
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.1 ether
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 100 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 50 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 20 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 10 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 4 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 1 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.4 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Uncommon].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.1 ether,
xMonoAmount: 0
})
);
// Rare
chestRewardsThreshold[ChestType.Rare].push(750);
chestRewardsThreshold[ChestType.Rare].push(3750);
chestRewardsThreshold[ChestType.Rare].push(9750);
chestRewardsThreshold[ChestType.Rare].push(21750);
chestRewardsThreshold[ChestType.Rare].push(41750);
chestRewardsThreshold[ChestType.Rare].push(41875);
chestRewardsThreshold[ChestType.Rare].push(42125);
chestRewardsThreshold[ChestType.Rare].push(42625);
chestRewardsThreshold[ChestType.Rare].push(43625);
chestRewardsThreshold[ChestType.Rare].push(48625);
chestRewardsThreshold[ChestType.Rare].push(58625);
chestRewardsThreshold[ChestType.Rare].push(88625);
chestRewardsThreshold[ChestType.Rare].push(163625);
chestRewardsThreshold[ChestType.Rare].push(238625);
chestRewardsThreshold[ChestType.Rare].push(288625);
chestRewardsThreshold[ChestType.Rare].push(313625);
chestRewardsThreshold[ChestType.Rare].push(323625);
chestRewardsThreshold[ChestType.Rare].push(328625);
chestRewards[ChestType.Rare].push(
ChestReward({availableMonoPass: true, usdAmount: 0, xMonoAmount: 0})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 1 ether
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.5 ether
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.3 ether
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.1 ether
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 200 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 100 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 50 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 20 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 10 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 7 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 5 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 3 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 1 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.6 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Rare].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.1 ether,
xMonoAmount: 0
})
);
// Epic
chestRewardsThreshold[ChestType.Epic].push(1500);
chestRewardsThreshold[ChestType.Epic].push(4500);
chestRewardsThreshold[ChestType.Epic].push(10500);
chestRewardsThreshold[ChestType.Epic].push(22500);
chestRewardsThreshold[ChestType.Epic].push(42500);
chestRewardsThreshold[ChestType.Epic].push(42600);
chestRewardsThreshold[ChestType.Epic].push(42850);
chestRewardsThreshold[ChestType.Epic].push(43350);
chestRewardsThreshold[ChestType.Epic].push(44350);
chestRewardsThreshold[ChestType.Epic].push(46850);
chestRewardsThreshold[ChestType.Epic].push(61850);
chestRewardsThreshold[ChestType.Epic].push(101850);
chestRewardsThreshold[ChestType.Epic].push(161850);
chestRewardsThreshold[ChestType.Epic].push(261850);
chestRewardsThreshold[ChestType.Epic].push(341850);
chestRewardsThreshold[ChestType.Epic].push(401850);
chestRewardsThreshold[ChestType.Epic].push(441850);
chestRewardsThreshold[ChestType.Epic].push(461850);
chestRewardsThreshold[ChestType.Epic].push(471850);
chestRewards[ChestType.Epic].push(
ChestReward({availableMonoPass: true, usdAmount: 0, xMonoAmount: 0})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 1 ether
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.5 ether
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.3 ether
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.1 ether
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 400 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 200 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 100 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 50 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 20 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 10 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 7 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 5 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 3 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 1 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.4 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Epic].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.1 ether,
xMonoAmount: 0
})
);
// Mythical
chestRewardsThreshold[ChestType.Mythical].push(1500);
chestRewardsThreshold[ChestType.Mythical].push(4500);
chestRewardsThreshold[ChestType.Mythical].push(10500);
chestRewardsThreshold[ChestType.Mythical].push(22500);
chestRewardsThreshold[ChestType.Mythical].push(42500);
chestRewardsThreshold[ChestType.Mythical].push(42550);
chestRewardsThreshold[ChestType.Mythical].push(42650);
chestRewardsThreshold[ChestType.Mythical].push(42900);
chestRewardsThreshold[ChestType.Mythical].push(43400);
chestRewardsThreshold[ChestType.Mythical].push(44400);
chestRewardsThreshold[ChestType.Mythical].push(46900);
chestRewardsThreshold[ChestType.Mythical].push(56900);
chestRewardsThreshold[ChestType.Mythical].push(96900);
chestRewardsThreshold[ChestType.Mythical].push(176900);
chestRewardsThreshold[ChestType.Mythical].push(246900);
chestRewardsThreshold[ChestType.Mythical].push(301900);
chestRewardsThreshold[ChestType.Mythical].push(336900);
chestRewardsThreshold[ChestType.Mythical].push(356900);
chestRewardsThreshold[ChestType.Mythical].push(366900);
chestRewardsThreshold[ChestType.Mythical].push(371900);
chestRewards[ChestType.Mythical].push(
ChestReward({availableMonoPass: true, usdAmount: 0, xMonoAmount: 0})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 1 ether
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.5 ether
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.3 ether
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0,
xMonoAmount: 0.1 ether
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 600 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 400 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 200 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 100 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 50 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 20 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 10 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 7 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 5 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 3 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 1 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.8 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.4 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.2 ether,
xMonoAmount: 0
})
);
chestRewards[ChestType.Mythical].push(
ChestReward({
availableMonoPass: false,
usdAmount: 0.1 ether,
xMonoAmount: 0
})
);
}
function openChest(
uint256 amount,
ChestType chestType,
PaymentToken paymentToken,
bool pythFlag
) external payable {
require(
msg.value >= (getFee() + txFees[chestType]),
"Insufficient fee"
);
payable(devWallet).transfer(txFees[chestType]);
require(!isContract(msg.sender), "Contract not allowed");
require(amount > 0, "Amount must be greater than 0");
if (!isParticipant[msg.sender]) {
isParticipant[msg.sender] = true;
totalParticipant += 1;
}
_pay(amount, chestType, paymentToken);
uint64 sequenceNumber = entropy.requestWithCallback{value: getFee()}(
entropyProvider,
bytes32("MonoChest")
);
requestRandoms[sequenceNumber] = RequestRandom(
msg.sender,
chestType,
amount,
sequenceNumber
);
totalChestOpened[chestType] += amount;
totalChestOpenedByUser[msg.sender][chestType] += amount;
emit RandomNumberRequested(
msg.sender,
chestType,
amount,
sequenceNumber
);
if (!pythFlag) {
entropy.revealWithCallback(
entropyProvider,
sequenceNumber,
bytes32("MonoChest"),
bytes32("MonoChestProviderRevelation")
);
}
}
function _pay(
uint256 amountChest,
ChestType chestType,
PaymentToken paymentToken
) internal {
if (paymentToken == PaymentToken.USDB) {
uint256 potAmount = (amountChest *
chestPrice[chestType] *
potInjectPercent) / 100;
uint256 refillAmount = (amountChest *
chestPrice[chestType] *
chestRefillPercent) / 100;
usdb.transferFrom(
msg.sender,
devWallet,
amountChest * chestPrice[chestType] - potAmount - refillAmount
);
usdb.transferFrom(
msg.sender,
address(this),
potAmount + refillAmount
);
musd.deposit(refillAmount);
uint256 balanceBefore = musd.balanceOf(address(this));
musd.deposit(potAmount);
uint256 balanceAfter = musd.balanceOf(address(this));
pot.injectFunds(
pot.viewCurrentPotId(),
balanceAfter - balanceBefore
);
} else if (paymentToken == PaymentToken.MUSD) {
uint256 price = musd.getPrice();
uint256 musdAmount = (amountChest *
chestPrice[chestType] *
1e8 *
95) /
price /
100;
uint256 potAmount = (musdAmount * potInjectPercent) / 100;
uint256 refillAmount = (musdAmount * chestRefillPercent) / 100;
musd.transferFrom(
msg.sender,
devWallet,
musdAmount - potAmount - refillAmount
);
musd.transferFrom(
msg.sender,
address(this),
potAmount + refillAmount
);
pot.injectFunds(pot.viewCurrentPotId(), potAmount);
} else if (paymentToken == PaymentToken.KEY) {
monoNFT.burn(msg.sender, chestKey[chestType], amountChest);
} else {
revert("Invalid payment token");
}
}
function getFee() public view returns (uint256 fee) {
fee = entropy.getFee(entropyProvider);
}
function entropyCallback(
uint64 sequenceNumber,
// If your app uses multiple providers, you can use this argument
// to distinguish which one is calling the app back. This app only
// uses one provider so this argument is not used.
address,
bytes32 randomNumber
) internal override nonReentrant {
RequestRandom storage requestRandom = requestRandoms[sequenceNumber];
require(
requestRandom.user != address(0),
"MonoChest: Invalid sequence number"
);
require(
sequenceNumber == requestRandom.sequenceNumber,
"MonoChest: Invalid sequence number"
);
uint256 xMonoAmount;
uint256 usdAmount;
uint256 passAmount;
// Do something with the random number
for (uint256 i = 0; i < requestRandom.amount; i++) {
(
uint256 rewardXmono,
uint256 rewardUsd,
uint256 rewardPass
) = _openChest(
requestRandom,
randomNumber,
i,
passAmount >= monoPass.balanceOf(address(this))
);
xMonoAmount += rewardXmono;
usdAmount += rewardUsd;
passAmount += rewardPass;
}
_transferReward(requestRandom.user, xMonoAmount, usdAmount, passAmount);
monoNFT.mint(
requestRandom.user,
MONO_TICKET_ID,
requestRandom.amount * ticketRewards[requestRandom.chestType],
""
);
emit TransferReward(
requestRandom.user,
requestRandom.amount * ticketRewards[requestRandom.chestType],
xMonoAmount,
usdAmount,
passAmount
);
}
function _openChest(
RequestRandom storage requestRandom,
bytes32 randomNumber,
uint256 seed,
bool isExceedPass
)
internal
returns (uint256 xMonoAmount, uint256 usdAmount, uint256 passAmount)
{
randomNumber = keccak256(
abi.encodePacked(
randomNumber,
blockhash(block.number - seed),
gasleft(),
seed
)
);
uint256 random = uint256(randomNumber) %
chestRewardsThreshold[requestRandom.chestType][
chestRewardsThreshold[requestRandom.chestType].length - 1
];
emit RandomChest(requestRandom.sequenceNumber, random);
ChestReward memory reward = getRewardByRandomNumber(
requestRandom.chestType,
random
);
if (isExceedPass && reward.availableMonoPass) {
reward = chestRewards[requestRandom.chestType][1];
}
// _transferReward(requestRandom.user, reward);
emit ChestOpened(
requestRandom.user,
reward.xMonoAmount,
reward.usdAmount,
ticketRewards[requestRandom.chestType],
reward.availableMonoPass
);
return (
reward.xMonoAmount,
reward.usdAmount,
reward.availableMonoPass ? 1 : 0
);
}
function _transferReward(
address to,
uint256 xMonoAmount,
uint256 usdAmount,
uint256 passAmount
) internal {
if (passAmount > 0) {
for (uint256 i = 0; i < passAmount; i++) {
monoPass.safeTransferFrom(
address(this),
to,
monoPass.tokenOfOwnerByIndex(address(this), 0),
""
);
totalRewardEarned.totalMonoPass += 1;
}
}
if (xMonoAmount > 0) {
xMono.transfer(to, xMonoAmount);
totalRewardEarned.totalXMono += xMonoAmount;
}
if (usdAmount > 0) {
uint256 price = musd.getPrice();
uint256 musdAmount = (usdAmount * 1e8) / price;
musd.transfer(to, musdAmount);
totalRewardEarned.totalUSD += usdAmount;
}
}
function setPaymentToken(
IMUSD _musd,
IXMono _xMono,
IERC20Metadata _usdb
) external onlyOwner {
musd = _musd;
xMono = _xMono;
usdb = _usdb;
}
function setTxFee(ChestType chestType, uint256 fee) external onlyOwner {
txFees[chestType] = fee;
}
function setPot(IMonoSwapPot _pot) external onlyOwner {
pot = _pot;
pot.viewCurrentPotId();
}
function setPotInjectAndRefillPercent(
uint256 _potInjectPercent,
uint256 _refillPercent
) external onlyOwner {
require(_potInjectPercent + _refillPercent < 100, "Invalid percent");
potInjectPercent = _potInjectPercent;
chestRefillPercent = _refillPercent;
}
function withdrawToken(address token, uint256 amount) external onlyOwner {
if (token == address(0)) {
payable(msg.sender).transfer(amount);
} else {
IERC20Metadata(token).transfer(msg.sender, amount);
}
}
function withdrawNFT(address nft, uint256 tokenId) external onlyOwner {
IERC721(nft).transferFrom(address(this), msg.sender, tokenId);
}
function withdrawPass(uint256 amount) external onlyOwner {
require(
monoPass.balanceOf(address(this)) >= amount,
"Insufficient pass"
);
for (uint256 i = 0; i < amount; i++) {
monoPass.safeTransferFrom(
address(this),
msg.sender,
monoPass.tokenOfOwnerByIndex(address(this), 0),
""
);
}
}
function setMonoNFT(IMonoSwapNFT _monoNFT) external onlyOwner {
monoNFT = _monoNFT;
}
function setMonoPass(IMonoPass _monoPass) external onlyOwner {
monoPass = _monoPass;
}
function setEntropy(
address _entropy,
address _entropyProvider
) external onlyOwner {
entropy = IEntropy(_entropy);
entropyProvider = _entropyProvider;
}
function setDevWallet(address _devWallet) external onlyOwner {
devWallet = _devWallet;
}
function setPrice(ChestType chestType, uint256 price) external onlyOwner {
chestPrice[chestType] = price;
}
function getRewardByRandomNumber(
ChestType chestType,
uint256 random
) public view returns (ChestReward memory) {
ChestReward memory reward;
for (uint256 i = 0; i < chestRewardsThreshold[chestType].length; i++) {
if (random < chestRewardsThreshold[chestType][i]) {
reward = chestRewards[chestType][i];
break;
}
}
return reward;
}
// This method is required by the IEntropyConsumer interface.
// It returns the address of the entropy contract which will call the callback.
function getEntropy() internal view override returns (address) {
return address(entropy);
}
function isContract(address _addr) private view returns (bool) {
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external pure returns (bytes4) {
return this.onERC721Received.selector;
}
function supportsInterface(
bytes4 interfaceId
) external pure returns (bool) {
return
interfaceId == type(IERC165).interfaceId ||
interfaceId == type(IERC721Receiver).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../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.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the value of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `value` amount.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.20;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position is the index of the value in the `values` array plus 1.
// Position 0 is used to mean a value is not in the set.
mapping(bytes32 value => uint256) _positions;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._positions[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We cache the value's position to prevent multiple reads from the same storage slot
uint256 position = set._positions[value];
if (position != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 valueIndex = position - 1;
uint256 lastIndex = set._values.length - 1;
if (valueIndex != lastIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the lastValue to the index where the value to delete is
set._values[valueIndex] = lastValue;
// Update the tracked position of the lastValue (that was just moved)
set._positions[lastValue] = position;
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the tracked position for the deleted slot
delete set._positions[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._positions[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
import "./EntropyStructs.sol";
interface EntropyEvents {
event Registered(EntropyStructs.ProviderInfo provider);
event Requested(EntropyStructs.Request request);
event RequestedWithCallback(
address indexed provider,
address indexed requestor,
uint64 indexed sequenceNumber,
bytes32 userRandomNumber,
EntropyStructs.Request request
);
event Revealed(
EntropyStructs.Request request,
bytes32 userRevelation,
bytes32 providerRevelation,
bytes32 blockHash,
bytes32 randomNumber
);
event RevealedWithCallback(
EntropyStructs.Request request,
bytes32 userRandomNumber,
bytes32 providerRevelation,
bytes32 randomNumber
);
event ProviderFeeUpdated(address provider, uint128 oldFee, uint128 newFee);
event ProviderUriUpdated(address provider, bytes oldUri, bytes newUri);
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
contract EntropyStructs {
struct ProviderInfo {
uint128 feeInWei;
uint128 accruedFeesInWei;
// The commitment that the provider posted to the blockchain, and the sequence number
// where they committed to this. This value is not advanced after the provider commits,
// and instead is stored to help providers track where they are in the hash chain.
bytes32 originalCommitment;
uint64 originalCommitmentSequenceNumber;
// Metadata for the current commitment. Providers may optionally use this field to to help
// manage rotations (i.e., to pick the sequence number from the correct hash chain).
bytes commitmentMetadata;
// Optional URI where clients can retrieve revelations for the provider.
// Client SDKs can use this field to automatically determine how to retrieve random values for each provider.
// TODO: specify the API that must be implemented at this URI
bytes uri;
// The first sequence number that is *not* included in the current commitment (i.e., an exclusive end index).
// The contract maintains the invariant that sequenceNumber <= endSequenceNumber.
// If sequenceNumber == endSequenceNumber, the provider must rotate their commitment to add additional random values.
uint64 endSequenceNumber;
// The sequence number that will be assigned to the next inbound user request.
uint64 sequenceNumber;
// The current commitment represents an index/value in the provider's hash chain.
// These values are used to verify requests for future sequence numbers. Note that
// currentCommitmentSequenceNumber < sequenceNumber.
//
// The currentCommitment advances forward through the provider's hash chain as values
// are revealed on-chain.
bytes32 currentCommitment;
uint64 currentCommitmentSequenceNumber;
}
struct Request {
// Storage slot 1 //
address provider;
uint64 sequenceNumber;
// The number of hashes required to verify the provider revelation.
uint32 numHashes;
// Storage slot 2 //
// The commitment is keccak256(userCommitment, providerCommitment). Storing the hash instead of both saves 20k gas by
// eliminating 1 store.
bytes32 commitment;
// Storage slot 3 //
// The number of the block where this request was created.
// Note that we're using a uint64 such that we have an additional space for an address and other fields in
// this storage slot. Although block.number returns a uint256, 64 bits should be plenty to index all of the
// blocks ever generated.
uint64 blockNumber;
// The address that requested this random number.
address requester;
// If true, incorporate the blockhash of blockNumber into the generated random value.
bool useBlockhash;
// If true, the requester will be called back with the generated random value.
bool isRequestWithCallback;
// There are 2 remaining bytes of free space in this slot.
}
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
import "./EntropyEvents.sol";
interface IEntropy is EntropyEvents {
// Register msg.sender as a randomness provider. The arguments are the provider's configuration parameters
// and initial commitment. Re-registering the same provider rotates the provider's commitment (and updates
// the feeInWei).
//
// chainLength is the number of values in the hash chain *including* the commitment, that is, chainLength >= 1.
function register(
uint128 feeInWei,
bytes32 commitment,
bytes calldata commitmentMetadata,
uint64 chainLength,
bytes calldata uri
) external;
// Withdraw a portion of the accumulated fees for the provider msg.sender.
// Calling this function will transfer `amount` wei to the caller (provided that they have accrued a sufficient
// balance of fees in the contract).
function withdraw(uint128 amount) external;
// As a user, request a random number from `provider`. Prior to calling this method, the user should
// generate a random number x and keep it secret. The user should then compute hash(x) and pass that
// as the userCommitment argument. (You may call the constructUserCommitment method to compute the hash.)
//
// This method returns a sequence number. The user should pass this sequence number to
// their chosen provider (the exact method for doing so will depend on the provider) to retrieve the provider's
// number. The user should then call fulfillRequest to construct the final random number.
//
// This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
// Note that excess value is *not* refunded to the caller.
function request(
address provider,
bytes32 userCommitment,
bool useBlockHash
) external payable returns (uint64 assignedSequenceNumber);
// Request a random number. The method expects the provider address and a secret random number
// in the arguments. It returns a sequence number.
//
// The address calling this function should be a contract that inherits from the IEntropyConsumer interface.
// The `entropyCallback` method on that interface will receive a callback with the generated random number.
//
// This method will revert unless the caller provides a sufficient fee (at least getFee(provider)) as msg.value.
// Note that excess value is *not* refunded to the caller.
function requestWithCallback(
address provider,
bytes32 userRandomNumber
) external payable returns (uint64 assignedSequenceNumber);
// Fulfill a request for a random number. This method validates the provided userRandomness and provider's proof
// against the corresponding commitments in the in-flight request. If both values are validated, this function returns
// the corresponding random number.
//
// Note that this function can only be called once per in-flight request. Calling this function deletes the stored
// request information (so that the contract doesn't use a linear amount of storage in the number of requests).
// If you need to use the returned random number more than once, you are responsible for storing it.
function reveal(
address provider,
uint64 sequenceNumber,
bytes32 userRevelation,
bytes32 providerRevelation
) external returns (bytes32 randomNumber);
// Fulfill a request for a random number. This method validates the provided userRandomness
// and provider's revelation against the corresponding commitment in the in-flight request. If both values are validated
// and the requestor address is a contract address, this function calls the requester's entropyCallback method with the
// sequence number, provider address and the random number as arguments. Else if the requestor is an EOA, it won't call it.
//
// Note that this function can only be called once per in-flight request. Calling this function deletes the stored
// request information (so that the contract doesn't use a linear amount of storage in the number of requests).
// If you need to use the returned random number more than once, you are responsible for storing it.
//
// Anyone can call this method to fulfill a request, but the callback will only be made to the original requester.
function revealWithCallback(
address provider,
uint64 sequenceNumber,
bytes32 userRandomNumber,
bytes32 providerRevelation
) external;
function getProviderInfo(
address provider
) external view returns (EntropyStructs.ProviderInfo memory info);
function getDefaultProvider() external view returns (address provider);
function getRequest(
address provider,
uint64 sequenceNumber
) external view returns (EntropyStructs.Request memory req);
function getFee(address provider) external view returns (uint128 feeAmount);
function getAccruedPythFees()
external
view
returns (uint128 accruedPythFeesInWei);
function setProviderFee(uint128 newFeeInWei) external;
function setProviderUri(bytes calldata newUri) external;
function constructUserCommitment(
bytes32 userRandomness
) external pure returns (bytes32 userCommitment);
function combineRandomValues(
bytes32 userRandomness,
bytes32 providerRandomness,
bytes32 blockHash
) external pure returns (bytes32 combinedRandomness);
}// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.0;
abstract contract IEntropyConsumer {
// This method is called by Entropy to provide the random number to the consumer.
// It asserts that the msg.sender is the Entropy contract. It is not meant to be
// override by the consumer.
function _entropyCallback(
uint64 sequence,
address provider,
bytes32 randomNumber
) external {
address entropy = getEntropy();
require(entropy != address(0), "Entropy address not set");
require(msg.sender == entropy, "Only Entropy can call this function");
entropyCallback(sequence, provider, randomNumber);
}
// getEntropy returns Entropy contract address. The method is being used to check that the
// callback is indeed from Entropy contract. The consumer is expected to implement this method.
// Entropy address can be found here - https://docs.pyth.network/entropy/contract-addresses
function getEntropy() internal view virtual returns (address);
// This method is expected to be implemented by the consumer to handle the random number.
// It will be called by _entropyCallback after _entropyCallback ensures that the call is
// indeed from Entropy contract.
function entropyCallback(
uint64 sequence,
address provider,
bytes32 randomNumber
) internal virtual;
}/// SPDX-License-Identifier: MIT
import "../interface/IBlast.sol";
abstract contract BaseBlast {
address public blastOperator;
address blast;
modifier onlyBlastOperator() {
require(
msg.sender == blastOperator,
"BaseBlast: caller is not the blast operator"
);
_;
}
constructor(address _blast) {
blast = _blast;
blastOperator = msg.sender;
IBlast(_blast).configureClaimableGas();
}
function claimGas(address recipient) external {
IBlast(blast).claimMaxGas(address(this), recipient);
}
function setBlastOperator(
address _blastOperator
) external onlyBlastOperator {
blastOperator = _blastOperator;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
enum YieldMode {
AUTOMATIC,
VOID,
CLAIMABLE
}
enum GasMode {
VOID,
CLAIMABLE
}
interface IBlast {
// configure
function configureContract(
address contractAddress,
YieldMode _yield,
GasMode gasMode,
address governor
) external;
function configure(
YieldMode _yield,
GasMode gasMode,
address governor
) external;
// base configuration options
function configureClaimableYield() external;
function configureClaimableYieldOnBehalf(address contractAddress) external;
function configureAutomaticYield() external;
function configureAutomaticYieldOnBehalf(address contractAddress) external;
function configureVoidYield() external;
function configureVoidYieldOnBehalf(address contractAddress) external;
function configureClaimableGas() external;
function configureClaimableGasOnBehalf(address contractAddress) external;
function configureVoidGas() external;
function configureVoidGasOnBehalf(address contractAddress) external;
function configureGovernor(address _governor) external;
function configureGovernorOnBehalf(
address _newGovernor,
address contractAddress
) external;
// claim yield
function claimYield(
address contractAddress,
address recipientOfYield,
uint256 amount
) external returns (uint256);
function claimAllYield(
address contractAddress,
address recipientOfYield
) external returns (uint256);
// claim gas
function claimAllGas(
address contractAddress,
address recipientOfGas
) external returns (uint256);
function claimGasAtMinClaimRate(
address contractAddress,
address recipientOfGas,
uint256 minClaimRateBips
) external returns (uint256);
function claimMaxGas(
address contractAddress,
address recipientOfGas
) external returns (uint256);
function claimGas(
address contractAddress,
address recipientOfGas,
uint256 gasToClaim,
uint256 gasSecondsToConsume
) external returns (uint256);
// read functions
function readClaimableYield(
address contractAddress
) external view returns (uint256);
function readYieldConfiguration(
address contractAddress
) external view returns (uint8);
function readGasParams(
address contractAddress
)
external
view
returns (
uint256 etherSeconds,
uint256 etherBalance,
uint256 lastUpdated,
GasMode
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IMonoPass is IERC721, IERC721Enumerable {
function safeMint(address to) external;
function burn(uint256 tokenId) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
interface IMonoSwapNFT is IERC1155 {
function mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) external;
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) external;
function mintBySystem(
address[] memory accounts,
uint256 id,
uint256[] memory amounts,
bytes memory data
) external;
function burn(address account, uint256 id, uint256 value) external;
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) external;
function hardCaps(uint256 id) external view returns (uint256);
function totalSupply(uint256 id) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IMUSD is IERC20 {
function getPrice() external view returns (uint256 price);
function deposit(uint256 amount) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IXMono is IERC20 {
function usageAllocations(
address userAddress,
address usageAddress
) external view returns (uint256 allocation);
function allocateFromUsage(address userAddress, uint256 amount) external;
function convertTo(uint256 amount, address to) external;
function deallocateFromUsage(address userAddress, uint256 amount) external;
function isTransferWhitelisted(
address account
) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
interface IMonoSwapPot {
/**
* @notice Buy tickets for the current pot
* @param _potId: potId
* @param _ticketNumbers: array of ticket numbers between 1,000,000 and 1,999,999
* @dev Callable by users
*/
function buyTickets(
uint256 _potId,
uint32[] calldata _ticketNumbers,
bool _useMonoSwapTicket
) external;
/**
* @notice Claim a set of winning tickets for a pot
* @param _potId: pot id
* @param _ticketIds: array of ticket ids
* @param _brackets: array of brackets for the ticket ids
* @dev Callable by users only, not contract!
*/
function claimTickets(
uint256 _potId,
uint256[] calldata _ticketIds,
uint32[] calldata _brackets
) external;
/**
* @notice Close pot
* @param _potId: pot id
* @dev Callable by operator
*/
function closePot(uint256 _potId) external payable;
/**
* @notice Draw the final number, calculate reward in Mono per group, and make pot claimable
* @param _potId: pot id
* @param _autoInjection: reinjects funds into next pot (vs. withdrawing all)
* @dev Callable by operator
*/
function drawFinalNumberAndMakePotClaimable(
uint256 _potId,
bool _autoInjection
) external;
/**
* @notice Inject funds
* @param _potId: pot id
* @param _amount: amount to inject in Mono token
* @dev Callable by operator
*/
function injectFunds(uint256 _potId, uint256 _amount) external;
/**
* @notice Start the pot
* @dev Callable by operator
* @param _endTime: endTime of the pot
* @param _priceTicketInMono: price of a ticket in Mono
* @param _discountDivisor: the divisor to calculate the discount magnitude for bulks
* @param _rewardsBreakdown: breakdown of rewards per bracket (must sum to 10,000)
* @param _treasuryFee: treasury fee (10,000 = 100%, 100 = 1%)
*/
function startPot(
uint256 _endTime,
uint256 _priceTicketInMono,
uint256 _discountDivisor,
uint256[6] calldata _rewardsBreakdown,
uint256 _treasuryFee
) external;
/**
* @notice View current pot id
*/
function viewCurrentPotId() external returns (uint256);
/**
* @notice View user ticket ids, numbers, and statuses of user for a given pot
* @param _user: user address
* @param _potId: pot id
* @param _cursor: cursor to start where to retrieve the tickets
* @param _size: the number of tickets to retrieve
*/
function viewUserInfoForPotId(
address _user,
uint256 _potId,
uint256 _cursor,
uint256 _size
)
external
view
returns (uint256[] memory, uint32[] memory, bool[] memory, uint256);
}{
"optimizer": {
"enabled": true,
"runs": 1
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_blast","type":"address"},{"internalType":"contract IMonoSwapNFT","name":"_monoNFT","type":"address"},{"internalType":"contract IMonoPass","name":"_monoPass","type":"address"},{"internalType":"contract IMUSD","name":"_musd","type":"address"},{"internalType":"contract IXMono","name":"_xMono","type":"address"},{"internalType":"contract IERC20Metadata","name":"_usdb","type":"address"},{"internalType":"address","name":"_entropy","type":"address"},{"internalType":"address","name":"_entropyProvider","type":"address"},{"internalType":"address","name":"_devWallet","type":"address"},{"internalType":"contract IMonoSwapPot","name":"_pot","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountXMono","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountUsd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountTicket","type":"uint256"},{"indexed":false,"internalType":"bool","name":"availableMonoPass","type":"bool"}],"name":"ChestOpened","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":"uint64","name":"sequenceNumber","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RandomChest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"name":"RandomNumberRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountTicket","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountXMono","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountUsd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountMonoPass","type":"uint256"}],"name":"TransferReward","type":"event"},{"inputs":[],"name":"MONO_COMMON_KEY_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONO_EPIC_KEY_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONO_MYTHICAL_KEY_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONO_RARE_KEY_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONO_TICKET_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MONO_UNCOMMON_KEY_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"sequence","type":"uint64"},{"internalType":"address","name":"provider","type":"address"},{"internalType":"bytes32","name":"randomNumber","type":"bytes32"}],"name":"_entropyCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blastOperator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"chestKey","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"chestPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chestRefillPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"chestRewards","outputs":[{"internalType":"uint256","name":"xMonoAmount","type":"uint256"},{"internalType":"uint256","name":"usdAmount","type":"uint256"},{"internalType":"bool","name":"availableMonoPass","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"chestRewardsThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"claimGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"random","type":"uint256"}],"name":"getRewardByRandomNumber","outputs":[{"components":[{"internalType":"uint256","name":"xMonoAmount","type":"uint256"},{"internalType":"uint256","name":"usdAmount","type":"uint256"},{"internalType":"bool","name":"availableMonoPass","type":"bool"}],"internalType":"struct MonoChest.ChestReward","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isParticipant","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"monoNFT","outputs":[{"internalType":"contract IMonoSwapNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"monoPass","outputs":[{"internalType":"contract IMonoPass","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"musd","outputs":[{"internalType":"contract IMUSD","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"internalType":"enum MonoChest.PaymentToken","name":"paymentToken","type":"uint8"},{"internalType":"bool","name":"pythFlag","type":"bool"}],"name":"openChest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pot","outputs":[{"internalType":"contract IMonoSwapPot","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"potInjectPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"requestRandoms","outputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint64","name":"sequenceNumber","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_blastOperator","type":"address"}],"name":"setBlastOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devWallet","type":"address"}],"name":"setDevWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_entropy","type":"address"},{"internalType":"address","name":"_entropyProvider","type":"address"}],"name":"setEntropy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMonoSwapNFT","name":"_monoNFT","type":"address"}],"name":"setMonoNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMonoPass","name":"_monoPass","type":"address"}],"name":"setMonoPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMUSD","name":"_musd","type":"address"},{"internalType":"contract IXMono","name":"_xMono","type":"address"},{"internalType":"contract IERC20Metadata","name":"_usdb","type":"address"}],"name":"setPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMonoSwapPot","name":"_pot","type":"address"}],"name":"setPot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_potInjectPercent","type":"uint256"},{"internalType":"uint256","name":"_refillPercent","type":"uint256"}],"name":"setPotInjectAndRefillPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"chestType","type":"uint8"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setTxFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"ticketRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"totalChestOpened","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"totalChestOpenedByUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalParticipant","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardEarned","outputs":[{"internalType":"uint256","name":"totalXMono","type":"uint256"},{"internalType":"uint256","name":"totalUSD","type":"uint256"},{"internalType":"uint256","name":"totalMonoPass","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum MonoChest.ChestType","name":"","type":"uint8"}],"name":"txFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdb","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xMono","outputs":[{"internalType":"contract IXMono","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6080604052600a60045560286005553480156200001b57600080fd5b5060405162006bf138038062006bf18339810160408190526200003e9162003a32565b8933806200006657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200007181620039b7565b5060018055600380546001600160a01b0383166001600160a01b03199182168117909255600280549091163317905560408051634e606c4760e01b81529051634e606c479160048082019260009290919082900301818387803b158015620000d857600080fd5b505af1158015620000ed573d6000803e3d6000fd5b5050600680546001600160a01b03199081166001600160a01b038f8116919091179092556007805482168e8416179055600a805482168d8416908117909155600b805483168d85161790556008805483168c851617905560098054909216928716929092179055601c6020526516bcc41e90007fb9c6de81004e18dedadca3e5eabaab449ca91dff6f58efc9461da635fe77f84955652d79883d20007f6de76108811faf2f94afbe5ac6c98e8393206cd093932de1fbfd61bbeec43a02556544364c5bb0007ff5b6e61a0c14f171ef1c86f003900ef0305e4159fff3317e4fb7c351f2050c8755655af3107a40007fb0deb225ecd3a242ef7d55f0f81ae3b924e0b6f9da8bc33b306fb32ca5f287f75560046000819052656d23ad5f80007fadacb2ae086d090ae1cbb87d66774fa6d708dd14d5bdc5b6c1e455aa2020dfb75560405163095ea7b360e01b815291945063095ea7b393506200025792508591600019910162003b1b565b6020604051808303816000875af115801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d919062003b34565b5060085460405163095ea7b360e01b81526001600160a01b039091169063095ea7b390620002d4908a906000199060040162003b1b565b6020604051808303816000875af1158015620002f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200031a919062003b34565b50600c80546001600160a01b038681166001600160a01b031992831617909255600d8054868416908316179055600e80549285169290911691909117905560017f7e7fa33969761a458e04f477e039a608702b4f924981d6653935a8319a08ad7b5560027f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a381905560037f8e1fee8c88a9e04123b21e90cae2727a7715bf522a1e46eb5934ccd05203a6b281905560047f0f36ad39aee03e7108cc48f54934702a5f0d4066f10344cebf8198978d86976a81905560057fb4fcd034df3d20faa1c133b66d862ce92732727d40916b48ffb4020cb00fe053819055670de0b6b3a76400007ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37555671bc16d674ec800007f169f97de0d9a84d840042b17d3c6b9638b3d6fd9024c9eb0c7a306a17b49f88f556729a2241af62c00007fa74ba3945261e09fde15ba3db55005b205e61eeb4ad811ac0faa2b315bffeead55673782dace9d9000007f45f76dafbbad695564362934e24d72eedc57f9fc1a65f39bca62176cc829682855674563918244f400007f367ccd2d0ac16bf7110a5dffe0801fdc9452a95a1adb7e1a12fe97dd3e9a4edd5560106020527f6e0956cda88cad152e89927e53611735b61a5c762d1428573c6931b0a5efcb01939093557f8c6065603763fec3f5742441d3833f3f43b982453612d76adb39a885e3006b5f919091557f853b2fefe141400fef543280f93d98bd49996069f632d0d20236afeeed8e46a28190557fb3edd0d534d647cffdae9f1294f11ad21f3fcf2814bea44c92bbb8d384a57d9e91909155600090815260067f1588ac671d87f82adc0e6ae8ab009c0de98f92a20243897597e566bc59b9c12655601390808152602080820192909252604001600090812080546001810182559082529181206102ee920191909155601390808152602080820192909252604001600090812080546001810182559082529181206131ce92019190915560139080815260208082019290925260400160009081208054600181018255908252918120617fee920191909155601390808152602080820192909252604001600090812080546001810182559082529181206185ca92019190915560139080815260208082019290925260400160009081208054600181018255908252918120618f8e9201919091556013908081526020808201929092526040016000908120805460018101825590825291812061be6e9201919091556013908081526020808201929092526040016000908120805460018101825590825291812062019546920191909155601390808152602080820192909252604001600090812080546001810182559082529181206202cdc692019190915560139080815260208082019290925260400160009081208054600181018255908252918120620454669201919091556013908081526020808201929092526040016000908120805460018101825590825291812062062926920191909155601390808152602080820192909252604001600090812080546001810182559082529181206207afc6920191909155601390808152602080820192909252604001600090812080546001810182559082529181206208d4be92019190915560149080815260208082019290925260409081016000908120825160608101845282815280850183815260019482018581528354808701855593855295842091516003909302909101918255519281019290925591516002909101805460ff19169115159190911790556014908081526020808201929092526040908101600090812082516060810184526702c68af0bb14000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19169215159290921790915560149080815260208082019290925260409081016000908120825160608101845267016345785d8a000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490808152602080820192909252604090810160009081208251606081018452828152678ac7230489e800008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490808152602080820192909252604090810160009081208251606081018452828152676124fee993bc00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490808152602080820192909252604090810160009081208251606081018452828152674563918244f400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff1916921515929092179091556014908081526020808201929092526040908101600090812082516060810184528281526729a2241af62c00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490808152602080820192909252604090810160009081208251606081018452828152670de0b6b3a76400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490808152602080820192909252604090810160009081208251606081018452828152670b1a2bc2ec5000008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19169215159290921790915560149080815260208082019290925260409081016000908120825160608101845282815267058d15e1762800008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff1916921515929092179091556014908081526020808201929092526040908101600090812082516060810184528281526702c68af0bb1400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19169215159290921790915560149080815260208082019290925260409081016000908120825160608101845282815267016345785d8a00008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff19169315159390931790925560139190815260208082019290925260400160009081208054600180820183559183529282206102ee93019290925560139181526020808201929092526040016000908120805460018082018355918352928220611a5e9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061493e9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061975e9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061995293019290925560139181526020808201929092526040016000908120805460018082018355918352928220619d3a9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061a50a9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061acda9301929092556013918152602080820192909252604001600090812080546001808201835591835292822061d3ea930192909255601391815260208082019290925260400160009081208054600180820183559183529282206201973a9301929092556013918152602080820192909252604001600090812080546001808201835591835292822062031dda930192909255601391815260208082019290925260400160009081208054600180820183559183529282206203e12a93019290925560139181526020808201929092526040016000908120805460018082018355918352928220620567ca930192909255601391815260208082019290925260400160009081208054600180820183559183529282206206ee6a930192909255601391815260208082019290925260400160009081208054600180820183559183529282206207b1ba930192909255601391815260208082019290925260400160009081208054600180820183559183529282206207d8ca930192909255601491815260208082019290925260409081016000908120825160608101845282815280850183815260019482018581528354808701855593855295842091516003909302909101918255518184015592516002909301805460ff1916931515939093179092556014919081526020808201929092526040908101600090812082516060810184526706f05b59d3b2000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452670429d069189e000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff19169315159390931790925560149190815260208082019290925260409081016000908120825160608101845267016345785d8a000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff19169315159390931790925560149190815260208082019290925260409081016000908120825160608101845282815268056bc75e2d631000008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff1916931515939093179092556014919081526020808201929092526040908101600090812082516060810184528281526802b5e3af16b18800008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff1916931515939093179092556014919081526020808201929092526040908101600090812082516060810184528281526801158e460913d000008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152678ac7230489e800008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152676f05b59d3b2000008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152673782dace9d9000008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152671bc16d674ec800008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152670de0b6b3a76400008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff191693151593909317909255601491908152602080820192909252604090810160009081208251606081018452828152670b1a2bc2ec5000008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff19169315159390931790925560149190815260208082019290925260409081016000908120825160608101845282815267058d15e1762800008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff1916931515939093179092556014919081526020808201929092526040908101600090812082516060810184528281526702c68af0bb1400008186019081529381018381528254600180820185559385529584209151600390960290910194855592518482015591516002909301805460ff19169315159390931790925560149190815260208082019290925260409081016000908120825160608101845282815267016345785d8a00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556013918152602080820192909252604001600090812080546001810182559082529181206102ee9201919091556013906002815260208082019290925260400160009081208054600181018255908252918120610ea6920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061261692019190915560139060028152602080820192909252604001600090812080546001810182559082529181206154f6920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061a316920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061a393920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061a48d920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061a681920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061aa69920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061bdf1920191909155601390600281526020808201929092526040016000908120805460018101825590825291812061e501920191909155601390600281526020808201929092526040016000908120805460018101825590825291812062015a31920191909155601390600281526020808201929092526040016000908120805460018101825590825291812062027f2992019190915560139060028152602080820192909252604001600090812080546001810182559082529181206203a42192019190915560139060028152602080820192909252604001600090812080546001810182559082529181206204677192019190915560139060028152602080820192909252604001600090812080546001810182559082529181206204c91992019190915560139060028152602080820192909252604001600090812080546001810182559082529181206204f0299201919091556013906002815260208082019290925260400160009081208054600181018255908252918120620503b19201919091556014906002815260208082019290925260409081016000908120825160608101845282815280850183815260019482018581528354808701855593855295842091516003909302909101918255519281019290925591516002918201805460ff1916911515919091179055601491908152602080820192909252604090810160009081208251606081018452670de0b6b3a764000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff191691151591909117905560149181526020808201929092526040908101600090812082516060810184526706f05b59d3b2000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452670429d069189e000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff1916911515919091179055601491815260208082019290925260409081016000908120825160608101845267016345785d8a000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152680ad78ebc5ac62000008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff1916911515919091179055601491815260208082019290925260409081016000908120825160608101845282815268056bc75e2d631000008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff191691151591909117905560149181526020808201929092526040908101600090812082516060810184528281526802b5e3af16b18800008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff191691151591909117905560149181526020808201929092526040908101600090812082516060810184528281526801158e460913d000008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152678ac7230489e800008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152676124fee993bc00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152674563918244f400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff191691151591909117905560149181526020808201929092526040908101600090812082516060810184528281526729a2241af62c00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152670de0b6b3a76400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152670b1a2bc2ec5000008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff19169115159190911790556014918152602080820192909252604090810160009081208251606081018452828152670853a0d2313c00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff191691151591909117905560149181526020808201929092526040908101600090812082516060810184528281526702c68af0bb1400008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002928301805460ff1916911515919091179055601491815260208082019290925260409081016000908120825160608101845282815267016345785d8a00008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556013918152602080820192909252604001600090812080546001810182559082529181206105dc9201919091556013906003815260208082019290925260400160009081208054600181018255908252918120611194920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061290492019190915560139060038152602080820192909252604001600090812080546001810182559082529181206157e4920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061a604920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061a668920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061a762920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061a956920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061ad3e920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061b702920191909155601390600381526020808201929092526040016000908120805460018101825590825291812061f19a920191909155601390600381526020808201929092526040016000908120805460018101825590825291812062018dda92019190915560139060038152602080820192909252604001600090812080546001810182559082529181206202783a92019190915560139060038152602080820192909252604001600090812080546001810182559082529181206203feda92019190915560139060038152602080820192909252604001600090812080546001810182559082529181206205375a9201919091556013906003815260208082019290925260400160009081208054600181018255908252918120620621ba92019190915560139060038152602080820192909252604001600090812080546001810182559082529181206206bdfa920191909155601390600381526020808201929092526040016000908120805460018101825590825291812062070c1a92019190915560139060038152602080820192909252604001600090812080546001810182559082529181206207332a9201919091556014906003815260208082019290925260409081016000908120825160608101845282815280850183815260019482018581528354808701855593855295842091516003938402909201918255519381019390935592516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452670de0b6b3a764000081528085018381529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184526706f05b59d3b2000081528085018381529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452670429d069189e000081528085018381529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff191692151592909217909155601491815260208082019290925260409081016000908120825160608101845267016345785d8a000081528085018381529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184528281526815af1d78b58c4000008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152680ad78ebc5ac62000008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff191692151592909217909155601491815260208082019290925260409081016000908120825160608101845282815268056bc75e2d631000008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184528281526802b5e3af16b18800008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184528281526801158e460913d000008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152678ac7230489e800008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152676124fee993bc00008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152674563918244f400008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184528281526729a2241af62c00008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152670de0b6b3a76400008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff1916921515929092179091556014918152602080820192909252604090810160009081208251606081018452828152670b1a2bc2ec5000008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff191692151592909217909155601491815260208082019290925260409081016000908120825160608101845282815267058d15e1762800008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff19169215159290921790915560149181526020808201929092526040908101600090812082516060810184528281526702c68af0bb1400008186019081529381018381528254600180820185559385529584209151600396870290920191825593519181019190915591516002909201805460ff191692151592909217909155601491815260208082019290925260409081016000908120825160608101845282815267016345785d8a00008186019081529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19169215159290921790915560139060048152602080820192909252604001600090812080546001810182559082529181206105dc9201919091556013906004815260208082019290925260400160009081208054600181018255908252918120611194920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061290492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206157e4920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061a604920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061a636920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061a69a920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061a794920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061a988920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061ad70920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061b734920191909155601390600481526020808201929092526040016000908120805460018101825590825291812061de44920191909155601390600481526020808201929092526040016000908120805460018101825590825291812062017a8492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206202b30492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206203c474920191909155601390600481526020808201929092526040016000908120805460018101825590825291812062049b4c92019190915560139060048152602080820192909252604001600090812080546001810182559082529181206205240492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206205722492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206205993492019190915560139060048152602080820192909252604001600090812080546001810182559082529181206205acbc9201919091556014906004815260208082019290925260409081016000908120825160608101845282815280850183815260019482018581528354808701855593855295842091516003909302909101918255519281019290925591516002909101805460ff191691151591909117905560149060048152602080820192909252604090810160009081208251606081018452670de0b6b3a764000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff191692151592909217909155601490600481526020808201929092526040908101600090812082516060810184526706f05b59d3b2000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19169215159290921790915560149060048152602080820192909252604090810160009081208251606081018452670429d069189e000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff1916921515929092179091556014906004815260208082019290925260409081016000908120825160608101845267016345785d8a000081528085018381529381018381528254600180820185559385529584209151600390960290910194855592519084015590516002909201805460ff19908116931515939093179055600481526014602080830182905260409283016000908120845160608082018752838252682086ac3510526000008286019081528288018581528454600181810187559587528787209451600391820290950194855591518486015551600290930180548a1693151593909317909255858552865180820188528481526815af1d78b58c4000008187019081528189018681527f52102136546d97ed3f65ec1070a32935d3048ea12f310d29c378dc9d6555c0d68054808801825581895293517fe69c065733bae23e42175e210b7b7f23cb75e95bfec39f250c04369ee66372e79487028581019190915592517fe69c065733bae23e42175e210b7b7f23cb75e95bfec39f250c04369ee66372e88085019190915591517fe69c065733bae23e42175e210b7b7f23cb75e95bfec39f250c04369ee66372e993840180548e169115159190911790558989528a518086018c52888152680ad78ebc5ac6200000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c5288815268056bc75e2d63100000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c528881526802b5e3af16b1880000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c528881526801158e460913d00000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c52888152678ac7230489e80000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c52888152676124fee993bc0000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c52888152674563918244f40000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c528881526729a2241af62c0000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c52888152670de0b6b3a7640000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c52888152670b1a2bc2ec500000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c5288815267058d15e176280000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e169115159190911790558989528a518086018c528881526702c68af0bb140000818b01908152818d018a81528354808b018555848c529251928902808801939093559051828501555190840180548e1691151591909117905598885289519384018a5286845267016345785d8a00009784019788529883018681528854958601895597909552905192909102908101919091559151938201939093559051910180549092169015151790555062003b5f98505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811462003a1d57600080fd5b50565b805162003a2d8162003a07565b919050565b6000806000806000806000806000806101408b8d03121562003a5357600080fd5b8a5162003a608162003a07565b60208c0151909a5062003a738162003a07565b60408c015190995062003a868162003a07565b60608c015190985062003a998162003a07565b60808c015190975062003aac8162003a07565b60a08c015190965062003abf8162003a07565b60c08c015190955062003ad28162003a07565b60e08c015190945062003ae58162003a07565b6101008c015190935062003af98162003a07565b915062003b0a6101208c0162003a20565b90509295989b9194979a5092959850565b6001600160a01b03929092168252602082015260400190565b60006020828403121562003b4757600080fd5b8151801515811462003b5857600080fd5b9392505050565b6130828062003b6f6000396000f3fe6080604052600436106102435760003560e01c80626f7d0014610248578063016948cb1461027e57806301ffc9a7146102a157806306df13ed146102d15780630b0454c8146102e657806310b84525146102fc57806314ab6e4b1461031e578063150b7a021461033e5780631f53ac02146103835780631f86a3d6146103a35780632626bc47146103d057806337dee2d31461041457806340ef7267146104415780634ba2363a146104615780634d221ff91461048157806352445dc2146104a157806352a07ce4146104c157806352a5f1f8146104ee5780635d4014601461050e5780636088e93a1461052e578063670b48401461054e5780636a00670b146105645780636ba0a072146105845780637041fb6e146105a4578063715018a6146105b95780637659c5db146105ce57806380189f7d146105ee57806385aee18f146106045780638da5cb5b146106315780638ea5220f14610646578063929066f5146106665780639732463d146106965780639e281a98146106b6578063a7e00f93146106d6578063a91b7a9f1461070e578063b633fcba14610723578063c0ee544714610743578063cab666d014610780578063ced72f87146107a0578063cef03698146107b5578063d1226809146107d5578063d5859249146107f5578063db79e06f1461085f578063e658ac451461088c578063eb1dc4bd146108a1578063ed348895146108c1578063f0ace608146108e1578063f0e03e54146108f6578063f2fde38b14610916578063f926691914610936578063fa0d40d814610970575b600080fd5b34801561025457600080fd5b50600854610268906001600160a01b031681565b6040516102759190612a78565b60405180910390f35b34801561028a57600080fd5b50610293600681565b604051908152602001610275565b3480156102ad57600080fd5b506102c16102bc366004612a8c565b610983565b6040519015158152602001610275565b3480156102dd57600080fd5b50610293600581565b3480156102f257600080fd5b5061029360045481565b34801561030857600080fd5b5061031c610317366004612ad2565b6109ba565b005b34801561032a57600080fd5b5061031c610339366004612b1d565b610a01565b34801561034a57600080fd5b5061036a610359366004612b36565b630a85bd0160e11b95945050505050565b6040516001600160e01b03199091168152602001610275565b34801561038f57600080fd5b5061031c61039e366004612bd4565b610bb3565b3480156103af57600080fd5b506102936103be366004612c05565b60126020526000908152604090205481565b3480156103dc57600080fd5b506103f06103eb366004612c20565b610bdd565b60408051825181526020808401519082015291810151151590820152606001610275565b34801561042057600080fd5b5061029361042f366004612c05565b601c6020526000908152604090205481565b34801561044d57600080fd5b5061031c61045c366004612c4a565b610d2d565b34801561046d57600080fd5b50600954610268906001600160a01b031681565b34801561048d57600080fd5b5061031c61049c366004612bd4565b610d63565b3480156104ad57600080fd5b5061031c6104bc366004612bd4565b610d8d565b3480156104cd57600080fd5b506102936104dc366004612c05565b60156020526000908152604090205481565b3480156104fa57600080fd5b5061031c610509366004612c98565b610db7565b34801561051a57600080fd5b50600254610268906001600160a01b031681565b34801561053a57600080fd5b5061031c610549366004612cd9565b610e92565b34801561055a57600080fd5b5061029360165481565b34801561057057600080fd5b5061031c61057f366004612c20565b610f00565b34801561059057600080fd5b5061031c61059f366004612c20565b610f45565b3480156105b057600080fd5b50610293600181565b3480156105c557600080fd5b5061031c610f64565b3480156105da57600080fd5b5061031c6105e9366004612cf7565b610f78565b3480156105fa57600080fd5b5061029360055481565b34801561061057600080fd5b5061029361061f366004612c05565b60106020526000908152604090205481565b34801561063d57600080fd5b50610268610fd6565b34801561065257600080fd5b50600e54610268906001600160a01b031681565b34801561067257600080fd5b506102c1610681366004612bd4565b60176020526000908152604090205460ff1681565b3480156106a257600080fd5b506102936106b1366004612c20565b610fe5565b3480156106c257600080fd5b5061031c6106d1366004612cd9565b611016565b3480156106e257600080fd5b506102936106f1366004612d19565b601860209081526000928352604080842090915290825290205481565b34801561071a57600080fd5b50610293600381565b34801561072f57600080fd5b5061031c61073e366004612bd4565b6110cf565b34801561074f57600080fd5b5061076361075e366004612c20565b611145565b604080519384526020840192909252151590820152606001610275565b34801561078c57600080fd5b50600a54610268906001600160a01b031681565b3480156107ac57600080fd5b5061029361118a565b3480156107c157600080fd5b50600654610268906001600160a01b031681565b3480156107e157600080fd5b50600754610268906001600160a01b031681565b34801561080157600080fd5b5061084f610810366004612d4e565b6011602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b90920460ff1691906001600160401b031684565b6040516102759493929190612da3565b34801561086b57600080fd5b5061029361087a366004612c05565b600f6020526000908152604090205481565b34801561089857600080fd5b50610293600481565b3480156108ad57600080fd5b5061031c6108bc366004612bd4565b611211565b3480156108cd57600080fd5b5061031c6108dc366004612bd4565b6112a1565b3480156108ed57600080fd5b50610293600281565b34801561090257600080fd5b50600b54610268906001600160a01b031681565b34801561092257600080fd5b5061031c610931366004612bd4565b611304565b34801561094257600080fd5b50601954601a54601b5461095592919083565b60408051938452602084019290925290820152606001610275565b61031c61097e366004612dee565b611342565b60006001600160e01b031982166301ffc9a760e01b14806109b457506001600160e01b03198216630a85bd0160e11b145b92915050565b6109c261183b565b600a80546001600160a01b039485166001600160a01b031991821617909155600b80549385169382169390931790925560088054919093169116179055565b610a0961183b565b6007546040516370a0823160e01b815282916001600160a01b0316906370a0823190610a39903090600401612a78565b602060405180830381865afa158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190612e43565b1015610ac15760405162461bcd60e51b8152602060048201526011602482015270496e73756666696369656e74207061737360781b60448201526064015b60405180910390fd5b60005b81811015610baf57600754604051632f745c5960e01b81526001600160a01b039091169063b88d4fde90309033908490632f745c5990610b0b908590600090600401612e5c565b602060405180830381865afa158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c9190612e43565b6040518463ffffffff1660e01b8152600401610b6a93929190612e75565b600060405180830381600087803b158015610b8457600080fd5b505af1158015610b98573d6000803e3d6000fd5b505050508080610ba790612ebe565b915050610ac4565b5050565b610bbb61183b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610be5612a55565b610bed612a55565b60005b60136000866004811115610c0657610c06612d6b565b6004811115610c1757610c17612d6b565b8152602081019190915260400160002054811015610d255760136000866004811115610c4557610c45612d6b565b6004811115610c5657610c56612d6b565b81526020019081526020016000208181548110610c7557610c75612ed7565b9060005260206000200154841015610d135760146000866004811115610c9d57610c9d612d6b565b6004811115610cae57610cae612d6b565b81526020019081526020016000208181548110610ccd57610ccd612ed7565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015460ff161515918101919091529150610d25565b80610d1d81612ebe565b915050610bf0565b509392505050565b610d3561183b565b600c80546001600160a01b039384166001600160a01b031991821617909155600d8054929093169116179055565b610d6b61183b565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b610d9561183b565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dcb600c546001600160a01b031690565b90506001600160a01b038116610e1d5760405162461bcd60e51b8152602060048201526017602482015276115b9d1c9bdc1e481859191c995cdcc81b9bdd081cd95d604a1b6044820152606401610ab8565b336001600160a01b03821614610e815760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b6064820152608401610ab8565b610e8c84848461186d565b50505050565b610e9a61183b565b6040516323b872dd60e01b81526001600160a01b038316906323b872dd90610eca90309033908690600401612eed565b600060405180830381600087803b158015610ee457600080fd5b505af1158015610ef8573d6000803e3d6000fd5b505050505050565b610f0861183b565b80600f6000846004811115610f1f57610f1f612d6b565b6004811115610f3057610f30612d6b565b81526020810191909152604001600020555050565b610f4d61183b565b80601c6000846004811115610f1f57610f1f612d6b565b610f6c61183b565b610f766000611b69565b565b610f8061183b565b6064610f8c8284612f11565b10610fcb5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b6044820152606401610ab8565b600491909155600555565b6000546001600160a01b031690565b6013602052816000526040600020818154811061100157600080fd5b90600052602060002001600091509150505481565b61101e61183b565b6001600160a01b03821661105e57604051339082156108fc029083906000818181858888f19350505050158015611059573d6000803e3d6000fd5b505050565b60405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb9061108c9033908590600401612e5c565b6020604051808303816000875af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110599190612f24565b60035460405163662aa11d60e01b81523060048201526001600160a01b0383811660248301529091169063662aa11d906044016020604051808303816000875af1158015611121573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610baf9190612e43565b6014602052816000526040600020818154811061116157600080fd5b600091825260209091206003909102018054600182015460029092015490935090915060ff1683565b600c54600d54604051631711922960e31b81526000926001600160a01b039081169263b88c9148926111c29290911690600401612a78565b602060405180830381865afa1580156111df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112039190612f41565b6001600160801b0316905090565b6002546001600160a01b0316331461127f5760405162461bcd60e51b815260206004820152602b60248201527f42617365426c6173743a2063616c6c6572206973206e6f742074686520626c6160448201526a39ba1037b832b930ba37b960a91b6064820152608401610ab8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6112a961183b565b600980546001600160a01b0319166001600160a01b03831690811790915560408051632163c42160e11b815290516342c788429160048082019260209290919082900301816000875af1158015611121573d6000803e3d6000fd5b61130c61183b565b6001600160a01b038116611336576000604051631e4fbdf760e01b8152600401610ab89190612a78565b61133f81611b69565b50565b601c600084600481111561135857611358612d6b565b600481111561136957611369612d6b565b81526020019081526020016000205461138061118a565b61138a9190612f11565b3410156113cc5760405162461bcd60e51b815260206004820152601060248201526f496e73756666696369656e742066656560801b6044820152606401610ab8565b600e546001600160a01b03166108fc601c60008660048111156113f1576113f1612d6b565b600481111561140257611402612d6b565b8152602001908152602001600020549081150290604051600060405180830381858888f1935050505015801561143c573d6000803e3d6000fd5b50333b63ffffffff16156114895760405162461bcd60e51b815260206004820152601460248201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b6044820152606401610ab8565b600084116114d95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610ab8565b3360009081526017602052604090205460ff1661152657336000908152601760205260408120805460ff191660019081179091556016805491929091611520908490612f11565b90915550505b611531848484611bb9565b600c546000906001600160a01b03166319cb825f61154d61118a565b600d546040516001600160e01b031960e085901b168152611588916001600160a01b03169068135bdb9bd0da195cdd60ba1b90600401612e5c565b60206040518083038185885af11580156115a6573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115cb9190612f6a565b90506040518060800160405280336001600160a01b031681526020018560048111156115f9576115f9612d6b565b815260208082018890526001600160401b038416604092830181905260009081526011825291909120825181546001600160a01b039091166001600160a01b031982168117835592840151919283916001600160a81b03191617600160a01b83600481111561166a5761166a612d6b565b021790555060408201516001820155606090910151600290910180546001600160401b0319166001600160401b0390921691909117905584601560008660048111156116b8576116b8612d6b565b60048111156116c9576116c9612d6b565b815260200190815260200160002060008282546116e69190612f11565b9091555050336000908152601860205260408120869186600481111561170e5761170e612d6b565b600481111561171f5761171f612d6b565b8152602001908152602001600020600082825461173c9190612f11565b90915550506040516001600160401b0382169033907fbeeb78f6d3a68cd348586167a542623b027b326020292242ee83092dffcf59a8906117809088908a90612f87565b60405180910390a38161183457600c54600d54604051631e985e0760e11b81526001600160a01b0391821660048201526001600160401b038416602482015268135bdb9bd0da195cdd60ba1b60448201527a26b7b737a1b432b9ba283937bb34b232b92932bb32b630ba34b7b760291b6064820152911690633d30bc0e90608401600060405180830381600087803b15801561181b57600080fd5b505af115801561182f573d6000803e3d6000fd5b505050505b5050505050565b33611844610fd6565b6001600160a01b031614610f76573360405163118cdaa760e01b8152600401610ab89190612a78565b611875612465565b6001600160401b038316600090815260116020526040902080546001600160a01b03166118b45760405162461bcd60e51b8152600401610ab890612fa2565b60028101546001600160401b038581169116146118e35760405162461bcd60e51b8152600401610ab890612fa2565b60008080805b84600101548110156119be576007546040516370a0823160e01b81526000918291829161197d918a918c9188916001600160a01b0316906370a0823190611934903090600401612a78565b602060405180830381865afa158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190612e43565b89101561248f565b9194509250905061198e8388612f11565b965061199a8287612f11565b95506119a68186612f11565b945050505080806119b690612ebe565b9150506118e9565b5083546119d6906001600160a01b0316848484612783565b60065484546001600160a01b039182169163731133e99190811690600190601290600090600160a01b900460ff166004811115611a1557611a15612d6b565b6004811115611a2657611a26612d6b565b8152602001908152602001600020548860010154611a449190612fe4565b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152608060648201526000608482015260a401600060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b505085546001600160a01b03811692507f5cd16ad47114de3783edb5a51a8ba1f8ce78c0fc3c3f4088f39af2257db074219150601290600090600160a01b900460ff166004811115611b0857611b08612d6b565b6004811115611b1957611b19612d6b565b8152602001908152602001600020548660010154611b379190612fe4565b604080519182526020820187905281018590526060810184905260800160405180910390a25050505061105960018055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816002811115611bcd57611bcd612d6b565b0361206c5760006064600454600f6000866004811115611bef57611bef612d6b565b6004811115611c0057611c00612d6b565b81526020019081526020016000205486611c1a9190612fe4565b611c249190612fe4565b611c2e9190613011565b905060006064600554600f6000876004811115611c4d57611c4d612d6b565b6004811115611c5e57611c5e612d6b565b81526020019081526020016000205487611c789190612fe4565b611c829190612fe4565b611c8c9190613011565b600854600e549192506001600160a01b03908116916323b872dd913391168486600f60008b6004811115611cc257611cc2612d6b565b6004811115611cd357611cd3612d6b565b8152602001908152602001600020548b611ced9190612fe4565b611cf79190613025565b611d019190613025565b6040518463ffffffff1660e01b8152600401611d1f93929190612eed565b6020604051808303816000875af1158015611d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d629190612f24565b506008546001600160a01b03166323b872dd3330611d808587612f11565b6040518463ffffffff1660e01b8152600401611d9e93929190612eed565b6020604051808303816000875af1158015611dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de19190612f24565b50600a5460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611e73903090600401612a78565b602060405180830381865afa158015611e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb49190612e43565b600a5460405163b6b55f2560e01b8152600481018690529192506001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611f46903090600401612a78565b602060405180830381865afa158015611f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f879190612e43565b60095460408051632163c42160e11b815290519293506001600160a01b039091169163471aeab49183916342c788429160048082019260209290919082900301816000875af1158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190612e43565b61200c8585613025565b6040516001600160e01b031960e085901b168152600481019290925260248201526044015b600060405180830381600087803b15801561204b57600080fd5b505af115801561205f573d6000803e3d6000fd5b5050505050505050505050565b600181600281111561208057612080612d6b565b0361235757600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca9160048083019260209291908290030181865afa1580156120cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f39190612e43565b90506000606482600f600087600481111561211057612110612d6b565b600481111561212157612121612d6b565b8152602001908152602001600020548761213b9190612fe4565b612149906305f5e100612fe4565b61215490605f612fe4565b61215e9190613011565b6121689190613011565b9050600060646004548361217c9190612fe4565b6121869190613011565b9050600060646005548461219a9190612fe4565b6121a49190613011565b600a54600e549192506001600160a01b03908116916323b872dd91339116846121cd8789613025565b6121d79190613025565b6040518463ffffffff1660e01b81526004016121f593929190612eed565b6020604051808303816000875af1158015612214573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122389190612f24565b50600a546001600160a01b03166323b872dd33306122568587612f11565b6040518463ffffffff1660e01b815260040161227493929190612eed565b6020604051808303816000875af1158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b79190612f24565b5060095460408051632163c42160e11b815290516001600160a01b039092169163471aeab49183916342c788429160048082019260209290919082900301816000875af115801561230c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123309190612e43565b846040518363ffffffff1660e01b8152600401612031929190918252602082015260400190565b600281600281111561236b5761236b612d6b565b03612425576006546001600160a01b031663f5298aca336010600086600481111561239857612398612d6b565b60048111156123a9576123a9612d6b565b8152602081019190915260409081016000205490516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260448101869052606401600060405180830381600087803b15801561240857600080fd5b505af115801561241c573d6000803e3d6000fd5b50505050505050565b60405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103830bcb6b2b73a103a37b5b2b760591b6044820152606401610ab8565b60026001540361248857604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600080808561249e8643613025565b405a60408051602081019490945283019190915260608201526080810186905260a0016040516020818303038152906040528051906020012095506000601360008960000160149054906101000a900460ff16600481111561250257612502612d6b565b600481111561251357612513612d6b565b81526020019081526020016000206001601360008b60000160149054906101000a900460ff16600481111561254a5761254a612d6b565b600481111561255b5761255b612d6b565b81526020810191909152604001600020546125769190613025565b8154811061258657612586612ed7565b60009182526020909120015461259c9088613038565b60028901546040518281529192506001600160401b0316907f3c162a7f7ee62c727f3c220e7afa8d380808a705ccaca4efb372a7b54da115309060200160405180910390a287546000906125fa90600160a01b900460ff1683610bdd565b905085801561260a575080604001515b156126a5578854601490600090600160a01b900460ff16600481111561263257612632612d6b565b600481111561264357612643612d6b565b815260200190815260200160002060018154811061266357612663612ed7565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015460ff1615159181019190915290505b8854815160208301516001600160a01b038316927fce9c83dbf0757dbd53fc65acb05894c5f5077e7dae2b0b5dd08e333e176d4d11929190601290600090600160a01b900460ff1660048111156126fe576126fe612d6b565b600481111561270f5761270f612d6b565b815260200190815260200160002054856040015160405161274b9493929190938452602084019290925260408301521515606082015260800190565b60405180910390a280516020820151604083015161276a57600061276d565b60015b919650945060ff16925050509450945094915050565b80156128945760005b8181101561289257600754604051632f745c5960e01b81526001600160a01b039091169063b88d4fde90309088908490632f745c59906127d3908590600090600401612e5c565b602060405180830381865afa1580156127f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128149190612e43565b6040518463ffffffff1660e01b815260040161283293929190612e75565b600060405180830381600087803b15801561284c57600080fd5b505af1158015612860573d6000803e3d6000fd5b5050505060016019600201600082825461287a9190612f11565b9091555081905061288a81612ebe565b91505061278c565b505b821561292b57600b5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906128cc9087908790600401612e5c565b6020604051808303816000875af11580156128eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290f9190612f24565b5082601960000160008282546129259190612f11565b90915550505b8115610e8c57600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca9160048083019260209291908290030181865afa15801561297b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299f9190612e43565b90506000816129b2856305f5e100612fe4565b6129bc9190613011565b600a5460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906129ef9089908590600401612e5c565b6020604051808303816000875af1158015612a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a329190612f24565b508360196001016000828254612a489190612f11565b9091555050505050505050565b604051806060016040528060008152602001600081526020016000151581525090565b6001600160a01b0391909116815260200190565b600060208284031215612a9e57600080fd5b81356001600160e01b031981168114612ab657600080fd5b9392505050565b6001600160a01b038116811461133f57600080fd5b600080600060608486031215612ae757600080fd5b8335612af281612abd565b92506020840135612b0281612abd565b91506040840135612b1281612abd565b809150509250925092565b600060208284031215612b2f57600080fd5b5035919050565b600080600080600060808688031215612b4e57600080fd5b8535612b5981612abd565b94506020860135612b6981612abd565b93506040860135925060608601356001600160401b0380821115612b8c57600080fd5b818801915088601f830112612ba057600080fd5b813581811115612baf57600080fd5b896020828501011115612bc157600080fd5b9699959850939650602001949392505050565b600060208284031215612be657600080fd5b8135612ab681612abd565b803560058110612c0057600080fd5b919050565b600060208284031215612c1757600080fd5b612ab682612bf1565b60008060408385031215612c3357600080fd5b612c3c83612bf1565b946020939093013593505050565b60008060408385031215612c5d57600080fd5b8235612c6881612abd565b91506020830135612c7881612abd565b809150509250929050565b6001600160401b038116811461133f57600080fd5b600080600060608486031215612cad57600080fd5b8335612cb881612c83565b92506020840135612cc881612abd565b929592945050506040919091013590565b60008060408385031215612cec57600080fd5b8235612c3c81612abd565b60008060408385031215612d0a57600080fd5b50508035926020909101359150565b60008060408385031215612d2c57600080fd5b8235612d3781612abd565b9150612d4560208401612bf1565b90509250929050565b600060208284031215612d6057600080fd5b8135612ab681612c83565b634e487b7160e01b600052602160045260246000fd5b60058110612d9f57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038516815260808101612dc06020830186612d81565b60408201939093526001600160401b039190911660609091015292915050565b801515811461133f57600080fd5b60008060008060808587031215612e0457600080fd5b84359350612e1460208601612bf1565b9250604085013560038110612e2857600080fd5b91506060850135612e3881612de0565b939692955090935050565b600060208284031215612e5557600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260806060820181905260009082015260a00190565b634e487b7160e01b600052601160045260246000fd5b600060018201612ed057612ed0612ea8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b808201808211156109b4576109b4612ea8565b600060208284031215612f3657600080fd5b8151612ab681612de0565b600060208284031215612f5357600080fd5b81516001600160801b0381168114612ab657600080fd5b600060208284031215612f7c57600080fd5b8151612ab681612c83565b60408101612f958285612d81565b8260208301529392505050565b60208082526022908201527f4d6f6e6f43686573743a20496e76616c69642073657175656e6365206e756d6260408201526132b960f11b606082015260800190565b80820281158282048414176109b4576109b4612ea8565b634e487b7160e01b600052601260045260246000fd5b60008261302057613020612ffb565b500490565b818103818111156109b4576109b4612ea8565b60008261304757613047612ffb565b50069056fea2646970667358221220f630a35453a4a8bc0a244f3b2e3570735589af10a01fda6a434a7e163f5b4f3a64736f6c634300081400330000000000000000000000004300000000000000000000000000000000000002000000000000000000000000beefa3fc2cabcf76c42802e563ae05bcb0e3d97c000000000000000000000000d13f2003687526159f4e94ab81a1c9a3cf840544000000000000000000000000837fe561e9c5dfa73f607fda679295dbc2be5e4000000000000000000000000028a922ad2d2a02250473b30f3444e20b138354d100000000000000000000000043000000000000000000000000000000000000030000000000000000000000004ef9415985ee3bd44d9f86e2e224b4c5ddae438500000000000000000000000013060d08ea8eb04a5cf554b59b138e84c1c07cde000000000000000000000000364601685c53705af5637f79a632a051e3e59159000000000000000000000000e56cf93657ca9dbd512363c3e69f55ab4f15022a
Deployed Bytecode
0x6080604052600436106102435760003560e01c80626f7d0014610248578063016948cb1461027e57806301ffc9a7146102a157806306df13ed146102d15780630b0454c8146102e657806310b84525146102fc57806314ab6e4b1461031e578063150b7a021461033e5780631f53ac02146103835780631f86a3d6146103a35780632626bc47146103d057806337dee2d31461041457806340ef7267146104415780634ba2363a146104615780634d221ff91461048157806352445dc2146104a157806352a07ce4146104c157806352a5f1f8146104ee5780635d4014601461050e5780636088e93a1461052e578063670b48401461054e5780636a00670b146105645780636ba0a072146105845780637041fb6e146105a4578063715018a6146105b95780637659c5db146105ce57806380189f7d146105ee57806385aee18f146106045780638da5cb5b146106315780638ea5220f14610646578063929066f5146106665780639732463d146106965780639e281a98146106b6578063a7e00f93146106d6578063a91b7a9f1461070e578063b633fcba14610723578063c0ee544714610743578063cab666d014610780578063ced72f87146107a0578063cef03698146107b5578063d1226809146107d5578063d5859249146107f5578063db79e06f1461085f578063e658ac451461088c578063eb1dc4bd146108a1578063ed348895146108c1578063f0ace608146108e1578063f0e03e54146108f6578063f2fde38b14610916578063f926691914610936578063fa0d40d814610970575b600080fd5b34801561025457600080fd5b50600854610268906001600160a01b031681565b6040516102759190612a78565b60405180910390f35b34801561028a57600080fd5b50610293600681565b604051908152602001610275565b3480156102ad57600080fd5b506102c16102bc366004612a8c565b610983565b6040519015158152602001610275565b3480156102dd57600080fd5b50610293600581565b3480156102f257600080fd5b5061029360045481565b34801561030857600080fd5b5061031c610317366004612ad2565b6109ba565b005b34801561032a57600080fd5b5061031c610339366004612b1d565b610a01565b34801561034a57600080fd5b5061036a610359366004612b36565b630a85bd0160e11b95945050505050565b6040516001600160e01b03199091168152602001610275565b34801561038f57600080fd5b5061031c61039e366004612bd4565b610bb3565b3480156103af57600080fd5b506102936103be366004612c05565b60126020526000908152604090205481565b3480156103dc57600080fd5b506103f06103eb366004612c20565b610bdd565b60408051825181526020808401519082015291810151151590820152606001610275565b34801561042057600080fd5b5061029361042f366004612c05565b601c6020526000908152604090205481565b34801561044d57600080fd5b5061031c61045c366004612c4a565b610d2d565b34801561046d57600080fd5b50600954610268906001600160a01b031681565b34801561048d57600080fd5b5061031c61049c366004612bd4565b610d63565b3480156104ad57600080fd5b5061031c6104bc366004612bd4565b610d8d565b3480156104cd57600080fd5b506102936104dc366004612c05565b60156020526000908152604090205481565b3480156104fa57600080fd5b5061031c610509366004612c98565b610db7565b34801561051a57600080fd5b50600254610268906001600160a01b031681565b34801561053a57600080fd5b5061031c610549366004612cd9565b610e92565b34801561055a57600080fd5b5061029360165481565b34801561057057600080fd5b5061031c61057f366004612c20565b610f00565b34801561059057600080fd5b5061031c61059f366004612c20565b610f45565b3480156105b057600080fd5b50610293600181565b3480156105c557600080fd5b5061031c610f64565b3480156105da57600080fd5b5061031c6105e9366004612cf7565b610f78565b3480156105fa57600080fd5b5061029360055481565b34801561061057600080fd5b5061029361061f366004612c05565b60106020526000908152604090205481565b34801561063d57600080fd5b50610268610fd6565b34801561065257600080fd5b50600e54610268906001600160a01b031681565b34801561067257600080fd5b506102c1610681366004612bd4565b60176020526000908152604090205460ff1681565b3480156106a257600080fd5b506102936106b1366004612c20565b610fe5565b3480156106c257600080fd5b5061031c6106d1366004612cd9565b611016565b3480156106e257600080fd5b506102936106f1366004612d19565b601860209081526000928352604080842090915290825290205481565b34801561071a57600080fd5b50610293600381565b34801561072f57600080fd5b5061031c61073e366004612bd4565b6110cf565b34801561074f57600080fd5b5061076361075e366004612c20565b611145565b604080519384526020840192909252151590820152606001610275565b34801561078c57600080fd5b50600a54610268906001600160a01b031681565b3480156107ac57600080fd5b5061029361118a565b3480156107c157600080fd5b50600654610268906001600160a01b031681565b3480156107e157600080fd5b50600754610268906001600160a01b031681565b34801561080157600080fd5b5061084f610810366004612d4e565b6011602052600090815260409020805460018201546002909201546001600160a01b03821692600160a01b90920460ff1691906001600160401b031684565b6040516102759493929190612da3565b34801561086b57600080fd5b5061029361087a366004612c05565b600f6020526000908152604090205481565b34801561089857600080fd5b50610293600481565b3480156108ad57600080fd5b5061031c6108bc366004612bd4565b611211565b3480156108cd57600080fd5b5061031c6108dc366004612bd4565b6112a1565b3480156108ed57600080fd5b50610293600281565b34801561090257600080fd5b50600b54610268906001600160a01b031681565b34801561092257600080fd5b5061031c610931366004612bd4565b611304565b34801561094257600080fd5b50601954601a54601b5461095592919083565b60408051938452602084019290925290820152606001610275565b61031c61097e366004612dee565b611342565b60006001600160e01b031982166301ffc9a760e01b14806109b457506001600160e01b03198216630a85bd0160e11b145b92915050565b6109c261183b565b600a80546001600160a01b039485166001600160a01b031991821617909155600b80549385169382169390931790925560088054919093169116179055565b610a0961183b565b6007546040516370a0823160e01b815282916001600160a01b0316906370a0823190610a39903090600401612a78565b602060405180830381865afa158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a9190612e43565b1015610ac15760405162461bcd60e51b8152602060048201526011602482015270496e73756666696369656e74207061737360781b60448201526064015b60405180910390fd5b60005b81811015610baf57600754604051632f745c5960e01b81526001600160a01b039091169063b88d4fde90309033908490632f745c5990610b0b908590600090600401612e5c565b602060405180830381865afa158015610b28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4c9190612e43565b6040518463ffffffff1660e01b8152600401610b6a93929190612e75565b600060405180830381600087803b158015610b8457600080fd5b505af1158015610b98573d6000803e3d6000fd5b505050508080610ba790612ebe565b915050610ac4565b5050565b610bbb61183b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610be5612a55565b610bed612a55565b60005b60136000866004811115610c0657610c06612d6b565b6004811115610c1757610c17612d6b565b8152602081019190915260400160002054811015610d255760136000866004811115610c4557610c45612d6b565b6004811115610c5657610c56612d6b565b81526020019081526020016000208181548110610c7557610c75612ed7565b9060005260206000200154841015610d135760146000866004811115610c9d57610c9d612d6b565b6004811115610cae57610cae612d6b565b81526020019081526020016000208181548110610ccd57610ccd612ed7565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015460ff161515918101919091529150610d25565b80610d1d81612ebe565b915050610bf0565b509392505050565b610d3561183b565b600c80546001600160a01b039384166001600160a01b031991821617909155600d8054929093169116179055565b610d6b61183b565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b610d9561183b565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dcb600c546001600160a01b031690565b90506001600160a01b038116610e1d5760405162461bcd60e51b8152602060048201526017602482015276115b9d1c9bdc1e481859191c995cdcc81b9bdd081cd95d604a1b6044820152606401610ab8565b336001600160a01b03821614610e815760405162461bcd60e51b815260206004820152602360248201527f4f6e6c7920456e74726f70792063616e2063616c6c20746869732066756e637460448201526234b7b760e91b6064820152608401610ab8565b610e8c84848461186d565b50505050565b610e9a61183b565b6040516323b872dd60e01b81526001600160a01b038316906323b872dd90610eca90309033908690600401612eed565b600060405180830381600087803b158015610ee457600080fd5b505af1158015610ef8573d6000803e3d6000fd5b505050505050565b610f0861183b565b80600f6000846004811115610f1f57610f1f612d6b565b6004811115610f3057610f30612d6b565b81526020810191909152604001600020555050565b610f4d61183b565b80601c6000846004811115610f1f57610f1f612d6b565b610f6c61183b565b610f766000611b69565b565b610f8061183b565b6064610f8c8284612f11565b10610fcb5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c195c98d95b9d608a1b6044820152606401610ab8565b600491909155600555565b6000546001600160a01b031690565b6013602052816000526040600020818154811061100157600080fd5b90600052602060002001600091509150505481565b61101e61183b565b6001600160a01b03821661105e57604051339082156108fc029083906000818181858888f19350505050158015611059573d6000803e3d6000fd5b505050565b60405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb9061108c9033908590600401612e5c565b6020604051808303816000875af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110599190612f24565b60035460405163662aa11d60e01b81523060048201526001600160a01b0383811660248301529091169063662aa11d906044016020604051808303816000875af1158015611121573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610baf9190612e43565b6014602052816000526040600020818154811061116157600080fd5b600091825260209091206003909102018054600182015460029092015490935090915060ff1683565b600c54600d54604051631711922960e31b81526000926001600160a01b039081169263b88c9148926111c29290911690600401612a78565b602060405180830381865afa1580156111df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112039190612f41565b6001600160801b0316905090565b6002546001600160a01b0316331461127f5760405162461bcd60e51b815260206004820152602b60248201527f42617365426c6173743a2063616c6c6572206973206e6f742074686520626c6160448201526a39ba1037b832b930ba37b960a91b6064820152608401610ab8565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6112a961183b565b600980546001600160a01b0319166001600160a01b03831690811790915560408051632163c42160e11b815290516342c788429160048082019260209290919082900301816000875af1158015611121573d6000803e3d6000fd5b61130c61183b565b6001600160a01b038116611336576000604051631e4fbdf760e01b8152600401610ab89190612a78565b61133f81611b69565b50565b601c600084600481111561135857611358612d6b565b600481111561136957611369612d6b565b81526020019081526020016000205461138061118a565b61138a9190612f11565b3410156113cc5760405162461bcd60e51b815260206004820152601060248201526f496e73756666696369656e742066656560801b6044820152606401610ab8565b600e546001600160a01b03166108fc601c60008660048111156113f1576113f1612d6b565b600481111561140257611402612d6b565b8152602001908152602001600020549081150290604051600060405180830381858888f1935050505015801561143c573d6000803e3d6000fd5b50333b63ffffffff16156114895760405162461bcd60e51b815260206004820152601460248201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b6044820152606401610ab8565b600084116114d95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610ab8565b3360009081526017602052604090205460ff1661152657336000908152601760205260408120805460ff191660019081179091556016805491929091611520908490612f11565b90915550505b611531848484611bb9565b600c546000906001600160a01b03166319cb825f61154d61118a565b600d546040516001600160e01b031960e085901b168152611588916001600160a01b03169068135bdb9bd0da195cdd60ba1b90600401612e5c565b60206040518083038185885af11580156115a6573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115cb9190612f6a565b90506040518060800160405280336001600160a01b031681526020018560048111156115f9576115f9612d6b565b815260208082018890526001600160401b038416604092830181905260009081526011825291909120825181546001600160a01b039091166001600160a01b031982168117835592840151919283916001600160a81b03191617600160a01b83600481111561166a5761166a612d6b565b021790555060408201516001820155606090910151600290910180546001600160401b0319166001600160401b0390921691909117905584601560008660048111156116b8576116b8612d6b565b60048111156116c9576116c9612d6b565b815260200190815260200160002060008282546116e69190612f11565b9091555050336000908152601860205260408120869186600481111561170e5761170e612d6b565b600481111561171f5761171f612d6b565b8152602001908152602001600020600082825461173c9190612f11565b90915550506040516001600160401b0382169033907fbeeb78f6d3a68cd348586167a542623b027b326020292242ee83092dffcf59a8906117809088908a90612f87565b60405180910390a38161183457600c54600d54604051631e985e0760e11b81526001600160a01b0391821660048201526001600160401b038416602482015268135bdb9bd0da195cdd60ba1b60448201527a26b7b737a1b432b9ba283937bb34b232b92932bb32b630ba34b7b760291b6064820152911690633d30bc0e90608401600060405180830381600087803b15801561181b57600080fd5b505af115801561182f573d6000803e3d6000fd5b505050505b5050505050565b33611844610fd6565b6001600160a01b031614610f76573360405163118cdaa760e01b8152600401610ab89190612a78565b611875612465565b6001600160401b038316600090815260116020526040902080546001600160a01b03166118b45760405162461bcd60e51b8152600401610ab890612fa2565b60028101546001600160401b038581169116146118e35760405162461bcd60e51b8152600401610ab890612fa2565b60008080805b84600101548110156119be576007546040516370a0823160e01b81526000918291829161197d918a918c9188916001600160a01b0316906370a0823190611934903090600401612a78565b602060405180830381865afa158015611951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119759190612e43565b89101561248f565b9194509250905061198e8388612f11565b965061199a8287612f11565b95506119a68186612f11565b945050505080806119b690612ebe565b9150506118e9565b5083546119d6906001600160a01b0316848484612783565b60065484546001600160a01b039182169163731133e99190811690600190601290600090600160a01b900460ff166004811115611a1557611a15612d6b565b6004811115611a2657611a26612d6b565b8152602001908152602001600020548860010154611a449190612fe4565b6040516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091526044820152608060648201526000608482015260a401600060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b505085546001600160a01b03811692507f5cd16ad47114de3783edb5a51a8ba1f8ce78c0fc3c3f4088f39af2257db074219150601290600090600160a01b900460ff166004811115611b0857611b08612d6b565b6004811115611b1957611b19612d6b565b8152602001908152602001600020548660010154611b379190612fe4565b604080519182526020820187905281018590526060810184905260800160405180910390a25050505061105960018055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000816002811115611bcd57611bcd612d6b565b0361206c5760006064600454600f6000866004811115611bef57611bef612d6b565b6004811115611c0057611c00612d6b565b81526020019081526020016000205486611c1a9190612fe4565b611c249190612fe4565b611c2e9190613011565b905060006064600554600f6000876004811115611c4d57611c4d612d6b565b6004811115611c5e57611c5e612d6b565b81526020019081526020016000205487611c789190612fe4565b611c829190612fe4565b611c8c9190613011565b600854600e549192506001600160a01b03908116916323b872dd913391168486600f60008b6004811115611cc257611cc2612d6b565b6004811115611cd357611cd3612d6b565b8152602001908152602001600020548b611ced9190612fe4565b611cf79190613025565b611d019190613025565b6040518463ffffffff1660e01b8152600401611d1f93929190612eed565b6020604051808303816000875af1158015611d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d629190612f24565b506008546001600160a01b03166323b872dd3330611d808587612f11565b6040518463ffffffff1660e01b8152600401611d9e93929190612eed565b6020604051808303816000875af1158015611dbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de19190612f24565b50600a5460405163b6b55f2560e01b8152600481018390526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015611e2857600080fd5b505af1158015611e3c573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611e73903090600401612a78565b602060405180830381865afa158015611e90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb49190612e43565b600a5460405163b6b55f2560e01b8152600481018690529192506001600160a01b03169063b6b55f2590602401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b5050600a546040516370a0823160e01b8152600093506001600160a01b0390911691506370a0823190611f46903090600401612a78565b602060405180830381865afa158015611f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f879190612e43565b60095460408051632163c42160e11b815290519293506001600160a01b039091169163471aeab49183916342c788429160048082019260209290919082900301816000875af1158015611fde573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120029190612e43565b61200c8585613025565b6040516001600160e01b031960e085901b168152600481019290925260248201526044015b600060405180830381600087803b15801561204b57600080fd5b505af115801561205f573d6000803e3d6000fd5b5050505050505050505050565b600181600281111561208057612080612d6b565b0361235757600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca9160048083019260209291908290030181865afa1580156120cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120f39190612e43565b90506000606482600f600087600481111561211057612110612d6b565b600481111561212157612121612d6b565b8152602001908152602001600020548761213b9190612fe4565b612149906305f5e100612fe4565b61215490605f612fe4565b61215e9190613011565b6121689190613011565b9050600060646004548361217c9190612fe4565b6121869190613011565b9050600060646005548461219a9190612fe4565b6121a49190613011565b600a54600e549192506001600160a01b03908116916323b872dd91339116846121cd8789613025565b6121d79190613025565b6040518463ffffffff1660e01b81526004016121f593929190612eed565b6020604051808303816000875af1158015612214573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122389190612f24565b50600a546001600160a01b03166323b872dd33306122568587612f11565b6040518463ffffffff1660e01b815260040161227493929190612eed565b6020604051808303816000875af1158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b79190612f24565b5060095460408051632163c42160e11b815290516001600160a01b039092169163471aeab49183916342c788429160048082019260209290919082900301816000875af115801561230c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123309190612e43565b846040518363ffffffff1660e01b8152600401612031929190918252602082015260400190565b600281600281111561236b5761236b612d6b565b03612425576006546001600160a01b031663f5298aca336010600086600481111561239857612398612d6b565b60048111156123a9576123a9612d6b565b8152602081019190915260409081016000205490516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260448101869052606401600060405180830381600087803b15801561240857600080fd5b505af115801561241c573d6000803e3d6000fd5b50505050505050565b60405162461bcd60e51b815260206004820152601560248201527424b73b30b634b2103830bcb6b2b73a103a37b5b2b760591b6044820152606401610ab8565b60026001540361248857604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600080808561249e8643613025565b405a60408051602081019490945283019190915260608201526080810186905260a0016040516020818303038152906040528051906020012095506000601360008960000160149054906101000a900460ff16600481111561250257612502612d6b565b600481111561251357612513612d6b565b81526020019081526020016000206001601360008b60000160149054906101000a900460ff16600481111561254a5761254a612d6b565b600481111561255b5761255b612d6b565b81526020810191909152604001600020546125769190613025565b8154811061258657612586612ed7565b60009182526020909120015461259c9088613038565b60028901546040518281529192506001600160401b0316907f3c162a7f7ee62c727f3c220e7afa8d380808a705ccaca4efb372a7b54da115309060200160405180910390a287546000906125fa90600160a01b900460ff1683610bdd565b905085801561260a575080604001515b156126a5578854601490600090600160a01b900460ff16600481111561263257612632612d6b565b600481111561264357612643612d6b565b815260200190815260200160002060018154811061266357612663612ed7565b60009182526020918290206040805160608101825260039093029091018054835260018101549383019390935260029092015460ff1615159181019190915290505b8854815160208301516001600160a01b038316927fce9c83dbf0757dbd53fc65acb05894c5f5077e7dae2b0b5dd08e333e176d4d11929190601290600090600160a01b900460ff1660048111156126fe576126fe612d6b565b600481111561270f5761270f612d6b565b815260200190815260200160002054856040015160405161274b9493929190938452602084019290925260408301521515606082015260800190565b60405180910390a280516020820151604083015161276a57600061276d565b60015b919650945060ff16925050509450945094915050565b80156128945760005b8181101561289257600754604051632f745c5960e01b81526001600160a01b039091169063b88d4fde90309088908490632f745c59906127d3908590600090600401612e5c565b602060405180830381865afa1580156127f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128149190612e43565b6040518463ffffffff1660e01b815260040161283293929190612e75565b600060405180830381600087803b15801561284c57600080fd5b505af1158015612860573d6000803e3d6000fd5b5050505060016019600201600082825461287a9190612f11565b9091555081905061288a81612ebe565b91505061278c565b505b821561292b57600b5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906128cc9087908790600401612e5c565b6020604051808303816000875af11580156128eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290f9190612f24565b5082601960000160008282546129259190612f11565b90915550505b8115610e8c57600a5460408051634c6afee560e11b815290516000926001600160a01b0316916398d5fdca9160048083019260209291908290030181865afa15801561297b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299f9190612e43565b90506000816129b2856305f5e100612fe4565b6129bc9190613011565b600a5460405163a9059cbb60e01b81529192506001600160a01b03169063a9059cbb906129ef9089908590600401612e5c565b6020604051808303816000875af1158015612a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a329190612f24565b508360196001016000828254612a489190612f11565b9091555050505050505050565b604051806060016040528060008152602001600081526020016000151581525090565b6001600160a01b0391909116815260200190565b600060208284031215612a9e57600080fd5b81356001600160e01b031981168114612ab657600080fd5b9392505050565b6001600160a01b038116811461133f57600080fd5b600080600060608486031215612ae757600080fd5b8335612af281612abd565b92506020840135612b0281612abd565b91506040840135612b1281612abd565b809150509250925092565b600060208284031215612b2f57600080fd5b5035919050565b600080600080600060808688031215612b4e57600080fd5b8535612b5981612abd565b94506020860135612b6981612abd565b93506040860135925060608601356001600160401b0380821115612b8c57600080fd5b818801915088601f830112612ba057600080fd5b813581811115612baf57600080fd5b896020828501011115612bc157600080fd5b9699959850939650602001949392505050565b600060208284031215612be657600080fd5b8135612ab681612abd565b803560058110612c0057600080fd5b919050565b600060208284031215612c1757600080fd5b612ab682612bf1565b60008060408385031215612c3357600080fd5b612c3c83612bf1565b946020939093013593505050565b60008060408385031215612c5d57600080fd5b8235612c6881612abd565b91506020830135612c7881612abd565b809150509250929050565b6001600160401b038116811461133f57600080fd5b600080600060608486031215612cad57600080fd5b8335612cb881612c83565b92506020840135612cc881612abd565b929592945050506040919091013590565b60008060408385031215612cec57600080fd5b8235612c3c81612abd565b60008060408385031215612d0a57600080fd5b50508035926020909101359150565b60008060408385031215612d2c57600080fd5b8235612d3781612abd565b9150612d4560208401612bf1565b90509250929050565b600060208284031215612d6057600080fd5b8135612ab681612c83565b634e487b7160e01b600052602160045260246000fd5b60058110612d9f57634e487b7160e01b600052602160045260246000fd5b9052565b6001600160a01b038516815260808101612dc06020830186612d81565b60408201939093526001600160401b039190911660609091015292915050565b801515811461133f57600080fd5b60008060008060808587031215612e0457600080fd5b84359350612e1460208601612bf1565b9250604085013560038110612e2857600080fd5b91506060850135612e3881612de0565b939692955090935050565b600060208284031215612e5557600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260806060820181905260009082015260a00190565b634e487b7160e01b600052601160045260246000fd5b600060018201612ed057612ed0612ea8565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b808201808211156109b4576109b4612ea8565b600060208284031215612f3657600080fd5b8151612ab681612de0565b600060208284031215612f5357600080fd5b81516001600160801b0381168114612ab657600080fd5b600060208284031215612f7c57600080fd5b8151612ab681612c83565b60408101612f958285612d81565b8260208301529392505050565b60208082526022908201527f4d6f6e6f43686573743a20496e76616c69642073657175656e6365206e756d6260408201526132b960f11b606082015260800190565b80820281158282048414176109b4576109b4612ea8565b634e487b7160e01b600052601260045260246000fd5b60008261302057613020612ffb565b500490565b818103818111156109b4576109b4612ea8565b60008261304757613047612ffb565b50069056fea2646970667358221220f630a35453a4a8bc0a244f3b2e3570735589af10a01fda6a434a7e163f5b4f3a64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004300000000000000000000000000000000000002000000000000000000000000beefa3fc2cabcf76c42802e563ae05bcb0e3d97c000000000000000000000000d13f2003687526159f4e94ab81a1c9a3cf840544000000000000000000000000837fe561e9c5dfa73f607fda679295dbc2be5e4000000000000000000000000028a922ad2d2a02250473b30f3444e20b138354d100000000000000000000000043000000000000000000000000000000000000030000000000000000000000004ef9415985ee3bd44d9f86e2e224b4c5ddae438500000000000000000000000013060d08ea8eb04a5cf554b59b138e84c1c07cde000000000000000000000000364601685c53705af5637f79a632a051e3e59159000000000000000000000000e56cf93657ca9dbd512363c3e69f55ab4f15022a
-----Decoded View---------------
Arg [0] : _blast (address): 0x4300000000000000000000000000000000000002
Arg [1] : _monoNFT (address): 0xBEEfA3FC2cabCf76c42802E563aE05bcb0E3d97C
Arg [2] : _monoPass (address): 0xD13f2003687526159F4e94aB81a1C9A3Cf840544
Arg [3] : _musd (address): 0x837fE561e9C5DFa73F607fDa679295DBC2Be5E40
Arg [4] : _xMono (address): 0x28A922aD2d2A02250473b30F3444E20b138354d1
Arg [5] : _usdb (address): 0x4300000000000000000000000000000000000003
Arg [6] : _entropy (address): 0x4ef9415985ee3Bd44d9F86e2e224B4c5DdAE4385
Arg [7] : _entropyProvider (address): 0x13060D08Ea8Eb04A5Cf554B59b138E84c1C07CDE
Arg [8] : _devWallet (address): 0x364601685C53705af5637F79a632a051e3e59159
Arg [9] : _pot (address): 0xe56cF93657ca9dbd512363C3e69f55ab4f15022A
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000004300000000000000000000000000000000000002
Arg [1] : 000000000000000000000000beefa3fc2cabcf76c42802e563ae05bcb0e3d97c
Arg [2] : 000000000000000000000000d13f2003687526159f4e94ab81a1c9a3cf840544
Arg [3] : 000000000000000000000000837fe561e9c5dfa73f607fda679295dbc2be5e40
Arg [4] : 00000000000000000000000028a922ad2d2a02250473b30f3444e20b138354d1
Arg [5] : 0000000000000000000000004300000000000000000000000000000000000003
Arg [6] : 0000000000000000000000004ef9415985ee3bd44d9f86e2e224b4c5ddae4385
Arg [7] : 00000000000000000000000013060d08ea8eb04a5cf554b59b138e84c1c07cde
Arg [8] : 000000000000000000000000364601685c53705af5637f79a632a051e3e59159
Arg [9] : 000000000000000000000000e56cf93657ca9dbd512363c3e69f55ab4f15022a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$10.97
Net Worth in ETH
0.003863
Token Allocations
ETH
100.00%
MNT
0.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 57.84% | $2,838.73 | 0.002235 | $6.34 | |
| LINEA | 14.08% | $2,834.43 | 0.000545 | $1.54 | |
| OP | 10.88% | $2,840.71 | 0.00042 | $1.19 | |
| TAIKO | 7.75% | $2,834.43 | 0.0003 | $0.850328 | |
| BASE | 5.05% | $2,840.02 | 0.000195 | $0.553804 | |
| BLAST | 2.46% | $2,842.14 | 0.000095 | $0.270003 | |
| ARB | 1.94% | $2,842.1 | 0.000075 | $0.213157 | |
| MANTLE | <0.01% | $0.83891 | 0.00012 | $0.000101 |
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.