ETH Price: $1,783.05 (+12.91%)

Contract

0xc30877315f3b621A8F7bCDA27819EC29429f3817
Transaction Hash
Method
Block
From
To
Unstake1348887662025-04-23 2:45:0933 mins ago1745376309IN
0xc3087731...9429f3817
0 ETH0.0000028978160.0014272
Prepare Unstake1345909372025-04-16 5:17:316 days ago1744780651IN
0xc3087731...9429f3817
0 ETH0.0000001609620.0012108
Claim1343517932025-04-10 16:26:0312 days ago1744302363IN
0xc3087731...9429f3817
0 ETH0.0000063114220.00109712
Claim1341768652025-04-06 15:15:0716 days ago1743952507IN
0xc3087731...9429f3817
0 ETH0.000000320060.0019598
Unstake1339362002025-04-01 1:32:5722 days ago1743471177IN
0xc3087731...9429f3817
0 ETH0.0000001108310.0011926
Claim1336780962025-03-26 2:09:2928 days ago1742954969IN
0xc3087731...9429f3817
0 ETH0.0000000337890.0002082
Claim1336703172025-03-25 21:50:1128 days ago1742939411IN
0xc3087731...9429f3817
0 ETH0.0000000515530.0002881
Unstake1335791822025-03-23 19:12:2130 days ago1742757141IN
0xc3087731...9429f3817
0 ETH0.0000000261410.0002605
Claim1335791692025-03-23 19:11:5530 days ago1742757115IN
0xc3087731...9429f3817
0 ETH0.000000044940.0002601
Unstake1335764422025-03-23 17:41:0130 days ago1742751661IN
0xc3087731...9429f3817
0 ETH0.000000032820.00033463
Unstake1334745962025-03-21 9:06:0932 days ago1742547969IN
0xc3087731...9429f3817
0 ETH0.0000000377190.00046679
Claim1334629132025-03-21 2:36:4333 days ago1742524603IN
0xc3087731...9429f3817
0 ETH0.0000001763140.00119736
Unstake1334122662025-03-19 22:28:2934 days ago1742423309IN
0xc3087731...9429f3817
0 ETH0.0000000145380.0001341
Unstake1334122552025-03-19 22:28:0734 days ago1742423287IN
0xc3087731...9429f3817
0 ETH0.0000000139770.0001242
Unstake1334122502025-03-19 22:27:5734 days ago1742423277IN
0xc3087731...9429f3817
0 ETH0.0000000151570.0001243
Unstake1334122432025-03-19 22:27:4334 days ago1742423263IN
0xc3087731...9429f3817
0 ETH0.0000000194310.0001245
Prepare Unstake1334122342025-03-19 22:27:2534 days ago1742423245IN
0xc3087731...9429f3817
0 ETH0.0000000201410.0001346
Unstake1333494382025-03-18 11:34:1335 days ago1742297653IN
0xc3087731...9429f3817
0 ETH0.0000001122380.00119025
Claim1330673322025-03-11 22:50:4142 days ago1741733441IN
0xc3087731...9429f3817
0 ETH0.0000002295580.0013677
Prepare Unstake1330092552025-03-10 14:34:4743 days ago1741617287IN
0xc3087731...9429f3817
0 ETH0.0000051637030.0010756
Prepare Unstake1329986622025-03-10 8:41:4143 days ago1741596101IN
0xc3087731...9429f3817
0 ETH0.0000001383290.00012394
Claim1329985992025-03-10 8:39:3543 days ago1741595975IN
0xc3087731...9429f3817
0 ETH0.0000001409140.00012403
Unstake1329758542025-03-09 20:01:2544 days ago1741550485IN
0xc3087731...9429f3817
0 ETH0.0000001541020.0010701
Prepare Unstake1328110232025-03-06 0:27:0348 days ago1741220823IN
0xc3087731...9429f3817
0 ETH0.0000000199450.00010053
Claim1328110112025-03-06 0:26:3948 days ago1741220799IN
0xc3087731...9429f3817
0 ETH0.0000000219720.00010052
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Staker

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, GNU GPLv3 license
File 1 of 21 : Staker.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

import {ScaledNumber} from "./libraries/ScaledNumber.sol";
import {Errors} from "./libraries/Errors.sol";

import {IStaker} from "./interfaces/IStaker.sol";
import {IRewardsStreaming} from "./interfaces/IRewardsStreaming.sol";
import {RewardsStreaming} from "./RewardsStreaming.sol";
import {Unstakes} from "./libraries/Unstakes.sol";

contract Staker is IStaker, RewardsStreaming {
    using ScaledNumber for uint256;
    using Unstakes for Unstakes.UserUnstakes;

    mapping(address => Unstakes.UserUnstakes) internal _queuedUnstakes;
    /// @inheritdoc IStaker
    uint256 public immutable override unstakeDelay;
    /// @inheritdoc IStaker
    uint256 public override totalPrepared;
    /// @inheritdoc IStaker
    bool public override claimingEnabled;

    constructor(
        address addressProvider_,
        uint256 unstakeDelay_,
        address rewardToken_
    ) RewardsStreaming(addressProvider_, rewardToken_) {
        unstakeDelay = unstakeDelay_;
    }

    /// @inheritdoc IRewardsStreaming
    function donateRewards(uint256 amount_) external override {
        if (amount_ == 0) revert ZeroAmount();
        uint256 divisor_ = totalStaked - totalPrepared;
        if (divisor_ == 0) revert ZeroBalance();

        IERC20(rewardToken).transferFrom(msg.sender, address(this), amount_);

        _rewardIntegral += amount_.div(divisor_);

        emit DonatedRewards(msg.sender, amount_);
    }

    /// @inheritdoc IRewardsStreaming
    function claim() external override {
        if (!claimingEnabled) revert ClaimingNotEnabled();

        _claim();
    }

    /// @inheritdoc IStaker
    function stake(uint256 amount_) external override {
        stakeFor(amount_, msg.sender);
    }

    /// @inheritdoc IStaker
    function listQueuedUnstakes(
        address account
    ) external view returns (Unstakes.UserUnstakeData[] memory unstakes) {
        return _queuedUnstakes[account].list();
    }

    /// @inheritdoc IStaker
    function stakeFor(uint256 amount_, address account_) public override {
        if (amount_ == 0) revert ZeroAmount();
        if (account_ == address(0)) revert Errors.ZeroAddress();

        _checkpoint(account_);

        _addressProvider.tlx().transferFrom(msg.sender, address(this), amount_);
        _balances[account_] += amount_;
        totalStaked += amount_;

        emit Staked(msg.sender, account_, amount_);
    }

    /// @inheritdoc IStaker
    function prepareUnstake(
        uint256 amount_
    ) public override returns (uint256 id) {
        if (amount_ == 0) revert ZeroAmount();
        if (activeBalanceOf(msg.sender) < amount_) revert InsufficientBalance();

        _checkpoint(msg.sender);
        id = _queuedUnstakes[msg.sender].queue(
            amount_,
            block.timestamp + unstakeDelay
        );
        totalPrepared += amount_;

        emit PreparedUnstake(msg.sender, amount_, id);
    }

    /// @inheritdoc IStaker
    function enableClaiming() public override onlyOwner {
        if (claimingEnabled) revert ClaimingAlreadyEnabled();

        claimingEnabled = true;
    }

    /// @inheritdoc IStaker
    function unstake(uint256 withdrawalId_) public override {
        unstakeFor(msg.sender, withdrawalId_);
    }

    /// @inheritdoc IStaker
    function restake(uint256 withdrawalId_) public override {
        _checkpoint(msg.sender);

        Unstakes.UserUnstake memory withdrawal_ = _queuedUnstakes[msg.sender]
            .remove(withdrawalId_);
        totalPrepared -= withdrawal_.amount;

        emit Restaked(msg.sender, withdrawal_.amount);
    }

    /// @inheritdoc IStaker
    function unstakeFor(
        address account_,
        uint256 withdrawalId_
    ) public override {
        _checkpoint(msg.sender);

        Unstakes.UserUnstake memory withdrawal_ = _queuedUnstakes[msg.sender]
            .remove(withdrawalId_);
        uint256 unstakeTime_ = withdrawal_.unstakeTime;
        if (unstakeTime_ > block.timestamp) revert NotUnstaked();

        uint256 amount_ = withdrawal_.amount;

        _balances[msg.sender] -= amount_;
        totalStaked -= amount_;
        totalPrepared -= amount_;

        _addressProvider.tlx().transfer(account_, amount_);

        emit Unstaked(msg.sender, account_, amount_);
    }

    /// @inheritdoc IRewardsStreaming
    function activeBalanceOf(
        address account_
    )
        public
        view
        override(IRewardsStreaming, RewardsStreaming)
        returns (uint256)
    {
        return _balances[account_] - _queuedUnstakes[account_].totalQueued;
    }

    /// @inheritdoc IStaker
    function symbol() public view override returns (string memory) {
        return string.concat("st", _addressProvider.tlx().symbol());
    }

    /// @inheritdoc IStaker
    function name() public view override returns (string memory) {
        return string.concat("Staked ", _addressProvider.tlx().name());
    }

    function _latestIntegral()
        internal
        view
        virtual
        override
        returns (uint256)
    {
        return _rewardIntegral;
    }
}

File 2 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 3 of 21 : ScaledNumber.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

library ScaledNumber {
    uint8 internal constant _DEFAULT_DECIMALS = 18;

    function div(
        uint256 value,
        uint256 divisor
    ) internal pure returns (uint256) {
        return (value * 10 ** _DEFAULT_DECIMALS) / divisor;
    }

    function mul(
        uint256 value,
        uint256 multiplier
    ) internal pure returns (uint256) {
        return (value * multiplier) / 10 ** _DEFAULT_DECIMALS;
    }

    function absSub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a - b : b - a;
    }
}

File 4 of 21 : Errors.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

library Errors {
    error NotAuthorized();
    error AlreadyExists();
    error DoesNotExist();
    error ZeroAddress();
    error SameAsCurrent();
    error InvalidAddress();
    error InsufficientAmount();
    error NotLeveragedToken();
}

File 5 of 21 : IStaker.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IRewardsStreaming} from "./IRewardsStreaming.sol";
import {Unstakes} from "../libraries/Unstakes.sol";

interface IStaker is IRewardsStreaming {
    event Staked(
        address indexed accountFrom,
        address indexed accountTo,
        uint256 amount
    );
    event PreparedUnstake(address indexed account, uint256 amount, uint256 id);
    event Unstaked(
        address indexed accountFrom,
        address indexed accountTo,
        uint256 amount
    );
    event Restaked(address indexed account, uint256 amount);

    error NotUnstaked();
    error ClaimingNotEnabled();
    error ClaimingAlreadyEnabled();
    error ZeroBalance();

    /**
     * @notice Stakes TLX tokens for the caller.
     * @param amount The amount of TLX tokens to stake.
     */
    function stake(uint256 amount) external;

    /**
     * @notice Stakes TLX tokens for the caller for the account.
     * @param amount The amount of TLX tokens to stake.
     * @param account The account to stake the TLX tokens to.
     */
    function stakeFor(uint256 amount, address account) external;

    /**
     * @notice Prepares the caller's staked TLX tokens for unstaking.
     * @return id The ID of the withdrawal to be unstaked.
     */
    function prepareUnstake(uint256 amount) external returns (uint256 id);

    /**
     * @notice Unstakes the caller's TLX tokens.
     * @param withdrawalId The ID of the withdrawal to unstake.
     */
    function unstake(uint256 withdrawalId) external;

