Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
Staking
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {IERC20MetadataUpgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import {SafeERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
/**
* @title Staking Contract
* @dev A staking contract that allows users to stake ERC20 tokens and earn rewards based on staking duration and tier.
* The contract supports multiple staking periods, APRs, and tiers with multipliers for rewards.
*/
contract Staking is
Initializable,
OwnableUpgradeable,
ReentrancyGuardUpgradeable,
PausableUpgradeable,
UUPSUpgradeable
{
using SafeERC20Upgradeable for IERC20MetadataUpgradeable;
IERC20MetadataUpgradeable public stakingToken; // The ERC20 token used for staking
uint256 public tokenDecimals; // the decimals of the Pineapple token
uint256 public constant BASE = 1000; // Base value for APR calculations
struct Stake {
uint256 tokenAmount; // Amount of tokens staked
uint256 startTime; // lock start
uint256 lastClaimTime; // reward‐accrual start
uint256 stakingType; // Type of staking (0 = flexible, 1+ = locked)
uint256 score; // the score which the user got for staking
address user; // Address of the staker
uint256 id; // Unique ID of the stake
bool finished; // Whether the stake is withdrawn
}
mapping(uint8 => uint256) public stakingPeriod; // seconds per lock
mapping(uint8 => uint256) public stakingAPR; // APR×BASE
mapping(uint8 => uint256) public stakingMultiplier; // for score
mapping(uint256 => Stake) public stakes; // store each Stake by its unique ID
mapping(address => uint256[]) public stakesByOwner; // track each user's list of stake-IDs
mapping(address => uint256) public userTotalScore; // Stores the total score for each user
uint256 private _nextStakeId; // next stake ID counter
mapping(uint256 => uint256) public rewards; // Mapping of stake ID to reward amount
mapping(address => uint256) public rewardsPerUser; // Mapping of user address to their total reward amount
mapping(uint8 => uint256) public tierScore; // Mapping of tier level (uint8) to its required score
uint8 public maxStakingTypes; // Maximum number of staking types/tiers
uint256 public totalAmountOfStakes; // Total amount of stakes
bool public isOpen; // Whether staking is open
uint256 public totalPaidRewards; // Total paid rewards
uint256 public BASE_SCORE_VALUE; // Base value for score calculation, can be adjusted by owner
bool public depositsPaused; // Whether deposits are paused
event MaxStakingTypesSet(uint8 oldMaxTypes, uint8 newMaxTypes);
event StakingPeriodSet(uint8 indexed tier, uint256 oldPeriod, uint256 newPeriod);
event StakingAPRSet(uint8 indexed tier, uint256 oldAPR, uint256 newAPR);
event StakingMultiplierSet(uint8 indexed tier, uint256 oldMultiplier, uint256 newMultiplier);
event BaseScoreValueSet(uint256 oldBaseScoreValue, uint256 newBaseScoreValue);
event TierScoreSet(uint8 indexed tier, uint256 oldScore, uint256 newScore);
event DepositsPausedSet(bool oldStatus, bool newStatus);
event Deposit(address indexed user, uint256 amount, uint256 stakingType);
event Withdraw(uint256 indexed id, uint256 rewardAmount);
event ClaimedReward(uint256 indexed id, uint256 rewardAmount);
event UserScoreUpdated(address indexed user, uint256 score);
event RestakedStake(uint256 indexed oldId, uint256 indexed newId, uint256 stakingType, uint256 rewardPaid);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(
address _stakingToken,
uint256 initialBalance
) public initializer {
__Ownable_init();
__ReentrancyGuard_init();
__UUPSUpgradeable_init();
__Pausable_init();
maxStakingTypes = 5; // Default maximum staking types
stakingToken = IERC20MetadataUpgradeable(_stakingToken);
tokenDecimals = stakingToken.decimals();
totalAmountOfStakes = 0;
stakingPeriod[0] = 0 days;
stakingPeriod[1] = 1 * 30 days;
stakingPeriod[2] = 3 * 30 days;
stakingPeriod[3] = 6 * 30 days;
stakingPeriod[4] = 12 * 30 days;
stakingAPR[0] = 30;
stakingAPR[1] = 42;
stakingAPR[2] = 60;
stakingAPR[3] = 90;
stakingAPR[4] = 150;
stakingMultiplier[0] = 0;
stakingMultiplier[1] = 1000;
stakingMultiplier[2] = 1500;
stakingMultiplier[3] = 2200;
stakingMultiplier[4] = 4000;
tierScore[0] = 0;
tierScore[1] = 100_000;
tierScore[2] = 500_000;
tierScore[3] = 2_000_000;
tierScore[4] = 5_000_000;
BASE_SCORE_VALUE = 1;
// fund the contract and open it
if (initialBalance > 0) {
stakingToken.safeTransferFrom(
msg.sender,
address(this),
initialBalance
);
}
isOpen = true;
}
/**
* @dev required by UUPS for authorization
* @param newImplementation The new implementation address
*/
function _authorizeUpgrade(
address newImplementation
) internal override onlyOwner {}
/**
* @dev Calculates the stake score based on the amount and staking type.
* @param _amount The amount of tokens staked.
* @param _stakingType The type of staking (0 = flexible, 1+ = locked).
* @return The calculated stake score for this particular stake. This is added / subtracted from totalScore
*/
function _calculateStakeScore(
uint256 _amount,
uint256 _stakingType
) private view returns (uint256) {
if (
_stakingType == 0 ||
_stakingType >= maxStakingTypes ||
stakingMultiplier[uint8(_stakingType)] == 0
) {
return 0; // No score for invalid types or types with zero multiplier (e.g., flexible tier)
}
uint256 denominator = BASE * (10 ** tokenDecimals);
return
(_amount *
stakingMultiplier[uint8(_stakingType)] *
BASE_SCORE_VALUE) / denominator;
}
/**
* @dev Allows a user to stake tokens.
* @param _amount Amount of tokens to stake.
* @param _stakingType Type of staking (0 = flexible, 1+ = locked).
*/
function stakeTokens(
uint256 _amount,
uint256 _stakingType
) external nonReentrant whenNotPaused {
require(isOpen, "Staking is not available");
require(!depositsPaused, "Deposits are paused");
require(_amount > 0, "Cannot stake 0 tokens");
require(_stakingType < maxStakingTypes, "Invalid staking type");
// assign a new ID, store by mapping, and record in msg.sender's list
uint256 id = _nextStakeId++;
stakes[id] = Stake({
tokenAmount: _amount,
startTime: block.timestamp,
lastClaimTime: block.timestamp,
stakingType: _stakingType,
score: _calculateStakeScore(_amount, _stakingType),
user: msg.sender,
id: id,
finished: false
});
stakingToken.safeTransferFrom(msg.sender, address(this), _amount);
emit Deposit(msg.sender, _amount, _stakingType);
stakesByOwner[msg.sender].push(id);
totalAmountOfStakes += _amount;
// Update user's total score with the score from the new stake
userTotalScore[msg.sender] += stakes[id].score;
emit UserScoreUpdated(msg.sender, userTotalScore[msg.sender]);
}
/**
* @dev Allows a user to withdraw their stake and rewards.
* @param _id ID of the stake to withdraw.
*/
function withdrawStake(uint256 _id) external nonReentrant whenNotPaused {
Stake storage stake = stakes[_id];
require(!stake.finished, "Stake already withdrawn");
require(stake.user == msg.sender, "Not the stake owner");
uint256 stakingDuration = block.timestamp - stake.startTime;
if (stake.stakingType != 0) {
require(
stakingDuration > stakingPeriod[uint8(stake.stakingType)],
"Lock period not reached"
);
}
uint256 rewardAmount = calculateReward(_id);
uint256 balance = stakingToken.balanceOf(address(this));
// Contract must at least hold all staked principal
require(
balance >= totalAmountOfStakes,
"Insufficient principal balance"
);
// Only the surplus over *all* live principal is usable as reward
uint256 availableReward = balance - totalAmountOfStakes;
uint256 paidReward = rewardAmount <= availableReward
? rewardAmount
: availableReward;
rewards[_id] += paidReward;
rewardsPerUser[msg.sender] += paidReward;
totalPaidRewards += paidReward;
totalAmountOfStakes -= stake.tokenAmount;
// transfer principal + whatever reward we can after updating state (no reentrancy possible)
stakingToken.safeTransfer(msg.sender, stake.tokenAmount + paidReward);
emit Withdraw(_id, stake.tokenAmount + paidReward);
// Update user's total score
userTotalScore[stake.user] -= stake.score;
emit UserScoreUpdated(stake.user, userTotalScore[stake.user]);
// zero out the stake, as it has been withdrawn
stake.tokenAmount = 0;
stake.finished = true;
}
/**
* @dev Claim the accrued reward for a single stake, regardless of lock status
* @param _id The ID of the stake to claim rewards from
*/
function claimReward(uint256 _id) external nonReentrant whenNotPaused {
Stake storage s = stakes[_id];
require(!s.finished, "Already withdrawn");
require(s.user == msg.sender, "Not stake owner");
uint256 rewardAmount = calculateReward(_id);
require(rewardAmount > 0, "No rewards available");
uint256 balance = stakingToken.balanceOf(address(this));
uint256 availableReward = balance - totalAmountOfStakes; // protect principals
require(
availableReward >= rewardAmount,
"Insufficient reward liquidity"
);
// record and pay out
rewards[_id] += rewardAmount;
rewardsPerUser[msg.sender] += rewardAmount;
totalPaidRewards += rewardAmount;
// advance the reward‐accrual cursor
s.lastClaimTime = block.timestamp;
stakingToken.safeTransfer(msg.sender, rewardAmount);
// no change to s.finished or tokenAmount — principal remains staked
emit ClaimedReward(_id, rewardAmount);
}
/**
* @dev Restake a finished or unlocked stake using the same staking type.
* Claims reward to user, restakes principal under identical terms.
* @param _id ID of the original stake to restake.
*/
function restakeStake(uint256 _id) external nonReentrant whenNotPaused {
Stake storage oldStake = stakes[_id];
require(isOpen, "Staking is not available");
require(!depositsPaused, "Deposits are paused");
require(!oldStake.finished, "Stake already withdrawn");
require(oldStake.user == msg.sender, "Not stake owner");
uint256 stakingType = oldStake.stakingType;
uint256 stakingDuration = block.timestamp - oldStake.startTime;
if (stakingType != 0) {
require(
stakingDuration > stakingPeriod[uint8(stakingType)],
"Stake is still locked"
);
}
uint256 principal = oldStake.tokenAmount;
uint256 rewardAmount = calculateReward(_id);
uint256 contractBalance = stakingToken.balanceOf(address(this));
uint256 availableReward = contractBalance - totalAmountOfStakes;
uint256 paidReward = rewardAmount <= availableReward ? rewardAmount : availableReward;
// === STATE CHANGES FIRST ===
oldStake.finished = true;
oldStake.tokenAmount = 0;
totalAmountOfStakes -= principal;
userTotalScore[msg.sender] -= oldStake.score;
emit UserScoreUpdated(msg.sender, userTotalScore[msg.sender]);
if (paidReward > 0) {
rewards[_id] += paidReward;
rewardsPerUser[msg.sender] += paidReward;
totalPaidRewards += paidReward;
}
uint256 newId = _nextStakeId++;
stakes[newId] = Stake({
tokenAmount: principal,
startTime: block.timestamp,
lastClaimTime: block.timestamp,
stakingType: stakingType,
score: _calculateStakeScore(principal, stakingType),
user: msg.sender,
id: newId,
finished: false
});
stakesByOwner[msg.sender].push(newId);
totalAmountOfStakes += principal;
userTotalScore[msg.sender] += stakes[newId].score;
emit UserScoreUpdated(msg.sender, userTotalScore[msg.sender]);
emit Deposit(msg.sender, principal, stakingType);
emit RestakedStake(_id, newId, stakingType, paidReward);
// === TRANSFER AFTER STATE ===
if (paidReward > 0) {
stakingToken.safeTransfer(msg.sender, paidReward);
emit ClaimedReward(_id, paidReward);
}
}
/**
* @dev Returns the list of stake IDs owned by a specific address.
* @param _owner Address of the staker.
* @return Array of stake IDs.
*/
function getStakeIdsByOwner(
address _owner
) public view returns (uint256[] memory) {
return stakesByOwner[_owner];
}
/**
* @dev Calculates the reward for a specific stake.
* @param _id ID of the stake.
* @return Reward amount.
*/
function calculateReward(uint256 _id) public view returns (uint256) {
Stake storage stake = stakes[_id];
if (stake.finished) return 0;
uint256 highAPRTime = stake.startTime + stakingPeriod[uint8(stake.stakingType)];
if(block.timestamp > highAPRTime) {
if(highAPRTime > stake.lastClaimTime) {
uint256 lockedReward = (stake.tokenAmount *
(highAPRTime - stake.lastClaimTime) *
stakingAPR[uint8(stake.stakingType)]) / (365 days * BASE);
uint256 flexReward = (stake.tokenAmount *
(block.timestamp - highAPRTime) *
stakingAPR[0]) / (365 days * BASE);
return lockedReward + flexReward;
} else {
return (stake.tokenAmount *
(block.timestamp - stake.lastClaimTime) *
stakingAPR[0]) / (365 days * BASE);
}
} else {
return (stake.tokenAmount *
(block.timestamp - stake.lastClaimTime) *
stakingAPR[uint8(stake.stakingType)]) / (365 days * BASE);
}
}
/**
* @dev Returns the total number of stakes in the contract.
* @return Total number of stakes.
* @notice How many stakes have ever been created
*/
function getTotalStakes() public view returns (uint256) {
return _nextStakeId;
}
/**
* @dev Returns the details of a specific stake.
* @param _id ID of the stake.
* @return Stake details.
*/
function getStakeDetails(uint256 _id) public view returns (Stake memory) {
return stakes[_id];
}
/**
* @dev Returns the total stake score for a specific user.
* @param _owner Address of the user to calculate score for.
* @return The calculated total score based on user's stakes.
*/
function getTotalScore(address _owner) public view returns (uint256) {
return userTotalScore[_owner];
}
/**
* @dev Calculates the total score for a user based on their active stakes at a specific block
* @param _owner Address of the user to calculate score for
* @return The calculated total score based on user's active stakes
* @notice This function is intended for off-chain snapshot purposes only and may be gas-intensive
*/
function getCalculatedTotalScore(address _owner) public view returns (uint256) {
uint256 totalScore = 0;
uint256[] memory userStakeIds = stakesByOwner[_owner];
for (uint256 i = 0; i < userStakeIds.length; i++) {
Stake memory stake = stakes[userStakeIds[i]];
// Only include active stakes in the calculation
if (!stake.finished && block.timestamp - stake.startTime < stakingPeriod[uint8(stake.stakingType)] && stake.tokenAmount > 0) {
totalScore += _calculateStakeScore(stake.tokenAmount, stake.stakingType);
}
}
return totalScore;
}
/**
* @dev Determines the tier level for a given owner based on their total score
* @param _owner The address of the owner to check the tier for
* @return tier The tier level (1-5) that the owner qualifies for
* @notice The tier is determined by comparing the owner's total score against predefined tier thresholds
* @notice Tier levels range from 1 to 5, with 5 being the highest
* @notice The owner's tier is the highest level where their score meets or exceeds the tier's threshold
*/
function getTierByOwner(address _owner) public view returns (uint8) {
uint256 totalScore = getTotalScore(_owner);
for (uint8 i = maxStakingTypes; i > 0; i--) {
uint8 tierIndex = i - 1;
if (totalScore >= tierScore[tierIndex]) {
return i; // Return the highest tier the user qualifies for
}
}
return 0; // No tier qualified (rare case if tierScore[0] > 0)
}
/**
* @dev Sets the score required for a specific tier level.
* @param _tier The tier level to set score.
* @param _score The score value to set for the tier.
* @notice Only callable by contract owner.
*/
function setTierScore(
uint8 _tier,
uint256 _score
) external onlyOwner nonReentrant whenNotPaused {
require(_tier < maxStakingTypes, "Invalid tier");
uint256 oldScore = tierScore[_tier];
tierScore[_tier] = _score;
emit TierScoreSet(_tier, oldScore, _score);
}
/**
* @dev Sets the base score value used in total score calculations.
* @param _newValue The new base score value to use.
* @notice Only callable by contract owner.
*/
function setBaseScoreValue(
uint256 _newValue
) external onlyOwner nonReentrant whenNotPaused {
uint256 oldValue = BASE_SCORE_VALUE;
BASE_SCORE_VALUE = _newValue;
emit BaseScoreValueSet(oldValue, _newValue);
}
/**
* @dev Change the lock period for a given staking type
* @param tier The tier level to change the lock period for
* @param seconds_ The new lock period in seconds
* @notice Only callable by contract owner
*/
function setStakingPeriod(
uint8 tier,
uint256 seconds_
) external onlyOwner nonReentrant whenNotPaused {
require(tier < maxStakingTypes, "Invalid tier");
uint256 oldPeriod = stakingPeriod[tier];
stakingPeriod[tier] = seconds_;
emit StakingPeriodSet(tier, oldPeriod, seconds_);
}
/**
* @dev Change the APR for a given staking type
* @param tier The tier level to change the APR for
* @param apr_ The new APR in basis points
* @notice Only callable by contract owner
*/
function setStakingAPR(
uint8 tier,
uint256 apr_
) external onlyOwner nonReentrant whenNotPaused {
require(tier < maxStakingTypes, "Invalid tier");
uint256 oldAPR = stakingAPR[tier];
stakingAPR[tier] = apr_;
emit StakingAPRSet(tier, oldAPR, apr_);
}
/**
* @dev Change the score multiplier for a given staking type
* @param tier The tier level to change the score multiplier for
* @param mult_ The new score multiplier
* @notice Only callable by contract owner
*/
function setStakingMultiplier(
uint8 tier,
uint256 mult_
) external onlyOwner nonReentrant whenNotPaused {
require(tier < maxStakingTypes, "Invalid tier");
uint256 oldMultiplier = stakingMultiplier[tier];
stakingMultiplier[tier] = mult_;
emit StakingMultiplierSet(tier, oldMultiplier, mult_);
}
/**
* @notice Allows the owner to set the maximum number of staking types/tiers.
* @param _newMaxTypes The new maximum number of staking types.
*/
function setMaxStakingTypes(
uint8 _newMaxTypes
) external onlyOwner nonReentrant whenNotPaused {
uint8 oldMaxTypes = maxStakingTypes;
maxStakingTypes = _newMaxTypes;
emit MaxStakingTypesSet(oldMaxTypes, _newMaxTypes);
}
function setDepositsPaused(bool _paused) external onlyOwner {
bool oldStatus = depositsPaused;
depositsPaused = _paused;
emit DepositsPausedSet(oldStatus, _paused);
}
/**
* @notice Pause all stake-related activity in the contract.
* @dev Only callable by the contract owner.
*/
function pause() external onlyOwner {
_pause();
}
/**
* @notice Unpause all stake-related activity in the contract.
* @dev Only callable by the contract owner.
*/
function unpause() external onlyOwner {
_unpause();
}
// This gap is used to reserve storage slots for future upgrades
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.8.3._
*/
interface IERC1967Upgradeable {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import {Initializable} from "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
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 proxied contracts do not make use of 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.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* 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 {ERC1967Proxy-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.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import {Initializable} from "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeTo(address newImplementation) public virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/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 onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
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());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/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 onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20PermitUpgradeable {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../extensions/IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20Upgradeable {
using AddressUpgradeable for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20PermitUpgradeable token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/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");
(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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/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 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 onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}{
"optimizer": {
"enabled": true,
"runs": 100
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldBaseScoreValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBaseScoreValue","type":"uint256"}],"name":"BaseScoreValueSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"ClaimedReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakingType","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"oldStatus","type":"bool"},{"indexed":false,"internalType":"bool","name":"newStatus","type":"bool"}],"name":"DepositsPausedSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"oldMaxTypes","type":"uint8"},{"indexed":false,"internalType":"uint8","name":"newMaxTypes","type":"uint8"}],"name":"MaxStakingTypesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"oldId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakingType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPaid","type":"uint256"}],"name":"RestakedStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"oldAPR","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAPR","type":"uint256"}],"name":"StakingAPRSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"oldMultiplier","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newMultiplier","type":"uint256"}],"name":"StakingMultiplierSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"oldPeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPeriod","type":"uint256"}],"name":"StakingPeriodSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"oldScore","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newScore","type":"uint256"}],"name":"TierScoreSet","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":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"score","type":"uint256"}],"name":"UserScoreUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BASE_SCORE_VALUE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"calculateReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositsPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getCalculatedTotalScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getStakeDetails","outputs":[{"components":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"},{"internalType":"uint256","name":"stakingType","type":"uint256"},{"internalType":"uint256","name":"score","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"finished","type":"bool"}],"internalType":"struct Staking.Stake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getStakeIdsByOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getTierByOwner","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"getTotalScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"uint256","name":"initialBalance","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxStakingTypes","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"restakeStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newValue","type":"uint256"}],"name":"setBaseScoreValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setDepositsPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_newMaxTypes","type":"uint8"}],"name":"setMaxStakingTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"uint256","name":"apr_","type":"uint256"}],"name":"setStakingAPR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"uint256","name":"mult_","type":"uint256"}],"name":"setStakingMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"tier","type":"uint8"},{"internalType":"uint256","name":"seconds_","type":"uint256"}],"name":"setStakingPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_tier","type":"uint8"},{"internalType":"uint256","name":"_score","type":"uint256"}],"name":"setTierScore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_stakingType","type":"uint256"}],"name":"stakeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakes","outputs":[{"internalType":"uint256","name":"tokenAmount","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"},{"internalType":"uint256","name":"stakingType","type":"uint256"},{"internalType":"uint256","name":"score","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"finished","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakesByOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"stakingAPR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"stakingMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"stakingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"contract IERC20MetadataUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"tierScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountOfStakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPaidRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userTotalScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a080604052346100dd57306080526000549060ff8260081c1661008b575060ff80821603610050575b604051612ef79081620000e382396080518181816111280152818161127e01526118280152f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a138610029565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c9081630ae26f8c146123bd575080631679b4471461232b57806318e4c2ea146122765780631c481e2d146122075780631ed3060414611da457806323d5521b14611d4b57806325d5971f14611a565780632af49d8c146119ec5780633659cfe6146118045780633b7b6188146115965780633b97e856146115775780633f4ba83a146114e357806347535d7b146114bf5780634f1ef2861461120257806351355389146111d457806352d1902d1461111557806355f6b7d3146110f65780635c975abb146110d357806360da3e83146110af5780636355e1fd1461101d578063663c91b214610f8b57806368c3362714610f6c578063715018a614610f0f57806372f702f314610ee557806378a406df14610eb0578063839ae6b914610e915780638456cb5914610e375780638da5cb5b14610e0e578063963c9dd314610d0357806398c1dab514610cc8578063a93d28e814610c36578063ae169a5014610a09578063b2e3fe851461088f578063c9b4088b1461085a578063cd1610b7146107de578063cd6dc68714610468578063d0023fcb146103f8578063d097705214610433578063d283b3c5146103f8578063d2d7231f146103d2578063d5a44f861461034b578063e5587f8e1461032c578063ec342ad01461030f578063f2fde38b14610280578063f301af42146102535763fda098181461021957600080fd5b3461024e57602036600319011261024e5760ff6102346123dc565b166000526101386020526020604060002054604051908152f35b600080fd5b3461024e57602036600319011261024e576004356000526101366020526020604060002054604051908152f35b3461024e57602036600319011261024e576102996123ec565b6102a16128f3565b6001600160a01b038116156102bb576102b990612b3c565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b3461024e57600036600319011261024e5760206040516103e88152f35b3461024e57600036600319011261024e57602061013a54604051908152f35b3461024e57602036600319011261024e5760043560005261013260205261010060406000208054906001810154906002810154600382015460048301549060018060a01b036005850154169260ff600760068701549601541695604051978852602088015260408701526060860152608085015260a084015260c0830152151560e0820152f35b3461024e57602036600319011261024e5760206103f06004356127d2565b604051908152f35b3461024e57602036600319011261024e576001600160a01b036104196123ec565b166000526101346020526020604060002054604051908152f35b3461024e57602036600319011261024e5760ff61044e6123dc565b1660005261012f6020526020604060002054604051908152f35b3461024e57604036600319011261024e576104816123ec565b6024359060005460ff90818160081c1615918280936107d2575b80156107bc575b156107605760019460ff199284878583161760005561074e575b506104d68260005460081c166104d181612b85565b612b85565b6104df33612b3c565b6105128260005460081c166104f381612b85565b6104fc81612b85565b8760655561050981612b85565b6104d181612b85565b609780548416905561013980548416600517905561012d80546001600160a01b0319166001600160a01b03968716908117825560405163313ce56760e01b81526020979294918890829060049082905afa9081156107425760009161070c575b501661012e55600061013a556000805261012f8652600060408120558660005262278d0060406000205560026000526276a700604060002055600360005262ed4e0060406000205560046000526301da9c00604060002055600080526101308652601e60406000205586600052602a6040600020556002600052603c6040600020556003600052605a6040600020556004600052609660406000205560008052610131865260006040812055866000526103e860406000205560026000526105dc60406000205560036000526108986040600020556004600052610fa06040600020556000805261013886526000604081205586600052620186a060406000205560026000526207a1206040600020556003600052621e84806040600020556004600052624c4b406040600020558661013d55816106f5575b5050508361013b918254161790556106bf57005b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001960005416600055604051908152a1005b61070492541630903390612ae4565b8480806106ab565b90508781813d831161073b575b6107238183612467565b8101031261024e5751818116810361024e5789610572565b503d610719565b6040513d6000823e3d90fd5b61ffff191661010117600055866104bc565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156104a257506001818316146104a2565b5060018183161061049b565b3461024e57602036600319011261024e577f0a24a08bbadb0ba389b37fdf6de4446dee9c0e28db7a1ee4c3f64d7ad7991f8b604061081a6123dc565b6108226128f3565b61082a61294b565b6108326129a1565b61013960ff81549216908160ff19841617905560ff8351921682526020820152a16001606555005b3461024e57602036600319011261024e5760ff6108756123dc565b166000526101306020526020604060002054604051908152f35b3461024e5760208060031936011261024e576108a96123ec565b6001600160a01b0390811660009081526101338352604080822090518154808252918352848320909291839081870190845b888282106109f3575050506108f292500383612467565b60005b82518110156109e95760058582821b85010151600052610132865260406000206040519061092282612430565b805482526007600182015491828a850152600281015460408501528860038201549560608601968752600483015460808701528201541660a0850152600681015460c085015260ff9182910154161591821560e0850152826109c3575b5050806109b9575b610996575b50506001016108f5565b926109ab6109b19260019495519051906129e5565b9061260e565b91908661098c565b5080511515610987565b6109cf919250426125eb565b9083511660005261012f885260406000205411888061097f565b8482604051908152f35b85548452600195860195889550930192016108db565b3461024e5760208060031936011261024e5760043590610a2761294b565b610a2f6129a1565b816000526101328152604060002060ff600782015416610bfd5760058101546001600160a01b039190610a6590831633146125ad565b610a6e846127d2565b918215610bc15761012d9160248583855416604051928380926370a0823160e01b82523060048301525afa8015610742578591600091610b8e575b5061013a54610ab7916125eb565b10610b4957928092610b3b927fee6506d5828b4bc76049d47a6c350c20c54df3f0338309504a1ba58ac4ef112796958860005261013687526040600020610aff85825461260e565b90553360005261013787526040600020610b1a85825461260e565b905561013c610b2a85825461260e565b905560024291015533915416612a93565b604051908152a26001606555005b60405162461bcd60e51b815260048101869052601d60248201527f496e73756666696369656e7420726577617264206c69717569646974790000006044820152606490fd5b809250878092503d8311610bba575b610ba78183612467565b8101031261024e57518490610ab7610aa9565b503d610b9d565b60405162461bcd60e51b81526004810185905260146024820152734e6f207265776172647320617661696c61626c6560601b6044820152606490fd5b60405162461bcd60e51b815260048101839052601160248201527020b63932b0b23c903bb4ba34323930bbb760791b6044820152606490fd5b3461024e57604036600319011261024e57610c4f6123dc565b7fd95e07adf567935c4df08f53c1ba94ddeb7b2833e8f7b63cce93fba10d1929fd6040602435610c7d6128f3565b610c8561294b565b610c8d6129a1565b610ca260ff80610139541695169485106124a3565b8360005261012f6020528160002090808254925582519182526020820152a26001606555005b3461024e57602036600319011261024e576001600160a01b03610ce96123ec565b166000526101376020526020604060002054604051908152f35b3461024e57602036600319011261024e57600060e0604051610d2481612430565b8281528260208201528260408201528260608201528260808201528260a08201528260c082015201526004356000526101326020526101006040600020604051610d6d81612430565b815491828252600181015460208301908152600282015490604084019182526003830154606085019081526004840154906080860191825260018060a01b0393846005870154169360a0880194855260e060ff600760068a01549960c08c019a8b5201541698019715158852604051988952516020890152516040880152516060870152516080860152511660a08401525160c083015251151560e0820152f35b3461024e57600036600319011261024e576033546040516001600160a01b039091168152602090f35b3461024e57600036600319011261024e57610e506128f3565b610e586129a1565b600160ff1960975416176097557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b3461024e57600036600319011261024e57602061013d54604051908152f35b3461024e57602036600319011261024e5760ff610ecb6123dc565b166000526101316020526020604060002054604051908152f35b3461024e57600036600319011261024e5761012d546040516001600160a01b039091168152602090f35b3461024e57600036600319011261024e57610f286128f3565b603380546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461024e57600036600319011261024e57602061013554604051908152f35b3461024e57604036600319011261024e57610fa46123dc565b7f2eab0f61f32931a2c9335c7fcaeb0d08bd85bd1b5c1759c7b21a54b9323cc18d6040602435610fd26128f3565b610fda61294b565b610fe26129a1565b610ff760ff80610139541695169485106124a3565b836000526101306020528160002090808254925582519182526020820152a26001606555005b3461024e57604036600319011261024e576110366123dc565b7f09364a0a144eb54a5d709374baabb4496be3c2e93e973590d6745d9f8544a9a660406024356110646128f3565b61106c61294b565b6110746129a1565b61108960ff80610139541695169485106124a3565b836000526101316020528160002090808254925582519182526020820152a26001606555005b3461024e57600036600319011261024e57602060ff61013e54166040519015158152f35b3461024e57600036600319011261024e57602060ff609754166040519015158152f35b3461024e57600036600319011261024e57602061013c54604051908152f35b3461024e57600036600319011261024e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361116e576020604051600080516020612e828339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608490fd5b3461024e57602036600319011261024e5760206111f76111f26123ec565b612721565b60ff60405191168152f35b604036600319011261024e576112166123ec565b602435906001600160401b03821161024e573660238301121561024e57816004013561124181612488565b9261124f6040519485612467565b81845260209182850191366024838301011161024e578160009260248693018537860101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116906112ac3083141561265f565b6112c9600080516020612e828339815191529282845416146126c0565b6112d16128f3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561130957505050506102b99150612ced565b84939416906040516352d1902d60e01b81528581600481865afa60009181611490575b5061138d5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b036114395761139b83612ced565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2835115801590611431575b6113d157005b600080916102b9957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c604051966114078861244c565b60278852870152660819985a5b195960ca1b60408701525190845af461142b612d7d565b91612dad565b5060016113cb565b60405162461bcd60e51b815260048101859052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d83116114b8575b6114a88183612467565b8101031261024e5751908861132c565b503d61149e565b3461024e57600036600319011261024e57602060ff61013b54166040519015158152f35b3461024e57600036600319011261024e576114fc6128f3565b60975460ff81161561153b5760ff19166097557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b3461024e57600036600319011261024e57602061012e54604051908152f35b3461024e57604036600319011261024e576004356024356115b561294b565b6115bd6129a1565b6115cc60ff61013b54166124de565b6115dc60ff61013e541615612525565b81156117c75760ff610139541681101561178b576101358054906115ff8261261b565b905561160b82846129e5565b926040519261161984612430565b8184526020948585019442865260408101428152606082018481526080830193845260a083019333855260c084019188835260e085019360008552896000526101329a8b8d5260406000209651875551600187015551600286015551600385015551600484015560058301600160a01b6001900380955116600160a01b600190031982541617905551600683015551151590600701906116c4919060ff801983541691151516179055565b61012d54168230336116d593612ae4565b6040519082825285820152339060407f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1591a2336000526101338452816040600020906117209161262a565b61013a908154906117309161260e565b90556000528152604060002060040154336000526101349081835260406000209081549061175d9161260e565b90553360005281526040600020546040519081523391600080516020612ea283398151915291a26001606555005b60405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207374616b696e67207479706560601b6044820152606490fd5b60405162461bcd60e51b815260206004820152601560248201527443616e6e6f74207374616b65203020746f6b656e7360581b6044820152606490fd5b3461024e5760208060031936011261024e5761181e6123ec565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692906118573085141561265f565b611874600080516020612e828339815191529482865416146126c0565b61187c6128f3565b60405193828501918583106001600160401b038411176119d657826040526000865260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354166000146118d857505050506102b99150612ced565b84939416906040516352d1902d60e01b81528581600481865afa600091816119a7575b5061195c5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b036114395761196a83612ced565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a283511580159061199f576113d157005b5060006113cb565b9091508681813d83116119cf575b6119bf8183612467565b8101031261024e575190886118fb565b503d6119b5565b634e487b7160e01b600052604160045260246000fd5b3461024e57602036600319011261024e577fa4f02d62df0d68b842df3f4772a1a0c463be2b6da9ce92361b0403542b4a8f6b6040600435611a2b6128f3565b611a3361294b565b611a3b6129a1565b61013d90808254925582519182526020820152a16001606555005b3461024e5760208060031936011261024e57600435611a7361294b565b611a7b6129a1565b80600052610132825260406000206007810191611a9c60ff84541615612567565b60058201805490916001600160a01b039182163303611d1057611ac36001850154426125eb565b600385015480611cb3575b5050611ad9816127d2565b602461012d918885845416604051938480926370a0823160e01b82523060048301525afa91821561074257600092611c84575b5061013a91825490818110611c3f5788611bdd88600080516020612ea283398151915299978e999760009e9f967f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c898611b6b611bc692611be4996125eb565b808211611c375750955b60008b90526101368952600060409020611b9088825461260e565b9055336000526101378952600060409020611bac88825461260e565b905561013c611bbc88825461260e565b90555482546125eb565b90555416611bd5838d5461260e565b903390612a93565b895461260e565b604051908152a260048501549381815416875261013494858452611c0d604089209182546125eb565b905554169283865281526040852054604051908152a255805460ff19166001908117909155606555005b905095611b75565b60405162461bcd60e51b8152600481018c9052601e60248201527f496e73756666696369656e74207072696e636970616c2062616c616e636500006044820152606490fd5b9091508881813d8311611cac575b611c9c8183612467565b8101031261024e57519089611b0c565b503d611c92565b60ff1660005261012f87526040600020541015611cd1578680611ace565b60405162461bcd60e51b8152600481018790526017602482015276131bd8dac81c195c9a5bd9081b9bdd081c995858da1959604a1b6044820152606490fd5b60405162461bcd60e51b81526004810187905260136024820152722737ba103a34329039ba30b5b29037bbb732b960691b6044820152606490fd5b3461024e57604036600319011261024e57611d646123ec565b6001600160a01b03166000908152610133602052604090208054602435919082101561024e57602091611d9691612402565b90546040519160031b1c8152f35b3461024e57602036600319011261024e57611dbd61294b565b611dc56129a1565b6004356000526101326020526040600020611de560ff61013b54166124de565b611df560ff61013e541615612525565b600781015490611e0860ff831615612567565b611e1f60018060a01b0360058301541633146125ad565b6003810154611e326001830154426125eb565b816121ab575b50815491611e476004356127d2565b61012d546040516370a0823160e01b815230600482015291929190602090829060249082906001600160a01b03165afa90811561074257600091612178575b50600492611e9a60019261013a54906125eb565b8082116121705750955b60ff191617600782015560008155611ebf8461013a546125eb565b61013a55015433600052610134602052611edf60406000209182546125eb565b905533600052610134602052604060002054604051908152600080516020612ea283398151915260203392a282612121575b6101355491611f1f8361261b565b61013555611fde611f3083836129e5565b600760405191611f3f83612430565b8483526020830190428252604084019042825260608501908882526080860190815260a086019133835260c08701938b855260e0880195600087528c600052610132602052604060002098518955516001890155516002880155516003870155516004860155600585019060018060a01b0390511660018060a01b031982541617905551600684015551151591019060ff801983541691151516179055565b33600052610133602052611ff683604060002061262a565b6120038161013a5461260e565b61013a558260005261013260205260046040600020015433600052610134602052612034604060002091825461260e565b905533600052610134602052604060002054604051908152600080516020612ea283398151915260203392a26040519081528160208201527f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1560403392a26040519081528260208201527f5d486f88d95c44dd8a2350103dbba141248082fcd3b6c213898359b2b9792840604060043592a3806120d3575b6001606555005b61012d546120ed90829033906001600160a01b0316612a93565b6040519081527fee6506d5828b4bc76049d47a6c350c20c54df3f0338309504a1ba58ac4ef1127602060043592a2806120cc565b600435600052610136602052604060002061213d84825461260e565b905533600052610137602052604060002061215984825461260e565b905561013c61216984825461260e565b9055611f11565b905095611ea4565b90506020813d6020116121a3575b8161219360209383612467565b8101031261024e57516004611e86565b3d9150612186565b60ff821660005261012f60205260406000205410156121ca5783611e38565b60405162461bcd60e51b815260206004820152601560248201527414dd185ad9481a5cc81cdd1a5b1b081b1bd8dad959605a1b6044820152606490fd5b3461024e57602036600319011261024e5760043580151580910361024e5760407f2ea5a697b1bb16f60c3f17227bb5824cbf6f4b56d2024b6cf143f6e05e9bb51a916122516128f3565b61013e9081549160ff821660ff19841617905560ff83519216151582526020820152a1005b3461024e5760208060031936011261024e576001600160a01b036122986123ec565b166000526101338152604060002060405190818382549182815201908192600052846000209060005b868282106123175786866122d782880383612467565b604051928392818401908285525180915260408401929160005b82811061230057505050500390f35b8351855286955093810193928101926001016122f1565b8354855290930192600192830192016122c1565b3461024e57604036600319011261024e576123446123dc565b7f9a26ff4dbaff219d0dea5912fcac808f6ca57bb578f425939826c4291d24c53c60406024356123726128f3565b61237a61294b565b6123826129a1565b61239760ff80610139541695169485106124a3565b836000526101386020528160002090808254925582519182526020820152a26001606555005b3461024e57600036600319011261024e5760209060ff61013954168152f35b6004359060ff8216820361024e57565b600435906001600160a01b038216820361024e57565b805482101561241a5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b61010081019081106001600160401b038211176119d657604052565b606081019081106001600160401b038211176119d657604052565b90601f801991011681019081106001600160401b038211176119d657604052565b6001600160401b0381116119d657601f01601f191660200190565b156124aa57565b60405162461bcd60e51b815260206004820152600c60248201526b24b73b30b634b2103a34b2b960a11b6044820152606490fd5b156124e557565b60405162461bcd60e51b81526020600482015260186024820152775374616b696e67206973206e6f7420617661696c61626c6560401b6044820152606490fd5b1561252c57565b60405162461bcd60e51b815260206004820152601360248201527211195c1bdcda5d1cc8185c99481c185d5cd959606a1b6044820152606490fd5b1561256e57565b60405162461bcd60e51b815260206004820152601760248201527629ba30b5b29030b63932b0b23c903bb4ba34323930bbb760491b6044820152606490fd5b156125b457565b60405162461bcd60e51b815260206004820152600f60248201526e2737ba1039ba30b5b29037bbb732b960891b6044820152606490fd5b919082039182116125f857565b634e487b7160e01b600052601160045260246000fd5b919082018092116125f857565b60001981146125f85760010190565b8054600160401b8110156119d65761264791600182018155612402565b819291549060031b91821b91600019901b1916179055565b1561266657565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b156126c757565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b9060009160018060a01b031682526020610134602052604091604084205460ff9360ff61013954165b85811680156127b557600019018681116127a157861687526101388552818720548310156127975785168015612783576000190161274a565b634e487b7160e01b87526011600452602487fd5b9450505092505090565b634e487b7160e01b88526011600452602488fd5b5092945050505050565b818102929181159184041417156125f857565b6000908152602061013281526040908183209160ff6007840154166128ed5760018301549361281560ff6003860154169586835261012f8552838320549061260e565b938442116000146128bd576002810154908186111561289957916128969661288261288f959361285461284e612874999754928b6125eb565b826127bf565b92845261287c61013093848852640757b12c00998a9188882054906127bf565b0499426125eb565b906127bf565b93828052522054906127bf565b049061260e565b90565b640757b12c0096506128b995506101309161287c612882925491426125eb565b0490565b6128b99450640757b12c0095936128e18261287c60026101309554920154426125eb565b948352522054906127bf565b50505090565b6033546001600160a01b0316330361290757565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60026065541461295c576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60ff609754166129ad57565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b81158015612a83575b8015612a69575b612a625761012e54604d81116125f857600a0a916103e892808402938404036125f857612a429160ff612a389216600052610131602052604060002054906127bf565b61013d54906127bf565b8115612a4c570490565b634e487b7160e01b600052601260045260246000fd5b5050600090565b5060ff8216600052610131602052604060002054156129f5565b5060ff61013954168210156129ee565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b038311828410176119d657612ae292604052612be5565b565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b038411176119d657612ae292604052612be5565b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b15612b8c57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60018060a01b03169060405160408101908082106001600160401b038311176119d657612c50916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af161142b612d7d565b805191821591848315612cc2575b505050905015612c6b5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b919381809450010312612ce957820151908115158203612ce6575080388084612c5e565b80fd5b5080fd5b803b15612d2257600080516020612e8283398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d15612da8573d90612d8e82612488565b91612d9c6040519384612467565b82523d6000602084013e565b606090565b91929015612e0f5750815115612dc1575090565b3b15612dca5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612e225750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510612e68575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350612e4556fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcd1683cfe840da55fcea98a1deff73cde45e40f76950db36ea1b647706f16e0f5a264697066735822122042e5aedfae0f4ea517d6cbd11dd19211847e61eb5545d01fd60ab0483cf71be864736f6c63430008180033
Deployed Bytecode
0x608080604052600436101561001357600080fd5b60003560e01c9081630ae26f8c146123bd575080631679b4471461232b57806318e4c2ea146122765780631c481e2d146122075780631ed3060414611da457806323d5521b14611d4b57806325d5971f14611a565780632af49d8c146119ec5780633659cfe6146118045780633b7b6188146115965780633b97e856146115775780633f4ba83a146114e357806347535d7b146114bf5780634f1ef2861461120257806351355389146111d457806352d1902d1461111557806355f6b7d3146110f65780635c975abb146110d357806360da3e83146110af5780636355e1fd1461101d578063663c91b214610f8b57806368c3362714610f6c578063715018a614610f0f57806372f702f314610ee557806378a406df14610eb0578063839ae6b914610e915780638456cb5914610e375780638da5cb5b14610e0e578063963c9dd314610d0357806398c1dab514610cc8578063a93d28e814610c36578063ae169a5014610a09578063b2e3fe851461088f578063c9b4088b1461085a578063cd1610b7146107de578063cd6dc68714610468578063d0023fcb146103f8578063d097705214610433578063d283b3c5146103f8578063d2d7231f146103d2578063d5a44f861461034b578063e5587f8e1461032c578063ec342ad01461030f578063f2fde38b14610280578063f301af42146102535763fda098181461021957600080fd5b3461024e57602036600319011261024e5760ff6102346123dc565b166000526101386020526020604060002054604051908152f35b600080fd5b3461024e57602036600319011261024e576004356000526101366020526020604060002054604051908152f35b3461024e57602036600319011261024e576102996123ec565b6102a16128f3565b6001600160a01b038116156102bb576102b990612b3c565b005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b3461024e57600036600319011261024e5760206040516103e88152f35b3461024e57600036600319011261024e57602061013a54604051908152f35b3461024e57602036600319011261024e5760043560005261013260205261010060406000208054906001810154906002810154600382015460048301549060018060a01b036005850154169260ff600760068701549601541695604051978852602088015260408701526060860152608085015260a084015260c0830152151560e0820152f35b3461024e57602036600319011261024e5760206103f06004356127d2565b604051908152f35b3461024e57602036600319011261024e576001600160a01b036104196123ec565b166000526101346020526020604060002054604051908152f35b3461024e57602036600319011261024e5760ff61044e6123dc565b1660005261012f6020526020604060002054604051908152f35b3461024e57604036600319011261024e576104816123ec565b6024359060005460ff90818160081c1615918280936107d2575b80156107bc575b156107605760019460ff199284878583161760005561074e575b506104d68260005460081c166104d181612b85565b612b85565b6104df33612b3c565b6105128260005460081c166104f381612b85565b6104fc81612b85565b8760655561050981612b85565b6104d181612b85565b609780548416905561013980548416600517905561012d80546001600160a01b0319166001600160a01b03968716908117825560405163313ce56760e01b81526020979294918890829060049082905afa9081156107425760009161070c575b501661012e55600061013a556000805261012f8652600060408120558660005262278d0060406000205560026000526276a700604060002055600360005262ed4e0060406000205560046000526301da9c00604060002055600080526101308652601e60406000205586600052602a6040600020556002600052603c6040600020556003600052605a6040600020556004600052609660406000205560008052610131865260006040812055866000526103e860406000205560026000526105dc60406000205560036000526108986040600020556004600052610fa06040600020556000805261013886526000604081205586600052620186a060406000205560026000526207a1206040600020556003600052621e84806040600020556004600052624c4b406040600020558661013d55816106f5575b5050508361013b918254161790556106bf57005b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001960005416600055604051908152a1005b61070492541630903390612ae4565b8480806106ab565b90508781813d831161073b575b6107238183612467565b8101031261024e5751818116810361024e5789610572565b503d610719565b6040513d6000823e3d90fd5b61ffff191661010117600055866104bc565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156104a257506001818316146104a2565b5060018183161061049b565b3461024e57602036600319011261024e577f0a24a08bbadb0ba389b37fdf6de4446dee9c0e28db7a1ee4c3f64d7ad7991f8b604061081a6123dc565b6108226128f3565b61082a61294b565b6108326129a1565b61013960ff81549216908160ff19841617905560ff8351921682526020820152a16001606555005b3461024e57602036600319011261024e5760ff6108756123dc565b166000526101306020526020604060002054604051908152f35b3461024e5760208060031936011261024e576108a96123ec565b6001600160a01b0390811660009081526101338352604080822090518154808252918352848320909291839081870190845b888282106109f3575050506108f292500383612467565b60005b82518110156109e95760058582821b85010151600052610132865260406000206040519061092282612430565b805482526007600182015491828a850152600281015460408501528860038201549560608601968752600483015460808701528201541660a0850152600681015460c085015260ff9182910154161591821560e0850152826109c3575b5050806109b9575b610996575b50506001016108f5565b926109ab6109b19260019495519051906129e5565b9061260e565b91908661098c565b5080511515610987565b6109cf919250426125eb565b9083511660005261012f885260406000205411888061097f565b8482604051908152f35b85548452600195860195889550930192016108db565b3461024e5760208060031936011261024e5760043590610a2761294b565b610a2f6129a1565b816000526101328152604060002060ff600782015416610bfd5760058101546001600160a01b039190610a6590831633146125ad565b610a6e846127d2565b918215610bc15761012d9160248583855416604051928380926370a0823160e01b82523060048301525afa8015610742578591600091610b8e575b5061013a54610ab7916125eb565b10610b4957928092610b3b927fee6506d5828b4bc76049d47a6c350c20c54df3f0338309504a1ba58ac4ef112796958860005261013687526040600020610aff85825461260e565b90553360005261013787526040600020610b1a85825461260e565b905561013c610b2a85825461260e565b905560024291015533915416612a93565b604051908152a26001606555005b60405162461bcd60e51b815260048101869052601d60248201527f496e73756666696369656e7420726577617264206c69717569646974790000006044820152606490fd5b809250878092503d8311610bba575b610ba78183612467565b8101031261024e57518490610ab7610aa9565b503d610b9d565b60405162461bcd60e51b81526004810185905260146024820152734e6f207265776172647320617661696c61626c6560601b6044820152606490fd5b60405162461bcd60e51b815260048101839052601160248201527020b63932b0b23c903bb4ba34323930bbb760791b6044820152606490fd5b3461024e57604036600319011261024e57610c4f6123dc565b7fd95e07adf567935c4df08f53c1ba94ddeb7b2833e8f7b63cce93fba10d1929fd6040602435610c7d6128f3565b610c8561294b565b610c8d6129a1565b610ca260ff80610139541695169485106124a3565b8360005261012f6020528160002090808254925582519182526020820152a26001606555005b3461024e57602036600319011261024e576001600160a01b03610ce96123ec565b166000526101376020526020604060002054604051908152f35b3461024e57602036600319011261024e57600060e0604051610d2481612430565b8281528260208201528260408201528260608201528260808201528260a08201528260c082015201526004356000526101326020526101006040600020604051610d6d81612430565b815491828252600181015460208301908152600282015490604084019182526003830154606085019081526004840154906080860191825260018060a01b0393846005870154169360a0880194855260e060ff600760068a01549960c08c019a8b5201541698019715158852604051988952516020890152516040880152516060870152516080860152511660a08401525160c083015251151560e0820152f35b3461024e57600036600319011261024e576033546040516001600160a01b039091168152602090f35b3461024e57600036600319011261024e57610e506128f3565b610e586129a1565b600160ff1960975416176097557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b3461024e57600036600319011261024e57602061013d54604051908152f35b3461024e57602036600319011261024e5760ff610ecb6123dc565b166000526101316020526020604060002054604051908152f35b3461024e57600036600319011261024e5761012d546040516001600160a01b039091168152602090f35b3461024e57600036600319011261024e57610f286128f3565b603380546001600160a01b031981169091556000906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461024e57600036600319011261024e57602061013554604051908152f35b3461024e57604036600319011261024e57610fa46123dc565b7f2eab0f61f32931a2c9335c7fcaeb0d08bd85bd1b5c1759c7b21a54b9323cc18d6040602435610fd26128f3565b610fda61294b565b610fe26129a1565b610ff760ff80610139541695169485106124a3565b836000526101306020528160002090808254925582519182526020820152a26001606555005b3461024e57604036600319011261024e576110366123dc565b7f09364a0a144eb54a5d709374baabb4496be3c2e93e973590d6745d9f8544a9a660406024356110646128f3565b61106c61294b565b6110746129a1565b61108960ff80610139541695169485106124a3565b836000526101316020528160002090808254925582519182526020820152a26001606555005b3461024e57600036600319011261024e57602060ff61013e54166040519015158152f35b3461024e57600036600319011261024e57602060ff609754166040519015158152f35b3461024e57600036600319011261024e57602061013c54604051908152f35b3461024e57600036600319011261024e577f0000000000000000000000007da6d2b18aefe5d832e099c9ec8344d64b256ba36001600160a01b0316300361116e576020604051600080516020612e828339815191528152f35b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608490fd5b3461024e57602036600319011261024e5760206111f76111f26123ec565b612721565b60ff60405191168152f35b604036600319011261024e576112166123ec565b602435906001600160401b03821161024e573660238301121561024e57816004013561124181612488565b9261124f6040519485612467565b81845260209182850191366024838301011161024e578160009260248693018537860101526001600160a01b037f0000000000000000000000007da6d2b18aefe5d832e099c9ec8344d64b256ba38116906112ac3083141561265f565b6112c9600080516020612e828339815191529282845416146126c0565b6112d16128f3565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561130957505050506102b99150612ced565b84939416906040516352d1902d60e01b81528581600481865afa60009181611490575b5061138d5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b036114395761139b83612ced565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2835115801590611431575b6113d157005b600080916102b9957f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c604051966114078861244c565b60278852870152660819985a5b195960ca1b60408701525190845af461142b612d7d565b91612dad565b5060016113cb565b60405162461bcd60e51b815260048101859052602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b9091508681813d83116114b8575b6114a88183612467565b8101031261024e5751908861132c565b503d61149e565b3461024e57600036600319011261024e57602060ff61013b54166040519015158152f35b3461024e57600036600319011261024e576114fc6128f3565b60975460ff81161561153b5760ff19166097557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b60405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606490fd5b3461024e57600036600319011261024e57602061012e54604051908152f35b3461024e57604036600319011261024e576004356024356115b561294b565b6115bd6129a1565b6115cc60ff61013b54166124de565b6115dc60ff61013e541615612525565b81156117c75760ff610139541681101561178b576101358054906115ff8261261b565b905561160b82846129e5565b926040519261161984612430565b8184526020948585019442865260408101428152606082018481526080830193845260a083019333855260c084019188835260e085019360008552896000526101329a8b8d5260406000209651875551600187015551600286015551600385015551600484015560058301600160a01b6001900380955116600160a01b600190031982541617905551600683015551151590600701906116c4919060ff801983541691151516179055565b61012d54168230336116d593612ae4565b6040519082825285820152339060407f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1591a2336000526101338452816040600020906117209161262a565b61013a908154906117309161260e565b90556000528152604060002060040154336000526101349081835260406000209081549061175d9161260e565b90553360005281526040600020546040519081523391600080516020612ea283398151915291a26001606555005b60405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207374616b696e67207479706560601b6044820152606490fd5b60405162461bcd60e51b815260206004820152601560248201527443616e6e6f74207374616b65203020746f6b656e7360581b6044820152606490fd5b3461024e5760208060031936011261024e5761181e6123ec565b6001600160a01b037f0000000000000000000000007da6d2b18aefe5d832e099c9ec8344d64b256ba3811692906118573085141561265f565b611874600080516020612e828339815191529482865416146126c0565b61187c6128f3565b60405193828501918583106001600160401b038411176119d657826040526000865260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354166000146118d857505050506102b99150612ced565b84939416906040516352d1902d60e01b81528581600481865afa600091816119a7575b5061195c5760405162461bcd60e51b815260048101879052602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b036114395761196a83612ced565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a283511580159061199f576113d157005b5060006113cb565b9091508681813d83116119cf575b6119bf8183612467565b8101031261024e575190886118fb565b503d6119b5565b634e487b7160e01b600052604160045260246000fd5b3461024e57602036600319011261024e577fa4f02d62df0d68b842df3f4772a1a0c463be2b6da9ce92361b0403542b4a8f6b6040600435611a2b6128f3565b611a3361294b565b611a3b6129a1565b61013d90808254925582519182526020820152a16001606555005b3461024e5760208060031936011261024e57600435611a7361294b565b611a7b6129a1565b80600052610132825260406000206007810191611a9c60ff84541615612567565b60058201805490916001600160a01b039182163303611d1057611ac36001850154426125eb565b600385015480611cb3575b5050611ad9816127d2565b602461012d918885845416604051938480926370a0823160e01b82523060048301525afa91821561074257600092611c84575b5061013a91825490818110611c3f5788611bdd88600080516020612ea283398151915299978e999760009e9f967f56ca301a9219608c91e7bcee90e083c19671d2cdcc96752c7af291cee5f9c8c898611b6b611bc692611be4996125eb565b808211611c375750955b60008b90526101368952600060409020611b9088825461260e565b9055336000526101378952600060409020611bac88825461260e565b905561013c611bbc88825461260e565b90555482546125eb565b90555416611bd5838d5461260e565b903390612a93565b895461260e565b604051908152a260048501549381815416875261013494858452611c0d604089209182546125eb565b905554169283865281526040852054604051908152a255805460ff19166001908117909155606555005b905095611b75565b60405162461bcd60e51b8152600481018c9052601e60248201527f496e73756666696369656e74207072696e636970616c2062616c616e636500006044820152606490fd5b9091508881813d8311611cac575b611c9c8183612467565b8101031261024e57519089611b0c565b503d611c92565b60ff1660005261012f87526040600020541015611cd1578680611ace565b60405162461bcd60e51b8152600481018790526017602482015276131bd8dac81c195c9a5bd9081b9bdd081c995858da1959604a1b6044820152606490fd5b60405162461bcd60e51b81526004810187905260136024820152722737ba103a34329039ba30b5b29037bbb732b960691b6044820152606490fd5b3461024e57604036600319011261024e57611d646123ec565b6001600160a01b03166000908152610133602052604090208054602435919082101561024e57602091611d9691612402565b90546040519160031b1c8152f35b3461024e57602036600319011261024e57611dbd61294b565b611dc56129a1565b6004356000526101326020526040600020611de560ff61013b54166124de565b611df560ff61013e541615612525565b600781015490611e0860ff831615612567565b611e1f60018060a01b0360058301541633146125ad565b6003810154611e326001830154426125eb565b816121ab575b50815491611e476004356127d2565b61012d546040516370a0823160e01b815230600482015291929190602090829060249082906001600160a01b03165afa90811561074257600091612178575b50600492611e9a60019261013a54906125eb565b8082116121705750955b60ff191617600782015560008155611ebf8461013a546125eb565b61013a55015433600052610134602052611edf60406000209182546125eb565b905533600052610134602052604060002054604051908152600080516020612ea283398151915260203392a282612121575b6101355491611f1f8361261b565b61013555611fde611f3083836129e5565b600760405191611f3f83612430565b8483526020830190428252604084019042825260608501908882526080860190815260a086019133835260c08701938b855260e0880195600087528c600052610132602052604060002098518955516001890155516002880155516003870155516004860155600585019060018060a01b0390511660018060a01b031982541617905551600684015551151591019060ff801983541691151516179055565b33600052610133602052611ff683604060002061262a565b6120038161013a5461260e565b61013a558260005261013260205260046040600020015433600052610134602052612034604060002091825461260e565b905533600052610134602052604060002054604051908152600080516020612ea283398151915260203392a26040519081528160208201527f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1560403392a26040519081528260208201527f5d486f88d95c44dd8a2350103dbba141248082fcd3b6c213898359b2b9792840604060043592a3806120d3575b6001606555005b61012d546120ed90829033906001600160a01b0316612a93565b6040519081527fee6506d5828b4bc76049d47a6c350c20c54df3f0338309504a1ba58ac4ef1127602060043592a2806120cc565b600435600052610136602052604060002061213d84825461260e565b905533600052610137602052604060002061215984825461260e565b905561013c61216984825461260e565b9055611f11565b905095611ea4565b90506020813d6020116121a3575b8161219360209383612467565b8101031261024e57516004611e86565b3d9150612186565b60ff821660005261012f60205260406000205410156121ca5783611e38565b60405162461bcd60e51b815260206004820152601560248201527414dd185ad9481a5cc81cdd1a5b1b081b1bd8dad959605a1b6044820152606490fd5b3461024e57602036600319011261024e5760043580151580910361024e5760407f2ea5a697b1bb16f60c3f17227bb5824cbf6f4b56d2024b6cf143f6e05e9bb51a916122516128f3565b61013e9081549160ff821660ff19841617905560ff83519216151582526020820152a1005b3461024e5760208060031936011261024e576001600160a01b036122986123ec565b166000526101338152604060002060405190818382549182815201908192600052846000209060005b868282106123175786866122d782880383612467565b604051928392818401908285525180915260408401929160005b82811061230057505050500390f35b8351855286955093810193928101926001016122f1565b8354855290930192600192830192016122c1565b3461024e57604036600319011261024e576123446123dc565b7f9a26ff4dbaff219d0dea5912fcac808f6ca57bb578f425939826c4291d24c53c60406024356123726128f3565b61237a61294b565b6123826129a1565b61239760ff80610139541695169485106124a3565b836000526101386020528160002090808254925582519182526020820152a26001606555005b3461024e57600036600319011261024e5760209060ff61013954168152f35b6004359060ff8216820361024e57565b600435906001600160a01b038216820361024e57565b805482101561241a5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b61010081019081106001600160401b038211176119d657604052565b606081019081106001600160401b038211176119d657604052565b90601f801991011681019081106001600160401b038211176119d657604052565b6001600160401b0381116119d657601f01601f191660200190565b156124aa57565b60405162461bcd60e51b815260206004820152600c60248201526b24b73b30b634b2103a34b2b960a11b6044820152606490fd5b156124e557565b60405162461bcd60e51b81526020600482015260186024820152775374616b696e67206973206e6f7420617661696c61626c6560401b6044820152606490fd5b1561252c57565b60405162461bcd60e51b815260206004820152601360248201527211195c1bdcda5d1cc8185c99481c185d5cd959606a1b6044820152606490fd5b1561256e57565b60405162461bcd60e51b815260206004820152601760248201527629ba30b5b29030b63932b0b23c903bb4ba34323930bbb760491b6044820152606490fd5b156125b457565b60405162461bcd60e51b815260206004820152600f60248201526e2737ba1039ba30b5b29037bbb732b960891b6044820152606490fd5b919082039182116125f857565b634e487b7160e01b600052601160045260246000fd5b919082018092116125f857565b60001981146125f85760010190565b8054600160401b8110156119d65761264791600182018155612402565b819291549060031b91821b91600019901b1916179055565b1561266657565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b156126c757565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b6163746976652070726f787960a01b6064820152608490fd5b9060009160018060a01b031682526020610134602052604091604084205460ff9360ff61013954165b85811680156127b557600019018681116127a157861687526101388552818720548310156127975785168015612783576000190161274a565b634e487b7160e01b87526011600452602487fd5b9450505092505090565b634e487b7160e01b88526011600452602488fd5b5092945050505050565b818102929181159184041417156125f857565b6000908152602061013281526040908183209160ff6007840154166128ed5760018301549361281560ff6003860154169586835261012f8552838320549061260e565b938442116000146128bd576002810154908186111561289957916128969661288261288f959361285461284e612874999754928b6125eb565b826127bf565b92845261287c61013093848852640757b12c00998a9188882054906127bf565b0499426125eb565b906127bf565b93828052522054906127bf565b049061260e565b90565b640757b12c0096506128b995506101309161287c612882925491426125eb565b0490565b6128b99450640757b12c0095936128e18261287c60026101309554920154426125eb565b948352522054906127bf565b50505090565b6033546001600160a01b0316330361290757565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60026065541461295c576002606555565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60ff609754166129ad57565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b81158015612a83575b8015612a69575b612a625761012e54604d81116125f857600a0a916103e892808402938404036125f857612a429160ff612a389216600052610131602052604060002054906127bf565b61013d54906127bf565b8115612a4c570490565b634e487b7160e01b600052601260045260246000fd5b5050600090565b5060ff8216600052610131602052604060002054156129f5565b5060ff61013954168210156129ee565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815260808101916001600160401b038311828410176119d657612ae292604052612be5565b565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815260a08101918183106001600160401b038411176119d657612ae292604052612be5565b603380546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b15612b8c57565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b60018060a01b03169060405160408101908082106001600160401b038311176119d657612c50916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af161142b612d7d565b805191821591848315612cc2575b505050905015612c6b5750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b919381809450010312612ce957820151908115158203612ce6575080388084612c5e565b80fd5b5080fd5b803b15612d2257600080516020612e8283398151915280546001600160a01b0319166001600160a01b03909216919091179055565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b3d15612da8573d90612d8e82612488565b91612d9c6040519384612467565b82523d6000602084013e565b606090565b91929015612e0f5750815115612dc1575090565b3b15612dca5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015612e225750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510612e68575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350612e4556fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcd1683cfe840da55fcea98a1deff73cde45e40f76950db36ea1b647706f16e0f5a264697066735822122042e5aedfae0f4ea517d6cbd11dd19211847e61eb5545d01fd60ab0483cf71be864736f6c63430008180033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.