More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 6,126 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Redeem | 124064554 | 250 days ago | IN | 0 ETH | 0.000004169178 | ||||
Redeem | 124064525 | 250 days ago | IN | 0 ETH | 0.000004219032 | ||||
Redeem | 124064494 | 250 days ago | IN | 0 ETH | 0.000004235015 | ||||
Redeem | 123622833 | 260 days ago | IN | 0 ETH | 0.000335565266 | ||||
Redeem | 123622790 | 260 days ago | IN | 0 ETH | 0.000353572091 | ||||
Redeem | 123622781 | 260 days ago | IN | 0 ETH | 0.0003750216 | ||||
Redeem | 123622757 | 260 days ago | IN | 0 ETH | 0.00036218321 | ||||
Mint | 123220213 | 270 days ago | IN | 0 ETH | 0.000002269877 | ||||
Mint | 123220184 | 270 days ago | IN | 0 ETH | 0.000001700913 | ||||
Mint | 123220151 | 270 days ago | IN | 0 ETH | 0.000002440027 | ||||
Redeem | 123173769 | 271 days ago | IN | 0 ETH | 0.000001760555 | ||||
Redeem | 123153338 | 271 days ago | IN | 0 ETH | 0.000000083468 | ||||
Redeem | 123152988 | 271 days ago | IN | 0 ETH | 0.000003828071 | ||||
Mint | 123117615 | 272 days ago | IN | 0 ETH | 0.000109992719 | ||||
Mint | 123105331 | 272 days ago | IN | 0 ETH | 0.000003940292 | ||||
Mint | 123105329 | 272 days ago | IN | 0 ETH | 0.000115971803 | ||||
Mint | 123098923 | 272 days ago | IN | 0 ETH | 0.000108119038 | ||||
Mint | 123098877 | 272 days ago | IN | 0 ETH | 0.000112780159 | ||||
Mint | 123083549 | 273 days ago | IN | 0 ETH | 0.000107340531 | ||||
Mint | 123083512 | 273 days ago | IN | 0 ETH | 0.000050812475 | ||||
Mint | 123083482 | 273 days ago | IN | 0 ETH | 0.000053078259 | ||||
Mint | 123083445 | 273 days ago | IN | 0 ETH | 0.000093631539 | ||||
Mint | 123083416 | 273 days ago | IN | 0 ETH | 0.000053452344 | ||||
Mint | 123083274 | 273 days ago | IN | 0 ETH | 0.00006310026 | ||||
Mint | 123083250 | 273 days ago | IN | 0 ETH | 0.000067092877 |
View more zero value Internal Transactions in Advanced View mode
Contract Source Code Verified (Exact Match)
Contract Source Code (Solidity Standard Json-Input format)
// 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 {Errors} from "../libraries/Errors.sol"; import {IZapSwap} from "../interfaces/IZapSwap.sol"; import {IAddressProvider} from "../interfaces/IAddressProvider.sol"; import {IVelodromeRouter} from "../interfaces/exchanges/IVelodromeRouter.sol"; import {IUniswapRouter} from "../interfaces/exchanges/IUniswapRouter.sol"; import {ILeveragedToken} from "../interfaces/ILeveragedToken.sol"; contract ZapSwap is IZapSwap, TlxOwnable { IAddressProvider internal immutable _addressProvider; IVelodromeRouter internal immutable _velodromeRouter; IUniswapRouter internal immutable _uniswapRouter; // Mapping zapAssets to their respective swapData mapping(address => SwapData) internal _swapDB; // Array keeping track of all supported zap assets address[] internal _supportedZapAssets; constructor( address addressProvider_, address velodromeRouter_, address uniswapRouter_ ) TlxOwnable(addressProvider_) { _addressProvider = IAddressProvider(addressProvider_); _velodromeRouter = IVelodromeRouter(velodromeRouter_); _uniswapRouter = IUniswapRouter(uniswapRouter_); // Approve velodrome router for base asset _addressProvider.baseAsset().approve( address(_velodromeRouter), type(uint256).max ); } /// @inheritdoc IZapSwap function setAssetSwapData( address zapAsset_, SwapData memory swapData_ ) external override onlyOwner { // Verifying that the bridge asset for uniswap is supported on velodrome if (swapData_.swapZapAssetOnUni) { SwapData memory bridgeData_ = _swapDB[swapData_.bridgeAsset]; bool bridgeSupported_ = bridgeData_.supported && !bridgeData_.swapZapAssetOnUni; if (!bridgeSupported_) { revert BridgeAssetNotSupported(); } // Approving the uniswap router for zap and bridge asset IERC20(swapData_.bridgeAsset).approve( address(_uniswapRouter), type(uint256).max ); IERC20(zapAsset_).approve( address(_uniswapRouter), type(uint256).max ); } else { // Approving the velodrome router for zap asset IERC20(zapAsset_).approve( address(_velodromeRouter), type(uint256).max ); } // Adding zap asset to supported assets only if it is a new asset if (!_swapDB[zapAsset_].supported) { _supportedZapAssets.push(zapAsset_); } // Setting the swapPath for the zapAsset _swapDB[zapAsset_] = swapData_; emit AssetSwapDataUpdated(zapAsset_, swapData_); } /// @inheritdoc IZapSwap function removeAssetSwapData( address zapAsset_ ) external override onlyOwner { // Reverting if asset is not supported or required as a bridge asset // Returning its index in the _supportedZapAssets array if validated uint256 idx_ = _validateAssetRemoval(zapAsset_); // Setting the zap asset to unsupported _swapDB[zapAsset_].supported = false; // Removing the zap asset from supported assets array _supportedZapAssets[idx_] = _supportedZapAssets[ _supportedZapAssets.length - 1 ]; _supportedZapAssets.pop(); emit AssetSwapDataRemoved(zapAsset_); } /// @inheritdoc IZapSwap function mint( address zapAssetAddress_, address leveragedTokenAddress_, uint256 zapAssetAmountIn_, uint256 minLeveragedTokenAmountOut_ ) public override returns (uint256) { // If amountIn is zero exit mint and return zero if (zapAssetAmountIn_ == 0) return 0; // Swap data of zap asset SwapData memory zapAssetSwapData_ = _swapDB[zapAssetAddress_]; // Verifying that zap asset is supported and the leveraged token address is valid _validateZap(zapAssetSwapData_, leveragedTokenAddress_); IERC20 baseAsset_ = _addressProvider.baseAsset(); IERC20 zapAsset_ = IERC20(zapAssetAddress_); // Receiving zap asset from user zapAsset_.transferFrom(msg.sender, address(this), zapAssetAmountIn_); // Swapping zap asset for base asset based on swap data _swapAsset( zapAssetAmountIn_, zapAssetAddress_, address(baseAsset_), zapAssetSwapData_, true ); uint256 baseAmountIn_ = baseAsset_.balanceOf(address(this)); // Minting leveraged tokens using baseAsset ILeveragedToken targetLeveragedToken_ = ILeveragedToken( leveragedTokenAddress_ ); baseAsset_.approve(leveragedTokenAddress_, baseAmountIn_); uint256 leveragedTokenAmountOut_ = targetLeveragedToken_.mint( baseAmountIn_, minLeveragedTokenAmountOut_ ); // Transferring leveraged tokens to user targetLeveragedToken_.transfer(msg.sender, leveragedTokenAmountOut_); emit Minted( msg.sender, leveragedTokenAddress_, zapAssetAddress_, zapAssetAmountIn_, leveragedTokenAmountOut_ ); return leveragedTokenAmountOut_; } /// @inheritdoc IZapSwap function redeem( address zapAssetAddress_, address leveragedTokenAddress_, uint256 leveragedTokenAmountIn_, uint256 minZapAssetAmountOut_ ) public override returns (uint256) { // If amountIn is zero exit redeem and return zero if (leveragedTokenAmountIn_ == 0) return 0; // Swap data of zap asset SwapData memory zapAssetSwapData_ = _swapDB[zapAssetAddress_]; // Verifying that zap asset is supported and the leveraged token address is valid _validateZap(zapAssetSwapData_, leveragedTokenAddress_); // Transferring leveraged token from user to zap ILeveragedToken targetLeveragedToken = ILeveragedToken( leveragedTokenAddress_ ); targetLeveragedToken.transferFrom( msg.sender, address(this), leveragedTokenAmountIn_ ); // Redeeming leveraged token for base asset targetLeveragedToken.redeem(leveragedTokenAmountIn_, 0); IERC20 baseAsset_ = _addressProvider.baseAsset(); IERC20 zapAsset_ = IERC20(zapAssetAddress_); uint256 baseAssetAmountIn_ = baseAsset_.balanceOf(address(this)); // Swapping base asset for zap asset based on swap data _swapAsset( baseAssetAmountIn_, address(baseAsset_), zapAssetAddress_, zapAssetSwapData_, false ); uint256 zapAssetAmountOut_ = zapAsset_.balanceOf(address(this)); // Verifying sufficient amount bool sufficient_ = zapAssetAmountOut_ >= minZapAssetAmountOut_; if (!sufficient_) revert Errors.InsufficientAmount(); // Sending the zap asset back to the user zapAsset_.transfer(msg.sender, zapAssetAmountOut_); emit Redeemed( msg.sender, leveragedTokenAddress_, leveragedTokenAmountIn_, zapAssetAddress_, zapAssetAmountOut_ ); return zapAssetAmountOut_; } /// @inheritdoc IZapSwap function swapData( address zapAsset_ ) public view override returns (SwapData memory) { return _swapDB[zapAsset_]; } /// @inheritdoc IZapSwap function supportedZapAssets() public view override returns (address[] memory) { return _supportedZapAssets; } function _swapAsset( uint256 amountIn_, address assetIn_, address assetOut_, SwapData memory swapData_, bool zapAssetForBaseAsset_ ) internal { if (!swapData_.swapZapAssetOnUni) { _swapOnVelodrome( amountIn_, assetIn_, assetOut_, swapData_, zapAssetForBaseAsset_ ); } else { _swapOnUniAndVelodrome( amountIn_, assetIn_, assetOut_, swapData_, zapAssetForBaseAsset_ ); } } function _swapOnVelodrome( uint256 amountIn_, address assetIn_, address assetOut_, SwapData memory swapData_, bool zapAssetForBaseAsset_ ) internal { if (swapData_.direct) { // Swapping directly IVelodromeRouter.Route[] memory routeList_ = new IVelodromeRouter.Route[](1); routeList_[0] = IVelodromeRouter.Route( assetIn_, assetOut_, swapData_.zapAssetSwapStable, swapData_.zapAssetFactory ); // Executing the swap _velodromeRouter.swapExactTokensForTokens( amountIn_, 0, routeList_, address(this), block.timestamp ); } else { // Swapping indirectly // Assigning the first and second pool stability and factory based on swap direction bool firstStable_; address firstFactory_; bool secondStable_; address secondFactory_; if (zapAssetForBaseAsset_) { firstStable_ = swapData_.zapAssetSwapStable; firstFactory_ = swapData_.zapAssetFactory; secondStable_ = swapData_.baseAssetSwapStable; secondFactory_ = swapData_.baseAssetFactory; } else { firstStable_ = swapData_.baseAssetSwapStable; firstFactory_ = swapData_.baseAssetFactory; secondStable_ = swapData_.zapAssetSwapStable; secondFactory_ = swapData_.zapAssetFactory; } // Setting the swap route IVelodromeRouter.Route[] memory routeList_ = new IVelodromeRouter.Route[](2); routeList_[0] = IVelodromeRouter.Route( assetIn_, swapData_.bridgeAsset, firstStable_, firstFactory_ ); routeList_[1] = IVelodromeRouter.Route( swapData_.bridgeAsset, assetOut_, secondStable_, secondFactory_ ); // Executing the swap _velodromeRouter.swapExactTokensForTokens( amountIn_, 0, routeList_, address(this), block.timestamp ); } } function _swapOnUni( uint256 amountIn_, address assetIn_, address assetOut_, uint24 poolFee_ ) internal { IUniswapRouter.ExactInputSingleParams memory params_ = IUniswapRouter .ExactInputSingleParams( assetIn_, assetOut_, poolFee_, address(this), block.timestamp, amountIn_, 0, 0 ); _uniswapRouter.exactInputSingle(params_); } function _swapOnUniAndVelodrome( uint256 amountIn_, address assetIn_, address assetOut_, SwapData memory swapData_, bool zapAssetForBaseAsset_ ) internal { address bridgeAsset_ = swapData_.bridgeAsset; SwapData memory swapDataBridgeAsset_ = _swapDB[bridgeAsset_]; // Verifying direction if (zapAssetForBaseAsset_) { // Swap zap asset for bridge asset on UniSwap _swapOnUni(amountIn_, assetIn_, bridgeAsset_, swapData_.uniPoolFee); // Swap bridge asset for base asset on Velodrome _swapOnVelodrome( IERC20(bridgeAsset_).balanceOf(address(this)), bridgeAsset_, assetOut_, swapDataBridgeAsset_, zapAssetForBaseAsset_ ); } else { // Swap base asset for bridge asset on Velodrome _swapOnVelodrome( amountIn_, assetIn_, bridgeAsset_, swapDataBridgeAsset_, zapAssetForBaseAsset_ ); // Swap bridge asset for zap asset on UniSwap _swapOnUni( IERC20(bridgeAsset_).balanceOf(address(this)), bridgeAsset_, assetOut_, swapData_.uniPoolFee ); } } function _validateZap( SwapData memory zapAssetSwapData_, address leveragedTokenAddress_ ) internal view { // Verifying that the asset is supported if (!zapAssetSwapData_.supported) { revert UnsupportedAsset(); } // Verifying valid leveraged token address bool valid_ = _addressProvider.leveragedTokenFactory().isLeveragedToken( leveragedTokenAddress_ ); if (!valid_) revert Errors.InvalidAddress(); } function _validateAssetRemoval( address zapAssetToRemove_ ) internal view returns (uint256) { uint256 numAssets_ = _supportedZapAssets.length; uint256 idx_ = numAssets_; // invalid index; used to determine whether zap asset is supported // Iterating through supported zap assets for (uint256 i_; i_ < numAssets_; i_++) { address asset_ = _supportedZapAssets[i_]; if (asset_ == zapAssetToRemove_) { // Capturing the index of the zap asset to be removed idx_ = i_; } else if (_swapDB[asset_].bridgeAsset == zapAssetToRemove_) { // Reverting if the zap asset to be removed is needed as a bridge asset revert BridgeAssetDependency(asset_); } } // Reverting if the zap asset is not supported, else returning its index if (idx_ == numAssets_) { revert UnsupportedAsset(); } else { return (idx_); } } }
// 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); }
// 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_); } }
// 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(); }
// 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); }
// 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); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; interface IVelodromeRouter { struct Route { address from; address to; bool stable; address factory; } function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, Route[] calldata routes, address to, uint256 deadline ) external returns (uint256[] memory amounts); function getAmountsOut( uint256 amountIn, Route[] memory routes ) external view returns (uint256[] memory amounts); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; interface IUniswapRouter { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } function exactInputSingle( ExactInputSingleParams calldata params ) external returns (uint256 amountOut); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.13; import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol"; interface ILeveragedToken is IERC20Metadata { event Minted( address indexed account, uint256 leveragedTokenAmount, uint256 baseAssetAmount ); event Redeemed( address indexed account, uint256 leveragedTokenAmount, uint256 baseAssetAmount ); event Rebalanced(uint256 currentLeverage); event PausedSet(bool isPaused); error InsufficientAmount(); error CannotRebalance(); error LeverageUpdatePending(); error Paused(); error ExceedsLimit(); error Inactive(); /** * @notice Mints some leveraged tokens to the caller with the given baseAmountIn of the base asset. * @param baseAmountIn The amount of the base asset to mint with. * @param minLeveragedTokenAmountOut The minimum amount of leveragedTokens to mint (reverts otherwise). * @return leveragedTokenAmountOut The amount of leveragedTokens minted. */ function mint( uint256 baseAmountIn, uint256 minLeveragedTokenAmountOut ) external returns (uint256 leveragedTokenAmountOut); /** * @notice Redeems leveragedTokenAmount of the leveraged token and returns the base asset. * @param leveragedTokenAmount The amount of the leveraged token to redeem. * @param minBaseAmountReceived The minimum amount of the base asset to receive (reverts otherwise). * @return baseAmountReceived The amount of the base asset received. */ function redeem( uint256 leveragedTokenAmount, uint256 minBaseAmountReceived ) external returns (uint256 baseAmountReceived); /** * @notice Rebalances the position to the target leverage. */ function rebalance() external; /** * @notice Charges the streaming fee. * @dev This is done automatically during rebalances, but we might want to do this more frequently. */ function chargeStreamingFee() external; /** * @notice Sets if the leveraged token is paused. * @dev Only callable by the contract owner. * @param isPaused If the leveraged token should be paused or not. */ function setIsPaused(bool isPaused) external; /** * @notice Returns the target asset of the leveraged token. * @return targetAsset The target asset of the leveraged token. */ function targetAsset() external view returns (string memory targetAsset); /** * @notice Returns the target leverage of the leveraged token. * @return targetLeverage The target leverage of the leveraged token. */ function targetLeverage() external view returns (uint256 targetLeverage); /** * @notice Returns if the leveraged token is long or short. * @return isLong `true` if the leveraged token is long and `false` if the leveraged token is short. */ function isLong() external view returns (bool isLong); /** * @notice Returns if the leveraged token is active, * @dev A token is active if it still has some positive exchange rate (i.e. has not been liquidated). * @return isActive If the leveraged token is active. */ function isActive() external view returns (bool isActive); /** * @notice Returns if the leveraged token is paused, * @dev If a token is paused, deposits are disabled. * @return isPaused If the leveraged token is paused. */ function isPaused() external view returns (bool isPaused); /** * @notice Returns the rebalance threshold. * @dev Represented as a percent in 18 decimals, e.g. 20% = 0.2e18. * @return rebalanceThreshold The rebalance threshold. */ function rebalanceThreshold() external view returns (uint256 rebalanceThreshold); /** * @notice Returns the exchange rate from one leveraged token to one base asset. * @dev In 18 decimals. * @return exchangeRate The exchange rate. */ function exchangeRate() external view returns (uint256 exchangeRate); /** * @notice Returns the expected slippage from making an adjustment to a position. * @param baseAmount Margin amount to deposit in units of base asset. * @param isDeposit If the adjustment is a deposit. * @return slippage Slippage in units of base asset. * @return isLoss Whether the slippage is a loss. */ function computePriceImpact( uint256 baseAmount, bool isDeposit ) external view returns (uint256 slippage, bool isLoss); /** * @notice Returns if the leveraged token can be rebalanced. * @return canRebalance If the leveraged token can be rebalanced. */ function canRebalance() external view returns (bool canRebalance); }
// 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); }
// 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); }
// 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); }
// 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); }
// 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); }
// 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); }
// 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 {}
// 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); }
// 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); }
// 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); }
// 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); }
// 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 }); } } }
// 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; } }
{ "remappings": [ "@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/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "pyth-sdk-solidity/=lib/pyth-sdk-solidity/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"addressProvider_","type":"address"},{"internalType":"address","name":"velodromeRouter_","type":"address"},{"internalType":"address","name":"uniswapRouter_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"dependentZapAsset","type":"address"}],"name":"BridgeAssetDependency","type":"error"},{"inputs":[],"name":"BridgeAssetNotSupported","type":"error"},{"inputs":[],"name":"InsufficientAmount","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"UnsupportedAsset","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"zapAsset","type":"address"}],"name":"AssetSwapDataRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"zapAsset","type":"address"},{"components":[{"internalType":"bool","name":"supported","type":"bool"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"address","name":"bridgeAsset","type":"address"},{"internalType":"bool","name":"zapAssetSwapStable","type":"bool"},{"internalType":"bool","name":"baseAssetSwapStable","type":"bool"},{"internalType":"address","name":"zapAssetFactory","type":"address"},{"internalType":"address","name":"baseAssetFactory","type":"address"},{"internalType":"bool","name":"swapZapAssetOnUni","type":"bool"},{"internalType":"uint24","name":"uniPoolFee","type":"uint24"}],"indexed":false,"internalType":"struct IZapSwap.SwapData","name":"swapData","type":"tuple"}],"name":"AssetSwapDataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"leveragedToken","type":"address"},{"indexed":false,"internalType":"address","name":"assetIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"leveragedTokenAmountOut","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"leveragedToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"leveragedTokenAmountIn","type":"uint256"},{"indexed":false,"internalType":"address","name":"assetOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"Redeemed","type":"event"},{"inputs":[{"internalType":"address","name":"zapAssetAddress_","type":"address"},{"internalType":"address","name":"leveragedTokenAddress_","type":"address"},{"internalType":"uint256","name":"zapAssetAmountIn_","type":"uint256"},{"internalType":"uint256","name":"minLeveragedTokenAmountOut_","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAssetAddress_","type":"address"},{"internalType":"address","name":"leveragedTokenAddress_","type":"address"},{"internalType":"uint256","name":"leveragedTokenAmountIn_","type":"uint256"},{"internalType":"uint256","name":"minZapAssetAmountOut_","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAsset_","type":"address"}],"name":"removeAssetSwapData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAsset_","type":"address"},{"components":[{"internalType":"bool","name":"supported","type":"bool"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"address","name":"bridgeAsset","type":"address"},{"internalType":"bool","name":"zapAssetSwapStable","type":"bool"},{"internalType":"bool","name":"baseAssetSwapStable","type":"bool"},{"internalType":"address","name":"zapAssetFactory","type":"address"},{"internalType":"address","name":"baseAssetFactory","type":"address"},{"internalType":"bool","name":"swapZapAssetOnUni","type":"bool"},{"internalType":"uint24","name":"uniPoolFee","type":"uint24"}],"internalType":"struct IZapSwap.SwapData","name":"swapData_","type":"tuple"}],"name":"setAssetSwapData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supportedZapAssets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"zapAsset_","type":"address"}],"name":"swapData","outputs":[{"components":[{"internalType":"bool","name":"supported","type":"bool"},{"internalType":"bool","name":"direct","type":"bool"},{"internalType":"address","name":"bridgeAsset","type":"address"},{"internalType":"bool","name":"zapAssetSwapStable","type":"bool"},{"internalType":"bool","name":"baseAssetSwapStable","type":"bool"},{"internalType":"address","name":"zapAssetFactory","type":"address"},{"internalType":"address","name":"baseAssetFactory","type":"address"},{"internalType":"bool","name":"swapZapAssetOnUni","type":"bool"},{"internalType":"uint24","name":"uniPoolFee","type":"uint24"}],"internalType":"struct IZapSwap.SwapData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
610100604090808252346200018a57606081620021a38038038091620000268285620001f4565b8339810103126200018a576200003c816200022e565b9060046020826200005d8662000055848097016200022e565b92016200022e565b6001600160a01b03958616608081905260a081905291861660c052851660e052855163cdf456e160e01b815292839182905afa8015620001e9578291600091620001a2575b5060448460c0511660008751968794859363095ea7b360e01b8552600485015282196024850152165af18015620001975762000158575b8251611f5f908162000244823960805181818160be0152610502015260a051818181610c700152818161147c0152611879015260c0518181816108f701528181610d7c01528181610fcc0152818161114a015281816112b301528181611cac0152611dc1015260e05181818161062a0152818161068d0152611ebd0152f35b81813d83116200018f575b6200016f8183620001f4565b810103126200018a5751801515036200018a573880620000d9565b600080fd5b503d62000163565b83513d6000823e3d90fd5b909181813d8311620001e1575b620001bb8183620001f4565b81010312620001dd5751908382168203620001da5750819038620000a2565b80fd5b5080fd5b503d620001af565b84513d6000823e3d90fd5b601f909101601f19168101906001600160401b038211908210176200021857604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200018a5756fe6080604052600436101561001257600080fd5b60003560e01c80631719ed20146104165780634be47418146103fa5780634bf1bc4814610339578063679ab062146102315780638255ac6b146100875763b3f1c93d1461005e57600080fd5b3461008257602061007a610071366109f6565b929190916113af565b604051908152f35b600080fd5b34610082576020366003190112610082576100a0610985565b604051638da5cb5b60e01b81526001600160a01b03906020816004817f000000000000000000000000000000000000000000000000000000000000000086165afa908115610225576000916101f6575b5081339116036101e457806101048361196c565b921691826000526000602052604060002060ff19815416905560015490600019918281019081116101ce5761016d918461014061014993610ae1565b93905492610ae1565b92909360031b1c169060018060a01b038084549260031b9316831b921b1916179055565b60015480156101b857019061018182610ae1565b909182549160031b1b191690556001557f78ebf0f20ca0297198dc913ed2b11ae1ce81e9f3eab9b298f6f5979ddef07fdf600080a2005b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6040516330cd747160e01b8152600490fd5b610218915060203d60201161021e575b61021081836109d4565b810190610aaa565b836100f0565b503d610206565b6040513d6000823e3d90fd5b346100825760203660031901126100825761033561024d610985565b6040516102598161099b565b6000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015260006101008092015260018060a01b03809216600052600060205262ffffff6040600020926002604051946102c28661099b565b60ff815481811615158852818160081c1615156020890152848160101c166040890152818160b01c161515606089015260b81c16151560808701528260018201541660a0870152015490811660c085015260ff8160a01c16151560e085015260a81c169082015260405191829182610a2f565b0390f35b34610082576000366003190112610082576040518060018054928381526020809101809460016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69060005b8181106103de575050508361039d9103846109d4565b60405192818401908285525180915260408401949160005b8281106103c25785870386f35b83516001600160a01b03168752958101959281019284016103b5565b82546001600160a01b0316845292840192918501918501610387565b3461008257602061007a61040d366109f6565b92919091610b2e565b346100825761014036600319011261008257610430610985565b61012036602319011261008257610447608061099b565b60243580151581036100825760805260443580151581036100825760a0526064356001600160a01b03811681036100825760c05260843580151581036100825760e05260a4358015158103610082576101005260c4356001600160a01b0381168103610082576101205260e4356001600160a01b0381168103610082576101405261010435801515810361008257610160526101243562ffffff811681036100825761018052604051638da5cb5b60e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561022557600091610966575b50336001600160a01b03909116036101e45761016051156108e05760c0516001600160a01b031660009081526020819052604090819020905161057d8161099b565b600282549260ff808516151594858552818160081c161515602086015260018060a01b038160101c166040860152818160b01c161515606086015260b81c161515608084015260018060a01b0360018201541660a084015201549060018060a01b03821660c082015261010062ffffff60ff8460a01c161593841560e085015260a81c16910152816108d8575b50156108c65760c05160405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301526000196024830152909160209183916044918391600091165af18015610225576108a7575b5060405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301526020908290604490829060009087165af1801561022557610878575b505b6001600160a01b03811660009081526020819052604090205460ff1615610817575b6001600160a01b039081166000818152602081905260409081902060808051825460a0805160c05160e051610100516001600160c01b031995861696151560ff169690961792151560081b61ff00169290921760109190911b62010000600160b01b03161790151560b01b60ff60b01b161760ff60b81b93151560b81b93909316929092178455610120516001850180546001600160a01b031916918916919091179055610140516002949094018054610160516101805191909316959098169490941790151590911b60ff60a01b161760a89590951b62ffffff60a81b169490941790555190917f250e73a0fbb30664345dff2e8a673d70a237b2734654ac84f444d05b9a270b20919081906108129082610a2f565b0390a2005b60015468010000000000000000811015610862578161083f82600161085d9401600155610ae1565b90919060018060a01b038084549260031b9316831b921b1916179055565b6106fb565b634e487b7160e01b600052604160045260246000fd5b6108999060203d6020116108a0575b61089181836109d4565b810190610ac9565b50816106d7565b503d610887565b6108bf9060203d6020116108a05761089181836109d4565b5081610675565b60405163177c8bd360e01b8152600490fd5b90508261060a565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301526020908290604490829060009087165af1801561022557610947575b506106d9565b61095f9060203d6020116108a05761089181836109d4565b5081610941565b61097f915060203d60201161021e5761021081836109d4565b8261053b565b600435906001600160a01b038216820361008257565b610120810190811067ffffffffffffffff82111761086257604052565b6080810190811067ffffffffffffffff82111761086257604052565b90601f8019910116810190811067ffffffffffffffff82111761086257604052565b6080906003190112610082576001600160a01b039060043582811681036100825791602435908116810361008257906044359060643590565b919091610120810192805115158252602081015115156020830152604081015160018060a01b0380911660408401526060820151151560608401526080820151151560808401528060a08301511660a084015260c08201511660c083015260e0810151151560e083015262ffffff6101008092015116910152565b9081602091031261008257516001600160a01b03811681036100825790565b90816020910312610082575180151581036100825790565b600154811015610b185760016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60190600090565b634e487b7160e01b600052603260045260246000fd5b82156113a65760018060a01b0381166000526000602052604060002062ffffff600260405192610b5d8461099b565b60ff815481811615158652818160081c161515602087015260018060a01b038160101c166040870152818160b01c161515606087015260b81c161515608085015260018060a01b0360018201541660a0850152015460018060a01b03811660c084015260ff8160a01c16151560e084015260a81c16610100820152610be28382611853565b6040516323b872dd60e01b81523360048201523060248201526044810185905260208160648160006001600160a01b0389165af1801561022557611387575b50604051637cbc237360e01b815284600482015260006024820152602081604481600060018060a01b0389165af180156102255761135c575b5060405163cdf456e160e01b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156102255760009161133d575b506040516370a0823160e01b8152306004820152906020826024816001600160a01b0385165afa91821561022557600092611309575b5060e083015161102257602083015115610efa5791600091610d7793610d03611a7a565b92606081015115159060a0600180821b03910151169060405192610d26846109b8565b6001600160a01b0390811684528816602084015260408301526060820152610d4d83611ae7565b52610d5782611ae7565b5060405163cac88ea960e01b815293849283924291309160048601611b80565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561022557610ed7575b505b6040516370a0823160e01b8152306004820152936020856024816001600160a01b0386165afa94851561022557600095610ea3575b508410610e915760405163a9059cbb60e01b81523360048201526024810185905260208160448160006001600160a01b0387165af1801561022557610e72575b50604080519384526001600160a01b0391821660208501528301849052169033907fa0dde38365e7863fcda1e12536206bc5ab0b7074a66a441e866145cf3d07fc2490606090a390565b610e8a9060203d6020116108a05761089181836109d4565b5038610e28565b604051632ca2f52b60e11b8152600490fd5b9094506020813d602011610ecf575b81610ebf602093836109d4565b8101031261008257519338610de8565b3d9150610eb2565b610ef3903d806000833e610eeb81836109d4565b810190611b04565b5038610db1565b608083015160c0840151606085015160a0860151610fc79660009694151595921515936001600160a01b0392831693919216610f34611a13565b9660018060a01b0360408501511660405193610f4f856109b8565b6001600160a01b03168452602084015260408301526060820152610f7286611ae7565b52610f7c85611ae7565b50604090810151905192906001600160a01b0316610f99846109b8565b83526001600160a01b038816602084015260408301526060820152610fbd83611af4565b52610d5782611af4565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561022557611007575b50610db3565b61101b903d806000833e610eeb81836109d4565b5038611001565b6040808401516001600160a01b0316600081815260208190528290209151909493909161104e8361099b565b80549260ff84161515815260ff8460081c16151593846020830152604082019460018060a01b038260101c168652606083019560ff808460b01c1615159384895260b81c1615159384608082015260018060a01b0360018701541692600260a083019785895201549161010062ffffff60018060a01b038516948560c085015260ff8160a01c16151560e085015260a81c1691015260001461121e575050505050906111459360009392611100611a7a565b93519051604051926001600160a01b0390911691151590611120846109b8565b6001600160a01b031683526020830189905260408301526060820152610d4d83611ae7565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561022557611203575b505b6040516370a0823160e01b8152306004820152602081602481865afa9182156102255784916000936111c9575b509262ffffff6101006111c49501511692611dfc565b610db3565b915091506020813d6020116111fb575b816111e6602093836109d4565b81010312610082575190839062ffffff6111ae565b3d91506111d9565b611217903d806000833e610eeb81836109d4565b503861117f565b600097506112ae9891929394969550611235611a13565b9660018060a01b038451166040519361124d856109b8565b6001600160a01b0316845260208401526040830152606082015261127086611ae7565b5261127a85611ae7565b505160405192906001600160a01b0316611293846109b8565b835288602084015260408301526060820152610fbd83611af4565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af18015610225576112ee575b50611181565b611302903d806000833e610eeb81836109d4565b50386112e8565b9091506020813d602011611335575b81611325602093836109d4565b8101031261008257519038610cdf565b3d9150611318565b611356915060203d60201161021e5761021081836109d4565b38610ca9565b602090813d8311611380575b61137281836109d4565b810103126100825738610c5a565b503d611368565b61139f9060203d6020116108a05761089181836109d4565b5038610c21565b50505050600090565b909180156113a65760018060a01b038216600052600060205260406000209362ffffff6002604051966113e18861099b565b60ff815481811615158a52818160081c16151560208b015260018060a01b038160101c1660408b0152818160b01c16151560608b015260b81c161515608089015260018060a01b0360018201541660a0890152015460018060a01b03811660c088015260ff8160a01c16151560e088015260a81c166101008601526114668486611853565b60405163cdf456e160e01b8152946020866004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa95861561022557600096611832575b506040516323b872dd60e01b81523360048201523060248201526044810184905260208160648160006001600160a01b038a165af1801561022557611813575b5060e08101516116dc57611514906001600160a01b0387168585611c1a565b6040516370a0823160e01b8152306004820152946020866024816001600160a01b0385165afa958615610225576000966116a7575b5060405163095ea7b360e01b81526001600160a01b03958616600482018190526024820188905295909160209183916044918391600091165af1801561022557611688575b5060405194630d9778e560e11b8652600486015260248501526020846044816000875af193841561022557600094611654575b5060405163a9059cbb60e01b8152336004820152602481018590526020816044816000885af1801561022557611635575b506040519160018060a01b0316825260208201528260408201527f913df59304c6b5e94c14d2ee67fdbe4e2e03154082b6cd95bf3425c83d69867a60603392a390565b61164d9060203d6020116108a05761089181836109d4565b50386115f2565b9093506020813d602011611680575b81611670602093836109d4565b81010312610082575192386115c1565b3d9150611663565b6116a09060203d6020116108a05761089181836109d4565b503861158e565b9095506020813d6020116116d4575b816116c3602093836109d4565b810103126100825751946020611549565b3d91506116b6565b60018060a01b036040820151169081600052600060205261179762ffffff610100604060002093826002604051966117138861099b565b60ff815481811615158a52818160081c16151560208b015260018060a01b038160101c1660408b0152818160b01c16151560608b015260b81c161515608089015260018060a01b0360018201541660a0890152015460018060a01b03811660c088015260ff8160a01c16151560e088015260a81c1682860152015116838787611dfc565b6040516370a0823160e01b815230600482015291602083602481845afa908115610225576000916117dd575b6117d893506001600160a01b03891691611c1a565b611514565b90506020833d60201161180b575b816117f8602093836109d4565b81010312610082576117d89251906117c3565b3d91506117eb565b61182b9060203d6020116108a05761089181836109d4565b50386114f5565b61184c91965060203d60201161021e5761021081836109d4565b94386114b5565b511561195a57604051633d2ba04d60e01b8152602091906001600160a01b0383826004817f000000000000000000000000000000000000000000000000000000000000000085165afa928315610225578492600094611915575b5060405163b02bb43360e01b815290821660048201529283916024918391165afa918215610225576000926118f8575b5050156118e657565b60405163e6c4247b60e01b8152600490fd5b61190e9250803d106108a05761089181836109d4565b38806118dd565b9093919281813d8311611953575b61192d81836109d4565b8101031261194f575190828216820361194c57509183919060246118ad565b80fd5b5080fd5b503d611923565b604051630928045160e21b8152600490fd5b60018054918291600080925b84841061199e5750505050810361199b57604051630928045160e21b8152600490fd5b90565b909192946119ab86610ae1565b90546001600160a01b0360039290921b1c8116908381168083036119d9575050505082855b01929190611978565b828699949952856020526040918287205460101c16146119fc57505083906119d0565b60249250519063237ee24360e11b82526004820152fd5b604090604051606080820182811067ffffffffffffffff8211176108625760405260028252819360005b818110611a4a5750505050565b6020908251611a58816109b8565b6000815282600081830152600085830152600086830152828701015201611a3d565b604090604051916040830183811067ffffffffffffffff8211176108625760405260018352829160005b602080821015611adf57835160209291611abd826109b8565b6000825260008183015260008683015260006060830152828801015201611aa4565b505091925050565b805115610b185760200190565b805160011015610b185760400190565b90602090818382031261008257825167ffffffffffffffff93848211610082570181601f82011215610082578051938411610862578360051b9060405194611b4e858401876109d4565b85528380860192820101928311610082578301905b828210611b71575050505090565b81518152908301908301611b63565b91909493929460a083019083526020906000602085015260409160a060408601528351809252602060c086019401926000905b838210611bd5575050505050906080919460018060a01b031660608201520152565b845180516001600160a01b0390811688528185015181168886015281830151151588840152606091820151169087015260809095019493820193600190910190611bb3565b60208401519093929015611cf257611ca8936000939260a092611c3b611a7a565b946060810151151590600180871b0380968192015116928160405195611c60876109b8565b16855216602084015260408301526060820152611c7c84611ae7565b52611c8683611ae7565b508360405180968195829463cac88ea960e01b84524291309160048601611b80565b03927f0000000000000000000000000000000000000000000000000000000000000000165af1801561022557611cdb5750565b611cef903d806000833e610eeb81836109d4565b50565b600091611dbd94606085015115159260018060a01b03928360a08801511694848060808a01511515928160c08c01511694611d2b611a13565b996040809d01928d8580865116915194611d44866109b8565b16845260208401528d8301526060820152611d5e8a611ae7565b52611d6889611ae7565b50511693895194611d78866109b8565b8552166020840152878301526060820152611d9284611af4565b52611d9c83611af4565b5083855180978195829463cac88ea960e01b84524291309160048601611b80565b03927f0000000000000000000000000000000000000000000000000000000000000000165af1908115611df25750611cdb5750565b513d6000823e3d90fd5b909160405192610100840184811067ffffffffffffffff8211176108625760409081526001600160a01b0391821685529181166020850190815262ffffff9586168584019081523060608701908152426080880190815260a08801968752600060c0890181815260e08a01828152975163414bf38960e01b81529951871660048b01529451861660248a015292519098166044880152518316606487015295516084860152925160a4850152915160c484015251811660e4830152829082907f000000000000000000000000000000000000000000000000000000000000000016815a9361010492602095f18015611f1e57611ef6575050565b602090813d8311611f17575b611f0c81836109d4565b8101031261194c5750565b503d611f02565b6040513d84823e3d90fdfea2646970667358221220073c12cecbd346697768ce078db1b1ed00b65c454cb4946e5baf24108a242a3364736f6c63430008180033000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e2000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b2858000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c80631719ed20146104165780634be47418146103fa5780634bf1bc4814610339578063679ab062146102315780638255ac6b146100875763b3f1c93d1461005e57600080fd5b3461008257602061007a610071366109f6565b929190916113af565b604051908152f35b600080fd5b34610082576020366003190112610082576100a0610985565b604051638da5cb5b60e01b81526001600160a01b03906020816004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e286165afa908115610225576000916101f6575b5081339116036101e457806101048361196c565b921691826000526000602052604060002060ff19815416905560015490600019918281019081116101ce5761016d918461014061014993610ae1565b93905492610ae1565b92909360031b1c169060018060a01b038084549260031b9316831b921b1916179055565b60015480156101b857019061018182610ae1565b909182549160031b1b191690556001557f78ebf0f20ca0297198dc913ed2b11ae1ce81e9f3eab9b298f6f5979ddef07fdf600080a2005b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6040516330cd747160e01b8152600490fd5b610218915060203d60201161021e575b61021081836109d4565b810190610aaa565b836100f0565b503d610206565b6040513d6000823e3d90fd5b346100825760203660031901126100825761033561024d610985565b6040516102598161099b565b6000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e082015260006101008092015260018060a01b03809216600052600060205262ffffff6040600020926002604051946102c28661099b565b60ff815481811615158852818160081c1615156020890152848160101c166040890152818160b01c161515606089015260b81c16151560808701528260018201541660a0870152015490811660c085015260ff8160a01c16151560e085015260a81c169082015260405191829182610a2f565b0390f35b34610082576000366003190112610082576040518060018054928381526020809101809460016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69060005b8181106103de575050508361039d9103846109d4565b60405192818401908285525180915260408401949160005b8281106103c25785870386f35b83516001600160a01b03168752958101959281019284016103b5565b82546001600160a01b0316845292840192918501918501610387565b3461008257602061007a61040d366109f6565b92919091610b2e565b346100825761014036600319011261008257610430610985565b61012036602319011261008257610447608061099b565b60243580151581036100825760805260443580151581036100825760a0526064356001600160a01b03811681036100825760c05260843580151581036100825760e05260a4358015158103610082576101005260c4356001600160a01b0381168103610082576101205260e4356001600160a01b0381168103610082576101405261010435801515810361008257610160526101243562ffffff811681036100825761018052604051638da5cb5b60e01b81526020816004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e26001600160a01b03165afa90811561022557600091610966575b50336001600160a01b03909116036101e45761016051156108e05760c0516001600160a01b031660009081526020819052604090819020905161057d8161099b565b600282549260ff808516151594858552818160081c161515602086015260018060a01b038160101c166040860152818160b01c161515606086015260b81c161515608084015260018060a01b0360018201541660a084015201549060018060a01b03821660c082015261010062ffffff60ff8460a01c161593841560e085015260a81c16910152816108d8575b50156108c65760c05160405163095ea7b360e01b81526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564811660048301526000196024830152909160209183916044918391600091165af18015610225576108a7575b5060405163095ea7b360e01b81526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615648116600483015260001960248301526020908290604490829060009087165af1801561022557610878575b505b6001600160a01b03811660009081526020819052604090205460ff1615610817575b6001600160a01b039081166000818152602081905260409081902060808051825460a0805160c05160e051610100516001600160c01b031995861696151560ff169690961792151560081b61ff00169290921760109190911b62010000600160b01b03161790151560b01b60ff60b01b161760ff60b81b93151560b81b93909316929092178455610120516001850180546001600160a01b031916918916919091179055610140516002949094018054610160516101805191909316959098169490941790151590911b60ff60a01b161760a89590951b62ffffff60a81b169490941790555190917f250e73a0fbb30664345dff2e8a673d70a237b2734654ac84f444d05b9a270b20919081906108129082610a2f565b0390a2005b60015468010000000000000000811015610862578161083f82600161085d9401600155610ae1565b90919060018060a01b038084549260031b9316831b921b1916179055565b6106fb565b634e487b7160e01b600052604160045260246000fd5b6108999060203d6020116108a0575b61089181836109d4565b810190610ac9565b50816106d7565b503d610887565b6108bf9060203d6020116108a05761089181836109d4565b5081610675565b60405163177c8bd360e01b8152600490fd5b90508261060a565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b28588116600483015260001960248301526020908290604490829060009087165af1801561022557610947575b506106d9565b61095f9060203d6020116108a05761089181836109d4565b5081610941565b61097f915060203d60201161021e5761021081836109d4565b8261053b565b600435906001600160a01b038216820361008257565b610120810190811067ffffffffffffffff82111761086257604052565b6080810190811067ffffffffffffffff82111761086257604052565b90601f8019910116810190811067ffffffffffffffff82111761086257604052565b6080906003190112610082576001600160a01b039060043582811681036100825791602435908116810361008257906044359060643590565b919091610120810192805115158252602081015115156020830152604081015160018060a01b0380911660408401526060820151151560608401526080820151151560808401528060a08301511660a084015260c08201511660c083015260e0810151151560e083015262ffffff6101008092015116910152565b9081602091031261008257516001600160a01b03811681036100825790565b90816020910312610082575180151581036100825790565b600154811015610b185760016000527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60190600090565b634e487b7160e01b600052603260045260246000fd5b82156113a65760018060a01b0381166000526000602052604060002062ffffff600260405192610b5d8461099b565b60ff815481811615158652818160081c161515602087015260018060a01b038160101c166040870152818160b01c161515606087015260b81c161515608085015260018060a01b0360018201541660a0850152015460018060a01b03811660c084015260ff8160a01c16151560e084015260a81c16610100820152610be28382611853565b6040516323b872dd60e01b81523360048201523060248201526044810185905260208160648160006001600160a01b0389165af1801561022557611387575b50604051637cbc237360e01b815284600482015260006024820152602081604481600060018060a01b0389165af180156102255761135c575b5060405163cdf456e160e01b81526020816004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e26001600160a01b03165afa9081156102255760009161133d575b506040516370a0823160e01b8152306004820152906020826024816001600160a01b0385165afa91821561022557600092611309575b5060e083015161102257602083015115610efa5791600091610d7793610d03611a7a565b92606081015115159060a0600180821b03910151169060405192610d26846109b8565b6001600160a01b0390811684528816602084015260408301526060820152610d4d83611ae7565b52610d5782611ae7565b5060405163cac88ea960e01b815293849283924291309160048601611b80565b0381837f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b28586001600160a01b03165af1801561022557610ed7575b505b6040516370a0823160e01b8152306004820152936020856024816001600160a01b0386165afa94851561022557600095610ea3575b508410610e915760405163a9059cbb60e01b81523360048201526024810185905260208160448160006001600160a01b0387165af1801561022557610e72575b50604080519384526001600160a01b0391821660208501528301849052169033907fa0dde38365e7863fcda1e12536206bc5ab0b7074a66a441e866145cf3d07fc2490606090a390565b610e8a9060203d6020116108a05761089181836109d4565b5038610e28565b604051632ca2f52b60e11b8152600490fd5b9094506020813d602011610ecf575b81610ebf602093836109d4565b8101031261008257519338610de8565b3d9150610eb2565b610ef3903d806000833e610eeb81836109d4565b810190611b04565b5038610db1565b608083015160c0840151606085015160a0860151610fc79660009694151595921515936001600160a01b0392831693919216610f34611a13565b9660018060a01b0360408501511660405193610f4f856109b8565b6001600160a01b03168452602084015260408301526060820152610f7286611ae7565b52610f7c85611ae7565b50604090810151905192906001600160a01b0316610f99846109b8565b83526001600160a01b038816602084015260408301526060820152610fbd83611af4565b52610d5782611af4565b0381837f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b28586001600160a01b03165af1801561022557611007575b50610db3565b61101b903d806000833e610eeb81836109d4565b5038611001565b6040808401516001600160a01b0316600081815260208190528290209151909493909161104e8361099b565b80549260ff84161515815260ff8460081c16151593846020830152604082019460018060a01b038260101c168652606083019560ff808460b01c1615159384895260b81c1615159384608082015260018060a01b0360018701541692600260a083019785895201549161010062ffffff60018060a01b038516948560c085015260ff8160a01c16151560e085015260a81c1691015260001461121e575050505050906111459360009392611100611a7a565b93519051604051926001600160a01b0390911691151590611120846109b8565b6001600160a01b031683526020830189905260408301526060820152610d4d83611ae7565b0381837f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b28586001600160a01b03165af1801561022557611203575b505b6040516370a0823160e01b8152306004820152602081602481865afa9182156102255784916000936111c9575b509262ffffff6101006111c49501511692611dfc565b610db3565b915091506020813d6020116111fb575b816111e6602093836109d4565b81010312610082575190839062ffffff6111ae565b3d91506111d9565b611217903d806000833e610eeb81836109d4565b503861117f565b600097506112ae9891929394969550611235611a13565b9660018060a01b038451166040519361124d856109b8565b6001600160a01b0316845260208401526040830152606082015261127086611ae7565b5261127a85611ae7565b505160405192906001600160a01b0316611293846109b8565b835288602084015260408301526060820152610fbd83611af4565b0381837f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b28586001600160a01b03165af18015610225576112ee575b50611181565b611302903d806000833e610eeb81836109d4565b50386112e8565b9091506020813d602011611335575b81611325602093836109d4565b8101031261008257519038610cdf565b3d9150611318565b611356915060203d60201161021e5761021081836109d4565b38610ca9565b602090813d8311611380575b61137281836109d4565b810103126100825738610c5a565b503d611368565b61139f9060203d6020116108a05761089181836109d4565b5038610c21565b50505050600090565b909180156113a65760018060a01b038216600052600060205260406000209362ffffff6002604051966113e18861099b565b60ff815481811615158a52818160081c16151560208b015260018060a01b038160101c1660408b0152818160b01c16151560608b015260b81c161515608089015260018060a01b0360018201541660a0890152015460018060a01b03811660c088015260ff8160a01c16151560e088015260a81c166101008601526114668486611853565b60405163cdf456e160e01b8152946020866004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e26001600160a01b03165afa95861561022557600096611832575b506040516323b872dd60e01b81523360048201523060248201526044810184905260208160648160006001600160a01b038a165af1801561022557611813575b5060e08101516116dc57611514906001600160a01b0387168585611c1a565b6040516370a0823160e01b8152306004820152946020866024816001600160a01b0385165afa958615610225576000966116a7575b5060405163095ea7b360e01b81526001600160a01b03958616600482018190526024820188905295909160209183916044918391600091165af1801561022557611688575b5060405194630d9778e560e11b8652600486015260248501526020846044816000875af193841561022557600094611654575b5060405163a9059cbb60e01b8152336004820152602481018590526020816044816000885af1801561022557611635575b506040519160018060a01b0316825260208201528260408201527f913df59304c6b5e94c14d2ee67fdbe4e2e03154082b6cd95bf3425c83d69867a60603392a390565b61164d9060203d6020116108a05761089181836109d4565b50386115f2565b9093506020813d602011611680575b81611670602093836109d4565b81010312610082575192386115c1565b3d9150611663565b6116a09060203d6020116108a05761089181836109d4565b503861158e565b9095506020813d6020116116d4575b816116c3602093836109d4565b810103126100825751946020611549565b3d91506116b6565b60018060a01b036040820151169081600052600060205261179762ffffff610100604060002093826002604051966117138861099b565b60ff815481811615158a52818160081c16151560208b015260018060a01b038160101c1660408b0152818160b01c16151560608b015260b81c161515608089015260018060a01b0360018201541660a0890152015460018060a01b03811660c088015260ff8160a01c16151560e088015260a81c1682860152015116838787611dfc565b6040516370a0823160e01b815230600482015291602083602481845afa908115610225576000916117dd575b6117d893506001600160a01b03891691611c1a565b611514565b90506020833d60201161180b575b816117f8602093836109d4565b81010312610082576117d89251906117c3565b3d91506117eb565b61182b9060203d6020116108a05761089181836109d4565b50386114f5565b61184c91965060203d60201161021e5761021081836109d4565b94386114b5565b511561195a57604051633d2ba04d60e01b8152602091906001600160a01b0383826004817f000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e285165afa928315610225578492600094611915575b5060405163b02bb43360e01b815290821660048201529283916024918391165afa918215610225576000926118f8575b5050156118e657565b60405163e6c4247b60e01b8152600490fd5b61190e9250803d106108a05761089181836109d4565b38806118dd565b9093919281813d8311611953575b61192d81836109d4565b8101031261194f575190828216820361194c57509183919060246118ad565b80fd5b5080fd5b503d611923565b604051630928045160e21b8152600490fd5b60018054918291600080925b84841061199e5750505050810361199b57604051630928045160e21b8152600490fd5b90565b909192946119ab86610ae1565b90546001600160a01b0360039290921b1c8116908381168083036119d9575050505082855b01929190611978565b828699949952856020526040918287205460101c16146119fc57505083906119d0565b60249250519063237ee24360e11b82526004820152fd5b604090604051606080820182811067ffffffffffffffff8211176108625760405260028252819360005b818110611a4a5750505050565b6020908251611a58816109b8565b6000815282600081830152600085830152600086830152828701015201611a3d565b604090604051916040830183811067ffffffffffffffff8211176108625760405260018352829160005b602080821015611adf57835160209291611abd826109b8565b6000825260008183015260008683015260006060830152828801015201611aa4565b505091925050565b805115610b185760200190565b805160011015610b185760400190565b90602090818382031261008257825167ffffffffffffffff93848211610082570181601f82011215610082578051938411610862578360051b9060405194611b4e858401876109d4565b85528380860192820101928311610082578301905b828210611b71575050505090565b81518152908301908301611b63565b91909493929460a083019083526020906000602085015260409160a060408601528351809252602060c086019401926000905b838210611bd5575050505050906080919460018060a01b031660608201520152565b845180516001600160a01b0390811688528185015181168886015281830151151588840152606091820151169087015260809095019493820193600190910190611bb3565b60208401519093929015611cf257611ca8936000939260a092611c3b611a7a565b946060810151151590600180871b0380968192015116928160405195611c60876109b8565b16855216602084015260408301526060820152611c7c84611ae7565b52611c8683611ae7565b508360405180968195829463cac88ea960e01b84524291309160048601611b80565b03927f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b2858165af1801561022557611cdb5750565b611cef903d806000833e610eeb81836109d4565b50565b600091611dbd94606085015115159260018060a01b03928360a08801511694848060808a01511515928160c08c01511694611d2b611a13565b996040809d01928d8580865116915194611d44866109b8565b16845260208401528d8301526060820152611d5e8a611ae7565b52611d6889611ae7565b50511693895194611d78866109b8565b8552166020840152878301526060820152611d9284611af4565b52611d9c83611af4565b5083855180978195829463cac88ea960e01b84524291309160048601611b80565b03927f000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b2858165af1908115611df25750611cdb5750565b513d6000823e3d90fd5b909160405192610100840184811067ffffffffffffffff8211176108625760409081526001600160a01b0391821685529181166020850190815262ffffff9586168584019081523060608701908152426080880190815260a08801968752600060c0890181815260e08a01828152975163414bf38960e01b81529951871660048b01529451861660248a015292519098166044880152518316606487015295516084860152925160a4850152915160c484015251811660e4830152829082907f000000000000000000000000e592427a0aece92de3edee1f18e0157c0586156416815a9361010492602095f18015611f1e57611ef6575050565b602090813d8311611f17575b611f0c81836109d4565b8101031261194c5750565b503d611f02565b6040513d84823e3d90fdfea2646970667358221220073c12cecbd346697768ce078db1b1ed00b65c454cb4946e5baf24108a242a3364736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e2000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b2858000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
-----Decoded View---------------
Arg [0] : addressProvider_ (address): 0xbaA87EcC5Dd76526b51AB7FD2d0c814EB967E2E2
Arg [1] : velodromeRouter_ (address): 0xa062aE8A9c5e11aaA026fc2670B0D65cCc8B2858
Arg [2] : uniswapRouter_ (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000baa87ecc5dd76526b51ab7fd2d0c814eb967e2e2
Arg [1] : 000000000000000000000000a062ae8a9c5e11aaa026fc2670b0d65ccc8b2858
Arg [2] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.