    /**
     * @notice Restakes the caller's prepared TLX tokens.
     * @param withdrawalId The ID of the withdrawal to restake.
     */
    function restake(uint256 withdrawalId) external;

    /**
     * @notice Unstakes the caller's TLX tokens for the given account.
     * @param account The account to send the TLX tokens to.
     * @param withdrawalId The ID of the withdrawal to unstake.
     */
    function unstakeFor(address account, uint256 withdrawalId) external;

    /**
     * @notice Enables claiming for stakers.
     * @dev This can only be called by the owner.
     */
    function enableClaiming() external;

    /**
     * @notice Returns if claiming is enabled for stakers.
     * @return claimingEnabled Whether claiming is enabled for stakers.
     */
    function claimingEnabled() external view returns (bool claimingEnabled);

    /**
     * @notice Returns the symbol of the Staker.
     * @return symbol The symbol of the Staker.
     */
    function symbol() external view returns (string memory symbol);

    /**
     * @notice Returns the name of the Staker.
     * @return name The name of the Staker.
     */
    function name() external view returns (string memory name);

    /**
     * @notice Returns the total amount of TLX tokens prepared for unstaking.
     * @return amount The total amount of TLX tokens prepared for unstaking.
     */
    function totalPrepared() external view returns (uint256 amount);

    /**
     * @notice Returns all the queued unstakes for the given account.
     * @param account The account to return the unstakes for.
     * @return unstakes All the queued unstakes for the given account.
     */
    function listQueuedUnstakes(
        address account
    ) external view returns (Unstakes.UserUnstakeData[] memory unstakes);

    /**
     * @notice Returns the delay the user must wait when unstakeing.
     * @return delay The delay the user must wait when unstakeing.
     */
    function unstakeDelay() external view returns (uint256 delay);
}

File 6 of 21 : IRewardsStreaming.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IRewardsStreaming {
    event Claimed(address indexed account, uint256 amount);
    event DonatedRewards(address indexed account, uint256 amount);

    error ZeroAmount();
    error InsufficientBalance();

    /**
     * @notice Claims the caller's rewards.
     */
    function claim() external;

    /**
     * @notice Donates an amount of the reward token to the staker.
     */
    function donateRewards(uint256 amount) external;

    /**
     * @notice Returns the amount of TLX tokens staked for the given account.
     * @param account The account to return the staked TLX tokens for.
     * @return amount The amount of TLX tokens staked for the given account.
     */
    function balanceOf(address account) external view returns (uint256 amount);

    /**
     * @notice Returns the amount of TLX tokens staked for the given account
     * minus the amount queued for withdrawal.
     * @param account The account to return the staked TLX tokens for.
     * @return amount The amount of TLX tokens staked and not queued for the given account.
     */
    function activeBalanceOf(
        address account
    ) external view returns (uint256 amount);

    /**
     * @notice Returns the total amount of TLX tokens staked.
     * @return amount The total amount of TLX tokens staked.
     */
    function totalStaked() external view returns (uint256 amount);

    /**
     * @notice Returns the amount of reward tokens claimable for the given account.
     * @param account The account to return the claimable reward tokens for.
     * @return amount The amount of reward tokens claimable for the given account.
     */
    function claimable(address account) external view returns (uint256 amount);

    /**
     * @notice Returns the number of decimals the Staker's token uses.
     * @return decimals The number of decimals the Staker's token uses.
     */
    function decimals() external view returns (uint8 decimals);

    /**
     * @notice Returns the address of the reward token.
     * @return rewardToken The address of the reward token.
     */
    function rewardToken() external view returns (address rewardToken);
}

File 7 of 21 : RewardsStreaming.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

import {TlxOwnable} from "./utils/TlxOwnable.sol";

import {ScaledNumber} from "./libraries/ScaledNumber.sol";

import {IRewardsStreaming} from "./interfaces/IRewardsStreaming.sol";
import {IAddressProvider} from "./interfaces/IAddressProvider.sol";

abstract contract RewardsStreaming is IRewardsStreaming, TlxOwnable {
    using ScaledNumber for uint256;

    IAddressProvider internal immutable _addressProvider;

    uint256 internal _rewardIntegral;
    mapping(address => uint256) internal _balances;
    mapping(address => uint256) internal _usersRewardIntegral;
    mapping(address => uint256) internal _usersRewards;

    /// @inheritdoc IRewardsStreaming
    address public immutable override rewardToken;
    /// @inheritdoc IRewardsStreaming
    uint256 public override totalStaked;

    constructor(
        address addressProvider_,
        address rewardToken_
    ) TlxOwnable(addressProvider_) {
        _addressProvider = IAddressProvider(addressProvider_);
        rewardToken = rewardToken_;
    }

    /// @inheritdoc IRewardsStreaming
    function claimable(
        address account_
    ) public view override returns (uint256) {
        return
            _usersRewards[account_] + _newRewards(account_, _latestIntegral());
    }

    /// @inheritdoc IRewardsStreaming
    function balanceOf(
        address account_
    ) public view override returns (uint256) {
        return _balances[account_];
    }

    /// @inheritdoc IRewardsStreaming
    function activeBalanceOf(
        address account
    ) public view virtual override returns (uint256);

    /// @inheritdoc IRewardsStreaming
    function decimals() public view override returns (uint8) {
        return _addressProvider.tlx().decimals();
    }

    function _checkpoint(address account_) internal {
        _globalCheckpoint();
        uint256 rewardIntegral_ = _rewardIntegral;
        _usersRewards[account_] += _newRewards(account_, rewardIntegral_);
        _usersRewardIntegral[account_] = rewardIntegral_;
    }

    function _claim() internal {
        _checkpoint(msg.sender);

        uint256 amount_ = _usersRewards[msg.sender];
        if (amount_ == 0) return;

        delete _usersRewards[msg.sender];
        IERC20(rewardToken).transfer(msg.sender, amount_);

        emit Claimed(msg.sender, amount_);
    }

    function _globalCheckpoint() internal virtual {}

    function _newRewards(
        address account_,
        uint256 rewardIntegral_
    ) internal view returns (uint256) {
        uint256 integral_ = rewardIntegral_ - _usersRewardIntegral[account_];
        return integral_.mul(activeBalanceOf(account_));
    }

    function _latestIntegral() internal view virtual returns (uint256);
}

File 8 of 21 : Unstakes.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {EnumerableSet} from "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol";
import {Errors} from "./Errors.sol";

library Unstakes {
    using EnumerableSet for EnumerableSet.UintSet;

    struct UserUnstakeData {
        uint256 id;
        uint256 amount;
        uint256 unstakeTime;
    }

    struct UserUnstake {
        uint192 amount;
        uint64 unstakeTime;
    }

    struct UserUnstakes {
        mapping(uint256 => UserUnstake) withdrawals;
        EnumerableSet.UintSet ids;
        uint64 nextId;
        uint192 totalQueued;
    }

    function queue(
        UserUnstakes storage self_,
        uint256 amount_,
        uint256 unstakeTime_
    ) internal returns (uint256) {
        uint256 id = self_.nextId;
        self_.withdrawals[id] = UserUnstake({
            amount: uint192(amount_),
            unstakeTime: uint64(unstakeTime_)
        });
        self_.ids.add(id);
        self_.nextId++;
        self_.totalQueued += uint192(amount_);
        return id;
    }

    function remove(
        UserUnstakes storage self_,
        uint256 id_
    ) internal returns (UserUnstake memory withdrawal) {
        if (!self_.ids.remove(id_)) revert Errors.DoesNotExist();
        withdrawal = self_.withdrawals[id_];
        self_.totalQueued -= withdrawal.amount;
        delete self_.withdrawals[id_];
    }

    function list(
        UserUnstakes storage self_
    ) internal view returns (UserUnstakeData[] memory withdrawals) {
        uint256 length_ = self_.ids.length();
        withdrawals = new UserUnstakeData[](length_);
        for (uint256 i_; i_ < length_; i_++) {
            uint256 id_ = self_.ids.at(i_);
            UserUnstake memory withdrawal = self_.withdrawals[id_];
            withdrawals[i_] = UserUnstakeData({
                id: id_,
                amount: withdrawal.amount,
                unstakeTime: withdrawal.unstakeTime
            });
        }
    }
}

File 9 of 21 : TlxOwnable.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IAddressProvider} from "../interfaces/IAddressProvider.sol";

abstract contract TlxOwnable {
    IAddressProvider private immutable _addressProvider;

    error NotOwner();

    modifier onlyOwner() {
        if (_addressProvider.owner() != msg.sender) {
            revert NotOwner();
        }
        _;
    }

    constructor(address addressProvider_) {
        _addressProvider = IAddressProvider(addressProvider_);
    }
}

File 10 of 21 : IAddressProvider.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";

import {ILeveragedTokenFactory} from "./ILeveragedTokenFactory.sol";
import {IReferrals} from "./IReferrals.sol";
import {IAirdrop} from "./IAirdrop.sol";
import {IBonding} from "./IBonding.sol";
import {IVesting} from "./IVesting.sol";
import {ITlxToken} from "./ITlxToken.sol";
import {IStaker} from "./IStaker.sol";
import {ISynthetixHandler} from "./ISynthetixHandler.sol";
import {IParameterProvider} from "./IParameterProvider.sol";
import {IZapSwap} from "./IZapSwap.sol";

interface IAddressProvider {
    event AddressUpdated(bytes32 indexed key, address value);
    event AddressFrozen(bytes32 indexed key);
    event RebalancerAdded(address indexed account);
    event RebalancerRemoved(address indexed account);

    error AddressIsFrozen(bytes32 key);

    /**
     * @notice Updates an address for the given key.
     * @param key The key of the address to be updated.
     * @param value The value of the address to be updated.
     */
    function updateAddress(bytes32 key, address value) external;

    /**
     * @notice Freezes an address for the given key, making it immutable.
     * @param key The key of the address to be frozen.
     */
    function freezeAddress(bytes32 key) external;

    /**
     * @notice Gives the `account` permissions to rebalance leveraged tokens.
     * @dev Reverts if the `account` is already a rebalancer.
     * @param account The address of the account to be added.
     */
    function addRebalancer(address account) external;

    /**
     * @notice Removes the `account` permissions to rebalance leveraged tokens.
     * @dev Reverts if the `account` is not a rebalancer.
     * @param account The address of the account to be removed.
     */
    function removeRebalancer(address account) external;

    /**
     * @notice Returns the address for a kiven key.
     * @param key The key of the address to be returned.
     * @return value The address for the given key.
     */
    function addressOf(bytes32 key) external view returns (address value);

    /**
     * @notice Returns whether an address is frozen.
     * @param key The key of the address to be checked.
     * @return Whether the address is frozen.
     */
    function isAddressFrozen(bytes32 key) external view returns (bool);

    /**
     * @notice Returns the LeveragedTokenFactory contract.
     * @return leveragedTokenFactory The LeveragedTokenFactory contract.
     */
    function leveragedTokenFactory()
        external
        view
        returns (ILeveragedTokenFactory leveragedTokenFactory);

    /**
     * @notice Returns the Referrals contract.
     * @return referrals The Referrals contract.
     */
    function referrals() external view returns (IReferrals referrals);

    /**
     * @notice Returns the Airdrop contract.
     * @return airdrop The Airdrop contract.
     */
    function airdrop() external view returns (IAirdrop airdrop);

    /**
     * @notice Returns the Bonding contract.
     * @return bonding The Bonding contract.
     */
    function bonding() external view returns (IBonding bonding);

    /**
     * @notice Returns the address for the Treasury contract.
     * @return treasury The address of the Treasury contract.
     */
    function treasury() external view returns (address treasury);

