Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 225 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Winner Raffl... | 17913244 | 536 days ago | IN | 0 ETH | 0.00307142 | ||||
Buy Entry | 17913052 | 536 days ago | IN | 0.011 ETH | 0.00345725 | ||||
Buy Entry | 17912901 | 536 days ago | IN | 0.011 ETH | 0.00235718 | ||||
Buy Entry | 17912560 | 536 days ago | IN | 0.0055 ETH | 0.00188322 | ||||
Buy Entry | 17901197 | 537 days ago | IN | 0.0055 ETH | 0.00302744 | ||||
Buy Entry | 17901100 | 537 days ago | IN | 0.0055 ETH | 0.00203823 | ||||
Set Winner Raffl... | 17888523 | 539 days ago | IN | 0 ETH | 0.00204456 | ||||
Buy Entry | 17888514 | 539 days ago | IN | 0 ETH | 0.00204076 | ||||
Buy Entry | 17888512 | 539 days ago | IN | 0 ETH | 0.00305132 | ||||
Buy Entry | 17888509 | 539 days ago | IN | 0 ETH | 0.00227868 | ||||
Buy Entry | 17888507 | 539 days ago | IN | 0 ETH | 0.00220472 | ||||
Buy Entry | 17888507 | 539 days ago | IN | 0 ETH | 0.00181775 | ||||
Buy Entry | 17888506 | 539 days ago | IN | 0 ETH | 0.00331086 | ||||
Buy Entry | 17888504 | 539 days ago | IN | 0 ETH | 0.00336542 | ||||
Buy Entry | 17888503 | 539 days ago | IN | 0 ETH | 0.00334544 | ||||
Buy Entry | 17888502 | 539 days ago | IN | 0 ETH | 0.00342685 | ||||
Buy Entry | 17888499 | 539 days ago | IN | 0 ETH | 0.00290759 | ||||
Buy Entry | 17888497 | 539 days ago | IN | 0 ETH | 0.00299064 | ||||
Buy Entry | 17888496 | 539 days ago | IN | 0 ETH | 0.00300897 | ||||
Buy Entry | 17888494 | 539 days ago | IN | 0 ETH | 0.00316009 | ||||
Buy Entry | 17888489 | 539 days ago | IN | 0 ETH | 0.0034255 | ||||
Buy Entry | 17888488 | 539 days ago | IN | 0 ETH | 0.00319883 | ||||
Buy Entry | 17888483 | 539 days ago | IN | 0 ETH | 0.00304665 | ||||
Buy Entry | 17888480 | 539 days ago | IN | 0 ETH | 0.00298186 | ||||
Buy Entry | 17888472 | 539 days ago | IN | 0 ETH | 0.00272865 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
RafldexV2_1
Compiler Version
v0.8.18+commit.87f61d96
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"; contract RafldexV2_1 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 UserBlacklisted(address _address); 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 RaffleSetNotToCancel(uint256 indexed raffleId, address creator); event RaffleCancelled(uint256 indexed raffleId, uint256 amountRaised); event SetWinnerTriggered(uint256 indexed raffleId, uint256 amountRaised); struct EntriesBought { address player; uint256[] currentEntriesLength; uint256 totalEntries; } 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; uint256 amountRaised; address creator; uint256 platformPercentage; address tokenPayment; uint256 entriesSold; bool canCancel; } RaffleStruct[] public raffles; struct RaffleCreationHolder { uint256 startTime; uint256 endTime; uint256 countRaffles; } mapping(bytes32 => RaffleCreationHolder) public raffleCreationData; mapping(address => uint256) public numberRafflesMonthCollection; 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.03 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 Subscribers; mapping(address => bool) public TokenPaymentAddresses; mapping(address => bool) public DiscountTokenPayments; bool public createEnabledHolders = false; bool public createEnabledSubscribers = false; 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 ) 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, amountRaised: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: new uint256[](1), totalEntries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle, _collateralAddress, _collateralId); 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 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, amountRaised: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: new uint256[](1), totalEntries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle, _collateralAddress, _collateralId); return idRaffle; } function createRaffleSubscriber( uint256 _endTime, address[] memory _collateralAddress, uint256[] memory _collateralId, uint256[] memory _tokenAmount, address _tokenPayment, uint256 _pricePerEntry, uint256 _maxEntriesRaffle, uint256 _maxEntriesUser ) external payable returns (uint256) { require( createEnabledSubscribers, "Create raffle noot set for subscribers." ); require( Subscribers[msg.sender], "Need to be subscriber to create raffle." ); 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, amountRaised: 0, creator: msg.sender, platformPercentage: _commissionInBasicPoints, tokenPayment: _tokenPayment, entriesSold: 0, canCancel: true }); raffles.push(raffle); uint256 idRaffle = raffles.length - 1; EntriesBought memory entryBought = EntriesBought({ player: address(0), currentEntriesLength: new uint256[](1), totalEntries: 0 }); entriesList[idRaffle].push(entryBought); delete entriesList[idRaffle][0]; emit RaffleCreated(idRaffle, _collateralAddress, _collateralId); return idRaffle; } function buyEntry(uint256 _raffleId, uint256 _numberEntries) 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.tokenPayment == address(0)) { require( msg.value == raffle.pricePerEntry * _numberEntries, "msg.value must be equal to the price" ); raffle.amountRaised += msg.value; } else { require( IERC20(raffle.tokenPayment).balanceOf(msg.sender) >= raffle.pricePerEntry * _numberEntries, "Need to have in wallet equal or more than ERC20 Token price" ); IERC20(raffle.tokenPayment).transferFrom( msg.sender, address(this), raffle.pricePerEntry * _numberEntries ); raffle.amountRaised += raffle.pricePerEntry * _numberEntries; } EntriesBought memory entryBought = EntriesBought({ player: msg.sender, currentEntriesLength: new uint256[](1), totalEntries: _numberEntries }); bool bought = false; for (uint256 i = 0; i < entriesList[_raffleId].length; i++) { if (entriesList[_raffleId][i].player == msg.sender) { require( entriesList[_raffleId][i].totalEntries + _numberEntries <= raffles[_raffleId].maxEntriesUser, "Bought too many entries" ); entriesList[_raffleId][i].currentEntriesLength.push( raffle.entriesSold + _numberEntries ); entriesList[_raffleId][i].totalEntries += _numberEntries; bought = true; break; } } if (!bought) { entriesList[_raffleId].push(entryBought); uint256 idEntry = entriesList[_raffleId].length - 1; entriesList[_raffleId][idEntry].currentEntriesLength[0] = raffle.entriesSold + _numberEntries; } 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); Subscribers[msg.sender] = true; emit GotSubscription(msg.sender); } function giveorRemoveSubscriptionTo( address[] memory _addresses, bool _isSubscriber ) external onlyRole(OPERATOR_ROLE, msg.sender) { for (uint256 i = 0; i < _addresses.length; i++) { Subscribers[_addresses[i]] = _isSubscriber; if (_isSubscriber == true) { emit GotSubscription(_addresses[i]); } } } function ChangeSubscriptionFee(uint256 _subscriptionfee) external onlyRole(OPERATOR_ROLE, msg.sender) { SUBSCRIPTION_PRICE = _subscriptionfee; } 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 _collection, uint256 _rafflesnumber ) external onlyRole(OPERATOR_ROLE, msg.sender) { numberRafflesMonthCollection[_collection] = _rafflesnumber; emit CollectionWhitelisted(_collection, _rafflesnumber); } function ChangeUserHolderCreateRaffleFee(uint256 _rafflefee) external onlyRole(OPERATOR_ROLE, msg.sender) { HOLDER_CREATE_RAFFLE_FEE = _rafflefee; } function ChangeUserHolderCreateRaffleFeeDiscount(uint256 _rafflefee) external onlyRole(OPERATOR_ROLE, msg.sender) { HOLDER_CREATE_RAFFLE_FEE_DISCOUNT = _rafflefee; } 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) { uint256 cumulativeSum = 0; address winner; EntriesBought[] storage entries = entriesList[_raffleId]; for (uint256 i = 0; i < entries.length; i++) { for ( uint256 j = 0; j < entries[i].currentEntriesLength.length; j++ ) { cumulativeSum += entries[i].currentEntriesLength[j]; if (cumulativeSum >= _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 amountForPlatform = (raffle.amountRaised * raffle.platformPercentage) / 10000; uint256 amountForSeller = raffle.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), raffle.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, raffle.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 { RaffleStruct storage raffle = raffles[_raffleId]; require( raffle.creator == msg.sender || hasRole(OPERATOR_ROLE, msg.sender), "Not raffle creator or Operator." ); if (msg.sender != raffle.creator) { require( raffle.endTime <= getCurrentTime() || raffle.entriesSold == raffle.entriesSupply, "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; if (entriesSold > 0) { requestRandomWords(_raffleId, entriesSold); } else { raffle.status = STATUS.DRAWING; transferNFTsAndFunds(_raffleId, raffle.randomNumber); } emit SetWinnerTriggered(_raffleId, raffle.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 usersLengthRaffle(uint256 _raffleId) public view returns (uint256) { return entriesList[_raffleId].length; } 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 usersLength = entriesList[_raffleId].length; require( usersLength <= 200, "Not cancelation available when it's more than 200 users." ); if (raffle.tokenPayment == address(0)) { for (uint256 i = 0; i < usersLength; i++) { address user = entriesList[_raffleId][i].player; if (user != address(0)) { uint256 amountToSend = raffle.pricePerEntry * entriesList[_raffleId][i].totalEntries; payable(user).transfer(amountToSend); } } } else { IERC20(raffle.tokenPayment).approve( address(this), raffle.amountRaised ); for (uint256 i = 0; i < usersLength; i++) { address user = entriesList[_raffleId][i].player; if (user != address(0)) { uint256 amountToSend = raffle.pricePerEntry * entriesList[_raffleId][i].totalEntries; 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, raffle.amountRaised); } 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; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.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 `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); } }
// 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.7.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 anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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.8.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) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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 10, 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 * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 v4.4.1 (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.7.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.8.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.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":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"},{"indexed":false,"internalType":"address[]","name":"nftAddress","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"nftId","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":"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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"UserBlacklisted","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":"uint256","name":"_subscriptionfee","type":"uint256"}],"name":"ChangeSubscriptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_id","type":"uint64"}],"name":"ChangeSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rafflefee","type":"uint256"}],"name":"ChangeUserHolderCreateRaffleFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rafflefee","type":"uint256"}],"name":"ChangeUserHolderCreateRaffleFeeDiscount","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":"Subscribers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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"}],"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":[],"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"}],"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"}],"name":"createRaffleSubscriber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","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":"totalEntries","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":"totalEntries","type":"uint256"}],"internalType":"struct RafldexV2_1.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":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"_isSubscriber","type":"bool"}],"name":"giveorRemoveSubscriptionTo","outputs":[],"stateMutability":"nonpayable","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":"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_1.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":"uint256","name":"amountRaised","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"}],"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":"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"},{"inputs":[{"internalType":"uint256","name":"_raffleId","type":"uint256"}],"name":"usersLengthRaffle","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a06040527f8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef600455600580546b032a00000001002625a000036001600160901b0319909116179055600c80546001600160a01b031916732300ae69d7d1ea0457ad79e822422888e3ee3e8717905566354a6ba7a18000600d5566470de4df820000600e55662386f26fc10000600f55666a94d74f4300006010556706f05b59d3b200006011556101f460125561015e60135561012c60145560966015556019805461ffff19169055348015620000d557600080fd5b5073271682deb8c4e0901d1a1550ad2e64d568e69909620000f6336200018d565b600180556001600160a01b0316608052600280546001600160a01b031990811673271682deb8c4e0901d1a1550ad2e64d568e69909179091556003805490911673514910771af9ca656af840dff83e8264ecf986ca1790556200017a7f523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0c33620001dd565b62000187600033620001dd565b62000249565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001e98282620001ed565b5050565b6000828152601a602090815260408083206001600160a01b038516845290915290205460ff16620001e9576000828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b608051615ecd6200026c6000396000818161146601526114a80152615ecd6000f3fe6080604052600436106103a25760003560e01c806388aaf2a9116101e7578063cf7874a31161010d578063e9d1badc116100a0578063f36914551161006f578063f369145514610b7a578063f5b541a614610b9a578063f860cec514610bbc578063ff0b906c14610bd157600080fd5b8063e9d1badc14610aee578063ead5c7bd14610b1b578063f23a6e6114610b2e578063f2fde38b14610b5a57600080fd5b8063d703ece8116100dc578063d703ece814610a82578063dadc9b4014610a98578063dd59e92c14610ab8578063e096839b14610ad857600080fd5b8063cf7874a3146109fe578063d0038ff414610a32578063d3c4d66414610a4c578063d547741f14610a6257600080fd5b8063a79bdca411610185578063bc0618c311610154578063bc0618c314610994578063bc197c81146109aa578063cb77c147146109d6578063cf482ee9146109eb57600080fd5b8063a79bdca414610911578063aaced47014610927578063acbb4eff14610954578063b66163a91461097457600080fd5b80638dfc13b6116101c15780638dfc13b61461089c57806391d14854146108bc5780639dde45da146108dc578063a217fddf146108fc57600080fd5b806388aaf2a91461082b57806388ec392c1461084a5780638da5cb5b1461086a57600080fd5b806346988a40116102cc5780636a890cb21161026a578063715018a611610239578063715018a61461078d578063719c0a13146107a257806381d12c58146107c25780638354a49c1461080b57600080fd5b80636a890cb2146107015780636bf3f8f6146107175780636cc735d5146107475780636fd969031461077757600080fd5b806350aa9dda116102a657806350aa9dda146106755780635d4bc0ce146106955780635fba3171146106ce57806369f26fb0146106e157600080fd5b806346988a401461061f5780634c72e7701461063f5780634c86bca11461065f57600080fd5b806321f4bd61116103445780632bb022b7116103135780632bb022b7146105655780632f2ff15d1461057b578063365e36581461059b5780634169933f146105c857600080fd5b806321f4bd61146104ef578063236854961461051f57806329cb924d1461053257806329dd67f91461054557600080fd5b80630f5e812e116103805780630f5e812e14610449578063150b7a021461046b5780631fe543e3146104af57806320c741b3146104cf57600080fd5b8063013805c5146103a757806301a6e623146103eb57806301ffc9a714610419575b600080fd5b3480156103b357600080fd5b506103c76103c2366004615057565b610bd9565b604080516001600160a01b0390931683526020830191909152015b60405180910390f35b3480156103f757600080fd5b5061040b6104063660046151d6565b610c1f565b6040519081526020016103e2565b34801561042557600080fd5b50610439610434366004615293565b611341565b60405190151581526020016103e2565b34801561045557600080fd5b506104696104643660046152bd565b611378565b005b34801561047757600080fd5b50610496610486366004615345565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103e2565b3480156104bb57600080fd5b506104696104ca3660046153b0565b61145b565b3480156104db57600080fd5b506104696104ea366004615404565b6114e3565b3480156104fb57600080fd5b5061043961050a36600461543d565b60176020526000908152604090205460ff1681565b61046961052d366004615057565b61152a565b34801561053e57600080fd5b504261040b565b34801561055157600080fd5b506104696105603660046152bd565b611cb7565b34801561057157600080fd5b5061040b60105481565b34801561058757600080fd5b5061046961059636600461545a565b611cd8565b3480156105a757600080fd5b506105bb6105b63660046152bd565b611d02565b6040516103e2919061547f565b3480156105d457600080fd5b506106046105e33660046152bd565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103e2565b34801561062b57600080fd5b5061040b61063a366004615533565b611de2565b34801561064b57600080fd5b5061046961065a3660046152bd565b611e69565b34801561066b57600080fd5b5061040b600e5481565b34801561068157600080fd5b5061046961069036600461555f565b611e8a565b3480156106a157600080fd5b506106b56106b03660046152bd565b611f7c565b6040516103e29d9c9b9a999897969594939291906155bb565b6104696106dc3660046152bd565b61200a565b3480156106ed57600080fd5b506104696106fc36600461543d565b61270c565b34801561070d57600080fd5b5061040b60115481565b34801561072357600080fd5b5061043961073236600461543d565b60186020526000908152604090205460ff1681565b34801561075357600080fd5b5061043961076236600461543d565b60166020526000908152604090205460ff1681565b34801561078357600080fd5b5061040b60145481565b34801561079957600080fd5b50610469612736565b3480156107ae57600080fd5b5061040b6107bd3660046152bd565b61274a565b3480156107ce57600080fd5b506107f66107dd3660046152bd565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103e2565b34801561081757600080fd5b506104696108263660046152bd565b6128d7565b34801561083757600080fd5b5060195461043990610100900460ff1681565b34801561085657600080fd5b506104696108653660046152bd565b6128f8565b34801561087657600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103e2565b3480156108a857600080fd5b506104696108b7366004615675565b612b03565b3480156108c857600080fd5b506104396108d736600461545a565b612b43565b3480156108e857600080fd5b506104696108f736600461569b565b612b6e565b34801561090857600080fd5b5061040b600081565b34801561091d57600080fd5b5061040b600d5481565b34801561093357600080fd5b5061040b61094236600461543d565b600b6020526000908152604090205481565b34801561096057600080fd5b5061046961096f3660046152bd565b612bb7565b34801561098057600080fd5b5061046961098f3660046152bd565b612bd8565b3480156109a057600080fd5b5061040b60135481565b3480156109b657600080fd5b506104966109c53660046156c4565b63bc197c8160e01b95945050505050565b3480156109e257600080fd5b50610469612bf9565b61040b6109f9366004615771565b612c32565b348015610a0a57600080fd5b506107f6610a193660046152bd565b6007602052600090815260409020805460019091015482565b348015610a3e57600080fd5b506019546104399060ff1681565b348015610a5857600080fd5b5061040b60125481565b348015610a6e57600080fd5b50610469610a7d36600461545a565b613603565b348015610a8e57600080fd5b5061040b60155481565b348015610aa457600080fd5b50610469610ab3366004615404565b613627565b348015610ac457600080fd5b50610469610ad3366004615533565b6136b2565b348015610ae457600080fd5b5061040b600f5481565b348015610afa57600080fd5b5061040b610b093660046152bd565b60009081526008602052604090205490565b61040b610b293660046151d6565b61371d565b348015610b3a57600080fd5b50610496610b4936600461584c565b63f23a6e6160e01b95945050505050565b348015610b6657600080fd5b50610469610b7536600461543d565b613f3b565b348015610b8657600080fd5b50610884610b95366004615057565b613fb1565b348015610ba657600080fd5b5061040b600080516020615e7883398151915281565b348015610bc857600080fd5b506104696140fd565b61046961412d565b60086020528160005260406000208181548110610bf557600080fd5b6000918252602090912060039091020180546002909101546001600160a01b039091169250905082565b6000600080516020615e7883398151915233610c3b82826141d8565b428b11610c635760405162461bcd60e51b8152600401610c5a906158b4565b60405180910390fd5b88518a5114610cc35760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c5a565b87518a5114610ce45760405162461bcd60e51b8152600401610c5a906158f8565b60008511610d045760405162461bcd60e51b8152600401610c5a90615948565b600084118015610d145750848411155b610d305760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b03871615610d77576001600160a01b03871660009081526017602052604090205460ff16610d775760405162461bcd60e51b8152600401610c5a906159ba565b60005b8a51811015610fd05760006001600160a01b03168b8281518110610da057610da06159f1565b60200260200101516001600160a01b031603610dce5760405162461bcd60e51b8152600401610c5a90615a07565b888181518110610de057610de06159f1565b6020026020010151600003610ecb5760008b8281518110610e0357610e036159f1565b60200260200101519050806001600160a01b0316636352211e8c8481518110610e2e57610e2e6159f1565b60200260200101516040518263ffffffff1660e01b8152600401610e5491815260200190565b602060405180830381865afa158015610e71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e959190615a2c565b6001600160a01b0316336001600160a01b031614610ec55760405162461bcd60e51b8152600401610c5a90615a49565b50610fbe565b60008b8281518110610edf57610edf6159f1565b60200260200101519050898281518110610efb57610efb6159f1565b6020026020010151816001600160a01b031662fdd58e338e8681518110610f2457610f246159f1565b60200260200101516040518363ffffffff1660e01b8152600401610f5d9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610f7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9e9190615a7e565b1015610fbc5760405162461bcd60e51b8152600401610c5a90615a97565b505b80610fc881615ae4565b915050610d7a565b506000610fe033308d8d8d614231565b60408051610200810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e0810188905260006101008201819052610120820181905261014082018190523361016083015261018082018590526001600160a01b038c166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156110c6576110c66155a5565b02179055506020828101516001830155604083015180516110ed9260028501920190614f88565b5060608201518051611109916003840191602090910190614fed565b5060808201518051611125916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff1916911515919091179055546000906111f490600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b03909316929092178255838301518051949550859492936112959392850192910190614fed565b506040918201516002909101556000838152600860205290812080549091906112c0576112c06159f1565b60009182526020822060039091020180546001600160a01b0319168155906112eb6001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611327929190615b10565b60405180910390a2509d9c50505050505050505050505050565b60006001600160e01b03198216630271189760e51b148061137257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6113806142bf565b600060098281548110611395576113956159f1565b60009182526020909120600b601090920201908101549091506001600160a01b031633146113fb5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c5a565b600f81015460ff16151560010361144e57600f8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b5061145860018055565b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146114d55760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610c5a565b6114df8282614318565b5050565b600080516020615e78833981519152336114fd82826141d8565b50506001600160a01b03919091166000908152601860205260409020805460ff1916911515919091179055565b60006009838154811061153f5761153f6159f1565b906000526020600020906010020190506115564290565b8160010154116115a05760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c5a565b6000815460ff1660048111156115b8576115b86155a5565b146116055760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610c5a565b600082118015611619575080600701548211155b61168b5760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610c5a565b336116d85760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c5a565b600983815481106116eb576116eb6159f1565b9060005260206000209060100201600501548282600e015461170d9190615b94565b111561175b5760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c5a565b600d8101546001600160a01b03166117ba5781816006015461177d9190615ba7565b341461179b5760405162461bcd60e51b8152600401610c5a90615bbe565b3481600a0160008282546117af9190615b94565b909155506119629050565b8181600601546117ca9190615ba7565b600d8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118389190615a7e565b10156118ac5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610c5a565b600d81015460068201546001600160a01b03909116906323b872dd90339030906118d7908790615ba7565b6040518463ffffffff1660e01b81526004016118f593929190615c02565b6020604051808303816000875af1158015611914573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119389190615c26565b508181600601546119499190615ba7565b81600a01600082825461195c9190615b94565b90915550505b6040805160608101825233815281516001808252818401909352600092602083019190816020016020820280368337505050815260200184905290506000805b600086815260086020526040902054811015611b695760008681526008602052604090208054339190839081106119db576119db6159f1565b60009182526020909120600390910201546001600160a01b031603611b575760098681548110611a0d57611a0d6159f1565b90600052602060002090601002016007015485600860008981526020019081526020016000208381548110611a4457611a446159f1565b906000526020600020906003020160020154611a609190615b94565b1115611aae5760405162461bcd60e51b815260206004820152601760248201527f426f7567687420746f6f206d616e7920656e74726965730000000000000000006044820152606401610c5a565b6000868152600860205260409020805482908110611ace57611ace6159f1565b90600052602060002090600302016001018585600e0154611aef9190615b94565b815460018101835560009283526020808420909101919091558782526008905260409020805486919083908110611b2857611b286159f1565b90600052602060002090600302016002016000828254611b489190615b94565b9091555060019250611b699050565b80611b6181615ae4565b9150506119a2565b5080611c55576000858152600860209081526040822080546001808201835591845292829020855160039094020180546001600160a01b0319166001600160a01b03909416939093178355848201518051869493611bcb938501920190614fed565b506040918201516002909101556000868152600860205290812054611bf290600190615afd565b90508484600e0154611c049190615b94565b6000878152600860205260409020805483908110611c2457611c246159f1565b9060005260206000209060030201600101600081548110611c4757611c476159f1565b600091825260209091200155505b8383600e016000828254611c699190615b94565b9091555050600e8301546040805191825260208201869052339187917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a35050505050565b600080516020615e7883398151915233611cd182826141d8565b5050600455565b600080516020615e7883398151915233611cf282826141d8565b611cfc848461444f565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611dd7576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600181018054835181870281018701909452808452939491938583019392830182828015611db557602002820191906000526020600020905b815481526020019060010190808311611da1575b5050505050815260200160028201548152505081526020019060010190611d37565b505050509050919050565b6001600160a01b0382166000908152600b6020526040812054819015611e6257604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b9093529290912054611e5e9190615afd565b9150505b9392505050565b600080516020615e7883398151915233611e8382826141d8565b5050600e55565b600080516020615e7883398151915233611ea482826141d8565b60005b8451811015611f75578360166000878481518110611ec757611ec76159f1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055831515600103611f63577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73858281518110611f3657611f366159f1565b6020026020010151604051611f5a91906001600160a01b0391909116815260200190565b60405180910390a15b80611f6d81615ae4565b915050611ea7565b5050505050565b60098181548110611f8c57600080fd5b600091825260209091206010909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e8c0154600f909c015460ff9b8c169d50999b989a979996986001600160a01b039687169895979496938416959294919093169291168d565b6120126142bf565b600060098281548110612027576120276159f1565b60009182526020909120600b601090920201908101549091506001600160a01b03163314806120695750612069600080516020615e7883398151915233612b43565b6120b55760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c5a565b428160010154116120d85760405162461bcd60e51b8152600401610c5a906158b4565b6000815460ff1660048111156120f0576120f06155a5565b1461212c5760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c5a565b612144600080516020615e7883398151915233612b43565b61227f57600f81015460ff166121905760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c5a565b80600e01546000036121ef5734156121ea5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c5a565b61227f565b6010543410156122415760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c5a565b600c546010546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561227d573d6000803e3d6000fd5b505b60008281526008602052604090205460c88111156123055760405162461bcd60e51b815260206004820152603860248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e206960448201527f742773206d6f7265207468616e203230302075736572732e00000000000000006064820152608401610c5a565b600d8201546001600160a01b03166123fa5760005b818110156123f4576000848152600860205260408120805483908110612342576123426159f1565b60009182526020909120600390910201546001600160a01b0316905080156123e1576000858152600860205260408120805484908110612384576123846159f1565b90600052602060002090600302016002015485600601546123a59190615ba7565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f193505050501580156123de573d6000803e3d6000fd5b50505b50806123ec81615ae4565b91505061231a565b50612598565b600d820154600a83015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015612453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124779190615c26565b5060005b818110156125965760008481526008602052604081208054839081106124a3576124a36159f1565b60009182526020909120600390910201546001600160a01b0316905080156125835760008581526008602052604081208054849081106124e5576124e56159f1565b90600052602060002090600302016002015485600601546125069190615ba7565b600d8601546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd9061253d90309086908690600401615c02565b6020604051808303816000875af115801561255c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125809190615c26565b50505b508061258e81615ae4565b91505061247b565b505b6126bc3083600b0160009054906101000a90046001600160a01b03168460020180548060200260200160405190810160405280929190818152602001828054801561260c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116125ee575b50505050508560030180548060200260200160405190810160405280929190818152602001828054801561265f57602002820191906000526020600020905b81548152602001906001019080831161264b575b5050505050866004018054806020026020016040519081016040528092919081815260200182805480156126b257602002820191906000526020600020905b81548152602001906001019080831161269e575b5050505050614231565b815460ff19166004178255600a82015460405190815283907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed29060200160405180910390a2505061145860018055565b61271461448e565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b61273e61448e565b61274860006144e8565b565b6000600080516020615e788339815191523361276682826141d8565b60006009858154811061277b5761277b6159f1565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601090930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af115801561281e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128429190615a7e565b604080518082018252878152600e8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b600080516020615e78833981519152336128f182826141d8565b5050601055565b60006009828154811061290d5761290d6159f1565b60009182526020909120600b601090920201908101549091506001600160a01b031633148061294f575061294f600080516020615e7883398151915233612b43565b61299b5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c5a565b600b8101546001600160a01b03163314612a21574281600101541115806129c95750806005015481600e0154145b612a215760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610c5a565b6000815460ff166004811115612a3957612a396155a5565b14612a7f5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c5a565b805460ff19166001178155600e8101548015612aa557612a9f8382614538565b50612ac0565b815460ff191660021782556009820154612ac09084906146a9565b827ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6883600a0154604051612af691815260200190565b60405180910390a2505050565b600080516020615e7883398151915233612b1d82826141d8565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615e7883398151915233612b8882826141d8565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b600080516020615e7883398151915233612bd182826141d8565b5050600f55565b600080516020615e7883398151915233612bf282826141d8565b5050601155565b600080516020615e7883398151915233612c1382826141d8565b50506019805461ff001981166101009182900460ff1615909102179055565b60195460009060ff16612c925760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c5a565b428911612cb15760405162461bcd60e51b8152600401610c5a906158b4565b8651885114612cd25760405162461bcd60e51b8152600401610c5a90615c43565b8551885114612cf35760405162461bcd60e51b8152600401610c5a906158f8565b60008311612d135760405162461bcd60e51b8152600401610c5a90615948565b600082118015612d235750828211155b612d3f5760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b03851615612d86576001600160a01b03851660009081526017602052604090205460ff16612d865760405162461bcd60e51b8152600401610c5a906159ba565b60005b8851811015612fdf5760006001600160a01b0316898281518110612daf57612daf6159f1565b60200260200101516001600160a01b031603612ddd5760405162461bcd60e51b8152600401610c5a90615a07565b868181518110612def57612def6159f1565b6020026020010151600003612eda576000898281518110612e1257612e126159f1565b60200260200101519050806001600160a01b0316636352211e8a8481518110612e3d57612e3d6159f1565b60200260200101516040518263ffffffff1660e01b8152600401612e6391815260200190565b602060405180830381865afa158015612e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea49190615a2c565b6001600160a01b0316336001600160a01b031614612ed45760405162461bcd60e51b8152600401610c5a90615a49565b50612fcd565b6000898281518110612eee57612eee6159f1565b60200260200101519050878281518110612f0a57612f0a6159f1565b6020026020010151816001600160a01b031662fdd58e338c8681518110612f3357612f336159f1565b60200260200101516040518363ffffffff1660e01b8152600401612f6c9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015612f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fad9190615a7e565b1015612fcb5760405162461bcd60e51b8152600401610c5a90615a97565b505b80612fd781615ae4565b915050612d89565b506001600160a01b03851660009081526018602052604081205460ff161561303957600d54600f546130119190615b94565b3410156130305760405162461bcd60e51b8152600401610c5a90615c98565b5060135461306d565b600d54600e546130499190615b94565b3410156130685760405162461bcd60e51b8152600401610c5a90615c98565b506012545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156130b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130da9190615a2c565b6001600160a01b0316146131305760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c5a565b604080516001600160a01b038f1660208201529081018d905260009060600160405160208183030381529060405280519060200120905061316e4290565b6000828152600a6020526040902060010154111561321f5760006131928f8f611de2565b116131f85760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c5a565b6000818152600a6020526040812060020180549161321583615ae4565b9190505550613259565b426000828152600a60205260409020554261323d9062278d00615b94565b6000828152600a60205260409020600180820192909255600201555b61326633308d8d8d614231565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f1935050505015801561329f573d6000803e3d6000fd5b5060408051610200810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e0810188905260006101008201819052610120820181905261014082018190523361016083015261018082018790526001600160a01b038c166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613386576133866155a5565b02179055506020828101516001830155604083015180516133ad9260028501920190614f88565b50606082015180516133c9916003840191602090910190614fed565b50608082015180516133e5916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff1916911515919091179055546000906134b490600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b03909316929092178255838301518051949550859492936135559392850192910190614fed565b50604091820151600290910155600083815260086020529081208054909190613580576135806159f1565b60009182526020822060039091020180546001600160a01b0319168155906135ab6001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f6040516135e7929190615b10565b60405180910390a2509f9e505050505050505050505050505050565b600080516020615e788339815191523361361d82826141d8565b611cfc8484614cbf565b600080516020615e788339815191523361364182826141d8565b6001600160a01b0384166000908152601760205260409020805460ff1916841515908117909155600103611cfc576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c733906020015b60405180910390a150505050565b600080516020615e78833981519152336136cc82826141d8565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d91016136a4565b601954600090610100900460ff166137875760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c5a565b3360009081526016602052604090205460ff166137f65760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610c5a565b4289116138155760405162461bcd60e51b8152600401610c5a906158b4565b86518851146138365760405162461bcd60e51b8152600401610c5a90615c43565b85518851146138575760405162461bcd60e51b8152600401610c5a906158f8565b600d543410156138795760405162461bcd60e51b8152600401610c5a90615c98565b600083116138995760405162461bcd60e51b8152600401610c5a90615948565b6000821180156138a95750828211155b6138c55760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b0385161561390c576001600160a01b03851660009081526017602052604090205460ff1661390c5760405162461bcd60e51b8152600401610c5a906159ba565b60005b8851811015613b655760006001600160a01b0316898281518110613935576139356159f1565b60200260200101516001600160a01b0316036139635760405162461bcd60e51b8152600401610c5a90615a07565b868181518110613975576139756159f1565b6020026020010151600003613a60576000898281518110613998576139986159f1565b60200260200101519050806001600160a01b0316636352211e8a84815181106139c3576139c36159f1565b60200260200101516040518263ffffffff1660e01b81526004016139e991815260200190565b602060405180830381865afa158015613a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a2a9190615a2c565b6001600160a01b0316336001600160a01b031614613a5a5760405162461bcd60e51b8152600401610c5a90615a49565b50613b53565b6000898281518110613a7457613a746159f1565b60200260200101519050878281518110613a9057613a906159f1565b6020026020010151816001600160a01b031662fdd58e338c8681518110613ab957613ab96159f1565b60200260200101516040518363ffffffff1660e01b8152600401613af29291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b339190615a7e565b1015613b515760405162461bcd60e51b8152600401610c5a90615a97565b505b80613b5d81615ae4565b91505061390f565b506001600160a01b03851660009081526018602052604081205460ff1615613b905750601554613b95565b506014545b613ba233308b8b8b614231565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613bdb573d6000803e3d6000fd5b5060408051610200810190915260009080828152602081018d9052604081018c9052606081018b9052608081018a905260a0810187905260c0810188905260e0810186905260006101008201819052610120820181905261014082018190523361016083015261018082018590526001600160a01b038a166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613cc257613cc26155a5565b0217905550602082810151600183015560408301518051613ce99260028501920190614f88565b5060608201518051613d05916003840191602090910190614fed565b5060808201518051613d21916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff191691151591909117905554600090613df090600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b0390931692909217825583830151805194955085949293613e919392850192910190614fed565b50604091820151600290910155600083815260086020529081208054909190613ebc57613ebc6159f1565b60009182526020822060039091020180546001600160a01b031916815590613ee76001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613f23929190615b10565b60405180910390a2509b9a5050505050505050505050565b613f4361448e565b6001600160a01b038116613fa85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c5a565b611458816144e8565b600082815260086020526040812081908190815b81548110156140aa5760005b828281548110613fe357613fe36159f1565b90600052602060002090600302016001018054905081101561409757828281548110614011576140116159f1565b90600052602060002090600302016001018181548110614033576140336159f1565b9060005260206000200154856140499190615b94565b945086851061408557828281548110614064576140646159f1565b60009182526020909120600390910201546001600160a01b03169350614097565b8061408f81615ae4565b915050613fd1565b50806140a281615ae4565b915050613fc5565b506001600160a01b0382166140f45760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c5a565b50949350505050565b600080516020615e788339815191523361411782826141d8565b50506019805460ff19811660ff90911615179055565b601154341461414e5760405162461bcd60e51b8152600401610c5a90615bbe565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015614187573d6000803e3d6000fd5b5033600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b6141e28282612b43565b6114df576141ef81614cfc565b6141fa836020614d0e565b60405160200161420b929190615cec565b60408051601f198184030181529082905262461bcd60e51b8252610c5a91600401615d8d565b60005b82518110156142b7576142a58686868481518110614254576142546159f1565b602002602001015186858151811061426e5761426e6159f1565b6020026020010151868681518110614288576142886159f1565b602002602001015160405180602001604052806000815250614ea9565b806142af81615ae4565b915050614234565b505050505050565b6002600154036143115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c5a565b6002600155565b60008281526007602052604081206001015482518390839061433c5761433c6159f1565b602002602001015161434e9190615db6565b614359906001615b94565b600084815260076020526040812054600980549394509192811061437f5761437f6159f1565b9060005260206000209060100201905081816009018190555060006040518060400160405280856000815181106143b8576143b86159f1565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a2600085815260076020526040902054611f7590846146a9565b6144598282612b43565b6114df576000828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6000546001600160a01b031633146127485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c5a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156145ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145ee9190615a7e565b60408051808201825285815260208082018681526000858152600790925292812091518255915160019091015560098054929350909185908110614634576146346159f1565b600091825260209091206010909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6146b16142bf565b6000600983815481106146c6576146c66159f1565b6000918252602090912060109091020190506002815460ff1660048111156146f0576146f06155a5565b146147365760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c5a565b60098101829055600e81015415614756576147518383613fb1565b614765565b600b8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b0392909216918217905560028201805460408051602080840282018101909252828152614893943094909391929091908301828280156147e557602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116147c7575b50505050508460030180548060200260200160405190810160405280929190818152602001828054801561483857602002820191906000526020600020905b815481526020019060010190808311614824575b5050505050856004018054806020026020016040519081016040528092919081815260200182805480156126b2576020028201919060005260206000209081548152602001906001019080831161269e575050505050614231565b600061271082600c015483600a01546148ac9190615ba7565b6148b69190615dca565b905060008183600a01546148ca9190615afd565b600d8401549091506001600160a01b0316614a2357600b8301546040516000916001600160a01b03169083908381818185875af1925050503d806000811461492e576040519150601f19603f3d011682016040523d82523d6000602084013e614933565b606091505b50509050806149795760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c5a565b600c546040516000916001600160a01b03169085908381818185875af1925050503d80600081146149c6576040519150601f19603f3d011682016040523d82523d6000602084013e6149cb565b606091505b5050905080614a1c5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c5a565b5050614c51565b600d830154600a84015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614aa09190615c26565b50600d830154600b8401546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614adf92309216908790600401615c02565b6020604051808303816000875af1158015614afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b229190615c26565b905080614b715760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c5a565b600d840154600c546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614bad92309216908990600401615c02565b6020604051808303816000875af1158015614bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bf09190615c26565b905080614c4e5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c5a565b50505b825460ff191660031783556008830154600a84015460098501546040805192835260208301919091526001600160a01b039092169187917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a35050506114df60018055565b614cc98282612b43565b156114df576000828152601a602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113726001600160a01b03831660145b60606000614d1d836002615ba7565b614d28906002615b94565b6001600160401b03811115614d3f57614d3f615079565b6040519080825280601f01601f191660200182016040528015614d69576020820181803683370190505b509050600360fc1b81600081518110614d8457614d846159f1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614db357614db36159f1565b60200101906001600160f81b031916908160001a9053506000614dd7846002615ba7565b614de2906001615b94565b90505b6001811115614e5a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614e1657614e166159f1565b1a60f81b828281518110614e2c57614e2c6159f1565b60200101906001600160f81b031916908160001a90535060049490941c93614e5381615dde565b9050614de5565b508315611e625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c5a565b81600003614f1a57604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614ee3908990899088908790600401615df5565b600060405180830381600087803b158015614efd57600080fd5b505af1158015614f11573d6000803e3d6000fd5b505050506142b7565b604051637921219560e11b81526001600160a01b0385169063f242432a90614f4e9089908990889088908890600401615e32565b600060405180830381600087803b158015614f6857600080fd5b505af1158015614f7c573d6000803e3d6000fd5b50505050505050505050565b828054828255906000526020600020908101928215614fdd579160200282015b82811115614fdd57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614fa8565b50614fe9929150615042565b5090565b828054828255906000526020600020908101928215614fdd579160200282015b82811115614fdd57825182559160200191906001019061500d565b508054600082559060005260206000209081019061145891905b5b80821115614fe95760008155600101615043565b6000806040838503121561506a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156150b7576150b7615079565b604052919050565b60006001600160401b038211156150d8576150d8615079565b5060051b60200190565b6001600160a01b038116811461145857600080fd5b8035615102816150e2565b919050565b600082601f83011261511857600080fd5b8135602061512d615128836150bf565b61508f565b82815260059290921b8401810191818101908684111561514c57600080fd5b8286015b84811015615170578035615163816150e2565b8352918301918301615150565b509695505050505050565b600082601f83011261518c57600080fd5b8135602061519c615128836150bf565b82815260059290921b840181019181810190868411156151bb57600080fd5b8286015b8481101561517057803583529183019183016151bf565b600080600080600080600080610100898b0312156151f357600080fd5b8835975060208901356001600160401b038082111561521157600080fd5b61521d8c838d01615107565b985060408b013591508082111561523357600080fd5b61523f8c838d0161517b565b975060608b013591508082111561525557600080fd5b506152628b828c0161517b565b95505061527160808a016150f7565b979a969950949793969560a0850135955060c08501359460e001359350915050565b6000602082840312156152a557600080fd5b81356001600160e01b031981168114611e6257600080fd5b6000602082840312156152cf57600080fd5b5035919050565b600082601f8301126152e757600080fd5b81356001600160401b0381111561530057615300615079565b615313601f8201601f191660200161508f565b81815284602083860101111561532857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561535b57600080fd5b8435615366816150e2565b93506020850135615376816150e2565b92506040850135915060608501356001600160401b0381111561539857600080fd5b6153a4878288016152d6565b91505092959194509250565b600080604083850312156153c357600080fd5b8235915060208301356001600160401b038111156153e057600080fd5b6153ec8582860161517b565b9150509250929050565b801515811461145857600080fd5b6000806040838503121561541757600080fd5b8235615422816150e2565b91506020830135615432816153f6565b809150509250929050565b60006020828403121561544f57600080fd5b8135611e62816150e2565b6000806040838503121561546d57600080fd5b823591506020830135615432816150e2565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561552457898403603f19018652825180516001600160a01b031685528881015160608a8701819052815190870181905260808701918b019085905b808210156155065782518452928c0192918c0191600191909101906154e6565b505050908801519488019490945294870194918701916001016154a7565b50919998505050505050505050565b6000806040838503121561554657600080fd5b8235615551816150e2565b946020939093013593505050565b6000806040838503121561557257600080fd5b82356001600160401b0381111561558857600080fd5b61559485828601615107565b9250506020830135615432816153f6565b634e487b7160e01b600052602160045260246000fd5b6101a0810160058f106155de57634e487b7160e01b600052602160045260246000fd5b8e82528d60208301528c60408301528b60608301528a608083015261560e60a083018b6001600160a01b03169052565b8860c08301528760e08301526156306101008301886001600160a01b03169052565b8561012083015261564d6101408301866001600160a01b03169052565b8361016083015261566361018083018415159052565b9e9d5050505050505050505050505050565b60006020828403121561568757600080fd5b813563ffffffff81168114611e6257600080fd5b6000602082840312156156ad57600080fd5b81356001600160401b0381168114611e6257600080fd5b600080600080600060a086880312156156dc57600080fd5b85356156e7816150e2565b945060208601356156f7816150e2565b935060408601356001600160401b038082111561571357600080fd5b61571f89838a0161517b565b9450606088013591508082111561573557600080fd5b61574189838a0161517b565b9350608088013591508082111561575757600080fd5b50615764888289016152d6565b9150509295509295909350565b6000806000806000806000806000806101408b8d03121561579157600080fd5b61579a8b6150f7565b995060208b0135985060408b0135975060608b01356001600160401b03808211156157c457600080fd5b6157d08e838f01615107565b985060808d01359150808211156157e657600080fd5b6157f28e838f0161517b565b975060a08d013591508082111561580857600080fd5b506158158d828e0161517b565b95505061582460c08c016150f7565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b600080600080600060a0868803121561586457600080fd5b853561586f816150e2565b9450602086013561587f816150e2565b9350604086013592506060860135915060808601356001600160401b038111156158a857600080fd5b615764888289016152d6565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b600060208284031215615a3e57600080fd5b8151611e62816150e2565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b600060208284031215615a9057600080fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201615af657615af6615ace565b5060010190565b8181038181111561137257611372615ace565b604080825283519082018190526000906020906060840190828701845b82811015615b525781516001600160a01b031684529284019290840190600101615b2d565b5050508381038285015284518082528583019183019060005b81811015615b8757835183529284019291840191600101615b6b565b5090979650505050505050565b8082018082111561137257611372615ace565b808202811582820484141761137257611372615ace565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615c3857600080fd5b8151611e62816153f6565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b83811015615ce3578181015183820152602001615ccb565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615d24816017850160208801615cc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d55816028840160208801615cc8565b01602801949350505050565b60008151808452615d79816020860160208601615cc8565b601f01601f19169290920160200192915050565b602081526000611e626020830184615d61565b634e487b7160e01b600052601260045260246000fd5b600082615dc557615dc5615da0565b500690565b600082615dd957615dd9615da0565b500490565b600081615ded57615ded615ace565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615e2890830184615d61565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615e6c90830184615d61565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220cb930d4c4422e2a8b39026a55c0297655ff50fb79b600a9e5e544f6755ddcb2064736f6c63430008120033
Deployed Bytecode
0x6080604052600436106103a25760003560e01c806388aaf2a9116101e7578063cf7874a31161010d578063e9d1badc116100a0578063f36914551161006f578063f369145514610b7a578063f5b541a614610b9a578063f860cec514610bbc578063ff0b906c14610bd157600080fd5b8063e9d1badc14610aee578063ead5c7bd14610b1b578063f23a6e6114610b2e578063f2fde38b14610b5a57600080fd5b8063d703ece8116100dc578063d703ece814610a82578063dadc9b4014610a98578063dd59e92c14610ab8578063e096839b14610ad857600080fd5b8063cf7874a3146109fe578063d0038ff414610a32578063d3c4d66414610a4c578063d547741f14610a6257600080fd5b8063a79bdca411610185578063bc0618c311610154578063bc0618c314610994578063bc197c81146109aa578063cb77c147146109d6578063cf482ee9146109eb57600080fd5b8063a79bdca414610911578063aaced47014610927578063acbb4eff14610954578063b66163a91461097457600080fd5b80638dfc13b6116101c15780638dfc13b61461089c57806391d14854146108bc5780639dde45da146108dc578063a217fddf146108fc57600080fd5b806388aaf2a91461082b57806388ec392c1461084a5780638da5cb5b1461086a57600080fd5b806346988a40116102cc5780636a890cb21161026a578063715018a611610239578063715018a61461078d578063719c0a13146107a257806381d12c58146107c25780638354a49c1461080b57600080fd5b80636a890cb2146107015780636bf3f8f6146107175780636cc735d5146107475780636fd969031461077757600080fd5b806350aa9dda116102a657806350aa9dda146106755780635d4bc0ce146106955780635fba3171146106ce57806369f26fb0146106e157600080fd5b806346988a401461061f5780634c72e7701461063f5780634c86bca11461065f57600080fd5b806321f4bd61116103445780632bb022b7116103135780632bb022b7146105655780632f2ff15d1461057b578063365e36581461059b5780634169933f146105c857600080fd5b806321f4bd61146104ef578063236854961461051f57806329cb924d1461053257806329dd67f91461054557600080fd5b80630f5e812e116103805780630f5e812e14610449578063150b7a021461046b5780631fe543e3146104af57806320c741b3146104cf57600080fd5b8063013805c5146103a757806301a6e623146103eb57806301ffc9a714610419575b600080fd5b3480156103b357600080fd5b506103c76103c2366004615057565b610bd9565b604080516001600160a01b0390931683526020830191909152015b60405180910390f35b3480156103f757600080fd5b5061040b6104063660046151d6565b610c1f565b6040519081526020016103e2565b34801561042557600080fd5b50610439610434366004615293565b611341565b60405190151581526020016103e2565b34801561045557600080fd5b506104696104643660046152bd565b611378565b005b34801561047757600080fd5b50610496610486366004615345565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016103e2565b3480156104bb57600080fd5b506104696104ca3660046153b0565b61145b565b3480156104db57600080fd5b506104696104ea366004615404565b6114e3565b3480156104fb57600080fd5b5061043961050a36600461543d565b60176020526000908152604090205460ff1681565b61046961052d366004615057565b61152a565b34801561053e57600080fd5b504261040b565b34801561055157600080fd5b506104696105603660046152bd565b611cb7565b34801561057157600080fd5b5061040b60105481565b34801561058757600080fd5b5061046961059636600461545a565b611cd8565b3480156105a757600080fd5b506105bb6105b63660046152bd565b611d02565b6040516103e2919061547f565b3480156105d457600080fd5b506106046105e33660046152bd565b600a6020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016103e2565b34801561062b57600080fd5b5061040b61063a366004615533565b611de2565b34801561064b57600080fd5b5061046961065a3660046152bd565b611e69565b34801561066b57600080fd5b5061040b600e5481565b34801561068157600080fd5b5061046961069036600461555f565b611e8a565b3480156106a157600080fd5b506106b56106b03660046152bd565b611f7c565b6040516103e29d9c9b9a999897969594939291906155bb565b6104696106dc3660046152bd565b61200a565b3480156106ed57600080fd5b506104696106fc36600461543d565b61270c565b34801561070d57600080fd5b5061040b60115481565b34801561072357600080fd5b5061043961073236600461543d565b60186020526000908152604090205460ff1681565b34801561075357600080fd5b5061043961076236600461543d565b60166020526000908152604090205460ff1681565b34801561078357600080fd5b5061040b60145481565b34801561079957600080fd5b50610469612736565b3480156107ae57600080fd5b5061040b6107bd3660046152bd565b61274a565b3480156107ce57600080fd5b506107f66107dd3660046152bd565b6006602052600090815260409020805460019091015482565b604080519283526020830191909152016103e2565b34801561081757600080fd5b506104696108263660046152bd565b6128d7565b34801561083757600080fd5b5060195461043990610100900460ff1681565b34801561085657600080fd5b506104696108653660046152bd565b6128f8565b34801561087657600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016103e2565b3480156108a857600080fd5b506104696108b7366004615675565b612b03565b3480156108c857600080fd5b506104396108d736600461545a565b612b43565b3480156108e857600080fd5b506104696108f736600461569b565b612b6e565b34801561090857600080fd5b5061040b600081565b34801561091d57600080fd5b5061040b600d5481565b34801561093357600080fd5b5061040b61094236600461543d565b600b6020526000908152604090205481565b34801561096057600080fd5b5061046961096f3660046152bd565b612bb7565b34801561098057600080fd5b5061046961098f3660046152bd565b612bd8565b3480156109a057600080fd5b5061040b60135481565b3480156109b657600080fd5b506104966109c53660046156c4565b63bc197c8160e01b95945050505050565b3480156109e257600080fd5b50610469612bf9565b61040b6109f9366004615771565b612c32565b348015610a0a57600080fd5b506107f6610a193660046152bd565b6007602052600090815260409020805460019091015482565b348015610a3e57600080fd5b506019546104399060ff1681565b348015610a5857600080fd5b5061040b60125481565b348015610a6e57600080fd5b50610469610a7d36600461545a565b613603565b348015610a8e57600080fd5b5061040b60155481565b348015610aa457600080fd5b50610469610ab3366004615404565b613627565b348015610ac457600080fd5b50610469610ad3366004615533565b6136b2565b348015610ae457600080fd5b5061040b600f5481565b348015610afa57600080fd5b5061040b610b093660046152bd565b60009081526008602052604090205490565b61040b610b293660046151d6565b61371d565b348015610b3a57600080fd5b50610496610b4936600461584c565b63f23a6e6160e01b95945050505050565b348015610b6657600080fd5b50610469610b7536600461543d565b613f3b565b348015610b8657600080fd5b50610884610b95366004615057565b613fb1565b348015610ba657600080fd5b5061040b600080516020615e7883398151915281565b348015610bc857600080fd5b506104696140fd565b61046961412d565b60086020528160005260406000208181548110610bf557600080fd5b6000918252602090912060039091020180546002909101546001600160a01b039091169250905082565b6000600080516020615e7883398151915233610c3b82826141d8565b428b11610c635760405162461bcd60e51b8152600401610c5a906158b4565b60405180910390fd5b88518a5114610cc35760405162461bcd60e51b815260206004820152602660248201527f416464726573732c20494473206e65656420746f20686176652073616d65206c60448201526532b733ba341760d11b6064820152608401610c5a565b87518a5114610ce45760405162461bcd60e51b8152600401610c5a906158f8565b60008511610d045760405162461bcd60e51b8152600401610c5a90615948565b600084118015610d145750848411155b610d305760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b03871615610d77576001600160a01b03871660009081526017602052604090205460ff16610d775760405162461bcd60e51b8152600401610c5a906159ba565b60005b8a51811015610fd05760006001600160a01b03168b8281518110610da057610da06159f1565b60200260200101516001600160a01b031603610dce5760405162461bcd60e51b8152600401610c5a90615a07565b888181518110610de057610de06159f1565b6020026020010151600003610ecb5760008b8281518110610e0357610e036159f1565b60200260200101519050806001600160a01b0316636352211e8c8481518110610e2e57610e2e6159f1565b60200260200101516040518263ffffffff1660e01b8152600401610e5491815260200190565b602060405180830381865afa158015610e71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e959190615a2c565b6001600160a01b0316336001600160a01b031614610ec55760405162461bcd60e51b8152600401610c5a90615a49565b50610fbe565b60008b8281518110610edf57610edf6159f1565b60200260200101519050898281518110610efb57610efb6159f1565b6020026020010151816001600160a01b031662fdd58e338e8681518110610f2457610f246159f1565b60200260200101516040518363ffffffff1660e01b8152600401610f5d9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610f7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9e9190615a7e565b1015610fbc5760405162461bcd60e51b8152600401610c5a90615a97565b505b80610fc881615ae4565b915050610d7a565b506000610fe033308d8d8d614231565b60408051610200810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e0810188905260006101008201819052610120820181905261014082018190523361016083015261018082018590526001600160a01b038c166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff1916908360048111156110c6576110c66155a5565b02179055506020828101516001830155604083015180516110ed9260028501920190614f88565b5060608201518051611109916003840191602090910190614fed565b5060808201518051611125916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff1916911515919091179055546000906111f490600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b03909316929092178255838301518051949550859492936112959392850192910190614fed565b506040918201516002909101556000838152600860205290812080549091906112c0576112c06159f1565b60009182526020822060039091020180546001600160a01b0319168155906112eb6001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f604051611327929190615b10565b60405180910390a2509d9c50505050505050505050505050565b60006001600160e01b03198216630271189760e51b148061137257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6113806142bf565b600060098281548110611395576113956159f1565b60009182526020909120600b601090920201908101549091506001600160a01b031633146113fb5760405162461bcd60e51b81526020600482015260136024820152722737ba103930b33336329031b932b0ba37b91760691b6044820152606401610c5a565b600f81015460ff16151560010361144e57600f8101805460ff1916905560405133815282907f7e3a30fb23600876c42b4241548a287a8ab696f0c2193e5898e5e45476de29d59060200160405180910390a25b5061145860018055565b50565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916146114d55760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610c5a565b6114df8282614318565b5050565b600080516020615e78833981519152336114fd82826141d8565b50506001600160a01b03919091166000908152601860205260409020805460ff1916911515919091179055565b60006009838154811061153f5761153f6159f1565b906000526020600020906010020190506115564290565b8160010154116115a05760405162461bcd60e51b8152602060048201526015602482015274526166666c6520436c6f736564206f6e2074696d6560581b6044820152606401610c5a565b6000815460ff1660048111156115b8576115b86155a5565b146116055760405162461bcd60e51b815260206004820152601860248201527f526166666c65206973206e6f7420696e204352454154454400000000000000006044820152606401610c5a565b600082118015611619575080600701548211155b61168b5760405162461bcd60e51b815260206004820152603c60248201527f4e756d62657220656e74726965732063616e27742062652030206f72206d6f7260448201527f65207468616e206d617820656e74726965732070657220757365722e000000006064820152608401610c5a565b336116d85760405162461bcd60e51b815260206004820152601e60248201527f416464726573732063616e742774206265206e756c6c206164647265737300006044820152606401610c5a565b600983815481106116eb576116eb6159f1565b9060005260206000209060100201600501548282600e015461170d9190615b94565b111561175b5760405162461bcd60e51b815260206004820152601e60248201527f526166666c65206861732072656163686564206d617820656e747269657300006044820152606401610c5a565b600d8101546001600160a01b03166117ba5781816006015461177d9190615ba7565b341461179b5760405162461bcd60e51b8152600401610c5a90615bbe565b3481600a0160008282546117af9190615b94565b909155506119629050565b8181600601546117ca9190615ba7565b600d8201546040516370a0823160e01b81523360048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015611814573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118389190615a7e565b10156118ac5760405162461bcd60e51b815260206004820152603b60248201527f4e65656420746f206861766520696e2077616c6c657420657175616c206f722060448201527f6d6f7265207468616e20455243323020546f6b656e20707269636500000000006064820152608401610c5a565b600d81015460068201546001600160a01b03909116906323b872dd90339030906118d7908790615ba7565b6040518463ffffffff1660e01b81526004016118f593929190615c02565b6020604051808303816000875af1158015611914573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119389190615c26565b508181600601546119499190615ba7565b81600a01600082825461195c9190615b94565b90915550505b6040805160608101825233815281516001808252818401909352600092602083019190816020016020820280368337505050815260200184905290506000805b600086815260086020526040902054811015611b695760008681526008602052604090208054339190839081106119db576119db6159f1565b60009182526020909120600390910201546001600160a01b031603611b575760098681548110611a0d57611a0d6159f1565b90600052602060002090601002016007015485600860008981526020019081526020016000208381548110611a4457611a446159f1565b906000526020600020906003020160020154611a609190615b94565b1115611aae5760405162461bcd60e51b815260206004820152601760248201527f426f7567687420746f6f206d616e7920656e74726965730000000000000000006044820152606401610c5a565b6000868152600860205260409020805482908110611ace57611ace6159f1565b90600052602060002090600302016001018585600e0154611aef9190615b94565b815460018101835560009283526020808420909101919091558782526008905260409020805486919083908110611b2857611b286159f1565b90600052602060002090600302016002016000828254611b489190615b94565b9091555060019250611b699050565b80611b6181615ae4565b9150506119a2565b5080611c55576000858152600860209081526040822080546001808201835591845292829020855160039094020180546001600160a01b0319166001600160a01b03909416939093178355848201518051869493611bcb938501920190614fed565b506040918201516002909101556000868152600860205290812054611bf290600190615afd565b90508484600e0154611c049190615b94565b6000878152600860205260409020805483908110611c2457611c246159f1565b9060005260206000209060030201600101600081548110611c4757611c476159f1565b600091825260209091200155505b8383600e016000828254611c699190615b94565b9091555050600e8301546040805191825260208201869052339187917f1d96340db85bb8f4232fc9c231f41da059f9a110d9099bd213b67115aa0b5654910160405180910390a35050505050565b600080516020615e7883398151915233611cd182826141d8565b5050600455565b600080516020615e7883398151915233611cf282826141d8565b611cfc848461444f565b50505050565b606060086000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015611dd7576000848152602090819020604080516060810182526003860290920180546001600160a01b03168352600181018054835181870281018701909452808452939491938583019392830182828015611db557602002820191906000526020600020905b815481526020019060010190808311611da1575b5050505050815260200160028201548152505081526020019060010190611d37565b505050509050919050565b6001600160a01b0382166000908152600b6020526040812054819015611e6257604080516001600160a01b0386166020808301829052828401879052835180840385018152606090930184528251928101929092206000818152600a845284812060020154928152600b9093529290912054611e5e9190615afd565b9150505b9392505050565b600080516020615e7883398151915233611e8382826141d8565b5050600e55565b600080516020615e7883398151915233611ea482826141d8565b60005b8451811015611f75578360166000878481518110611ec757611ec76159f1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055831515600103611f63577f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73858281518110611f3657611f366159f1565b6020026020010151604051611f5a91906001600160a01b0391909116815260200190565b60405180910390a15b80611f6d81615ae4565b915050611ea7565b5050505050565b60098181548110611f8c57600080fd5b600091825260209091206010909102018054600182015460058301546006840154600785015460088601546009870154600a880154600b890154600c8a0154600d8b0154600e8c0154600f909c015460ff9b8c169d50999b989a979996986001600160a01b039687169895979496938416959294919093169291168d565b6120126142bf565b600060098281548110612027576120276159f1565b60009182526020909120600b601090920201908101549091506001600160a01b03163314806120695750612069600080516020615e7883398151915233612b43565b6120b55760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c5a565b428160010154116120d85760405162461bcd60e51b8152600401610c5a906158b4565b6000815460ff1660048111156120f0576120f06155a5565b1461212c5760405162461bcd60e51b815260206004820152600c60248201526b57726f6e672073746174757360a01b6044820152606401610c5a565b612144600080516020615e7883398151915233612b43565b61227f57600f81015460ff166121905760405162461bcd60e51b8152602060048201526011602482015270155cd95c8810d85b89dd0818d85b98d95b607a1b6044820152606401610c5a565b80600e01546000036121ef5734156121ea5760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c5a565b61227f565b6010543410156122415760405162461bcd60e51b815260206004820152601a60248201527f4e6f742063616e63656c6174696f6e206665652076616c75652e0000000000006044820152606401610c5a565b600c546010546040516001600160a01b039092169181156108fc0291906000818181858888f1935050505015801561227d573d6000803e3d6000fd5b505b60008281526008602052604090205460c88111156123055760405162461bcd60e51b815260206004820152603860248201527f4e6f742063616e63656c6174696f6e20617661696c61626c65207768656e206960448201527f742773206d6f7265207468616e203230302075736572732e00000000000000006064820152608401610c5a565b600d8201546001600160a01b03166123fa5760005b818110156123f4576000848152600860205260408120805483908110612342576123426159f1565b60009182526020909120600390910201546001600160a01b0316905080156123e1576000858152600860205260408120805484908110612384576123846159f1565b90600052602060002090600302016002015485600601546123a59190615ba7565b6040519091506001600160a01b0383169082156108fc029083906000818181858888f193505050501580156123de573d6000803e3d6000fd5b50505b50806123ec81615ae4565b91505061231a565b50612598565b600d820154600a83015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015612453573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124779190615c26565b5060005b818110156125965760008481526008602052604081208054839081106124a3576124a36159f1565b60009182526020909120600390910201546001600160a01b0316905080156125835760008581526008602052604081208054849081106124e5576124e56159f1565b90600052602060002090600302016002015485600601546125069190615ba7565b600d8601546040516323b872dd60e01b81529192506001600160a01b0316906323b872dd9061253d90309086908690600401615c02565b6020604051808303816000875af115801561255c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125809190615c26565b50505b508061258e81615ae4565b91505061247b565b505b6126bc3083600b0160009054906101000a90046001600160a01b03168460020180548060200260200160405190810160405280929190818152602001828054801561260c57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116125ee575b50505050508560030180548060200260200160405190810160405280929190818152602001828054801561265f57602002820191906000526020600020905b81548152602001906001019080831161264b575b5050505050866004018054806020026020016040519081016040528092919081815260200182805480156126b257602002820191906000526020600020905b81548152602001906001019080831161269e575b5050505050614231565b815460ff19166004178255600a82015460405190815283907fd512a34b0f0618078770fcd85d974df1ab46a7882e8b3d45aa91764f4961aed29060200160405180910390a2505061145860018055565b61271461448e565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b61273e61448e565b61274860006144e8565b565b6000600080516020615e788339815191523361276682826141d8565b60006009858154811061277b5761277b6159f1565b60009182526020909120600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b909104166084820152601090930290910192506001600160a01b031690635d3b1d309060a4016020604051808303816000875af115801561281e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128429190615a7e565b604080518082018252878152600e8401546020808301918252600085815260078252849020925183559051600190920191909155835460ff19166002178455600554825184815263ffffffff600160301b90920491909116918101919091529195507fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a1505050919050565b600080516020615e78833981519152336128f182826141d8565b5050601055565b60006009828154811061290d5761290d6159f1565b60009182526020909120600b601090920201908101549091506001600160a01b031633148061294f575061294f600080516020615e7883398151915233612b43565b61299b5760405162461bcd60e51b815260206004820152601f60248201527f4e6f7420726166666c652063726561746f72206f72204f70657261746f722e006044820152606401610c5a565b600b8101546001600160a01b03163314612a21574281600101541115806129c95750806005015481600e0154145b612a215760405162461bcd60e51b815260206004820152602360248201527f526166666c65207374696c6c206f70656e6564206f72206e6f7420736f6c64206044820152621bdd5d60ea1b6064820152608401610c5a565b6000815460ff166004811115612a3957612a396155a5565b14612a7f5760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c5a565b805460ff19166001178155600e8101548015612aa557612a9f8382614538565b50612ac0565b815460ff191660021782556009820154612ac09084906146a9565b827ff2be214756d2fbc1e781d10809ddef33000009d805be55356bb348134ce21c6883600a0154604051612af691815260200190565b60405180910390a2505050565b600080516020615e7883398151915233612b1d82826141d8565b50506005805463ffffffff909216620100000265ffffffff000019909216919091179055565b6000918252601a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b600080516020615e7883398151915233612b8882826141d8565b5050600580546001600160401b03909216600160501b0267ffffffffffffffff60501b19909216919091179055565b600080516020615e7883398151915233612bd182826141d8565b5050600f55565b600080516020615e7883398151915233612bf282826141d8565b5050601155565b600080516020615e7883398151915233612c1382826141d8565b50506019805461ff001981166101009182900460ff1615909102179055565b60195460009060ff16612c925760405162461bcd60e51b815260206004820152602260248201527f43726561746520726166666c65206e6f742073657420666f7220686f6c646572604482015261399760f11b6064820152608401610c5a565b428911612cb15760405162461bcd60e51b8152600401610c5a906158b4565b8651885114612cd25760405162461bcd60e51b8152600401610c5a90615c43565b8551885114612cf35760405162461bcd60e51b8152600401610c5a906158f8565b60008311612d135760405162461bcd60e51b8152600401610c5a90615948565b600082118015612d235750828211155b612d3f5760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b03851615612d86576001600160a01b03851660009081526017602052604090205460ff16612d865760405162461bcd60e51b8152600401610c5a906159ba565b60005b8851811015612fdf5760006001600160a01b0316898281518110612daf57612daf6159f1565b60200260200101516001600160a01b031603612ddd5760405162461bcd60e51b8152600401610c5a90615a07565b868181518110612def57612def6159f1565b6020026020010151600003612eda576000898281518110612e1257612e126159f1565b60200260200101519050806001600160a01b0316636352211e8a8481518110612e3d57612e3d6159f1565b60200260200101516040518263ffffffff1660e01b8152600401612e6391815260200190565b602060405180830381865afa158015612e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea49190615a2c565b6001600160a01b0316336001600160a01b031614612ed45760405162461bcd60e51b8152600401610c5a90615a49565b50612fcd565b6000898281518110612eee57612eee6159f1565b60200260200101519050878281518110612f0a57612f0a6159f1565b6020026020010151816001600160a01b031662fdd58e338c8681518110612f3357612f336159f1565b60200260200101516040518363ffffffff1660e01b8152600401612f6c9291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015612f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fad9190615a7e565b1015612fcb5760405162461bcd60e51b8152600401610c5a90615a97565b505b80612fd781615ae4565b915050612d89565b506001600160a01b03851660009081526018602052604081205460ff161561303957600d54600f546130119190615b94565b3410156130305760405162461bcd60e51b8152600401610c5a90615c98565b5060135461306d565b600d54600e546130499190615b94565b3410156130685760405162461bcd60e51b8152600401610c5a90615c98565b506012545b6040516331a9108f60e11b8152600481018c90528c9033906001600160a01b03831690636352211e90602401602060405180830381865afa1580156130b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130da9190615a2c565b6001600160a01b0316146131305760405162461bcd60e51b815260206004820152601860248201527f4e6f7420746865206f776e6572206f6620746f6b656e496400000000000000006044820152606401610c5a565b604080516001600160a01b038f1660208201529081018d905260009060600160405160208183030381529060405280519060200120905061316e4290565b6000828152600a6020526040902060010154111561321f5760006131928f8f611de2565b116131f85760405162461bcd60e51b815260206004820152603060248201527f4372656174656420746f6f206d616e7920726166666c6573207769746820796f60448201526f3ab91027232a103cb7ba903437b6321760811b6064820152608401610c5a565b6000818152600a6020526040812060020180549161321583615ae4565b9190505550613259565b426000828152600a60205260409020554261323d9062278d00615b94565b6000828152600a60205260409020600180820192909255600201555b61326633308d8d8d614231565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f1935050505015801561329f573d6000803e3d6000fd5b5060408051610200810190915260009080828152602081018f9052604081018e9052606081018d9052608081018c905260a0810189905260c081018a905260e0810188905260006101008201819052610120820181905261014082018190523361016083015261018082018790526001600160a01b038c166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613386576133866155a5565b02179055506020828101516001830155604083015180516133ad9260028501920190614f88565b50606082015180516133c9916003840191602090910190614fed565b50608082015180516133e5916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff1916911515919091179055546000906134b490600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b03909316929092178255838301518051949550859492936135559392850192910190614fed565b50604091820151600290910155600083815260086020529081208054909190613580576135806159f1565b60009182526020822060039091020180546001600160a01b0319168155906135ab6001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48f8f6040516135e7929190615b10565b60405180910390a2509f9e505050505050505050505050505050565b600080516020615e788339815191523361361d82826141d8565b611cfc8484614cbf565b600080516020615e788339815191523361364182826141d8565b6001600160a01b0384166000908152601760205260409020805460ff1916841515908117909155600103611cfc576040516001600160a01b03851681527f7f2c42a00d513609b2f0aaa86f3b78575f99fa1b7d37446cddc7843f2854c733906020015b60405180910390a150505050565b600080516020615e78833981519152336136cc82826141d8565b6001600160a01b0384166000818152600b6020908152604091829020869055815192835282018590527fc54af0d8ebbaa95f738d0c156db9a3bea905f4942ed99ed5fc1bbc4e250b434d91016136a4565b601954600090610100900460ff166137875760405162461bcd60e51b815260206004820152602760248201527f43726561746520726166666c65206e6f6f742073657420666f722073756273636044820152663934b132b9399760c91b6064820152608401610c5a565b3360009081526016602052604090205460ff166137f65760405162461bcd60e51b815260206004820152602760248201527f4e65656420746f206265207375627363726962657220746f20637265617465206044820152663930b33336329760c91b6064820152608401610c5a565b4289116138155760405162461bcd60e51b8152600401610c5a906158b4565b86518851146138365760405162461bcd60e51b8152600401610c5a90615c43565b85518851146138575760405162461bcd60e51b8152600401610c5a906158f8565b600d543410156138795760405162461bcd60e51b8152600401610c5a90615c98565b600083116138995760405162461bcd60e51b8152600401610c5a90615948565b6000821180156138a95750828211155b6138c55760405162461bcd60e51b8152600401610c5a9061596c565b6001600160a01b0385161561390c576001600160a01b03851660009081526017602052604090205460ff1661390c5760405162461bcd60e51b8152600401610c5a906159ba565b60005b8851811015613b655760006001600160a01b0316898281518110613935576139356159f1565b60200260200101516001600160a01b0316036139635760405162461bcd60e51b8152600401610c5a90615a07565b868181518110613975576139756159f1565b6020026020010151600003613a60576000898281518110613998576139986159f1565b60200260200101519050806001600160a01b0316636352211e8a84815181106139c3576139c36159f1565b60200260200101516040518263ffffffff1660e01b81526004016139e991815260200190565b602060405180830381865afa158015613a06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a2a9190615a2c565b6001600160a01b0316336001600160a01b031614613a5a5760405162461bcd60e51b8152600401610c5a90615a49565b50613b53565b6000898281518110613a7457613a746159f1565b60200260200101519050878281518110613a9057613a906159f1565b6020026020010151816001600160a01b031662fdd58e338c8681518110613ab957613ab96159f1565b60200260200101516040518363ffffffff1660e01b8152600401613af29291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015613b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b339190615a7e565b1015613b515760405162461bcd60e51b8152600401610c5a90615a97565b505b80613b5d81615ae4565b91505061390f565b506001600160a01b03851660009081526018602052604081205460ff1615613b905750601554613b95565b506014545b613ba233308b8b8b614231565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015613bdb573d6000803e3d6000fd5b5060408051610200810190915260009080828152602081018d9052604081018c9052606081018b9052608081018a905260a0810187905260c0810188905260e0810186905260006101008201819052610120820181905261014082018190523361016083015261018082018590526001600160a01b038a166101a08301526101c0820181905260016101e09092018290526009805480840182559152825160109091027f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805493945084939092839160ff191690836004811115613cc257613cc26155a5565b0217905550602082810151600183015560408301518051613ce99260028501920190614f88565b5060608201518051613d05916003840191602090910190614fed565b5060808201518051613d21916004840191602090910190614fed565b5060a0820151600582015560c0820151600682015560e082015160078201556101008201516008820180546001600160a01b03199081166001600160a01b0393841617909155610120840151600980850191909155610140850151600a850155610160850151600b850180548416918516919091179055610180850151600c8501556101a0850151600d8501805490931693169290921790556101c0830151600e8301556101e090920151600f909101805460ff191691151591909117905554600090613df090600190615afd565b6040805160608101825260008082528251600180825281850190945293945092909160208301919081602001602082028036833701905050815260006020918201819052848152600882526040812080546001808201835591835291839020845160039093020180546001600160a01b0319166001600160a01b0390931692909217825583830151805194955085949293613e919392850192910190614fed565b50604091820151600290910155600083815260086020529081208054909190613ebc57613ebc6159f1565b60009182526020822060039091020180546001600160a01b031916815590613ee76001830182615028565b60028201600090555050817ffe3ba64e9340fdc4b20b9c902122c80faed7abfd44631295ea2d8f6cca6de6a48d8d604051613f23929190615b10565b60405180910390a2509b9a5050505050505050505050565b613f4361448e565b6001600160a01b038116613fa85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c5a565b611458816144e8565b600082815260086020526040812081908190815b81548110156140aa5760005b828281548110613fe357613fe36159f1565b90600052602060002090600302016001018054905081101561409757828281548110614011576140116159f1565b90600052602060002090600302016001018181548110614033576140336159f1565b9060005260206000200154856140499190615b94565b945086851061408557828281548110614064576140646159f1565b60009182526020909120600390910201546001600160a01b03169350614097565b8061408f81615ae4565b915050613fd1565b50806140a281615ae4565b915050613fc5565b506001600160a01b0382166140f45760405162461bcd60e51b815260206004820152601060248201526f15da5b9b995c881b9bdd08199bdd5b9960821b6044820152606401610c5a565b50949350505050565b600080516020615e788339815191523361411782826141d8565b50506019805460ff19811660ff90911615179055565b601154341461414e5760405162461bcd60e51b8152600401610c5a90615bbe565b600c546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015614187573d6000803e3d6000fd5b5033600081815260166020908152604091829020805460ff1916600117905590519182527f5045de7742fc02adb39abdd0ec08c8e8d651ba4315dd3a294a341771b8e06e73910160405180910390a1565b6141e28282612b43565b6114df576141ef81614cfc565b6141fa836020614d0e565b60405160200161420b929190615cec565b60408051601f198184030181529082905262461bcd60e51b8252610c5a91600401615d8d565b60005b82518110156142b7576142a58686868481518110614254576142546159f1565b602002602001015186858151811061426e5761426e6159f1565b6020026020010151868681518110614288576142886159f1565b602002602001015160405180602001604052806000815250614ea9565b806142af81615ae4565b915050614234565b505050505050565b6002600154036143115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c5a565b6002600155565b60008281526007602052604081206001015482518390839061433c5761433c6159f1565b602002602001015161434e9190615db6565b614359906001615b94565b600084815260076020526040812054600980549394509192811061437f5761437f6159f1565b9060005260206000209060100201905081816009018190555060006040518060400160405280856000815181106143b8576143b86159f1565b602090810291909101810151825290810185905260008781526007808352604080832080548452600685528184208651815586860151600190910155928a9052908352905481518981529283018790529293507f8a06e59f8bcf6fd7f3d4f78e40f7271ef279eaf8e0fc07df107169ccdc05ab65910160405180910390a2600085815260076020526040902054611f7590846146a9565b6144598282612b43565b6114df576000828152601a602090815260408083206001600160a01b03851684529091529020805460ff191660011790555050565b6000546001600160a01b031633146127485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c5a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600254600480546005546040516305d3b1d360e41b8152928301919091526001600160401b03600160501b820416602483015261ffff8116604483015263ffffffff62010000820481166064840152600160301b9091041660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156145ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906145ee9190615a7e565b60408051808201825285815260208082018681526000858152600790925292812091518255915160019091015560098054929350909185908110614634576146346159f1565b600091825260209091206010909102018054909150600290829060ff1916600183021790555060055460408051848152600160301b90920463ffffffff1660208301527fcc58b13ad3eab50626c6a6300b1d139cd6ebb1688a7cced9461c2f7e762665ee910160405180910390a15092915050565b6146b16142bf565b6000600983815481106146c6576146c66159f1565b6000918252602090912060109091020190506002815460ff1660048111156146f0576146f06155a5565b146147365760405162461bcd60e51b8152602060048201526016602482015275526166666c6520696e2077726f6e672073746174757360501b6044820152606401610c5a565b60098101829055600e81015415614756576147518383613fb1565b614765565b600b8101546001600160a01b03165b6008820180546001600160a01b0319166001600160a01b0392909216918217905560028201805460408051602080840282018101909252828152614893943094909391929091908301828280156147e557602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116147c7575b50505050508460030180548060200260200160405190810160405280929190818152602001828054801561483857602002820191906000526020600020905b815481526020019060010190808311614824575b5050505050856004018054806020026020016040519081016040528092919081815260200182805480156126b2576020028201919060005260206000209081548152602001906001019080831161269e575050505050614231565b600061271082600c015483600a01546148ac9190615ba7565b6148b69190615dca565b905060008183600a01546148ca9190615afd565b600d8401549091506001600160a01b0316614a2357600b8301546040516000916001600160a01b03169083908381818185875af1925050503d806000811461492e576040519150601f19603f3d011682016040523d82523d6000602084013e614933565b606091505b50509050806149795760405162461bcd60e51b815260206004820152601260248201527108cc2d2d8cac840e8de40e6cadcc8408ae8d60731b6044820152606401610c5a565b600c546040516000916001600160a01b03169085908381818185875af1925050503d80600081146149c6576040519150601f19603f3d011682016040523d82523d6000602084013e6149cb565b606091505b5050905080614a1c5760405162461bcd60e51b815260206004820152601b60248201527f4661696c65642073656e642045746820746f20506c6174666f726d00000000006044820152606401610c5a565b5050614c51565b600d830154600a84015460405163095ea7b360e01b815230600482015260248101919091526001600160a01b039091169063095ea7b3906044016020604051808303816000875af1158015614a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614aa09190615c26565b50600d830154600b8401546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614adf92309216908790600401615c02565b6020604051808303816000875af1158015614afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614b229190615c26565b905080614b715760405162461bcd60e51b815260206004820152601a60248201527f4661696c656420746f2073656e6420455243323020546f6b656e0000000000006044820152606401610c5a565b600d840154600c546040516323b872dd60e01b81526000926001600160a01b03908116926323b872dd92614bad92309216908990600401615c02565b6020604051808303816000875af1158015614bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614bf09190615c26565b905080614c4e5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f2073656e6420455243323020546f6b656e20746f20706c6044820152656174666f726d60d01b6064820152608401610c5a565b50505b825460ff191660031783556008830154600a84015460098501546040805192835260208301919091526001600160a01b039092169187917f7e9ab850b8ae5bd2e5fba4accceb80d63e90bcb89852d7cae476cd917f25b25d910160405180910390a35050506114df60018055565b614cc98282612b43565b156114df576000828152601a602090815260408083206001600160a01b03851684529091529020805460ff191690555050565b60606113726001600160a01b03831660145b60606000614d1d836002615ba7565b614d28906002615b94565b6001600160401b03811115614d3f57614d3f615079565b6040519080825280601f01601f191660200182016040528015614d69576020820181803683370190505b509050600360fc1b81600081518110614d8457614d846159f1565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110614db357614db36159f1565b60200101906001600160f81b031916908160001a9053506000614dd7846002615ba7565b614de2906001615b94565b90505b6001811115614e5a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110614e1657614e166159f1565b1a60f81b828281518110614e2c57614e2c6159f1565b60200101906001600160f81b031916908160001a90535060049490941c93614e5381615dde565b9050614de5565b508315611e625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c5a565b81600003614f1a57604051635c46a7ef60e11b81526001600160a01b0385169063b88d4fde90614ee3908990899088908790600401615df5565b600060405180830381600087803b158015614efd57600080fd5b505af1158015614f11573d6000803e3d6000fd5b505050506142b7565b604051637921219560e11b81526001600160a01b0385169063f242432a90614f4e9089908990889088908890600401615e32565b600060405180830381600087803b158015614f6857600080fd5b505af1158015614f7c573d6000803e3d6000fd5b50505050505050505050565b828054828255906000526020600020908101928215614fdd579160200282015b82811115614fdd57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190614fa8565b50614fe9929150615042565b5090565b828054828255906000526020600020908101928215614fdd579160200282015b82811115614fdd57825182559160200191906001019061500d565b508054600082559060005260206000209081019061145891905b5b80821115614fe95760008155600101615043565b6000806040838503121561506a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156150b7576150b7615079565b604052919050565b60006001600160401b038211156150d8576150d8615079565b5060051b60200190565b6001600160a01b038116811461145857600080fd5b8035615102816150e2565b919050565b600082601f83011261511857600080fd5b8135602061512d615128836150bf565b61508f565b82815260059290921b8401810191818101908684111561514c57600080fd5b8286015b84811015615170578035615163816150e2565b8352918301918301615150565b509695505050505050565b600082601f83011261518c57600080fd5b8135602061519c615128836150bf565b82815260059290921b840181019181810190868411156151bb57600080fd5b8286015b8481101561517057803583529183019183016151bf565b600080600080600080600080610100898b0312156151f357600080fd5b8835975060208901356001600160401b038082111561521157600080fd5b61521d8c838d01615107565b985060408b013591508082111561523357600080fd5b61523f8c838d0161517b565b975060608b013591508082111561525557600080fd5b506152628b828c0161517b565b95505061527160808a016150f7565b979a969950949793969560a0850135955060c08501359460e001359350915050565b6000602082840312156152a557600080fd5b81356001600160e01b031981168114611e6257600080fd5b6000602082840312156152cf57600080fd5b5035919050565b600082601f8301126152e757600080fd5b81356001600160401b0381111561530057615300615079565b615313601f8201601f191660200161508f565b81815284602083860101111561532857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561535b57600080fd5b8435615366816150e2565b93506020850135615376816150e2565b92506040850135915060608501356001600160401b0381111561539857600080fd5b6153a4878288016152d6565b91505092959194509250565b600080604083850312156153c357600080fd5b8235915060208301356001600160401b038111156153e057600080fd5b6153ec8582860161517b565b9150509250929050565b801515811461145857600080fd5b6000806040838503121561541757600080fd5b8235615422816150e2565b91506020830135615432816153f6565b809150509250929050565b60006020828403121561544f57600080fd5b8135611e62816150e2565b6000806040838503121561546d57600080fd5b823591506020830135615432816150e2565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561552457898403603f19018652825180516001600160a01b031685528881015160608a8701819052815190870181905260808701918b019085905b808210156155065782518452928c0192918c0191600191909101906154e6565b505050908801519488019490945294870194918701916001016154a7565b50919998505050505050505050565b6000806040838503121561554657600080fd5b8235615551816150e2565b946020939093013593505050565b6000806040838503121561557257600080fd5b82356001600160401b0381111561558857600080fd5b61559485828601615107565b9250506020830135615432816153f6565b634e487b7160e01b600052602160045260246000fd5b6101a0810160058f106155de57634e487b7160e01b600052602160045260246000fd5b8e82528d60208301528c60408301528b60608301528a608083015261560e60a083018b6001600160a01b03169052565b8860c08301528760e08301526156306101008301886001600160a01b03169052565b8561012083015261564d6101408301866001600160a01b03169052565b8361016083015261566361018083018415159052565b9e9d5050505050505050505050505050565b60006020828403121561568757600080fd5b813563ffffffff81168114611e6257600080fd5b6000602082840312156156ad57600080fd5b81356001600160401b0381168114611e6257600080fd5b600080600080600060a086880312156156dc57600080fd5b85356156e7816150e2565b945060208601356156f7816150e2565b935060408601356001600160401b038082111561571357600080fd5b61571f89838a0161517b565b9450606088013591508082111561573557600080fd5b61574189838a0161517b565b9350608088013591508082111561575757600080fd5b50615764888289016152d6565b9150509295509295909350565b6000806000806000806000806000806101408b8d03121561579157600080fd5b61579a8b6150f7565b995060208b0135985060408b0135975060608b01356001600160401b03808211156157c457600080fd5b6157d08e838f01615107565b985060808d01359150808211156157e657600080fd5b6157f28e838f0161517b565b975060a08d013591508082111561580857600080fd5b506158158d828e0161517b565b95505061582460c08c016150f7565b935060e08b013592506101008b013591506101208b013590509295989b9194979a5092959850565b600080600080600060a0868803121561586457600080fd5b853561586f816150e2565b9450602086013561587f816150e2565b9350604086013592506060860135915060808601356001600160401b038111156158a857600080fd5b615764888289016152d6565b60208082526024908201527f456e642074696d652063616e2774206265203c2061732063757272656e74207460408201526334b6b29760e11b606082015260800190565b60208082526030908201527f416464726573732c20546f6b656e20416d6f756e7473206e65656420746f206860408201526f30bb329039b0b6b2903632b733ba341760811b606082015260800190565b6020808252600a90820152694e6f20656e747269657360b01b604082015260600190565b6020808252602e908201527f4d696e20656e74726965732075736572203e203020616e64203c3d206d61782060408201526d656e747269657320726166666c6560901b606082015260800190565b60208082526018908201527f546f6b656e2041646472657373206e6f74206164646564200000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a139195081a5cc81b9d5b1b60aa1b604082015260600190565b600060208284031215615a3e57600080fd5b8151611e62816150e2565b6020808252818101527f4f6e6c79204e4654206f776e65722063616e2063726561746520726166666c65604082015260600190565b600060208284031215615a9057600080fd5b5051919050565b60208082526018908201527f446f6e74206861766520656e6f75676820616d6f756e742e0000000000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600060018201615af657615af6615ace565b5060010190565b8181038181111561137257611372615ace565b604080825283519082018190526000906020906060840190828701845b82811015615b525781516001600160a01b031684529284019290840190600101615b2d565b5050508381038285015284518082528583019183019060005b81811015615b8757835183529284019291840191600101615b6b565b5090979650505050505050565b8082018082111561137257611372615ace565b808202811582820484141761137257611372615ace565b60208082526024908201527f6d73672e76616c7565206d75737420626520657175616c20746f2074686520706040820152637269636560e01b606082015260800190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615c3857600080fd5b8151611e62816153f6565b60208082526035908201527f416464726573732c20494473202620546f6b656e20416d6f756e74206e656564604082015274103a37903430bb329039b0b6b2903632b733ba341760591b606082015260800190565b602080825260169082015275125b9d985b1a5908199d5b991cc81c1c9bdd9a59195960521b604082015260600190565b60005b83811015615ce3578181015183820152602001615ccb565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615d24816017850160208801615cc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d55816028840160208801615cc8565b01602801949350505050565b60008151808452615d79816020860160208601615cc8565b601f01601f19169290920160200192915050565b602081526000611e626020830184615d61565b634e487b7160e01b600052601260045260246000fd5b600082615dc557615dc5615da0565b500690565b600082615dd957615dd9615da0565b500490565b600081615ded57615ded615ace565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615e2890830184615d61565b9695505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615e6c90830184615d61565b97965050505050505056fe523a704056dcd17bcf83bed8b68c59416dac1119be77755efe3bde0a64e46e0ca2646970667358221220cb930d4c4422e2a8b39026a55c0297655ff50fb79b600a9e5e544f6755ddcb2064736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.