Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- StreamingRewardsV6
- Optimization enabled
- true
- Compiler version
- v0.8.34+commit.80d5c536
- Optimization runs
- 200
- EVM Version
- paris
- Verified at
- 2026-04-13T07:49:46.123060Z
Constructor Arguments
00000000000000000000000017e7b189982d8df2539d059b46467a09a7bcb91d000000000000000000000000d7a138d66251ec49333e6a2c4b50781e7f49702d000000000000000000000000ba44071ea19962fc272676bd2a52f25f26d974880000000000000000000000004e988b163aab47fae182ec32bfe3c4d5908f4f30000000000000000000000000756639c761e228143780e022a175325d79797eec
Arg [0] (address) : 0x17e7b189982d8df2539d059b46467a09a7bcb91d
Arg [1] (address) : 0xd7a138d66251ec49333e6a2c4b50781e7f49702d
Arg [2] (address) : 0xba44071ea19962fc272676bd2a52f25f26d97488
Arg [3] (address) : 0x4e988b163aab47fae182ec32bfe3c4d5908f4f30
Arg [4] (address) : 0x756639c761e228143780e022a175325d79797eec
contracts/AER/StreamingRewardsV6.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/utils/ReentrancyGuard.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/access/Ownable.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/token/ERC20/IERC20.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/token/ERC20/utils/SafeERC20.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/utils/cryptography/ECDSA.sol";
import "https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/v5.0.2/contracts/utils/cryptography/MessageHashUtils.sol";
// ─────────────────────────────────────────────────────────────────────────────
// StreamingRewardsV6
//
// WHAT CHANGED FROM V5
// ─────────────────────
// V5 managed 17 token reward pools with price feeds, pending rewards,
// claim functions, and runway monitoring. All of that is removed.
//
// V6 has one job on each stream update: call ArtistTokenFactory.mintForStream().
// The factory handles all token minting, creator payments, and LP fees.
//
// Everything else is identical to V5:
// • Streak system (shields, milestones, celebrations)
// • Dedicated Listener (total seconds per artist, frame tiers)
// • Weekly MEFI jackpot (competitive streaming leaderboard)
// • Shield purchases (MEFI → jackpot pool)
// • MysteryBoxV3 ABI compatibility (getStreakInfo 10-field layout)
// • Oracle signature verification with 48h signer timelock
// • Pause system
// • Migration from V5
//
// ORACLE FLOW
// ─────────────
// Every ~60s oracle calls updateStream(user, deltaSeconds, boostedDelta,
// creatorAddress, trackId, sessionId, nonce, signature)
// Contract:
// 1. Verifies signature
// 2. Calls factory.mintForStream(user, creatorAddress, boostedDelta)
// 3. Updates weeklyBoostedSeconds[user]
// 4. Updates streak + dedicated listener
//
// MEFI JACKPOT FLOW
// ─────────────────
// BatchBuyer sends MEFI → notifyMyfiReceived() or fundJackpot()
// Oracle calls distributeWeeklyJackpot() each Sunday
// Top streamers by weeklyBoostedSeconds win MEFI prizes
// ─────────────────────────────────────────────────────────────────────────────
interface IKEYStaking {
function getBoostBps(address user) external view returns (uint256);
function getTierId(address user) external view returns (uint8);
}
interface IArtistTokenFactory {
function mintForStream(address user, address artist, uint256 boostedDelta) external;
}
contract StreamingRewardsV6 is Ownable, ReentrancyGuard {
using SafeERC20 for IERC20;
using ECDSA for bytes32;
using MessageHashUtils for bytes32;
// ─── Constants ────────────────────────────────────────────────────────────
uint256 public constant BPS_DENOMINATOR = 10000;
uint256 public constant SECONDS_PER_WEEK = 604800;
// ─── Configurable ─────────────────────────────────────────────────────────
uint256 public signatureWindow = 600; // 10 min replay window
uint256 public oracleChangeDelay = 172800; // 48h timelock
// ─── User State ───────────────────────────────────────────────────────────
mapping(address => uint256) public weeklyBoostedSeconds;
mapping(address => uint256) public totalLifetimeBoostedSeconds;
mapping(address => uint256) public userNonces;
// ─── Dedicated Listener ───────────────────────────────────────────────────
// Total seconds streamed per (user, artist) — cumulative, never resets.
// Drives tiered avatar frames the artist customises for their fans.
// Tiers match KEY staking names:
// Fan (1h) → Collector (5h) → Curator (20h) → Legend (100h)
mapping(address => mapping(address => uint256)) public artistTotalSeconds;
mapping(address => mapping(address => bool)) public dedicatedFanClaimed;
mapping(address => mapping(address => bool)) public dedicatedCollectorClaimed;
mapping(address => mapping(address => bool)) public dedicatedCuratorClaimed;
mapping(address => mapping(address => bool)) public dedicatedLegendClaimed;
uint256 public dedicatedFanThreshold = 3_600;
uint256 public dedicatedCollectorThreshold = 18_000;
uint256 public dedicatedCuratorThreshold = 72_000;
uint256 public dedicatedLegendThreshold = 360_000;
mapping(address => address) public activeFrameArtist;
mapping(address => uint8) public activeFrameTier;
// ─── Streak ───────────────────────────────────────────────────────────────
struct StreakInfo {
uint256 streakDays;
uint256 lastStreamDay;
uint256 missedDays;
uint256 shields;
uint256 purchasedShieldsCount;
bool milestone7Claimed;
bool milestone30Claimed;
bool milestone90Claimed;
bool milestone180Claimed;
}
mapping(address => StreakInfo) public streaks;
uint256 public shieldCostMyfi = 10 * 1e18;
uint256 public maxShields = 3;
// ─── Weekly Jackpot ───────────────────────────────────────────────────────
uint256 public weekNumber;
uint256 public lastJackpotSettlement;
uint256 public minJackpotSize;
address public jackpotToken; // MEFI
/// @notice Live MEFI jackpot balance — reads contract balance directly.
/// BatchBuyer raw transfers and graduation payments count automatically.
function jackpotPool() public view returns (uint256) {
if (jackpotToken == address(0)) return 0;
return IERC20(jackpotToken).balanceOf(address(this));
}
uint256 public legendPoolBps = 500;
address[] public legendStakerList;
mapping(address => bool) public isLegendStaker;
uint8 public legendTierId = 3;
// ─── External Contracts ───────────────────────────────────────────────────
IKEYStaking public keyStaking;
IArtistTokenFactory public artistFactory;
// ─── Oracle Signer ────────────────────────────────────────────────────────
address public oracleSigner;
address public pendingOracleSigner;
uint256 public oracleSignerChangeTime;
// ─── Pause ────────────────────────────────────────────────────────────────
bool public paused;
// ─── Events ───────────────────────────────────────────────────────────────
event StreamUpdated(address indexed user, uint256 boostedDelta, uint256 weeklyTotal);
event FactoryMintCalled(address indexed user, address indexed artist, uint256 boostedDelta);
event FactoryMintFailed(address indexed user, address indexed artist, string reason);
event WeeklyJackpotDistributed(address[] winners, uint256[] amounts, uint256 weekNumber, uint256 totalPaid);
event WeeklyJackpotRolledOver(uint256 amount, uint256 newTotal);
event JackpotFunded(uint256 amount, uint256 newTotal);
event ShieldPurchased(address indexed user, uint256 cost, uint256 newShieldCount);
event StreakUpdated(address indexed user, uint256 streakDays);
event StreakMilestone(address indexed user, uint256 day, uint256 shieldsEarned);
event StreakCelebration(address indexed user, uint256 day);
event DedicatedListenerFrame(address indexed user, address indexed artist, uint8 frameTier, uint256 totalSeconds, uint256 timestamp);
event ActiveFrameSet(address indexed user, address indexed artist, uint8 frameTier);
event DedicatedListener(address indexed user, address indexed topArtist, uint256 streakDays, uint256 timestamp);
event TopArtistsUpdated(address indexed user, address artist1, address artist2, address artist3, uint256 timestamp);
event OracleSignerProposed(address indexed proposed, uint256 executeAfter);
event OracleSignerChanged(address indexed oldSigner, address indexed newSigner);
event MigrationLocked();
// ─── Constructor ──────────────────────────────────────────────────────────
constructor(
address _oracleSigner,
address _keyStaking,
address _artistFactory,
address _jackpotToken,
address initialOwner
) Ownable(initialOwner) {
require(_oracleSigner != address(0), "Zero oracle");
oracleSigner = _oracleSigner;
keyStaking = IKEYStaking(_keyStaking);
artistFactory = IArtistTokenFactory(_artistFactory);
jackpotToken = _jackpotToken;
lastJackpotSettlement = block.timestamp;
weekNumber = 1;
minJackpotSize = 1e18;
}
// ─────────────────────────────────────────────────────────────────────────
// ORACLE — updateStream
// ─────────────────────────────────────────────────────────────────────────
/**
* @notice Oracle calls this every ~60s per active streaming session.
*
* @param user Streamer wallet
* @param deltaSeconds Raw seconds since last update
* @param boostedDelta deltaSeconds × KEY tier multiplier (oracle-computed)
* @param creatorAddress Creator of the currently playing track
* @param trackId keccak256(trackUUID) — for future Song Drops
* @param sessionId Unique per-session identifier
* @param nonce userNonces[user] + 1
* @param signature Oracle signature over all params
*/
function updateStream(
address user,
uint256 deltaSeconds,
uint256 boostedDelta,
address creatorAddress,
bytes32 trackId,
uint256 sessionId,
uint256 nonce,
bytes calldata signature
) external nonReentrant {
require(!paused, "Paused");
require(boostedDelta > 0, "Zero delta");
require(nonce == userNonces[user] + 1, "Bad nonce");
_verifySignature(
user, deltaSeconds, boostedDelta,
creatorAddress, trackId, sessionId, nonce, signature
);
userNonces[user] = nonce;
// Call factory to mint artist tokens — try/catch so a factory
// failure never blocks streak or jackpot updates
if (address(artistFactory) != address(0) && creatorAddress != address(0)) {
try artistFactory.mintForStream(user, creatorAddress, boostedDelta) {
emit FactoryMintCalled(user, creatorAddress, boostedDelta);
} catch Error(string memory reason) {
emit FactoryMintFailed(user, creatorAddress, reason);
} catch {
emit FactoryMintFailed(user, creatorAddress, "Unknown");
}
}
// Weekly leaderboard tracking
weeklyBoostedSeconds[user] += boostedDelta;
totalLifetimeBoostedSeconds[user] += boostedDelta;
// Streak + dedicated listener
_updateStreak(user, deltaSeconds, creatorAddress);
emit StreamUpdated(user, boostedDelta, weeklyBoostedSeconds[user]);
}
function _verifySignature(
address user,
uint256 deltaSeconds,
uint256 boostedDelta,
address creatorAddress,
bytes32 trackId,
uint256 sessionId,
uint256 nonce,
bytes calldata signature
) internal view {
uint256 window = block.timestamp / signatureWindow;
bytes32 msgHash = keccak256(abi.encode(
user, deltaSeconds, boostedDelta,
creatorAddress, trackId,
sessionId, nonce, window
));
address signer = msgHash.toEthSignedMessageHash().recover(signature);
require(signer == oracleSigner, "Bad sig");
}
// ─────────────────────────────────────────────────────────────────────────
// STREAK
// ─────────────────────────────────────────────────────────────────────────
function _updateStreak(address user, uint256 deltaSeconds, address creatorAddress) internal {
if (deltaSeconds == 0) return;
StreakInfo storage s = streaks[user];
uint256 today = block.timestamp / 86400;
if (s.lastStreamDay == today) {
if (creatorAddress != address(0))
_updateDedicatedListener(user, creatorAddress, deltaSeconds);
return;
}
if (s.lastStreamDay == 0) {
s.streakDays = 1;
} else if (s.lastStreamDay == today - 1) {
s.streakDays++;
} else {
uint256 daysMissed = today - s.lastStreamDay - 1;
if (s.shields > 0 && daysMissed == 1) {
s.shields--;
s.streakDays++;
} else {
s.missedDays += daysMissed;
s.streakDays = 1;
}
}
s.lastStreamDay = today;
_checkStreakMilestones(user, s.streakDays);
if (creatorAddress != address(0))
_updateDedicatedListener(user, creatorAddress, deltaSeconds);
emit StreakUpdated(user, s.streakDays);
}
function _checkStreakMilestones(address user, uint256 day) internal {
StreakInfo storage s = streaks[user];
uint256 earned = 0;
if (day == 7 && !s.milestone7Claimed) { s.milestone7Claimed = true; earned++; }
if (day == 30 && !s.milestone30Claimed) { s.milestone30Claimed = true; earned++; }
if (day == 90 && !s.milestone90Claimed) { s.milestone90Claimed = true; earned++; }
if (day == 180 && !s.milestone180Claimed) { s.milestone180Claimed = true; earned++; }
if (earned > 0) {
s.shields += earned;
if (s.shields > maxShields) s.shields = maxShields;
emit StreakMilestone(user, day, earned);
}
if (day == 45 || day == 60) {
emit StreakCelebration(user, day);
}
}
// ─────────────────────────────────────────────────────────────────────────
// DEDICATED LISTENER
// ─────────────────────────────────────────────────────────────────────────
function _updateDedicatedListener(address user, address artist, uint256 deltaSeconds) internal {
if (artist == address(0) || deltaSeconds == 0) return;
artistTotalSeconds[user][artist] += deltaSeconds;
_checkDedicatedMilestones(user, artist, artistTotalSeconds[user][artist]);
}
function _checkDedicatedMilestones(address user, address artist, uint256 total) internal {
if (total >= dedicatedFanThreshold && !dedicatedFanClaimed[user][artist]) {
dedicatedFanClaimed[user][artist] = true;
emit DedicatedListenerFrame(user, artist, 0, total, block.timestamp);
}
if (total >= dedicatedCollectorThreshold && !dedicatedCollectorClaimed[user][artist]) {
dedicatedCollectorClaimed[user][artist] = true;
emit DedicatedListenerFrame(user, artist, 1, total, block.timestamp);
}
if (total >= dedicatedCuratorThreshold && !dedicatedCuratorClaimed[user][artist]) {
dedicatedCuratorClaimed[user][artist] = true;
emit DedicatedListenerFrame(user, artist, 2, total, block.timestamp);
}
if (total >= dedicatedLegendThreshold && !dedicatedLegendClaimed[user][artist]) {
dedicatedLegendClaimed[user][artist] = true;
emit DedicatedListenerFrame(user, artist, 3, total, block.timestamp);
}
}
// ─────────────────────────────────────────────────────────────────────────
// SHIELD PURCHASE
// ─────────────────────────────────────────────────────────────────────────
function purchaseShield(uint256 myfiAmount) external nonReentrant returns (uint256 newShieldCount) {
require(!paused, "Paused");
require(address(jackpotToken) != address(0), "MEFI not set");
require(myfiAmount == shieldCostMyfi, "Wrong amount");
StreakInfo storage s = streaks[msg.sender];
require(s.shields < maxShields, "Max shields held");
IERC20(jackpotToken).safeTransferFrom(msg.sender, address(this), myfiAmount);
s.shields++;
s.purchasedShieldsCount++;
newShieldCount = s.shields;
emit ShieldPurchased(msg.sender, myfiAmount, newShieldCount);
emit JackpotFunded(myfiAmount, jackpotPool());
}
function getShieldCost() external view returns (uint256) { return shieldCostMyfi; }
// ─────────────────────────────────────────────────────────────────────────
// WEEKLY JACKPOT
// ─────────────────────────────────────────────────────────────────────────
/**
* @notice Oracle settles the weekly jackpot each Sunday.
* 5% → Legend KEY stakers equally
* 95% → top streamers by boostedSeconds (oracle-ranked)
* ALL participants' weeklyBoostedSeconds reset.
*/
function distributeWeeklyJackpot(
address[] calldata winners,
uint256[] calldata amounts,
address[] calldata allParticipants
) external nonReentrant {
require(msg.sender == oracleSigner || msg.sender == owner(), "Auth");
require(winners.length == amounts.length, "Mismatch");
require(winners.length > 0, "No winners");
require(block.timestamp >= lastJackpotSettlement + 6 days, "Too soon");
// Always reset all participants before pool check (prevents carry-forward bug)
for (uint256 i = 0; i < allParticipants.length; i++) {
weeklyBoostedSeconds[allParticipants[i]] = 0;
}
uint256 pool = jackpotPool();
if (pool < minJackpotSize) {
emit WeeklyJackpotRolledOver(pool, pool);
lastJackpotSettlement = block.timestamp;
weekNumber++;
return;
}
IERC20 mefi = IERC20(jackpotToken);
// Legend staker split (5%)
uint256 legendPool_ = (pool * legendPoolBps) / BPS_DENOMINATOR;
uint256 activeLegendCount = _countActiveLegendStakers();
if (legendPool_ > 0 && activeLegendCount > 0) {
uint256 perLegend = legendPool_ / activeLegendCount;
if (perLegend > 0) {
for (uint256 i = 0; i < legendStakerList.length; i++) {
if (!_isActiveLegend(legendStakerList[i])) continue;
mefi.safeTransfer(legendStakerList[i], perLegend);
}
}
}
// Competitive payout
uint256 totalPayout = 0;
for (uint256 i = 0; i < amounts.length; i++) totalPayout += amounts[i];
require(totalPayout <= pool, "Exceeds pool");
for (uint256 i = 0; i < winners.length; i++) {
if (amounts[i] > 0 && winners[i] != address(0)) {
mefi.safeTransfer(winners[i], amounts[i]);
}
}
emit WeeklyJackpotDistributed(winners, amounts, weekNumber, totalPayout);
lastJackpotSettlement = block.timestamp;
weekNumber++;
}
function _countActiveLegendStakers() internal view returns (uint256 count) {
for (uint256 i = 0; i < legendStakerList.length; i++) {
if (_isActiveLegend(legendStakerList[i])) count++;
}
}
function _isActiveLegend(address staker) internal view returns (bool) {
if (address(keyStaking) == address(0)) return false;
try keyStaking.getTierId(staker) returns (uint8 tierId) {
return tierId == legendTierId;
} catch { return false; }
}
function syncLegendStakers(address[] calldata stakers) external {
require(msg.sender == oracleSigner || msg.sender == owner(), "Auth");
for (uint256 i = 0; i < legendStakerList.length; i++) {
isLegendStaker[legendStakerList[i]] = false;
}
delete legendStakerList;
for (uint256 i = 0; i < stakers.length; i++) {
if (!isLegendStaker[stakers[i]]) {
legendStakerList.push(stakers[i]);
isLegendStaker[stakers[i]] = true;
}
}
}
function fundJackpot(uint256 amount) external nonReentrant {
IERC20(jackpotToken).safeTransferFrom(msg.sender, address(this), amount);
emit JackpotFunded(amount, jackpotPool());
}
function notifyMyfiReceived(uint256 amount) external nonReentrant {
require(msg.sender == oracleSigner || msg.sender == owner(), "Auth");
// MEFI already transferred to this contract by caller
emit JackpotFunded(amount, jackpotPool());
}
// ─────────────────────────────────────────────────────────────────────────
// DEDICATED LISTENER — oracle + user functions
// ─────────────────────────────────────────────────────────────────────────
function recordTopArtists(
address user,
address artist1,
address artist2,
address artist3
) external {
require(msg.sender == oracleSigner || msg.sender == owner(), "Auth");
require(artist1 != address(0), "Must have at least one artist");
uint256 sd = streaks[user].streakDays;
emit TopArtistsUpdated(user, artist1, artist2, artist3, block.timestamp);
emit DedicatedListener(user, artist1, sd, block.timestamp);
if (artist2 != address(0)) emit DedicatedListener(user, artist2, sd, block.timestamp);
if (artist3 != address(0)) emit DedicatedListener(user, artist3, sd, block.timestamp);
}
function recordDedicatedListener(address user, address topArtist) external {
require(msg.sender == oracleSigner || msg.sender == owner(), "Auth");
require(topArtist != address(0), "Bad artist");
emit DedicatedListener(user, topArtist, streaks[user].streakDays, block.timestamp);
}
function getDedicatedListenerInfo(address user, address artist) external view returns (
uint256 totalSeconds,
bool fanEarned,
bool collectorEarned,
bool curatorEarned,
bool legendEarned
) {
return (
artistTotalSeconds[user][artist],
dedicatedFanClaimed[user][artist],
dedicatedCollectorClaimed[user][artist],
dedicatedCuratorClaimed[user][artist],
dedicatedLegendClaimed[user][artist]
);
}
function setActiveFrame(address artist, uint8 frameTier) external {
require(frameTier <= 3, "Invalid tier");
if (artist == address(0)) {
activeFrameArtist[msg.sender] = address(0);
activeFrameTier[msg.sender] = 0;
emit ActiveFrameSet(msg.sender, address(0), 0);
return;
}
if (frameTier == 0) require(dedicatedFanClaimed[msg.sender][artist], "Fan frame not earned");
if (frameTier == 1) require(dedicatedCollectorClaimed[msg.sender][artist], "Collector frame not earned");
if (frameTier == 2) require(dedicatedCuratorClaimed[msg.sender][artist], "Curator frame not earned");
if (frameTier == 3) require(dedicatedLegendClaimed[msg.sender][artist], "Legend frame not earned");
activeFrameArtist[msg.sender] = artist;
activeFrameTier[msg.sender] = frameTier;
emit ActiveFrameSet(msg.sender, artist, frameTier);
}
function getActiveFrame(address user) external view returns (address artist, uint8 frameTier) {
return (activeFrameArtist[user], activeFrameTier[user]);
}
// ─────────────────────────────────────────────────────────────────────────
// VIEW FUNCTIONS
// ─────────────────────────────────────────────────────────────────────────
/**
* @notice 10-field streak info — preserves MysteryBoxV3 ABI compatibility.
* Field 1 (streakMultiplierBps) always returns 0 — deprecated.
*/
function getStreakInfo(address user) external view returns (
uint256 streakDays,
uint256 streakMultiplierBps,
uint256 lastStreamDay,
uint256 missedDays,
uint256 shields,
uint256 purchasedShieldsCount,
bool milestone7Claimed,
bool milestone30Claimed,
bool milestone90Claimed,
bool milestone180Claimed
) {
StreakInfo storage s = streaks[user];
return (
s.streakDays,
0,
s.lastStreamDay,
s.missedDays,
s.shields,
s.purchasedShieldsCount,
s.milestone7Claimed,
s.milestone30Claimed,
s.milestone90Claimed,
s.milestone180Claimed
);
}
function getSystemStatus() external view returns (
uint256 jackpotBalance,
uint256 nextJackpotTime,
uint256 currentWeek,
bool isPaused,
address factory_,
uint256 shieldCost,
uint256 maxShields_,
uint256 legendPoolBps_
) {
return (
jackpotPool(),
lastJackpotSettlement + SECONDS_PER_WEEK,
weekNumber,
paused,
address(artistFactory),
shieldCostMyfi,
maxShields,
legendPoolBps
);
}
/**
* @notice Single call for the jackpot page — all competition data in one read.
*/
function getJackpotInfo() external view returns (
uint256 pool,
uint256 nextDistribution,
uint256 week,
uint256 minSize,
uint256 legendShare,
uint256 shieldCost_,
uint256 maxShields_
) {
return (
jackpotPool(),
lastJackpotSettlement + SECONDS_PER_WEEK,
weekNumber,
minJackpotSize,
legendPoolBps,
shieldCostMyfi,
maxShields
);
}
/**
* @notice Streak and boosted seconds summary for the profile page.
*/
function getUserStreakInfo(address user) external view returns (
uint256 streakDays_,
uint256 shields_,
uint256 weeklyBoosted,
uint256 lifetimeBoosted,
bool milestone7,
bool milestone30,
bool milestone90,
bool milestone180
) {
StreakInfo storage s = streaks[user];
return (
s.streakDays,
s.shields,
weeklyBoostedSeconds[user],
totalLifetimeBoostedSeconds[user],
s.milestone7Claimed,
s.milestone30Claimed,
s.milestone90Claimed,
s.milestone180Claimed
);
}
/**
* @notice Active frame and leaderboard data for the profile page.
*/
function getUserFrameInfo(address user) external view returns (
address activeFrameArtist_,
uint8 activeFrameTier_,
uint256 weeklyBoosted,
uint256 lifetimeBoosted
) {
return (
activeFrameArtist[user],
activeFrameTier[user],
weeklyBoostedSeconds[user],
totalLifetimeBoostedSeconds[user]
);
}
// ─────────────────────────────────────────────────────────────────────────
// ADMIN
// ─────────────────────────────────────────────────────────────────────────
function setArtistFactory(address _factory) external onlyOwner {
artistFactory = IArtistTokenFactory(_factory);
}
function setKeyStaking(address _ks) external onlyOwner {
keyStaking = IKEYStaking(_ks);
}
function setJackpotToken(address _t) external onlyOwner { jackpotToken = _t; }
function setMinJackpotSize(uint256 _m) external onlyOwner { minJackpotSize = _m; }
function setShieldCost(uint256 _costMyfi) external onlyOwner { shieldCostMyfi = _costMyfi; }
function setMaxShields(uint256 _max) external onlyOwner {
require(_max >= 1 && _max <= 5, "Out of range");
maxShields = _max;
}
function setLegendPoolBps(uint256 _bps) external onlyOwner {
require(_bps <= 2000, "Max 20%");
legendPoolBps = _bps;
}
function setLegendTierId(uint8 _tierId) external onlyOwner { legendTierId = _tierId; }
function setDedicatedListenerThresholds(
uint256 fanSecs,
uint256 collectorSecs,
uint256 curatorSecs,
uint256 legendSecs
) external onlyOwner {
require(
fanSecs < collectorSecs &&
collectorSecs < curatorSecs &&
curatorSecs < legendSecs,
"Bad order"
);
dedicatedFanThreshold = fanSecs;
dedicatedCollectorThreshold = collectorSecs;
dedicatedCuratorThreshold = curatorSecs;
dedicatedLegendThreshold = legendSecs;
}
function setSignatureWindow(uint256 _seconds) external onlyOwner {
require(_seconds >= 60 && _seconds <= 3600, "Bad window");
signatureWindow = _seconds;
}
function setOracleChangeDelay(uint256 _seconds) external onlyOwner {
require(_seconds >= 3600, "Bad delay");
oracleChangeDelay = _seconds;
}
function setPaused(bool _paused) external onlyOwner { paused = _paused; }
function proposeOracleSignerChange(address newSigner) external onlyOwner {
require(newSigner != address(0), "Zero addr");
pendingOracleSigner = newSigner;
oracleSignerChangeTime = block.timestamp + oracleChangeDelay;
emit OracleSignerProposed(newSigner, oracleSignerChangeTime);
}
function executeOracleSignerChange() external onlyOwner {
require(pendingOracleSigner != address(0), "No change");
require(block.timestamp >= oracleSignerChangeTime, "Locked");
address old = oracleSigner;
oracleSigner = pendingOracleSigner;
pendingOracleSigner = address(0);
emit OracleSignerChanged(old, oracleSigner);
}
function cancelOracleSignerChange() external onlyOwner {
pendingOracleSigner = address(0);
}
function rescueToken(address token, uint256 amount) external onlyOwner {
require(token != jackpotToken, "Cannot rescue jackpot token");
IERC20(token).safeTransfer(owner(), amount);
}
// ─────────────────────────────────────────────────────────────────────────
// MIGRATION — V5 state import
// ─────────────────────────────────────────────────────────────────────────
bool public migrationOpen = true;
modifier onlyDuringMigration() {
require(migrationOpen, "Locked");
require(msg.sender == owner(), "Auth");
_;
}
function lockMigration() external onlyOwner {
migrationOpen = false;
emit MigrationLocked();
}
function migrateNonces(
address[] calldata users,
uint256[] calldata nonces
) external onlyDuringMigration {
require(users.length == nonces.length, "Mismatch");
for (uint256 i = 0; i < users.length; i++) {
if (nonces[i] > userNonces[users[i]])
userNonces[users[i]] = nonces[i];
}
}
function migrateStreamingHistory(
address[] calldata users,
uint256[] calldata lifetimeSecs,
uint256[] calldata weeklySecs
) external onlyDuringMigration {
require(
users.length == lifetimeSecs.length &&
users.length == weeklySecs.length,
"Mismatch"
);
for (uint256 i = 0; i < users.length; i++) {
totalLifetimeBoostedSeconds[users[i]] += lifetimeSecs[i];
weeklyBoostedSeconds[users[i]] += weeklySecs[i];
}
}
function migrateStreaks(
address[] calldata users,
StreakInfo[] calldata streakData
) external onlyDuringMigration {
require(users.length == streakData.length, "Mismatch");
for (uint256 i = 0; i < users.length; i++) {
streaks[users[i]] = streakData[i];
}
}
function migrateArtistSeconds(
address[] calldata users,
address[] calldata artists,
uint256[] calldata seconds_
) external onlyDuringMigration {
require(
users.length == artists.length &&
users.length == seconds_.length,
"Mismatch"
);
for (uint256 i = 0; i < users.length; i++) {
artistTotalSeconds[users[i]][artists[i]] += seconds_[i];
}
}
}
/v5.0.2/contracts/utils/math/SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}
/v5.0.2/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}
/v5.0.2/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}
/v5.0.2/contracts/utils/cryptography/MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}
/v5.0.2/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS, s);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}
/v5.0.2/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
/v5.0.2/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
/v5.0.2/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}
/v5.0.2/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
/v5.0.2/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
/v5.0.2/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/v5.0.2/contracts/utils/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"paris","compilationTarget":{"contracts/AER/StreamingRewardsV6.sol":"StreamingRewardsV6"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_oracleSigner","internalType":"address"},{"type":"address","name":"_keyStaking","internalType":"address"},{"type":"address","name":"_artistFactory","internalType":"address"},{"type":"address","name":"_jackpotToken","internalType":"address"},{"type":"address","name":"initialOwner","internalType":"address"}]},{"type":"error","name":"AddressEmptyCode","inputs":[{"type":"address","name":"target","internalType":"address"}]},{"type":"error","name":"AddressInsufficientBalance","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ECDSAInvalidSignature","inputs":[]},{"type":"error","name":"ECDSAInvalidSignatureLength","inputs":[{"type":"uint256","name":"length","internalType":"uint256"}]},{"type":"error","name":"ECDSAInvalidSignatureS","inputs":[{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"error","name":"FailedInnerCall","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"ActiveFrameSet","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"artist","internalType":"address","indexed":true},{"type":"uint8","name":"frameTier","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"DedicatedListener","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"topArtist","internalType":"address","indexed":true},{"type":"uint256","name":"streakDays","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"DedicatedListenerFrame","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"artist","internalType":"address","indexed":true},{"type":"uint8","name":"frameTier","internalType":"uint8","indexed":false},{"type":"uint256","name":"totalSeconds","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FactoryMintCalled","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"artist","internalType":"address","indexed":true},{"type":"uint256","name":"boostedDelta","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"FactoryMintFailed","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"artist","internalType":"address","indexed":true},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"JackpotFunded","inputs":[{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"newTotal","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MigrationLocked","inputs":[],"anonymous":false},{"type":"event","name":"OracleSignerChanged","inputs":[{"type":"address","name":"oldSigner","internalType":"address","indexed":true},{"type":"address","name":"newSigner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OracleSignerProposed","inputs":[{"type":"address","name":"proposed","internalType":"address","indexed":true},{"type":"uint256","name":"executeAfter","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ShieldPurchased","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"cost","internalType":"uint256","indexed":false},{"type":"uint256","name":"newShieldCount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StreakCelebration","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"day","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StreakMilestone","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"day","internalType":"uint256","indexed":false},{"type":"uint256","name":"shieldsEarned","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StreakUpdated","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"streakDays","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StreamUpdated","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"boostedDelta","internalType":"uint256","indexed":false},{"type":"uint256","name":"weeklyTotal","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TopArtistsUpdated","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"artist1","internalType":"address","indexed":false},{"type":"address","name":"artist2","internalType":"address","indexed":false},{"type":"address","name":"artist3","internalType":"address","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WeeklyJackpotDistributed","inputs":[{"type":"address[]","name":"winners","internalType":"address[]","indexed":false},{"type":"uint256[]","name":"amounts","internalType":"uint256[]","indexed":false},{"type":"uint256","name":"weekNumber","internalType":"uint256","indexed":false},{"type":"uint256","name":"totalPaid","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WeeklyJackpotRolledOver","inputs":[{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"newTotal","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"BPS_DENOMINATOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"SECONDS_PER_WEEK","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"activeFrameArtist","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"activeFrameTier","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IArtistTokenFactory"}],"name":"artistFactory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"artistTotalSeconds","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelOracleSignerChange","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"dedicatedCollectorClaimed","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dedicatedCollectorThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"dedicatedCuratorClaimed","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dedicatedCuratorThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"dedicatedFanClaimed","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dedicatedFanThreshold","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"dedicatedLegendClaimed","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"dedicatedLegendThreshold","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"distributeWeeklyJackpot","inputs":[{"type":"address[]","name":"winners","internalType":"address[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"address[]","name":"allParticipants","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeOracleSignerChange","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"fundJackpot","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"artist","internalType":"address"},{"type":"uint8","name":"frameTier","internalType":"uint8"}],"name":"getActiveFrame","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"totalSeconds","internalType":"uint256"},{"type":"bool","name":"fanEarned","internalType":"bool"},{"type":"bool","name":"collectorEarned","internalType":"bool"},{"type":"bool","name":"curatorEarned","internalType":"bool"},{"type":"bool","name":"legendEarned","internalType":"bool"}],"name":"getDedicatedListenerInfo","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"address","name":"artist","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"pool","internalType":"uint256"},{"type":"uint256","name":"nextDistribution","internalType":"uint256"},{"type":"uint256","name":"week","internalType":"uint256"},{"type":"uint256","name":"minSize","internalType":"uint256"},{"type":"uint256","name":"legendShare","internalType":"uint256"},{"type":"uint256","name":"shieldCost_","internalType":"uint256"},{"type":"uint256","name":"maxShields_","internalType":"uint256"}],"name":"getJackpotInfo","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getShieldCost","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"streakDays","internalType":"uint256"},{"type":"uint256","name":"streakMultiplierBps","internalType":"uint256"},{"type":"uint256","name":"lastStreamDay","internalType":"uint256"},{"type":"uint256","name":"missedDays","internalType":"uint256"},{"type":"uint256","name":"shields","internalType":"uint256"},{"type":"uint256","name":"purchasedShieldsCount","internalType":"uint256"},{"type":"bool","name":"milestone7Claimed","internalType":"bool"},{"type":"bool","name":"milestone30Claimed","internalType":"bool"},{"type":"bool","name":"milestone90Claimed","internalType":"bool"},{"type":"bool","name":"milestone180Claimed","internalType":"bool"}],"name":"getStreakInfo","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"jackpotBalance","internalType":"uint256"},{"type":"uint256","name":"nextJackpotTime","internalType":"uint256"},{"type":"uint256","name":"currentWeek","internalType":"uint256"},{"type":"bool","name":"isPaused","internalType":"bool"},{"type":"address","name":"factory_","internalType":"address"},{"type":"uint256","name":"shieldCost","internalType":"uint256"},{"type":"uint256","name":"maxShields_","internalType":"uint256"},{"type":"uint256","name":"legendPoolBps_","internalType":"uint256"}],"name":"getSystemStatus","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"activeFrameArtist_","internalType":"address"},{"type":"uint8","name":"activeFrameTier_","internalType":"uint8"},{"type":"uint256","name":"weeklyBoosted","internalType":"uint256"},{"type":"uint256","name":"lifetimeBoosted","internalType":"uint256"}],"name":"getUserFrameInfo","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"streakDays_","internalType":"uint256"},{"type":"uint256","name":"shields_","internalType":"uint256"},{"type":"uint256","name":"weeklyBoosted","internalType":"uint256"},{"type":"uint256","name":"lifetimeBoosted","internalType":"uint256"},{"type":"bool","name":"milestone7","internalType":"bool"},{"type":"bool","name":"milestone30","internalType":"bool"},{"type":"bool","name":"milestone90","internalType":"bool"},{"type":"bool","name":"milestone180","internalType":"bool"}],"name":"getUserStreakInfo","inputs":[{"type":"address","name":"user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isLegendStaker","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"jackpotPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"jackpotToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IKEYStaking"}],"name":"keyStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastJackpotSettlement","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"legendPoolBps","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"legendStakerList","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"legendTierId","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"lockMigration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxShields","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateArtistSeconds","inputs":[{"type":"address[]","name":"users","internalType":"address[]"},{"type":"address[]","name":"artists","internalType":"address[]"},{"type":"uint256[]","name":"seconds_","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateNonces","inputs":[{"type":"address[]","name":"users","internalType":"address[]"},{"type":"uint256[]","name":"nonces","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateStreaks","inputs":[{"type":"address[]","name":"users","internalType":"address[]"},{"type":"tuple[]","name":"streakData","internalType":"struct StreamingRewardsV6.StreakInfo[]","components":[{"type":"uint256","name":"streakDays","internalType":"uint256"},{"type":"uint256","name":"lastStreamDay","internalType":"uint256"},{"type":"uint256","name":"missedDays","internalType":"uint256"},{"type":"uint256","name":"shields","internalType":"uint256"},{"type":"uint256","name":"purchasedShieldsCount","internalType":"uint256"},{"type":"bool","name":"milestone7Claimed","internalType":"bool"},{"type":"bool","name":"milestone30Claimed","internalType":"bool"},{"type":"bool","name":"milestone90Claimed","internalType":"bool"},{"type":"bool","name":"milestone180Claimed","internalType":"bool"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"migrateStreamingHistory","inputs":[{"type":"address[]","name":"users","internalType":"address[]"},{"type":"uint256[]","name":"lifetimeSecs","internalType":"uint256[]"},{"type":"uint256[]","name":"weeklySecs","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"migrationOpen","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minJackpotSize","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"notifyMyfiReceived","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"oracleChangeDelay","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"oracleSigner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"oracleSignerChangeTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingOracleSigner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"proposeOracleSignerChange","inputs":[{"type":"address","name":"newSigner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"newShieldCount","internalType":"uint256"}],"name":"purchaseShield","inputs":[{"type":"uint256","name":"myfiAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recordDedicatedListener","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"address","name":"topArtist","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recordTopArtists","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"address","name":"artist1","internalType":"address"},{"type":"address","name":"artist2","internalType":"address"},{"type":"address","name":"artist3","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueToken","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setActiveFrame","inputs":[{"type":"address","name":"artist","internalType":"address"},{"type":"uint8","name":"frameTier","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setArtistFactory","inputs":[{"type":"address","name":"_factory","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDedicatedListenerThresholds","inputs":[{"type":"uint256","name":"fanSecs","internalType":"uint256"},{"type":"uint256","name":"collectorSecs","internalType":"uint256"},{"type":"uint256","name":"curatorSecs","internalType":"uint256"},{"type":"uint256","name":"legendSecs","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setJackpotToken","inputs":[{"type":"address","name":"_t","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setKeyStaking","inputs":[{"type":"address","name":"_ks","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLegendPoolBps","inputs":[{"type":"uint256","name":"_bps","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLegendTierId","inputs":[{"type":"uint8","name":"_tierId","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxShields","inputs":[{"type":"uint256","name":"_max","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinJackpotSize","inputs":[{"type":"uint256","name":"_m","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracleChangeDelay","inputs":[{"type":"uint256","name":"_seconds","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaused","inputs":[{"type":"bool","name":"_paused","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setShieldCost","inputs":[{"type":"uint256","name":"_costMyfi","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSignatureWindow","inputs":[{"type":"uint256","name":"_seconds","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"shieldCostMyfi","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"signatureWindow","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"streakDays","internalType":"uint256"},{"type":"uint256","name":"lastStreamDay","internalType":"uint256"},{"type":"uint256","name":"missedDays","internalType":"uint256"},{"type":"uint256","name":"shields","internalType":"uint256"},{"type":"uint256","name":"purchasedShieldsCount","internalType":"uint256"},{"type":"bool","name":"milestone7Claimed","internalType":"bool"},{"type":"bool","name":"milestone30Claimed","internalType":"bool"},{"type":"bool","name":"milestone90Claimed","internalType":"bool"},{"type":"bool","name":"milestone180Claimed","internalType":"bool"}],"name":"streaks","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"syncLegendStakers","inputs":[{"type":"address[]","name":"stakers","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalLifetimeBoostedSeconds","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateStream","inputs":[{"type":"address","name":"user","internalType":"address"},{"type":"uint256","name":"deltaSeconds","internalType":"uint256"},{"type":"uint256","name":"boostedDelta","internalType":"uint256"},{"type":"address","name":"creatorAddress","internalType":"address"},{"type":"bytes32","name":"trackId","internalType":"bytes32"},{"type":"uint256","name":"sessionId","internalType":"uint256"},{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userNonces","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"weekNumber","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"weeklyBoostedSeconds","inputs":[{"type":"address","name":"","internalType":"address"}]}]
Contract Creation Code
0x60806040526102586002556202a3006003908155610e10600c55614650600d5562011940600e5562057e40600f55678ac7230489e8000060135560148190556101f4601955601c805460ff191690911790556021805461ff00191661010017905534801561006c57600080fd5b506040516145b73803806145b783398101604081905261008b916101f0565b806001600160a01b0381166100bb57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100c481610184565b50600180556001600160a01b03851661010d5760405162461bcd60e51b815260206004820152600b60248201526a5a65726f206f7261636c6560a81b60448201526064016100b2565b50601e80546001600160a01b039586166001600160a01b031991821617909155601c805494861661010002610100600160a81b031990951694909417909355601d80549285169284169290921790915560188054919093169116179055426016556001601555670de0b6b3a7640000601755610255565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146101eb57600080fd5b919050565b600080600080600060a0868803121561020857600080fd5b610211866101d4565b945061021f602087016101d4565b935061022d604087016101d4565b925061023b606087016101d4565b9150610249608087016101d4565b90509295509295909350565b614353806102646000396000f3fe608060405234801561001057600080fd5b506004361061046a5760003560e01c8063953dd29a1161024c578063d66ddbec11610146578063ef9c7bce116100c3578063f762ab8511610087578063f762ab8514610dd0578063f795943814610df0578063f9c9b30814610e19578063fbc7b53014610e2c578063fcca9b7614610e3557600080fd5b8063ef9c7bce14610d6c578063f2fde38b14610d7f578063f3082ab914610d92578063f3b6328c14610db5578063f6290cf314610dc857600080fd5b8063e15bea6a1161010a578063e15bea6a14610c64578063e1a4521814610c6d578063e7df057614610c76578063ecef233f14610c7f578063ed8d2c5314610c9e57600080fd5b8063d66ddbec14610b62578063d8334dea14610b6b578063d994c92014610b7e578063dc8d49d514610b91578063dc95573b14610ba457600080fd5b8063bc485fab116101d4578063cda2c34711610198578063cda2c34714610afd578063cfe32bd514610b10578063d0902a0f14610b23578063d27794c614610b36578063d2d2d90114610b5957600080fd5b8063bc485fab14610ab3578063bf62b08514610abb578063c37f4b7b14610ace578063ca2cf16114610ae1578063cca8ebd314610aea57600080fd5b8063a79002201161021b578063a790022014610a5f578063ac7246f014610a72578063ae5e8b3014610a85578063b05b32ae14610a98578063b92db50314610aa057600080fd5b8063953dd29a14610a1f578063985498dc14610a3257806398c8bece14610a3a5780639ab3ec2f14610a4c57600080fd5b806350da1e4c11610368578063813ae831116102e55780638d420282116102a95780638d420282146109b15780638d7914ef146109df5780638da5cb5b146109e85780638ec9925e146109f95780638f4aaa8714610a0c57600080fd5b8063813ae8311461084e578063843e3e651461086157806384ae2a74146109155780638571c4411461091f57806387e321791461093257600080fd5b80635ef5cc4a1161032c5780635ef5cc4a1461070157806370b5b07e1461070a578063715018a614610738578063720e9aea1461074057806379fd9365146107a057600080fd5b806350da1e4c1461068957806352a44ed614610692578063534646381461069b5780635c975abb146106c65780635d2ada6b146106d357600080fd5b80632c1d7ebd116103f6578063442f2682116103ba578063442f2682146105fb57806344bbb3c91461060e578063468d4ca2146106215780634a13c6341461062a57806350c1d19d1461063d57600080fd5b80632c1d7ebd146105945780632f7801f41461059d57806333f3d628146105bd57806337b7e152146105d05780633d740769146105e857600080fd5b80630feb48ea1161043d5780630feb48ea1461052757806316c38b3c1461053a5780631709a61b1461054d5780631af72681146105785780632247e21c1461058157600080fd5b80630b957b281461046f5780630bad91d3146104b25780630be8287e146104e05780630fc0482a1461051d575b600080fd5b61049d61047d3660046139f3565b600a60209081526000928352604080842090915290825290205460ff1681565b60405190151581526020015b60405180910390f35b6104d26104c0366004613a26565b60046020526000908152604090205481565b6040519081526020016104a9565b6104e8610e48565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016104a9565b610525610e91565b005b610525610535366004613a41565b610ecf565b610525610548366004613b14565b611267565b601e54610560906001600160a01b031681565b6040516001600160a01b0390911681526020016104a9565b6104d2600d5481565b61052561058f3660046139f3565b611282565b6104d260205481565b6104d26105ab366004613a26565b60066020526000908152604090205481565b6105256105cb366004613b31565b611356565b601c546105609061010090046001600160a01b031681565b6105256105f6366004613a26565b6113e6565b610525610609366004613ba6565b611410565b61052561061c366004613c49565b611568565b6104d260035481565b610525610638366004613ba6565b61172e565b610645611b82565b6040805198895260208901979097529587019490945291151560608601526001600160a01b0316608085015260a084015260c083015260e0820152610100016104a9565b6104d2600c5481565b6104d260135481565b6104d26106a93660046139f3565b600760209081526000928352604080842090915290825290205481565b60215461049d9060ff1681565b61049d6106e13660046139f3565b600b60209081526000928352604080842090915290825290205460ff1681565b6104d260155481565b61049d6107183660046139f3565b600860209081526000928352604080842090915290825290205460ff1681565b610525611bde565b61077f61074e366004613a26565b6001600160a01b0390811660009081526010602090815260408083205460119092529091205491169160ff90911690565b604080516001600160a01b03909316835260ff9091166020830152016104a9565b6108026107ae366004613a26565b601260205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909160ff808216916101008104821691620100008204811691630100000090041689565b60408051998a5260208a01989098529688019590955260608701939093526080860191909152151560a0850152151560c0840152151560e08301521515610100820152610120016104a9565b6104d261085c366004613c9d565b611bf2565b6108d261086f366004613a26565b6001600160a01b0316600090815260126020908152604080832080546003820154600485528386205460059586905293909520549390910154909491929160ff808316926101008104821692620100008204831692630100000090920490911690565b60408051988952602089019790975295870194909452606086019290925215156080850152151560a0840152151560c0830152151560e0820152610100016104a9565b6104d262093a8081565b61052561092d366004613c9d565b611df0565b610985610940366004613a26565b6001600160a01b038082166000908152601060209081526040808320546011835281842054600484528285205460059094529190932054929093169260ff1693509193565b604080516001600160a01b03909516855260ff90931660208501529183015260608201526080016104a9565b61049d6109bf3660046139f3565b600960209081526000928352604080842090915290825290205460ff1681565b6104d2600f5481565b6000546001600160a01b0316610560565b601854610560906001600160a01b031681565b610525610a1a366004613c9d565b611e5e565b610525610a2d366004613c9d565b611ea9565b610525611ef0565b60215461049d90610100900460ff1681565b610525610a5a366004613ba6565b611fbb565b610525610a6d366004613a26565b61213a565b610525610a80366004613c9d565b61216a565b610525610a93366004613cc5565b612177565b6104d2612195565b610525610aae366004613a26565b61221f565b6105256122d5565b610560610ac9366004613c9d565b6122ef565b610525610adc366004613ce2565b612319565b6104d260145481565b601d54610560906001600160a01b031681565b610525610b0b366004613c9d565b612466565b610525610b1e366004613c9d565b6124af565b610525610b31366004613d51565b612508565b61049d610b44366004613a26565b601b6020526000908152604090205460ff1681565b6104d260195481565b6104d260165481565b610525610b79366004613c9d565b6126cb565b610525610b8c366004613d92565b612725565b610525610b9f366004613e34565b612811565b610c12610bb2366004613a26565b6001600160a01b0316600090815260126020526040812080546001820154600283015460038401546004850154600590950154939692949193909260ff808316926101008104821692620100008204831692630100000090920490911690565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a0860152151560c0850152151560e084015215156101008301521515610120820152610140016104a9565b6104d2600e5481565b6104d261271081565b6104d260175481565b601c54610c8c9060ff1681565b60405160ff90911681526020016104a9565b610d3c610cac3660046139f3565b6001600160a01b03918216600081815260076020908152604080832094909516808352938152848220548383526008825285832085845282528583205484845260098352868420868552835286842054858552600a8452878520878652845287852054958552600b8452878520968552959092529490912054939460ff9182169493821693928216929190911690565b6040805195865293151560208601529115159284019290925290151560608301521515608082015260a0016104a9565b601f54610560906001600160a01b031681565b610525610d8d366004613a26565b61287e565b610c8c610da0366004613a26565b60116020526000908152604090205460ff1681565b610525610dc3366004613c9d565b6128b9565b6013546104d2565b6104d2610dde366004613a26565b60056020526000908152604090205481565b610560610dfe366004613a26565b6010602052600090815260409020546001600160a01b031681565b610525610e27366004613e66565b6128c6565b6104d260025481565b610525610e43366004613a26565b612bda565b6000806000806000806000610e5b612195565b62093a80601654610e6c9190613eb3565b601554601754601954601354601454959d949c50929a50909850965094509092509050565b610e99612c04565b6021805461ff00191690556040517f9bb3a4a301e0fd406aaa546b2a772ebc9fca96f40128b2d160d9df351bcbf1bf90600090a1565b610ed7612c31565b60215460ff1615610f185760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b60448201526064015b60405180910390fd5b60008711610f555760405162461bcd60e51b815260206004820152600a6024820152695a65726f2064656c746160b01b6044820152606401610f0f565b6001600160a01b038916600090815260066020526040902054610f79906001613eb3565b8314610fb35760405162461bcd60e51b8152602060048201526009602482015268426164206e6f6e636560b81b6044820152606401610f0f565b610fc4898989898989898989612c5b565b6001600160a01b03808a166000908152600660205260409020849055601d541615801590610ffa57506001600160a01b03861615155b1561119c57601d5460405163156c0a9d60e31b81526001600160a01b038b811660048301528881166024830152604482018a90529091169063ab6054e890606401600060405180830381600087803b15801561105557600080fd5b505af1925050508015611066575060015b61114e57611072613ec6565b806308c379a0036110e25750611086613f1c565b8061109157506110e4565b866001600160a01b03168a6001600160a01b03167fe8467f7005bf496be63ae0bba095d0cfe006fc462c8f30fc177271f0673daecd836040516110d49190613fc3565b60405180910390a35061119c565b505b856001600160a01b0316896001600160a01b03167fe8467f7005bf496be63ae0bba095d0cfe006fc462c8f30fc177271f0673daecd604051611141906020808252600790820152662ab735b737bbb760c91b604082015260600190565b60405180910390a361119c565b856001600160a01b0316896001600160a01b03167f6b7fed0c1845611c44f2babc927c0825f1bd2ac990e5baf85004b173a1bdcdc38960405161119391815260200190565b60405180910390a35b6001600160a01b038916600090815260046020526040812080548992906111c4908490613eb3565b90915550506001600160a01b038916600090815260056020526040812080548992906111f1908490613eb3565b909155506112029050898988612d78565b6001600160a01b0389166000818152600460209081526040918290205482518b8152918201527fa91bb85274e57e1e9971f4d78df185f5b2f65364f5244bf6dd42045be2a7986b910160405180910390a261125c60018055565b505050505050505050565b61126f612c04565b6021805460ff1916911515919091179055565b601e546001600160a01b03163314806112a557506000546001600160a01b031633145b6112c15760405162461bcd60e51b8152600401610f0f90613ff6565b6001600160a01b0381166113045760405162461bcd60e51b815260206004820152600a60248201526910985908185c9d1a5cdd60b21b6044820152606401610f0f565b6001600160a01b0382811660008181526012602052604090819020549051928416926000805160206142fe8339815191529161134a914290918252602082015260400190565b60405180910390a35050565b61135e612c04565b6018546001600160a01b03908116908316036113bc5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420726573637565206a61636b706f7420746f6b656e00000000006044820152606401610f0f565b6113e26113d16000546001600160a01b031690565b6001600160a01b0384169083612f11565b5050565b6113ee612c04565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b602154610100900460ff166114375760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b031633146114615760405162461bcd60e51b8152600401610f0f90613ff6565b848314801561146f57508481145b61148b5760405162461bcd60e51b8152600401610f0f90614034565b60005b8581101561155f578282828181106114a8576114a8614056565b90506020020135600760008989858181106114c5576114c5614056565b90506020020160208101906114da9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061150e5761150e614056565b90506020020160208101906115239190613a26565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546115529190613eb3565b909155505060010161148e565b50505050505050565b601e546001600160a01b031633148061158b57506000546001600160a01b031633145b6115a75760405162461bcd60e51b8152600401610f0f90613ff6565b6001600160a01b0383166115fd5760405162461bcd60e51b815260206004820152601d60248201527f4d7573742068617665206174206c65617374206f6e65206172746973740000006044820152606401610f0f565b6001600160a01b038481166000818152601260209081526040918290205482518886168152878616928101929092529385168183015242606082015290517f5dd182fe622e0cdab05e2d23b32fb64ea67e079e949412aa81072c33c9be57f79181900360800190a2604080518281524260208201526001600160a01b0380871692908816916000805160206142fe833981519152910160405180910390a36001600160a01b038316156116e157604080518281524260208201526001600160a01b0380861692908816916000805160206142fe833981519152910160405180910390a35b6001600160a01b0382161561172757604080518281524260208201526001600160a01b0380851692908816916000805160206142fe833981519152910160405180910390a35b5050505050565b611736612c31565b601e546001600160a01b031633148061175957506000546001600160a01b031633145b6117755760405162461bcd60e51b8152600401610f0f90613ff6565b8483146117945760405162461bcd60e51b8152600401610f0f90614034565b846117ce5760405162461bcd60e51b815260206004820152600a6024820152694e6f2077696e6e65727360b01b6044820152606401610f0f565b6016546117de906207e900613eb3565b4210156118185760405162461bcd60e51b81526020600482015260086024820152672a37b79039b7b7b760c11b6044820152606401610f0f565b60005b818110156118725760006004600085858581811061183b5761183b614056565b90506020020160208101906118509190613a26565b6001600160a01b0316815260208101919091526040016000205560010161181b565b50600061187d612195565b90506017548110156118e15760408051828152602081018390527f8db0ebe5f64ac513aa57bc8f320f1b18dd3b7c6dc2cc68f383ee0521eb964bbc910160405180910390a142601655601580549060006118d68361406c565b919050555050611b71565b6018546019546001600160a01b0390911690600090612710906119049085614085565b61190e919061409c565b9050600061191a612f70565b905060008211801561192c5750600081115b156119c857600061193d828461409c565b905080156119c65760005b601a548110156119c457611982601a828154811061196857611968614056565b6000918252602090912001546001600160a01b0316612fb3565b156119bc576119bc601a828154811061199d5761199d614056565b6000918252602090912001546001600160a01b03878116911684612f11565b600101611948565b505b505b6000805b88811015611a02578989828181106119e6576119e6614056565b90506020020135826119f89190613eb3565b91506001016119cc565b5084811115611a425760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc81c1bdbdb60a21b6044820152606401610f0f565b60005b8a811015611b0e5760008a8a83818110611a6157611a61614056565b90506020020135118015611aa5575060008c8c83818110611a8457611a84614056565b9050602002016020810190611a999190613a26565b6001600160a01b031614155b15611b0657611b068c8c83818110611abf57611abf614056565b9050602002016020810190611ad49190613a26565b8b8b84818110611ae657611ae6614056565b90506020020135876001600160a01b0316612f119092919063ffffffff16565b600101611a45565b507fa96d0397e2fe4d6ef9f2667b45bd71a2f3ececf47b0147ff3c6652763cc146708b8b8b8b60155486604051611b4a969594939291906140be565b60405180910390a14260165560158054906000611b668361406c565b919050555050505050505b611b7a60018055565b505050505050565b600080600080600080600080611b96612195565b62093a80601654611ba79190613eb3565b601554602154601d54601354601454601954969f959e50939c5060ff9092169a506001600160a01b03169850965094509092509050565b611be6612c04565b611bf0600061305c565b565b6000611bfc612c31565b60215460ff1615611c385760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610f0f565b6018546001600160a01b0316611c7f5760405162461bcd60e51b815260206004820152600c60248201526b13515192481b9bdd081cd95d60a21b6044820152606401610f0f565b6013548214611cbf5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610f0f565b336000908152601260205260409020601454600382015410611d165760405162461bcd60e51b815260206004820152601060248201526f13585e081cda1a595b191cc81a195b1960821b6044820152606401610f0f565b601854611d2e906001600160a01b03163330866130ac565b600381018054906000611d408361406c565b9091555050600481018054906000611d578361406c565b90915550506003810154604080518581526020810183905291935033917f701e98e095ab8ad42761eb86893260239c36c303d20eb585510d50de2a041acb910160405180910390a27fdebc7807341368163ff883cc9f2791669b791ffa7a3c555196bfb70a1453d77583611dc9612195565b6040805192835260208301919091520160405180910390a150611deb60018055565b919050565b611df8612c31565b601854611e10906001600160a01b03163330846130ac565b7fdebc7807341368163ff883cc9f2791669b791ffa7a3c555196bfb70a1453d77581611e3a612195565b6040805192835260208301919091520160405180910390a1611e5b60018055565b50565b611e66612c04565b610e10811015611ea45760405162461bcd60e51b81526020600482015260096024820152684261642064656c617960b81b6044820152606401610f0f565b600355565b611eb1612c31565b601e546001600160a01b0316331480611ed457506000546001600160a01b031633145b611e105760405162461bcd60e51b8152600401610f0f90613ff6565b611ef8612c04565b601f546001600160a01b0316611f3c5760405162461bcd60e51b81526020600482015260096024820152684e6f206368616e676560b81b6044820152606401610f0f565b602054421015611f5e5760405162461bcd60e51b8152600401610f0f90614014565b601e8054601f80546001600160a01b03198084166001600160a01b038381169182179096559116909155604051929091169182907f9275b597b6188dcd901ecae14175fd5b02a5c9dee8bcce5af021f420af6cd1a390600090a350565b602154610100900460ff16611fe25760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b0316331461200c5760405162461bcd60e51b8152600401610f0f90613ff6565b848314801561201a57508481145b6120365760405162461bcd60e51b8152600401610f0f90614034565b60005b8581101561155f5784848281811061205357612053614056565b905060200201356005600089898581811061207057612070614056565b90506020020160208101906120859190613a26565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120b49190613eb3565b9091555083905082828181106120cc576120cc614056565b90506020020135600460008989858181106120e9576120e9614056565b90506020020160208101906120fe9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461212d9190613eb3565b9091555050600101612039565b612142612c04565b601c80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b612172612c04565b601355565b61217f612c04565b601c805460ff191660ff92909216919091179055565b6018546000906001600160a01b03166121ae5750600090565b6018546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156121f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221a919061414d565b905090565b612227612c04565b6001600160a01b0381166122695760405162461bcd60e51b81526020600482015260096024820152682d32b9379030b2323960b91b6044820152606401610f0f565b601f80546001600160a01b0319166001600160a01b0383161790556003546122919042613eb3565b60208181556040519182526001600160a01b038316917f2a1459dc71e0f6a29305688e3de1620261942b79596c24acce059a6200a26830910160405180910390a250565b6122dd612c04565b601f80546001600160a01b0319169055565b601a81815481106122ff57600080fd5b6000918252602090912001546001600160a01b0316905081565b602154610100900460ff166123405760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b0316331461236a5760405162461bcd60e51b8152600401610f0f90613ff6565b8281146123895760405162461bcd60e51b8152600401610f0f90614034565b60005b8381101561172757600660008686848181106123aa576123aa614056565b90506020020160208101906123bf9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020548383838181106123f2576123f2614056565b90506020020135111561245e5782828281811061241157612411614056565b905060200201356006600087878581811061242e5761242e614056565b90506020020160208101906124439190613a26565b6001600160a01b031681526020810191909152604001600020555b60010161238c565b61246e612c04565b6107d08111156124aa5760405162461bcd60e51b81526020600482015260076024820152664d61782032302560c81b6044820152606401610f0f565b601955565b6124b7612c04565b603c81101580156124ca5750610e108111155b6125035760405162461bcd60e51b815260206004820152600a6024820152694261642077696e646f7760b01b6044820152606401610f0f565b600255565b601e546001600160a01b031633148061252b57506000546001600160a01b031633145b6125475760405162461bcd60e51b8152600401610f0f90613ff6565b60005b601a548110156125a9576000601b6000601a848154811061256d5761256d614056565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905560010161254a565b506125b6601a60006139ad565b60005b818110156126c657601b60008484848181106125d7576125d7614056565b90506020020160208101906125ec9190613a26565b6001600160a01b0316815260208101919091526040016000205460ff166126be57601a83838381811061262157612621614056565b90506020020160208101906126369190613a26565b81546001808201845560009384526020842090910180546001600160a01b0319166001600160a01b03939093169290921790915590601b9085858581811061268057612680614056565b90506020020160208101906126959190613a26565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790555b6001016125b9565b505050565b6126d3612c04565b600181101580156126e5575060058111155b6127205760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662072616e676560a01b6044820152606401610f0f565b601455565b602154610100900460ff1661274c5760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b031633146127765760405162461bcd60e51b8152600401610f0f90613ff6565b8281146127955760405162461bcd60e51b8152600401610f0f90614034565b60005b83811015611727578282828181106127b2576127b2614056565b90506101200201601260008787858181106127cf576127cf614056565b90506020020160208101906127e49190613a26565b6001600160a01b0316815260208101919091526040016000206128078282614173565b5050600101612798565b612819612c04565b828410801561282757508183105b801561283257508082105b61286a5760405162461bcd60e51b81526020600482015260096024820152682130b21037b93232b960b91b6044820152606401610f0f565b600c93909355600d91909155600e55600f55565b612886612c04565b6001600160a01b0381166128b057604051631e4fbdf760e01b815260006004820152602401610f0f565b611e5b8161305c565b6128c1612c04565b601755565b60038160ff1611156129095760405162461bcd60e51b815260206004820152600c60248201526b24b73b30b634b2103a34b2b960a11b6044820152606401610f0f565b6001600160a01b0382166129755733600081815260106020908152604080832080546001600160a01b031916905560118252808320805460ff19169055518281529192917f33d9d44e193f8cff8e24f6948182cd5aba0aebd658e8e1dee977f35266d59193910161134a565b8060ff166000036129ea573360009081526008602090815260408083206001600160a01b038616845290915290205460ff166129ea5760405162461bcd60e51b815260206004820152601460248201527311985b88199c985b59481b9bdd0819585c9b995960621b6044820152606401610f0f565b8060ff16600103612a68573360009081526009602090815260408083206001600160a01b038616845290915290205460ff16612a685760405162461bcd60e51b815260206004820152601a60248201527f436f6c6c6563746f72206672616d65206e6f74206561726e65640000000000006044820152606401610f0f565b8060ff16600203612ae657336000908152600a602090815260408083206001600160a01b038616845290915290205460ff16612ae65760405162461bcd60e51b815260206004820152601860248201527f43757261746f72206672616d65206e6f74206561726e656400000000000000006044820152606401610f0f565b8060ff16600303612b6457336000908152600b602090815260408083206001600160a01b038616845290915290205460ff16612b645760405162461bcd60e51b815260206004820152601760248201527f4c6567656e64206672616d65206e6f74206561726e65640000000000000000006044820152606401610f0f565b33600081815260106020908152604080832080546001600160a01b0319166001600160a01b0388169081179091556011835292819020805460ff191660ff871690811790915590519081529192917f33d9d44e193f8cff8e24f6948182cd5aba0aebd658e8e1dee977f35266d59193910161134a565b612be2612c04565b601d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314611bf05760405163118cdaa760e01b8152336004820152602401610f0f565b600260015403612c5457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600060025442612c6b919061409c565b604080516001600160a01b03808e1660208301529181018c9052606081018b9052908916608082015260a0810188905260c0810187905260e081018690526101008101829052909150600090610120016040516020818303038152906040528051906020012090506000612d2085858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d1a92508691506130eb9050565b9061311e565b601e549091506001600160a01b03808316911614612d6a5760405162461bcd60e51b81526020600482015260076024820152664261642073696760c81b6044820152606401610f0f565b505050505050505050505050565b81600003612d8557505050565b6001600160a01b038316600090815260126020526040812090612dab620151804261409c565b905080826001015403612dd2576001600160a01b038316156117275761172785848661314a565b8160010154600003612de75760018255612e9c565b612df2600182614247565b826001015403612e14578154826000612e0a8361406c565b9190505550612e9c565b60006001836001015483612e289190614247565b612e329190614247565b905060008360030154118015612e485750806001145b15612e7c57600383018054906000612e5f8361425a565b90915550508254836000612e728361406c565b9190505550612e9a565b80836002016000828254612e909190613eb3565b9091555050600183555b505b600182018190558154612eb09086906131d7565b6001600160a01b03831615612eca57612eca85848661314a565b81546040519081526001600160a01b038616907f46f6fe577ecfefe55b0f14f0b42ddb4c22db1fb9bade43aa02c5ef4e5439512e9060200160405180910390a25050505050565b6040516001600160a01b038381166024830152604482018390526126c691859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506133c2565b6000805b601a54811015612faf57612f94601a828154811061196857611968614056565b15612fa75781612fa38161406c565b9250505b600101612f74565b5090565b601c5460009061010090046001600160a01b0316612fd357506000919050565b601c54604051630edf617560e41b81526001600160a01b0384811660048301526101009092049091169063edf6175090602401602060405180830381865afa92505050801561303f575060408051601f3d908101601f1916820190925261303c91810190614271565b60015b61304b57506000919050565b601c5460ff91821691161492915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0384811660248301528381166044830152606482018390526130e59186918216906323b872dd90608401612f3e565b50505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b60008060008061312e8686613425565b92509250925061313e8282613472565b50909150505b92915050565b6001600160a01b038216158061315e575080155b1561316857505050565b6001600160a01b0380841660009081526007602090815260408083209386168352929052908120805483929061319f908490613eb3565b90915550506001600160a01b038084166000908152600760209081526040808320938616835292905220546126c6908490849061352b565b6001600160a01b0382166000908152601260205260408120906007831480156132055750600582015460ff16155b156132275760058201805460ff19166001179055806132238161406c565b9150505b82601e14801561324157506005820154610100900460ff16155b156132655760058201805461ff001916610100179055806132618161406c565b9150505b82605a1480156132805750600582015462010000900460ff16155b156132a65760058201805462ff0000191662010000179055806132a28161406c565b9150505b8260b41480156132c2575060058201546301000000900460ff16155b156132ea5760058201805463ff00000019166301000000179055806132e68161406c565b9150505b801561336557808260030160008282546133049190613eb3565b9091555050601454600383015411156133205760145460038301555b60408051848152602081018390526001600160a01b038616917f3e36978d09ecbfcd5deec4f3c53e931d9a55776a08d36e727728c8f6b285f260910160405180910390a25b82602d1480613374575082603c145b156130e557836001600160a01b03167f797b20333f23f48d6e5874d29da16311e52b22731345bf45f7b8ca2daa7291cd846040516133b491815260200190565b60405180910390a250505050565b60006133d76001600160a01b038416836137a7565b905080516000141580156133fc5750808060200190518101906133fa919061428e565b155b156126c657604051635274afe760e01b81526001600160a01b0384166004820152602401610f0f565b6000806000835160410361345f5760208401516040850151606086015160001a613451888285856137bc565b95509550955050505061346b565b50508151600091506002905b9250925092565b6000826003811115613486576134866142ab565b0361348f575050565b60018260038111156134a3576134a36142ab565b036134c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156134d5576134d56142ab565b036134f65760405163fce698f760e01b815260048101829052602401610f0f565b600382600381111561350a5761350a6142ab565b036113e2576040516335e2f38360e21b815260048101829052602401610f0f565b600c54811015801561356357506001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff16155b156135c7576001600160a01b038381166000818152600860209081526040808320948716808452948252808320805460ff19166001179055805192835290820185905242908201526000805160206142de8339815191529060600160405180910390a35b600d5481101580156135ff57506001600160a01b0380841660009081526009602090815260408083209386168352929052205460ff16155b15613667576001600160a01b038381166000818152600960209081526040808320948716808452948252918290208054600160ff1990911681179091558251908152908101859052428183015290516000805160206142de8339815191529181900360600190a35b600e54811015801561369f57506001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff16155b15613705576001600160a01b038381166000818152600a6020908152604080832094871680845294825291829020805460ff19166001179055815160028152908101859052428183015290516000805160206142de833981519152916060908290030190a35b600f54811015801561373d57506001600160a01b038084166000908152600b602090815260408083209386168352929052205460ff16155b156126c6576001600160a01b038381166000818152600b6020908152604080832094871680845294825291829020805460ff19166001179055815160038152908101859052428183015290516000805160206142de833981519152916060908290030190a3505050565b60606137b58383600061388b565b9392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156137f75750600091506003905082613881565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561384b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661387757506000925060019150829050613881565b9250600091508190505b9450945094915050565b6060814710156138b05760405163cd78605960e01b8152306004820152602401610f0f565b600080856001600160a01b031684866040516138cc91906142c1565b60006040518083038185875af1925050503d8060008114613909576040519150601f19603f3d011682016040523d82523d6000602084013e61390e565b606091505b509150915061391e868383613928565b9695505050505050565b60608261393d5761393882613984565b6137b5565b815115801561395457506001600160a01b0384163b155b1561397d57604051639996b31560e01b81526001600160a01b0385166004820152602401610f0f565b50806137b5565b8051156139945780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090611bf0919060005b808211156126c6576000818401556001016139c6565b80356001600160a01b0381168114611deb57600080fd5b60008060408385031215613a0657600080fd5b613a0f836139dc565b9150613a1d602084016139dc565b90509250929050565b600060208284031215613a3857600080fd5b6137b5826139dc565b60008060008060008060008060006101008a8c031215613a6057600080fd5b613a698a6139dc565b985060208a0135975060408a01359650613a8560608b016139dc565b955060808a0135945060a08a0135935060c08a0135925060e08a01356001600160401b03811115613ab557600080fd5b8a01601f81018c13613ac657600080fd5b80356001600160401b03811115613adc57600080fd5b8c6020828401011115613aee57600080fd5b60208201935080925050509295985092959850929598565b8015158114611e5b57600080fd5b600060208284031215613b2657600080fd5b81356137b581613b06565b60008060408385031215613b4457600080fd5b613b4d836139dc565b946020939093013593505050565b60008083601f840112613b6d57600080fd5b5081356001600160401b03811115613b8457600080fd5b6020830191508360208260051b8501011115613b9f57600080fd5b9250929050565b60008060008060008060608789031215613bbf57600080fd5b86356001600160401b03811115613bd557600080fd5b613be189828a01613b5b565b90975095505060208701356001600160401b03811115613c0057600080fd5b613c0c89828a01613b5b565b90955093505060408701356001600160401b03811115613c2b57600080fd5b613c3789828a01613b5b565b979a9699509497509295939492505050565b60008060008060808587031215613c5f57600080fd5b613c68856139dc565b9350613c76602086016139dc565b9250613c84604086016139dc565b9150613c92606086016139dc565b905092959194509250565b600060208284031215613caf57600080fd5b5035919050565b60ff81168114611e5b57600080fd5b600060208284031215613cd757600080fd5b81356137b581613cb6565b60008060008060408587031215613cf857600080fd5b84356001600160401b03811115613d0e57600080fd5b613d1a87828801613b5b565b90955093505060208501356001600160401b03811115613d3957600080fd5b613d4587828801613b5b565b95989497509550505050565b60008060208385031215613d6457600080fd5b82356001600160401b03811115613d7a57600080fd5b613d8685828601613b5b565b90969095509350505050565b60008060008060408587031215613da857600080fd5b84356001600160401b03811115613dbe57600080fd5b613dca87828801613b5b565b90955093505060208501356001600160401b03811115613de957600080fd5b8501601f81018713613dfa57600080fd5b80356001600160401b03811115613e1057600080fd5b87602061012083028401011115613e2657600080fd5b949793965060200194505050565b60008060008060808587031215613e4a57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215613e7957600080fd5b613e82836139dc565b91506020830135613e9281613cb6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561314457613144613e9d565b600060033d1115613edf5760046000803e5060005160e01c5b90565b601f8201601f191681016001600160401b0381118282101715613f1557634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d1015613f2a5790565b6040513d600319016004823e80513d60248201116001600160401b0382111715613f5357505090565b80820180516001600160401b03811115613f6e575050505090565b3d8401600319018282016020011115613f88575050505090565b613f9760208285010185613ee2565b509392505050565b60005b83811015613fba578181015183820152602001613fa2565b50506000910152565b6020815260008251806020840152613fe2816040850160208701613f9f565b601f01601f19169190910160400192915050565b602080825260049082015263082eae8d60e31b604082015260600190565b602080825260069082015265131bd8dad95960d21b604082015260600190565b60208082526008908201526709ad2e6dac2e8c6d60c31b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161407e5761407e613e9d565b5060010190565b808202811582820484141761314457613144613e9d565b6000826140b957634e487b7160e01b600052601260045260246000fd5b500490565b6080808252810186905260008760a08301825b898110156140ff576001600160a01b036140ea846139dc565b168252602092830192909101906001016140d1565b5083810360208501528681526001600160fb1b0387111561411f57600080fd5b8660051b91508188602083013760208282010192505050836040830152826060830152979650505050505050565b60006020828403121561415f57600080fd5b5051919050565b6000813561314481613b06565b813581556020820135600182015560408201356002820155606082013560038201556080820135600482015560058101600060a08401356141b381613b06565b825460ff191660ff821515161783559050506141ee6141d460c08501614166565b82805461ff00191691151560081b61ff0016919091179055565b6142196141fd60e08501614166565b82805462ff0000191691151560101b62ff000016919091179055565b6126c66142296101008501614166565b82805463ff000000191691151560181b63ff00000016919091179055565b8181038181111561314457613144613e9d565b60008161426957614269613e9d565b506000190190565b60006020828403121561428357600080fd5b81516137b581613cb6565b6000602082840312156142a057600080fd5b81516137b581613b06565b634e487b7160e01b600052602160045260246000fd5b600082516142d3818460208701613f9f565b919091019291505056fe2d8a70ba38e324c45f616d6bd7355930a299c04e18a6082c403c504994c095b6628b7356de2062bea33757b892caf43731bcc3555f6fe746af75a640c1375d51a2646970667358221220f72b5c80654c7dd225929bd2174a8df58ca1062fd45050ce428f18719545604a64736f6c6343000822003300000000000000000000000017e7b189982d8df2539d059b46467a09a7bcb91d000000000000000000000000d7a138d66251ec49333e6a2c4b50781e7f49702d000000000000000000000000ba44071ea19962fc272676bd2a52f25f26d974880000000000000000000000004e988b163aab47fae182ec32bfe3c4d5908f4f30000000000000000000000000756639c761e228143780e022a175325d79797eec
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061046a5760003560e01c8063953dd29a1161024c578063d66ddbec11610146578063ef9c7bce116100c3578063f762ab8511610087578063f762ab8514610dd0578063f795943814610df0578063f9c9b30814610e19578063fbc7b53014610e2c578063fcca9b7614610e3557600080fd5b8063ef9c7bce14610d6c578063f2fde38b14610d7f578063f3082ab914610d92578063f3b6328c14610db5578063f6290cf314610dc857600080fd5b8063e15bea6a1161010a578063e15bea6a14610c64578063e1a4521814610c6d578063e7df057614610c76578063ecef233f14610c7f578063ed8d2c5314610c9e57600080fd5b8063d66ddbec14610b62578063d8334dea14610b6b578063d994c92014610b7e578063dc8d49d514610b91578063dc95573b14610ba457600080fd5b8063bc485fab116101d4578063cda2c34711610198578063cda2c34714610afd578063cfe32bd514610b10578063d0902a0f14610b23578063d27794c614610b36578063d2d2d90114610b5957600080fd5b8063bc485fab14610ab3578063bf62b08514610abb578063c37f4b7b14610ace578063ca2cf16114610ae1578063cca8ebd314610aea57600080fd5b8063a79002201161021b578063a790022014610a5f578063ac7246f014610a72578063ae5e8b3014610a85578063b05b32ae14610a98578063b92db50314610aa057600080fd5b8063953dd29a14610a1f578063985498dc14610a3257806398c8bece14610a3a5780639ab3ec2f14610a4c57600080fd5b806350da1e4c11610368578063813ae831116102e55780638d420282116102a95780638d420282146109b15780638d7914ef146109df5780638da5cb5b146109e85780638ec9925e146109f95780638f4aaa8714610a0c57600080fd5b8063813ae8311461084e578063843e3e651461086157806384ae2a74146109155780638571c4411461091f57806387e321791461093257600080fd5b80635ef5cc4a1161032c5780635ef5cc4a1461070157806370b5b07e1461070a578063715018a614610738578063720e9aea1461074057806379fd9365146107a057600080fd5b806350da1e4c1461068957806352a44ed614610692578063534646381461069b5780635c975abb146106c65780635d2ada6b146106d357600080fd5b80632c1d7ebd116103f6578063442f2682116103ba578063442f2682146105fb57806344bbb3c91461060e578063468d4ca2146106215780634a13c6341461062a57806350c1d19d1461063d57600080fd5b80632c1d7ebd146105945780632f7801f41461059d57806333f3d628146105bd57806337b7e152146105d05780633d740769146105e857600080fd5b80630feb48ea1161043d5780630feb48ea1461052757806316c38b3c1461053a5780631709a61b1461054d5780631af72681146105785780632247e21c1461058157600080fd5b80630b957b281461046f5780630bad91d3146104b25780630be8287e146104e05780630fc0482a1461051d575b600080fd5b61049d61047d3660046139f3565b600a60209081526000928352604080842090915290825290205460ff1681565b60405190151581526020015b60405180910390f35b6104d26104c0366004613a26565b60046020526000908152604090205481565b6040519081526020016104a9565b6104e8610e48565b604080519788526020880196909652948601939093526060850191909152608084015260a083015260c082015260e0016104a9565b610525610e91565b005b610525610535366004613a41565b610ecf565b610525610548366004613b14565b611267565b601e54610560906001600160a01b031681565b6040516001600160a01b0390911681526020016104a9565b6104d2600d5481565b61052561058f3660046139f3565b611282565b6104d260205481565b6104d26105ab366004613a26565b60066020526000908152604090205481565b6105256105cb366004613b31565b611356565b601c546105609061010090046001600160a01b031681565b6105256105f6366004613a26565b6113e6565b610525610609366004613ba6565b611410565b61052561061c366004613c49565b611568565b6104d260035481565b610525610638366004613ba6565b61172e565b610645611b82565b6040805198895260208901979097529587019490945291151560608601526001600160a01b0316608085015260a084015260c083015260e0820152610100016104a9565b6104d2600c5481565b6104d260135481565b6104d26106a93660046139f3565b600760209081526000928352604080842090915290825290205481565b60215461049d9060ff1681565b61049d6106e13660046139f3565b600b60209081526000928352604080842090915290825290205460ff1681565b6104d260155481565b61049d6107183660046139f3565b600860209081526000928352604080842090915290825290205460ff1681565b610525611bde565b61077f61074e366004613a26565b6001600160a01b0390811660009081526010602090815260408083205460119092529091205491169160ff90911690565b604080516001600160a01b03909316835260ff9091166020830152016104a9565b6108026107ae366004613a26565b601260205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909160ff808216916101008104821691620100008204811691630100000090041689565b60408051998a5260208a01989098529688019590955260608701939093526080860191909152151560a0850152151560c0840152151560e08301521515610100820152610120016104a9565b6104d261085c366004613c9d565b611bf2565b6108d261086f366004613a26565b6001600160a01b0316600090815260126020908152604080832080546003820154600485528386205460059586905293909520549390910154909491929160ff808316926101008104821692620100008204831692630100000090920490911690565b60408051988952602089019790975295870194909452606086019290925215156080850152151560a0840152151560c0830152151560e0820152610100016104a9565b6104d262093a8081565b61052561092d366004613c9d565b611df0565b610985610940366004613a26565b6001600160a01b038082166000908152601060209081526040808320546011835281842054600484528285205460059094529190932054929093169260ff1693509193565b604080516001600160a01b03909516855260ff90931660208501529183015260608201526080016104a9565b61049d6109bf3660046139f3565b600960209081526000928352604080842090915290825290205460ff1681565b6104d2600f5481565b6000546001600160a01b0316610560565b601854610560906001600160a01b031681565b610525610a1a366004613c9d565b611e5e565b610525610a2d366004613c9d565b611ea9565b610525611ef0565b60215461049d90610100900460ff1681565b610525610a5a366004613ba6565b611fbb565b610525610a6d366004613a26565b61213a565b610525610a80366004613c9d565b61216a565b610525610a93366004613cc5565b612177565b6104d2612195565b610525610aae366004613a26565b61221f565b6105256122d5565b610560610ac9366004613c9d565b6122ef565b610525610adc366004613ce2565b612319565b6104d260145481565b601d54610560906001600160a01b031681565b610525610b0b366004613c9d565b612466565b610525610b1e366004613c9d565b6124af565b610525610b31366004613d51565b612508565b61049d610b44366004613a26565b601b6020526000908152604090205460ff1681565b6104d260195481565b6104d260165481565b610525610b79366004613c9d565b6126cb565b610525610b8c366004613d92565b612725565b610525610b9f366004613e34565b612811565b610c12610bb2366004613a26565b6001600160a01b0316600090815260126020526040812080546001820154600283015460038401546004850154600590950154939692949193909260ff808316926101008104821692620100008204831692630100000090920490911690565b604080519a8b5260208b0199909952978901969096526060880194909452608087019290925260a0860152151560c0850152151560e084015215156101008301521515610120820152610140016104a9565b6104d2600e5481565b6104d261271081565b6104d260175481565b601c54610c8c9060ff1681565b60405160ff90911681526020016104a9565b610d3c610cac3660046139f3565b6001600160a01b03918216600081815260076020908152604080832094909516808352938152848220548383526008825285832085845282528583205484845260098352868420868552835286842054858552600a8452878520878652845287852054958552600b8452878520968552959092529490912054939460ff9182169493821693928216929190911690565b6040805195865293151560208601529115159284019290925290151560608301521515608082015260a0016104a9565b601f54610560906001600160a01b031681565b610525610d8d366004613a26565b61287e565b610c8c610da0366004613a26565b60116020526000908152604090205460ff1681565b610525610dc3366004613c9d565b6128b9565b6013546104d2565b6104d2610dde366004613a26565b60056020526000908152604090205481565b610560610dfe366004613a26565b6010602052600090815260409020546001600160a01b031681565b610525610e27366004613e66565b6128c6565b6104d260025481565b610525610e43366004613a26565b612bda565b6000806000806000806000610e5b612195565b62093a80601654610e6c9190613eb3565b601554601754601954601354601454959d949c50929a50909850965094509092509050565b610e99612c04565b6021805461ff00191690556040517f9bb3a4a301e0fd406aaa546b2a772ebc9fca96f40128b2d160d9df351bcbf1bf90600090a1565b610ed7612c31565b60215460ff1615610f185760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b60448201526064015b60405180910390fd5b60008711610f555760405162461bcd60e51b815260206004820152600a6024820152695a65726f2064656c746160b01b6044820152606401610f0f565b6001600160a01b038916600090815260066020526040902054610f79906001613eb3565b8314610fb35760405162461bcd60e51b8152602060048201526009602482015268426164206e6f6e636560b81b6044820152606401610f0f565b610fc4898989898989898989612c5b565b6001600160a01b03808a166000908152600660205260409020849055601d541615801590610ffa57506001600160a01b03861615155b1561119c57601d5460405163156c0a9d60e31b81526001600160a01b038b811660048301528881166024830152604482018a90529091169063ab6054e890606401600060405180830381600087803b15801561105557600080fd5b505af1925050508015611066575060015b61114e57611072613ec6565b806308c379a0036110e25750611086613f1c565b8061109157506110e4565b866001600160a01b03168a6001600160a01b03167fe8467f7005bf496be63ae0bba095d0cfe006fc462c8f30fc177271f0673daecd836040516110d49190613fc3565b60405180910390a35061119c565b505b856001600160a01b0316896001600160a01b03167fe8467f7005bf496be63ae0bba095d0cfe006fc462c8f30fc177271f0673daecd604051611141906020808252600790820152662ab735b737bbb760c91b604082015260600190565b60405180910390a361119c565b856001600160a01b0316896001600160a01b03167f6b7fed0c1845611c44f2babc927c0825f1bd2ac990e5baf85004b173a1bdcdc38960405161119391815260200190565b60405180910390a35b6001600160a01b038916600090815260046020526040812080548992906111c4908490613eb3565b90915550506001600160a01b038916600090815260056020526040812080548992906111f1908490613eb3565b909155506112029050898988612d78565b6001600160a01b0389166000818152600460209081526040918290205482518b8152918201527fa91bb85274e57e1e9971f4d78df185f5b2f65364f5244bf6dd42045be2a7986b910160405180910390a261125c60018055565b505050505050505050565b61126f612c04565b6021805460ff1916911515919091179055565b601e546001600160a01b03163314806112a557506000546001600160a01b031633145b6112c15760405162461bcd60e51b8152600401610f0f90613ff6565b6001600160a01b0381166113045760405162461bcd60e51b815260206004820152600a60248201526910985908185c9d1a5cdd60b21b6044820152606401610f0f565b6001600160a01b0382811660008181526012602052604090819020549051928416926000805160206142fe8339815191529161134a914290918252602082015260400190565b60405180910390a35050565b61135e612c04565b6018546001600160a01b03908116908316036113bc5760405162461bcd60e51b815260206004820152601b60248201527f43616e6e6f7420726573637565206a61636b706f7420746f6b656e00000000006044820152606401610f0f565b6113e26113d16000546001600160a01b031690565b6001600160a01b0384169083612f11565b5050565b6113ee612c04565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b602154610100900460ff166114375760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b031633146114615760405162461bcd60e51b8152600401610f0f90613ff6565b848314801561146f57508481145b61148b5760405162461bcd60e51b8152600401610f0f90614034565b60005b8581101561155f578282828181106114a8576114a8614056565b90506020020135600760008989858181106114c5576114c5614056565b90506020020160208101906114da9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020600087878581811061150e5761150e614056565b90506020020160208101906115239190613a26565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546115529190613eb3565b909155505060010161148e565b50505050505050565b601e546001600160a01b031633148061158b57506000546001600160a01b031633145b6115a75760405162461bcd60e51b8152600401610f0f90613ff6565b6001600160a01b0383166115fd5760405162461bcd60e51b815260206004820152601d60248201527f4d7573742068617665206174206c65617374206f6e65206172746973740000006044820152606401610f0f565b6001600160a01b038481166000818152601260209081526040918290205482518886168152878616928101929092529385168183015242606082015290517f5dd182fe622e0cdab05e2d23b32fb64ea67e079e949412aa81072c33c9be57f79181900360800190a2604080518281524260208201526001600160a01b0380871692908816916000805160206142fe833981519152910160405180910390a36001600160a01b038316156116e157604080518281524260208201526001600160a01b0380861692908816916000805160206142fe833981519152910160405180910390a35b6001600160a01b0382161561172757604080518281524260208201526001600160a01b0380851692908816916000805160206142fe833981519152910160405180910390a35b5050505050565b611736612c31565b601e546001600160a01b031633148061175957506000546001600160a01b031633145b6117755760405162461bcd60e51b8152600401610f0f90613ff6565b8483146117945760405162461bcd60e51b8152600401610f0f90614034565b846117ce5760405162461bcd60e51b815260206004820152600a6024820152694e6f2077696e6e65727360b01b6044820152606401610f0f565b6016546117de906207e900613eb3565b4210156118185760405162461bcd60e51b81526020600482015260086024820152672a37b79039b7b7b760c11b6044820152606401610f0f565b60005b818110156118725760006004600085858581811061183b5761183b614056565b90506020020160208101906118509190613a26565b6001600160a01b0316815260208101919091526040016000205560010161181b565b50600061187d612195565b90506017548110156118e15760408051828152602081018390527f8db0ebe5f64ac513aa57bc8f320f1b18dd3b7c6dc2cc68f383ee0521eb964bbc910160405180910390a142601655601580549060006118d68361406c565b919050555050611b71565b6018546019546001600160a01b0390911690600090612710906119049085614085565b61190e919061409c565b9050600061191a612f70565b905060008211801561192c5750600081115b156119c857600061193d828461409c565b905080156119c65760005b601a548110156119c457611982601a828154811061196857611968614056565b6000918252602090912001546001600160a01b0316612fb3565b156119bc576119bc601a828154811061199d5761199d614056565b6000918252602090912001546001600160a01b03878116911684612f11565b600101611948565b505b505b6000805b88811015611a02578989828181106119e6576119e6614056565b90506020020135826119f89190613eb3565b91506001016119cc565b5084811115611a425760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc81c1bdbdb60a21b6044820152606401610f0f565b60005b8a811015611b0e5760008a8a83818110611a6157611a61614056565b90506020020135118015611aa5575060008c8c83818110611a8457611a84614056565b9050602002016020810190611a999190613a26565b6001600160a01b031614155b15611b0657611b068c8c83818110611abf57611abf614056565b9050602002016020810190611ad49190613a26565b8b8b84818110611ae657611ae6614056565b90506020020135876001600160a01b0316612f119092919063ffffffff16565b600101611a45565b507fa96d0397e2fe4d6ef9f2667b45bd71a2f3ececf47b0147ff3c6652763cc146708b8b8b8b60155486604051611b4a969594939291906140be565b60405180910390a14260165560158054906000611b668361406c565b919050555050505050505b611b7a60018055565b505050505050565b600080600080600080600080611b96612195565b62093a80601654611ba79190613eb3565b601554602154601d54601354601454601954969f959e50939c5060ff9092169a506001600160a01b03169850965094509092509050565b611be6612c04565b611bf0600061305c565b565b6000611bfc612c31565b60215460ff1615611c385760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b6044820152606401610f0f565b6018546001600160a01b0316611c7f5760405162461bcd60e51b815260206004820152600c60248201526b13515192481b9bdd081cd95d60a21b6044820152606401610f0f565b6013548214611cbf5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610f0f565b336000908152601260205260409020601454600382015410611d165760405162461bcd60e51b815260206004820152601060248201526f13585e081cda1a595b191cc81a195b1960821b6044820152606401610f0f565b601854611d2e906001600160a01b03163330866130ac565b600381018054906000611d408361406c565b9091555050600481018054906000611d578361406c565b90915550506003810154604080518581526020810183905291935033917f701e98e095ab8ad42761eb86893260239c36c303d20eb585510d50de2a041acb910160405180910390a27fdebc7807341368163ff883cc9f2791669b791ffa7a3c555196bfb70a1453d77583611dc9612195565b6040805192835260208301919091520160405180910390a150611deb60018055565b919050565b611df8612c31565b601854611e10906001600160a01b03163330846130ac565b7fdebc7807341368163ff883cc9f2791669b791ffa7a3c555196bfb70a1453d77581611e3a612195565b6040805192835260208301919091520160405180910390a1611e5b60018055565b50565b611e66612c04565b610e10811015611ea45760405162461bcd60e51b81526020600482015260096024820152684261642064656c617960b81b6044820152606401610f0f565b600355565b611eb1612c31565b601e546001600160a01b0316331480611ed457506000546001600160a01b031633145b611e105760405162461bcd60e51b8152600401610f0f90613ff6565b611ef8612c04565b601f546001600160a01b0316611f3c5760405162461bcd60e51b81526020600482015260096024820152684e6f206368616e676560b81b6044820152606401610f0f565b602054421015611f5e5760405162461bcd60e51b8152600401610f0f90614014565b601e8054601f80546001600160a01b03198084166001600160a01b038381169182179096559116909155604051929091169182907f9275b597b6188dcd901ecae14175fd5b02a5c9dee8bcce5af021f420af6cd1a390600090a350565b602154610100900460ff16611fe25760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b0316331461200c5760405162461bcd60e51b8152600401610f0f90613ff6565b848314801561201a57508481145b6120365760405162461bcd60e51b8152600401610f0f90614034565b60005b8581101561155f5784848281811061205357612053614056565b905060200201356005600089898581811061207057612070614056565b90506020020160208101906120859190613a26565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120b49190613eb3565b9091555083905082828181106120cc576120cc614056565b90506020020135600460008989858181106120e9576120e9614056565b90506020020160208101906120fe9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461212d9190613eb3565b9091555050600101612039565b612142612c04565b601c80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b612172612c04565b601355565b61217f612c04565b601c805460ff191660ff92909216919091179055565b6018546000906001600160a01b03166121ae5750600090565b6018546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156121f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221a919061414d565b905090565b612227612c04565b6001600160a01b0381166122695760405162461bcd60e51b81526020600482015260096024820152682d32b9379030b2323960b91b6044820152606401610f0f565b601f80546001600160a01b0319166001600160a01b0383161790556003546122919042613eb3565b60208181556040519182526001600160a01b038316917f2a1459dc71e0f6a29305688e3de1620261942b79596c24acce059a6200a26830910160405180910390a250565b6122dd612c04565b601f80546001600160a01b0319169055565b601a81815481106122ff57600080fd5b6000918252602090912001546001600160a01b0316905081565b602154610100900460ff166123405760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b0316331461236a5760405162461bcd60e51b8152600401610f0f90613ff6565b8281146123895760405162461bcd60e51b8152600401610f0f90614034565b60005b8381101561172757600660008686848181106123aa576123aa614056565b90506020020160208101906123bf9190613a26565b6001600160a01b03166001600160a01b03168152602001908152602001600020548383838181106123f2576123f2614056565b90506020020135111561245e5782828281811061241157612411614056565b905060200201356006600087878581811061242e5761242e614056565b90506020020160208101906124439190613a26565b6001600160a01b031681526020810191909152604001600020555b60010161238c565b61246e612c04565b6107d08111156124aa5760405162461bcd60e51b81526020600482015260076024820152664d61782032302560c81b6044820152606401610f0f565b601955565b6124b7612c04565b603c81101580156124ca5750610e108111155b6125035760405162461bcd60e51b815260206004820152600a6024820152694261642077696e646f7760b01b6044820152606401610f0f565b600255565b601e546001600160a01b031633148061252b57506000546001600160a01b031633145b6125475760405162461bcd60e51b8152600401610f0f90613ff6565b60005b601a548110156125a9576000601b6000601a848154811061256d5761256d614056565b6000918252602080832091909101546001600160a01b031683528201929092526040019020805460ff191691151591909117905560010161254a565b506125b6601a60006139ad565b60005b818110156126c657601b60008484848181106125d7576125d7614056565b90506020020160208101906125ec9190613a26565b6001600160a01b0316815260208101919091526040016000205460ff166126be57601a83838381811061262157612621614056565b90506020020160208101906126369190613a26565b81546001808201845560009384526020842090910180546001600160a01b0319166001600160a01b03939093169290921790915590601b9085858581811061268057612680614056565b90506020020160208101906126959190613a26565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790555b6001016125b9565b505050565b6126d3612c04565b600181101580156126e5575060058111155b6127205760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662072616e676560a01b6044820152606401610f0f565b601455565b602154610100900460ff1661274c5760405162461bcd60e51b8152600401610f0f90614014565b6000546001600160a01b031633146127765760405162461bcd60e51b8152600401610f0f90613ff6565b8281146127955760405162461bcd60e51b8152600401610f0f90614034565b60005b83811015611727578282828181106127b2576127b2614056565b90506101200201601260008787858181106127cf576127cf614056565b90506020020160208101906127e49190613a26565b6001600160a01b0316815260208101919091526040016000206128078282614173565b5050600101612798565b612819612c04565b828410801561282757508183105b801561283257508082105b61286a5760405162461bcd60e51b81526020600482015260096024820152682130b21037b93232b960b91b6044820152606401610f0f565b600c93909355600d91909155600e55600f55565b612886612c04565b6001600160a01b0381166128b057604051631e4fbdf760e01b815260006004820152602401610f0f565b611e5b8161305c565b6128c1612c04565b601755565b60038160ff1611156129095760405162461bcd60e51b815260206004820152600c60248201526b24b73b30b634b2103a34b2b960a11b6044820152606401610f0f565b6001600160a01b0382166129755733600081815260106020908152604080832080546001600160a01b031916905560118252808320805460ff19169055518281529192917f33d9d44e193f8cff8e24f6948182cd5aba0aebd658e8e1dee977f35266d59193910161134a565b8060ff166000036129ea573360009081526008602090815260408083206001600160a01b038616845290915290205460ff166129ea5760405162461bcd60e51b815260206004820152601460248201527311985b88199c985b59481b9bdd0819585c9b995960621b6044820152606401610f0f565b8060ff16600103612a68573360009081526009602090815260408083206001600160a01b038616845290915290205460ff16612a685760405162461bcd60e51b815260206004820152601a60248201527f436f6c6c6563746f72206672616d65206e6f74206561726e65640000000000006044820152606401610f0f565b8060ff16600203612ae657336000908152600a602090815260408083206001600160a01b038616845290915290205460ff16612ae65760405162461bcd60e51b815260206004820152601860248201527f43757261746f72206672616d65206e6f74206561726e656400000000000000006044820152606401610f0f565b8060ff16600303612b6457336000908152600b602090815260408083206001600160a01b038616845290915290205460ff16612b645760405162461bcd60e51b815260206004820152601760248201527f4c6567656e64206672616d65206e6f74206561726e65640000000000000000006044820152606401610f0f565b33600081815260106020908152604080832080546001600160a01b0319166001600160a01b0388169081179091556011835292819020805460ff191660ff871690811790915590519081529192917f33d9d44e193f8cff8e24f6948182cd5aba0aebd658e8e1dee977f35266d59193910161134a565b612be2612c04565b601d80546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314611bf05760405163118cdaa760e01b8152336004820152602401610f0f565b600260015403612c5457604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600060025442612c6b919061409c565b604080516001600160a01b03808e1660208301529181018c9052606081018b9052908916608082015260a0810188905260c0810187905260e081018690526101008101829052909150600090610120016040516020818303038152906040528051906020012090506000612d2085858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d1a92508691506130eb9050565b9061311e565b601e549091506001600160a01b03808316911614612d6a5760405162461bcd60e51b81526020600482015260076024820152664261642073696760c81b6044820152606401610f0f565b505050505050505050505050565b81600003612d8557505050565b6001600160a01b038316600090815260126020526040812090612dab620151804261409c565b905080826001015403612dd2576001600160a01b038316156117275761172785848661314a565b8160010154600003612de75760018255612e9c565b612df2600182614247565b826001015403612e14578154826000612e0a8361406c565b9190505550612e9c565b60006001836001015483612e289190614247565b612e329190614247565b905060008360030154118015612e485750806001145b15612e7c57600383018054906000612e5f8361425a565b90915550508254836000612e728361406c565b9190505550612e9a565b80836002016000828254612e909190613eb3565b9091555050600183555b505b600182018190558154612eb09086906131d7565b6001600160a01b03831615612eca57612eca85848661314a565b81546040519081526001600160a01b038616907f46f6fe577ecfefe55b0f14f0b42ddb4c22db1fb9bade43aa02c5ef4e5439512e9060200160405180910390a25050505050565b6040516001600160a01b038381166024830152604482018390526126c691859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506133c2565b6000805b601a54811015612faf57612f94601a828154811061196857611968614056565b15612fa75781612fa38161406c565b9250505b600101612f74565b5090565b601c5460009061010090046001600160a01b0316612fd357506000919050565b601c54604051630edf617560e41b81526001600160a01b0384811660048301526101009092049091169063edf6175090602401602060405180830381865afa92505050801561303f575060408051601f3d908101601f1916820190925261303c91810190614271565b60015b61304b57506000919050565b601c5460ff91821691161492915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0384811660248301528381166044830152606482018390526130e59186918216906323b872dd90608401612f3e565b50505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c91909152603c902090565b60008060008061312e8686613425565b92509250925061313e8282613472565b50909150505b92915050565b6001600160a01b038216158061315e575080155b1561316857505050565b6001600160a01b0380841660009081526007602090815260408083209386168352929052908120805483929061319f908490613eb3565b90915550506001600160a01b038084166000908152600760209081526040808320938616835292905220546126c6908490849061352b565b6001600160a01b0382166000908152601260205260408120906007831480156132055750600582015460ff16155b156132275760058201805460ff19166001179055806132238161406c565b9150505b82601e14801561324157506005820154610100900460ff16155b156132655760058201805461ff001916610100179055806132618161406c565b9150505b82605a1480156132805750600582015462010000900460ff16155b156132a65760058201805462ff0000191662010000179055806132a28161406c565b9150505b8260b41480156132c2575060058201546301000000900460ff16155b156132ea5760058201805463ff00000019166301000000179055806132e68161406c565b9150505b801561336557808260030160008282546133049190613eb3565b9091555050601454600383015411156133205760145460038301555b60408051848152602081018390526001600160a01b038616917f3e36978d09ecbfcd5deec4f3c53e931d9a55776a08d36e727728c8f6b285f260910160405180910390a25b82602d1480613374575082603c145b156130e557836001600160a01b03167f797b20333f23f48d6e5874d29da16311e52b22731345bf45f7b8ca2daa7291cd846040516133b491815260200190565b60405180910390a250505050565b60006133d76001600160a01b038416836137a7565b905080516000141580156133fc5750808060200190518101906133fa919061428e565b155b156126c657604051635274afe760e01b81526001600160a01b0384166004820152602401610f0f565b6000806000835160410361345f5760208401516040850151606086015160001a613451888285856137bc565b95509550955050505061346b565b50508151600091506002905b9250925092565b6000826003811115613486576134866142ab565b0361348f575050565b60018260038111156134a3576134a36142ab565b036134c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156134d5576134d56142ab565b036134f65760405163fce698f760e01b815260048101829052602401610f0f565b600382600381111561350a5761350a6142ab565b036113e2576040516335e2f38360e21b815260048101829052602401610f0f565b600c54811015801561356357506001600160a01b0380841660009081526008602090815260408083209386168352929052205460ff16155b156135c7576001600160a01b038381166000818152600860209081526040808320948716808452948252808320805460ff19166001179055805192835290820185905242908201526000805160206142de8339815191529060600160405180910390a35b600d5481101580156135ff57506001600160a01b0380841660009081526009602090815260408083209386168352929052205460ff16155b15613667576001600160a01b038381166000818152600960209081526040808320948716808452948252918290208054600160ff1990911681179091558251908152908101859052428183015290516000805160206142de8339815191529181900360600190a35b600e54811015801561369f57506001600160a01b038084166000908152600a602090815260408083209386168352929052205460ff16155b15613705576001600160a01b038381166000818152600a6020908152604080832094871680845294825291829020805460ff19166001179055815160028152908101859052428183015290516000805160206142de833981519152916060908290030190a35b600f54811015801561373d57506001600160a01b038084166000908152600b602090815260408083209386168352929052205460ff16155b156126c6576001600160a01b038381166000818152600b6020908152604080832094871680845294825291829020805460ff19166001179055815160038152908101859052428183015290516000805160206142de833981519152916060908290030190a3505050565b60606137b58383600061388b565b9392505050565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156137f75750600091506003905082613881565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561384b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661387757506000925060019150829050613881565b9250600091508190505b9450945094915050565b6060814710156138b05760405163cd78605960e01b8152306004820152602401610f0f565b600080856001600160a01b031684866040516138cc91906142c1565b60006040518083038185875af1925050503d8060008114613909576040519150601f19603f3d011682016040523d82523d6000602084013e61390e565b606091505b509150915061391e868383613928565b9695505050505050565b60608261393d5761393882613984565b6137b5565b815115801561395457506001600160a01b0384163b155b1561397d57604051639996b31560e01b81526001600160a01b0385166004820152602401610f0f565b50806137b5565b8051156139945780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546000825590600052602060002090611bf0919060005b808211156126c6576000818401556001016139c6565b80356001600160a01b0381168114611deb57600080fd5b60008060408385031215613a0657600080fd5b613a0f836139dc565b9150613a1d602084016139dc565b90509250929050565b600060208284031215613a3857600080fd5b6137b5826139dc565b60008060008060008060008060006101008a8c031215613a6057600080fd5b613a698a6139dc565b985060208a0135975060408a01359650613a8560608b016139dc565b955060808a0135945060a08a0135935060c08a0135925060e08a01356001600160401b03811115613ab557600080fd5b8a01601f81018c13613ac657600080fd5b80356001600160401b03811115613adc57600080fd5b8c6020828401011115613aee57600080fd5b60208201935080925050509295985092959850929598565b8015158114611e5b57600080fd5b600060208284031215613b2657600080fd5b81356137b581613b06565b60008060408385031215613b4457600080fd5b613b4d836139dc565b946020939093013593505050565b60008083601f840112613b6d57600080fd5b5081356001600160401b03811115613b8457600080fd5b6020830191508360208260051b8501011115613b9f57600080fd5b9250929050565b60008060008060008060608789031215613bbf57600080fd5b86356001600160401b03811115613bd557600080fd5b613be189828a01613b5b565b90975095505060208701356001600160401b03811115613c0057600080fd5b613c0c89828a01613b5b565b90955093505060408701356001600160401b03811115613c2b57600080fd5b613c3789828a01613b5b565b979a9699509497509295939492505050565b60008060008060808587031215613c5f57600080fd5b613c68856139dc565b9350613c76602086016139dc565b9250613c84604086016139dc565b9150613c92606086016139dc565b905092959194509250565b600060208284031215613caf57600080fd5b5035919050565b60ff81168114611e5b57600080fd5b600060208284031215613cd757600080fd5b81356137b581613cb6565b60008060008060408587031215613cf857600080fd5b84356001600160401b03811115613d0e57600080fd5b613d1a87828801613b5b565b90955093505060208501356001600160401b03811115613d3957600080fd5b613d4587828801613b5b565b95989497509550505050565b60008060208385031215613d6457600080fd5b82356001600160401b03811115613d7a57600080fd5b613d8685828601613b5b565b90969095509350505050565b60008060008060408587031215613da857600080fd5b84356001600160401b03811115613dbe57600080fd5b613dca87828801613b5b565b90955093505060208501356001600160401b03811115613de957600080fd5b8501601f81018713613dfa57600080fd5b80356001600160401b03811115613e1057600080fd5b87602061012083028401011115613e2657600080fd5b949793965060200194505050565b60008060008060808587031215613e4a57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215613e7957600080fd5b613e82836139dc565b91506020830135613e9281613cb6565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561314457613144613e9d565b600060033d1115613edf5760046000803e5060005160e01c5b90565b601f8201601f191681016001600160401b0381118282101715613f1557634e487b7160e01b600052604160045260246000fd5b6040525050565b600060443d1015613f2a5790565b6040513d600319016004823e80513d60248201116001600160401b0382111715613f5357505090565b80820180516001600160401b03811115613f6e575050505090565b3d8401600319018282016020011115613f88575050505090565b613f9760208285010185613ee2565b509392505050565b60005b83811015613fba578181015183820152602001613fa2565b50506000910152565b6020815260008251806020840152613fe2816040850160208701613f9f565b601f01601f19169190910160400192915050565b602080825260049082015263082eae8d60e31b604082015260600190565b602080825260069082015265131bd8dad95960d21b604082015260600190565b60208082526008908201526709ad2e6dac2e8c6d60c31b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006001820161407e5761407e613e9d565b5060010190565b808202811582820484141761314457613144613e9d565b6000826140b957634e487b7160e01b600052601260045260246000fd5b500490565b6080808252810186905260008760a08301825b898110156140ff576001600160a01b036140ea846139dc565b168252602092830192909101906001016140d1565b5083810360208501528681526001600160fb1b0387111561411f57600080fd5b8660051b91508188602083013760208282010192505050836040830152826060830152979650505050505050565b60006020828403121561415f57600080fd5b5051919050565b6000813561314481613b06565b813581556020820135600182015560408201356002820155606082013560038201556080820135600482015560058101600060a08401356141b381613b06565b825460ff191660ff821515161783559050506141ee6141d460c08501614166565b82805461ff00191691151560081b61ff0016919091179055565b6142196141fd60e08501614166565b82805462ff0000191691151560101b62ff000016919091179055565b6126c66142296101008501614166565b82805463ff000000191691151560181b63ff00000016919091179055565b8181038181111561314457613144613e9d565b60008161426957614269613e9d565b506000190190565b60006020828403121561428357600080fd5b81516137b581613cb6565b6000602082840312156142a057600080fd5b81516137b581613b06565b634e487b7160e01b600052602160045260246000fd5b600082516142d3818460208701613f9f565b919091019291505056fe2d8a70ba38e324c45f616d6bd7355930a299c04e18a6082c403c504994c095b6628b7356de2062bea33757b892caf43731bcc3555f6fe746af75a640c1375d51a2646970667358221220f72b5c80654c7dd225929bd2174a8df58ca1062fd45050ce428f18719545604a64736f6c63430008220033