    /**
     * @notice Returns the Vesting contract.
     * @return vesting The Vesting contract.
     */
    function vesting() external view returns (IVesting vesting);

    /**
     * @notice Returns the TLX contract.
     * @return tlx The TLX contract.
     */
    function tlx() external view returns (ITlxToken tlx);

    /**
     * @notice Returns the Staker contract.
     * @return staker The Staker contract.
     */
    function staker() external view returns (IStaker staker);

    /**
     * @notice Returns the ZapSwap contract.
     * @return zapSwap The ZapSwap contract.
     */
    function zapSwap() external view returns (IZapSwap zapSwap);

    /**
     * @notice Returns the base asset.
     * @return baseAsset The base asset.
     */
    function baseAsset() external view returns (IERC20Metadata baseAsset);

    /**
     * @notice Returns the SynthetixHandler contract.
     * @return synthetixHandler The SynthetixHandler  contract.
     */
    function synthetixHandler()
        external
        view
        returns (ISynthetixHandler synthetixHandler);

    /**
     * @notice Returns the address for the POL token.
     * @return pol The address of the POL token.
     */
    function pol() external view returns (address pol);

    /**
     * @notice Returns the Parameter Provider contract.
     * @return parameterProvider The Parameter Provider contract.
     */
    function parameterProvider()
        external
        view
        returns (IParameterProvider parameterProvider);

    /**
     * @notice Returns if the given `account` is permitted to rebalance leveraged tokens.
     * @param account The address of the account to be checked.
     * @return isRebalancer Whether the account is permitted to rebalance leveraged tokens.
     */
    function isRebalancer(
        address account
    ) external view returns (bool isRebalancer);

    /**
     * @notice Returns the list of rebalancers.
     * @return rebalancers The list of rebalancers.
     */
    function rebalancers() external view returns (address[] memory rebalancers);

    /**
     * @notice Returns the address for the Rebalance Fee Receiver.
     * @return rebalanceFeeReceiver The address of the Rebalance Fee Receiver.
     */
    function rebalanceFeeReceiver()
        external
        view
        returns (address rebalanceFeeReceiver);

    /**
     * @notice Returns the owner of all TLX contracts.
     * @return owner The owner of all TLX contracts.
     */
    function owner() external view returns (address owner);
}

File 11 of 21 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 12 of 21 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @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);
}

File 13 of 21 : ILeveragedTokenFactory.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface ILeveragedTokenFactory {
    event NewLeveragedToken(address indexed token);

    error ZeroLeverage();
    error MaxLeverage();
    error MaxOfTwoDecimals();
    error AssetNotSupported();
    error NotInactive();

    /**
     * @notice Creates a new Long and Short Leveraged Token for the given target asset and leverage.
     * @dev Reverts if a Leveraged Token for the given target asset and leverage already exists.
     * @param targetAsset The target asset of the Leveraged Token.
     * @param targetLeverage The target leverage of the Leveraged Token (18 decimals).
     * @param rebalanceThreshold The threshold for rebalancing (18 decimals).
     * @return longToken The address of the Long Leveraged Token.
     * @return shortToken The address of the Short Leveraged Token.
     */
    function createLeveragedTokens(
        string calldata targetAsset,
        uint256 targetLeverage,
        uint256 rebalanceThreshold
    ) external returns (address longToken, address shortToken);

    /**
     * @notice Redeploys a Leveraged Token when the old one has been liquidated and is inactive.
     * @dev Reverts if the Leveraged Token doesn't exist or is not inactive.
     * @param tokenAddress The address of the Leveraged Token that has been liquidated and is inactive.
     * @return newToken The address of the new Leveraged Token.
     */
    function redeployInactiveToken(
        address tokenAddress
    ) external returns (address newToken);

    /**
     * @notice Returns all Leveraged Tokens.
     * @return tokens The addresses of all Leveraged Tokens.
     */
    function allTokens() external view returns (address[] memory tokens);

    /**
     * @notice Returns all Long Leveraged Tokens.
     * @return tokens The addresses of all Long Leveraged Tokens.
     */
    function longTokens() external view returns (address[] memory tokens);

    /**
     * @notice Returns all Short Leveraged Tokens.
     * @return tokens The addresses of all Short Leveraged Tokens.
     */
    function shortTokens() external view returns (address[] memory tokens);

    /**
     * @notice Returns all Leveraged Tokens for the given target asset.
     * @param targetAsset The target asset of the Leveraged Tokens.
     * @return tokens The addresses of all Leveraged Tokens for the given target asset.
     */
    function allTokens(
        string calldata targetAsset
    ) external view returns (address[] memory tokens);

    /**
     * @notice Returns all Long Leveraged Tokens for the given target asset.
     * @param targetAsset The target asset of the Long Leveraged Tokens.
     * @return tokens The addresses of all Long Leveraged Tokens for the given target asset.
     */
    function longTokens(
        string calldata targetAsset
    ) external view returns (address[] memory tokens);

    /**
     * @notice Returns all Short Leveraged Tokens for the given target asset.
     * @param targetAsset The target asset of the Short Leveraged Tokens.
     * @return tokens The addresses of all Short Leveraged Tokens for the given target asset.
     */
    function shortTokens(
        string calldata targetAsset
    ) external view returns (address[] memory tokens);

    /**
     * @notice Returns the Leveraged Token for the given target asset and leverage.
     * @param targetAsset The target asset of the Leveraged Token.
     * @param targetLeverage The target leverage of the Leveraged Token (2 decimals).
     * @param isLong If the Leveraged Token is long or short.
     * @return token The address of the Leveraged Token.
     */
    function token(
        string calldata targetAsset,
        uint256 targetLeverage,
        bool isLong
    ) external view returns (address token);

    /**
     * @notice Returns if the Leveraged Token for the given target asset and leverage exists.
     * @param targetAsset The target asset of the Leveraged Token.
     * @param targetLeverage The target leverage of the Leveraged Token (2 decimals).
     * @param isLong If the Leveraged Token is long or short.
     * @return exists If the Leveraged Token exists.
     */
    function tokenExists(
        string calldata targetAsset,
        uint256 targetLeverage,
        bool isLong
    ) external view returns (bool exists);

    /**
     * @notice Returns the Leveraged Tokens inverse pair (e.g. ETH3L -> ETH3S).
     * @param token The address of the Leveraged Token.
     * @return pair The address of the Leveraged Tokens inverse pair.
     */
    function pair(address token) external view returns (address pair);

    /**
     * @notice Returns if the given token is a Leveraged Token.
     * @param token The address of the token.
     * @return isLeveragedToken If the given token is a Leveraged Token.
     */
    function isLeveragedToken(
        address token
    ) external view returns (bool isLeveragedToken);
}

File 14 of 21 : IReferrals.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IReferrals {
    event Registered(address indexed user, bytes32 code);
    event SetReferral(address indexed user, bytes32 code);
    event RebateSet(uint256 rebate);
    event EarningsSet(uint256 earnings);
    event ReferralEarned(address indexed user, uint256 amount);
    event RebateEarned(address indexed user, uint256 amount);
    event EarningsClaimed(address indexed user, uint256 amount);

    error AlreadyRegistered();
    error InvalidCode();
    error CodeTaken();
    error AlreadyOpen();
    error NotChanged();
    error InvalidAmount();

    /**
     * @notice Takes the referral earnings from the given fees for the given user.
     * @param fees The fees to take the earnings from.
     * @param user The user to take the earnings for.
     * @return earnings The earnings taken.
     */
    function takeEarnings(
        uint256 fees,
        address user
    ) external returns (uint256 earnings);

    /**
     * @notice Claims the referral earnings for the sender.
     * @return earnings The earnings claimed.
     */
    function claimEarnings() external returns (uint256 earnings);

    /**
     * @notice Registers the given code for the sender.
     * @param code The code to register.
     */
    function register(address referrer, bytes32 code) external;

    /**
     * @notice Sets the referral code for the sender.
     * @dev Reverts if the user has already set a code.
     * @param code The code to use.
     */
    function setReferral(bytes32 code) external;

    /**
     * @notice Sets the rebate percent.
     * @dev Can only be called by the owner.
     * @param rebatePercent The rebate percent to set.
     */
    function setRebatePercent(uint256 rebatePercent) external;

    /**
     * @notice Sets the referral percent.
     * @dev Can only be called by the owner.
     * @param referralPercent The referral percent to set.
     */
    function setReferralPercent(uint256 referralPercent) external;

    /**
     * @notice Returns the reabate for the given code.
     * @param code The code to get the rebate for.
     * @return rebate The rebate for the given code.
     */
    function codeRebate(bytes32 code) external view returns (uint256 rebate);

    /**
     * @notice Returns the rebate for the given user.
     * @param user The user to get the rebate for.
     * @return rebate The rebate for the given user.
     */
    function userRebate(address user) external view returns (uint256 rebate);

    /**
     * @notice Returns the referrer for the given code.
     * @param code The code to get the referrer for.
     * @return referrer The referrer for the given code.
     */
    function referrer(bytes32 code) external view returns (address referrer);

    /**
     * @notice Returns the code for the given referrer
     * @param referrer The referrer to get the code for.
     * @return code The code for the given referrer.
     */
    function code(address referrer) external view returns (bytes32 code);

    /**
     * @notice Returns the code for the given user.
     * @param user The user to get the code for.
     * @return code The code for the given user.
     */
    function referral(address user) external view returns (bytes32 code);

    /**
     * @notice Returns the earnings for the given referrer.
     * @param referrer The referrer to get the earnings for.
     * @return earned The earnings for the given referrer.
     */
    function earned(address referrer) external view returns (uint256 earned);

    /**
     * @notice Returns the rebate percent.
     * @dev As a percent of fees, e.g 10% as 0.1e18.
     * @return rebatePercent The rebate percent.
     */
    function rebatePercent() external view returns (uint256 rebatePercent);

    /**
     * @notice Returns the referral percent.
     * @dev As a percent of fees, e.g 10% as 0.1e18.
     * @return referralPercent The referral percent.
     */
    function referralPercent() external view returns (uint256 referralPercent);
}

File 15 of 21 : IAirdrop.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IAirdrop {
    event MerkleRootUpdated(bytes32 merkleRoot);
    event Claimed(address indexed account, uint256 amount);
    event UnclaimedRecovered(uint256 amount);

    error ClaimPeriodOver();
    error InvalidMerkleProof();
    error AlreadyClaimed();
    error AirdropCompleted();
    error EverythingClaimed();
    error ClaimStillOngoing();

    /**
     * @notice Claim tokens from the airdrop.
     * @param amount The amount of tokens to claim.
     * @param merkleProof The merkle proof for the account.
     */
    function claim(uint256 amount, bytes32[] calldata merkleProof) external;

    /**
     * @notice Update the merkle root for the airdrop.
     * @param merkleRoot_ The new merkle root.
     */
    function updateMerkleRoot(bytes32 merkleRoot_) external;

    /**
     * @notice Recover unclaimed tokens to the treasury.
     */
    function recoverUnclaimed() external;

    /**
     * @notice Returns the merkle root for the airdrop.
     * @return merkleRoot The merkle root for the airdrop.
     */
    function merkleRoot() external view returns (bytes32 merkleRoot);

    /**
     * @notice Returns if the `account` has claimed their airdrop.
     * @param account The account to check.
     * @return hasClaimed If the `account` has claimed their airdrop.
     */
    function hasClaimed(
        address account
    ) external view returns (bool hasClaimed);

    /**
     * @notice Returns the deadline for the airdrop.
     * @return deadline The deadline for the airdrop.
     */
    function deadline() external view returns (uint256 deadline);

    /**
     * @notice Returns the total amount of tokens claimed.
     * @return totalClaimed The total amount of tokens claimed.
     */
    function totalClaimed() external view returns (uint256 totalClaimed);
}

