Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
PriceGetterAlgebra
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.16; import "../IPriceGetterProtocol.sol"; import "../../IPriceGetter.sol"; import "../../lib/UtilityLibrary.sol"; import "./interfaces/IAlgebraPool.sol"; import "./interfaces/IAlgebraFactory.sol"; contract PriceGetterAlgebra is IPriceGetterProtocol { // ========== Get Token Prices ========== function getTokenPrice( address token, address factory, PriceGetterParams memory params ) public view override returns (uint256 price) { IAlgebraFactory factoryAlgebra = IAlgebraFactory(factory); uint256 nativePrice = params.mainPriceGetter.getNativePrice(IPriceGetter.Protocol.Algebra, factory); if (token == params.wrappedNative.tokenAddress) { return nativePrice; } uint256 tempPrice; uint256 totalPrice; uint256 totalBalance; tempPrice = _getRelativePriceLP(factoryAlgebra, token, params.wrappedNative.tokenAddress); if (tempPrice > 0) { address pair = factoryAlgebra.poolByPair(token, params.wrappedNative.tokenAddress); uint256 balance = IERC20(token).balanceOf(pair); uint256 wNativeBalance = IERC20(params.wrappedNative.tokenAddress).balanceOf(pair); if (wNativeBalance > params.nativeLiquidityThreshold) { totalPrice += ((tempPrice * nativePrice) / 1e18) * balance; totalBalance += balance; } } for (uint256 i = 0; i < params.stableUsdTokens.length; i++) { address stableUsdToken = params.stableUsdTokens[i].tokenAddress; tempPrice = _getRelativePriceLP(factoryAlgebra, token, stableUsdToken); if (tempPrice > 0) { address pair = factoryAlgebra.poolByPair(token, stableUsdToken); uint256 balance = IERC20(token).balanceOf(pair); uint256 balanceStable = IERC20(stableUsdToken).balanceOf(pair); if (balanceStable > 10 * (10 ** IERC20(stableUsdToken).decimals())) { uint256 stableUsdPrice = params.mainPriceGetter.getOraclePriceNormalized(stableUsdToken); if (stableUsdPrice > 0) { tempPrice = (tempPrice * stableUsdPrice) / 1e18; } totalPrice += tempPrice * balance; totalBalance += balance; } } } if (totalBalance == 0) { return 0; } price = totalPrice / totalBalance; } // ========== LP PRICE ========== function getLPPrice( address lp, address factory, PriceGetterParams memory params ) public view override returns (uint256 price) { IAlgebraFactory factoryAlgebra = IAlgebraFactory(factory); address token0 = IAlgebraPool(lp).token0(); address token1 = IAlgebraPool(lp).token1(); return _getRelativePriceLP(factoryAlgebra, token0, token1); } // ========== NATIVE PRICE ========== function getNativePrice( address factory, PriceGetterParams memory params ) public view override returns (uint256 price) { IAlgebraFactory factoryAlgebra = IAlgebraFactory(factory); uint256 totalPrice; uint256 wNativeTotal; for (uint256 i = 0; i < params.stableUsdTokens.length; i++) { address stableUsdToken = params.stableUsdTokens[i].tokenAddress; price = _getRelativePriceLP(factoryAlgebra, params.wrappedNative.tokenAddress, stableUsdToken); uint256 stableUsdPrice = params.mainPriceGetter.getOraclePriceNormalized(stableUsdToken); if (stableUsdPrice > 0) { price = (price * stableUsdPrice) / 1e18; } if (price > 0) { address pair = factoryAlgebra.poolByPair(params.wrappedNative.tokenAddress, stableUsdToken); uint256 balance = IERC20(params.wrappedNative.tokenAddress).balanceOf(pair); totalPrice += price * balance; wNativeTotal += balance; } } if (wNativeTotal == 0) { return 0; } price = totalPrice / wNativeTotal; } // ========== INTERNAL FUNCTIONS ========== function _getRelativePriceLP( IAlgebraFactory factoryAlgebra, address token0, address token1 ) internal view returns (uint256 price) { address tokenPegPair = IAlgebraFactory(factoryAlgebra).poolByPair(token0, token1); if (tokenPegPair == address(0)) return 0; uint256 sqrtPriceX96; (sqrtPriceX96, , , , , , ) = IAlgebraPool(tokenPegPair).globalState(); uint256 token0Decimals = UtilityLibrary._getTokenDecimals(token0); uint256 token1Decimals = UtilityLibrary._getTokenDecimals(token1); if (sqrtPriceX96 == 0) { return 0; } uint256 decimalCorrection = 0; if (sqrtPriceX96 >= 340282366920938463463374607431768211455) { sqrtPriceX96 = sqrtPriceX96 / 1e3; decimalCorrection = 6; } if (sqrtPriceX96 >= 340282366920938463463374607431768211455) { return 0; } if (token1 < token0) { price = (2 ** 192) / ((sqrtPriceX96) ** 2 / uint256(10 ** (token0Decimals + 18 - token1Decimals - decimalCorrection))); } else { price = ((sqrtPriceX96) ** 2) / ((2 ** 192) / uint256(10 ** (token0Decimals + 18 - token1Decimals - decimalCorrection))); } } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; pragma abicoder v2; /// @title The interface for the Algebra Factory /// @dev Credit to Uniswap Labs under GPL-2.0-or-later license: /// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces interface IAlgebraFactory { /// @notice Emitted when a process of ownership renounce is started /// @param timestamp The timestamp of event /// @param finishTimestamp The timestamp when ownership renounce will be possible to finish event RenounceOwnershipStart(uint256 timestamp, uint256 finishTimestamp); /// @notice Emitted when a process of ownership renounce cancelled /// @param timestamp The timestamp of event event RenounceOwnershipStop(uint256 timestamp); /// @notice Emitted when a process of ownership renounce finished /// @param timestamp The timestamp of ownership renouncement event RenounceOwnershipFinish(uint256 timestamp); /// @notice Emitted when a pool is created /// @param token0 The first token of the pool by address sort order /// @param token1 The second token of the pool by address sort order /// @param pool The address of the created pool event Pool(address indexed token0, address indexed token1, address pool); /// @notice Emitted when the farming address is changed /// @param newFarmingAddress The farming address after the address was changed event FarmingAddress(address indexed newFarmingAddress); /// @notice Emitted when the default community fee is changed /// @param newDefaultCommunityFee The new default community fee value event DefaultCommunityFee(uint8 newDefaultCommunityFee); /// @notice role that can change communityFee and tickspacing in pools function POOLS_ADMINISTRATOR_ROLE() external view returns (bytes32); /// @dev Returns `true` if `account` has been granted `role` or `account` is owner. function hasRoleOrOwner(bytes32 role, address account) external view returns (bool); /// @notice Returns the current owner of the factory /// @dev Can be changed by the current owner via transferOwnership(address newOwner) /// @return The address of the factory owner function owner() external view returns (address); /// @notice Returns the current poolDeployerAddress /// @return The address of the poolDeployer function poolDeployer() external view returns (address); /// @dev Is retrieved from the pools to restrict calling certain functions not by a tokenomics contract /// @return The tokenomics contract address function farmingAddress() external view returns (address); /// @notice Returns the current communityVaultAddress /// @return The address to which community fees are transferred function communityVault() external view returns (address); /// @notice Returns the default community fee /// @return Fee which will be set at the creation of the pool function defaultCommunityFee() external view returns (uint8); /// @notice Returns the pool address for a given pair of tokens, or address 0 if it does not exist /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order /// @param tokenA The contract address of either token0 or token1 /// @param tokenB The contract address of the other token /// @return pool The pool address function poolByPair(address tokenA, address tokenB) external view returns (address pool); /// @return timestamp The timestamp of the beginning of the renounceOwnership process function renounceOwnershipStartTimestamp() external view returns (uint256 timestamp); /// @notice Creates a pool for the given two tokens /// @param tokenA One of the two tokens in the desired pool /// @param tokenB The other of the two tokens in the desired pool /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. /// The call will revert if the pool already exists or the token arguments are invalid. /// @return pool The address of the newly created pool function createPool(address tokenA, address tokenB) external returns (address pool); /// @dev updates tokenomics address on the factory /// @param newFarmingAddress The new tokenomics contract address function setFarmingAddress(address newFarmingAddress) external; /// @dev updates default community fee for new pools /// @param newDefaultCommunityFee The new community fee, _must_ be <= MAX_COMMUNITY_FEE function setDefaultCommunityFee(uint8 newDefaultCommunityFee) external; /// @notice Starts process of renounceOwnership. After that, a certain period /// of time must pass before the ownership renounce can be completed. function startRenounceOwnership() external; /// @notice Stops process of renounceOwnership and removes timer. function stopRenounceOwnership() external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Pool state that can change /// @dev Credit to Uniswap Labs under GPL-2.0-or-later license: /// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces interface IAlgebraPool { /// @notice The globalState structure in the pool stores many values but requires only one slot /// and is exposed as a single method to save gas when accessed externally. /// @return price The current price of the pool as a sqrt(dToken1/dToken0) Q64.96 value; /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run; /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(price) if the price is on a tick boundary; /// @return prevInitializedTick The previous initialized tick /// @return fee The last pool fee value in hundredths of a bip, i.e. 1e-6 /// @return timepointIndex The index of the last written timepoint /// @return communityFee The community fee percentage of the swap fee in thousandths (1e-3) /// @return unlocked Whether the pool is currently locked to reentrancy function globalState() external view returns ( uint160 price, int24 tick, int24 prevInitializedTick, uint16 fee, uint16 timepointIndex, uint8 communityFee, bool unlocked ); function token0() external view returns (address); function token1() external view returns (address); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.16; import "../IPriceGetter.sol"; interface IPriceGetterProtocol { struct PriceGetterParams { IPriceGetter mainPriceGetter; IPriceGetter.TokenAndDecimals wrappedNative; IPriceGetter.TokenAndDecimals[] stableUsdTokens; uint256 nativeLiquidityThreshold; } /** * @dev Returns the price of a token. * @param token The address of the token to get the price for. * @return price The current price of the token. */ function getTokenPrice( address token, address factory, PriceGetterParams memory params ) external view returns (uint256 price); /** * @dev Returns the price of an LP token. * @param lp The address of the LP token to get the price for. * @return price The current price of the LP token. */ function getLPPrice( address lp, address factory, PriceGetterParams memory params ) external view returns (uint256 price); /** * @dev Returns the current price of the native token in USD. * @return nativePrice The current price of the native token in USD. */ function getNativePrice( address factory, PriceGetterParams memory params ) external view returns (uint256 nativePrice); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.16; interface IPriceGetter { enum Protocol { __, ___, UniV2, UniV3, Algebra, _Gamma, // outdated _Steer, // outdated Solidly, Xfai, Curve, AlgebraIntegral } enum Wrappers { Gamma, Ichi, Steer } struct TokenAndDecimals { address tokenAddress; uint8 decimals; } function getTokenPrice(address token, Protocol protocol, address factory) external view returns (uint256 price); function getLPPrice(address lp, Protocol protocol, address factory) external view returns (uint256 price); function getWrappedLPPrice( address lp, Protocol protocol, address factory, IPriceGetter.Wrappers wrapper ) external view returns (uint256 price); function getNativePrice(Protocol protocol, address factory) external view returns (uint256 nativePrice); function getOraclePriceNormalized(address token) external view returns (uint256 price); }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity 0.8.16; import "../token-lib/IERC20.sol"; library UtilityLibrary { function _isSorted(address tokenA, address tokenB) internal pure returns (bool isSorted) { // (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); isSorted = tokenA < tokenB ? true : false; } function _getTokenDecimals(address token) internal view returns (uint8 decimals) { try IERC20(token).decimals() returns (uint8 dec) { decimals = dec; } catch { decimals = 18; } } /// @notice Normalize the amount of a token to wei or 1e18 function _normalizeToken(uint256 amount, address token) internal view returns (uint256) { return _normalize(amount, _getTokenDecimals(token)); } /// @notice Normalize the amount of a token to wei or 1e18 function _normalizeToken112(uint112 amount, address token) internal view returns (uint112) { return _normalize112(amount, _getTokenDecimals(token)); } /// @notice Normalize the amount passed to wei or 1e18 decimals function _normalize(uint256 amount, uint8 decimals) internal pure returns (uint256) { if (decimals == 18) return amount; return (amount * (10 ** 18)) / (10 ** decimals); } /// @notice Normalize the amount passed to wei or 1e18 decimals function _normalize112(uint112 amount, uint8 decimals) internal pure returns (uint112) { if (decimals == 18) { return amount; } else if (decimals > 18) { return uint112(amount / (10 ** (decimals - 18))); } else { return uint112(amount * (10 ** (18 - decimals))); } } }
// SPDX-License-Identifier: GPL-3.0-only pragma solidity >=0.5.0; interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"lp","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getLPPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getNativePrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"factory","type":"address"},{"components":[{"internalType":"contract IPriceGetter","name":"mainPriceGetter","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals","name":"wrappedNative","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"internalType":"struct IPriceGetter.TokenAndDecimals[]","name":"stableUsdTokens","type":"tuple[]"},{"internalType":"uint256","name":"nativeLiquidityThreshold","type":"uint256"}],"internalType":"struct IPriceGetterProtocol.PriceGetterParams","name":"params","type":"tuple"}],"name":"getTokenPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506111d6806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635a51a2a0146100465780639bbcae161461006b578063e98765641461007e575b600080fd5b610059610054366004610dfe565b610091565b60405190815260200160405180910390f35b610059610079366004610dfe565b61017b565b61005961008c366004610e60565b610715565b6000808390506000856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610eb0565b90506000866001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561013d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101619190610eb0565b905061016e83838361095c565b93505050505b9392505050565b805160405160016246908760e11b03198152600091849183916001600160a01b03169063ff72def2906101b49060049086908201610ecd565b602060405180830381865afa1580156101d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f59190610f07565b90508360200151600001516001600160a01b0316866001600160a01b0316036102215791506101749050565b6000806000610239858a89602001516000015161095c565b925082156103f65760208701515160405163d9a641e160e01b81526001600160a01b038b81166004830152918216602482015260009187169063d9a641e190604401602060405180830381865afa158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc9190610eb0565b6040516370a0823160e01b81526001600160a01b0380831660048301529192506000918c16906370a0823190602401602060405180830381865afa158015610308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032c9190610f07565b60208a0151516040516370a0823160e01b81526001600160a01b038581166004830152929350600092909116906370a0823190602401602060405180830381865afa15801561037f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a39190610f07565b905089606001518111156103f25781670de0b6b3a76400006103c58989610f36565b6103cf9190610f55565b6103d99190610f36565b6103e39086610f77565b94506103ef8285610f77565b93505b5050505b60005b8760400151518110156106e75760008860400151828151811061041e5761041e610f8a565b6020026020010151600001519050610437878c8361095c565b945084156106d45760405163d9a641e160e01b81526001600160a01b038c8116600483015282811660248301526000919089169063d9a641e190604401602060405180830381865afa158015610491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b59190610eb0565b6040516370a0823160e01b81526001600160a01b0380831660048301529192506000918e16906370a0823190602401602060405180830381865afa158015610501573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105259190610f07565b6040516370a0823160e01b81526001600160a01b0384811660048301529192506000918516906370a0823190602401602060405180830381865afa158015610571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105959190610f07565b9050836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f99190610fa0565b61060490600a6110a1565b61060f90600a610f36565b8111156106d0578b5160405163427d626760e11b81526001600160a01b03868116600483015260009216906384fac4ce90602401602060405180830381865afa158015610660573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106849190610f07565b905080156106ac57670de0b6b3a764000061069f828b610f36565b6106a99190610f55565b98505b6106b6838a610f36565b6106c09089610f77565b97506106cc8388610f77565b9650505b5050505b50806106df816110b0565b9150506103f9565b50806000036106fe57600095505050505050610174565b6107088183610f55565b9998505050505050505050565b6000828180805b8560400151518110156109315760008660400151828151811061074157610741610f8a565b6020026020010151600001519050610762858860200151600001518361095c565b875160405163427d626760e11b81526001600160a01b038481166004830152929850600092909116906384fac4ce90602401602060405180830381865afa1580156107b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d59190610f07565b905080156107fd57670de0b6b3a76400006107f08289610f36565b6107fa9190610f55565b96505b861561091c5760208801515160405163d9a641e160e01b81526001600160a01b039182166004820152838216602482015260009188169063d9a641e190604401602060405180830381865afa15801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e9190610eb0565b60208a0151516040516370a0823160e01b81526001600160a01b038084166004830152929350600092909116906370a0823190602401602060405180830381865afa1580156108d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f59190610f07565b9050610901818a610f36565b61090b9088610f77565b96506109178187610f77565b955050505b50508080610929906110b0565b91505061071c565b50806000036109465760009350505050610956565b6109508183610f55565b93505050505b92915050565b60405163d9a641e160e01b81526001600160a01b0383811660048301528281166024830152600091829186169063d9a641e190604401602060405180830381865afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d39190610eb0565b90506001600160a01b0381166109ed576000915050610174565b6000816001600160a01b031663e76c01e46040518163ffffffff1660e01b815260040160e060405180830381865afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5191906110ed565b50506001600160a01b03909416945060009350610a739250889150610ba79050565b60ff1690506000610a8386610ba7565b60ff16905082600003610a9d576000945050505050610174565b60006001600160801b038410610ac057610ab96103e885610f55565b9350600690505b6001600160801b038410610adc57600095505050505050610174565b876001600160a01b0316876001600160a01b03161015610b4c578082610b03856012610f77565b610b0d9190611181565b610b179190611181565b610b2290600a611194565b610b2d6002866110a1565b610b379190610f55565b610b4590600160c01b610f55565b9550610b9b565b8082610b59856012610f77565b610b639190611181565b610b6d9190611181565b610b7890600a611194565b610b8690600160c01b610f55565b610b916002866110a1565b6107089190610f55565b50505050509392505050565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c03575060408051601f3d908101601f19168201909252610c0091810190610fa0565b60015b610c0f57506012919050565b90505b919050565b6001600160a01b0381168114610c2c57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610c6857610c68610c2f565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610c9757610c97610c2f565b604052919050565b60ff81168114610c2c57600080fd5b600060408284031215610cc057600080fd5b6040516040810181811067ffffffffffffffff82111715610ce357610ce3610c2f565b6040529050808235610cf481610c17565b81526020830135610d0481610c9f565b6020919091015292915050565b600060a08284031215610d2357600080fd5b610d2b610c45565b90508135610d3881610c17565b81526020610d4884848301610cae565b81830152606083013567ffffffffffffffff80821115610d6757600080fd5b818501915085601f830112610d7b57600080fd5b813581811115610d8d57610d8d610c2f565b610d9b848260051b01610c6e565b818152848101925060069190911b830184019087821115610dbb57600080fd5b928401925b81841015610de457610dd28885610cae565b83528483019250604084019350610dc0565b604086015250505050608091909101356060820152919050565b600080600060608486031215610e1357600080fd5b8335610e1e81610c17565b92506020840135610e2e81610c17565b9150604084013567ffffffffffffffff811115610e4a57600080fd5b610e5686828701610d11565b9150509250925092565b60008060408385031215610e7357600080fd5b8235610e7e81610c17565b9150602083013567ffffffffffffffff811115610e9a57600080fd5b610ea685828601610d11565b9150509250929050565b600060208284031215610ec257600080fd5b815161017481610c17565b60408101600b8410610eef57634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b600060208284031215610f1957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610f5057610f50610f20565b500290565b600082610f7257634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561095657610956610f20565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610fb257600080fd5b815161017481610c9f565b600181815b80851115610ff8578160001904821115610fde57610fde610f20565b80851615610feb57918102915b93841c9390800290610fc2565b509250929050565b60008261100f57506001610956565b8161101c57506000610956565b8160018114611032576002811461103c57611058565b6001915050610956565b60ff84111561104d5761104d610f20565b50506001821b610956565b5060208310610133831016604e8410600b841016171561107b575081810a610956565b6110858383610fbd565b806000190482111561109957611099610f20565b029392505050565b600061017460ff841683611000565b6000600182016110c2576110c2610f20565b5060010190565b8051600281900b8114610c1257600080fd5b805161ffff81168114610c1257600080fd5b600080600080600080600060e0888a03121561110857600080fd5b875161111381610c17565b9650611121602089016110c9565b955061112f604089016110c9565b945061113d606089016110db565b935061114b608089016110db565b925060a088015161115b81610c9f565b60c0890151909250801515811461117157600080fd5b8091505092959891949750929550565b8181038181111561095657610956610f20565b6000610174838361100056fea26469706673582212208673b5994f7e5dd6916b145fd9925c1818a97e7579c931c1bd4bc82dea6b3b5964736f6c63430008100033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635a51a2a0146100465780639bbcae161461006b578063e98765641461007e575b600080fd5b610059610054366004610dfe565b610091565b60405190815260200160405180910390f35b610059610079366004610dfe565b61017b565b61005961008c366004610e60565b610715565b6000808390506000856001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fb9190610eb0565b90506000866001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561013d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101619190610eb0565b905061016e83838361095c565b93505050505b9392505050565b805160405160016246908760e11b03198152600091849183916001600160a01b03169063ff72def2906101b49060049086908201610ecd565b602060405180830381865afa1580156101d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101f59190610f07565b90508360200151600001516001600160a01b0316866001600160a01b0316036102215791506101749050565b6000806000610239858a89602001516000015161095c565b925082156103f65760208701515160405163d9a641e160e01b81526001600160a01b038b81166004830152918216602482015260009187169063d9a641e190604401602060405180830381865afa158015610298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102bc9190610eb0565b6040516370a0823160e01b81526001600160a01b0380831660048301529192506000918c16906370a0823190602401602060405180830381865afa158015610308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032c9190610f07565b60208a0151516040516370a0823160e01b81526001600160a01b038581166004830152929350600092909116906370a0823190602401602060405180830381865afa15801561037f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a39190610f07565b905089606001518111156103f25781670de0b6b3a76400006103c58989610f36565b6103cf9190610f55565b6103d99190610f36565b6103e39086610f77565b94506103ef8285610f77565b93505b5050505b60005b8760400151518110156106e75760008860400151828151811061041e5761041e610f8a565b6020026020010151600001519050610437878c8361095c565b945084156106d45760405163d9a641e160e01b81526001600160a01b038c8116600483015282811660248301526000919089169063d9a641e190604401602060405180830381865afa158015610491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b59190610eb0565b6040516370a0823160e01b81526001600160a01b0380831660048301529192506000918e16906370a0823190602401602060405180830381865afa158015610501573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105259190610f07565b6040516370a0823160e01b81526001600160a01b0384811660048301529192506000918516906370a0823190602401602060405180830381865afa158015610571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105959190610f07565b9050836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f99190610fa0565b61060490600a6110a1565b61060f90600a610f36565b8111156106d0578b5160405163427d626760e11b81526001600160a01b03868116600483015260009216906384fac4ce90602401602060405180830381865afa158015610660573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106849190610f07565b905080156106ac57670de0b6b3a764000061069f828b610f36565b6106a99190610f55565b98505b6106b6838a610f36565b6106c09089610f77565b97506106cc8388610f77565b9650505b5050505b50806106df816110b0565b9150506103f9565b50806000036106fe57600095505050505050610174565b6107088183610f55565b9998505050505050505050565b6000828180805b8560400151518110156109315760008660400151828151811061074157610741610f8a565b6020026020010151600001519050610762858860200151600001518361095c565b875160405163427d626760e11b81526001600160a01b038481166004830152929850600092909116906384fac4ce90602401602060405180830381865afa1580156107b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d59190610f07565b905080156107fd57670de0b6b3a76400006107f08289610f36565b6107fa9190610f55565b96505b861561091c5760208801515160405163d9a641e160e01b81526001600160a01b039182166004820152838216602482015260009188169063d9a641e190604401602060405180830381865afa15801561085a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087e9190610eb0565b60208a0151516040516370a0823160e01b81526001600160a01b038084166004830152929350600092909116906370a0823190602401602060405180830381865afa1580156108d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f59190610f07565b9050610901818a610f36565b61090b9088610f77565b96506109178187610f77565b955050505b50508080610929906110b0565b91505061071c565b50806000036109465760009350505050610956565b6109508183610f55565b93505050505b92915050565b60405163d9a641e160e01b81526001600160a01b0383811660048301528281166024830152600091829186169063d9a641e190604401602060405180830381865afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d39190610eb0565b90506001600160a01b0381166109ed576000915050610174565b6000816001600160a01b031663e76c01e46040518163ffffffff1660e01b815260040160e060405180830381865afa158015610a2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5191906110ed565b50506001600160a01b03909416945060009350610a739250889150610ba79050565b60ff1690506000610a8386610ba7565b60ff16905082600003610a9d576000945050505050610174565b60006001600160801b038410610ac057610ab96103e885610f55565b9350600690505b6001600160801b038410610adc57600095505050505050610174565b876001600160a01b0316876001600160a01b03161015610b4c578082610b03856012610f77565b610b0d9190611181565b610b179190611181565b610b2290600a611194565b610b2d6002866110a1565b610b379190610f55565b610b4590600160c01b610f55565b9550610b9b565b8082610b59856012610f77565b610b639190611181565b610b6d9190611181565b610b7890600a611194565b610b8690600160c01b610f55565b610b916002866110a1565b6107089190610f55565b50505050509392505050565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610c03575060408051601f3d908101601f19168201909252610c0091810190610fa0565b60015b610c0f57506012919050565b90505b919050565b6001600160a01b0381168114610c2c57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715610c6857610c68610c2f565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610c9757610c97610c2f565b604052919050565b60ff81168114610c2c57600080fd5b600060408284031215610cc057600080fd5b6040516040810181811067ffffffffffffffff82111715610ce357610ce3610c2f565b6040529050808235610cf481610c17565b81526020830135610d0481610c9f565b6020919091015292915050565b600060a08284031215610d2357600080fd5b610d2b610c45565b90508135610d3881610c17565b81526020610d4884848301610cae565b81830152606083013567ffffffffffffffff80821115610d6757600080fd5b818501915085601f830112610d7b57600080fd5b813581811115610d8d57610d8d610c2f565b610d9b848260051b01610c6e565b818152848101925060069190911b830184019087821115610dbb57600080fd5b928401925b81841015610de457610dd28885610cae565b83528483019250604084019350610dc0565b604086015250505050608091909101356060820152919050565b600080600060608486031215610e1357600080fd5b8335610e1e81610c17565b92506020840135610e2e81610c17565b9150604084013567ffffffffffffffff811115610e4a57600080fd5b610e5686828701610d11565b9150509250925092565b60008060408385031215610e7357600080fd5b8235610e7e81610c17565b9150602083013567ffffffffffffffff811115610e9a57600080fd5b610ea685828601610d11565b9150509250929050565b600060208284031215610ec257600080fd5b815161017481610c17565b60408101600b8410610eef57634e487b7160e01b600052602160045260246000fd5b9281526001600160a01b039190911660209091015290565b600060208284031215610f1957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610f5057610f50610f20565b500290565b600082610f7257634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561095657610956610f20565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610fb257600080fd5b815161017481610c9f565b600181815b80851115610ff8578160001904821115610fde57610fde610f20565b80851615610feb57918102915b93841c9390800290610fc2565b509250929050565b60008261100f57506001610956565b8161101c57506000610956565b8160018114611032576002811461103c57611058565b6001915050610956565b60ff84111561104d5761104d610f20565b50506001821b610956565b5060208310610133831016604e8410600b841016171561107b575081810a610956565b6110858383610fbd565b806000190482111561109957611099610f20565b029392505050565b600061017460ff841683611000565b6000600182016110c2576110c2610f20565b5060010190565b8051600281900b8114610c1257600080fd5b805161ffff81168114610c1257600080fd5b600080600080600080600060e0888a03121561110857600080fd5b875161111381610c17565b9650611121602089016110c9565b955061112f604089016110c9565b945061113d606089016110db565b935061114b608089016110db565b925060a088015161115b81610c9f565b60c0890151909250801515811461117157600080fd5b8091505092959891949750929550565b8181038181111561095657610956610f20565b6000610174838361100056fea26469706673582212208673b5994f7e5dd6916b145fd9925c1818a97e7579c931c1bd4bc82dea6b3b5964736f6c63430008100033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.