Overview
AVAX Balance
AVAX Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
StakedAvax
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "./StakedAvaxStorage.sol"; contract StakedAvax is IERC20Upgradeable, AccessControlUpgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable, StakedAvaxStorage { using SafeMathUpgradeable for uint; /// @notice Emitted when a user stakes AVAX event Submitted(address indexed user, uint avaxAmount, uint shareAmount); /// @notice Emitted when a user requests sAVAX to be converted back to AVAX event UnlockRequested(address indexed user, uint shareAmount); /// @notice Emitted when a user cancel a pending unlock request event UnlockCancelled(address indexed user, uint unlockRequestedAt, uint shareAmount); /// @notice Emitted when a user redeems delegated AVAX event Redeem(address indexed user, uint unlockRequestedAt, uint shareAmount, uint avaxAmount); /// @notice Emitted when a user redeems sAVAX which was not burned for AVAX withing the `redeemPeriod`. event RedeemOverdueShares(address indexed user, uint shareAmount); /// @notice Emitted when a warden withdraws AVAX for delegation event Withdraw(address indexed user, uint amount); /// @notice Emitted when a warden deposits AVAX into the contract event Deposit(address indexed user, uint amount); /// @notice Emitted when the cooldown period is updated event CooldownPeriodUpdated(uint oldCooldownPeriod, uint newCooldownPeriod); /// @notice Emitted when the redeem period is updated event RedeemPeriodUpdated(uint oldRedeemPeriod, uint newRedeemPeriod); /// @notice Emitted when the maximum pooled AVAX amount is changed event TotalPooledAvaxCapUpdated(uint oldTotalPooldAvaxCap, uint newTotalPooledAvaxCap); /// @notice Emitted when rewards are distributed into the pool event AccrueRewards(uint userRewardAmount, uint protocolRewardAmount); /// @notice Emitted when sAVAX minting is paused event MintingPaused(address user); /// @notice Emitted when sAVAX minting is resumed event MintingResumed(address user); /// @notice Emitted when the protocol reward share recipient is updated event ProtocolRewardShareRecipientUpdated( address oldProtocolRewardShareRecipient, address newProtocolRewardShareRecipient ); /// @notice Emitted when the protocol reward share percentage is updated event ProtocolRewardShareUpdated(uint oldProtocolRewardShare, uint newProtocolRewardShare); constructor() initializer public {} /** * @notice Initialize the StakedAvax contract * @param _cooldownPeriod Time delay before shares can be burned for AVAX * @param _redeemPeriod AVAX redemption period after unlock cooldown has elapsed */ function initialize(uint _cooldownPeriod, uint _redeemPeriod) initializer public { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); cooldownPeriod = _cooldownPeriod; emit CooldownPeriodUpdated(0, _cooldownPeriod); redeemPeriod = _redeemPeriod; emit RedeemPeriodUpdated(0, _redeemPeriod); totalPooledAvaxCap = uint(-1); emit TotalPooledAvaxCapUpdated(0, totalPooledAvaxCap); } /** * @return The name of the token. */ function name() public pure returns (string memory) { return "Staked AVAX"; } /** * @return The symbol of the token. */ function symbol() public pure returns (string memory) { return "sAVAX"; } /** * @return The number of decimals for getting user representation of a token amount. */ function decimals() public pure returns (uint8) { return 18; } /** * @return The amount of tokens in existence. */ function totalSupply() public view override returns (uint) { return totalShares; } /** * @return The amount of sAVAX tokens owned by the `account`. */ function balanceOf(address account) public view override returns (uint) { return shares[account]; } /** * @notice Moves `amount` tokens from the caller's account to the `recipient` account. * Emits a `Transfer` event. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. * - the contract must not be paused. * * @return A boolean value indicating whether the operation succeeded. */ function transfer(address recipient, uint amount) public override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @return The remaining number of tokens that `spender` is allowed to spend on behalf of `owner` * through `transferFrom`. This is zero by default. * * @dev This value changes when `approve` or `transferFrom` is called. */ function allowance(address owner, address spender) public view override returns (uint) { return allowances[owner][spender]; } /** * @notice Sets `amount` as the allowance of `spender` over the caller's tokens. * Emits an `Approval` event. * * Requirements: * * - `spender` cannot be the zero address. * - the contract must not be paused. * * @return A boolean value indicating whether the operation succeeded. */ function approve(address spender, uint amount) public override returns (bool) { _approve(msg.sender, spender, amount); return true; } /** * @notice Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` * is then deducted from the caller's allowance. * * @return A boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `sender` and `recipient` cannot be the zero addresses. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for `sender`'s tokens of at least `amount`. * - the contract must not be paused. */ function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { uint currentAllowance = allowances[sender][msg.sender]; require(currentAllowance >= amount, "TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE"); _transfer(sender, recipient, amount); _approve(sender, msg.sender, currentAllowance.sub(amount)); return true; } /** * @return The amount of shares that corresponds to `avaxAmount` protocol-controlled AVAX. */ function getSharesByPooledAvax(uint avaxAmount) public view returns (uint) { if (totalPooledAvax == 0) { return 0; } uint shares = avaxAmount.mul(totalShares).div(totalPooledAvax); require(shares > 0, "Invalid share count"); return shares; } /** * @return The amount of AVAX that corresponds to `shareAmount` token shares. */ function getPooledAvaxByShares(uint shareAmount) public view returns (uint) { if (totalShares == 0) { return 0; } return shareAmount.mul(totalPooledAvax).div(totalShares); } /** * @notice Start unlocking cooldown period for `shareAmount` AVAX * @param shareAmount Amount of shares to unlock */ function requestUnlock(uint shareAmount) external nonReentrant whenNotPaused { require(shareAmount > 0, "Invalid unlock amount"); require(shareAmount <= shares[msg.sender], "Unlock amount too large"); userSharesInCustody[msg.sender] = userSharesInCustody[msg.sender].add(shareAmount); _transfer(msg.sender, address(this), shareAmount); userUnlockRequests[msg.sender].push(UnlockRequest( block.timestamp, shareAmount )); emit UnlockRequested(msg.sender, shareAmount); } /** * @notice Get the number of active unlock requests by user * @param user User address */ function getUnlockRequestCount(address user) external view returns (uint) { return userUnlockRequests[user].length; } /** * @notice Get a subsection of a user's unlock requests * @param user User account address * @param from List start index * @param to List end index */ function getPaginatedUnlockRequests(address user, uint from, uint to) external view returns ( UnlockRequest[] memory, uint[] memory ) { require(from < userUnlockRequests[user].length, "From index out of bounds"); require(from < to, "To index must be greater than from index"); if (to > userUnlockRequests[user].length) { to = userUnlockRequests[user].length; } UnlockRequest[] memory paginatedUnlockRequests = new UnlockRequest[](to.sub(from)); uint[] memory exchangeRates = new uint[](to.sub(from)); for (uint i = 0; i < to.sub(from); i = i.add(1)) { paginatedUnlockRequests[i] = userUnlockRequests[user][from.add(i)]; if (_isWithinRedemptionPeriod(paginatedUnlockRequests[i])) { (bool success, uint exchangeRate) = _getExchangeRateByUnlockTimestamp(paginatedUnlockRequests[i].startedAt); require(success, "Exchange rate not found"); exchangeRates[i] = exchangeRate; } } return (paginatedUnlockRequests, exchangeRates); } /** * @notice Cancel all unlock requests that are pending the cooldown period to elapse. */ function cancelPendingUnlockRequests() external nonReentrant { uint unlockIndex; while (unlockIndex < userUnlockRequests[msg.sender].length) { if (!_isWithinCooldownPeriod(userUnlockRequests[msg.sender][unlockIndex])) { unlockIndex = unlockIndex.add(1); continue; } _cancelUnlockRequest(unlockIndex); } } /** * @notice Cancel all unlock requests that are redeemable. */ function cancelRedeemableUnlockRequests() external nonReentrant { uint unlockIndex; while (unlockIndex < userUnlockRequests[msg.sender].length) { if (!_isWithinRedemptionPeriod(userUnlockRequests[msg.sender][unlockIndex])) { unlockIndex = unlockIndex.add(1); continue; } _cancelUnlockRequest(unlockIndex); } } /** * @notice Cancel an unexpired unlock request * @param unlockIndex Index number of the cancelled unlock */ function cancelUnlockRequest(uint unlockIndex) external nonReentrant { _cancelUnlockRequest(unlockIndex); } /** * @notice Redeem all redeemable AVAX from all unlocks */ function redeem() external nonReentrant { uint unlockRequestCount = userUnlockRequests[msg.sender].length; uint i = 0; while (i < unlockRequestCount) { if (!_isWithinRedemptionPeriod(userUnlockRequests[msg.sender][i])) { i = i.add(1); continue; } _redeem(i); unlockRequestCount = unlockRequestCount.sub(1); } } /** * @notice Redeem AVAX after cooldown has finished * @param unlockIndex Index number of the redeemed unlock request */ function redeem(uint unlockIndex) external nonReentrant { _redeem(unlockIndex); } /** * @notice Redeem all sAVAX held in custody for overdue unlock requests */ function redeemOverdueShares() external nonReentrant whenNotPaused { uint totalOverdueShares = 0; uint unlockCount = userUnlockRequests[msg.sender].length; uint i = 0; while (i < unlockCount) { UnlockRequest memory unlockRequest = userUnlockRequests[msg.sender][i]; if (!_isExpired(unlockRequest)) { i = i.add(1); continue; } totalOverdueShares = totalOverdueShares.add(unlockRequest.shareAmount); userUnlockRequests[msg.sender][i] = userUnlockRequests[msg.sender][userUnlockRequests[msg.sender].length.sub(1)]; userUnlockRequests[msg.sender].pop(); unlockCount = unlockCount.sub(1); } if (totalOverdueShares > 0) { userSharesInCustody[msg.sender] = userSharesInCustody[msg.sender].sub(totalOverdueShares); _transfer(address(this), msg.sender, totalOverdueShares); emit RedeemOverdueShares(msg.sender, totalOverdueShares); } } /** * @notice Redeem sAVAX held in custody for the given unlock request * @param unlockIndex Unlock request array index */ function redeemOverdueShares(uint unlockIndex) external nonReentrant whenNotPaused { require(unlockIndex < userUnlockRequests[msg.sender].length, "Invalid unlock index"); UnlockRequest memory unlockRequest = userUnlockRequests[msg.sender][unlockIndex]; require(_isExpired(unlockRequest), "Unlock request is not expired"); uint shareAmount = unlockRequest.shareAmount; userSharesInCustody[msg.sender] = userSharesInCustody[msg.sender].sub(shareAmount); userUnlockRequests[msg.sender][unlockIndex] = userUnlockRequests[msg.sender][userUnlockRequests[msg.sender].length - 1]; userUnlockRequests[msg.sender].pop(); _transfer(address(this), msg.sender, shareAmount); emit RedeemOverdueShares(msg.sender, shareAmount); } /** * @notice Process user deposit, mints liquid tokens and increase the pool buffer * @return Amount of sAVAX shares generated */ function submit() public payable whenNotPaused returns (uint) { address sender = msg.sender; uint deposit = msg.value; require(deposit != 0, "ZERO_DEPOSIT"); uint shareAmount = getSharesByPooledAvax(deposit); if (shareAmount == 0) { shareAmount = deposit; } _mintShares(sender, shareAmount); totalPooledAvax = totalPooledAvax.add(deposit); emit Transfer(address(0), sender, shareAmount); emit Submitted(sender, deposit, shareAmount); return shareAmount; } receive() external payable { submit(); } /********************************************************************************* * * * INTERNAL FUNCTIONS * * * *********************************************************************************/ /** * @notice Moves `amount` tokens from `sender` to `recipient`. * Emits a `Transfer` event. */ function _transfer(address sender, address recipient, uint amount) internal { _transferShares(sender, recipient, amount); emit Transfer(sender, recipient, amount); } /** * @notice Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. * - the contract must not be paused. */ function _approve(address owner, address spender, uint amount) internal whenNotPaused { require(owner != address(0), "APPROVE_FROM_ZERO_ADDRESS"); require(spender != address(0), "APPROVE_TO_ZERO_ADDRESS"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Moves `shareAmount` shares from `sender` to `recipient`. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must hold at least `shareAmount` shares. * - the contract must not be paused. */ function _transferShares(address sender, address recipient, uint shareAmount) internal whenNotPaused { require(sender != address(0), "TRANSFER_FROM_THE_ZERO_ADDRESS"); require(recipient != address(0), "TRANSFER_TO_THE_ZERO_ADDRESS"); require(sender != recipient, "TRANSFER_TO_SELF"); uint currentSenderShares = shares[sender]; require(shareAmount <= currentSenderShares, "TRANSFER_AMOUNT_EXCEEDS_BALANCE"); require(shareAmount > 0, "TRANSFER_ZERO_VALUE"); if (shares[recipient] == 0) { stakerCount = stakerCount.add(1); } shares[sender] = currentSenderShares.sub(shareAmount); shares[recipient] = shares[recipient].add(shareAmount); if (shares[sender] == 0) { stakerCount = stakerCount.sub(1); } } /** * @notice Creates `shareAmount` shares and assigns them to `recipient`, increasing the total amount of shares. * @dev This doesn't increase the token total supply. * * Requirements: * * - `recipient` cannot be the zero address * - the contract must not be paused * - minting must not be paused * - total pooled AVAX cap must not be exceeded */ function _mintShares(address recipient, uint shareAmount) internal whenNotPaused returns (uint) { require(!mintingPaused, "Minting paused"); require(recipient != address(0), "MINT_TO_THE_ZERO_ADDRESS"); require(shareAmount > 0, "MINT_ZERO_VALUE"); uint avaxAmount = getPooledAvaxByShares(shareAmount); require(totalPooledAvax.add(avaxAmount) <= totalPooledAvaxCap, "TOTAL_POOLED_AVAX_CAP_EXCEEDED"); if (shares[recipient] == 0) { stakerCount = stakerCount.add(1); } totalShares = totalShares.add(shareAmount); shares[recipient] = shares[recipient].add(shareAmount); return totalShares; } /** * @notice Destroys `shareAmount` shares from `account`'s holdings, decreasing the total amount of shares. * @dev This doesn't decrease the token total supply. * * Requirements: * * - `account` cannot be the zero address. * - `account` must hold at least `shareAmount` shares. * - the contract must not be paused. */ function _burnShares(address account, uint shareAmount) internal whenNotPaused returns (uint) { require(account != address(0), "BURN_FROM_THE_ZERO_ADDRESS"); require(shareAmount > 0, "BURN_ZERO_VALUE"); uint accountShares = shares[account]; require(shareAmount <= accountShares, "BURN_AMOUNT_EXCEEDS_BALANCE"); totalShares = totalShares.sub(shareAmount); shares[account] = accountShares.sub(shareAmount); if (shares[account] == 0) { stakerCount = stakerCount.sub(1); } return totalShares; } /** * @notice Checks if the unlock request is within its cooldown period * @param unlockRequest Unlock request */ function _isWithinCooldownPeriod(UnlockRequest memory unlockRequest) internal view returns (bool) { return unlockRequest.startedAt.add(cooldownPeriod) >= block.timestamp; } /** * @notice Checks if the unlock request is within its redemption period * @param unlockRequest Unlock request */ function _isWithinRedemptionPeriod(UnlockRequest memory unlockRequest) internal view returns (bool) { return !_isWithinCooldownPeriod(unlockRequest) && unlockRequest.startedAt.add(cooldownPeriod).add(redeemPeriod) >= block.timestamp; } /** * @notice Checks if the unlock request has expired * @param unlockRequest Unlock request */ function _isExpired(UnlockRequest memory unlockRequest) internal view returns (bool) { return unlockRequest.startedAt.add(cooldownPeriod).add(redeemPeriod) < block.timestamp; } /** * @notice Cancel an unexpired unlock request * @param unlockIndex Index number of the cancelled unlock */ function _cancelUnlockRequest(uint unlockIndex) internal whenNotPaused { require(unlockIndex < userUnlockRequests[msg.sender].length, "Invalid index"); UnlockRequest memory unlockRequest = userUnlockRequests[msg.sender][unlockIndex]; require(!_isExpired(unlockRequest), "Unlock request is expired"); uint shareAmount = unlockRequest.shareAmount; uint unlockRequestedAt = unlockRequest.startedAt; if (unlockIndex != userUnlockRequests[msg.sender].length - 1) { userUnlockRequests[msg.sender][unlockIndex] = userUnlockRequests[msg.sender][userUnlockRequests[msg.sender].length - 1]; } userUnlockRequests[msg.sender].pop(); userSharesInCustody[msg.sender] = userSharesInCustody[msg.sender].sub(shareAmount); _transfer(address(this), msg.sender, shareAmount); emit UnlockCancelled(msg.sender, unlockRequestedAt, shareAmount); } /** * @notice Redeem AVAX after cooldown has finished * @param unlockRequestIndex Index number of the redeemed unlock request */ function _redeem(uint unlockRequestIndex) internal whenNotPaused { require(unlockRequestIndex < userUnlockRequests[msg.sender].length, "Invalid unlock request index"); UnlockRequest memory unlockRequest = userUnlockRequests[msg.sender][unlockRequestIndex]; require(_isWithinRedemptionPeriod(unlockRequest), "Unlock request is not redeemable"); (bool success, uint exchangeRate) = _getExchangeRateByUnlockTimestamp(unlockRequest.startedAt); require(success, "Exchange rate not found"); uint shareAmount = unlockRequest.shareAmount; uint startedAt = unlockRequest.startedAt; uint avaxAmount = exchangeRate.mul(shareAmount).div(1e18); require(avaxAmount >= shareAmount, "Invalid exchange rate"); userSharesInCustody[msg.sender] = userSharesInCustody[msg.sender].sub(shareAmount); _burnShares(address(this), shareAmount); totalPooledAvax = totalPooledAvax.sub(avaxAmount); userUnlockRequests[msg.sender][unlockRequestIndex] = userUnlockRequests[msg.sender][userUnlockRequests[msg.sender].length.sub(1)]; userUnlockRequests[msg.sender].pop(); (success, ) = msg.sender.call{ value: avaxAmount }(""); require(success, "AVAX transfer failed"); emit Redeem(msg.sender, startedAt, shareAmount, avaxAmount); } /** * @notice Get the earliest exchange rate closest to the unlock timestamp * @param unlockTimestamp Unlock request timestamp * @return (success, exchange rate) */ function _getExchangeRateByUnlockTimestamp(uint unlockTimestamp) internal view returns (bool, uint) { if (historicalExchangeRateTimestamps.length == 0) { return (false, 0); } uint low = 0; uint mid; uint high = historicalExchangeRateTimestamps.length - 1; uint unlockClaimableAtTimestamp = unlockTimestamp.add(cooldownPeriod); while (low <= high) { mid = high.add(low).div(2); if (historicalExchangeRateTimestamps[mid] <= unlockClaimableAtTimestamp) { if (mid.add(1) == historicalExchangeRateTimestamps.length || historicalExchangeRateTimestamps[mid.add(1)] > unlockClaimableAtTimestamp) { return (true, historicalExchangeRatesByTimestamp[historicalExchangeRateTimestamps[mid]]); } low = mid.add(1); } else if (mid == 0) { return (true, 1e18); } else { high = mid.sub(1); } } return (false, 0); } /** * @notice Remove exchange rate entries older than `redeemPeriod` */ function _dropExpiredExchangeRateEntries() internal { if (historicalExchangeRateTimestamps.length == 0) { return; } uint shiftCount = 0; uint expirationThreshold = block.timestamp.sub(redeemPeriod).sub(172800); while (shiftCount < historicalExchangeRateTimestamps.length && historicalExchangeRateTimestamps[shiftCount] < expirationThreshold) { shiftCount = shiftCount.add(1); } if (shiftCount == 0) { return; } for (uint i = 0; i < historicalExchangeRateTimestamps.length.sub(shiftCount); i = i.add(1)) { historicalExchangeRateTimestamps[i] = historicalExchangeRateTimestamps[i.add(shiftCount)]; } for (uint i = 1; i <= shiftCount; i = i.add(1)) { historicalExchangeRateTimestamps.pop(); } } /********************************************************************************* * * * ADMIN-ONLY FUNCTIONS * * * *********************************************************************************/ /** * @notice Accrue staking rewards to the pool */ function accrueRewards() external payable nonReentrant { require(hasRole(ROLE_ACCRUE_REWARDS, msg.sender), "ROLE_ACCRUE_REWARDS"); require(msg.value > 0, "ZERO_ACCRUAL"); require( protocolRewardShare == 0 || protocolRewardShareRecipient != address(0), "INVALID_PROTOCOL_REWARDS_SETTINGS" ); uint protocolRewardAmount; uint userRewardAmount = msg.value; if (protocolRewardShare != 0) { protocolRewardAmount = msg.value.mul(protocolRewardShare).div(1e18); userRewardAmount = msg.value.sub(protocolRewardAmount); } totalPooledAvax = totalPooledAvax.add(userRewardAmount); _dropExpiredExchangeRateEntries(); historicalExchangeRatesByTimestamp[block.timestamp] = getPooledAvaxByShares(1e18); historicalExchangeRateTimestamps.push(block.timestamp); if (protocolRewardAmount > 0) { (bool success, ) = protocolRewardShareRecipient.call{ value: protocolRewardAmount}(""); require(success, "AVAX_TRANSFER_FAILED"); } emit AccrueRewards(userRewardAmount, protocolRewardAmount); } /** * @notice Withdraw AVAX from the contract for delegation * @param amount Amount of AVAX to withdraw */ function withdraw(uint amount) external nonReentrant { require(hasRole(ROLE_WITHDRAW, msg.sender), "ROLE_WITHDRAW"); (bool success, ) = msg.sender.call{ value: amount }(""); require(success, "AVAX transfer failed"); emit Withdraw(msg.sender, amount); } /** * @notice Deposit AVAX into the contract without minting sAVAX */ function deposit() external payable { require(hasRole(ROLE_DEPOSIT, msg.sender), "ROLE_DEPOSIT"); require(msg.value > 0, "Zero value"); emit Deposit(msg.sender, msg.value); } /** * @notice Update the cooldown period * @param newCooldownPeriod New cooldown period */ function setCooldownPeriod(uint newCooldownPeriod) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "DEFAULT_ADMIN_ROLE"); uint oldCooldownPeriod = cooldownPeriod; cooldownPeriod = newCooldownPeriod; emit CooldownPeriodUpdated(oldCooldownPeriod, cooldownPeriod); } /** * @notice Update the redeem period * @param newRedeemPeriod New redeem period */ function setRedeemPeriod(uint newRedeemPeriod) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "DEFAULT_ADMIN_ROLE"); uint oldRedeemPeriod = redeemPeriod; redeemPeriod = newRedeemPeriod; emit RedeemPeriodUpdated(oldRedeemPeriod, redeemPeriod); } /** * @notice Set a upper limit for the total pooled AVAX amount * @param newTotalPooledAvaxCap The pool cap */ function setTotalPooledAvaxCap(uint newTotalPooledAvaxCap) external { require(hasRole(ROLE_SET_TOTAL_POOLED_AVAX_CAP, msg.sender), "ROLE_SET_TOTAL_POOLED_AVAX_CAP"); uint oldTotalPooledAvaxCap = totalPooledAvaxCap; totalPooledAvaxCap = newTotalPooledAvaxCap; emit TotalPooledAvaxCapUpdated(oldTotalPooledAvaxCap, newTotalPooledAvaxCap); } /** * @notice Set the address where the protocol reward share is sent to * @param newProtocolRewardShareRecipient Address of the new protocol reward share recipient */ function setProtocolRewardShareRecipient(address payable newProtocolRewardShareRecipient) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "DEFAULT_ADMIN_ROLE"); if (newProtocolRewardShareRecipient == address(0)) { require(protocolRewardShare == 0, "NON_ZERO_PROTOCOL_REWARD_SHARE"); } emit ProtocolRewardShareRecipientUpdated(protocolRewardShareRecipient, newProtocolRewardShareRecipient); protocolRewardShareRecipient = newProtocolRewardShareRecipient; } /** * @notice Set the protocol reward share percentage * @param newProtocolRewardShare New protocol reward share percentage */ function setProtocolRewardShare(uint newProtocolRewardShare) external { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "DEFAULT_ADMIN_ROLE"); require(newProtocolRewardShare <= 1e18, "PROTOCOL_REWARD_SHARE_TOO_LARGE"); if (newProtocolRewardShare != 0) { require(protocolRewardShareRecipient != address(0), "PROTOCOL_REWARD_SHARE_RECIPIENT_NOT_SET"); } emit ProtocolRewardShareUpdated(protocolRewardShare, newProtocolRewardShare); protocolRewardShare = newProtocolRewardShare; } /** * @notice Stop pool routine operations */ function pause() external { require(hasRole(ROLE_PAUSE, msg.sender), "ROLE_PAUSE"); _pause(); } /** * @notice Resume pool routine operations */ function resume() external { require(hasRole(ROLE_RESUME, msg.sender), "ROLE_RESUME"); _unpause(); } /** * @notice Stop minting */ function pauseMinting() external { require(hasRole(ROLE_PAUSE_MINTING, msg.sender), "ROLE_PAUSE_MINTING"); require(!mintingPaused, "Minting is already paused"); mintingPaused = true; emit MintingPaused(msg.sender); } /** * @notice Resume minting */ function resumeMinting() external { require(hasRole(ROLE_RESUME_MINTING, msg.sender), "ROLE_RESUME_MINTING"); require(mintingPaused, "Minting is not paused"); mintingPaused = false; emit MintingResumed(msg.sender); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSetUpgradeable.sol"; import "../utils/AddressUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using AddressUpgradeable for address; struct RoleData { EnumerableSetUpgradeable.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; function __ReentrancyGuard_init() internal initializer { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal initializer { _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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal initializer { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.6.12; contract StakedAvaxStorage { struct UnlockRequest { // The timestamp at which the `shareAmount` was requested to be unlocked uint startedAt; // The amount of shares to burn uint shareAmount; } bytes32 public constant ROLE_WITHDRAW = keccak256("ROLE_WITHDRAW"); bytes32 public constant ROLE_PAUSE = keccak256("ROLE_PAUSE"); bytes32 public constant ROLE_RESUME = keccak256("ROLE_RESUME"); bytes32 public constant ROLE_ACCRUE_REWARDS = keccak256("ROLE_ACCRUE_REWARDS"); bytes32 public constant ROLE_DEPOSIT = keccak256("ROLE_DEPOSIT"); bytes32 public constant ROLE_PAUSE_MINTING = keccak256("ROLE_PAUSE_MINTING"); bytes32 public constant ROLE_RESUME_MINTING = keccak256("ROLE_RESUME_MINTING"); bytes32 public constant ROLE_SET_TOTAL_POOLED_AVAX_CAP = keccak256("ROLE_SET_TOTAL_POOLED_AVAX_CAP"); // The total amount of AVAX controlled by the contract uint public totalPooledAvax; // The total number of sAVAX shares uint public totalShares; /** * @dev sAVAX balances are dynamic and are calculated based on the accounts' shares * and the total amount of AVAX controlled by the protocol. Account shares aren't * normalized, so the contract also stores the sum of all shares to calculate * each account's token balance which equals to: * * shares[account] * totalPooledAvax / totalShares */ mapping(address => uint256) internal shares; // Allowances are nominated in tokens, not token shares. mapping(address => mapping(address => uint256)) internal allowances; // The time that has to elapse before all sAVAX can be converted into AVAX uint public cooldownPeriod; // The time window within which the unlocked AVAX has to be redeemed after the cooldown uint public redeemPeriod; // User-specific details of requested AVAX unlocks mapping(address => UnlockRequest[]) public userUnlockRequests; // Amount of users' sAVAX custodied by the contract mapping(address => uint) public userSharesInCustody; // Exchange rate by timestamp. Updated on delegation reward accrual. mapping(uint => uint) public historicalExchangeRatesByTimestamp; // An ordered list of `historicalExchangeRates` keys uint[] public historicalExchangeRateTimestamps; // Set if minting has been paused bool public mintingPaused; // The maximum amount of AVAX that can be held by the protocol uint public totalPooledAvaxCap; // Number of wallets which have sAVAX uint public stakerCount; // The percentage of accrued rewards that are paid to the protocol. 0-1e18 for 0-100 %. uint public protocolRewardShare; // Recipient address of the protocol rewards address payable public protocolRewardShareRecipient; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /* * @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 GSN 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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "istanbul", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"userRewardAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolRewardAmount","type":"uint256"}],"name":"AccrueRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldCooldownPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCooldownPeriod","type":"uint256"}],"name":"CooldownPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"MintingPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"MintingResumed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldProtocolRewardShareRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"newProtocolRewardShareRecipient","type":"address"}],"name":"ProtocolRewardShareRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldProtocolRewardShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newProtocolRewardShare","type":"uint256"}],"name":"ProtocolRewardShareUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"unlockRequestedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"avaxAmount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"RedeemOverdueShares","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldRedeemPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRedeemPeriod","type":"uint256"}],"name":"RedeemPeriodUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"avaxAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"Submitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldTotalPooldAvaxCap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalPooledAvaxCap","type":"uint256"}],"name":"TotalPooledAvaxCapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"unlockRequestedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"UnlockCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"UnlockRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_ACCRUE_REWARDS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_DEPOSIT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_PAUSE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_PAUSE_MINTING","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_RESUME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_RESUME_MINTING","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_SET_TOTAL_POOLED_AVAX_CAP","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROLE_WITHDRAW","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accrueRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelPendingUnlockRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelRedeemableUnlockRequests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"unlockIndex","type":"uint256"}],"name":"cancelUnlockRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cooldownPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getPaginatedUnlockRequests","outputs":[{"components":[{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"shareAmount","type":"uint256"}],"internalType":"struct StakedAvaxStorage.UnlockRequest[]","name":"","type":"tuple[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"getPooledAvaxByShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"avaxAmount","type":"uint256"}],"name":"getSharesByPooledAvax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUnlockRequestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"historicalExchangeRateTimestamps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"historicalExchangeRatesByTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cooldownPeriod","type":"uint256"},{"internalType":"uint256","name":"_redeemPeriod","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolRewardShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolRewardShareRecipient","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"unlockIndex","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemOverdueShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"unlockIndex","type":"uint256"}],"name":"redeemOverdueShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shareAmount","type":"uint256"}],"name":"requestUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resume","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resumeMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newCooldownPeriod","type":"uint256"}],"name":"setCooldownPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProtocolRewardShare","type":"uint256"}],"name":"setProtocolRewardShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newProtocolRewardShareRecipient","type":"address"}],"name":"setProtocolRewardShareRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRedeemPeriod","type":"uint256"}],"name":"setRedeemPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTotalPooledAvaxCap","type":"uint256"}],"name":"setTotalPooledAvaxCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"submit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalPooledAvax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPooledAvaxCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userSharesInCustody","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userUnlockRequests","outputs":[{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"shareAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b50600054610100900460ff16806200002e57506200002e620000ab565b806200003d575060005460ff16155b620000655760405162461bcd60e51b81526004016200005c90620000cf565b60405180910390fd5b600054610100900460ff1615801562000091576000805460ff1961ff0019909116610100171660011790555b8015620000a4576000805461ff00191690555b506200011d565b6000620000c330620000c960201b620025771760201c565b15905090565b3b151590565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b61461f806200012d6000396000f3fe6080604052600436106103d25760003560e01c8063629e8056116101fd578063c423f9a811610118578063dd62ed3e116100ab578063f0d82e841161007a578063f0d82e8414610a16578063f1ee8d9214610a36578063f2ab8cd214610a56578063fbb6353814610a84578063fd012e3414610aa4576103e2565b8063dd62ed3e146109ac578063dff69787146109cc578063e1a283d6146109e1578063e4a30116146109f6576103e2565b8063d1f1ca04116100e7578063d1f1ca0414610942578063d547741f14610957578063da8fbf2a14610977578063db006a751461098c576103e2565b8063c423f9a8146108da578063c9d2ff9d146108fa578063ca15c8731461091a578063d0e30db01461093a576103e2565b806395d89b4111610190578063ada03b381161015f578063ada03b381461087b578063be040fb01461089b578063c1db6588146108b0578063c2d78654146108c5576103e2565b806395d89b411461081c578063a217fddf14610831578063a9059cbb14610846578063a905ff9314610866576103e2565b80638456cb59116101cc5780638456cb59146107a55780638f3032c2146107ba5780639010d07c146107dc57806391d14854146107fc576103e2565b8063629e80561461073b5780636e34637c1461075057806370a082311461076557806380ea3de114610785576103e2565b80632e1a7d4d116102ed5780634a36d6c1116102805780635bcb2fc61161024f5780635bcb2fc6146106e95780635c975abb146106f15780635cd47487146107065780635d0395251461071b576103e2565b80634a36d6c11461068a5780634b7e23dc146106aa5780634ff0241a146106bf57806359ae340e146106d4576103e2565b80633a98ef39116102bc5780633a98ef39146106365780633fc777b31461064b57806340a233a6146106605780634757c0d214610675576103e2565b80632e1a7d4d146105b45780632f2ff15d146105d4578063313ce567146105f457806336568abe14610616576103e2565b80631610247b116103655780631b2b3a2f116103345780631b2b3a2f1461053457806323b872dd14610554578063248a9ca314610574578063298e0d3b14610594576103e2565b80631610247b146104e257806318160ddd146105025780631ab8ab25146105175780631afdbce41461052c576103e2565b8063095ea7b3116103a1578063095ea7b3146104605780630a732ce61461048d5780630d10d32c146104ad5780630f7e2048146104c2576103e2565b806301550f64146103e757806304646a49146103fe578063046f7da21461042957806306fdde031461043e576103e2565b366103e2576103df610ad2565b50005b600080fd5b3480156103f357600080fd5b506103fc610be1565b005b34801561040a57600080fd5b50610413610ca1565b6040516104209190613901565b60405180910390f35b34801561043557600080fd5b506103fc610ca7565b34801561044a57600080fd5b50610453610cf7565b6040516104209190613918565b34801561046c57600080fd5b5061048061047b36600461376e565b610d1c565b60405161042091906138f6565b34801561049957600080fd5b506104136104a83660046137cd565b610d33565b3480156104b957600080fd5b506103fc610d45565b3480156104ce57600080fd5b506103fc6104dd3660046137cd565b610f8f565b3480156104ee57600080fd5b506103fc6104fd3660046137cd565b6111a5565b34801561050e57600080fd5b506104136111d6565b34801561052357600080fd5b506104136111dc565b6103fc611200565b34801561054057600080fd5b5061041361054f3660046137cd565b61143e565b34801561056057600080fd5b5061048061056f36600461372e565b61145c565b34801561058057600080fd5b5061041361058f3660046137cd565b6114ca565b3480156105a057600080fd5b506103fc6105af3660046136da565b6114e2565b3480156105c057600080fd5b506103fc6105cf3660046137cd565b6115a0565b3480156105e057600080fd5b506103fc6105ef3660046137e5565b6116d4565b34801561060057600080fd5b5061060961171c565b60405161042091906145c3565b34801561062257600080fd5b506103fc6106313660046137e5565b611721565b34801561064257600080fd5b50610413611763565b34801561065757600080fd5b50610413611769565b34801561066c57600080fd5b5061041361178d565b34801561068157600080fd5b50610413611793565b34801561069657600080fd5b506104136106a53660046137cd565b6117b7565b3480156106b657600080fd5b506104136117e7565b3480156106cb57600080fd5b5061041361180b565b3480156106e057600080fd5b506103fc61182f565b610413610ad2565b3480156106fd57600080fd5b506104806118db565b34801561071257600080fd5b506104136118e4565b34801561072757600080fd5b506104136107363660046136da565b6118ea565b34801561074757600080fd5b506104136118fc565b34801561075c57600080fd5b50610413611902565b34801561077157600080fd5b506104136107803660046136da565b611908565b34801561079157600080fd5b506103fc6107a03660046137cd565b611923565b3480156107b157600080fd5b506103fc611990565b3480156107c657600080fd5b506107cf6119de565b6040516104209190613835565b3480156107e857600080fd5b506107cf6107f7366004613809565b6119ed565b34801561080857600080fd5b506104806108173660046137e5565b611a0c565b34801561082857600080fd5b50610453611a24565b34801561083d57600080fd5b50610413611a43565b34801561085257600080fd5b5061048061086136600461376e565b611a48565b34801561087257600080fd5b50610413611a55565b34801561088757600080fd5b506103fc6108963660046137cd565b611a79565b3480156108a757600080fd5b506103fc611af9565b3480156108bc57600080fd5b50610413611bc7565b3480156108d157600080fd5b50610413611beb565b3480156108e657600080fd5b506104136108f53660046136da565b611c0f565b34801561090657600080fd5b506103fc6109153660046137cd565b611c2a565b34801561092657600080fd5b506104136109353660046137cd565b611d80565b6103fc611d97565b34801561094e57600080fd5b506103fc611e40565b34801561096357600080fd5b506103fc6109723660046137e5565b611ec6565b34801561098357600080fd5b506103fc611f00565b34801561099857600080fd5b506103fc6109a73660046137cd565b611fa6565b3480156109b857600080fd5b506104136109c73660046136f6565b611fd7565b3480156109d857600080fd5b50610413612002565b3480156109ed57600080fd5b50610480612008565b348015610a0257600080fd5b506103fc610a11366004613809565b612011565b348015610a2257600080fd5b506103fc610a313660046137cd565b612163565b348015610a4257600080fd5b50610413610a513660046137cd565b6121c4565b348015610a6257600080fd5b50610a76610a71366004613799565b612218565b604051610420929190613863565b348015610a9057600080fd5b506103fc610a9f3660046137cd565b612481565b348015610ab057600080fd5b50610ac4610abf36600461376e565b61253e565b60405161042092919061390a565b6000610adc6118db565b15610b025760405162461bcd60e51b8152600401610af990613e71565b60405180910390fd5b333480610b215760405162461bcd60e51b8152600401610af990614094565b6000610b2c826121c4565b905080610b365750805b610b40838261257d565b5060c954610b4e90836126d6565b60c9556040516001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b8f908590613901565b60405180910390a3826001600160a01b03167fbb0070894135d02edfa550b04d7e5e141aa8090b46e57597ad45bfedd65544988383604051610bd292919061390a565b60405180910390a29250505090565b60026065541415610c045760405162461bcd60e51b8152600401610af99061446e565b600260655560005b33600090815260cf6020526040902054811015610c995733600090815260cf602052604090208054610c75919083908110610c4357fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250506126fb565b610c8b57610c848160016126d6565b9050610c0c565b610c9481612716565b610c0c565b506001606555565b60cd5481565b610cd17f042c6cf123ef505aa22225497dce2119e438d03e616dea9958b9e78a7d2c9bfd33611a0c565b610ced5760405162461bcd60e51b8152600401610af990613994565b610cf561293c565b565b60408051808201909152600b81526a0a6e8c2d6cac84082ac82b60ab1b602082015290565b6000610d293384846129a0565b5060015b92915050565b60d16020526000908152604090205481565b60026065541415610d685760405162461bcd60e51b8152600401610af99061446e565b6002606555610d756118db565b15610d925760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf6020526040812054815b81811015610f0457610db46136c0565b33600090815260cf60205260409020805483908110610dcf57fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050610e0781612a79565b610e1e57610e168260016126d6565b915050610da4565b6020810151610e2e9085906126d6565b33600090815260cf60205260409020805491955090610e4e906001612aa0565b81548110610e5857fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b031681526020019081526020016000208381548110610e9657fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf90915260409020805480610ece57fe5b6000828152602081206002600019909301928302018181556001908101919091559155610efc908490612aa0565b925050610da4565b8215610f855733600090815260d06020526040902054610f249084612aa0565b33600081815260d06020526040902091909155610f4390309085612ac8565b336001600160a01b03167feaca243f6502ade1b9ea0909306c290366d6ea6778ca407ca4415c4a0f45e35384604051610f7c9190613901565b60405180910390a25b5050600160655550565b60026065541415610fb25760405162461bcd60e51b8152600401610af99061446e565b6002606555610fbf6118db565b15610fdc5760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf6020526040902054811061100a5760405162461bcd60e51b8152600401610af9906140ba565b6110126136c0565b33600090815260cf6020526040902080548390811061102d57fe5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050905061106581612a79565b6110815760405162461bcd60e51b8152600401610af9906144a5565b60208082015133600090815260d09092526040909120546110a29082612aa0565b33600090815260d0602090815260408083209390935560cf905220805460001981019081106110cd57fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020848154811061110b57fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf9091526040902080548061114357fe5b60008281526020812060026000199093019283020181815560010155905561116c303383612ac8565b336001600160a01b03167feaca243f6502ade1b9ea0909306c290366d6ea6778ca407ca4415c4a0f45e35382604051610f7c9190613901565b600260655414156111c85760405162461bcd60e51b8152600401610af99061446e565b6002606555610c9981612716565b60ca5490565b7fcdf8b82f637f9a4be48302312e5512748fdc83ce33bdd13a07588c9a48f40d0881565b600260655414156112235760405162461bcd60e51b8152600401610af99061446e565b60026065556112527f47b922604560255f6e7d9ac32bd55d2b112af12fac29e9cbbcef77fe82ffbd9333611a0c565b61126e5760405162461bcd60e51b8152600401610af990613d51565b6000341161128e5760405162461bcd60e51b8152600401610af990613fcc565b60d65415806112a7575060d7546001600160a01b031615155b6112c35760405162461bcd60e51b8152600401610af9906141ce565b60d654600090349015611306576112f7670de0b6b3a76400006112f160d65434612b1690919063ffffffff16565b90612b50565b91506113033483612aa0565b90505b60c95461131390826126d6565b60c95561131e612b82565b61132f670de0b6b3a76400006117b7565b42600081815260d1602052604081209290925560d2805460018101825592527ff2192e1030363415d7b4fb0406540a0060e8e2fc8982f3f32289379e11fa65469091015581156113fc5760d7546040516000916001600160a01b031690849061139790613832565b60006040518083038185875af1925050503d80600081146113d4576040519150601f19603f3d011682016040523d82523d6000602084013e6113d9565b606091505b50509050806113fa5760405162461bcd60e51b8152600401610af990613b5e565b505b7f915149a1670a81177a53d6f73ee6f911abec9e8d13d0ca02a93a28fcc0d54458818360405161142d92919061390a565b60405180910390a150506001606555565b60d2818154811061144b57fe5b600091825260209091200154905081565b6001600160a01b038316600090815260cc60209081526040808320338452909152812054828110156114a05760405162461bcd60e51b8152600401610af9906139fb565b6114ab858585612ac8565b6114bf85336114ba8487612aa0565b6129a0565b506001949350505050565b6000818152603360205260409020600201545b919050565b6114ed600033611a0c565b6115095760405162461bcd60e51b8152600401610af990613bc3565b6001600160a01b0381166115375760d654156115375760405162461bcd60e51b8152600401610af99061420f565b60d7546040517fec82cc68c33f2e4344f1dc23eef251666e1f15e90a4b1bd1edc2a7544eff9a1a91611576916001600160a01b03909116908490613849565b60405180910390a160d780546001600160a01b0319166001600160a01b0392909216919091179055565b600260655414156115c35760405162461bcd60e51b8152600401610af99061446e565b60026065556115f27f0f9dd4db10c87ffcc337f44200a5df16e545591d09c12f63c158b3d592fcf18833611a0c565b61160e5760405162461bcd60e51b8152600401610af990613b00565b6000336001600160a01b03168260405161162790613832565b60006040518083038185875af1925050503d8060008114611664576040519150601f19603f3d011682016040523d82523d6000602084013e611669565b606091505b505090508061168a5760405162461bcd60e51b8152600401610af9906141a0565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516116c39190613901565b60405180910390a250506001606555565b6000828152603360205260409020600201546116f290610817612caa565b61170e5760405162461bcd60e51b8152600401610af990613a3c565b6117188282612cae565b5050565b601290565b611729612caa565b6001600160a01b0316816001600160a01b0316146117595760405162461bcd60e51b8152600401610af990614500565b6117188282612d17565b60ca5481565b7feaf074586bf6c7ac16d3c4db5c992c7f0721b20b018b99a7d1fe8187f59d9c8681565b60ce5481565b7f7507d5b6f482d6f276fc3788841416ce1f32150a93658622625d5b91ccda3d7881565b600060ca54600014156117cc575060006114dd565b610d2d60ca546112f160c95485612b1690919063ffffffff16565b7f0f9dd4db10c87ffcc337f44200a5df16e545591d09c12f63c158b3d592fcf18881565b7ff146182d150a5b368b6d283f87aeae1f25c21b02ff55cf16848704ade176a5cb81565b6118597fcdf8b82f637f9a4be48302312e5512748fdc83ce33bdd13a07588c9a48f40d0833611a0c565b6118755760405162461bcd60e51b8152600401610af990614246565b60d35460ff166118975760405162461bcd60e51b8152600401610af99061457e565b60d3805460ff191690556040517f8a53acd29b3c02ba82b89c57b23196b792ccb00a28515221f71bd92eafbc2dc3906118d1903390613835565b60405180910390a1565b60975460ff1690565b60d45481565b60d06020526000908152604090205481565b60c95481565b60d65481565b6001600160a01b0316600090815260cb602052604090205490565b61192e600033611a0c565b61194a5760405162461bcd60e51b8152600401610af990613bc3565b60cd8054908290556040517f98eaabfe135a9c40c420208962bf81e7926b4d6df3e23502164c0554b7b3522490611984908390859061390a565b60405180910390a15050565b6119ba7ff146182d150a5b368b6d283f87aeae1f25c21b02ff55cf16848704ade176a5cb33611a0c565b6119d65760405162461bcd60e51b8152600401610af9906144dc565b610cf5612d80565b60d7546001600160a01b031681565b6000828152603360205260408120611a059083612ddb565b9392505050565b6000828152603360205260408120611a059083612de7565b6040805180820190915260058152640e682ac82b60db1b602082015290565b600081565b6000610d29338484612ac8565b7f47b922604560255f6e7d9ac32bd55d2b112af12fac29e9cbbcef77fe82ffbd9381565b611aa37f7507d5b6f482d6f276fc3788841416ce1f32150a93658622625d5b91ccda3d7833611a0c565b611abf5760405162461bcd60e51b8152600401610af990613e9b565b60d48054908290556040517fc016457d0a92973d26bab98d68d6f20133e355c467d05e5206c88c25d3b739d090611984908390859061390a565b60026065541415611b1c5760405162461bcd60e51b8152600401610af99061446e565b600260655533600090815260cf6020526040812054905b81811015611bbe5733600090815260cf602052604090208054611b8d919083908110611b5b57fe5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050612dfc565b611ba357611b9c8160016126d6565b9050611b33565b611bac81612e2f565b611bb7826001612aa0565b9150611b33565b50506001606555565b7f042c6cf123ef505aa22225497dce2119e438d03e616dea9958b9e78a7d2c9bfd81565b7fa9905b3f34c6e7b8ac62a407ded9f3069ef096a2e251318e09aff6898263df1981565b6001600160a01b0316600090815260cf602052604090205490565b60026065541415611c4d5760405162461bcd60e51b8152600401610af99061446e565b6002606555611c5a6118db565b15611c775760405162461bcd60e51b8152600401610af990613e71565b60008111611c975760405162461bcd60e51b8152600401610af99061437c565b33600090815260cb6020526040902054811115611cc65760405162461bcd60e51b8152600401610af990614273565b33600090815260d06020526040902054611ce090826126d6565b33600081815260d06020526040902091909155611cfe903083612ac8565b33600081815260cf602090815260408083208151808301835242815280840187815282546001818101855593875294909520905160029094020192835592519190920155517fd843ce9ef55b27026be6c5e44e9f58097e0ebfa0d9d2d5823cb8ffa77958517090611d70908490613901565b60405180910390a2506001606555565b6000818152603360205260408120610d2d9061312d565b611dc17fa9905b3f34c6e7b8ac62a407ded9f3069ef096a2e251318e09aff6898263df1933611a0c565b611ddd5760405162461bcd60e51b8152600401610af99061411f565b60003411611dfd5760405162461bcd60e51b8152600401610af990614145565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051611e369190613901565b60405180910390a2565b60026065541415611e635760405162461bcd60e51b8152600401610af99061446e565b600260655560005b33600090815260cf6020526040902054811015610c995733600090815260cf602052604090208054611ea2919083908110611b5b57fe5b611eb857611eb18160016126d6565b9050611e6b565b611ec181612716565b611e6b565b600082815260336020526040902060020154611ee490610817612caa565b6117595760405162461bcd60e51b8152600401610af990613dec565b611f2a7feaf074586bf6c7ac16d3c4db5c992c7f0721b20b018b99a7d1fe8187f59d9c8633611a0c565b611f465760405162461bcd60e51b8152600401610af990614442565b60d35460ff1615611f695760405162461bcd60e51b8152600401610af9906142aa565b60d3805460ff191660011790556040517f35365f539a67058ad0735a24a50fe45b0ee05207919e9f4a2f60d855f55e0c0e906118d1903390613835565b60026065541415611fc95760405162461bcd60e51b8152600401610af99061446e565b6002606555610c9981612e2f565b6001600160a01b03918216600090815260cc6020908152604080832093909416825291909152205490565b60d55481565b60d35460ff1681565b600054610100900460ff168061202a575061202a613138565b80612038575060005460ff16155b6120545760405162461bcd60e51b8152600401610af990613ed2565b600054610100900460ff1615801561207f576000805460ff1961ff0019909116610100171660011790555b61208a60003361170e565b60cd8390556040517f98eaabfe135a9c40c420208962bf81e7926b4d6df3e23502164c0554b7b35224906120c290600090869061390a565b60405180910390a160ce8290556040517f13cca15637be33d4651625caf09528168b20c132463c69ab5c0ff48b3e6391179061210290600090859061390a565b60405180910390a160001960d48190556040517fc016457d0a92973d26bab98d68d6f20133e355c467d05e5206c88c25d3b739d091612144916000919061390a565b60405180910390a1801561215e576000805461ff00191690555b505050565b61216e600033611a0c565b61218a5760405162461bcd60e51b8152600401610af990613bc3565b60ce8054908290556040517f13cca15637be33d4651625caf09528168b20c132463c69ab5c0ff48b3e63911790611984908390859061390a565b600060c954600014156121d9575060006114dd565b60006121f660c9546112f160ca5486612b1690919063ffffffff16565b905060008111610d2d5760405162461bcd60e51b8152600401610af99061434f565b6001600160a01b038316600090815260cf6020526040902054606090819084106122545760405162461bcd60e51b8152600401610af990613c4e565b8284106122735760405162461bcd60e51b8152600401610af990613f20565b6001600160a01b038516600090815260cf60205260409020548311156122af576001600160a01b038516600090815260cf602052604090205492505b60606122bb8486612aa0565b67ffffffffffffffff811180156122d157600080fd5b5060405190808252806020026020018201604052801561230b57816020015b6122f86136c0565b8152602001906001900390816122f05790505b509050606061231a8587612aa0565b67ffffffffffffffff8111801561233057600080fd5b5060405190808252806020026020018201604052801561235a578160200160208202803683370190505b50905060005b61236a8688612aa0565b811015612474576001600160a01b038816600090815260cf6020526040902061239388836126d6565b8154811061239d57fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508382815181106123d657fe5b60200260200101819052506123fd8382815181106123f057fe5b6020026020010151612dfc565b156124625760008061242585848151811061241457fe5b602002602001015160000151613149565b91509150816124465760405162461bcd60e51b8152600401610af9906140e8565b8084848151811061245357fe5b60200260200101818152505050505b61246d8160016126d6565b9050612360565b5090969095509350505050565b61248c600033611a0c565b6124a85760405162461bcd60e51b8152600401610af990613bc3565b670de0b6b3a76400008111156124d05760405162461bcd60e51b8152600401610af990613b27565b80156124fe5760d7546001600160a01b03166124fe5760405162461bcd60e51b8152600401610af990613ab9565b7fd64413eea98d7572b05d6a3596cd38358dc16b901dc7a62e3ddb2e9546cacd6760d6548260405161253192919061390a565b60405180910390a160d655565b60cf602052816000526040600020818154811061255757fe5b600091825260209091206002909102018054600190910154909250905082565b3b151590565b60006125876118db565b156125a45760405162461bcd60e51b8152600401610af990613e71565b60d35460ff16156125c75760405162461bcd60e51b8152600401610af990613bef565b6001600160a01b0383166125ed5760405162461bcd60e51b8152600401610af9906143ab565b6000821161260d5760405162461bcd60e51b8152600401610af99061396b565b6000612618836117b7565b905060d4546126328260c9546126d690919063ffffffff16565b11156126505760405162461bcd60e51b8152600401610af990613d1a565b6001600160a01b038416600090815260cb602052604090205461267f5760d55461267b9060016126d6565b60d5555b60ca5461268c90846126d6565b60ca556001600160a01b038416600090815260cb60205260409020546126b290846126d6565b6001600160a01b038516600090815260cb6020526040902055505060ca5492915050565b600082820183811015611a055760405162461bcd60e51b8152600401610af990613cbc565b60cd548151600091429161270e916126d6565b101592915050565b61271e6118db565b1561273b5760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf602052604090205481106127695760405162461bcd60e51b8152600401610af990613cf3565b6127716136c0565b33600090815260cf6020526040902080548390811061278c57fe5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090506127c481612a79565b156127e15760405162461bcd60e51b8152600401610af9906143e2565b602080820151825133600090815260cf9093526040909220549091906000190184146128835733600090815260cf602052604090208054600019810190811061282657fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020858154811061286457fe5b6000918252602090912082546002909202019081556001918201549101555b33600090815260cf6020526040902080548061289b57fe5b600082815260208082206002600019909401938402018281556001018290559190925533825260d0905260409020546128d49083612aa0565b33600081815260d060205260409020919091556128f390309084612ac8565b336001600160a01b03167f7e4a9502fd577f76f1dc8c9c8f63196816f7c1bd73c6db99f888e8d7bb2f8998828460405161292e92919061390a565b60405180910390a250505050565b6129446118db565b6129605760405162461bcd60e51b8152600401610af990613a8b565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612993612caa565b6040516118d19190613835565b6129a86118db565b156129c55760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166129eb5760405162461bcd60e51b8152600401610af990614318565b6001600160a01b038216612a115760405162461bcd60e51b8152600401610af990613c85565b6001600160a01b03808416600081815260cc602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590612a6c908590613901565b60405180910390a3505050565b60ce5460cd5482516000924292612a9992612a93916126d6565b906126d6565b1092915050565b600082821115612ac25760405162461bcd60e51b8152600401610af990613d7e565b50900390565b612ad3838383613284565b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612a6c9190613901565b600082612b2557506000610d2d565b82820282848281612b3257fe5b0414611a055760405162461bcd60e51b8152600401610af990614029565b6000808211612b715760405162461bcd60e51b8152600401610af990613db5565b818381612b7a57fe5b049392505050565b60d254612b8e57610cf5565b600080612bb36202a300612bad60ce5442612aa090919063ffffffff16565b90612aa0565b90505b60d25482108015612bdd57508060d28381548110612bd057fe5b9060005260206000200154105b15612bf457612bed8260016126d6565b9150612bb6565b81612c00575050610cf5565b60005b60d254612c109084612aa0565b811015612c635760d2612c2382856126d6565b81548110612c2d57fe5b906000526020600020015460d28281548110612c4557fe5b600091825260209091200155612c5c8160016126d6565b9050612c03565b5060015b82811161215e5760d2805480612c7957fe5b60019003818190600052602060002001600090559055612ca36001826126d690919063ffffffff16565b9050612c67565b3390565b6000828152603360205260409020612cc69082613429565b1561171857612cd3612caa565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152603360205260409020612d2f908261343e565b1561171857612d3c612caa565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b612d886118db565b15612da55760405162461bcd60e51b8152600401610af990613e71565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612993612caa565b6000611a058383613453565b6000611a05836001600160a01b038416613498565b6000612e07826126fb565b158015610d2d57504261270e60ce54612a9360cd5486600001516126d690919063ffffffff16565b612e376118db565b15612e545760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf60205260409020548110612e825760405162461bcd60e51b8152600401610af9906142e1565b612e8a6136c0565b33600090815260cf60205260409020805483908110612ea557fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050612edd81612dfc565b612ef95760405162461bcd60e51b8152600401610af990613e3c565b600080612f098360000151613149565b9150915081612f2a5760405162461bcd60e51b8152600401610af9906140e8565b602083015183516000612f49670de0b6b3a76400006112f18686612b16565b905082811015612f6b5760405162461bcd60e51b8152600401610af99061454f565b33600090815260d06020526040902054612f859084612aa0565b33600090815260d06020526040902055612f9f30846134b0565b5060c954612fad9082612aa0565b60c95533600090815260cf602052604090208054612fcc906001612aa0565b81548110612fd657fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020888154811061301457fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf9091526040902080548061304c57fe5b6000828152602081206002600019909301928302018181556001015590556040513390829061307a90613832565b60006040518083038185875af1925050503d80600081146130b7576040519150601f19603f3d011682016040523d82523d6000602084013e6130bc565b606091505b505080955050846130df5760405162461bcd60e51b8152600401610af9906141a0565b336001600160a01b03167fbd5034ffbd47e4e72a94baa2cdb74c6fad73cb3bcdc13036b72ec8306f5a764683858460405161311c939291906145ad565b60405180910390a250505050505050565b6000610d2d826135ac565b600061314330612577565b15905090565b60d25460009081906131605750600090508061327f565b60d25460cd54600091829160001990910190829061317f9088906126d6565b90505b8184116132735761319860026112f184876126d6565b92508060d284815481106131a857fe5b9060005260206000200154116132435760d2546131c68460016126d6565b14806131f257508060d26131db8560016126d6565b815481106131e557fe5b9060005260206000200154115b1561323157600160d1600060d2868154811061320a57fe5b9060005260206000200154815260200190815260200160002054955095505050505061327f565b61323c8360016126d6565b935061326e565b82613260576001670de0b6b3a7640000955095505050505061327f565b61326b836001612aa0565b91505b613182565b60008095509550505050505b915091565b61328c6118db565b156132a95760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166132cf5760405162461bcd60e51b8152600401610af990613b8c565b6001600160a01b0382166132f55760405162461bcd60e51b8152600401610af990613f95565b816001600160a01b0316836001600160a01b031614156133275760405162461bcd60e51b8152600401610af99061406a565b6001600160a01b038316600090815260cb6020526040902054808211156133605760405162461bcd60e51b8152600401610af990614169565b600082116133805760405162461bcd60e51b8152600401610af990613f68565b6001600160a01b038316600090815260cb60205260409020546133af5760d5546133ab9060016126d6565b60d5555b6133b98183612aa0565b6001600160a01b03808616600090815260cb602052604080822093909355908516815220546133e890836126d6565b6001600160a01b03808516600090815260cb602052604080822093909355908616815220546134235760d55461341f906001612aa0565b60d5555b50505050565b6000611a05836001600160a01b0384166135b0565b6000611a05836001600160a01b0384166135fa565b815460009082106134765760405162461bcd60e51b8152600401610af9906139b9565b82600001828154811061348557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006134ba6118db565b156134d75760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166134fd5760405162461bcd60e51b8152600401610af990613c17565b6000821161351d5760405162461bcd60e51b8152600401610af990614419565b6001600160a01b038316600090815260cb6020526040902054808311156135565760405162461bcd60e51b8152600401610af990613ff2565b60ca546135639084612aa0565b60ca556135708184612aa0565b6001600160a01b038516600090815260cb602052604090208190556135a15760d55461359d906001612aa0565b60d5555b505060ca5492915050565b5490565b60006135bc8383613498565b6135f257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d2d565b506000610d2d565b600081815260018301602052604081205480156136b6578354600019808301919081019060009087908390811061362d57fe5b906000526020600020015490508087600001848154811061364a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061367a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610d2d565b6000915050610d2d565b604051806040016040528060008152602001600081525090565b6000602082840312156136eb578081fd5b8135611a05816145d1565b60008060408385031215613708578081fd5b8235613713816145d1565b91506020830135613723816145d1565b809150509250929050565b600080600060608486031215613742578081fd5b833561374d816145d1565b9250602084013561375d816145d1565b929592945050506040919091013590565b60008060408385031215613780578182fd5b823561378b816145d1565b946020939093013593505050565b6000806000606084860312156137ad578283fd5b83356137b8816145d1565b95602085013595506040909401359392505050565b6000602082840312156137de578081fd5b5035919050565b600080604083850312156137f7578182fd5b823591506020830135613723816145d1565b6000806040838503121561381b578182fd5b50508035926020909101359150565b815260200190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60408082528351828201819052600091906020906060850190828801855b828110156138a657815180518552850151858501529285019290840190600101613881565b5050508481038286015280925085516138bf8183613901565b93508287019150845b818110156138e9576138db85845161382a565b9450918301916001016138c8565b5092979650505050505050565b901515815260200190565b90815260200190565b918252602082015260400190565b6000602080835283518082850152825b8181101561394457858101830151858201604001528201613928565b818111156139555783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e4d494e545f5a45524f5f56414c554560881b604082015260600190565b6020808252600b908201526a524f4c455f524553554d4560a81b604082015260600190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b60208082526021908201527f5452414e534645525f414d4f554e545f455843454544535f414c4c4f57414e436040820152604560f81b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526027908201527f50524f544f434f4c5f5245574152445f53484152455f524543495049454e545f6040820152661393d517d4d15560ca1b606082015260800190565b6020808252600d908201526c524f4c455f574954484452415760981b604082015260600190565b6020808252601f908201527f50524f544f434f4c5f5245574152445f53484152455f544f4f5f4c4152474500604082015260600190565b6020808252601490820152731055905617d514905394d1915497d1905253115160621b604082015260600190565b6020808252601e908201527f5452414e534645525f46524f4d5f5448455f5a45524f5f414444524553530000604082015260600190565b60208082526012908201527144454641554c545f41444d494e5f524f4c4560701b604082015260600190565b6020808252600e908201526d135a5b9d1a5b99c81c185d5cd95960921b604082015260600190565b6020808252601a908201527f4255524e5f46524f4d5f5448455f5a45524f5f41444452455353000000000000604082015260600190565b60208082526018908201527f46726f6d20696e646578206f7574206f6620626f756e64730000000000000000604082015260600190565b60208082526017908201527f415050524f56455f544f5f5a45524f5f41444452455353000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600d908201526c092dcecc2d8d2c840d2dcc8caf609b1b604082015260600190565b6020808252601e908201527f544f54414c5f504f4f4c45445f415641585f4341505f45584345454445440000604082015260600190565b602080825260139082015272524f4c455f4143435255455f5245574152445360681b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b6020808252818101527f556e6c6f636b2072657175657374206973206e6f742072656465656d61626c65604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601e908201527f524f4c455f5345545f544f54414c5f504f4f4c45445f415641585f4341500000604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526028908201527f546f20696e646578206d7573742062652067726561746572207468616e2066726040820152670deda40d2dcc8caf60c31b606082015260800190565b6020808252601390820152725452414e534645525f5a45524f5f56414c554560681b604082015260600190565b6020808252601c908201527f5452414e534645525f544f5f5448455f5a45524f5f4144445245535300000000604082015260600190565b6020808252600c908201526b16915493d7d050d0d495505360a21b604082015260600190565b6020808252601b908201527f4255524e5f414d4f554e545f455843454544535f42414c414e43450000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526010908201526f2a2920a729a322a92faa27afa9a2a62360811b604082015260600190565b6020808252600c908201526b16915493d7d1115413d4d25560a21b604082015260600190565b602080825260149082015273092dcecc2d8d2c840eadcd8dec6d640d2dcc8caf60631b604082015260600190565b60208082526017908201527f45786368616e67652072617465206e6f7420666f756e64000000000000000000604082015260600190565b6020808252600c908201526b1493d31157d1115413d4d25560a21b604082015260600190565b6020808252600a90820152695a65726f2076616c756560b01b604082015260600190565b6020808252601f908201527f5452414e534645525f414d4f554e545f455843454544535f42414c414e434500604082015260600190565b60208082526014908201527310559056081d1c985b9cd9995c8819985a5b195960621b604082015260600190565b60208082526021908201527f494e56414c49445f50524f544f434f4c5f524557415244535f53455454494e476040820152605360f81b606082015260800190565b6020808252601e908201527f4e4f4e5f5a45524f5f50524f544f434f4c5f5245574152445f53484152450000604082015260600190565b602080825260139082015272524f4c455f524553554d455f4d494e54494e4760681b604082015260600190565b60208082526017908201527f556e6c6f636b20616d6f756e7420746f6f206c61726765000000000000000000604082015260600190565b60208082526019908201527f4d696e74696e6720697320616c72656164792070617573656400000000000000604082015260600190565b6020808252601c908201527f496e76616c696420756e6c6f636b207265717565737420696e64657800000000604082015260600190565b60208082526019908201527f415050524f56455f46524f4d5f5a45524f5f4144445245535300000000000000604082015260600190565b602080825260139082015272125b9d985b1a59081cda185c994818dbdd5b9d606a1b604082015260600190565b602080825260159082015274125b9d985b1a59081d5b9b1bd8dac8185b5bdd5b9d605a1b604082015260600190565b60208082526018908201527f4d494e545f544f5f5448455f5a45524f5f414444524553530000000000000000604082015260600190565b60208082526019908201527f556e6c6f636b2072657175657374206973206578706972656400000000000000604082015260600190565b6020808252600f908201526e4255524e5f5a45524f5f56414c554560881b604082015260600190565b602080825260129082015271524f4c455f50415553455f4d494e54494e4760701b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601d908201527f556e6c6f636b2072657175657374206973206e6f742065787069726564000000604082015260600190565b6020808252600a9082015269524f4c455f504155534560b01b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b602080825260159082015274496e76616c69642065786368616e6765207261746560581b604082015260600190565b602080825260159082015274135a5b9d1a5b99c81a5cc81b9bdd081c185d5cd959605a1b604082015260600190565b9283526020830191909152604082015260600190565b60ff91909116815260200190565b6001600160a01b03811681146145e657600080fd5b5056fea2646970667358221220d738fc0f0185aa9ff6e5288d11dbb0dfa5f927a7967f0caa16b2aee005cb4e8664736f6c634300060c0033
Deployed Bytecode
0x6080604052600436106103d25760003560e01c8063629e8056116101fd578063c423f9a811610118578063dd62ed3e116100ab578063f0d82e841161007a578063f0d82e8414610a16578063f1ee8d9214610a36578063f2ab8cd214610a56578063fbb6353814610a84578063fd012e3414610aa4576103e2565b8063dd62ed3e146109ac578063dff69787146109cc578063e1a283d6146109e1578063e4a30116146109f6576103e2565b8063d1f1ca04116100e7578063d1f1ca0414610942578063d547741f14610957578063da8fbf2a14610977578063db006a751461098c576103e2565b8063c423f9a8146108da578063c9d2ff9d146108fa578063ca15c8731461091a578063d0e30db01461093a576103e2565b806395d89b4111610190578063ada03b381161015f578063ada03b381461087b578063be040fb01461089b578063c1db6588146108b0578063c2d78654146108c5576103e2565b806395d89b411461081c578063a217fddf14610831578063a9059cbb14610846578063a905ff9314610866576103e2565b80638456cb59116101cc5780638456cb59146107a55780638f3032c2146107ba5780639010d07c146107dc57806391d14854146107fc576103e2565b8063629e80561461073b5780636e34637c1461075057806370a082311461076557806380ea3de114610785576103e2565b80632e1a7d4d116102ed5780634a36d6c1116102805780635bcb2fc61161024f5780635bcb2fc6146106e95780635c975abb146106f15780635cd47487146107065780635d0395251461071b576103e2565b80634a36d6c11461068a5780634b7e23dc146106aa5780634ff0241a146106bf57806359ae340e146106d4576103e2565b80633a98ef39116102bc5780633a98ef39146106365780633fc777b31461064b57806340a233a6146106605780634757c0d214610675576103e2565b80632e1a7d4d146105b45780632f2ff15d146105d4578063313ce567146105f457806336568abe14610616576103e2565b80631610247b116103655780631b2b3a2f116103345780631b2b3a2f1461053457806323b872dd14610554578063248a9ca314610574578063298e0d3b14610594576103e2565b80631610247b146104e257806318160ddd146105025780631ab8ab25146105175780631afdbce41461052c576103e2565b8063095ea7b3116103a1578063095ea7b3146104605780630a732ce61461048d5780630d10d32c146104ad5780630f7e2048146104c2576103e2565b806301550f64146103e757806304646a49146103fe578063046f7da21461042957806306fdde031461043e576103e2565b366103e2576103df610ad2565b50005b600080fd5b3480156103f357600080fd5b506103fc610be1565b005b34801561040a57600080fd5b50610413610ca1565b6040516104209190613901565b60405180910390f35b34801561043557600080fd5b506103fc610ca7565b34801561044a57600080fd5b50610453610cf7565b6040516104209190613918565b34801561046c57600080fd5b5061048061047b36600461376e565b610d1c565b60405161042091906138f6565b34801561049957600080fd5b506104136104a83660046137cd565b610d33565b3480156104b957600080fd5b506103fc610d45565b3480156104ce57600080fd5b506103fc6104dd3660046137cd565b610f8f565b3480156104ee57600080fd5b506103fc6104fd3660046137cd565b6111a5565b34801561050e57600080fd5b506104136111d6565b34801561052357600080fd5b506104136111dc565b6103fc611200565b34801561054057600080fd5b5061041361054f3660046137cd565b61143e565b34801561056057600080fd5b5061048061056f36600461372e565b61145c565b34801561058057600080fd5b5061041361058f3660046137cd565b6114ca565b3480156105a057600080fd5b506103fc6105af3660046136da565b6114e2565b3480156105c057600080fd5b506103fc6105cf3660046137cd565b6115a0565b3480156105e057600080fd5b506103fc6105ef3660046137e5565b6116d4565b34801561060057600080fd5b5061060961171c565b60405161042091906145c3565b34801561062257600080fd5b506103fc6106313660046137e5565b611721565b34801561064257600080fd5b50610413611763565b34801561065757600080fd5b50610413611769565b34801561066c57600080fd5b5061041361178d565b34801561068157600080fd5b50610413611793565b34801561069657600080fd5b506104136106a53660046137cd565b6117b7565b3480156106b657600080fd5b506104136117e7565b3480156106cb57600080fd5b5061041361180b565b3480156106e057600080fd5b506103fc61182f565b610413610ad2565b3480156106fd57600080fd5b506104806118db565b34801561071257600080fd5b506104136118e4565b34801561072757600080fd5b506104136107363660046136da565b6118ea565b34801561074757600080fd5b506104136118fc565b34801561075c57600080fd5b50610413611902565b34801561077157600080fd5b506104136107803660046136da565b611908565b34801561079157600080fd5b506103fc6107a03660046137cd565b611923565b3480156107b157600080fd5b506103fc611990565b3480156107c657600080fd5b506107cf6119de565b6040516104209190613835565b3480156107e857600080fd5b506107cf6107f7366004613809565b6119ed565b34801561080857600080fd5b506104806108173660046137e5565b611a0c565b34801561082857600080fd5b50610453611a24565b34801561083d57600080fd5b50610413611a43565b34801561085257600080fd5b5061048061086136600461376e565b611a48565b34801561087257600080fd5b50610413611a55565b34801561088757600080fd5b506103fc6108963660046137cd565b611a79565b3480156108a757600080fd5b506103fc611af9565b3480156108bc57600080fd5b50610413611bc7565b3480156108d157600080fd5b50610413611beb565b3480156108e657600080fd5b506104136108f53660046136da565b611c0f565b34801561090657600080fd5b506103fc6109153660046137cd565b611c2a565b34801561092657600080fd5b506104136109353660046137cd565b611d80565b6103fc611d97565b34801561094e57600080fd5b506103fc611e40565b34801561096357600080fd5b506103fc6109723660046137e5565b611ec6565b34801561098357600080fd5b506103fc611f00565b34801561099857600080fd5b506103fc6109a73660046137cd565b611fa6565b3480156109b857600080fd5b506104136109c73660046136f6565b611fd7565b3480156109d857600080fd5b50610413612002565b3480156109ed57600080fd5b50610480612008565b348015610a0257600080fd5b506103fc610a11366004613809565b612011565b348015610a2257600080fd5b506103fc610a313660046137cd565b612163565b348015610a4257600080fd5b50610413610a513660046137cd565b6121c4565b348015610a6257600080fd5b50610a76610a71366004613799565b612218565b604051610420929190613863565b348015610a9057600080fd5b506103fc610a9f3660046137cd565b612481565b348015610ab057600080fd5b50610ac4610abf36600461376e565b61253e565b60405161042092919061390a565b6000610adc6118db565b15610b025760405162461bcd60e51b8152600401610af990613e71565b60405180910390fd5b333480610b215760405162461bcd60e51b8152600401610af990614094565b6000610b2c826121c4565b905080610b365750805b610b40838261257d565b5060c954610b4e90836126d6565b60c9556040516001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b8f908590613901565b60405180910390a3826001600160a01b03167fbb0070894135d02edfa550b04d7e5e141aa8090b46e57597ad45bfedd65544988383604051610bd292919061390a565b60405180910390a29250505090565b60026065541415610c045760405162461bcd60e51b8152600401610af99061446e565b600260655560005b33600090815260cf6020526040902054811015610c995733600090815260cf602052604090208054610c75919083908110610c4357fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250506126fb565b610c8b57610c848160016126d6565b9050610c0c565b610c9481612716565b610c0c565b506001606555565b60cd5481565b610cd17f042c6cf123ef505aa22225497dce2119e438d03e616dea9958b9e78a7d2c9bfd33611a0c565b610ced5760405162461bcd60e51b8152600401610af990613994565b610cf561293c565b565b60408051808201909152600b81526a0a6e8c2d6cac84082ac82b60ab1b602082015290565b6000610d293384846129a0565b5060015b92915050565b60d16020526000908152604090205481565b60026065541415610d685760405162461bcd60e51b8152600401610af99061446e565b6002606555610d756118db565b15610d925760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf6020526040812054815b81811015610f0457610db46136c0565b33600090815260cf60205260409020805483908110610dcf57fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050610e0781612a79565b610e1e57610e168260016126d6565b915050610da4565b6020810151610e2e9085906126d6565b33600090815260cf60205260409020805491955090610e4e906001612aa0565b81548110610e5857fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b031681526020019081526020016000208381548110610e9657fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf90915260409020805480610ece57fe5b6000828152602081206002600019909301928302018181556001908101919091559155610efc908490612aa0565b925050610da4565b8215610f855733600090815260d06020526040902054610f249084612aa0565b33600081815260d06020526040902091909155610f4390309085612ac8565b336001600160a01b03167feaca243f6502ade1b9ea0909306c290366d6ea6778ca407ca4415c4a0f45e35384604051610f7c9190613901565b60405180910390a25b5050600160655550565b60026065541415610fb25760405162461bcd60e51b8152600401610af99061446e565b6002606555610fbf6118db565b15610fdc5760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf6020526040902054811061100a5760405162461bcd60e51b8152600401610af9906140ba565b6110126136c0565b33600090815260cf6020526040902080548390811061102d57fe5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050905061106581612a79565b6110815760405162461bcd60e51b8152600401610af9906144a5565b60208082015133600090815260d09092526040909120546110a29082612aa0565b33600090815260d0602090815260408083209390935560cf905220805460001981019081106110cd57fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020848154811061110b57fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf9091526040902080548061114357fe5b60008281526020812060026000199093019283020181815560010155905561116c303383612ac8565b336001600160a01b03167feaca243f6502ade1b9ea0909306c290366d6ea6778ca407ca4415c4a0f45e35382604051610f7c9190613901565b600260655414156111c85760405162461bcd60e51b8152600401610af99061446e565b6002606555610c9981612716565b60ca5490565b7fcdf8b82f637f9a4be48302312e5512748fdc83ce33bdd13a07588c9a48f40d0881565b600260655414156112235760405162461bcd60e51b8152600401610af99061446e565b60026065556112527f47b922604560255f6e7d9ac32bd55d2b112af12fac29e9cbbcef77fe82ffbd9333611a0c565b61126e5760405162461bcd60e51b8152600401610af990613d51565b6000341161128e5760405162461bcd60e51b8152600401610af990613fcc565b60d65415806112a7575060d7546001600160a01b031615155b6112c35760405162461bcd60e51b8152600401610af9906141ce565b60d654600090349015611306576112f7670de0b6b3a76400006112f160d65434612b1690919063ffffffff16565b90612b50565b91506113033483612aa0565b90505b60c95461131390826126d6565b60c95561131e612b82565b61132f670de0b6b3a76400006117b7565b42600081815260d1602052604081209290925560d2805460018101825592527ff2192e1030363415d7b4fb0406540a0060e8e2fc8982f3f32289379e11fa65469091015581156113fc5760d7546040516000916001600160a01b031690849061139790613832565b60006040518083038185875af1925050503d80600081146113d4576040519150601f19603f3d011682016040523d82523d6000602084013e6113d9565b606091505b50509050806113fa5760405162461bcd60e51b8152600401610af990613b5e565b505b7f915149a1670a81177a53d6f73ee6f911abec9e8d13d0ca02a93a28fcc0d54458818360405161142d92919061390a565b60405180910390a150506001606555565b60d2818154811061144b57fe5b600091825260209091200154905081565b6001600160a01b038316600090815260cc60209081526040808320338452909152812054828110156114a05760405162461bcd60e51b8152600401610af9906139fb565b6114ab858585612ac8565b6114bf85336114ba8487612aa0565b6129a0565b506001949350505050565b6000818152603360205260409020600201545b919050565b6114ed600033611a0c565b6115095760405162461bcd60e51b8152600401610af990613bc3565b6001600160a01b0381166115375760d654156115375760405162461bcd60e51b8152600401610af99061420f565b60d7546040517fec82cc68c33f2e4344f1dc23eef251666e1f15e90a4b1bd1edc2a7544eff9a1a91611576916001600160a01b03909116908490613849565b60405180910390a160d780546001600160a01b0319166001600160a01b0392909216919091179055565b600260655414156115c35760405162461bcd60e51b8152600401610af99061446e565b60026065556115f27f0f9dd4db10c87ffcc337f44200a5df16e545591d09c12f63c158b3d592fcf18833611a0c565b61160e5760405162461bcd60e51b8152600401610af990613b00565b6000336001600160a01b03168260405161162790613832565b60006040518083038185875af1925050503d8060008114611664576040519150601f19603f3d011682016040523d82523d6000602084013e611669565b606091505b505090508061168a5760405162461bcd60e51b8152600401610af9906141a0565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040516116c39190613901565b60405180910390a250506001606555565b6000828152603360205260409020600201546116f290610817612caa565b61170e5760405162461bcd60e51b8152600401610af990613a3c565b6117188282612cae565b5050565b601290565b611729612caa565b6001600160a01b0316816001600160a01b0316146117595760405162461bcd60e51b8152600401610af990614500565b6117188282612d17565b60ca5481565b7feaf074586bf6c7ac16d3c4db5c992c7f0721b20b018b99a7d1fe8187f59d9c8681565b60ce5481565b7f7507d5b6f482d6f276fc3788841416ce1f32150a93658622625d5b91ccda3d7881565b600060ca54600014156117cc575060006114dd565b610d2d60ca546112f160c95485612b1690919063ffffffff16565b7f0f9dd4db10c87ffcc337f44200a5df16e545591d09c12f63c158b3d592fcf18881565b7ff146182d150a5b368b6d283f87aeae1f25c21b02ff55cf16848704ade176a5cb81565b6118597fcdf8b82f637f9a4be48302312e5512748fdc83ce33bdd13a07588c9a48f40d0833611a0c565b6118755760405162461bcd60e51b8152600401610af990614246565b60d35460ff166118975760405162461bcd60e51b8152600401610af99061457e565b60d3805460ff191690556040517f8a53acd29b3c02ba82b89c57b23196b792ccb00a28515221f71bd92eafbc2dc3906118d1903390613835565b60405180910390a1565b60975460ff1690565b60d45481565b60d06020526000908152604090205481565b60c95481565b60d65481565b6001600160a01b0316600090815260cb602052604090205490565b61192e600033611a0c565b61194a5760405162461bcd60e51b8152600401610af990613bc3565b60cd8054908290556040517f98eaabfe135a9c40c420208962bf81e7926b4d6df3e23502164c0554b7b3522490611984908390859061390a565b60405180910390a15050565b6119ba7ff146182d150a5b368b6d283f87aeae1f25c21b02ff55cf16848704ade176a5cb33611a0c565b6119d65760405162461bcd60e51b8152600401610af9906144dc565b610cf5612d80565b60d7546001600160a01b031681565b6000828152603360205260408120611a059083612ddb565b9392505050565b6000828152603360205260408120611a059083612de7565b6040805180820190915260058152640e682ac82b60db1b602082015290565b600081565b6000610d29338484612ac8565b7f47b922604560255f6e7d9ac32bd55d2b112af12fac29e9cbbcef77fe82ffbd9381565b611aa37f7507d5b6f482d6f276fc3788841416ce1f32150a93658622625d5b91ccda3d7833611a0c565b611abf5760405162461bcd60e51b8152600401610af990613e9b565b60d48054908290556040517fc016457d0a92973d26bab98d68d6f20133e355c467d05e5206c88c25d3b739d090611984908390859061390a565b60026065541415611b1c5760405162461bcd60e51b8152600401610af99061446e565b600260655533600090815260cf6020526040812054905b81811015611bbe5733600090815260cf602052604090208054611b8d919083908110611b5b57fe5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050612dfc565b611ba357611b9c8160016126d6565b9050611b33565b611bac81612e2f565b611bb7826001612aa0565b9150611b33565b50506001606555565b7f042c6cf123ef505aa22225497dce2119e438d03e616dea9958b9e78a7d2c9bfd81565b7fa9905b3f34c6e7b8ac62a407ded9f3069ef096a2e251318e09aff6898263df1981565b6001600160a01b0316600090815260cf602052604090205490565b60026065541415611c4d5760405162461bcd60e51b8152600401610af99061446e565b6002606555611c5a6118db565b15611c775760405162461bcd60e51b8152600401610af990613e71565b60008111611c975760405162461bcd60e51b8152600401610af99061437c565b33600090815260cb6020526040902054811115611cc65760405162461bcd60e51b8152600401610af990614273565b33600090815260d06020526040902054611ce090826126d6565b33600081815260d06020526040902091909155611cfe903083612ac8565b33600081815260cf602090815260408083208151808301835242815280840187815282546001818101855593875294909520905160029094020192835592519190920155517fd843ce9ef55b27026be6c5e44e9f58097e0ebfa0d9d2d5823cb8ffa77958517090611d70908490613901565b60405180910390a2506001606555565b6000818152603360205260408120610d2d9061312d565b611dc17fa9905b3f34c6e7b8ac62a407ded9f3069ef096a2e251318e09aff6898263df1933611a0c565b611ddd5760405162461bcd60e51b8152600401610af99061411f565b60003411611dfd5760405162461bcd60e51b8152600401610af990614145565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c34604051611e369190613901565b60405180910390a2565b60026065541415611e635760405162461bcd60e51b8152600401610af99061446e565b600260655560005b33600090815260cf6020526040902054811015610c995733600090815260cf602052604090208054611ea2919083908110611b5b57fe5b611eb857611eb18160016126d6565b9050611e6b565b611ec181612716565b611e6b565b600082815260336020526040902060020154611ee490610817612caa565b6117595760405162461bcd60e51b8152600401610af990613dec565b611f2a7feaf074586bf6c7ac16d3c4db5c992c7f0721b20b018b99a7d1fe8187f59d9c8633611a0c565b611f465760405162461bcd60e51b8152600401610af990614442565b60d35460ff1615611f695760405162461bcd60e51b8152600401610af9906142aa565b60d3805460ff191660011790556040517f35365f539a67058ad0735a24a50fe45b0ee05207919e9f4a2f60d855f55e0c0e906118d1903390613835565b60026065541415611fc95760405162461bcd60e51b8152600401610af99061446e565b6002606555610c9981612e2f565b6001600160a01b03918216600090815260cc6020908152604080832093909416825291909152205490565b60d55481565b60d35460ff1681565b600054610100900460ff168061202a575061202a613138565b80612038575060005460ff16155b6120545760405162461bcd60e51b8152600401610af990613ed2565b600054610100900460ff1615801561207f576000805460ff1961ff0019909116610100171660011790555b61208a60003361170e565b60cd8390556040517f98eaabfe135a9c40c420208962bf81e7926b4d6df3e23502164c0554b7b35224906120c290600090869061390a565b60405180910390a160ce8290556040517f13cca15637be33d4651625caf09528168b20c132463c69ab5c0ff48b3e6391179061210290600090859061390a565b60405180910390a160001960d48190556040517fc016457d0a92973d26bab98d68d6f20133e355c467d05e5206c88c25d3b739d091612144916000919061390a565b60405180910390a1801561215e576000805461ff00191690555b505050565b61216e600033611a0c565b61218a5760405162461bcd60e51b8152600401610af990613bc3565b60ce8054908290556040517f13cca15637be33d4651625caf09528168b20c132463c69ab5c0ff48b3e63911790611984908390859061390a565b600060c954600014156121d9575060006114dd565b60006121f660c9546112f160ca5486612b1690919063ffffffff16565b905060008111610d2d5760405162461bcd60e51b8152600401610af99061434f565b6001600160a01b038316600090815260cf6020526040902054606090819084106122545760405162461bcd60e51b8152600401610af990613c4e565b8284106122735760405162461bcd60e51b8152600401610af990613f20565b6001600160a01b038516600090815260cf60205260409020548311156122af576001600160a01b038516600090815260cf602052604090205492505b60606122bb8486612aa0565b67ffffffffffffffff811180156122d157600080fd5b5060405190808252806020026020018201604052801561230b57816020015b6122f86136c0565b8152602001906001900390816122f05790505b509050606061231a8587612aa0565b67ffffffffffffffff8111801561233057600080fd5b5060405190808252806020026020018201604052801561235a578160200160208202803683370190505b50905060005b61236a8688612aa0565b811015612474576001600160a01b038816600090815260cf6020526040902061239388836126d6565b8154811061239d57fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508382815181106123d657fe5b60200260200101819052506123fd8382815181106123f057fe5b6020026020010151612dfc565b156124625760008061242585848151811061241457fe5b602002602001015160000151613149565b91509150816124465760405162461bcd60e51b8152600401610af9906140e8565b8084848151811061245357fe5b60200260200101818152505050505b61246d8160016126d6565b9050612360565b5090969095509350505050565b61248c600033611a0c565b6124a85760405162461bcd60e51b8152600401610af990613bc3565b670de0b6b3a76400008111156124d05760405162461bcd60e51b8152600401610af990613b27565b80156124fe5760d7546001600160a01b03166124fe5760405162461bcd60e51b8152600401610af990613ab9565b7fd64413eea98d7572b05d6a3596cd38358dc16b901dc7a62e3ddb2e9546cacd6760d6548260405161253192919061390a565b60405180910390a160d655565b60cf602052816000526040600020818154811061255757fe5b600091825260209091206002909102018054600190910154909250905082565b3b151590565b60006125876118db565b156125a45760405162461bcd60e51b8152600401610af990613e71565b60d35460ff16156125c75760405162461bcd60e51b8152600401610af990613bef565b6001600160a01b0383166125ed5760405162461bcd60e51b8152600401610af9906143ab565b6000821161260d5760405162461bcd60e51b8152600401610af99061396b565b6000612618836117b7565b905060d4546126328260c9546126d690919063ffffffff16565b11156126505760405162461bcd60e51b8152600401610af990613d1a565b6001600160a01b038416600090815260cb602052604090205461267f5760d55461267b9060016126d6565b60d5555b60ca5461268c90846126d6565b60ca556001600160a01b038416600090815260cb60205260409020546126b290846126d6565b6001600160a01b038516600090815260cb6020526040902055505060ca5492915050565b600082820183811015611a055760405162461bcd60e51b8152600401610af990613cbc565b60cd548151600091429161270e916126d6565b101592915050565b61271e6118db565b1561273b5760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf602052604090205481106127695760405162461bcd60e51b8152600401610af990613cf3565b6127716136c0565b33600090815260cf6020526040902080548390811061278c57fe5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090506127c481612a79565b156127e15760405162461bcd60e51b8152600401610af9906143e2565b602080820151825133600090815260cf9093526040909220549091906000190184146128835733600090815260cf602052604090208054600019810190811061282657fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020858154811061286457fe5b6000918252602090912082546002909202019081556001918201549101555b33600090815260cf6020526040902080548061289b57fe5b600082815260208082206002600019909401938402018281556001018290559190925533825260d0905260409020546128d49083612aa0565b33600081815260d060205260409020919091556128f390309084612ac8565b336001600160a01b03167f7e4a9502fd577f76f1dc8c9c8f63196816f7c1bd73c6db99f888e8d7bb2f8998828460405161292e92919061390a565b60405180910390a250505050565b6129446118db565b6129605760405162461bcd60e51b8152600401610af990613a8b565b6097805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612993612caa565b6040516118d19190613835565b6129a86118db565b156129c55760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166129eb5760405162461bcd60e51b8152600401610af990614318565b6001600160a01b038216612a115760405162461bcd60e51b8152600401610af990613c85565b6001600160a01b03808416600081815260cc602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590612a6c908590613901565b60405180910390a3505050565b60ce5460cd5482516000924292612a9992612a93916126d6565b906126d6565b1092915050565b600082821115612ac25760405162461bcd60e51b8152600401610af990613d7e565b50900390565b612ad3838383613284565b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612a6c9190613901565b600082612b2557506000610d2d565b82820282848281612b3257fe5b0414611a055760405162461bcd60e51b8152600401610af990614029565b6000808211612b715760405162461bcd60e51b8152600401610af990613db5565b818381612b7a57fe5b049392505050565b60d254612b8e57610cf5565b600080612bb36202a300612bad60ce5442612aa090919063ffffffff16565b90612aa0565b90505b60d25482108015612bdd57508060d28381548110612bd057fe5b9060005260206000200154105b15612bf457612bed8260016126d6565b9150612bb6565b81612c00575050610cf5565b60005b60d254612c109084612aa0565b811015612c635760d2612c2382856126d6565b81548110612c2d57fe5b906000526020600020015460d28281548110612c4557fe5b600091825260209091200155612c5c8160016126d6565b9050612c03565b5060015b82811161215e5760d2805480612c7957fe5b60019003818190600052602060002001600090559055612ca36001826126d690919063ffffffff16565b9050612c67565b3390565b6000828152603360205260409020612cc69082613429565b1561171857612cd3612caa565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152603360205260409020612d2f908261343e565b1561171857612d3c612caa565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b612d886118db565b15612da55760405162461bcd60e51b8152600401610af990613e71565b6097805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612993612caa565b6000611a058383613453565b6000611a05836001600160a01b038416613498565b6000612e07826126fb565b158015610d2d57504261270e60ce54612a9360cd5486600001516126d690919063ffffffff16565b612e376118db565b15612e545760405162461bcd60e51b8152600401610af990613e71565b33600090815260cf60205260409020548110612e825760405162461bcd60e51b8152600401610af9906142e1565b612e8a6136c0565b33600090815260cf60205260409020805483908110612ea557fe5b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250509050612edd81612dfc565b612ef95760405162461bcd60e51b8152600401610af990613e3c565b600080612f098360000151613149565b9150915081612f2a5760405162461bcd60e51b8152600401610af9906140e8565b602083015183516000612f49670de0b6b3a76400006112f18686612b16565b905082811015612f6b5760405162461bcd60e51b8152600401610af99061454f565b33600090815260d06020526040902054612f859084612aa0565b33600090815260d06020526040902055612f9f30846134b0565b5060c954612fad9082612aa0565b60c95533600090815260cf602052604090208054612fcc906001612aa0565b81548110612fd657fe5b906000526020600020906002020160cf6000336001600160a01b03166001600160a01b03168152602001908152602001600020888154811061301457fe5b600091825260208083208454600290930201918255600193840154939091019290925533815260cf9091526040902080548061304c57fe5b6000828152602081206002600019909301928302018181556001015590556040513390829061307a90613832565b60006040518083038185875af1925050503d80600081146130b7576040519150601f19603f3d011682016040523d82523d6000602084013e6130bc565b606091505b505080955050846130df5760405162461bcd60e51b8152600401610af9906141a0565b336001600160a01b03167fbd5034ffbd47e4e72a94baa2cdb74c6fad73cb3bcdc13036b72ec8306f5a764683858460405161311c939291906145ad565b60405180910390a250505050505050565b6000610d2d826135ac565b600061314330612577565b15905090565b60d25460009081906131605750600090508061327f565b60d25460cd54600091829160001990910190829061317f9088906126d6565b90505b8184116132735761319860026112f184876126d6565b92508060d284815481106131a857fe5b9060005260206000200154116132435760d2546131c68460016126d6565b14806131f257508060d26131db8560016126d6565b815481106131e557fe5b9060005260206000200154115b1561323157600160d1600060d2868154811061320a57fe5b9060005260206000200154815260200190815260200160002054955095505050505061327f565b61323c8360016126d6565b935061326e565b82613260576001670de0b6b3a7640000955095505050505061327f565b61326b836001612aa0565b91505b613182565b60008095509550505050505b915091565b61328c6118db565b156132a95760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166132cf5760405162461bcd60e51b8152600401610af990613b8c565b6001600160a01b0382166132f55760405162461bcd60e51b8152600401610af990613f95565b816001600160a01b0316836001600160a01b031614156133275760405162461bcd60e51b8152600401610af99061406a565b6001600160a01b038316600090815260cb6020526040902054808211156133605760405162461bcd60e51b8152600401610af990614169565b600082116133805760405162461bcd60e51b8152600401610af990613f68565b6001600160a01b038316600090815260cb60205260409020546133af5760d5546133ab9060016126d6565b60d5555b6133b98183612aa0565b6001600160a01b03808616600090815260cb602052604080822093909355908516815220546133e890836126d6565b6001600160a01b03808516600090815260cb602052604080822093909355908616815220546134235760d55461341f906001612aa0565b60d5555b50505050565b6000611a05836001600160a01b0384166135b0565b6000611a05836001600160a01b0384166135fa565b815460009082106134765760405162461bcd60e51b8152600401610af9906139b9565b82600001828154811061348557fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b60006134ba6118db565b156134d75760405162461bcd60e51b8152600401610af990613e71565b6001600160a01b0383166134fd5760405162461bcd60e51b8152600401610af990613c17565b6000821161351d5760405162461bcd60e51b8152600401610af990614419565b6001600160a01b038316600090815260cb6020526040902054808311156135565760405162461bcd60e51b8152600401610af990613ff2565b60ca546135639084612aa0565b60ca556135708184612aa0565b6001600160a01b038516600090815260cb602052604090208190556135a15760d55461359d906001612aa0565b60d5555b505060ca5492915050565b5490565b60006135bc8383613498565b6135f257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610d2d565b506000610d2d565b600081815260018301602052604081205480156136b6578354600019808301919081019060009087908390811061362d57fe5b906000526020600020015490508087600001848154811061364a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061367a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610d2d565b6000915050610d2d565b604051806040016040528060008152602001600081525090565b6000602082840312156136eb578081fd5b8135611a05816145d1565b60008060408385031215613708578081fd5b8235613713816145d1565b91506020830135613723816145d1565b809150509250929050565b600080600060608486031215613742578081fd5b833561374d816145d1565b9250602084013561375d816145d1565b929592945050506040919091013590565b60008060408385031215613780578182fd5b823561378b816145d1565b946020939093013593505050565b6000806000606084860312156137ad578283fd5b83356137b8816145d1565b95602085013595506040909401359392505050565b6000602082840312156137de578081fd5b5035919050565b600080604083850312156137f7578182fd5b823591506020830135613723816145d1565b6000806040838503121561381b578182fd5b50508035926020909101359150565b815260200190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b60408082528351828201819052600091906020906060850190828801855b828110156138a657815180518552850151858501529285019290840190600101613881565b5050508481038286015280925085516138bf8183613901565b93508287019150845b818110156138e9576138db85845161382a565b9450918301916001016138c8565b5092979650505050505050565b901515815260200190565b90815260200190565b918252602082015260400190565b6000602080835283518082850152825b8181101561394457858101830151858201604001528201613928565b818111156139555783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600f908201526e4d494e545f5a45524f5f56414c554560881b604082015260600190565b6020808252600b908201526a524f4c455f524553554d4560a81b604082015260600190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604082015261647360f01b606082015260800190565b60208082526021908201527f5452414e534645525f414d4f554e545f455843454544535f414c4c4f57414e436040820152604560f81b606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526e0818591b5a5b881d1bc819dc985b9d608a1b606082015260800190565b60208082526014908201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604082015260600190565b60208082526027908201527f50524f544f434f4c5f5245574152445f53484152455f524543495049454e545f6040820152661393d517d4d15560ca1b606082015260800190565b6020808252600d908201526c524f4c455f574954484452415760981b604082015260600190565b6020808252601f908201527f50524f544f434f4c5f5245574152445f53484152455f544f4f5f4c4152474500604082015260600190565b6020808252601490820152731055905617d514905394d1915497d1905253115160621b604082015260600190565b6020808252601e908201527f5452414e534645525f46524f4d5f5448455f5a45524f5f414444524553530000604082015260600190565b60208082526012908201527144454641554c545f41444d494e5f524f4c4560701b604082015260600190565b6020808252600e908201526d135a5b9d1a5b99c81c185d5cd95960921b604082015260600190565b6020808252601a908201527f4255524e5f46524f4d5f5448455f5a45524f5f41444452455353000000000000604082015260600190565b60208082526018908201527f46726f6d20696e646578206f7574206f6620626f756e64730000000000000000604082015260600190565b60208082526017908201527f415050524f56455f544f5f5a45524f5f41444452455353000000000000000000604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252600d908201526c092dcecc2d8d2c840d2dcc8caf609b1b604082015260600190565b6020808252601e908201527f544f54414c5f504f4f4c45445f415641585f4341505f45584345454445440000604082015260600190565b602080825260139082015272524f4c455f4143435255455f5245574152445360681b604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526030908201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60408201526f2061646d696e20746f207265766f6b6560801b606082015260800190565b6020808252818101527f556e6c6f636b2072657175657374206973206e6f742072656465656d61626c65604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601e908201527f524f4c455f5345545f544f54414c5f504f4f4c45445f415641585f4341500000604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526028908201527f546f20696e646578206d7573742062652067726561746572207468616e2066726040820152670deda40d2dcc8caf60c31b606082015260800190565b6020808252601390820152725452414e534645525f5a45524f5f56414c554560681b604082015260600190565b6020808252601c908201527f5452414e534645525f544f5f5448455f5a45524f5f4144445245535300000000604082015260600190565b6020808252600c908201526b16915493d7d050d0d495505360a21b604082015260600190565b6020808252601b908201527f4255524e5f414d4f554e545f455843454544535f42414c414e43450000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b60208082526010908201526f2a2920a729a322a92faa27afa9a2a62360811b604082015260600190565b6020808252600c908201526b16915493d7d1115413d4d25560a21b604082015260600190565b602080825260149082015273092dcecc2d8d2c840eadcd8dec6d640d2dcc8caf60631b604082015260600190565b60208082526017908201527f45786368616e67652072617465206e6f7420666f756e64000000000000000000604082015260600190565b6020808252600c908201526b1493d31157d1115413d4d25560a21b604082015260600190565b6020808252600a90820152695a65726f2076616c756560b01b604082015260600190565b6020808252601f908201527f5452414e534645525f414d4f554e545f455843454544535f42414c414e434500604082015260600190565b60208082526014908201527310559056081d1c985b9cd9995c8819985a5b195960621b604082015260600190565b60208082526021908201527f494e56414c49445f50524f544f434f4c5f524557415244535f53455454494e476040820152605360f81b606082015260800190565b6020808252601e908201527f4e4f4e5f5a45524f5f50524f544f434f4c5f5245574152445f53484152450000604082015260600190565b602080825260139082015272524f4c455f524553554d455f4d494e54494e4760681b604082015260600190565b60208082526017908201527f556e6c6f636b20616d6f756e7420746f6f206c61726765000000000000000000604082015260600190565b60208082526019908201527f4d696e74696e6720697320616c72656164792070617573656400000000000000604082015260600190565b6020808252601c908201527f496e76616c696420756e6c6f636b207265717565737420696e64657800000000604082015260600190565b60208082526019908201527f415050524f56455f46524f4d5f5a45524f5f4144445245535300000000000000604082015260600190565b602080825260139082015272125b9d985b1a59081cda185c994818dbdd5b9d606a1b604082015260600190565b602080825260159082015274125b9d985b1a59081d5b9b1bd8dac8185b5bdd5b9d605a1b604082015260600190565b60208082526018908201527f4d494e545f544f5f5448455f5a45524f5f414444524553530000000000000000604082015260600190565b60208082526019908201527f556e6c6f636b2072657175657374206973206578706972656400000000000000604082015260600190565b6020808252600f908201526e4255524e5f5a45524f5f56414c554560881b604082015260600190565b602080825260129082015271524f4c455f50415553455f4d494e54494e4760701b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601d908201527f556e6c6f636b2072657175657374206973206e6f742065787069726564000000604082015260600190565b6020808252600a9082015269524f4c455f504155534560b01b604082015260600190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201526e103937b632b9903337b91039b2b63360891b606082015260800190565b602080825260159082015274496e76616c69642065786368616e6765207261746560581b604082015260600190565b602080825260159082015274135a5b9d1a5b99c81a5cc81b9bdd081c185d5cd959605a1b604082015260600190565b9283526020830191909152604082015260600190565b60ff91909116815260200190565b6001600160a01b03811681146145e657600080fd5b5056fea2646970667358221220d738fc0f0185aa9ff6e5288d11dbb0dfa5f927a7967f0caa16b2aee005cb4e8664736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.