File 16 of 21 : IBonding.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IBonding {
    event Bonded(
        address indexed account,
        address indexed leveragedToken,
        uint256 leveragedTokenAmount,
        uint256 tlxTokensReceived
    );
    event Migrated(uint256 amount);
    event BaseForAllTlxSet(uint256 value);
    event Launched();

    error MinTlxNotReached();
    error ExceedsAvailable();
    error BondingNotLive();
    error AmountIsZero();
    error BondingAlreadyLive();
    error AlreadyMigrated();
    error InactiveToken();

    /**
     * @notice Bond leveraged tokens for TLX.
     * @param leveragedToken The address of the leveraged token to bond.
     * @param leveragedTokenAmount The amount of leveraged tokens to bond.
     * @param minTlxTokensReceived The minimum amount of TLX tokens to receive.
     * @return tlxTokensReceived The amount of TLX tokens received.
     */
    function bond(
        address leveragedToken,
        uint256 leveragedTokenAmount,
        uint256 minTlxTokensReceived
    ) external returns (uint256 tlxTokensReceived);

    /**
     * @notice Sets the base for all TLX.
     * @dev Reverts if the caller is not the owner.
     * @param baseForAllTlx The new base for all TLX.
     */
    function setBaseForAllTlx(uint256 baseForAllTlx) external;

    /**
     * @notice Sets the bonding to live.
     * @dev Reverts if the caller is not the owner.
     */
    function launch() external;

    /**
     * @notice Migrate the TLX tokens to the new bonding contract.
     * @dev Reverts if the caller is not the owner.
     */
    function migrate() external;

    /**
     * @notice Returns if the bonding is live.
     * @return isLive If the bonding is live.
     */
    function isLive() external view returns (bool isLive);

    /**
     * @notice Returns the exchange rate between leveraged tokens baseAsset value and TLX.
     * @return exchangeRate The exchange rate between leveraged tokens baseAsset value and TLX.
     */
    function exchangeRate() external view returns (uint256 exchangeRate);

    /**
     * @notice Returns the amount of TLX tokens that can be bonded.
     * @return availableTlx The amount of TLX tokens that can be bonded.
     */
    function availableTlx() external view returns (uint256 availableTlx);

    /**
     * @notice Returns the total amount of TLX tokens bonded.
     * @return totalTlxBonded The total amount of TLX tokens bonded.
     */
    function totalTlxBonded() external view returns (uint256 totalTlxBonded);
}

File 17 of 21 : IVesting.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IVesting {
    struct VestingAmount {
        address account;
        uint256 amount;
    }

    struct VestingData {
        uint256 amount;
        uint256 claimed;
    }

    event Claimed(address indexed account, address indexed to, uint256 amount);
    event DelegateAdded(address indexed account, address indexed delegate);
    event DelegateRemoved(address indexed account, address indexed delegate);

    error NothingToClaim();
    error InvalidDuration();
    error NotAuthorized();

    /**
     * @notice Claim vested tokens.
     */
    function claim() external;

    /**
     * @notice Claim vested tokens for 'account' and send to 'to'.
     * @param account The address to claim the vested tokens for.
     * @param to The address to send the claimed tokens to.
     */
    function claim(address account, address to) external;

    /**
     * @notice Adds a delegate for the caller.
     * @param delegate The address of the delegate to add.
     */
    function addDelegate(address delegate) external;

    /**
     * @notice Removes a delegate for the caller.
     * @param delegate The address of the delegate to remove.
     */
    function removeDelegate(address delegate) external;

    /**
     * @notice Get the amount of tokens that were allocated for vesting for `account`.
     * @param account The address to get the allocated amount for.
     * @return amount The amount of tokens allocated for vesting for `account`.
     */
    function allocated(address account) external view returns (uint256 amount);

    /**
     * @notice Get the amount of tokens that have vested for `account`.
     * @param account The address to get the vested amount for.
     * @return amount The amount of tokens vested to `account`.
     */
    function vested(address account) external view returns (uint256 amount);

    /**
     * @notice Get the amount of tokens that are vesting for `account`.
     * @param account The address to get the vesting amount for.
     * @return amount The amount of tokens vesting for `account`.
     */
    function vesting(address account) external view returns (uint256 amount);

    /**
     * @notice Get the amount of tokens that have been claimed for `account`.
     * @param account The address to get the claimed amount for.
     * @return amount The amount of tokens claimed for `account`.
     */
    function claimed(address account) external view returns (uint256 amount);

    /**
     * @notice Get the amount of tokens that are claimable for `account`.
     * @dev This is calculated as `vested` - `claimed`.
     * @param account The address to get the claimable amount for.
     * @return amount The amount of tokens claimable for `account`.
     */
    function claimable(address account) external view returns (uint256 amount);

    /**
     * @notice Check if `delegate` is a delegate for `account`.
     * @param account The address to check the delegate for.
     * @param delegate The address to check if it is a delegate.
     * @return isDelegate True if `delegate` is a delegate for `account`.
     */
    function isDelegate(
        address account,
        address delegate
    ) external view returns (bool isDelegate);
}

File 18 of 21 : ITlxToken.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface ITlxToken is IERC20Metadata {}

File 19 of 21 : ISynthetixHandler.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface ISynthetixHandler {
    error ErrorGettingPnl();
    error ErrorGettingOrderFee();
    error ErrorGettingIsLong();
    error ErrorGettingFillPrice();
    error ErrorGettingAssetPrice();
    error NoMargin();

    /**
     * @notice Deposit `amount` of margin to Synthetix for the `market`.
     * @dev Should be called with delegatecall.
     * @param market The market to deposit margin for.
     * @param amount The amount of margin to deposit.
     */
    function depositMargin(address market, uint256 amount) external;

    /**
     * @notice Withdraw `amount` of margin from Synthetix for the `market`.
     * @dev Should be called with delegatecall.
     * @param market The market to withdraw margin for.
     * @param amount The amount of margin to withdraw.
     */
    function withdrawMargin(address market, uint256 amount) external;

    /**
     * @notice Submit a leverage update for the `market`.
     * @dev Should be called with delegatecall.
     * @param market The market to submit a leverage update for.
     * @param leverage The new leverage to target.
     * @param isLong Whether the position is long or short.
     */
    function submitLeverageUpdate(
        address market,
        uint256 leverage,
        bool isLong
    ) external;

    /**
     * @notice Computes expected price impact for a position adjustment at current prices.
     * @param market The market for which to compute price impact for.
     * @param leverage The leverage to target.
     * @param baseAmount The margin amount to compute price impact for.
     * @param isLong Whether the position is long or short.
     * @param isDeposit Whether the adjustment is a deposit.
     * @return slippage The expected slippage for the position adjustment.
     * @return isLoss Whether the expected slippage is a loss.
     */
    function computePriceImpact(
        address market,
        uint256 leverage,
        uint256 baseAmount,
        bool isLong,
        bool isDeposit
    ) external view returns (uint256 slippage, bool isLoss);

    /**
     * @notice Returns the address for the market of the `targetAsset`.
     * @param targetAsset The asset to return the market for.
     * @return market The address for the market of the `targetAsset`.
     */
    function market(
        string calldata targetAsset
    ) external view returns (address market);

    /**
     * @notice Returns if the `account` has a pending leverage update.
     * @param market The market to check if the `account` has a pending leverage update for.
     * @param account The account to check if they have a pending leverage update.
     * @return hasPendingLeverageUpdate Whether the `account` has a pending leverage update.
     */
    function hasPendingLeverageUpdate(
        address market,
        address account
    ) external view returns (bool hasPendingLeverageUpdate);

    /**
     * @notice Returns if the `account` has an open position for the `market`.
     * @param market The market to check if the `account` has an open position for.
     * @param account The account to check if they have an open position for the `market`.
     * @return hasOpenPosition Whether the `acccount` has an open position for the `market`.
     */
    function hasOpenPosition(
        address market,
        address account
    ) external view returns (bool hasOpenPosition);

    /**
     * @notice Returns the total value of the `account`'s position for the `market` in the Base Asset.
     * @param market The market to get the total value of the `account`'s position for.
     * @param account The account to get the total value of the `account`'s position for the `market`.
     * @return totalValue The total value of the `account`'s position for the `market` in the Base Asset.
     */
    function totalValue(
        address market,
        address account
    ) external view returns (uint256 totalValue);

    /**
     * @notice Returns the deviation factor from our target leverage.
     * @dev Used for rebalances, if |1 - leverageDeviationFactor| exceeds our `rebalanceThreshold` then a rebalance is triggered.
     * When this factoris below 1, it means we are underleveraged, when it is above 1, it means we are overleveraged.
     * @param market The market to get the leverage of the `account`'s position for.
     * @param account The account to get the leverage of the `account`'s position for the `market`.
     * @return leverageDeviationFactor The deviation factor from our target leverage.
     */
    function leverageDeviationFactor(
        address market,
        address account,
        uint256 targetLeverage
    ) external view returns (uint256 leverageDeviationFactor);

    /**
     * @notice Returns the leverage of the `account`'s position for the `market`.
     * @param market The market to get the leverage of the `account`'s position for.
     * @param account The account to get the leverage of the `account`'s position for the `market`.
     * @return leverage The leverage of the `account`'s position for the `market`.
     */
    function leverage(
        address market,
        address account
    ) external view returns (uint256 leverage);

    /**
     * @notice Returns the notional value of the `account`'s position for the `market` in the Base Asset.
     * @param market The market to get the notional value of the `account`'s position for.
     * @param account The account to get the notional value of the `account`'s position for the `market`.
     * @return notionalValue The notional value of the `account`'s position for the `market` in the Base Asset.
     */
    function notionalValue(
        address market,
        address account
    ) external view returns (uint256);

    /**
     * @notice Returns if the `account`'s position for the `m` is long.
     * @dev Reverts if the `account` does not have an open position for the `targetAsset`.
     * @param market The market to check if the `account`'s position for is long.
     * @param account The account to check if the `account`'s position for the `targetAsset` is long.
     * @return isLong Whether the `account`'s position for the `market` is long.
     */
    function isLong(
        address market,
        address account
    ) external view returns (bool isLong);

    /**
     * @notice Returns the initial margin of the `account`'s position for the `market`.
     * This does not take into account any profit or loss
     * @param market The market to get the remaining margin of the `account`'s position for.
     * @param account The account to get the remaining margin of the `account`'s position for the `market`.
     * @return initialMargin The initial margin of the `account`'s position for the `market`.
     */
    function initialMargin(
        address market,
        address account
    ) external view returns (uint256 initialMargin);

    /**
     * @notice Returns the remaining margin of the `account`'s position for the `market`.
     * @param market The market to get the remaining margin of the `account`'s position for.
     * @param account The account to get the remaining margin of the `account`'s position for the `market`.
     * @return remainingMargin The remaining margin of the `account`'s position for the `market`.
     */
    function remainingMargin(
        address market,
        address account
    ) external view returns (uint256 remainingMargin);

    /**
     * @notice Returns the fill price of the `market` for a trade of `sizeDelta` tokens.
     * @param market The market to get the fill price of.
     * @param sizeDelta The amount of tokens to get the fill price for.
     * @return fillPrice The fill price of the `market` for a trade of `sizeDelta` tokens.
     */
    function fillPrice(
        address market,
        int256 sizeDelta
    ) external view returns (uint256 fillPrice);

    /**
     * @notice Returns the price of the `market`.
     * @param market The market to return the price for.
     * @return assetPrice The price of the `market`.
     */
    function assetPrice(
        address market
    ) external view returns (uint256 assetPrice);

    /**
     * @notice Returns if the `targetAsset` is supported.
     * @param targetAsset The asset to check if it is supported.
     * @return isSupported Whether the `targetAsset` is supported.
     */
    function isAssetSupported(
        string calldata targetAsset
    ) external view returns (bool isSupported);

    /**
     * @notice Returns the Maximum Market value for the `targetAsset`.
     * @param targetAsset The asset to get the Maximum Market value for.
     * @param market The market to get the Maximum Market value for.
     * @return maxMarketValue The Maximum Market value for the `targetAsset`.
     */
    function maxMarketValue(
        string calldata targetAsset,
        address market
    ) external view returns (uint256 maxMarketValue);

    /**
     * @notice Returns the maximum leverage allowed for the `targetAsset`.
     * @param targetAsset The asset to check the maximum leverage allowed for.
     * @return maxLeverage The maximum leverage allowed for the `targetAsset`.
     */
    function maxLeverage(
        string calldata targetAsset
    ) external view returns (uint256 maxLeverage);
}

