More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,470 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Winner Raffl... | 21358132 | 16 days ago | IN | 0 ETH | 0.00287517 | ||||
Buy Entry | 19960062 | 211 days ago | IN | 0.003 ETH | 0.00152655 | ||||
Buy Entry | 19864711 | 224 days ago | IN | 0.002 ETH | 0.00045127 | ||||
Buy Entry | 19744138 | 241 days ago | IN | 0.001 ETH | 0.00076308 | ||||
Buy Entry | 19687283 | 249 days ago | IN | 0.001 ETH | 0.0011684 | ||||
Set Raffle To No... | 19687276 | 249 days ago | IN | 0 ETH | 0.00027646 | ||||
Buy Entry | 19687263 | 249 days ago | IN | 0.001 ETH | 0.00128046 | ||||
Create Raffle Su... | 19687234 | 249 days ago | IN | 0.015 ETH | 0.00492628 | ||||
Cancel Raffle | 19495495 | 276 days ago | IN | 0 ETH | 0.00427244 | ||||
Set Winner Raffl... | 19364997 | 294 days ago | IN | 0 ETH | 0.01449204 | ||||
Buy Entry | 19339858 | 298 days ago | IN | 0.0005 ETH | 0.00596195 | ||||
Cancel Raffle | 19291561 | 305 days ago | IN | 0 ETH | 0.00805803 | ||||
Buy Entry | 19286378 | 305 days ago | IN | 0.05 ETH | 0.00940757 | ||||
Buy Entry | 19286184 | 305 days ago | IN | 0.05 ETH | 0.00980199 | ||||
Buy Entry | 19283210 | 306 days ago | IN | 0.05 ETH | 0.00572932 | ||||
Create Raffle Su... | 19283175 | 306 days ago | IN | 0.015 ETH | 0.0137982 | ||||
Set Winner Raffl... | 19277971 | 307 days ago | IN | 0 ETH | 0.00613028 | ||||
Buy Entry | 19277945 | 307 days ago | IN | 0.35 ETH | 0.00555803 | ||||
Buy Entry | 19277942 | 307 days ago | IN | 0.05 ETH | 0.00529303 | ||||
Buy Entry | 19277939 | 307 days ago | IN | 0.05 ETH | 0.00527018 | ||||
Buy Entry | 19277939 | 307 days ago | IN | 0.05 ETH | 0.00527018 | ||||
Buy Entry | 19277936 | 307 days ago | IN | 0.4 ETH | 0.00561785 | ||||
Buy Entry | 19277930 | 307 days ago | IN | 0.05 ETH | 0.00520113 | ||||
Buy Entry | 19277924 | 307 days ago | IN | 0.5 ETH | 0.00567008 | ||||
Buy Entry | 19277889 | 307 days ago | IN | 0.05 ETH | 0.00729759 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21358132 | 16 days ago | 0.00024 ETH | ||||
21358132 | 16 days ago | 0.00776 ETH | ||||
19687234 | 249 days ago | 0.015 ETH | ||||
19365001 | 294 days ago | 0.000045 ETH | ||||
19365001 | 294 days ago | 0.001455 ETH | ||||
19291561 | 305 days ago | 0.05 ETH | ||||
19291561 | 305 days ago | 0.05 ETH | ||||
19291561 | 305 days ago | 0.05 ETH | ||||
19283175 | 306 days ago | 0.015 ETH | ||||
19277975 | 307 days ago | 0.045 ETH | ||||
19277975 | 307 days ago | 1.455 ETH | ||||
19277822 | 307 days ago | 0.015 ETH | ||||
19198729 | 318 days ago | 0.015 ETH | ||||
19137132 | 326 days ago | 0.015 ETH | ||||
19136264 | 326 days ago | 0.015 ETH | ||||
18859401 | 365 days ago | 0.009405 ETH | ||||
18859401 | 365 days ago | 0.304095 ETH | ||||
18688498 | 389 days ago | 0.0063 ETH | ||||
18688498 | 389 days ago | 0.2037 ETH | ||||
18686415 | 390 days ago | 0.00315 ETH | ||||
18686415 | 390 days ago | 0.10185 ETH | ||||
18680080 | 390 days ago | 0.015 ETH | ||||
18676289 | 391 days ago | 0.00775 ETH | ||||
18676289 | 391 days ago | 0.14725 ETH | ||||
18673381 | 391 days ago | 0.015 ETH |
Loading...
Loading
Contract Name:
RafldexV2_5
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/[email protected]/utils/cryptography/MerkleProof.sol"; contract RafldexV2_5 is Ownable, ReentrancyGuard, VRFConsumerBaseV2, ERC721Holder, ERC1155Holder { VRFCoordinatorV2Interface COORDINATOR; LinkTokenInterface LINKTOKEN; address constant vrfCoordinator = 0x271682DEB8C4E0901D1a1550aD2e64D568E69909; address constant link_token_contract = 0x514910771AF9Ca656af840dff83E8264EcF986CA; bytes32 private keyHash = 0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef; uint16 private requestConfirmations = 3; uint32 private callbackGasLimit = 2500000; uint32 private numWords = 1; uint64 private subscriptionId = 810; struct RandomResult { uint256 randomNumber; uint256 nomalizedRandomNumber; } struct RaffleInfo { uint256 id; uint256 size; } mapping(uint256 => RandomResult) public requests; mapping(uint256 => RaffleInfo) public chainlinkRaffleInfo; event GotSubscription(address _address); event CollectionWhitelisted(address _collection, uint256 _rafflesnumber); event AddedTokenPayment(address _address); event RequestFulfilled( uint256 requestId, uint256 randomNumber, uint256 indexed raffleId ); event RequestSent(uint256 requestId, uint32 numWords); event RaffleCreated( uint256 indexed raffleId // address[] nftAddress, // uint256[] nftId ); event RaffleDrawn( uint256 indexed raffleId, address indexed winner, uint256 amountRaised, uint256 randomNumber ); event EntryBought( uint256 indexed raffleId, address indexed buyer, uint256 currentSize, uint256 numberEntries ); event EntryGifted( uint256 indexed raffleId, address indexed gifter, address indexed buyer, uint256 currentSize, uint256 numberEntries ); event RaffleSetNotToCancel(uint256 indexed raffleId, address creator); event RaffleRootChanged(uint256 indexed raffleId, bytes32 root); event RaffleCancelled(uint256 indexed raffleId, uint256 amountRaised); event SetWinnerTriggered(uint256 indexed raffleId, uint256 amountRaised); struct EntriesBought { address player; uint256 currentEntriesLength; uint256 entries; } mapping(uint256 => EntriesBought[]) public entriesList; enum STATUS { CREATED, PENDING_DRAW, DRAWING, DRAWN, CANCELLED } struct RaffleStruct { STATUS status; uint256 endTime; address[] collateralAddress; uint256[] collateralId; uint256[] tokenAmount; uint256 entriesSupply; uint256 pricePerEntry; uint256 maxEntriesUser; address winner; uint256 randomNumber; address creator; uint256 platformPercentage; address tokenPayment; uint256 entriesSold; bool canCancel; bytes32 root; } RaffleStruct[] public raffles; struct RaffleCreationHolder { uint256 startTime; uint256 endTime; uint256 countRaffles; } mapping(bytes32 => RaffleCreationHolder) public raffleCreationData; mapping(address => uint256) public numberRafflesMonthCollection; mapping(bytes32 => uint256) public entriesInfo; bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR"); bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; address payable private platformWallet = payable(0x2300Ae69d7D1Ea0457aD79e822422888e3Ee3e87); uint256 public CHAINLINK_RAFFLE_FEE = 0.015 ether; uint256 public HOLDER_CREATE_RAFFLE_FEE = 0.02 ether; uint256 public HOLDER_CREATE_RAFFLE_FEE_DISCOUNT = 0.01 ether; uint256 public CANCELATION_RAFFLE_FEE_BASE = 0 ether; uint256 public SUBSCRIPTION_PRICE = 0.5 ether; uint256 public COMMISSION_HOLDERS = 500; //5 % uint256 public COMMISSION_HOLDERS_DISCOUNT = 350; //3.5% uint256 public COMMISSION_SUBSCRIBERS = 300; //3% uint256 public COMMISSION_SUBSCRIBERS_DISCOUNT = 150; //1.5% mapping(address => bool) public TokenPaymentAddresses; mapping(address => bool) public DiscountTokenPayments; bool public createEnabledHolders = true; bool public createEnabledSubscribers = true; struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; constructor() VRFConsumerBaseV2(vrfCoordinator) { COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator); LINKTOKEN = LinkTokenInterface(link_token_contract); _setupRole(OPERATOR_ROLE, msg.sender); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } modifier onlyRole(bytes32 role, address account) { _checkRole(role, account); _; } function createRaffleOperator( uint256 _endTime, address[] memory _collateralAddress, uint256[] memory _collateralId, uint256[] memory _tokenAmount, address _tokenPayment, uint256 _pricePerEntry, uint256 _maxEntriesRaffle, uint256 _maxEntriesUser, bytes32 _root ) external onlyRole(OPERATOR_ROLE, msg.sender) returns (uint256) { require( _endTime > getCurrentTime(), "End time can't be < as current time." ); require( _collateralAddress.length == _collateralId.length, "Address, IDs need to have same length." ); require( _collateralAddress.length == _tokenAmount.length, "Address, Token Amounts need to have same length." ); require(_maxEntriesRaffle > 0, "No entries"); require( _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle, "Min entries user > 0 and <= max entries raffle" ); if (_tokenPayment != address(0)) { require( TokenPaymentAddresses[_tokenPayment], "Token Address not added " ); } for (uint256 i = 0; i < _collateralAddress.length; i++) { require(_collateralAddress[i] != address(0), "NFT is null"); if (_tokenAmount[i] == 0) { IERC721 nftContract = IERC721(_collateralAddress[i]); require( msg.sender == nftContract.ownerOf(_collateralId[i]), "Only NFT owner can create raffle" ); } else { IERC1155 nftContract = IERC1155(_collateralAddress[i]); require( nftContract.balanceOf(msg.sender, _collateralId[i]) >= _tokenAmount[i], "Dont have enough amount." ); } } uint256 _commissionInBasicPoints = 0; safeMultipleTransfersFrom( msg.sender, address(this), _collateralAddress, _collateralId, _tokenAmount ); RaffleStruct memory raffle = RaffleStruct({ status: STATUS.CREATED, endTime: _endTime, collateralAddress: _collateralAddress, collateralId: _collateralId, tokenAmount: _tokenAmount, pricePerEntry: _pricePerEntry, entriesSupply: _maxEntriesRaffle, maxEntriesUser: _maxEntriesUser, winner: address(0), randomNumber: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true, root: _root }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: 0, entries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle); return idRaffle; } function createRaffleHolder( address createRaffleCollection, uint256 createRaffleTokenId, uint256 _endTime, address[] memory _collateralAddress, uint256[] memory _collateralId, uint256[] memory _tokenAmount, address _tokenPayment, uint256 _pricePerEntry, uint256 _maxEntriesRaffle, uint256 _maxEntriesUser ) external payable nonReentrant returns (uint256) { require(createEnabledHolders, "Create raffle not set for holders."); require( _endTime > getCurrentTime(), "End time can't be < as current time." ); require( _collateralAddress.length == _collateralId.length, "Address, IDs & Token Amount need to have same length." ); require( _collateralAddress.length == _tokenAmount.length, "Address, Token Amounts need to have same length." ); require(_maxEntriesRaffle > 0, "No entries"); require( _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle, "Min entries user > 0 and <= max entries raffle" ); if (_tokenPayment != address(0)) { require( TokenPaymentAddresses[_tokenPayment], "Token Address not added " ); } for (uint256 i = 0; i < _collateralAddress.length; i++) { require(_collateralAddress[i] != address(0), "NFT is null"); if (_tokenAmount[i] == 0) { IERC721 nftContract = IERC721(_collateralAddress[i]); require( msg.sender == nftContract.ownerOf(_collateralId[i]), "Only NFT owner can create raffle" ); } else { IERC1155 nftContract = IERC1155(_collateralAddress[i]); require( nftContract.balanceOf(msg.sender, _collateralId[i]) >= _tokenAmount[i], "Dont have enough amount." ); } } uint256 _commissionInBasicPoints = 0; if (DiscountTokenPayments[_tokenPayment]) { require( msg.value >= HOLDER_CREATE_RAFFLE_FEE_DISCOUNT + CHAINLINK_RAFFLE_FEE, "Invalid funds provided" ); _commissionInBasicPoints = COMMISSION_HOLDERS_DISCOUNT; } else { require( msg.value >= HOLDER_CREATE_RAFFLE_FEE + CHAINLINK_RAFFLE_FEE, "Invalid funds provided" ); _commissionInBasicPoints = COMMISSION_HOLDERS; } IERC721 createraffleNFT = IERC721(createRaffleCollection); require( createraffleNFT.ownerOf(createRaffleTokenId) == msg.sender, "Not the owner of tokenId" ); bytes32 hash = keccak256( abi.encode(createRaffleCollection, createRaffleTokenId) ); if (raffleCreationData[hash].endTime > getCurrentTime()) { require( numberRafflesRemainingPerNFT( createRaffleCollection, createRaffleTokenId ) > 0, "Created too many raffles with your NFT you hold." ); raffleCreationData[hash].countRaffles++; } else { raffleCreationData[hash].startTime = getCurrentTime(); raffleCreationData[hash].endTime = getCurrentTime() + 30 days; raffleCreationData[hash].countRaffles = 1; } safeMultipleTransfersFrom( msg.sender, address(this), _collateralAddress, _collateralId, _tokenAmount ); platformWallet.transfer(msg.value); RaffleStruct memory raffle = RaffleStruct({ status: STATUS.CREATED, endTime: _endTime, collateralAddress: _collateralAddress, collateralId: _collateralId, tokenAmount: _tokenAmount, pricePerEntry: _pricePerEntry, entriesSupply: _maxEntriesRaffle, maxEntriesUser: _maxEntriesUser, winner: address(0), randomNumber: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true, root: bytes32(0) }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: 0, entries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle); return idRaffle; } function createRaffleSubscriber( uint256 _endTime, address[] memory _collateralAddress, uint256[] memory _collateralId, uint256[] memory _tokenAmount, address _tokenPayment, uint256 _pricePerEntry, uint256 _maxEntriesRaffle, uint256 _maxEntriesUser, bytes32 _root ) external payable nonReentrant returns (uint256) { require( createEnabledSubscribers, "Create raffle noot set for subscribers." ); require( _endTime > getCurrentTime(), "End time can't be < as current time." ); require( _collateralAddress.length == _collateralId.length, "Address, IDs & Token Amount need to have same length." ); require( _collateralAddress.length == _tokenAmount.length, "Address, Token Amounts need to have same length." ); require(msg.value >= CHAINLINK_RAFFLE_FEE, "Invalid funds provided"); require(_maxEntriesRaffle > 0, "No entries"); require( _maxEntriesUser > 0 && _maxEntriesUser <= _maxEntriesRaffle, "Min entries user > 0 and <= max entries raffle" ); if (_tokenPayment != address(0)) { require( TokenPaymentAddresses[_tokenPayment], "Token Address not added " ); } for (uint256 i = 0; i < _collateralAddress.length; i++) { require(_collateralAddress[i] != address(0), "NFT is null"); if (_tokenAmount[i] == 0) { IERC721 nftContract = IERC721(_collateralAddress[i]); require( msg.sender == nftContract.ownerOf(_collateralId[i]), "Only NFT owner can create raffle" ); } else { IERC1155 nftContract = IERC1155(_collateralAddress[i]); require( nftContract.balanceOf(msg.sender, _collateralId[i]) >= _tokenAmount[i], "Dont have enough amount." ); } } uint256 _commissionInBasicPoints = 0; if (DiscountTokenPayments[_tokenPayment]) { _commissionInBasicPoints = COMMISSION_SUBSCRIBERS_DISCOUNT; } else { _commissionInBasicPoints = COMMISSION_SUBSCRIBERS; } safeMultipleTransfersFrom( msg.sender, address(this), _collateralAddress, _collateralId, _tokenAmount ); platformWallet.transfer(msg.value); RaffleStruct memory raffle = RaffleStruct({ status: STATUS.CREATED, endTime: _endTime, collateralAddress: _collateralAddress, collateralId: _collateralId, tokenAmount: _tokenAmount, pricePerEntry: _pricePerEntry, entriesSupply: _maxEntriesRaffle, maxEntriesUser: _maxEntriesUser, winner: address(0), randomNumber: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true, root: _root }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: 0, entries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle); return idRaffle; } function giftEntry( uint256 _raffleId, uint256 _numberEntries, address _user, bytes32[] memory proof ) external payable { RaffleStruct storage raffle = raffles[_raffleId]; require(raffle.endTime > getCurrentTime(), "Raffle Closed on time"); require(raffle.status == STATUS.CREATED, "Raffle is not in CREATED"); if (raffle.root != bytes32(0)) { require( isValid( proof, raffle.root, keccak256(abi.encodePacked(msg.sender)) ), "Not part of Whitelist" ); } require( _numberEntries > 0 && _numberEntries <= raffle.maxEntriesUser, "Number entries can't be 0 or more than max entries per user." ); require( _user != address(0) && _user != msg.sender, "Address cant't be null address / msg sender" ); require( raffle.entriesSold + _numberEntries <= raffles[_raffleId].entriesSupply, "Raffle has reached max entries" ); if (raffle.tokenPayment == address(0)) { require( msg.value == raffle.pricePerEntry * _numberEntries, "msg.value must be equal to the price" ); } else { IERC20(raffle.tokenPayment).transferFrom( msg.sender, address(this), raffle.pricePerEntry * _numberEntries ); } bytes32 hash = keccak256(abi.encode(msg.sender, _raffleId)); require( entriesInfo[hash] + _numberEntries <= raffle.maxEntriesUser, "Max entries user reached." ); entriesInfo[hash] += _numberEntries; EntriesBought memory entryBought = EntriesBought({ player: _user, currentEntriesLength: uint256(raffle.entriesSold + _numberEntries), entries: _numberEntries }); entriesList[_raffleId].push(entryBought); raffle.entriesSold += _numberEntries; emit EntryGifted( _raffleId, msg.sender, _user, raffle.entriesSold, _numberEntries ); } function buyEntry( uint256 _raffleId, uint256 _numberEntries, bytes32[] memory proof ) external payable { RaffleStruct storage raffle = raffles[_raffleId]; require(raffle.endTime > getCurrentTime(), "Raffle Closed on time"); require(raffle.status == STATUS.CREATED, "Raffle is not in CREATED"); require( _numberEntries > 0 && _numberEntries <= raffle.maxEntriesUser, "Number entries can't be 0 or more than max entries per user." ); require(msg.sender != address(0), "Address cant't be null address"); require( raffle.entriesSold + _numberEntries <= raffles[_raffleId].entriesSupply, "Raffle has reached max entries" ); if (raffle.root != bytes32(0)) { require( isValid( proof, raffle.root, keccak256(abi.encodePacked(msg.sender)) ), "Not part of the Whitelist" ); } if (raffle.tokenPayment == address(0)) { require( msg.value == raffle.pricePerEntry * _numberEntries, "msg.value must be equal to the price" ); } else { IERC20(raffle.tokenPayment).transferFrom( msg.sender, address(this), raffle.pricePerEntry * _numberEntries ); } bytes32 hash = keccak256(abi.encode(msg.sender, _raffleId)); require( entriesInfo[hash] + _numberEntries <= raffle.maxEntriesUser, "Max entries user reached." ); entriesInfo[hash] += _numberEntries; EntriesBought memory entryBought = EntriesBought({ player: msg.sender, currentEntriesLength: uint256(raffle.entriesSold + _numberEntries), entries: _numberEntries }); entriesList[_raffleId].push(entryBought); raffle.entriesSold += _numberEntries; emit EntryBought( _raffleId, msg.sender, raffle.entriesSold, _numberEntries ); } function getCurrentTime() public view returns (uint256) { return block.timestamp; } function getSubscription() external payable { require( msg.value == SUBSCRIPTION_PRICE, "msg.value must be equal to the price" ); platformWallet.transfer(msg.value); emit GotSubscription(msg.sender); } function ChangeCancellationFeeBase(uint256 _fee) external onlyRole(OPERATOR_ROLE, msg.sender) { CANCELATION_RAFFLE_FEE_BASE = _fee; } function ChangeSubscriptionId(uint64 _id) external onlyRole(OPERATOR_ROLE, msg.sender) { subscriptionId = _id; } function ChangecallbackGasLimit(uint32 _number) external onlyRole(OPERATOR_ROLE, msg.sender) { callbackGasLimit = _number; } function ChangeKeyHash(bytes32 _hash) external onlyRole(OPERATOR_ROLE, msg.sender) { keyHash = _hash; } function setNumberRafflesCollectionWhitelistedPerMonth( address[] memory _collection, uint256[] memory _rafflesnumber ) external onlyRole(OPERATOR_ROLE, msg.sender) { require( _collection.length == _rafflesnumber.length, "Require same length" ); for (uint256 i = 0; i < _collection.length; i++) { numberRafflesMonthCollection[_collection[i]] = _rafflesnumber[i]; emit CollectionWhitelisted(_collection[i], _rafflesnumber[i]); } } function numberRafflesRemainingPerNFT( address _collectionaddress, uint256 _tokenid ) public view returns (uint256) { uint256 numberRafflesNFT = 0; if (numberRafflesMonthCollection[_collectionaddress] > 0) { bytes32 hashNFT = keccak256( abi.encode(_collectionaddress, _tokenid) ); numberRafflesNFT = numberRafflesMonthCollection[_collectionaddress] - raffleCreationData[hashNFT].countRaffles; } return numberRafflesNFT; } function changePlatformWalletAddress(address payable _address) external onlyOwner { platformWallet = _address; } function getEntriesBought(uint256 _raffleId) public view returns (EntriesBought[] memory) { return entriesList[_raffleId]; } function addTokenPayment(address _address, bool _isAdded) external onlyRole(OPERATOR_ROLE, msg.sender) { TokenPaymentAddresses[_address] = _isAdded; if (_isAdded == true) { emit AddedTokenPayment(_address); } } function addDiscountTokenPayment(address _address, bool _isAdded) external onlyRole(OPERATOR_ROLE, msg.sender) { DiscountTokenPayments[_address] = _isAdded; } function toggleCreateHoldersEnabled() external onlyRole(OPERATOR_ROLE, msg.sender) { createEnabledHolders = !createEnabledHolders; } function toggleCreateSubscribersEnabled() external onlyRole(OPERATOR_ROLE, msg.sender) { createEnabledSubscribers = !createEnabledSubscribers; } function getWinnerAddressFromRandom( uint256 _raffleId, uint256 _normalizedRandomNumber ) public view returns (address) { address winner; EntriesBought[] storage entries = entriesList[_raffleId]; for (uint256 i = 0; i < entries.length; i++) { uint256 entriesIndex = entries[i].currentEntriesLength; if (entriesIndex >= _normalizedRandomNumber) { winner = entries[i].player; break; } } require(winner != address(0), "Winner not found"); return winner; } function safeMultipleTransfersFrom( address from, address to, address[] memory nftAddresses, uint256[] memory nftIds, uint256[] memory nftAmounts ) internal virtual { for (uint256 i = 0; i < nftIds.length; i++) { safeTransferFrom( from, to, nftAddresses[i], nftIds[i], nftAmounts[i], "" ); } } function safeTransferFrom( address from, address to, address tokenAddress, uint256 tokenId, uint256 tokenAmount, bytes memory _data ) internal virtual { if (tokenAmount == 0) { IERC721(tokenAddress).safeTransferFrom(from, to, tokenId, _data); } else { IERC1155(tokenAddress).safeTransferFrom( from, to, tokenId, tokenAmount, _data ); } } function requestRandomWords(uint256 _id, uint256 _entriesSold) internal returns (uint256 requestId) { requestId = COORDINATOR.requestRandomWords( keyHash, subscriptionId, requestConfirmations, callbackGasLimit, numWords ); chainlinkRaffleInfo[requestId] = RaffleInfo({ id: _id, size: _entriesSold }); RaffleStruct storage raffle = raffles[_id]; raffle.status = STATUS.DRAWING; emit RequestSent(requestId, numWords); return requestId; } function requestRandomWordsRetry(uint256 _id) external onlyRole(OPERATOR_ROLE, msg.sender) returns (uint256 requestId) { RaffleStruct storage raffle = raffles[_id]; requestId = COORDINATOR.requestRandomWords( keyHash, subscriptionId, requestConfirmations, callbackGasLimit, numWords ); chainlinkRaffleInfo[requestId] = RaffleInfo({ id: _id, size: raffle.entriesSold }); raffle.status = STATUS.DRAWING; emit RequestSent(requestId, numWords); return requestId; } function transferNFTsAndFunds( uint256 _raffleId, uint256 _normalizedRandomNumber ) internal nonReentrant { RaffleStruct storage raffle = raffles[_raffleId]; // require(raffle.status == STATUS.DRAWING, "Raffle in wrong status"); raffle.randomNumber = _normalizedRandomNumber; raffle.winner = (raffle.entriesSold == 0) ? raffle.creator : getWinnerAddressFromRandom(_raffleId, _normalizedRandomNumber); safeMultipleTransfersFrom( address(this), raffle.winner, raffle.collateralAddress, raffle.collateralId, raffle.tokenAmount ); uint256 amountRaised = raffle.entriesSold * raffle.pricePerEntry; uint256 amountForPlatform = (amountRaised * raffle.platformPercentage) / 10000; uint256 amountForSeller = amountRaised - amountForPlatform; if (raffle.tokenPayment == address(0)) { (bool sent, ) = raffle.creator.call{value: amountForSeller}(""); require(sent, "Failed to send Eth"); (bool sent2, ) = platformWallet.call{value: amountForPlatform}(""); require(sent2, "Failed send Eth to Platform"); } else { IERC20(raffle.tokenPayment).approve(address(this), amountRaised); bool sent = IERC20(raffle.tokenPayment).transferFrom( address(this), raffle.creator, amountForSeller ); require(sent, "Failed to send ERC20 Token"); bool sent2 = IERC20(raffle.tokenPayment).transferFrom( address(this), platformWallet, amountForPlatform ); require(sent2, "Failed to send ERC20 Token to platform"); } raffle.status = STATUS.DRAWN; emit RaffleDrawn( _raffleId, raffle.winner, amountRaised, raffle.randomNumber ); } function fulfillRandomWords( uint256 _requestId, uint256[] memory _randomWords ) internal override { uint256 normalizedRandomNumber = (_randomWords[0] % chainlinkRaffleInfo[_requestId].size) + 1; RaffleStruct storage raffle = raffles[ chainlinkRaffleInfo[_requestId].id ]; raffle.randomNumber = normalizedRandomNumber; RandomResult memory result = RandomResult({ randomNumber: _randomWords[0], nomalizedRandomNumber: normalizedRandomNumber }); requests[chainlinkRaffleInfo[_requestId].id] = result; emit RequestFulfilled( _requestId, normalizedRandomNumber, chainlinkRaffleInfo[_requestId].id ); transferNFTsAndFunds( chainlinkRaffleInfo[_requestId].id, normalizedRandomNumber ); } function setWinnerRaffle(uint256 _raffleId) external nonReentrant { RaffleStruct storage raffle = raffles[_raffleId]; require( raffle.creator == msg.sender || hasRole(OPERATOR_ROLE, msg.sender), "Not raffle creator or operator." ); if (hasRole(OPERATOR_ROLE, msg.sender)) { require( raffle.entriesSold == raffle.entriesSupply || raffle.endTime <= getCurrentTime(), "Raffle still opened or not sold out" ); } require(raffle.status == STATUS.CREATED, "Raffle in wrong status"); raffle.status = STATUS.PENDING_DRAW; uint256 entriesSold = raffle.entriesSold; uint256 amountRaised = entriesSold * raffle.pricePerEntry; if (entriesSold == 0) { raffle.status = STATUS.DRAWING; transferNFTsAndFunds(_raffleId, raffle.randomNumber); } else { requestRandomWords(_raffleId, entriesSold); } emit SetWinnerTriggered(_raffleId, amountRaised); } function setWinnerRaffleEmergency(uint256 _raffleId) external onlyRole(OPERATOR_ROLE, msg.sender) { RaffleStruct storage raffle = raffles[_raffleId]; if (raffle.creator != msg.sender) { require( raffle.entriesSold == raffle.entriesSupply || raffle.endTime <= getCurrentTime(), "Raffle still opened or not sold out" ); } uint256 entriesSold = raffle.entriesSold; bytes32 baseHash = keccak256( abi.encodePacked( block.number, block.timestamp, block.gaslimit, block.coinbase ) ); uint256 normalizedRandomNumber = (uint256(baseHash) % entriesSold) + 1; raffle.randomNumber = normalizedRandomNumber; transferNFTsAndFunds(_raffleId, normalizedRandomNumber); } function cancelRaffle(uint256 _raffleId) external payable nonReentrant { RaffleStruct storage raffle = raffles[_raffleId]; require( raffle.creator == msg.sender || hasRole(OPERATOR_ROLE, msg.sender), "Not raffle creator or Operator." ); require( raffle.endTime > getCurrentTime(), "End time can't be < as current time." ); require(raffle.status == STATUS.CREATED, "Wrong status"); if (!hasRole(OPERATOR_ROLE, msg.sender)) { require(raffle.canCancel, "User Can't cancel"); if (raffle.entriesSold == 0) { require(msg.value == 0, "Not cancelation fee value."); } else { require( msg.value >= CANCELATION_RAFFLE_FEE_BASE, "Not cancelation fee value." ); platformWallet.transfer(CANCELATION_RAFFLE_FEE_BASE); } } uint256 txLength = entriesList[_raffleId].length; require( txLength <= 200, "Not cancelation available when it's more than 200 txs." ); uint256 amountRaised = raffle.entriesSold * raffle.pricePerEntry; if (raffle.tokenPayment == address(0)) { for (uint256 i = 0; i < txLength; i++) { address user = entriesList[_raffleId][i].player; if (user != address(0)) { uint256 amountToSend = raffle.pricePerEntry * entriesList[_raffleId][i].entries; payable(user).transfer(amountToSend); } } } else { IERC20(raffle.tokenPayment).approve(address(this), amountRaised); for (uint256 i = 0; i < txLength; i++) { address user = entriesList[_raffleId][i].player; if (user != address(0)) { uint256 amountToSend = raffle.pricePerEntry * entriesList[_raffleId][i].entries; IERC20(raffle.tokenPayment).transferFrom( address(this), user, amountToSend ); } } } safeMultipleTransfersFrom( address(this), raffle.creator, raffle.collateralAddress, raffle.collateralId, raffle.tokenAmount ); raffle.status = STATUS.CANCELLED; emit RaffleCancelled(_raffleId, amountRaised); } function setRaffleToNotCancel(uint256 _raffleId) external nonReentrant { RaffleStruct storage raffle = raffles[_raffleId]; require(raffle.creator == msg.sender, "Not raffle creator."); if (raffle.canCancel == true) { raffle.canCancel = false; emit RaffleSetNotToCancel(_raffleId, msg.sender); } } function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].members[account]; } function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } function grantRole(bytes32 role, address account) public virtual onlyRole(OPERATOR_ROLE, msg.sender) { _grantRole(role, account); } function revokeRole(bytes32 role, address account) public virtual onlyRole(OPERATOR_ROLE, msg.sender) { _revokeRole(role, account); } function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; } } function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; } } function isValid( bytes32[] memory proof, bytes32 root, bytes32 leaf ) public view virtual returns (bool) { return MerkleProof.verify(proof, root, leaf); } function changeRootRaffle(uint256 _raffleId, bytes32 _root) external nonReentrant { RaffleStruct storage raffle = raffles[_raffleId]; require(raffle.creator == msg.sender, "Not raffle creator."); raffle.root = _root; emit RaffleRootChanged(_raffleId, _root); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. It ensures 2 things: * @dev 1. The fulfillment came from the VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash). Create subscription, fund it * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface * @dev subscription management functions). * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations, * @dev callbackGasLimit, numWords), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomWords method. * * @dev The randomness argument to fulfillRandomWords is a set of random words * @dev generated from your requestId and the blockHash of the request. * * @dev If your contract could have concurrent requests open, you can use the * @dev requestId returned from requestRandomWords to track which response is associated * @dev with which randomness request. * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously. * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. It is for this reason that * @dev that you can signal to an oracle you'd like them to wait longer before * @dev responding to the request (however this is not enforced in the contract * @dev and so remains effective only in the case of unmodified oracle software). */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _vrfCoordinator; } /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests * @return minimumRequestConfirmations global min for request confirmations * @return maxGasLimit global max for request gas limit * @return s_provingKeyHashes list of registered key hashes */ function getRequestConfig() external view returns ( uint16, uint32, bytes32[] memory ); /** * @notice Request a set of random words. * @param keyHash - Corresponds to a particular oracle job which uses * that key for generating the VRF proof. Different keyHash's have different gas price * ceilings, so you can select a specific one to bound your maximum per request cost. * @param subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. * @param minimumRequestConfirmations - How many blocks you'd like the * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS * for why you may want to request more. The acceptable range is * [minimumRequestBlockConfirmations, 200]. * @param callbackGasLimit - How much gas you'd like to receive in your * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords * may be slightly less than this amount because of gas used calling the function * (argument decoding etc.), so you may need to request slightly more than you expect * to have inside fulfillRandomWords. The acceptable range is * [0, maxGasLimit] * @param numWords - The number of uint256 random values you'd like to receive * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ function requestRandomWords( bytes32 keyHash, uint64 subId, uint16 minimumRequestConfirmations, uint32 callbackGasLimit, uint32 numWords ) external returns (uint256 requestId); /** * @notice Create a VRF subscription. * @return subId - A unique subscription id. * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer. * @dev Note to fund the subscription, use transferAndCall. For example * @dev LINKTOKEN.transferAndCall( * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); */ function createSubscription() external returns (uint64 subId); /** * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. * @return reqCount - number of requests for this subscription, determines fee tier. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. */ function getSubscription(uint64 subId) external view returns ( uint96 balance, uint64 reqCount, address owner, address[] memory consumers ); /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @param newOwner - proposed new owner of the subscription */ function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external; /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @dev will revert if original owner of subId has * not requested that msg.sender become the new owner. */ function acceptSubscriptionOwnerTransfer(uint64 subId) external; /** * @notice Add a consumer to a VRF subscription. * @param subId - ID of the subscription * @param consumer - New consumer which can use the subscription */ function addConsumer(uint64 subId, address consumer) external; /** * @notice Remove a consumer from a VRF subscription. * @param subId - ID of the subscription * @param consumer - Consumer to remove from the subscription */ function removeConsumer(uint64 subId, address consumer) external; /** * @notice Cancel a subscription * @param subId - ID of the subscription * @param to - Where to send the remaining LINK to */ function cancelSubscription(uint64 subId, address to) external; /* * @notice Check to see if there exists a request commitment consumers * for all consumers and keyhashes for a given sub. * @param subId - ID of the subscription * @return true if there exists at least one unfulfilled request for the subscription, false * otherwise. */ function pendingRequestExists(uint64 subId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); function decimals() external view returns (uint8 decimalPlaces); function decreaseApproval(address spender, uint256 addedValue) external returns (bool success); function increaseApproval(address spender, uint256 subtractedValue) external; function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function totalSupply() external view returns (uint256 totalTokensIssued); function transfer(address to, uint256 value) external returns (bool success); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns (bool success); function transferFrom( address from, address to, uint256 value ) external returns (bool success); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // 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 v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * 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 caller. * * 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 v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AddedTokenPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"_rafflesnumber","type":"uint256"}],"name":"CollectionWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"currentSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberEntries","type":"uint256"}],"name":"EntryBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"gifter","type":"address"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"currentSize","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numberEntries","type":"uint256"}],"name":"EntryGifted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"GotSubscription","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":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"}],"name":"RaffleCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"RaffleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"}],"name":"RaffleDrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"root","type":"bytes32"}],"name":"RaffleRootChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"}],"name":"RaffleSetNotToCancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"randomNumber","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"}],"name":"RequestFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"numWords","type":"uint32"}],"name":"RequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"raffleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountRaised","type":"uint256"}],"name":"SetWinnerTriggered","type":"event"},{"inputs":[],"name":"CANCELATION_RAFFLE_FEE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHAINLINK_RAFFLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_HOLDERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_HOLDERS_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_SUBSCRIBERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"COMMISSION_SUBSCRIBERS_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"ChangeCancellationFeeBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"ChangeKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_id","type":"uint64"}],"name":"ChangeSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_number","type":"uint32"}],"name":"ChangecallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"DiscountTokenPayments","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOLDER_CREATE_RAFFLE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HOLDER_CREATE_RAFFLE_FEE_DISCOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUBSCRIPTION_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TokenPaymentAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isAdded","type":"bool"}],"name":"addDiscountTokenPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bool","name":"_isAdded","type":"bool"}],"name":"addTokenPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_numberEntries","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"buyEntry","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"cancelRaffle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"chainlinkRaffleInfo","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"_address","type":"address"}],"name":"changePlatformWalletAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"changeRootRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createEnabledHolders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createEnabledSubscribers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"createRaffleCollection","type":"address"},{"internalType":"uint256","name":"createRaffleTokenId","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesUser","type":"uint256"}],"name":"createRaffleHolder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesUser","type":"uint256"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"createRaffleOperator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"address[]","name":"_collateralAddress","type":"address[]"},{"internalType":"uint256[]","name":"_collateralId","type":"uint256[]"},{"internalType":"uint256[]","name":"_tokenAmount","type":"uint256[]"},{"internalType":"address","name":"_tokenPayment","type":"address"},{"internalType":"uint256","name":"_pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesRaffle","type":"uint256"},{"internalType":"uint256","name":"_maxEntriesUser","type":"uint256"},{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"createRaffleSubscriber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"entriesInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"entriesList","outputs":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"uint256","name":"entries","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"getEntriesBought","outputs":[{"components":[{"internalType":"address","name":"player","type":"address"},{"internalType":"uint256","name":"currentEntriesLength","type":"uint256"},{"internalType":"uint256","name":"entries","type":"uint256"}],"internalType":"struct RafldexV2_5.EntriesBought[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubscription","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_normalizedRandomNumber","type":"uint256"}],"name":"getWinnerAddressFromRandom","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"},{"internalType":"uint256","name":"_numberEntries","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"giftEntry","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"bytes32","name":"root","type":"bytes32"},{"internalType":"bytes32","name":"leaf","type":"bytes32"}],"name":"isValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numberRafflesMonthCollection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collectionaddress","type":"address"},{"internalType":"uint256","name":"_tokenid","type":"uint256"}],"name":"numberRafflesRemainingPerNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","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":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"raffleCreationData","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"countRaffles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"raffles","outputs":[{"internalType":"enum RafldexV2_5.STATUS","name":"status","type":"uint8"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"entriesSupply","type":"uint256"},{"internalType":"uint256","name":"pricePerEntry","type":"uint256"},{"internalType":"uint256","name":"maxEntriesUser","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"platformPercentage","type":"uint256"},{"internalType":"address","name":"tokenPayment","type":"address"},{"internalType":"uint256","name":"entriesSold","type":"uint256"},{"internalType":"bool","name":"canCancel","type":"bool"},{"internalType":"bytes32","name":"root","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"requestRandomWordsRetry","outputs":[{"internalType":"uint256","name":"requestId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"requests","outputs":[{"internalType":"uint256","name":"randomNumber","type":"uint256"},{"internalType":"uint256","name":"nomalizedRandomNumber","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_collection","type":"address[]"},{"internalType":"uint256[]","name":"_rafflesnumber","type":"uint256[]"}],"name":"setNumberRafflesCollectionWhitelistedPerMonth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setRaffleToNotCancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setWinnerRaffle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"setWinnerRaffleEmergency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleCreateHoldersEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleCreateSubscribersEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040527f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef600455600580546001600160901b0319166b032a00000001002625a00003179055600d8054732300ae69d7d1ea0457ad79e822422888e3ee3e876001600160a01b031990911617905566354a6ba7a18000600e5566470de4df820000600f55662386f26fc100006010555f6011556706f05b59d3b200006012556101f460135561015e60145561012c60155560966016556019805461ffff1916610101179055348015620000d1575f80fd5b5073271682deb8c4e0901d1a1550ad2e64d568e69909620000f23362000188565b600180556001600160a01b0316608052600280546001600160a01b031990811673271682deb8c4e0901d1a1550ad2e64d568e69909179091556003805490911673514910771af9ca656af840dff83e8264ecf986ca179055620001767f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c33620001d7565b620001825f33620001d7565b62000241565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001e38282620001e7565b5050565b5f828152601a602090815260408083206001600160a01b038516845290915290205460ff16620001e3575f828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b608051615ea1620002615f395f8181610cb50152610cf70152615ea15ff3fe608060405260043610610387575f3560e01c80638354a49c116101d3578063cf482ee9116100fd578063e096839b1161009d578063f36914551161006d578063f369145514610aeb578063f5b541a614610b0a578063f860cec514610b2a578063ff0b906c14610b3e575f80fd5b8063e096839b14610a79578063ebb4c01014610a8e578063f23a6e6114610aa1578063f2fde38b14610acc575f80fd5b8063d3c4d664116100d8578063d3c4d66414610a11578063d547741f14610a26578063d703ece814610a45578063dadc9b4014610a5a575f80fd5b8063cf482ee9146109b3578063cf7874a3146109c6578063d0038ff4146109f8575f80fd5b806391d1485411610173578063aaced47011610143578063aaced47014610934578063bc0618c31461095f578063bc197c8114610974578063cb77c1471461099f575f80fd5b806391d14854146108ce5780639dde45da146108ed578063a217fddf1461090c578063a79bdca41461091f575f80fd5b806388ec392c116101ae57806388ec392c146108415780638da5cb5b146108605780638dfc13b614610890578063903c6db6146108af575f80fd5b80638354a49c146107e5578063888a56371461080457806388aaf2a914610823575f80fd5b80634944a480116102b457806369f26fb011610254578063715018a611610224578063715018a614610758578063719c0a131461076c57806375e4d3fd1461078b57806381d12c581461079e575f80fd5b806369f26fb0146106e15780636a890cb2146107005780636bf3f8f6146107155780636fd9690314610743575f80fd5b8063581343c41161028f578063581343c4146106645780635d4bc0ce146106835780635fba3171146106bb578063622b291c146106ce575f80fd5b80634944a480146106055780634c86bca11461062457806353e53a8714610639575f80fd5b806327c7807b1161032a5780632f2ff15d116102fa5780632f2ff15d14610546578063365e3658146105655780634169933f1461059157806346988a40146105e6575f80fd5b806327c7807b146104d357806329cb924d1461050057806329dd67f9146105125780632bb022b714610531575f80fd5b8063150b7a0211610365578063150b7a02146104245780631fe543e31461046757806320c741b31461048657806321f4bd61146104a5575f80fd5b8063013805c51461038b57806301ffc9a7146103d45780630f5e812e14610403575b5f80fd5b348015610396575f80fd5b506103aa6103a5366004614fa7565b610b46565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b3480156103df575f80fd5b506103f36103ee366004614fc7565b610b8e565b60405190151581526020016103cb565b34801561040e575f80fd5b5061042261041d366004614fee565b610bc4565b005b34801561042f575f80fd5b5061044e61043e3660046150d8565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103cb565b348015610472575f80fd5b506104226104813660046151cd565b610caa565b348015610491575f80fd5b506104226104a036600461521d565b610d32565b3480156104b0575f80fd5b506103f36104bf366004615254565b60176020525f908152604090205460ff1681565b3480156104de575f80fd5b506104f26104ed3660046152d4565b610d77565b6040519081526020016103cb565b34801561050b575f80fd5b50426104f2565b34801561051d575f80fd5b5061042261052c366004614fee565b6113f4565b34801561053c575f80fd5b506104f260115481565b348015610551575f80fd5b50610422610560366004615392565b611414565b348015610570575f80fd5b5061058461057f366004614fee565b61143d565b6040516103cb91906153b5565b34801561059c575f80fd5b506105cb6105ab366004614fee565b600a6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103cb565b3480156105f1575f80fd5b506104f2610600366004615416565b6114ce565b348015610610575f80fd5b5061042261061f366004615440565b611556565b34801561062f575f80fd5b506104f2600f5481565b348015610644575f80fd5b506104f2610653366004614fee565b600c6020525f908152604090205481565b34801561066f575f80fd5b5061042261067e366004614fee565b611695565b34801561068e575f80fd5b506106a261069d366004614fee565b61179c565b6040516103cb9d9c9b9a999897969594939291906154a9565b6104226106c9366004614fee565b61182a565b6104f26106dc3660046152d4565b611efa565b3480156106ec575f80fd5b506104226106fb366004615254565b612623565b34801561070b575f80fd5b506104f260125481565b348015610720575f80fd5b506103f361072f366004615254565b60186020525f908152604090205460ff1681565b34801561074e575f80fd5b506104f260155481565b348015610763575f80fd5b5061042261264d565b348015610777575f80fd5b506104f2610786366004614fee565b612660565b610422610799366004615561565b6127e5565b3480156107a9575f80fd5b506107d06107b8366004614fee565b60066020525f90815260409020805460019091015482565b604080519283526020830191909152016103cb565b3480156107f0575f80fd5b506104226107ff366004614fee565b612cc8565b34801561080f575f80fd5b5061042261081e366004614fa7565b612ce8565b34801561082e575f80fd5b506019546103f390610100900460ff1681565b34801561084c575f80fd5b5061042261085b366004614fee565b612daf565b34801561086b575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020016103cb565b34801561089b575f80fd5b506104226108aa3660046155ac565b612f8e565b3480156108ba575f80fd5b506103f36108c93660046155cf565b612fcd565b3480156108d9575f80fd5b506103f36108e8366004615392565b612fe1565b3480156108f8575f80fd5b50610422610907366004615618565b61300b565b348015610917575f80fd5b506104f25f81565b34801561092a575f80fd5b506104f2600e5481565b34801561093f575f80fd5b506104f261094e366004615254565b600b6020525f908152604090205481565b34801561096a575f80fd5b506104f260145481565b34801561097f575f80fd5b5061044e61098e36600461563e565b63bc197c8160e01b95945050505050565b3480156109aa575f80fd5b50610422613053565b6104f26109c13660046156e4565b61308b565b3480156109d1575f80fd5b506107d06109e0366004614fee565b60076020525f90815260409020805460019091015482565b348015610a03575f80fd5b506019546103f39060ff1681565b348015610a1c575f80fd5b506104f260135481565b348015610a31575f80fd5b50610422610a40366004615392565b6139c3565b348015610a50575f80fd5b506104f260165481565b348015610a65575f80fd5b50610422610a7436600461521d565b6139e6565b348015610a84575f80fd5b506104f260105481565b610422610a9c3660046157b6565b613a6e565b348015610aac575f80fd5b5061044e610abb366004615808565b63f23a6e6160e01b95945050505050565b348015610ad7575f80fd5b50610422610ae6366004615254565b613f72565b348015610af6575f80fd5b50610878610b05366004614fa7565b613fe8565b348015610b15575f80fd5b506104f25f80516020615e4c83398151915281565b348015610b35575f80fd5b506104226140bd565b6104226140ec565b6008602052815f5260405f208181548110610b5f575f80fd5b5f9182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b5f6001600160e01b03198216630271189760e51b1480610bbe57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610bcc614179565b5f60098281548110610be057610be061586b565b5f9182526020909120600a601090920201908101549091506001600160a01b03163314610c4a5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b60448201526064015b60405180910390fd5b600e81015460ff161515600103610c9d57600e8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b50610ca760018055565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610d245760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610c41565b610d2e82826141d2565b5050565b5f80516020615e4c83398151915233610d4b8282614301565b50506001600160a01b03919091165f908152601860205260409020805460ff1916911515919091179055565b5f5f80516020615e4c83398151915233610d918282614301565b428c11610db05760405162461bcd60e51b8152600401610c419061587f565b89518b5114610e105760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c41565b88518b5114610e315760405162461bcd60e51b8152600401610c41906158c3565b5f8611610e505760405162461bcd60e51b8152600401610c4190615913565b5f85118015610e5f5750858511155b610e7b5760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b03881615610ec1576001600160a01b0388165f9081526017602052604090205460ff16610ec15760405162461bcd60e51b8152600401610c4190615985565b5f5b8b518110156110f3575f6001600160a01b03168c8281518110610ee857610ee861586b565b60200260200101516001600160a01b031603610f165760405162461bcd60e51b8152600401610c41906159bc565b898181518110610f2857610f2861586b565b60200260200101515f0361100f575f8c8281518110610f4957610f4961586b565b60200260200101519050806001600160a01b0316636352211e8d8481518110610f7457610f7461586b565b60200260200101516040518263ffffffff1660e01b8152600401610f9a91815260200190565b602060405180830381865afa158015610fb5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fd991906159e1565b6001600160a01b0316336001600160a01b0316146110095760405162461bcd60e51b8152600401610c41906159fc565b506110eb565b5f8c82815181106110225761102261586b565b602002602001015190508a828151811061103e5761103e61586b565b6020026020010151816001600160a01b031662fdd58e338f86815181106110675761106761586b565b60200260200101516040518363ffffffff1660e01b815260040161108c929190615a31565b602060405180830381865afa1580156110a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110cb9190615a4a565b10156110e95760405162461bcd60e51b8152600401610c4190615a61565b505b600101610ec3565b505f61110233308e8e8e61435a565b6040805161020081019091525f90808281526020018f81526020018e81526020018d81526020018c81526020018981526020018a81526020018881526020015f6001600160a01b031681526020015f8152602001336001600160a01b031681526020018381526020018b6001600160a01b031681526020015f8152602001600115158152602001878152509050600981908060018154018082558091505060019003905f5260205f2090601002015f909190919091505f820151815f015f6101000a81548160ff021916908360048111156111df576111df615495565b02179055506020828101516001830155604083015180516112069260028501920190614ef7565b5060608201518051611222916003840191602090910190614f5a565b506080820151805161123e916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f9061130c90600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926113905761139061586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509e9d5050505050505050505050505050565b5f80516020615e4c8339815191523361140d8282614301565b5050600455565b5f80516020615e4c8339815191523361142d8282614301565b61143784846143dc565b50505050565b606060085f8381526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b828210156114c3575f848152602090819020604080516060810182526003860290920180546001600160a01b031683526001808201548486015260029091015491830191909152908352909201910161146f565b505050509050919050565b6001600160a01b0382165f908152600b602052604081205481901561154f575f8484604051602001611501929190615a31565b60408051601f1981840301815291815281516020928301205f818152600a8452828120600201546001600160a01b038a168252600b909452919091205490925061154b9190615aac565b9150505b9392505050565b5f80516020615e4c8339815191523361156f8282614301565b82518451146115b65760405162461bcd60e51b81526020600482015260136024820152720a4cae2ead2e4ca40e6c2daca40d8cadccee8d606b1b6044820152606401610c41565b5f5b845181101561168e578381815181106115d3576115d361586b565b6020026020010151600b5f8784815181106115f0576115f061586b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f20819055507fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d85828151811061164e5761164e61586b565b60200260200101518583815181106116685761166861586b565b602002602001015160405161167e929190615a31565b60405180910390a16001016115b8565b5050505050565b5f80516020615e4c833981519152336116ae8282614301565b5f600984815481106116c2576116c261586b565b5f9182526020909120600a601090920201908101549091506001600160a01b0316331461171f57806005015481600d01541480611703575042816001015411155b61171f5760405162461bcd60e51b8152600401610c4190615abf565b600d810154604080514360208083019190915242828401524560608084019190915241901b6001600160601b031916608083015282518083036074018152609490920190925280519101205f6117758383615b16565b611780906001615b29565b600985018190559050611793878261441a565b50505050505050565b600981815481106117ab575f80fd5b5f91825260209091206010909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e8c0154600f909c015460ff9b8c169d50999b989a979996986001600160a01b0396871698959794871696939592909316939092909116908d565b611832614179565b5f600982815481106118465761184661586b565b5f9182526020909120600a601090920201908101549091506001600160a01b031633148061188657506118865f80516020615e4c83398151915233612fe1565b6118d25760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c41565b428160010154116118f55760405162461bcd60e51b8152600401610c419061587f565b5f815460ff16600481111561190c5761190c615495565b146119485760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c41565b61195f5f80516020615e4c83398151915233612fe1565b611a9657600e81015460ff166119ab5760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c41565b80600d01545f03611a09573415611a045760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c41565b611a96565b601154341015611a5b5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c41565b600d546011546040516001600160a01b039092169181156108fc0291905f818181858888f19350505050158015611a94573d5f803e3d5ffd5b505b5f8281526008602052604090205460c8811115611b145760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610c41565b5f826006015483600d0154611b299190615b3c565b600c8401549091506001600160a01b0316611c0e575f5b82811015611c08575f858152600860205260408120805483908110611b6757611b6761586b565b5f9182526020909120600390910201546001600160a01b031690508015611bff575f868152600860205260408120805484908110611ba757611ba761586b565b905f5260205f209060030201600201548660060154611bc69190615b3c565b6040519091506001600160a01b0383169082156108fc029083905f818181858888f19350505050158015611bfc573d5f803e3d5ffd5b50505b50600101611b40565b50611d90565b600c83015460405163095ea7b360e01b81526001600160a01b039091169063095ea7b390611c429030908590600401615a31565b6020604051808303815f875af1158015611c5e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c829190615b53565b505f5b82811015611d8e575f858152600860205260408120805483908110611cac57611cac61586b565b5f9182526020909120600390910201546001600160a01b031690508015611d85575f868152600860205260408120805484908110611cec57611cec61586b565b905f5260205f209060030201600201548660060154611d0b9190615b3c565b600c8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611d4290309086908690600401615b6e565b6020604051808303815f875af1158015611d5e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d829190615b53565b50505b50600101611c85565b505b611ead3084600a015f9054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611e0157602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611de3575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611e5257602002820191905f5260205f20905b815481526020019060010190808311611e3e575b505050505087600401805480602002602001604051908101604052809291908181526020018280548015611ea357602002820191905f5260205f20905b815481526020019060010190808311611e8f575b505050505061435a565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a2505050610ca760018055565b5f611f03614179565b601954610100900460ff16611f6a5760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c41565b428a11611f895760405162461bcd60e51b8152600401610c419061587f565b8751895114611faa5760405162461bcd60e51b8152600401610c4190615b92565b8651895114611fcb5760405162461bcd60e51b8152600401610c41906158c3565b600e54341015611fed5760405162461bcd60e51b8152600401610c4190615be7565b5f841161200c5760405162461bcd60e51b8152600401610c4190615913565b5f8311801561201b5750838311155b6120375760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b0386161561207d576001600160a01b0386165f9081526017602052604090205460ff1661207d5760405162461bcd60e51b8152600401610c4190615985565b5f5b89518110156122af575f6001600160a01b03168a82815181106120a4576120a461586b565b60200260200101516001600160a01b0316036120d25760405162461bcd60e51b8152600401610c41906159bc565b8781815181106120e4576120e461586b565b60200260200101515f036121cb575f8a82815181106121055761210561586b565b60200260200101519050806001600160a01b0316636352211e8b84815181106121305761213061586b565b60200260200101516040518263ffffffff1660e01b815260040161215691815260200190565b602060405180830381865afa158015612171573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061219591906159e1565b6001600160a01b0316336001600160a01b0316146121c55760405162461bcd60e51b8152600401610c41906159fc565b506122a7565b5f8a82815181106121de576121de61586b565b602002602001015190508882815181106121fa576121fa61586b565b6020026020010151816001600160a01b031662fdd58e338d86815181106122235761222361586b565b60200260200101516040518363ffffffff1660e01b8152600401612248929190615a31565b602060405180830381865afa158015612263573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122879190615a4a565b10156122a55760405162461bcd60e51b8152600401610c4190615a61565b505b60010161207f565b506001600160a01b0386165f9081526018602052604081205460ff16156122d957506016546122de565b506015545b6122eb33308c8c8c61435a565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f19350505050158015612321573d5f803e3d5ffd5b506040805161020081019091525f9080828152602081018e9052604081018d9052606081018c9052608081018b905260a0810188905260c0810189905260e081018790525f610100820181905261012082018190523361014083015261016082018590526001600160a01b038b166101808301526101a0820181905260016101c083018190526101e09092018790526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561240657612406615495565b021790555060208281015160018301556040830151805161242d9260028501920190614ef7565b5060608201518051612449916003840191602090910190614f5a565b5060808201518051612465916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f9061253390600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926125b7576125b761586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509250505061261660018055565b9998505050505050505050565b61262b6149ba565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6126556149ba565b61265e5f614a13565b565b5f5f80516020615e4c8339815191523361267a8282614301565b5f6009858154811061268e5761268e61586b565b5f9182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601090930290910192506001600160a01b031690635d3b1d309060a4016020604051808303815f875af115801561272d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127519190615a4a565b604080518082018252878152600d84015460208083019182525f85815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b5f600984815481106127f9576127f961586b565b905f5260205f209060100201905061280e4290565b8160010154116128585760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c41565b5f815460ff16600481111561286f5761286f615495565b146128b75760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610c41565b5f831180156128ca575080600701548311155b6128e65760405162461bcd60e51b8152600401610c4190615c17565b336129335760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c41565b600984815481106129465761294661586b565b905f5260205f209060100201600501548382600d01546129669190615b29565b11156129b45760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c41565b600f81015415612a4a57600f8101546040516001600160601b03193360601b1660208201526129fe9184916034015b60405160208183030381529060405280519060200120612fcd565b612a4a5760405162461bcd60e51b815260206004820152601960248201527f4e6f742070617274206f66207468652057686974656c697374000000000000006044820152606401610c41565b600c8101546001600160a01b0316612a8f57828160060154612a6c9190615b3c565b3414612a8a5760405162461bcd60e51b8152600401610c4190615c74565b612b1a565b600c81015460068201546001600160a01b03909116906323b872dd9033903090612aba908890615b3c565b6040518463ffffffff1660e01b8152600401612ad893929190615b6e565b6020604051808303815f875af1158015612af4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b189190615b53565b505b5f3385604051602001612b2e929190615a31565b604051602081830303815290604052805190602001209050816007015484600c5f8481526020019081526020015f2054612b689190615b29565b1115612bb25760405162461bcd60e51b815260206004820152601960248201527826b0bc1032b73a3934b2b9903ab9b2b9103932b0b1b432b21760391b6044820152606401610c41565b5f818152600c602052604081208054869290612bcf908490615b29565b925050819055505f6040518060600160405280336001600160a01b031681526020018685600d0154612c019190615b29565b815260209081018790525f888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508792909190612c79908490615b29565b9091555050600d8301546040805191825260208201879052339188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b5f80516020615e4c83398151915233612ce18282614301565b5050601155565b612cf0614179565b5f60098381548110612d0457612d0461586b565b5f9182526020909120600a601090920201908101549091506001600160a01b03163314612d695760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c41565b600f810182905560405182815283907fbeffc53bea2d95fb8c844351c36ee8730739ced3171008941faeb629f9beb0599060200160405180910390a250610d2e60018055565b612db7614179565b5f60098281548110612dcb57612dcb61586b565b5f9182526020909120600a601090920201908101549091506001600160a01b0316331480612e0b5750612e0b5f80516020615e4c83398151915233612fe1565b612e575760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610c41565b612e6e5f80516020615e4c83398151915233612fe1565b15612ea957806005015481600d01541480612e8d575042816001015411155b612ea95760405162461bcd60e51b8152600401610c4190615abf565b5f815460ff166004811115612ec057612ec0615495565b14612f065760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c41565b805460ff19166001178155600d81015460068201545f90612f279083615b3c565b9050815f03612f5057825460ff191660021783556009830154612f4b90859061441a565b612f5c565b612f5a8483614a62565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611ee691815260200190565b5f80516020615e4c83398151915233612fa78282614301565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b5f612fd9848484614bcd565b949350505050565b5f918252601a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80516020615e4c833981519152336130248282614301565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b5f80516020615e4c8339815191523361306c8282614301565b50506019805461ff001981166101009182900460ff1615909102179055565b5f613094614179565b60195460ff166130f15760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c41565b4289116131105760405162461bcd60e51b8152600401610c419061587f565b86518851146131315760405162461bcd60e51b8152600401610c4190615b92565b85518851146131525760405162461bcd60e51b8152600401610c41906158c3565b5f83116131715760405162461bcd60e51b8152600401610c4190615913565b5f821180156131805750828211155b61319c5760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b038516156131e2576001600160a01b0385165f9081526017602052604090205460ff166131e25760405162461bcd60e51b8152600401610c4190615985565b5f5b8851811015613414575f6001600160a01b03168982815181106132095761320961586b565b60200260200101516001600160a01b0316036132375760405162461bcd60e51b8152600401610c41906159bc565b8681815181106132495761324961586b565b60200260200101515f03613330575f89828151811061326a5761326a61586b565b60200260200101519050806001600160a01b0316636352211e8a84815181106132955761329561586b565b60200260200101516040518263ffffffff1660e01b81526004016132bb91815260200190565b602060405180830381865afa1580156132d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132fa91906159e1565b6001600160a01b0316336001600160a01b03161461332a5760405162461bcd60e51b8152600401610c41906159fc565b5061340c565b5f8982815181106133435761334361586b565b6020026020010151905087828151811061335f5761335f61586b565b6020026020010151816001600160a01b031662fdd58e338c86815181106133885761338861586b565b60200260200101516040518363ffffffff1660e01b81526004016133ad929190615a31565b602060405180830381865afa1580156133c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133ec9190615a4a565b101561340a5760405162461bcd60e51b8152600401610c4190615a61565b505b6001016131e4565b506001600160a01b0385165f9081526018602052604081205460ff161561346d57600e546010546134459190615b29565b3410156134645760405162461bcd60e51b8152600401610c4190615be7565b506014546134a1565b600e54600f5461347d9190615b29565b34101561349c5760405162461bcd60e51b8152600401610c4190615be7565b506013545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156134e8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061350c91906159e1565b6001600160a01b0316146135625760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c41565b5f8d8d604051602001613576929190615a31565b6040516020818303038152906040528051906020012090506135954290565b5f828152600a60205260409020600101541115613643575f6135b78f8f6114ce565b1161361d5760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c41565b5f818152600a6020526040812060020180549161363983615cb8565b919050555061367b565b425f828152600a6020526040902055426136609062278d00615b29565b5f828152600a60205260409020600180820192909255600201555b61368833308d8d8d61435a565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156136be573d5f803e3d5ffd5b506040805161020081019091525f9080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890525f610100820181905261012082018190523361014083015261016082018790526001600160a01b038c166101808301526101a0820181905260016101c083018190526101e09092018190526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156137a3576137a3615495565b02179055506020828101516001830155604083015180516137ca9260028501920190614ef7565b50606082015180516137e6916003840191602090910190614f5a565b5060808201518051613802916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f906138d090600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926139545761395461586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509450505050506139b560018055565b9a9950505050505050505050565b5f80516020615e4c833981519152336139dc8282614301565b6114378484614be2565b5f80516020615e4c833981519152336139ff8282614301565b6001600160a01b0384165f908152601760205260409020805460ff1916841515908117909155600103611437576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c7339060200160405180910390a150505050565b5f60098581548110613a8257613a8261586b565b905f5260205f2090601002019050613a974290565b816001015411613ae15760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c41565b5f815460ff166004811115613af857613af8615495565b14613b405760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610c41565b600f81015415613bb757600f8101546040516001600160601b03193360601b166020820152613b739184916034016129e3565b613bb75760405162461bcd60e51b8152602060048201526015602482015274139bdd081c185c9d081bd98815da1a5d195b1a5cdd605a1b6044820152606401610c41565b5f84118015613bca575080600701548411155b613be65760405162461bcd60e51b8152600401610c4190615c17565b6001600160a01b03831615801590613c0757506001600160a01b0383163314155b613c675760405162461bcd60e51b815260206004820152602b60248201527f416464726573732063616e742774206265206e756c6c2061646472657373202f60448201526a1036b9b39039b2b73232b960a91b6064820152608401610c41565b60098581548110613c7a57613c7a61586b565b905f5260205f209060100201600501548482600d0154613c9a9190615b29565b1115613ce85760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c41565b600c8101546001600160a01b0316613d2d57838160060154613d0a9190615b3c565b3414613d285760405162461bcd60e51b8152600401610c4190615c74565b613db8565b600c81015460068201546001600160a01b03909116906323b872dd9033903090613d58908990615b3c565b6040518463ffffffff1660e01b8152600401613d7693929190615b6e565b6020604051808303815f875af1158015613d92573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613db69190615b53565b505b5f3386604051602001613dcc929190615a31565b604051602081830303815290604052805190602001209050816007015485600c5f8481526020019081526020015f2054613e069190615b29565b1115613e505760405162461bcd60e51b815260206004820152601960248201527826b0bc1032b73a3934b2b9903ab9b2b9103932b0b1b432b21760391b6044820152606401610c41565b5f818152600c602052604081208054879290613e6d908490615b29565b925050819055505f6040518060600160405280866001600160a01b031681526020018785600d0154613e9f9190615b29565b815260209081018890525f898152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508892909190613f17908490615b29565b9091555050600d83015460408051918252602082018890526001600160a01b0387169133918a917f15bbd06a4440dc4bed7451cfd8c6d87d7dd0b32856c137538574d4dc5581aa7b910160405180910390a450505050505050565b613f7a6149ba565b6001600160a01b038116613fdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c41565b610ca781614a13565b5f8281526008602052604081208190815b815481101561406b575f8282815481106140155761401561586b565b905f5260205f209060030201600101549050858110614062578282815481106140405761404061586b565b5f9182526020909120600390910201546001600160a01b0316935061406b9050565b50600101613ff9565b506001600160a01b0382166140b55760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c41565b509392505050565b5f80516020615e4c833981519152336140d68282614301565b50506019805460ff19811660ff90911615179055565b601254341461410d5760405162461bcd60e51b8152600401610c4190615c74565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f19350505050158015614143573d5f803e3d5ffd5b506040513381527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e739060200160405180910390a1565b6002600154036141cb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c41565b6002600155565b5f828152600760205260408120600101548251839083906141f5576141f561586b565b60200260200101516142079190615b16565b614212906001615b29565b5f8481526007602052604081205460098054939450919281106142375761423761586b565b905f5260205f20906010020190508181600901819055505f6040518060400160405280855f8151811061426c5761426c61586b565b60209081029190910181015182529081018590525f8781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a25f8581526007602052604090205461168e908461441a565b61430b8282612fe1565b610d2e5761431881614c1e565b614323836020614c30565b604051602001614334929190615cf2565b60408051601f198184030181529082905262461bcd60e51b8252610c4191600401615d91565b5f5b82518110156143d4576143cc868686848151811061437c5761437c61586b565b60200260200101518685815181106143965761439661586b565b60200260200101518686815181106143b0576143b061586b565b602002602001015160405180602001604052805f815250614dc5565b60010161435c565b505050505050565b6143e68282612fe1565b610d2e575f828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b614422614179565b5f600983815481106144365761443661586b565b905f5260205f209060100201905081816009018190555080600d01545f14614467576144628383613fe8565b614476565b600a8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b039290921691821790556002820180546040805160208084028201810190925282815261459e943094909391929091908301828280156144f457602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116144d6575b50505050508460030180548060200260200160405190810160405280929190818152602001828054801561454557602002820191905f5260205f20905b815481526020019060010190808311614531575b505050505085600401805480602002602001604051908101604052809291908181526020018280548015611ea357602002820191905f5260205f2090815481526020019060010190808311611e8f57505050505061435a565b5f816006015482600d01546145b39190615b3c565b90505f61271083600b0154836145c99190615b3c565b6145d39190615da3565b90505f6145e08284615aac565b600c8501549091506001600160a01b031661473357600a8401546040515f916001600160a01b03169083908381818185875af1925050503d805f8114614641576040519150601f19603f3d011682016040523d82523d5f602084013e614646565b606091505b505090508061468c5760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c41565b600d546040515f916001600160a01b03169085908381818185875af1925050503d805f81146146d6576040519150601f19603f3d011682016040523d82523d5f602084013e6146db565b606091505b505090508061472c5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c41565b5050614950565b600c84015460405163095ea7b360e01b81526001600160a01b039091169063095ea7b3906147679030908790600401615a31565b6020604051808303815f875af1158015614783573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906147a79190615b53565b50600c840154600a8501546040516323b872dd60e01b81525f926001600160a01b03908116926323b872dd926147e592309216908790600401615b6e565b6020604051808303815f875af1158015614801573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148259190615b53565b9050806148745760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c41565b600c850154600d546040516323b872dd60e01b81525f926001600160a01b03908116926323b872dd926148af92309216908990600401615b6e565b6020604051808303815f875af11580156148cb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148ef9190615b53565b90508061494d5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c41565b50505b835460ff19166003178455600884015460098501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a350505050610d2e60018055565b5f546001600160a01b0316331461265e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c41565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201525f916001600160a01b031690635d3b1d309060a4016020604051808303815f875af1158015614af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614b149190615a4a565b60408051808201825285815260208082018681525f858152600790925292812091518255915160019091015560098054929350909185908110614b5957614b5961586b565b5f91825260209091206010909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b5f82614bd98584614e99565b14949350505050565b614bec8282612fe1565b15610d2e575f828152601a602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b6060610bbe6001600160a01b03831660145b60605f614c3e836002615b3c565b614c49906002615b29565b6001600160401b03811115614c6057614c60615029565b6040519080825280601f01601f191660200182016040528015614c8a576020820181803683370190505b509050600360fc1b815f81518110614ca457614ca461586b565b60200101906001600160f81b03191690815f1a905350600f60fb1b81600181518110614cd257614cd261586b565b60200101906001600160f81b03191690815f1a9053505f614cf4846002615b3c565b614cff906001615b29565b90505b6001811115614d76576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614d3357614d3361586b565b1a60f81b828281518110614d4957614d4961586b565b60200101906001600160f81b03191690815f1a90535060049490941c93614d6f81615db6565b9050614d02565b50831561154f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c41565b815f03614e3057604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614dfe908990899088908790600401615dcb565b5f604051808303815f87803b158015614e15575f80fd5b505af1158015614e27573d5f803e3d5ffd5b505050506143d4565b604051637921219560e11b81526001600160a01b0385169063f242432a90614e649089908990889088908890600401615e07565b5f604051808303815f87803b158015614e7b575f80fd5b505af1158015614e8d573d5f803e3d5ffd5b50505050505050505050565b5f81815b84518110156140b5575f858281518110614eb957614eb961586b565b60200260200101519050808311614ede575f8381526020829052604090209250614eee565b5f81815260208490526040902092505b50600101614e9d565b828054828255905f5260205f20908101928215614f4a579160200282015b82811115614f4a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614f15565b50614f56929150614f93565b5090565b828054828255905f5260205f20908101928215614f4a579160200282015b82811115614f4a578251825591602001919060010190614f78565b5b80821115614f56575f8155600101614f94565b5f8060408385031215614fb8575f80fd5b50508035926020909101359150565b5f60208284031215614fd7575f80fd5b81356001600160e01b03198116811461154f575f80fd5b5f60208284031215614ffe575f80fd5b5035919050565b6001600160a01b0381168114610ca7575f80fd5b803561502481615005565b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561506557615065615029565b604052919050565b5f82601f83011261507c575f80fd5b81356001600160401b0381111561509557615095615029565b6150a8601f8201601f191660200161503d565b8181528460208386010111156150bc575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f80608085870312156150eb575f80fd5b84356150f681615005565b9350602085013561510681615005565b92506040850135915060608501356001600160401b03811115615127575f80fd5b6151338782880161506d565b91505092959194509250565b5f6001600160401b0382111561515757615157615029565b5060051b60200190565b5f82601f830112615170575f80fd5b813560206151856151808361513f565b61503d565b8083825260208201915060208460051b8701019350868411156151a6575f80fd5b602086015b848110156151c257803583529183019183016151ab565b509695505050505050565b5f80604083850312156151de575f80fd5b8235915060208301356001600160401b038111156151fa575f80fd5b61520685828601615161565b9150509250929050565b8015158114610ca7575f80fd5b5f806040838503121561522e575f80fd5b823561523981615005565b9150602083013561524981615210565b809150509250929050565b5f60208284031215615264575f80fd5b813561154f81615005565b5f82601f83011261527e575f80fd5b8135602061528e6151808361513f565b8083825260208201915060208460051b8701019350868411156152af575f80fd5b602086015b848110156151c25780356152c781615005565b83529183019183016152b4565b5f805f805f805f805f6101208a8c0312156152ed575f80fd5b8935985060208a01356001600160401b038082111561530a575f80fd5b6153168d838e0161526f565b995060408c013591508082111561532b575f80fd5b6153378d838e01615161565b985060608c013591508082111561534c575f80fd5b506153598c828d01615161565b96505061536860808b01615019565b989b979a50959894979660a0860135965060c08601359560e0810135955061010001359350915050565b5f80604083850312156153a3575f80fd5b82359150602083013561524981615005565b602080825282518282018190525f919060409081850190868401855b8281101561540957815180516001600160a01b03168552868101518786015285015185850152606090930192908501906001016153d1565b5091979650505050505050565b5f8060408385031215615427575f80fd5b823561543281615005565b946020939093013593505050565b5f8060408385031215615451575f80fd5b82356001600160401b0380821115615467575f80fd5b6154738683870161526f565b93506020850135915080821115615488575f80fd5b5061520685828601615161565b634e487b7160e01b5f52602160045260245ffd5b6101a0810160058f106154ca57634e487b7160e01b5f52602160045260245ffd5b8e82528d60208301528c60408301528b60608301528a60808301526154fa60a083018b6001600160a01b03169052565b8860c083015261551560e08301896001600160a01b03169052565b866101008301526155326101208301876001600160a01b03169052565b8461014083015261554861016083018515159052565b826101808301529e9d5050505050505050505050505050565b5f805f60608486031215615573575f80fd5b833592506020840135915060408401356001600160401b03811115615596575f80fd5b6155a286828701615161565b9150509250925092565b5f602082840312156155bc575f80fd5b813563ffffffff8116811461154f575f80fd5b5f805f606084860312156155e1575f80fd5b83356001600160401b038111156155f6575f80fd5b61560286828701615161565b9660208601359650604090950135949350505050565b5f60208284031215615628575f80fd5b81356001600160401b038116811461154f575f80fd5b5f805f805f60a08688031215615652575f80fd5b853561565d81615005565b9450602086013561566d81615005565b935060408601356001600160401b0380821115615688575f80fd5b61569489838a01615161565b945060608801359150808211156156a9575f80fd5b6156b589838a01615161565b935060808801359150808211156156ca575f80fd5b506156d78882890161506d565b9150509295509295909350565b5f805f805f805f805f806101408b8d0312156156fe575f80fd5b6157078b615019565b995060208b0135985060408b0135975060608b01356001600160401b0380821115615730575f80fd5b61573c8e838f0161526f565b985060808d0135915080821115615751575f80fd5b61575d8e838f01615161565b975060a08d0135915080821115615772575f80fd5b5061577f8d828e01615161565b95505061578e60c08c01615019565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b5f805f80608085870312156157c9575f80fd5b843593506020850135925060408501356157e281615005565b915060608501356001600160401b038111156157fc575f80fd5b61513387828801615161565b5f805f805f60a0868803121561581c575f80fd5b853561582781615005565b9450602086013561583781615005565b9350604086013592506060860135915060808601356001600160401b0381111561585f575f80fd5b6156d78882890161506d565b634e487b7160e01b5f52603260045260245ffd5b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b5f602082840312156159f1575f80fd5b815161154f81615005565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b6001600160a01b03929092168252602082015260400190565b5f60208284031215615a5a575f80fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610bbe57610bbe615a98565b60208082526023908201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206040820152621bdd5d60ea1b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f82615b2457615b24615b02565b500690565b80820180821115610bbe57610bbe615a98565b8082028115828204841417610bbe57610bbe615a98565b5f60208284031215615b63575f80fd5b815161154f81615210565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b6020808252603c908201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260408201527f65207468616e206d617820656e74726965732070657220757365722e00000000606082015260800190565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b5f60018201615cc957615cc9615a98565b5060010190565b5f5b83811015615cea578181015183820152602001615cd2565b50505f910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351615d29816017850160208801615cd0565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d5a816028840160208801615cd0565b01602801949350505050565b5f8151808452615d7d816020860160208601615cd0565b601f01601f19169290920160200192915050565b602081525f61154f6020830184615d66565b5f82615db157615db1615b02565b500490565b5f81615dc457615dc4615a98565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90615dfd90830184615d66565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f90615e4090830184615d66565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca26469706673582212203b44b7d9f6b858cb2048e2afa3dfe06e49c9aaef9a6a7aaf4fed114d26baec0464736f6c63430008160033
Deployed Bytecode
0x608060405260043610610387575f3560e01c80638354a49c116101d3578063cf482ee9116100fd578063e096839b1161009d578063f36914551161006d578063f369145514610aeb578063f5b541a614610b0a578063f860cec514610b2a578063ff0b906c14610b3e575f80fd5b8063e096839b14610a79578063ebb4c01014610a8e578063f23a6e6114610aa1578063f2fde38b14610acc575f80fd5b8063d3c4d664116100d8578063d3c4d66414610a11578063d547741f14610a26578063d703ece814610a45578063dadc9b4014610a5a575f80fd5b8063cf482ee9146109b3578063cf7874a3146109c6578063d0038ff4146109f8575f80fd5b806391d1485411610173578063aaced47011610143578063aaced47014610934578063bc0618c31461095f578063bc197c8114610974578063cb77c1471461099f575f80fd5b806391d14854146108ce5780639dde45da146108ed578063a217fddf1461090c578063a79bdca41461091f575f80fd5b806388ec392c116101ae57806388ec392c146108415780638da5cb5b146108605780638dfc13b614610890578063903c6db6146108af575f80fd5b80638354a49c146107e5578063888a56371461080457806388aaf2a914610823575f80fd5b80634944a480116102b457806369f26fb011610254578063715018a611610224578063715018a614610758578063719c0a131461076c57806375e4d3fd1461078b57806381d12c581461079e575f80fd5b806369f26fb0146106e15780636a890cb2146107005780636bf3f8f6146107155780636fd9690314610743575f80fd5b8063581343c41161028f578063581343c4146106645780635d4bc0ce146106835780635fba3171146106bb578063622b291c146106ce575f80fd5b80634944a480146106055780634c86bca11461062457806353e53a8714610639575f80fd5b806327c7807b1161032a5780632f2ff15d116102fa5780632f2ff15d14610546578063365e3658146105655780634169933f1461059157806346988a40146105e6575f80fd5b806327c7807b146104d357806329cb924d1461050057806329dd67f9146105125780632bb022b714610531575f80fd5b8063150b7a0211610365578063150b7a02146104245780631fe543e31461046757806320c741b31461048657806321f4bd61146104a5575f80fd5b8063013805c51461038b57806301ffc9a7146103d45780630f5e812e14610403575b5f80fd5b348015610396575f80fd5b506103aa6103a5366004614fa7565b610b46565b604080516001600160a01b0390941684526020840192909252908201526060015b60405180910390f35b3480156103df575f80fd5b506103f36103ee366004614fc7565b610b8e565b60405190151581526020016103cb565b34801561040e575f80fd5b5061042261041d366004614fee565b610bc4565b005b34801561042f575f80fd5b5061044e61043e3660046150d8565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103cb565b348015610472575f80fd5b506104226104813660046151cd565b610caa565b348015610491575f80fd5b506104226104a036600461521d565b610d32565b3480156104b0575f80fd5b506103f36104bf366004615254565b60176020525f908152604090205460ff1681565b3480156104de575f80fd5b506104f26104ed3660046152d4565b610d77565b6040519081526020016103cb565b34801561050b575f80fd5b50426104f2565b34801561051d575f80fd5b5061042261052c366004614fee565b6113f4565b34801561053c575f80fd5b506104f260115481565b348015610551575f80fd5b50610422610560366004615392565b611414565b348015610570575f80fd5b5061058461057f366004614fee565b61143d565b6040516103cb91906153b5565b34801561059c575f80fd5b506105cb6105ab366004614fee565b600a6020525f908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103cb565b3480156105f1575f80fd5b506104f2610600366004615416565b6114ce565b348015610610575f80fd5b5061042261061f366004615440565b611556565b34801561062f575f80fd5b506104f2600f5481565b348015610644575f80fd5b506104f2610653366004614fee565b600c6020525f908152604090205481565b34801561066f575f80fd5b5061042261067e366004614fee565b611695565b34801561068e575f80fd5b506106a261069d366004614fee565b61179c565b6040516103cb9d9c9b9a999897969594939291906154a9565b6104226106c9366004614fee565b61182a565b6104f26106dc3660046152d4565b611efa565b3480156106ec575f80fd5b506104226106fb366004615254565b612623565b34801561070b575f80fd5b506104f260125481565b348015610720575f80fd5b506103f361072f366004615254565b60186020525f908152604090205460ff1681565b34801561074e575f80fd5b506104f260155481565b348015610763575f80fd5b5061042261264d565b348015610777575f80fd5b506104f2610786366004614fee565b612660565b610422610799366004615561565b6127e5565b3480156107a9575f80fd5b506107d06107b8366004614fee565b60066020525f90815260409020805460019091015482565b604080519283526020830191909152016103cb565b3480156107f0575f80fd5b506104226107ff366004614fee565b612cc8565b34801561080f575f80fd5b5061042261081e366004614fa7565b612ce8565b34801561082e575f80fd5b506019546103f390610100900460ff1681565b34801561084c575f80fd5b5061042261085b366004614fee565b612daf565b34801561086b575f80fd5b505f546001600160a01b03165b6040516001600160a01b0390911681526020016103cb565b34801561089b575f80fd5b506104226108aa3660046155ac565b612f8e565b3480156108ba575f80fd5b506103f36108c93660046155cf565b612fcd565b3480156108d9575f80fd5b506103f36108e8366004615392565b612fe1565b3480156108f8575f80fd5b50610422610907366004615618565b61300b565b348015610917575f80fd5b506104f25f81565b34801561092a575f80fd5b506104f2600e5481565b34801561093f575f80fd5b506104f261094e366004615254565b600b6020525f908152604090205481565b34801561096a575f80fd5b506104f260145481565b34801561097f575f80fd5b5061044e61098e36600461563e565b63bc197c8160e01b95945050505050565b3480156109aa575f80fd5b50610422613053565b6104f26109c13660046156e4565b61308b565b3480156109d1575f80fd5b506107d06109e0366004614fee565b60076020525f90815260409020805460019091015482565b348015610a03575f80fd5b506019546103f39060ff1681565b348015610a1c575f80fd5b506104f260135481565b348015610a31575f80fd5b50610422610a40366004615392565b6139c3565b348015610a50575f80fd5b506104f260165481565b348015610a65575f80fd5b50610422610a7436600461521d565b6139e6565b348015610a84575f80fd5b506104f260105481565b610422610a9c3660046157b6565b613a6e565b348015610aac575f80fd5b5061044e610abb366004615808565b63f23a6e6160e01b95945050505050565b348015610ad7575f80fd5b50610422610ae6366004615254565b613f72565b348015610af6575f80fd5b50610878610b05366004614fa7565b613fe8565b348015610b15575f80fd5b506104f25f80516020615e4c83398151915281565b348015610b35575f80fd5b506104226140bd565b6104226140ec565b6008602052815f5260405f208181548110610b5f575f80fd5b5f9182526020909120600390910201805460018201546002909201546001600160a01b03909116935090915083565b5f6001600160e01b03198216630271189760e51b1480610bbe57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610bcc614179565b5f60098281548110610be057610be061586b565b5f9182526020909120600a601090920201908101549091506001600160a01b03163314610c4a5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b60448201526064015b60405180910390fd5b600e81015460ff161515600103610c9d57600e8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b50610ca760018055565b50565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610d245760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610c41565b610d2e82826141d2565b5050565b5f80516020615e4c83398151915233610d4b8282614301565b50506001600160a01b03919091165f908152601860205260409020805460ff1916911515919091179055565b5f5f80516020615e4c83398151915233610d918282614301565b428c11610db05760405162461bcd60e51b8152600401610c419061587f565b89518b5114610e105760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c41565b88518b5114610e315760405162461bcd60e51b8152600401610c41906158c3565b5f8611610e505760405162461bcd60e51b8152600401610c4190615913565b5f85118015610e5f5750858511155b610e7b5760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b03881615610ec1576001600160a01b0388165f9081526017602052604090205460ff16610ec15760405162461bcd60e51b8152600401610c4190615985565b5f5b8b518110156110f3575f6001600160a01b03168c8281518110610ee857610ee861586b565b60200260200101516001600160a01b031603610f165760405162461bcd60e51b8152600401610c41906159bc565b898181518110610f2857610f2861586b565b60200260200101515f0361100f575f8c8281518110610f4957610f4961586b565b60200260200101519050806001600160a01b0316636352211e8d8481518110610f7457610f7461586b565b60200260200101516040518263ffffffff1660e01b8152600401610f9a91815260200190565b602060405180830381865afa158015610fb5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fd991906159e1565b6001600160a01b0316336001600160a01b0316146110095760405162461bcd60e51b8152600401610c41906159fc565b506110eb565b5f8c82815181106110225761102261586b565b602002602001015190508a828151811061103e5761103e61586b565b6020026020010151816001600160a01b031662fdd58e338f86815181106110675761106761586b565b60200260200101516040518363ffffffff1660e01b815260040161108c929190615a31565b602060405180830381865afa1580156110a7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110cb9190615a4a565b10156110e95760405162461bcd60e51b8152600401610c4190615a61565b505b600101610ec3565b505f61110233308e8e8e61435a565b6040805161020081019091525f90808281526020018f81526020018e81526020018d81526020018c81526020018981526020018a81526020018881526020015f6001600160a01b031681526020015f8152602001336001600160a01b031681526020018381526020018b6001600160a01b031681526020015f8152602001600115158152602001878152509050600981908060018154018082558091505060019003905f5260205f2090601002015f909190919091505f820151815f015f6101000a81548160ff021916908360048111156111df576111df615495565b02179055506020828101516001830155604083015180516112069260028501920190614ef7565b5060608201518051611222916003840191602090910190614f5a565b506080820151805161123e916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f9061130c90600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926113905761139061586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509e9d5050505050505050505050505050565b5f80516020615e4c8339815191523361140d8282614301565b5050600455565b5f80516020615e4c8339815191523361142d8282614301565b61143784846143dc565b50505050565b606060085f8381526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b828210156114c3575f848152602090819020604080516060810182526003860290920180546001600160a01b031683526001808201548486015260029091015491830191909152908352909201910161146f565b505050509050919050565b6001600160a01b0382165f908152600b602052604081205481901561154f575f8484604051602001611501929190615a31565b60408051601f1981840301815291815281516020928301205f818152600a8452828120600201546001600160a01b038a168252600b909452919091205490925061154b9190615aac565b9150505b9392505050565b5f80516020615e4c8339815191523361156f8282614301565b82518451146115b65760405162461bcd60e51b81526020600482015260136024820152720a4cae2ead2e4ca40e6c2daca40d8cadccee8d606b1b6044820152606401610c41565b5f5b845181101561168e578381815181106115d3576115d361586b565b6020026020010151600b5f8784815181106115f0576115f061586b565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020015f20819055507fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d85828151811061164e5761164e61586b565b60200260200101518583815181106116685761166861586b565b602002602001015160405161167e929190615a31565b60405180910390a16001016115b8565b5050505050565b5f80516020615e4c833981519152336116ae8282614301565b5f600984815481106116c2576116c261586b565b5f9182526020909120600a601090920201908101549091506001600160a01b0316331461171f57806005015481600d01541480611703575042816001015411155b61171f5760405162461bcd60e51b8152600401610c4190615abf565b600d810154604080514360208083019190915242828401524560608084019190915241901b6001600160601b031916608083015282518083036074018152609490920190925280519101205f6117758383615b16565b611780906001615b29565b600985018190559050611793878261441a565b50505050505050565b600981815481106117ab575f80fd5b5f91825260209091206010909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e8c0154600f909c015460ff9b8c169d50999b989a979996986001600160a01b0396871698959794871696939592909316939092909116908d565b611832614179565b5f600982815481106118465761184661586b565b5f9182526020909120600a601090920201908101549091506001600160a01b031633148061188657506118865f80516020615e4c83398151915233612fe1565b6118d25760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c41565b428160010154116118f55760405162461bcd60e51b8152600401610c419061587f565b5f815460ff16600481111561190c5761190c615495565b146119485760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c41565b61195f5f80516020615e4c83398151915233612fe1565b611a9657600e81015460ff166119ab5760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c41565b80600d01545f03611a09573415611a045760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c41565b611a96565b601154341015611a5b5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c41565b600d546011546040516001600160a01b039092169181156108fc0291905f818181858888f19350505050158015611a94573d5f803e3d5ffd5b505b5f8281526008602052604090205460c8811115611b145760405162461bcd60e51b815260206004820152603660248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e20696044820152753a13b99036b7b932903a3430b710191818103a3c399760511b6064820152608401610c41565b5f826006015483600d0154611b299190615b3c565b600c8401549091506001600160a01b0316611c0e575f5b82811015611c08575f858152600860205260408120805483908110611b6757611b6761586b565b5f9182526020909120600390910201546001600160a01b031690508015611bff575f868152600860205260408120805484908110611ba757611ba761586b565b905f5260205f209060030201600201548660060154611bc69190615b3c565b6040519091506001600160a01b0383169082156108fc029083905f818181858888f19350505050158015611bfc573d5f803e3d5ffd5b50505b50600101611b40565b50611d90565b600c83015460405163095ea7b360e01b81526001600160a01b039091169063095ea7b390611c429030908590600401615a31565b6020604051808303815f875af1158015611c5e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c829190615b53565b505f5b82811015611d8e575f858152600860205260408120805483908110611cac57611cac61586b565b5f9182526020909120600390910201546001600160a01b031690508015611d85575f868152600860205260408120805484908110611cec57611cec61586b565b905f5260205f209060030201600201548660060154611d0b9190615b3c565b600c8701546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd90611d4290309086908690600401615b6e565b6020604051808303815f875af1158015611d5e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d829190615b53565b50505b50600101611c85565b505b611ead3084600a015f9054906101000a90046001600160a01b031685600201805480602002602001604051908101604052809291908181526020018280548015611e0157602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611de3575b505050505086600301805480602002602001604051908101604052809291908181526020018280548015611e5257602002820191905f5260205f20905b815481526020019060010190808311611e3e575b505050505087600401805480602002602001604051908101604052809291908181526020018280548015611ea357602002820191905f5260205f20905b815481526020019060010190808311611e8f575b505050505061435a565b825460ff1916600417835560405181815284907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed2906020015b60405180910390a2505050610ca760018055565b5f611f03614179565b601954610100900460ff16611f6a5760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c41565b428a11611f895760405162461bcd60e51b8152600401610c419061587f565b8751895114611faa5760405162461bcd60e51b8152600401610c4190615b92565b8651895114611fcb5760405162461bcd60e51b8152600401610c41906158c3565b600e54341015611fed5760405162461bcd60e51b8152600401610c4190615be7565b5f841161200c5760405162461bcd60e51b8152600401610c4190615913565b5f8311801561201b5750838311155b6120375760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b0386161561207d576001600160a01b0386165f9081526017602052604090205460ff1661207d5760405162461bcd60e51b8152600401610c4190615985565b5f5b89518110156122af575f6001600160a01b03168a82815181106120a4576120a461586b565b60200260200101516001600160a01b0316036120d25760405162461bcd60e51b8152600401610c41906159bc565b8781815181106120e4576120e461586b565b60200260200101515f036121cb575f8a82815181106121055761210561586b565b60200260200101519050806001600160a01b0316636352211e8b84815181106121305761213061586b565b60200260200101516040518263ffffffff1660e01b815260040161215691815260200190565b602060405180830381865afa158015612171573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061219591906159e1565b6001600160a01b0316336001600160a01b0316146121c55760405162461bcd60e51b8152600401610c41906159fc565b506122a7565b5f8a82815181106121de576121de61586b565b602002602001015190508882815181106121fa576121fa61586b565b6020026020010151816001600160a01b031662fdd58e338d86815181106122235761222361586b565b60200260200101516040518363ffffffff1660e01b8152600401612248929190615a31565b602060405180830381865afa158015612263573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122879190615a4a565b10156122a55760405162461bcd60e51b8152600401610c4190615a61565b505b60010161207f565b506001600160a01b0386165f9081526018602052604081205460ff16156122d957506016546122de565b506015545b6122eb33308c8c8c61435a565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f19350505050158015612321573d5f803e3d5ffd5b506040805161020081019091525f9080828152602081018e9052604081018d9052606081018c9052608081018b905260a0810188905260c0810189905260e081018790525f610100820181905261012082018190523361014083015261016082018590526001600160a01b038b166101808301526101a0820181905260016101c083018190526101e09092018790526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff19169083600481111561240657612406615495565b021790555060208281015160018301556040830151805161242d9260028501920190614ef7565b5060608201518051612449916003840191602090910190614f5a565b5060808201518051612465916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f9061253390600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926125b7576125b761586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509250505061261660018055565b9998505050505050505050565b61262b6149ba565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6126556149ba565b61265e5f614a13565b565b5f5f80516020615e4c8339815191523361267a8282614301565b5f6009858154811061268e5761268e61586b565b5f9182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601090930290910192506001600160a01b031690635d3b1d309060a4016020604051808303815f875af115801561272d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127519190615a4a565b604080518082018252878152600d84015460208083019182525f85815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b5f600984815481106127f9576127f961586b565b905f5260205f209060100201905061280e4290565b8160010154116128585760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c41565b5f815460ff16600481111561286f5761286f615495565b146128b75760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610c41565b5f831180156128ca575080600701548311155b6128e65760405162461bcd60e51b8152600401610c4190615c17565b336129335760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c41565b600984815481106129465761294661586b565b905f5260205f209060100201600501548382600d01546129669190615b29565b11156129b45760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c41565b600f81015415612a4a57600f8101546040516001600160601b03193360601b1660208201526129fe9184916034015b60405160208183030381529060405280519060200120612fcd565b612a4a5760405162461bcd60e51b815260206004820152601960248201527f4e6f742070617274206f66207468652057686974656c697374000000000000006044820152606401610c41565b600c8101546001600160a01b0316612a8f57828160060154612a6c9190615b3c565b3414612a8a5760405162461bcd60e51b8152600401610c4190615c74565b612b1a565b600c81015460068201546001600160a01b03909116906323b872dd9033903090612aba908890615b3c565b6040518463ffffffff1660e01b8152600401612ad893929190615b6e565b6020604051808303815f875af1158015612af4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612b189190615b53565b505b5f3385604051602001612b2e929190615a31565b604051602081830303815290604052805190602001209050816007015484600c5f8481526020019081526020015f2054612b689190615b29565b1115612bb25760405162461bcd60e51b815260206004820152601960248201527826b0bc1032b73a3934b2b9903ab9b2b9103932b0b1b432b21760391b6044820152606401610c41565b5f818152600c602052604081208054869290612bcf908490615b29565b925050819055505f6040518060600160405280336001600160a01b031681526020018685600d0154612c019190615b29565b815260209081018790525f888152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508792909190612c79908490615b29565b9091555050600d8301546040805191825260208201879052339188917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a3505050505050565b5f80516020615e4c83398151915233612ce18282614301565b5050601155565b612cf0614179565b5f60098381548110612d0457612d0461586b565b5f9182526020909120600a601090920201908101549091506001600160a01b03163314612d695760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c41565b600f810182905560405182815283907fbeffc53bea2d95fb8c844351c36ee8730739ced3171008941faeb629f9beb0599060200160405180910390a250610d2e60018055565b612db7614179565b5f60098281548110612dcb57612dcb61586b565b5f9182526020909120600a601090920201908101549091506001600160a01b0316331480612e0b5750612e0b5f80516020615e4c83398151915233612fe1565b612e575760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72206f70657261746f722e006044820152606401610c41565b612e6e5f80516020615e4c83398151915233612fe1565b15612ea957806005015481600d01541480612e8d575042816001015411155b612ea95760405162461bcd60e51b8152600401610c4190615abf565b5f815460ff166004811115612ec057612ec0615495565b14612f065760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c41565b805460ff19166001178155600d81015460068201545f90612f279083615b3c565b9050815f03612f5057825460ff191660021783556009830154612f4b90859061441a565b612f5c565b612f5a8483614a62565b505b837ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6882604051611ee691815260200190565b5f80516020615e4c83398151915233612fa78282614301565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b5f612fd9848484614bcd565b949350505050565b5f918252601a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80516020615e4c833981519152336130248282614301565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b5f80516020615e4c8339815191523361306c8282614301565b50506019805461ff001981166101009182900460ff1615909102179055565b5f613094614179565b60195460ff166130f15760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c41565b4289116131105760405162461bcd60e51b8152600401610c419061587f565b86518851146131315760405162461bcd60e51b8152600401610c4190615b92565b85518851146131525760405162461bcd60e51b8152600401610c41906158c3565b5f83116131715760405162461bcd60e51b8152600401610c4190615913565b5f821180156131805750828211155b61319c5760405162461bcd60e51b8152600401610c4190615937565b6001600160a01b038516156131e2576001600160a01b0385165f9081526017602052604090205460ff166131e25760405162461bcd60e51b8152600401610c4190615985565b5f5b8851811015613414575f6001600160a01b03168982815181106132095761320961586b565b60200260200101516001600160a01b0316036132375760405162461bcd60e51b8152600401610c41906159bc565b8681815181106132495761324961586b565b60200260200101515f03613330575f89828151811061326a5761326a61586b565b60200260200101519050806001600160a01b0316636352211e8a84815181106132955761329561586b565b60200260200101516040518263ffffffff1660e01b81526004016132bb91815260200190565b602060405180830381865afa1580156132d6573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132fa91906159e1565b6001600160a01b0316336001600160a01b03161461332a5760405162461bcd60e51b8152600401610c41906159fc565b5061340c565b5f8982815181106133435761334361586b565b6020026020010151905087828151811061335f5761335f61586b565b6020026020010151816001600160a01b031662fdd58e338c86815181106133885761338861586b565b60200260200101516040518363ffffffff1660e01b81526004016133ad929190615a31565b602060405180830381865afa1580156133c8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133ec9190615a4a565b101561340a5760405162461bcd60e51b8152600401610c4190615a61565b505b6001016131e4565b506001600160a01b0385165f9081526018602052604081205460ff161561346d57600e546010546134459190615b29565b3410156134645760405162461bcd60e51b8152600401610c4190615be7565b506014546134a1565b600e54600f5461347d9190615b29565b34101561349c5760405162461bcd60e51b8152600401610c4190615be7565b506013545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156134e8573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061350c91906159e1565b6001600160a01b0316146135625760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c41565b5f8d8d604051602001613576929190615a31565b6040516020818303038152906040528051906020012090506135954290565b5f828152600a60205260409020600101541115613643575f6135b78f8f6114ce565b1161361d5760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c41565b5f818152600a6020526040812060020180549161363983615cb8565b919050555061367b565b425f828152600a6020526040902055426136609062278d00615b29565b5f828152600a60205260409020600180820192909255600201555b61368833308d8d8d61435a565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f193505050501580156136be573d5f803e3d5ffd5b506040805161020081019091525f9080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e081018890525f610100820181905261012082018190523361014083015261016082018790526001600160a01b038c166101808301526101a0820181905260016101c083018190526101e09092018190526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156137a3576137a3615495565b02179055506020828101516001830155604083015180516137ca9260028501920190614ef7565b50606082015180516137e6916003840191602090910190614f5a565b5060808201518051613802916004840191602090910190614f5a565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850180548416918516919091179055610160850151600b850155610180850151600c8501805490931693169290921790556101a0830151600d8301556101c0830151600e8301805460ff19169115159190911790556101e090920151600f90910155545f906138d090600190615aac565b604080516060810182525f808252602080830182815283850183815286845260088352948320805460018082018355828652938520865160039092020180546001600160a01b0319166001600160a01b039092169190911781559151928201929092559351600290940193909355838152825493945090926139545761395461586b565b5f9182526020822060039091020180546001600160a01b03191681556001810182905560020181905560405183917f0b5745354685a046e72f24602bcf00fa0ee07f0bf511afb5f2d3ab636241e41b91a2509450505050506139b560018055565b9a9950505050505050505050565b5f80516020615e4c833981519152336139dc8282614301565b6114378484614be2565b5f80516020615e4c833981519152336139ff8282614301565b6001600160a01b0384165f908152601760205260409020805460ff1916841515908117909155600103611437576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c7339060200160405180910390a150505050565b5f60098581548110613a8257613a8261586b565b905f5260205f2090601002019050613a974290565b816001015411613ae15760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c41565b5f815460ff166004811115613af857613af8615495565b14613b405760405162461bcd60e51b8152602060048201526018602482015277149859999b19481a5cc81b9bdd081a5b8810d4915055115160421b6044820152606401610c41565b600f81015415613bb757600f8101546040516001600160601b03193360601b166020820152613b739184916034016129e3565b613bb75760405162461bcd60e51b8152602060048201526015602482015274139bdd081c185c9d081bd98815da1a5d195b1a5cdd605a1b6044820152606401610c41565b5f84118015613bca575080600701548411155b613be65760405162461bcd60e51b8152600401610c4190615c17565b6001600160a01b03831615801590613c0757506001600160a01b0383163314155b613c675760405162461bcd60e51b815260206004820152602b60248201527f416464726573732063616e742774206265206e756c6c2061646472657373202f60448201526a1036b9b39039b2b73232b960a91b6064820152608401610c41565b60098581548110613c7a57613c7a61586b565b905f5260205f209060100201600501548482600d0154613c9a9190615b29565b1115613ce85760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c41565b600c8101546001600160a01b0316613d2d57838160060154613d0a9190615b3c565b3414613d285760405162461bcd60e51b8152600401610c4190615c74565b613db8565b600c81015460068201546001600160a01b03909116906323b872dd9033903090613d58908990615b3c565b6040518463ffffffff1660e01b8152600401613d7693929190615b6e565b6020604051808303815f875af1158015613d92573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613db69190615b53565b505b5f3386604051602001613dcc929190615a31565b604051602081830303815290604052805190602001209050816007015485600c5f8481526020019081526020015f2054613e069190615b29565b1115613e505760405162461bcd60e51b815260206004820152601960248201527826b0bc1032b73a3934b2b9903ab9b2b9103932b0b1b432b21760391b6044820152606401610c41565b5f818152600c602052604081208054879290613e6d908490615b29565b925050819055505f6040518060600160405280866001600160a01b031681526020018785600d0154613e9f9190615b29565b815260209081018890525f898152600882526040808220805460018082018355918452848420865160039092020180546001600160a01b0319166001600160a01b039092169190911781559385015190840155830151600290920191909155600d850180549293508892909190613f17908490615b29565b9091555050600d83015460408051918252602082018890526001600160a01b0387169133918a917f15bbd06a4440dc4bed7451cfd8c6d87d7dd0b32856c137538574d4dc5581aa7b910160405180910390a450505050505050565b613f7a6149ba565b6001600160a01b038116613fdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c41565b610ca781614a13565b5f8281526008602052604081208190815b815481101561406b575f8282815481106140155761401561586b565b905f5260205f209060030201600101549050858110614062578282815481106140405761404061586b565b5f9182526020909120600390910201546001600160a01b0316935061406b9050565b50600101613ff9565b506001600160a01b0382166140b55760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c41565b509392505050565b5f80516020615e4c833981519152336140d68282614301565b50506019805460ff19811660ff90911615179055565b601254341461410d5760405162461bcd60e51b8152600401610c4190615c74565b600d546040516001600160a01b03909116903480156108fc02915f818181858888f19350505050158015614143573d5f803e3d5ffd5b506040513381527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e739060200160405180910390a1565b6002600154036141cb5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c41565b6002600155565b5f828152600760205260408120600101548251839083906141f5576141f561586b565b60200260200101516142079190615b16565b614212906001615b29565b5f8481526007602052604081205460098054939450919281106142375761423761586b565b905f5260205f20906010020190508181600901819055505f6040518060400160405280855f8151811061426c5761426c61586b565b60209081029190910181015182529081018590525f8781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a25f8581526007602052604090205461168e908461441a565b61430b8282612fe1565b610d2e5761431881614c1e565b614323836020614c30565b604051602001614334929190615cf2565b60408051601f198184030181529082905262461bcd60e51b8252610c4191600401615d91565b5f5b82518110156143d4576143cc868686848151811061437c5761437c61586b565b60200260200101518685815181106143965761439661586b565b60200260200101518686815181106143b0576143b061586b565b602002602001015160405180602001604052805f815250614dc5565b60010161435c565b505050505050565b6143e68282612fe1565b610d2e575f828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b614422614179565b5f600983815481106144365761443661586b565b905f5260205f209060100201905081816009018190555080600d01545f14614467576144628383613fe8565b614476565b600a8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b039290921691821790556002820180546040805160208084028201810190925282815261459e943094909391929091908301828280156144f457602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116144d6575b50505050508460030180548060200260200160405190810160405280929190818152602001828054801561454557602002820191905f5260205f20905b815481526020019060010190808311614531575b505050505085600401805480602002602001604051908101604052809291908181526020018280548015611ea357602002820191905f5260205f2090815481526020019060010190808311611e8f57505050505061435a565b5f816006015482600d01546145b39190615b3c565b90505f61271083600b0154836145c99190615b3c565b6145d39190615da3565b90505f6145e08284615aac565b600c8501549091506001600160a01b031661473357600a8401546040515f916001600160a01b03169083908381818185875af1925050503d805f8114614641576040519150601f19603f3d011682016040523d82523d5f602084013e614646565b606091505b505090508061468c5760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c41565b600d546040515f916001600160a01b03169085908381818185875af1925050503d805f81146146d6576040519150601f19603f3d011682016040523d82523d5f602084013e6146db565b606091505b505090508061472c5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c41565b5050614950565b600c84015460405163095ea7b360e01b81526001600160a01b039091169063095ea7b3906147679030908790600401615a31565b6020604051808303815f875af1158015614783573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906147a79190615b53565b50600c840154600a8501546040516323b872dd60e01b81525f926001600160a01b03908116926323b872dd926147e592309216908790600401615b6e565b6020604051808303815f875af1158015614801573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148259190615b53565b9050806148745760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c41565b600c850154600d546040516323b872dd60e01b81525f926001600160a01b03908116926323b872dd926148af92309216908990600401615b6e565b6020604051808303815f875af11580156148cb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906148ef9190615b53565b90508061494d5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c41565b50505b835460ff19166003178455600884015460098501546040805186815260208101929092526001600160a01b039092169188917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a350505050610d2e60018055565b5f546001600160a01b0316331461265e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c41565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201525f916001600160a01b031690635d3b1d309060a4016020604051808303815f875af1158015614af0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190614b149190615a4a565b60408051808201825285815260208082018681525f858152600790925292812091518255915160019091015560098054929350909185908110614b5957614b5961586b565b5f91825260209091206010909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b5f82614bd98584614e99565b14949350505050565b614bec8282612fe1565b15610d2e575f828152601a602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b6060610bbe6001600160a01b03831660145b60605f614c3e836002615b3c565b614c49906002615b29565b6001600160401b03811115614c6057614c60615029565b6040519080825280601f01601f191660200182016040528015614c8a576020820181803683370190505b509050600360fc1b815f81518110614ca457614ca461586b565b60200101906001600160f81b03191690815f1a905350600f60fb1b81600181518110614cd257614cd261586b565b60200101906001600160f81b03191690815f1a9053505f614cf4846002615b3c565b614cff906001615b29565b90505b6001811115614d76576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614d3357614d3361586b565b1a60f81b828281518110614d4957614d4961586b565b60200101906001600160f81b03191690815f1a90535060049490941c93614d6f81615db6565b9050614d02565b50831561154f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c41565b815f03614e3057604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614dfe908990899088908790600401615dcb565b5f604051808303815f87803b158015614e15575f80fd5b505af1158015614e27573d5f803e3d5ffd5b505050506143d4565b604051637921219560e11b81526001600160a01b0385169063f242432a90614e649089908990889088908890600401615e07565b5f604051808303815f87803b158015614e7b575f80fd5b505af1158015614e8d573d5f803e3d5ffd5b50505050505050505050565b5f81815b84518110156140b5575f858281518110614eb957614eb961586b565b60200260200101519050808311614ede575f8381526020829052604090209250614eee565b5f81815260208490526040902092505b50600101614e9d565b828054828255905f5260205f20908101928215614f4a579160200282015b82811115614f4a57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614f15565b50614f56929150614f93565b5090565b828054828255905f5260205f20908101928215614f4a579160200282015b82811115614f4a578251825591602001919060010190614f78565b5b80821115614f56575f8155600101614f94565b5f8060408385031215614fb8575f80fd5b50508035926020909101359150565b5f60208284031215614fd7575f80fd5b81356001600160e01b03198116811461154f575f80fd5b5f60208284031215614ffe575f80fd5b5035919050565b6001600160a01b0381168114610ca7575f80fd5b803561502481615005565b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561506557615065615029565b604052919050565b5f82601f83011261507c575f80fd5b81356001600160401b0381111561509557615095615029565b6150a8601f8201601f191660200161503d565b8181528460208386010111156150bc575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f80608085870312156150eb575f80fd5b84356150f681615005565b9350602085013561510681615005565b92506040850135915060608501356001600160401b03811115615127575f80fd5b6151338782880161506d565b91505092959194509250565b5f6001600160401b0382111561515757615157615029565b5060051b60200190565b5f82601f830112615170575f80fd5b813560206151856151808361513f565b61503d565b8083825260208201915060208460051b8701019350868411156151a6575f80fd5b602086015b848110156151c257803583529183019183016151ab565b509695505050505050565b5f80604083850312156151de575f80fd5b8235915060208301356001600160401b038111156151fa575f80fd5b61520685828601615161565b9150509250929050565b8015158114610ca7575f80fd5b5f806040838503121561522e575f80fd5b823561523981615005565b9150602083013561524981615210565b809150509250929050565b5f60208284031215615264575f80fd5b813561154f81615005565b5f82601f83011261527e575f80fd5b8135602061528e6151808361513f565b8083825260208201915060208460051b8701019350868411156152af575f80fd5b602086015b848110156151c25780356152c781615005565b83529183019183016152b4565b5f805f805f805f805f6101208a8c0312156152ed575f80fd5b8935985060208a01356001600160401b038082111561530a575f80fd5b6153168d838e0161526f565b995060408c013591508082111561532b575f80fd5b6153378d838e01615161565b985060608c013591508082111561534c575f80fd5b506153598c828d01615161565b96505061536860808b01615019565b989b979a50959894979660a0860135965060c08601359560e0810135955061010001359350915050565b5f80604083850312156153a3575f80fd5b82359150602083013561524981615005565b602080825282518282018190525f919060409081850190868401855b8281101561540957815180516001600160a01b03168552868101518786015285015185850152606090930192908501906001016153d1565b5091979650505050505050565b5f8060408385031215615427575f80fd5b823561543281615005565b946020939093013593505050565b5f8060408385031215615451575f80fd5b82356001600160401b0380821115615467575f80fd5b6154738683870161526f565b93506020850135915080821115615488575f80fd5b5061520685828601615161565b634e487b7160e01b5f52602160045260245ffd5b6101a0810160058f106154ca57634e487b7160e01b5f52602160045260245ffd5b8e82528d60208301528c60408301528b60608301528a60808301526154fa60a083018b6001600160a01b03169052565b8860c083015261551560e08301896001600160a01b03169052565b866101008301526155326101208301876001600160a01b03169052565b8461014083015261554861016083018515159052565b826101808301529e9d5050505050505050505050505050565b5f805f60608486031215615573575f80fd5b833592506020840135915060408401356001600160401b03811115615596575f80fd5b6155a286828701615161565b9150509250925092565b5f602082840312156155bc575f80fd5b813563ffffffff8116811461154f575f80fd5b5f805f606084860312156155e1575f80fd5b83356001600160401b038111156155f6575f80fd5b61560286828701615161565b9660208601359650604090950135949350505050565b5f60208284031215615628575f80fd5b81356001600160401b038116811461154f575f80fd5b5f805f805f60a08688031215615652575f80fd5b853561565d81615005565b9450602086013561566d81615005565b935060408601356001600160401b0380821115615688575f80fd5b61569489838a01615161565b945060608801359150808211156156a9575f80fd5b6156b589838a01615161565b935060808801359150808211156156ca575f80fd5b506156d78882890161506d565b9150509295509295909350565b5f805f805f805f805f806101408b8d0312156156fe575f80fd5b6157078b615019565b995060208b0135985060408b0135975060608b01356001600160401b0380821115615730575f80fd5b61573c8e838f0161526f565b985060808d0135915080821115615751575f80fd5b61575d8e838f01615161565b975060a08d0135915080821115615772575f80fd5b5061577f8d828e01615161565b95505061578e60c08c01615019565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b5f805f80608085870312156157c9575f80fd5b843593506020850135925060408501356157e281615005565b915060608501356001600160401b038111156157fc575f80fd5b61513387828801615161565b5f805f805f60a0868803121561581c575f80fd5b853561582781615005565b9450602086013561583781615005565b9350604086013592506060860135915060808601356001600160401b0381111561585f575f80fd5b6156d78882890161506d565b634e487b7160e01b5f52603260045260245ffd5b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b5f602082840312156159f1575f80fd5b815161154f81615005565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b6001600160a01b03929092168252602082015260400190565b5f60208284031215615a5a575f80fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610bbe57610bbe615a98565b60208082526023908201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206040820152621bdd5d60ea1b606082015260800190565b634e487b7160e01b5f52601260045260245ffd5b5f82615b2457615b24615b02565b500690565b80820180821115610bbe57610bbe615a98565b8082028115828204841417610bbe57610bbe615a98565b5f60208284031215615b63575f80fd5b815161154f81615210565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b6020808252603c908201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260408201527f65207468616e206d617820656e74726965732070657220757365722e00000000606082015260800190565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b5f60018201615cc957615cc9615a98565b5060010190565b5f5b83811015615cea578181015183820152602001615cd2565b50505f910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f8351615d29816017850160208801615cd0565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d5a816028840160208801615cd0565b01602801949350505050565b5f8151808452615d7d816020860160208601615cd0565b601f01601f19169290920160200192915050565b602081525f61154f6020830184615d66565b5f82615db157615db1615b02565b500490565b5f81615dc457615dc4615a98565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90615dfd90830184615d66565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f90615e4090830184615d66565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca26469706673582212203b44b7d9f6b858cb2048e2afa3dfe06e49c9aaef9a6a7aaf4fed114d26baec0464736f6c63430008160033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
CRONOS | 100.00% | $0.16386 | 0.8226 | $0.134791 |
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.