File 20 of 21 : IParameterProvider.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IParameterProvider {
    struct Parameter {
        bytes32 key;
        uint256 value;
    }

    event ParameterUpdated(bytes32 indexed key, uint256 value);
    event RebalanceThresholdUpdated(address leveragedToken, uint256 value);

    error InvalidRebalanceThreshold();
    error NonExistentParameter(bytes32 key);

    /**
     * @notice Updates a parameter for the given key.
     * @param key The key of the parameter to be updated.
     * @param value The value of the parameter to be updated.
     */
    function updateParameter(bytes32 key, uint256 value) external;

    /**
     * @notice Updates the rebalance threshold for the `leveragedToken`.
     * @param leveragedToken The address of the leveraged token.
     * @param value The new rebalance threshold.
     */
    function updateRebalanceThreshold(
        address leveragedToken,
        uint256 value
    ) external;

    /**
     * @notice Returns the parameter for a given key.
     * @param key The key of the parameter to be returned.
     * @return value The parameter  for the given key.
     */
    function parameterOf(bytes32 key) external view returns (uint256 value);

    /**
     * @notice Returns the redemption fee parameter.
     * @return redemptionFee The redemption fee parameter.
     */
    function redemptionFee() external view returns (uint256);

    /**
     * @notice Returns the streaming fee parameter.
     * @return streamingFee The streaming fee parameter.
     */
    function streamingFee() external view returns (uint256);

    /**
     * @notice Returns the rebalance fee charged for rebalances in baseAsset.
     * @return rebalanceFee The rebalance fee.
     */
    function rebalanceFee() external view returns (uint256 rebalanceFee);

    /**
     * @notice Returns the percent buffer applied on the `maxBaseAssetAmount`.
     * @return maxBaseAssetAmountBuffer The percent buffer applied on the `maxBaseAssetAmount`.
     */
    function maxBaseAssetAmountBuffer()
        external
        view
        returns (uint256 maxBaseAssetAmountBuffer);

    /**
     * @notice Returns all parameters.
     * @return parameters All parameters.
     */
    function parameters() external view returns (Parameter[] memory parameters);

    /**
     * @notice Returns the rebalance threshold for the `leveragedToken`.
     * @param leveragedToken The address of the leveraged token.
     * @return rebalanceThreshold The rebalance threshold of the `leveragedToken`.
     */
    function rebalanceThreshold(
        address leveragedToken
    ) external view returns (uint256 rebalanceThreshold);
}

File 21 of 21 : IZapSwap.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface IZapSwap {
    struct SwapData {
        bool supported;
        bool direct;
        address bridgeAsset;
        bool zapAssetSwapStable;
        bool baseAssetSwapStable;
        address zapAssetFactory;
        address baseAssetFactory;
        bool swapZapAssetOnUni;
        uint24 uniPoolFee;
    }

    event Minted(
        address indexed account,
        address indexed leveragedToken,
        address assetIn,
        uint256 amountIn,
        uint256 leveragedTokenAmountOut
    );
    event Redeemed(
        address indexed account,
        address indexed leveragedToken,
        uint256 leveragedTokenAmountIn,
        address assetOut,
        uint256 amountOut
    );
    event AssetSwapDataUpdated(address indexed zapAsset, SwapData swapData);
    event AssetSwapDataRemoved(address indexed zapAsset);

    error UnsupportedAsset();
    error BridgeAssetNotSupported();
    error BridgeAssetDependency(address dependentZapAsset);

    /**
     * @notice Sets the swap data for a zap asset.
     * @param zapAsset The address of the new zap asset.
     * @param swapData The swap data describing the swap route.
     */
    function setAssetSwapData(
        address zapAsset,
        SwapData memory swapData
    ) external;

    /**
     * @notice Removes an asset from supported zap assets.
     * @param zapAsset The address of the zap asset to be removed.
     */
    function removeAssetSwapData(address zapAsset) external;

    /**
     * @notice Returns the swap data of a zap asset.
     * @param zapAsset The address of the zap asset.
     * @return swapData The swap data of the zap asset.
     */
    function swapData(
        address zapAsset
    ) external returns (SwapData memory swapData);

    /**
     * @notice Returns all assets supported by the zap.
     * @return assets An array of all assets supported by the zap.
     */
    function supportedZapAssets() external returns (address[] memory assets);

    /**
     * @notice Swaps the zap asset for the base asset and mints the target leveraged tokens for the caller.
     * @param zapAssetAddress The address of the asset used for minting.
     * @param leveragedTokenAddress Address of target leveraged token to mint.
     * @param zapAssetAmountIn The amount of the zap asset to mint with.
     * @param minLeveragedTokenAmountOut The minimum amount of leveraged tokens to receive (reverts otherwise).
     * @return leveragedTokenAmountOut The amount of leveraged tokens minted.
     */
    function mint(
        address zapAssetAddress,
        address leveragedTokenAddress,
        uint256 zapAssetAmountIn,
        uint256 minLeveragedTokenAmountOut
    ) external returns (uint256 leveragedTokenAmountOut);

    /**
     * @notice Redeems the target leveraged tokens, swaps the base asset for the zap asset and returns the zap asset to the caller.
     * @param zapAssetAddress The address of the asset received upon redeeming.
     * @param leveragedTokenAddress The address of the target leveraged token to redeem.
     * @param leveragedTokenAmountIn The amount of the leveraged tokens to redeem.
     * @param minZapAssetAmountOut The minimum amount of the zap asset to receive (reverts otherwise).
     * @return zapAssetAmountOut The amount of zap asset received.
     */
    function redeem(
        address zapAssetAddress,
        address leveragedTokenAddress,
        uint256 leveragedTokenAmountIn,
        uint256 minZapAssetAmountOut
    ) external returns (uint256 zapAssetAmountOut);
}

Settings
{
  "remappings": [
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "chainlink/=lib/chainlink/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "pyth-sdk-solidity/=lib/pyth-sdk-solidity/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"addressProvider_","type":"address"},{"internalType":"uint256","name":"unstakeDelay_","type":"uint256"},{"internalType":"address","name":"rewardToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ClaimingAlreadyEnabled","type":"error"},{"inputs":[],"name":"ClaimingNotEnabled","type":"error"},{"inputs":[],"name":"DoesNotExist","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotUnstaked","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"inputs":[],"name":"ZeroBalance","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DonatedRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"PreparedUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Restaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"accountFrom","type":"address"},{"indexed":true,"internalType":"address","name":"accountTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"accountFrom","type":"address"},{"indexed":true,"internalType":"address","name":"accountTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"activeBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimingEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"donateRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableClaiming","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"listQueuedUnstakes","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unstakeTime","type":"uint256"}],"internalType":"struct Unstakes.UserUnstakeData[]","name":"unstakes","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"prepareUnstake","outputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawalId_","type":"uint256"}],"name":"restake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"address","name":"account_","type":"address"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPrepared","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"withdrawalId_","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unstakeDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"uint256","name":"withdrawalId_","type":"uint256"}],"name":"unstakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100346100d657601f6116ad38819003918201601f19168301916001600160401b038311848410176100db578084926060946040528339810103126100d657610048816100f1565b6100596040602084015193016100f1565b6001600160a01b03909116608081905260a05260c05260e0526040516115a79081610106823960805181610a8d015260a051818181610502015281816107c801528181610bb801528181610ecf0152610ffe015260c051818181610121015281816101b5015261130a015260e05181818161077401526108fd0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036100d65756fe608060408181526004918236101561001657600080fd5b60009283803560e01c92836306fdde0314610b8b57505081630e141a9b14610b67578163149ee6a514610b485781632081a88c14610a60578163265c7760146108b35781632e17de7814610895578163313ce567146107975781633222012f1461075c57816336ef088c14610737578163402914f5146106f15781634e71d92d146106bd57816351746bb21461068e57816359f769a91461066157816370a0823114610629578163817b1cd21461060b57816395d89b41146104d1578163a694fc3a146104af578163bce1b52014610430578163c3ae1983146102af578163decb7bcb14610154575063f7c618c11461010e57600080fd5b34610150578160031936011261015057517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b8383346101505760203660031901126101505782359081156102a05761017e845460065490610e14565b80156102905781516323b872dd60e01b815233868201908152306020828101919091526040820186905290829081906060010381887f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561028657610257575b50670de0b6b3a76400008302670de0b6b3a763ffff1984820401610244579061021591048454610df1565b8355519081527f7e5b4f1ecd550783305a91024850d04a590ca64a1977e3352c961fef3f9b770b60203392a280f35b634e487b7160e01b855260118652602485fd5b6102789060203d60201161027f575b6102708183610d44565b810190610e21565b50856101ea565b503d610266565b83513d87823e3d90fd5b815163334ab3f560e11b81528590fd5b51631f2a200560e01b81528390fd5b82843461042d57602091826003193601126101505782906001600160a01b036102d6610cdb565b168352600582528083209260019160018501948554906102f58261139d565b9661030284519889610d44565b82885261030e8361139d565b601f1901855b8181106103fa575050845b838110610377575050505080519380850191818652865180935281818701970193905b83821061034f5786880387f35b84518051895283810151848a0152810151818901526060909701969382019390850190610342565b9586610389829a98849a97989a6113df565b90549060031b1c808a5284875286888b208951906103a682610cf6565b546001600160c01b03811680835260c09190911c929091018290528951926103cd84610d28565b835288830152888201526103e1828a6113b5565b526103ec81896113b5565b50019795979694939661031f565b9785969881969a989a5161040d81610d28565b8a81528a838201528a8982015282828b0101520198969897959497610314565b80fd5b9050346104ab5760203660031901126104ab576104619061045033611167565b3384526005602052358284206111aa565b60018060c01b039061047882825116600654610e14565b600655511690519081527ffc11547e675aec955dee8afa8fab2509420a3a91ca90e88b9b95db75bdf4c00b60203392a280f35b8280fd5b839034610150576020366003190112610150576104ce90339035610fc5565b80f35b919050346104ab57826003193601126104ab5780516224262360e61b81526001600160a01b039284919060208282817f000000000000000000000000000000000000000000000000000000000000000089165afa9182156106015783926105d0575b5083516395d89b4160e01b81529485928391165afa9182156105c6578361059d94936105a1575b5050610593602282518094611cdd60f21b60208301526105838151809260208686019101610c8c565b8101036002810185520183610d44565b5191829182610caf565b0390f35b6105be9293503d8091833e6105b68183610d44565b810190610d85565b90388061055a565b81513d85823e3d90fd5b6105f391925060203d6020116105fa575b6105eb8183610d44565b810190610d66565b9038610533565b503d6105e1565b84513d85823e3d90fd5b9050346104ab57826003193601126104ab5760209250549051908152f35b5050346101505760203660031901126101505760209181906001600160a01b03610651610cdb565b1681526001845220549051908152f35b50503461015057602036600319011261015057602090610687610682610cdb565b611137565b9051908152f35b919050346104ab57366003190112610150576024356001600160a01b03811681036104ab576104ce9135610fc5565b919050346104ab57826003193601126104ab5760ff60075416156106e457826104ce6112be565b516371642c7760e11b8152fd5b50503461015057602036600319011261015057610687602092610731610715610cdb565b6001600160a01b03811683526003865284832054925490611271565b90610df1565b5050346101505736600319011261042d576104ce610753610cdb565b60243590610e39565b505034610150578160031936011261015057602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b83833461015057816003193601126101505780516224262360e61b81526020936001600160a01b03939190858282817f000000000000000000000000000000000000000000000000000000000000000089165afa91821561060157908692918492610876575b50845163313ce56760e01b81529586928391165afa92831561086a57819361082c575b505060ff905191168152f35b909192508381813d8311610863575b6108458183610d44565b8101031261015057519060ff8216820361042d57509060ff84610820565b503d61083b565b509051903d90823e3d90fd5b61088e919250833d85116105fa576105eb8183610d44565b90876107fd565b839034610150576020366003190112610150576104ce903533610e39565b919050346104ab576020928360031936011261042d578235928315610a5257836108dc33611137565b10610a44579083916108ed33611167565b33825260058652838220916109227f000000000000000000000000000000000000000000000000000000000000000042610df1565b91876003850193610989886001888767ffffffffffffffff95868b54169e8f95858060c01b039d8e8093169a8883519661095b88610cf6565b8d88528c8389019716875252528b209251169067ffffffffffffffff60c01b905160c01b16179055016113f7565b50845490808216818114610a3157600101169067ffffffffffffffff191617808555871c01938411610a1e575050805467ffffffffffffffff1660409290921b67ffffffffffffffff19169190911790556109e681600654610df1565b600655815190815282848201527ff6fd3987ffa89628a233283807e8912d77e55fe1289879e7067c23279c0ae22e823392a251908152f35b634e487b7160e01b825260119052602490fd5b634e487b7160e01b865260118552602486fd5b8251631e9acf1760e31b8152fd5b8251631f2a200560e01b8152fd5b9050346104ab57826003193601126104ab578151638da5cb5b60e01b81526001600160a01b0360208284817f000000000000000000000000000000000000000000000000000000000000000085165afa918215610b3e578592610afd575b5033911603610aef576007549160ff8316610ae25760ff1983166001176007558380f35b51635f9bf30360e11b8152fd5b90516330cd747160e01b8152fd5b9091506020813d602011610b36575b81610b1960209383610d44565b81010312610b3257518181168103610b32579038610abe565b8480fd5b3d9150610b0c565b84513d87823e3d90fd5b5050346101505781600319360112610150576020906006549051908152f35b50503461015057816003193601126101505760209060ff6007541690519015158152f35b84828492346101505781600319360112610150576224262360e61b81526001600160a01b039360208282817f000000000000000000000000000000000000000000000000000000000000000089165afa918215610601578392610c6b575b5083516306fdde0360e01b81529485928391165afa9182156105c6578361059d9493610c4e575b505061059360278251809466029ba30b5b2b2160cd1b6020830152610c3e8151809260208686019101610c8c565b8101036007810185520183610d44565b610c639293503d8091833e6105b68183610d44565b908380610c10565b610c8591925060203d6020116105fa576105eb8183610d44565b9086610be9565b60005b838110610c9f5750506000910152565b8181015183820152602001610c8f565b60409160208252610ccf8151809281602086015260208686019101610c8c565b601f01601f1916010190565b600435906001600160a01b0382168203610cf157565b600080fd5b6040810190811067ffffffffffffffff821117610d1257604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff821117610d1257604052565b90601f8019910116810190811067ffffffffffffffff821117610d1257604052565b90816020910312610cf157516001600160a01b0381168103610cf15790565b602081830312610cf157805167ffffffffffffffff91828211610cf157019082601f83011215610cf1578151908111610d125760405192610dd0601f8301601f191660200185610d44565b81845260208284010111610cf157610dee9160208085019101610c8c565b90565b91908201809211610dfe57565b634e487b7160e01b600052601160045260246000fd5b91908203918211610dfe57565b90816020910312610cf157518015158103610cf15790565b9190610e4433611167565b60009233845260209160058352610e5f6040918287206111aa565b67ffffffffffffffff84820151164210610fb45760018060c01b039051169133865260018452818620610e93848254610e14565b9055610ea183600454610e14565b600455610eb083600654610e14565b60065581516224262360e61b81526001600160a01b03929085816004817f000000000000000000000000000000000000000000000000000000000000000088165afa908115610f8d578891610f97575b50815163a9059cbb60e01b81526001600160a01b038416600482015260248101869052908690829060449082908c9089165af18015610f8d577fd8654fcc8cf5b36d30b3f5e4688fc78118e6d68de60b9994e09902268b57c3e39596979850610f70575b505193845216923392a3565b610f8690873d891161027f576102708183610d44565b5038610f64565b82513d8a823e3d90fd5b610fae9150863d88116105fa576105eb8183610d44565b38610f00565b8151630b2aa99d60e01b8152600490fd5b8015611125576001600160a01b0382811692831561111357610fe690611167565b604080516224262360e61b81526020929083816004817f000000000000000000000000000000000000000000000000000000000000000086165afa9081156111085791849160009384916110eb575b5084516323b872dd60e01b815233600482015230602482015260448101889052938492606492849291165af180156110e057907f5dac0c1b1112564a045ba943c9d50270893e8e826c49be8e7073adc713ab7bd79392916110c3575b508460005260018252806000206110a9858254610df1565b90556110b784600454610df1565b600455519283523392a3565b6110d990833d851161027f576102708183610d44565b5038611091565b82513d6000823e3d90fd5b6111029150833d85116105fa576105eb8183610d44565b38611035565b83513d6000823e3d90fd5b60405163d92e233d60e01b8152600490fd5b604051631f2a200560e01b8152600490fd5b60018060a01b03166000526001602052610dee604060002054600560205260036040600020015460401c90610e14565b600054906111758282611271565b9060018060a01b0316908160005260036020526111986040600020918254610df1565b90556000526002602052604060002055565b60209092919260409081516111be81610cf6565b600093818580935201526111d58560018301611481565b156112605784835280602052818320948251956111f187610cf6565b546001600160c01b0380821680895260c09290921c6020890152600384018054861c929092039190821161124c57805467ffffffffffffffff1660409290921b67ffffffffffffffff19169190911790558352602052812055565b634e487b7160e01b86526011600452602486fd5b815163b0ce759160e01b8152600490fd5b6001600160a01b038116600090815260026020526040902054909161129f9161129991610e14565b91611137565b90818102918183041490151715610dfe57670de0b6b3a7640000900490565b6112c733611167565b33600052600360205260406000208054908115611399576000905560405163a9059cbb60e01b8152336004820152602481018290526020818060448101038160007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561138d5761136e575b506040519081527fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a60203392a2565b6113869060203d60201161027f576102708183610d44565b503861133f565b6040513d6000823e3d90fd5b5050565b67ffffffffffffffff8111610d125760051b60200190565b80518210156113c95760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b80548210156113c95760005260206000200190600090565b9190600183016000908282528060205260408220541560001461147b57845494680100000000000000008610156114675783611457611440886001604098999a018555846113df565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9060018201906000928184528260205260408420549081151560001461156a5760001991808301818111611556578254908482019182116115425781810361150d575b505050805480156114f9578201916114dc83836113df565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61152d61151d61144093866113df565b90549060031b1c928392866113df565b905586528460205260408620553880806114c4565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea264697066735822122080a0dcdc4a51c39e44398f5c2225d7e5a48f2f049b1b053edf988c18ff2cbc8e64736f6c63430008180033000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e200000000000000000000000000000000000000000000000000000000000697800000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d9

Deployed Bytecode

0x608060408181526004918236101561001657600080fd5b60009283803560e01c92836306fdde0314610b8b57505081630e141a9b14610b67578163149ee6a514610b485781632081a88c14610a60578163265c7760146108b35781632e17de7814610895578163313ce567146107975781633222012f1461075c57816336ef088c14610737578163402914f5146106f15781634e71d92d146106bd57816351746bb21461068e57816359f769a91461066157816370a0823114610629578163817b1cd21461060b57816395d89b41146104d1578163a694fc3a146104af578163bce1b52014610430578163c3ae1983146102af578163decb7bcb14610154575063f7c618c11461010e57600080fd5b34610150578160031936011261015057517f0000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d96001600160a01b03168152602090f35b5080fd5b8383346101505760203660031901126101505782359081156102a05761017e845460065490610e14565b80156102905781516323b872dd60e01b815233868201908152306020828101919091526040820186905290829081906060010381887f0000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d96001600160a01b03165af1801561028657610257575b50670de0b6b3a76400008302670de0b6b3a763ffff1984820401610244579061021591048454610df1565b8355519081527f7e5b4f1ecd550783305a91024850d04a590ca64a1977e3352c961fef3f9b770b60203392a280f35b634e487b7160e01b855260118652602485fd5b6102789060203d60201161027f575b6102708183610d44565b810190610e21565b50856101ea565b503d610266565b83513d87823e3d90fd5b815163334ab3f560e11b81528590fd5b51631f2a200560e01b81528390fd5b82843461042d57602091826003193601126101505782906001600160a01b036102d6610cdb565b168352600582528083209260019160018501948554906102f58261139d565b9661030284519889610d44565b82885261030e8361139d565b601f1901855b8181106103fa575050845b838110610377575050505080519380850191818652865180935281818701970193905b83821061034f5786880387f35b84518051895283810151848a0152810151818901526060909701969382019390850190610342565b9586610389829a98849a97989a6113df565b90549060031b1c808a5284875286888b208951906103a682610cf6565b546001600160c01b03811680835260c09190911c929091018290528951926103cd84610d28565b835288830152888201526103e1828a6113b5565b526103ec81896113b5565b50019795979694939661031f565b9785969881969a989a5161040d81610d28565b8a81528a838201528a8982015282828b0101520198969897959497610314565b80fd5b9050346104ab5760203660031901126104ab576104619061045033611167565b3384526005602052358284206111aa565b60018060c01b039061047882825116600654610e14565b600655511690519081527ffc11547e675aec955dee8afa8fab2509420a3a91ca90e88b9b95db75bdf4c00b60203392a280f35b8280fd5b839034610150576020366003190112610150576104ce90339035610fc5565b80f35b919050346104ab57826003193601126104ab5780516224262360e61b81526001600160a01b039284919060208282817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e289165afa9182156106015783926105d0575b5083516395d89b4160e01b81529485928391165afa9182156105c6578361059d94936105a1575b5050610593602282518094611cdd60f21b60208301526105838151809260208686019101610c8c565b8101036002810185520183610d44565b5191829182610caf565b0390f35b6105be9293503d8091833e6105b68183610d44565b810190610d85565b90388061055a565b81513d85823e3d90fd5b6105f391925060203d6020116105fa575b6105eb8183610d44565b810190610d66565b9038610533565b503d6105e1565b84513d85823e3d90fd5b9050346104ab57826003193601126104ab5760209250549051908152f35b5050346101505760203660031901126101505760209181906001600160a01b03610651610cdb565b1681526001845220549051908152f35b50503461015057602036600319011261015057602090610687610682610cdb565b611137565b9051908152f35b919050346104ab57366003190112610150576024356001600160a01b03811681036104ab576104ce9135610fc5565b919050346104ab57826003193601126104ab5760ff60075416156106e457826104ce6112be565b516371642c7760e11b8152fd5b50503461015057602036600319011261015057610687602092610731610715610cdb565b6001600160a01b03811683526003865284832054925490611271565b90610df1565b5050346101505736600319011261042d576104ce610753610cdb565b60243590610e39565b505034610150578160031936011261015057602090517f00000000000000000000000000000000000000000000000000000000000697808152f35b83833461015057816003193601126101505780516224262360e61b81526020936001600160a01b03939190858282817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e289165afa91821561060157908692918492610876575b50845163313ce56760e01b81529586928391165afa92831561086a57819361082c575b505060ff905191168152f35b909192508381813d8311610863575b6108458183610d44565b8101031261015057519060ff8216820361042d57509060ff84610820565b503d61083b565b509051903d90823e3d90fd5b61088e919250833d85116105fa576105eb8183610d44565b90876107fd565b839034610150576020366003190112610150576104ce903533610e39565b919050346104ab576020928360031936011261042d578235928315610a5257836108dc33611137565b10610a44579083916108ed33611167565b33825260058652838220916109227f000000000000000000000000000000000000000000000000000000000006978042610df1565b91876003850193610989886001888767ffffffffffffffff95868b54169e8f95858060c01b039d8e8093169a8883519661095b88610cf6565b8d88528c8389019716875252528b209251169067ffffffffffffffff60c01b905160c01b16179055016113f7565b50845490808216818114610a3157600101169067ffffffffffffffff191617808555871c01938411610a1e575050805467ffffffffffffffff1660409290921b67ffffffffffffffff19169190911790556109e681600654610df1565b600655815190815282848201527ff6fd3987ffa89628a233283807e8912d77e55fe1289879e7067c23279c0ae22e823392a251908152f35b634e487b7160e01b825260119052602490fd5b634e487b7160e01b865260118552602486fd5b8251631e9acf1760e31b8152fd5b8251631f2a200560e01b8152fd5b9050346104ab57826003193601126104ab578151638da5cb5b60e01b81526001600160a01b0360208284817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e285165afa918215610b3e578592610afd575b5033911603610aef576007549160ff8316610ae25760ff1983166001176007558380f35b51635f9bf30360e11b8152fd5b90516330cd747160e01b8152fd5b9091506020813d602011610b36575b81610b1960209383610d44565b81010312610b3257518181168103610b32579038610abe565b8480fd5b3d9150610b0c565b84513d87823e3d90fd5b5050346101505781600319360112610150576020906006549051908152f35b50503461015057816003193601126101505760209060ff6007541690519015158152f35b84828492346101505781600319360112610150576224262360e61b81526001600160a01b039360208282817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e289165afa918215610601578392610c6b575b5083516306fdde0360e01b81529485928391165afa9182156105c6578361059d9493610c4e575b505061059360278251809466029ba30b5b2b2160cd1b6020830152610c3e8151809260208686019101610c8c565b8101036007810185520183610d44565b610c639293503d8091833e6105b68183610d44565b908380610c10565b610c8591925060203d6020116105fa576105eb8183610d44565b9086610be9565b60005b838110610c9f5750506000910152565b8181015183820152602001610c8f565b60409160208252610ccf8151809281602086015260208686019101610c8c565b601f01601f1916010190565b600435906001600160a01b0382168203610cf157565b600080fd5b6040810190811067ffffffffffffffff821117610d1257604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff821117610d1257604052565b90601f8019910116810190811067ffffffffffffffff821117610d1257604052565b90816020910312610cf157516001600160a01b0381168103610cf15790565b602081830312610cf157805167ffffffffffffffff91828211610cf157019082601f83011215610cf1578151908111610d125760405192610dd0601f8301601f191660200185610d44565b81845260208284010111610cf157610dee9160208085019101610c8c565b90565b91908201809211610dfe57565b634e487b7160e01b600052601160045260246000fd5b91908203918211610dfe57565b90816020910312610cf157518015158103610cf15790565b9190610e4433611167565b60009233845260209160058352610e5f6040918287206111aa565b67ffffffffffffffff84820151164210610fb45760018060c01b039051169133865260018452818620610e93848254610e14565b9055610ea183600454610e14565b600455610eb083600654610e14565b60065581516224262360e61b81526001600160a01b03929085816004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e288165afa908115610f8d578891610f97575b50815163a9059cbb60e01b81526001600160a01b038416600482015260248101869052908690829060449082908c9089165af18015610f8d577fd8654fcc8cf5b36d30b3f5e4688fc78118e6d68de60b9994e09902268b57c3e39596979850610f70575b505193845216923392a3565b610f8690873d891161027f576102708183610d44565b5038610f64565b82513d8a823e3d90fd5b610fae9150863d88116105fa576105eb8183610d44565b38610f00565b8151630b2aa99d60e01b8152600490fd5b8015611125576001600160a01b0382811692831561111357610fe690611167565b604080516224262360e61b81526020929083816004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e286165afa9081156111085791849160009384916110eb575b5084516323b872dd60e01b815233600482015230602482015260448101889052938492606492849291165af180156110e057907f5dac0c1b1112564a045ba943c9d50270893e8e826c49be8e7073adc713ab7bd79392916110c3575b508460005260018252806000206110a9858254610df1565b90556110b784600454610df1565b600455519283523392a3565b6110d990833d851161027f576102708183610d44565b5038611091565b82513d6000823e3d90fd5b6111029150833d85116105fa576105eb8183610d44565b38611035565b83513d6000823e3d90fd5b60405163d92e233d60e01b8152600490fd5b604051631f2a200560e01b8152600490fd5b60018060a01b03166000526001602052610dee604060002054600560205260036040600020015460401c90610e14565b600054906111758282611271565b9060018060a01b0316908160005260036020526111986040600020918254610df1565b90556000526002602052604060002055565b60209092919260409081516111be81610cf6565b600093818580935201526111d58560018301611481565b156112605784835280602052818320948251956111f187610cf6565b546001600160c01b0380821680895260c09290921c6020890152600384018054861c929092039190821161124c57805467ffffffffffffffff1660409290921b67ffffffffffffffff19169190911790558352602052812055565b634e487b7160e01b86526011600452602486fd5b815163b0ce759160e01b8152600490fd5b6001600160a01b038116600090815260026020526040902054909161129f9161129991610e14565b91611137565b90818102918183041490151715610dfe57670de0b6b3a7640000900490565b6112c733611167565b33600052600360205260406000208054908115611399576000905560405163a9059cbb60e01b8152336004820152602481018290526020818060448101038160007f0000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d96001600160a01b03165af1801561138d5761136e575b506040519081527fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a60203392a2565b6113869060203d60201161027f576102708183610d44565b503861133f565b6040513d6000823e3d90fd5b5050565b67ffffffffffffffff8111610d125760051b60200190565b80518210156113c95760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b80548210156113c95760005260206000200190600090565b9190600183016000908282528060205260408220541560001461147b57845494680100000000000000008610156114675783611457611440886001604098999a018555846113df565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9060018201906000928184528260205260408420549081151560001461156a5760001991808301818111611556578254908482019182116115425781810361150d575b505050805480156114f9578201916114dc83836113df565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61152d61151d61144093866113df565b90549060031b1c928392866113df565b905586528460205260408620553880806114c4565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea264697066735822122080a0dcdc4a51c39e44398f5c2225d7e5a48f2f049b1b053edf988c18ff2cbc8e64736f6c63430008180033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e200000000000000000000000000000000000000000000000000000000000697800000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d9

-----Decoded View---------------
Arg [0] : addressProvider_ (address): 0xbaA87EcC5Dd76526b51AB7FD2d0c814EB967E2E2
Arg [1] : unstakeDelay_ (uint256): 432000
Arg [2] : rewardToken_ (address): 0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e2
Arg [1] : 0000000000000000000000000000000000000000000000000000000000069780
Arg [2] : 0000000000000000000000008c6f28f2f1a3c87f0f938b96d27520d9751ec8d9


Deployed Bytecode Sourcemap

479:4725:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1838:22:3;479:4725:4;1838:22:3;;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;812:45:3;-1:-1:-1;;;;;479:4725:4;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;1230:12;;;1226:37;;1292:27;479:4725;;1306:13;479:4725;1292:27;;:::i;:::-;1333:13;;1329:39;;479:4725;;-1:-1:-1;;;1379:68:4;;1412:10;1379:68;;;479:4725;;;1432:4;479:4725;;;;;;;;;;;;;;;;;;;;;1379:68;479:4725;;1386:11;-1:-1:-1;;;;;479:4725:4;1379:68;;;;;;;;479:4725;-1:-1:-1;133:2:18;;;-1:-1:-1;;133:2:18;;;;;;;1458:40:4;133:2:18;;479:4725:4;;1458:40;:::i;:::-;479:4725;;;;;;1514:35;479:4725;1412:10;1514:35;;479:4725;;133:2:18;-1:-1:-1;;;479:4725:4;;;;;;;;1379:68;;;479:4725;1379:68;479:4725;1379:68;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;479:4725;;;;;;;;;1329:39;479:4725;;-1:-1:-1;;;1355:13:4;;479:4725;;1355:13;1226:37;479:4725;-1:-1:-1;;;1251:12:4;;479:4725;;1251:12;479:4725;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;479:4725:4;;:::i;:::-;;;;2027:15;479:4725;;;;;1567:9:19;;;;;;479:4725:4;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;-1:-1:-1;;479:4725:4;;;;;;;;1654:10:19;;;1666:12;;;;;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1680:4:19;5016:18:2;;;;;;;;;;;;:::i;:::-;479:4725:4;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;-1:-1:-1;;;;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;1830:152:19;;;479:4725:4;1830:152:19;;;479:4725:4;1812:170:19;;;;:::i;:::-;;;;;;:::i;:::-;;479:4725:4;1654:10:19;;;;;;;;;479:4725:4;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;3542:62;3478:10;;;;:::i;:::-;;479:4725;;3542:15;479:4725;;;;;;3542:62;:::i;:::-;479:4725;;;;;;3614:35;479:4725;;;;3614:35;479:4725;3614:35;:::i;:::-;;479:4725;;;;;;;;3665:40;479:4725;3478:10;3665:40;;479:4725;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;1832:10;;;479:4725;;1832:10;:::i;:::-;479:4725;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;4824:22:4;;-1:-1:-1;;;;;479:4725:4;;;;4824:22;479:4725;;;4824:16;479:4725;;4824:22;;;;;;;;;;;479:4725;-1:-1:-1;479:4725:4;;-1:-1:-1;;;4824:31:4;;479:4725;;;;;;4824:31;;;;;;;;479:4725;4824:31;;;;479:4725;;;;;;;;;-1:-1:-1;;;4824:22:4;479:4725;;;;;;;;4824:22;479:4725;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;4824:31;;;;;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;479:4725;;;;;;;;;4824:22;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;479:4725;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;;-1:-1:-1;;;;;479:4725:4;;:::i;:::-;;;;1547:9:3;479:4725:4;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;-1:-1:-1;;;;;479:4725:4;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;1650:15;479:4725;;1649:16;1645:49;;;;;:::i;:::-;479:4725;-1:-1:-1;;;1674:20:4;;;479:4725;;;;;;;;-1:-1:-1;;479:4725:4;;;;1323:66:3;479:4725:4;;1349:40:3;479:4725:4;;:::i;:::-;-1:-1:-1;;;;;479:4725:4;;;;1323:13:3;479:4725:4;;;;;;;;;1349:40:3;:::i;:::-;1323:66;;:::i;479:4725:4:-;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;;;;;;;713:46;479:4725;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1838:22:3;;;;-1:-1:-1;;;;;479:4725:4;;;1838:22:3;479:4725:4;1838:16:3;479:4725:4;1838:16:3;479:4725:4;;1838:22:3;;;;;;;;;;;;;;;479:4725:4;-1:-1:-1;479:4725:4;;-1:-1:-1;;;1838:33:3;;479:4725:4;;;;;;1838:33:3;;;;;;;;;;;479:4725:4;;;;;;;;;;;1838:33:3;;;;;;;;;;;;;;;;;;:::i;:::-;;;479:4725:4;;;;;;;;;;;;;-1:-1:-1;1838:33:3;479:4725:4;1838:33:3;;;;;;;;;479:4725:4;;;;;;;;;;;1838:22:3;;;;;;;;;;;;;;;:::i;:::-;;;;;479:4725:4;;;;;;;;-1:-1:-1;;479:4725:4;;;;3345:13;479:4725;;3333:10;3345:13;:::i;479:4725::-;;;;;;;;;;;;;;;;;;;2666:12;;;2662:37;;2729:10;2713:27;2729:10;2713:27;:::i;:::-;:37;2709:71;;2729:10;;;2803;2729;2803;:::i;:::-;2729;479:4725;;2829:15;479:4725;;;;;2915:12;2897:30;2915:12;2897:15;:30;:::i;:::-;799:12:19;;;;;479:4725:4;10894:32:2;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;845:108:19;;;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;963:9:19;10894:32:2;:::i;:::-;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;2947:24;479:4725;2947:24;479:4725;2947:24;:::i;:::-;;479:4725;;;;;;;;;;;2987:40;2729:10;;2987:40;;479:4725;;;;;;-1:-1:-1;;;479:4725:4;;;;;;;;;-1:-1:-1;;;479:4725:4;;;;;;;;2709:71;479:4725;;-1:-1:-1;;;2759:21:4;;;2662:37;479:4725;;-1:-1:-1;;;2687:12:4;;;479:4725;;;;;;;;;;;;;;;;-1:-1:-1;;;283:24:20;;-1:-1:-1;;;;;283:24:20;479:4725:4;283:16:20;479:4725:4;283:16:20;479:4725:4;;283:24:20;;;;;;;;;;;479:4725:4;311:10:20;;479:4725:4;;283:38:20;279:86;;3134:15:4;479:4725;;;;;3130:52;;-1:-1:-1;;479:4725:4;;3211:4;479:4725;3134:15;479:4725;;;;3130:52;479:4725;-1:-1:-1;;;3158:24:4;;;279:86:20;479:4725:4;;-1:-1:-1;;;344:10:20;;;283:24;;;;;;;;;;;;;;;;;;:::i;:::-;;;479:4725:4;;;;;;;;;;;;283:24:20;;;;479:4725:4;;;;283:24:20;;;-1:-1:-1;283:24:20;;;479:4725:4;;;;;;;;;;;;;;;;;;;;;;;;;793:37;479:4725;;;;;;;;;;;;;;;;;;;;;;;;864:36;479:4725;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;5000:22:4;;-1:-1:-1;;;;;479:4725:4;5000:22;;479:4725;5000:22;:16;479:4725;;5000:22;;;;;;;;;;;479:4725;-1:-1:-1;479:4725:4;;-1:-1:-1;;;5000:29:4;;479:4725;;;;;;5000:29;;;;;;;;479:4725;5000:29;;;;479:4725;;;;;;;;;-1:-1:-1;;;5000:22:4;479:4725;;;;;;;;5000:22;479:4725;;;;;;:::i;:::-;;;;;;;;;;;;:::i;5000:29::-;;;;;;;;;;;;;;:::i;:::-;;;;;;:22;;;;;;;;;;;;;;;:::i;:::-;;;;;479:4725;;;;;;;;-1:-1:-1;;479:4725:4;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;479:4725:4;;;;:::o;:::-;;;;-1:-1:-1;;;;;479:4725:4;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;-1:-1:-1;;;;;479:4725:4;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;:::o;3746:648::-;;;3867:10;;;:::i;:::-;-1:-1:-1;3867:10:4;;479:4725;;;;3931:15;479:4725;;3931:62;479:4725;;;;;3931:62;:::i;:::-;479:4725;4026:23;;;479:4725;;4078:15;-1:-1:-1;4059:56:4;;479:4725;;;;;;;;3867:10;;479:4725;;4173:9;479:4725;;;;;4173:32;479:4725;;;4173:32;:::i;:::-;479:4725;;4215:22;479:4725;4215:22;479:4725;4215:22;:::i;:::-;;479:4725;4247:24;479:4725;4247:24;479:4725;4247:24;:::i;:::-;;479:4725;;;-1:-1:-1;;;4282:22:4;;-1:-1:-1;;;;;479:4725:4;;4282:16;479:4725;4215:22;479:4725;4282:16;479:4725;;4282:22;;;;;;;;;;;3746:648;-1:-1:-1;479:4725:4;;-1:-1:-1;;;4282:50:4;;-1:-1:-1;;;;;479:4725:4;;4215:22;4282:50;;479:4725;;;;;;;;;;;;;;;;4282:50;;479:4725;;4282:50;;;;;;4348:39;4282:50;;;;;;;3746:648;479:4725;;;;;;3867:10;;4348:39;;3746:648::o;4282:50::-;;;;;;;;;;;;;:::i;:::-;;;;;;479:4725;;;;;;;;;4282:22;;;;;;;;;;;;;;:::i;:::-;;;;4059:56;479:4725;;-1:-1:-1;;;4102:13:4;;;;;2099:427;2182:12;;2178:37;;-1:-1:-1;;;;;479:4725:4;;;;2229:22;;2225:55;;2303:8;;;:::i;:::-;479:4725;;;-1:-1:-1;;;2323:22:4;;;;479:4725;2323:22;479:4725;2323:22;479:4725;2323:16;479:4725;;2323:22;;;;;;;;;;2193:1;2323:22;;;;;2099:427;-1:-1:-1;479:4725:4;;-1:-1:-1;;;2323:71:4;;2359:10;2323:22;:71;;479:4725;2379:4;479:4725;;;;;;;;;;;;;;;;;;;2323:71;;;;;;;2482:37;2323:71;;;;;2099:427;479:4725;;2193:1;479:4725;2404:9;479:4725;;;2193:1;479:4725;2404:30;479:4725;;;2404:30;:::i;:::-;479:4725;;2444:22;479:4725;2323:22;479:4725;2444:22;:::i;:::-;2323;479:4725;;;;;2359:10;2482:37;;2099:427::o;2323:71::-;;;;;;;;;;;;;:::i;:::-;;;;;;479:4725;;;2193:1;479:4725;;;;;2323:22;;;;;;;;;;;;;;:::i;:::-;;;;;479:4725;;;2193:1;479:4725;;;;;2225:55;479:4725;;-1:-1:-1;;;2260:20:4;;;;;2178:37;479:4725;;-1:-1:-1;;;2203:12:4;;;;;4438:252;479:4725;;;;;;-1:-1:-1;479:4725:4;4624:9;479:4725;;4624:59;479:4725;-1:-1:-1;479:4725:4;;4646:15;479:4725;;4646:37;479:4725;-1:-1:-1;479:4725:4;4646:37;479:4725;;;4624:59;;:::i;1884:268:3:-;1997:15;479:4725:4;2049:38:3;;;;;:::i;:::-;479:4725:4;;;;;;;;;1997:15:3;479:4725:4;2022:13:3;479:4725:4;;2022:65:3;479:4725:4;1997:15:3;479:4725:4;;;;2022:65:3;:::i;:::-;479:4725:4;;1997:15:3;479:4725:4;2097:20:3;479:4725:4;;;1997:15:3;479:4725:4;;1884:268:3:o;1083:333:19:-;479:4725:4;1083:333:19;;;;479:4725:4;;;;;;;:::i;:::-;-1:-1:-1;479:4725:4;;;;;;;;11194:35:2;1226:9:19;;;;11194:35:2;:::i;:::-;1225:22:19;1221:56;;479:4725:4;;;;;;;;;;;;;;;;:::i;:::-;;-1:-1:-1;;;;;479:4725:4;;;;;;;;;;;;;;;1332:17:19;;;479:4725:4;;;;;;;;;1332:17:19;479:4725:4;;;;;;;;;;;;;-1:-1:-1;;479:4725:4;;;;;;;;;;;;;;1083:333:19:o;479:4725:4:-;-1:-1:-1;;;479:4725:4;;;;;;;;1221:56:19;479:4725:4;;-1:-1:-1;;;1256:21:19;;;;;2519:260:3;-1:-1:-1;;;;;479:4725:4;;-1:-1:-1;479:4725:4;;;2685:20:3;479:4725:4;;;;;;2519:260:3;;2746:25;;2667:48;;;:::i;:::-;2746:25;;:::i;:::-;133:2:18;;;;;;;;;;;;;;;;;;2519:260:3;:::o;2158:301::-;2207:10;;;:::i;:::-;;-1:-1:-1;479:4725:4;2247:13:3;479:4725:4;;;-1:-1:-1;479:4725:4;;;2286:12:3;;;2282:25;;-1:-1:-1;479:4725:4;;;;-1:-1:-1;;;2359:49:3;;2207:10;2359:49;;;479:4725:4;;;;;;;;;;;;;2359:49:3;479:4725:4;-1:-1:-1;2366:11:3;-1:-1:-1;;;;;479:4725:4;2359:49:3;;;;;;;;2158:301;479:4725:4;;;;;;2424:28:3;479:4725:4;2207:10:3;2424:28;;2158:301::o;2359:49::-;;;479:4725:4;2359:49:3;479:4725:4;2359:49:3;;;;;;;:::i;:::-;;;;;;479:4725:4;;;-1:-1:-1;479:4725:4;;;;;2282:25:3;2300:7;;:::o;479:4725:4:-;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;479:4725:4;;-1:-1:-1;479:4725:4;;;-1:-1:-1;479:4725:4;:::o;2241:406:2:-;;;4360:14;;;-1:-1:-1;479:4725:4;;;;;;;;;;;4360:26:2;2320:321;479:4725:4;;;;;;;;;;;;;;;;4360:14:2;479:4725:4;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4360:14:2;2576:11;:::o;479:4725:4:-;-1:-1:-1;;;479:4725:4;;;;;;;;2320:321:2;-1:-1:-1;2618:12:2;-1:-1:-1;;2618:12:2:o;2815:1368::-;;3010:14;;;-1:-1:-1;;479:4725:4;;;;;;;;;;;3046:13:2;;;;3042:1135;3046:13;;;-1:-1:-1;;479:4725:4;;;;;;;;;;;;;;;;;;;;3521:23:2;;;3517:378;;3042:1135;479:4725:4;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;3010:14:2;4112:11;:::o;479:4725:4:-;-1:-1:-1;;;479:4725:4;;;;;;;;3517:378:2;479:4725:4;3584:22:2;3705:23;3584:22;;;:::i;:::-;479:4725:4;;;;;;3705:23:2;;;;;:::i;479:4725:4:-;;;;;;;;;;;;3517:378:2;;;;;479:4725:4;-1:-1:-1;;;479:4725:4;;;;;;;;;-1:-1:-1;;;479:4725:4;;;;;;;;3042:1135:2;4154:12;;;;;:::o

Swarm Source

ipfs://80a0dcdc4a51c39e44398f5c2225d7e5a48f2f049b1b053edf988c18ff2cbc8e

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.