Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 6 from a total of 6 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Price Calcul... | 5490244 | 87 days ago | IN | 0 ETH | 0.00000225 | ||||
Set Price Calcul... | 5489829 | 87 days ago | IN | 0 ETH | 0.00000216 | ||||
Set Price Calcul... | 3768279 | 145 days ago | IN | 0 ETH | 0.00000371 | ||||
Set Core | 3768278 | 145 days ago | IN | 0 ETH | 0.00000372 | ||||
Initialize | 3768277 | 145 days ago | IN | 0 ETH | 0.00000372 | ||||
0x60806040 | 3768276 | 145 days ago | IN | 0 ETH | 0.0001514 |
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
9251085 | 2 mins ago | 0 ETH | ||||
9251085 | 2 mins ago | 0 ETH | ||||
9251085 | 2 mins ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9247304 | 2 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9244348 | 3 hrs ago | 0 ETH | ||||
9240306 | 6 hrs ago | 0 ETH | ||||
9240306 | 6 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
Validator
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../interfaces/IPriceCalculator.sol"; import "../interfaces/IValidator.sol"; import "../interfaces/ILToken.sol"; import "../interfaces/ICore.sol"; import "../interfaces/IBEP20.sol"; import "../library/Constant.sol"; contract Validator is IValidator, Ownable { using SafeMath for uint256; /* ========== CONSTANT VARIABLES ========== */ IPriceCalculator public oracle; uint256 private constant labPriceCollateralCap = 75e15; uint256 private constant DUST = 1000; /* ========== STATE VARIABLES ========== */ ICore public core; address private LAB; bool public initialized; /* ========== INITIALIZER ========== */ constructor() public {} function initialize(address _lab) external onlyOwner { require(initialized == false, "already initialized"); LAB = _lab; initialized = true; } /// @notice priceCalculator address 를 설정 /// @dev ZERO ADDRESS 로 설정할 수 없음 /// @param _priceCalculator priceCalculator contract address function setPriceCalculator(address _priceCalculator) public onlyOwner { require(_priceCalculator != address(0), "Validator: invalid priceCalculator address"); oracle = IPriceCalculator(_priceCalculator); } /* ========== VIEWS ========== */ /// @notice View collateral, supply, borrow value in USD of account /// @param account account address /// @return collateralInUSD Total collateral value in USD /// @return supplyInUSD Total supply value in USD /// @return borrowInUSD Total borrow value in USD function getAccountLiquidity( address account ) external view override returns (uint256 collateralInUSD, uint256 supplyInUSD, uint256 borrowInUSD) { collateralInUSD = 0; supplyInUSD = 0; borrowInUSD = 0; address[] memory assets = core.marketListOf(account); uint256[] memory prices = oracle.getUnderlyingPrices(assets); for (uint256 i = 0; i < assets.length; i++) { require(prices[i] != 0, "Validator: price error"); uint256 decimals = _getDecimals(assets[i]); Constant.AccountSnapshot memory snapshot = ILToken(payable(assets[i])).accountSnapshot(account); uint256 priceCollateral; if (assets[i] == LAB && prices[i] > labPriceCollateralCap) { priceCollateral = labPriceCollateralCap; } else { priceCollateral = prices[i]; } uint256 collateralFactor = core.marketInfoOf(payable(assets[i])).collateralFactor; uint256 collateralValuePerShareInUSD = snapshot.exchangeRate.mul(priceCollateral).mul(collateralFactor).div(1e36); collateralInUSD = collateralInUSD.add( snapshot.gTokenBalance.mul(10 ** (18 - decimals)).mul(collateralValuePerShareInUSD).div(1e18) ); supplyInUSD = supplyInUSD.add( snapshot.gTokenBalance.mul(snapshot.exchangeRate).mul(10 ** (18 - decimals)).mul(prices[i]).div(1e36) ); borrowInUSD = borrowInUSD.add(snapshot.borrowBalance.mul(10 ** (18 - decimals)).mul(prices[i]).div(1e18)); } } /* ========== RESTRICTED FUNCTIONS ========== */ /// @notice core address 를 설정 /// @dev ZERO ADDRESS 로 설정할 수 없음 /// 설정 이후에는 다른 주소로 변경할 수 없음 /// @param _core core contract address function setCore(address _core) external onlyOwner { require(_core != address(0), "Validator: invalid core address"); require(address(core) == address(0), "Validator: core already set"); core = ICore(_core); } /* ========== ALLOWED FUNCTIONS ========== */ /// @notice View if redeem is allowed /// @param gToken gToken address /// @param redeemer Redeemer account /// @param redeemAmount Redeem amount of underlying token function redeemAllowed(address gToken, address redeemer, uint256 redeemAmount) external override returns (bool) { (, uint256 shortfall) = _getAccountLiquidityInternal(redeemer, gToken, redeemAmount, 0); return shortfall == 0; } /// @notice View if borrow is allowed /// @param gToken gToken address /// @param borrower Borrower address /// @param borrowAmount Borrow amount of underlying token function borrowAllowed(address gToken, address borrower, uint256 borrowAmount) external override returns (bool) { require(borrowAmount > DUST, "Validator: too small borrow amount"); require(core.checkMembership(borrower, address(gToken)), "Validator: enterMarket required"); require(oracle.getUnderlyingPrice(address(gToken)) > 0, "Validator: Underlying price error"); // Borrow cap of 0 corresponds to unlimited borrowing uint256 borrowCap = core.marketInfoOf(gToken).borrowCap; if (borrowCap != 0) { uint256 totalBorrows = ILToken(payable(gToken)).accruedTotalBorrow(); uint256 nextTotalBorrows = totalBorrows.add(borrowAmount); require(nextTotalBorrows < borrowCap, "Validator: market borrow cap reached"); } (, uint256 shortfall) = _getAccountLiquidityInternal(borrower, gToken, 0, borrowAmount); return shortfall == 0; } /// @notice View if liquidate is allowed /// @param gToken gToken address /// @param borrower Borrower address /// @param liquidateAmount Underlying token amount to liquidate /// @param closeFactor Close factor function liquidateAllowed( address gToken, address borrower, uint256 liquidateAmount, uint256 closeFactor ) external override returns (bool) { // The borrower must have shortfall in order to be liquidate (, uint256 shortfall) = _getAccountLiquidityInternal(borrower, address(0), 0, 0); require(shortfall != 0, "Validator: Insufficient shortfall"); // The liquidator may not repay more than what is allowed by the closeFactor uint256 borrowBalance = ILToken(payable(gToken)).accruedBorrowBalanceOf(borrower); uint256 maxClose = closeFactor.mul(borrowBalance).div(1e18); return liquidateAmount <= maxClose; } function gTokenAmountToSeize( address gTokenBorrowed, address gTokenCollateral, uint256 amount ) external override returns (uint256 seizeGAmount, uint256 rebateGAmount, uint256 liquidatorGAmount) { require( oracle.getUnderlyingPrice(gTokenBorrowed) != 0 && oracle.getUnderlyingPrice(gTokenCollateral) != 0, "Validator: price error" ); uint256 exchangeRate = ILToken(payable(gTokenCollateral)).accruedExchangeRate(); require(exchangeRate != 0, "Validator: exchangeRate of gTokenCollateral is zero"); uint256 borrowedDecimals = _getDecimals(gTokenBorrowed); uint256 collateralDecimals = _getDecimals(gTokenCollateral); // seizeGTokenAmountBase18 = ( repayAmount * (liquidationIncentive * priceBorrowed) / (priceCollateral * exchangeRate) ) // seizeGTokenAmount = seizeGTokenAmountBase18 / (10 ** (18 - decimals)) uint256 seizeGTokenAmountBase = amount .mul(10 ** (18 - borrowedDecimals)) .mul(core.liquidationIncentive()) .mul(oracle.getUnderlyingPrice(gTokenBorrowed)) .div(oracle.getUnderlyingPrice(gTokenCollateral).mul(exchangeRate)); seizeGAmount = seizeGTokenAmountBase.div(10 ** (18 - collateralDecimals)); liquidatorGAmount = seizeGAmount; rebateGAmount = 0; } /* ========== PRIVATE FUNCTIONS ========== */ function _getAccountLiquidityInternal( address account, address gToken, uint256 redeemAmount, uint256 borrowAmount ) private returns (uint256 liquidity, uint256 shortfall) { uint256 accCollateralValueInUSD; uint256 accBorrowValueInUSD; address[] memory assets = core.marketListOf(account); uint256[] memory prices = oracle.getUnderlyingPrices(assets); for (uint256 i = 0; i < assets.length; i++) { uint256 decimals = _getDecimals(assets[i]); require(prices[i] != 0, "Validator: price error"); Constant.AccountSnapshot memory snapshot = ILToken(payable(assets[i])).accruedAccountSnapshot(account); uint256 collateralValuePerShareInUSD; if (assets[i] == LAB && prices[i] > labPriceCollateralCap) { collateralValuePerShareInUSD = snapshot .exchangeRate .mul(labPriceCollateralCap) .mul(core.marketInfoOf(payable(assets[i])).collateralFactor) .div(1e36); } else { collateralValuePerShareInUSD = snapshot .exchangeRate .mul(prices[i]) .mul(core.marketInfoOf(payable(assets[i])).collateralFactor) .div(1e36); } accCollateralValueInUSD = accCollateralValueInUSD.add( snapshot.gTokenBalance.mul(10 ** (18 - decimals)).mul(collateralValuePerShareInUSD).div(1e18) ); accBorrowValueInUSD = accBorrowValueInUSD.add( snapshot.borrowBalance.mul(10 ** (18 - decimals)).mul(prices[i]).div(1e18) ); if (assets[i] == gToken) { accBorrowValueInUSD = accBorrowValueInUSD.add( _getAmountForAdditionalBorrowValue( redeemAmount, borrowAmount, collateralValuePerShareInUSD, prices[i], decimals ) ); } } liquidity = accCollateralValueInUSD > accBorrowValueInUSD ? accCollateralValueInUSD.sub(accBorrowValueInUSD) : 0; shortfall = accCollateralValueInUSD > accBorrowValueInUSD ? 0 : accBorrowValueInUSD.sub(accCollateralValueInUSD); } function _getAmountForAdditionalBorrowValue( uint256 redeemAmount, uint256 borrowAmount, uint256 collateralValuePerShareInUSD, uint256 price, uint256 decimals ) internal pure returns (uint256 additionalBorrowValueInUSD) { additionalBorrowValueInUSD = redeemAmount.mul(10 ** (18 - decimals)).mul(collateralValuePerShareInUSD).div(1e18); additionalBorrowValueInUSD = additionalBorrowValueInUSD.add( borrowAmount.mul(10 ** (18 - decimals)).mul(price).div(1e18) ); } /// @notice View underlying token decimals by gToken address /// @param gToken gToken address function _getDecimals(address gToken) internal view returns (uint256 decimals) { address underlying = ILToken(gToken).underlying(); if (underlying == address(0)) { decimals = 18; // ETH } else { decimals = IBEP20(underlying).decimals(); } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; interface IPriceCalculator { struct ReferenceData { uint256 lastData; uint256 lastUpdated; } function priceOf(address asset) external view returns (uint256); function pricesOf(address[] memory assets) external view returns (uint256[] memory); function priceOfETH() external view returns (uint256); function getUnderlyingPrice(address gToken) external view returns (uint256); function getUnderlyingPrices(address[] memory gTokens) external view returns (uint256[] memory); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "../library/Constant.sol"; interface ILToken { function underlying() external view returns (address); function totalSupply() external view returns (uint256); function accountSnapshot(address account) external view returns (Constant.AccountSnapshot memory); function underlyingBalanceOf(address account) external view returns (uint256); function borrowBalanceOf(address account) external view returns (uint256); function totalBorrow() external view returns (uint256); function _totalBorrow() external view returns (uint256); function totalReserve() external view returns (uint256); function reserveFactor() external view returns (uint256); function lastAccruedTime() external view returns (uint256); function accInterestIndex() external view returns (uint256); function exchangeRate() external view returns (uint256); function getCash() external view returns (uint256); function getRateModel() external view returns (address); function getAccInterestIndex() external view returns (uint256); function accruedAccountSnapshot(address account) external returns (Constant.AccountSnapshot memory); function accruedBorrowBalanceOf(address account) external returns (uint256); function accruedTotalBorrow() external returns (uint256); function accruedExchangeRate() external returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address dst, uint256 amount) external returns (bool); function transferFrom(address src, address dst, uint256 amount) external returns (bool); function supply(address account, uint256 underlyingAmount) external payable returns (uint256); function redeemToken(address account, uint256 gTokenAmount) external returns (uint256); function redeemUnderlying(address account, uint256 underlyingAmount) external returns (uint256); function borrow(address account, uint256 amount) external returns (uint256); function repayBorrow(address account, uint256 amount) external payable returns (uint256); function repayBorrowBehalf(address payer, address borrower, uint256 amount) external payable returns (uint256); function liquidateBorrow( address gTokenCollateral, address liquidator, address borrower, uint256 amount ) external payable returns (uint256 seizeGAmount, uint256 rebateGAmount, uint256 liquidatorGAmount); function seize(address liquidator, address borrower, uint256 gTokenAmount) external; function withdrawReserves() external; function transferTokensInternal(address spender, address src, address dst, uint256 amount) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; library Constant { uint256 public constant CLOSE_FACTOR_MIN = 5e16; uint256 public constant CLOSE_FACTOR_MAX = 9e17; uint256 public constant COLLATERAL_FACTOR_MAX = 9e17; uint256 public constant LIQUIDATION_THRESHOLD_MAX = 9e17; uint256 public constant LIQUIDATION_BONUS_MAX = 5e17; enum EcoScorePreviewOption { LOCK, CLAIM, EXTEND, LOCK_MORE } enum LoanState { None, Active, Auction, Repaid, Defaulted } struct MarketInfo { bool isListed; uint256 supplyCap; uint256 borrowCap; uint256 collateralFactor; } struct BorrowInfo { uint256 borrow; uint256 interestIndex; } struct LoanData { uint256 loanId; LoanState state; address borrower; address gNft; address nftAsset; uint256 nftTokenId; uint256 borrowAmount; uint256 interestIndex; uint256 bidStartTimestamp; address bidderAddress; uint256 bidPrice; uint256 bidBorrowAmount; uint256 floorPrice; uint256 bidCount; address firstBidderAddress; } struct AccountSnapshot { uint256 gTokenBalance; uint256 borrowBalance; uint256 exchangeRate; } struct AccrueSnapshot { uint256 totalBorrow; uint256 totalReserve; uint256 accInterestIndex; } struct AccrueLoanSnapshot { uint256 totalBorrow; uint256 accInterestIndex; } struct DistributionInfo { uint256 supplySpeed; uint256 borrowSpeed; uint256 totalBoostedSupply; uint256 totalBoostedBorrow; uint256 accPerShareSupply; uint256 accPerShareBorrow; uint256 accruedAt; } struct DistributionAccountInfo { uint256 accuredLAB; // Unclaimed LAB rewards amount uint256 boostedSupply; // effective(boosted) supply balance of user (since last_action) uint256 boostedBorrow; // effective(boosted) borrow balance of user (since last_action) uint256 accPerShareSupply; // Last integral value of LAB rewards per share. ∫(LABRate(t) / totalShare(t) dt) from 0 till (last_action) uint256 accPerShareBorrow; // Last integral value of LAB rewards per share. ∫(LABRate(t) / totalShare(t) dt) from 0 till (last_action) } struct DistributionAPY { uint256 apySupplyLab; uint256 apyBorrowLab; uint256 apyAccountSupplyLab; uint256 apyAccountBorrowLab; } struct RebateCheckpoint { uint256 timestamp; uint256 totalScore; uint256 adminFeeRate; uint256 weeklyLabSpeed; uint256 additionalLabAmount; mapping(address => uint256) marketFees; } struct LockInfo { uint256 timestamp; uint256 amount; uint256 expiry; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; interface IValidator { function redeemAllowed(address gToken, address redeemer, uint256 redeemAmount) external returns (bool); function borrowAllowed(address gToken, address borrower, uint256 borrowAmount) external returns (bool); function liquidateAllowed( address gTokenBorrowed, address borrower, uint256 repayAmount, uint256 closeFactor ) external returns (bool); function gTokenAmountToSeize( address gTokenBorrowed, address gTokenCollateral, uint256 actualRepayAmount ) external returns (uint256 seizeGAmount, uint256 rebateGAmount, uint256 liquidatorGAmount); function getAccountLiquidity( address account ) external view returns (uint256 collateralInUSD, uint256 supplyInUSD, uint256 borrowInUSD); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; import "../library/Constant.sol"; interface ICore { /* ========== Event ========== */ event MarketSupply(address user, address gToken, uint256 uAmount); event MarketRedeem(address user, address gToken, uint256 uAmount); event MarketListed(address gToken); event MarketEntered(address gToken, address account); event MarketExited(address gToken, address account); event CloseFactorUpdated(uint256 newCloseFactor); event CollateralFactorUpdated(address gToken, uint256 newCollateralFactor); event LiquidationIncentiveUpdated(uint256 newLiquidationIncentive); event SupplyCapUpdated(address indexed gToken, uint256 newSupplyCap); event BorrowCapUpdated(address indexed gToken, uint256 newBorrowCap); event KeeperUpdated(address newKeeper); event NftCoreUpdated(address newNftCore); event ValidatorUpdated(address newValidator); event LABDistributorUpdated(address newLABDistributor); event RebateDistributorUpdated(address newRebateDistributor); event FlashLoan( address indexed target, address indexed initiator, address indexed asset, uint256 amount, uint256 premium ); function nftCore() external view returns (address); function validator() external view returns (address); function rebateDistributor() external view returns (address); function allMarkets() external view returns (address[] memory); function marketListOf(address account) external view returns (address[] memory); function marketInfoOf(address gToken) external view returns (Constant.MarketInfo memory); function checkMembership(address account, address gToken) external view returns (bool); function accountLiquidityOf( address account ) external view returns (uint256 collateralInUSD, uint256 supplyInUSD, uint256 borrowInUSD); function closeFactor() external view returns (uint256); function liquidationIncentive() external view returns (uint256); function enterMarkets(address[] memory gTokens) external; function exitMarket(address gToken) external; function supply(address gToken, uint256 underlyingAmount) external payable returns (uint256); function redeemToken(address gToken, uint256 gTokenAmount) external returns (uint256 redeemed); function redeemUnderlying(address gToken, uint256 underlyingAmount) external returns (uint256 redeemed); function borrow(address gToken, uint256 amount) external; function nftBorrow(address gToken, address user, uint256 amount) external; function repayBorrow(address gToken, uint256 amount) external payable; function nftRepayBorrow(address gToken, address user, uint256 amount) external payable; function repayBorrowBehalf(address gToken, address borrower, uint256 amount) external payable; function liquidateBorrow( address gTokenBorrowed, address gTokenCollateral, address borrower, uint256 amount ) external payable; function claimLab() external; function claimLab(address market) external; function transferTokens(address spender, address src, address dst, uint256 amount) external; function compoundLab() external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.4.0; interface IBEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the bep token owner. */ function getOwner() external view returns (address); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address _owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
{ "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
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"gToken","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"borrowAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"core","outputs":[{"internalType":"contract ICore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gTokenBorrowed","type":"address"},{"internalType":"address","name":"gTokenCollateral","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"gTokenAmountToSeize","outputs":[{"internalType":"uint256","name":"seizeGAmount","type":"uint256"},{"internalType":"uint256","name":"rebateGAmount","type":"uint256"},{"internalType":"uint256","name":"liquidatorGAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountLiquidity","outputs":[{"internalType":"uint256","name":"collateralInUSD","type":"uint256"},{"internalType":"uint256","name":"supplyInUSD","type":"uint256"},{"internalType":"uint256","name":"borrowInUSD","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_lab","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gToken","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"liquidateAmount","type":"uint256"},{"internalType":"uint256","name":"closeFactor","type":"uint256"}],"name":"liquidateAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IPriceCalculator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gToken","type":"address"},{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_core","type":"address"}],"name":"setCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_priceCalculator","type":"address"}],"name":"setPriceCalculator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6120a78061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063800096301161008c578063da3d454c11610066578063da3d454c146101b5578063eabe7d91146101c8578063f2f4eb26146101db578063f2fde38b146101e3576100ea565b806380009630146101875780638da5cb5b1461019a578063c4d66de8146101a2576100ea565b80635ec88c79116100c85780635ec88c79146101425780636922d7b614610155578063715018a61461016a5780637dc0d1d014610172576100ea565b8063158ef93e146100ef5780631ed4a1741461010d57806325d024621461012f575b600080fd5b6100f76101f6565b6040516101049190611bdb565b60405180910390f35b61012061011b3660046118d5565b610206565b60405161010493929190611fee565b6100f761013d366004611915565b6105cb565b61012061015036600461189d565b6106a6565b61016861016336600461189d565b610b08565b005b610168610b8f565b61017a610c18565b6040516101049190611b60565b61016861019536600461189d565b610c27565b61017a610cd7565b6101686101b036600461189d565b610ce6565b6100f76101c33660046118d5565b610d7f565b6100f76101d63660046118d5565b61102d565b61017a611048565b6101686101f136600461189d565b611057565b600354600160a01b900460ff1681565b60015460405163fc57d4df60e01b8152600091829182916001600160a01b03169063fc57d4df9061023b908990600401611b60565b60206040518083038186803b15801561025357600080fd5b505afa158015610267573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028b9190611b27565b15801590610317575060015460405163fc57d4df60e01b81526001600160a01b039091169063fc57d4df906102c4908890600401611b60565b60206040518083038186803b1580156102dc57600080fd5b505afa1580156102f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103149190611b27565b15155b61033c5760405162461bcd60e51b815260040161033390611be6565b60405180910390fd5b6000856001600160a01b0316638b9db0376040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561037957600080fd5b505af115801561038d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b19190611b27565b9050806103d05760405162461bcd60e51b815260040161033390611f20565b60006103db88611117565b905060006103e888611117565b60015460405163fc57d4df60e01b81529192506000916105a59161047c9187916001600160a01b03169063fc57d4df90610426908f90600401611b60565b60206040518083038186803b15801561043e57600080fd5b505afa158015610452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104769190611b27565b90611221565b61059f600160009054906101000a90046001600160a01b03166001600160a01b031663fc57d4df8e6040518263ffffffff1660e01b81526004016104c09190611b60565b60206040518083038186803b1580156104d857600080fd5b505afa1580156104ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105109190611b27565b6002546040805163231d97a560e21b81529051610476926001600160a01b031691638c765e94916004808301926020929190829003018186803b15801561055657600080fd5b505afa15801561056a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058e9190611b27565b6104768e60128b9003600a0a611221565b90611264565b90506105b8816012849003600a0a611264565b9a60009a508b9950975050505050505050565b6000806105dc856000806000611296565b915050806105fc5760405162461bcd60e51b815260040161033390611e32565b6040516341cce05d60e11b81526000906001600160a01b03881690638399c0ba9061062b908990600401611b60565b602060405180830381600087803b15801561064557600080fd5b505af1158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d9190611b27565b90506000610697670de0b6b3a764000061059f8785611221565b90951115979650505050505050565b6002546040516305189e1160e41b8152600091829182916060916001600160a01b0390911690635189e110906106e0908890600401611b60565b60006040518083038186803b1580156106f857600080fd5b505afa15801561070c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610734919081019061195a565b6001546040516348a1371b60e01b81529192506060916001600160a01b03909116906348a1371b9061076a908590600401611b8e565b60006040518083038186803b15801561078257600080fd5b505afa158015610796573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107be91908101906119f8565b905060005b8251811015610afe578181815181106107d857fe5b6020026020010151600014156108005760405162461bcd60e51b815260040161033390611be6565b600061081e84838151811061081157fe5b6020026020010151611117565b905061082861187c565b84838151811061083457fe5b60200260200101516001600160a01b031663014a296f8a6040518263ffffffff1660e01b81526004016108679190611b60565b60606040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b79190611a98565b60035486519192506000916001600160a01b03909116908790869081106108da57fe5b60200260200101516001600160a01b0316148015610912575067010a741a4627800085858151811061090857fe5b6020026020010151115b15610926575067010a741a4627800061093d565b84848151811061093257fe5b602002602001015190505b60025486516000916001600160a01b031690636e8584fd9089908890811061096157fe5b60200260200101516040518263ffffffff1660e01b81526004016109859190611b60565b60806040518083038186803b15801561099d57600080fd5b505afa1580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611ad5565b6060015190506000610a0b6ec097ce7bc90715b34b9f100000000061059f8461047687896040015161122190919063ffffffff16565b9050610a44610a3d670de0b6b3a764000061059f846104768a601203600a0a8a6000015161122190919063ffffffff16565b8c906117d1565b9a50610a9f610a986ec097ce7bc90715b34b9f100000000061059f8a8a81518110610a6b57fe5b60200260200101516104768a601203600a0a6104768b604001518c6000015161122190919063ffffffff16565b8b906117d1565b9950610aeb610ae4670de0b6b3a764000061059f8a8a81518110610abf57fe5b60200260200101516104768a601203600a0a8a6020015161122190919063ffffffff16565b8a906117d1565b985050600190940193506107c392505050565b5050509193909250565b610b106117f6565b6001600160a01b0316610b21610cd7565b6001600160a01b031614610b475760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b038116610b6d5760405162461bcd60e51b815260040161033390611d0b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610b976117f6565b6001600160a01b0316610ba8610cd7565b6001600160a01b031614610bce5760405162461bcd60e51b815260040161033390611eeb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001546001600160a01b031681565b610c2f6117f6565b6001600160a01b0316610c40610cd7565b6001600160a01b031614610c665760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b038116610c8c5760405162461bcd60e51b815260040161033390611fb7565b6002546001600160a01b031615610cb55760405162461bcd60e51b815260040161033390611e73565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b610cee6117f6565b6001600160a01b0316610cff610cd7565b6001600160a01b031614610d255760405162461bcd60e51b815260040161033390611eeb565b600354600160a01b900460ff1615610d4f5760405162461bcd60e51b815260040161033390611dc3565b6003805460ff60a01b196001600160a01b039093166001600160a01b03199091161791909116600160a01b179055565b60006103e88211610da25760405162461bcd60e51b815260040161033390611df0565b60025460405163929fe9a160e01b81526001600160a01b039091169063929fe9a190610dd49086908890600401611b74565b60206040518083038186803b158015610dec57600080fd5b505afa158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e249190611a7c565b610e405760405162461bcd60e51b815260040161033390611cd4565b60015460405163fc57d4df60e01b81526000916001600160a01b03169063fc57d4df90610e71908890600401611b60565b60206040518083038186803b158015610e8957600080fd5b505afa158015610e9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec19190611b27565b11610ede5760405162461bcd60e51b815260040161033390611c16565b600254604051636e8584fd60e01b81526000916001600160a01b031690636e8584fd90610f0f908890600401611b60565b60806040518083038186803b158015610f2757600080fd5b505afa158015610f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5f9190611ad5565b6040015190508015611012576000856001600160a01b031663ecdaff7e6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fa857600080fd5b505af1158015610fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe09190611b27565b90506000610fee82866117d1565b905082811061100f5760405162461bcd60e51b815260040161033390611f73565b50505b60006110218587600087611296565b15979650505050505050565b60008061103d8486856000611296565b159695505050505050565b6002546001600160a01b031681565b61105f6117f6565b6001600160a01b0316611070610cd7565b6001600160a01b0316146110965760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b0381166110bc5760405162461bcd60e51b815260040161033390611c57565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561115357600080fd5b505afa158015611167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118b91906118b9565b90506001600160a01b0381166111a4576012915061121b565b806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156111dd57600080fd5b505afa1580156111f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112159190611b3f565b60ff1691505b50919050565b6000826112305750600061125e565b8282028284828161123d57fe5b041461125b5760405162461bcd60e51b815260040161033390611eaa565b90505b92915050565b60008082116112855760405162461bcd60e51b815260040161033390611d8c565b81838161128e57fe5b049392505050565b6002546040516305189e1160e41b81526000918291829182916060916001600160a01b031690635189e110906112d0908c90600401611b60565b60006040518083038186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611324919081019061195a565b6001546040516348a1371b60e01b81529192506060916001600160a01b03909116906348a1371b9061135a908590600401611b8e565b60006040518083038186803b15801561137257600080fd5b505afa158015611386573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113ae91908101906119f8565b905060005b825181101561178e5760006113cd84838151811061081157fe5b90508282815181106113db57fe5b6020026020010151600014156114035760405162461bcd60e51b815260040161033390611be6565b61140b61187c565b84838151811061141757fe5b60200260200101516001600160a01b03166392fa4e8e8e6040518263ffffffff1660e01b815260040161144a9190611b60565b606060405180830381600087803b15801561146457600080fd5b505af1158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c9190611a98565b60035486519192506000916001600160a01b03909116908790869081106114bf57fe5b60200260200101516001600160a01b03161480156114f7575067010a741a462780008585815181106114ed57fe5b6020026020010151115b156115cc5760025486516115c5916ec097ce7bc90715b34b9f10000000009161059f916001600160a01b031690636e8584fd908b908a90811061153657fe5b60200260200101516040518263ffffffff1660e01b815260040161155a9190611b60565b60806040518083038186803b15801561157257600080fd5b505afa158015611586573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115aa9190611ad5565b6060015160408601516104769067010a741a46278000611221565b90506116ab565b60025486516116a8916ec097ce7bc90715b34b9f10000000009161059f916001600160a01b031690636e8584fd908b908a90811061160657fe5b60200260200101516040518263ffffffff1660e01b815260040161162a9190611b60565b60806040518083038186803b15801561164257600080fd5b505afa158015611656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167a9190611ad5565b6060015161047689898151811061168d57fe5b6020026020010151876040015161122190919063ffffffff16565b90505b6116e26116db670de0b6b3a764000061059f8461047688601203600a0a886000015161122190919063ffffffff16565b89906117d1565b975061172e611727670de0b6b3a764000061059f88888151811061170257fe5b602002602001015161047688601203600a0a886020015161122190919063ffffffff16565b88906117d1565b96508c6001600160a01b031686858151811061174657fe5b60200260200101516001600160a01b03161415611783576117806117278d8d8489898151811061177257fe5b6020026020010151886117fa565b96505b5050506001016113b3565b5082841161179d5760006117a7565b6117a78484611854565b95508284116117bf576117ba8385611854565b6117c2565b60005b94505050505094509492505050565b60008282018381101561125b5760405162461bcd60e51b815260040161033390611c9d565b3390565b600061181d670de0b6b3a764000061059f866104768a6012889003600a0a611221565b905061184a611843670de0b6b3a764000061059f866104768a6012899003600a0a611221565b82906117d1565b9695505050505050565b6000828211156118765760405162461bcd60e51b815260040161033390611d55565b50900390565b60405180606001604052806000815260200160008152602001600081525090565b6000602082840312156118ae578081fd5b813561125b8161204b565b6000602082840312156118ca578081fd5b815161125b8161204b565b6000806000606084860312156118e9578182fd5b83356118f48161204b565b925060208401356119048161204b565b929592945050506040919091013590565b6000806000806080858703121561192a578081fd5b84356119358161204b565b935060208501356119458161204b565b93969395505050506040820135916060013590565b6000602080838503121561196c578182fd5b825167ffffffffffffffff811115611982578283fd5b8301601f81018513611992578283fd5b80516119a56119a08261202b565b612004565b81815283810190838501858402850186018910156119c1578687fd5b8694505b838510156119ec5780516119d88161204b565b8352600194909401939185019185016119c5565b50979650505050505050565b60006020808385031215611a0a578182fd5b825167ffffffffffffffff811115611a20578283fd5b8301601f81018513611a30578283fd5b8051611a3e6119a08261202b565b8181528381019083850185840285018601891015611a5a578687fd5b8694505b838510156119ec578051835260019490940193918501918501611a5e565b600060208284031215611a8d578081fd5b815161125b81612063565b600060608284031215611aa9578081fd5b611ab36060612004565b8251815260208301516020820152604083015160408201528091505092915050565b600060808284031215611ae6578081fd5b611af06080612004565b8251611afb81612063565b808252506020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215611b38578081fd5b5051919050565b600060208284031215611b50578081fd5b815160ff8116811461125b578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015611bcf5783516001600160a01b031683529284019291840191600101611baa565b50909695505050505050565b901515815260200190565b6020808252601690820152752b30b634b230ba37b91d10383934b1b29032b93937b960511b604082015260600190565b60208082526021908201527f56616c696461746f723a20556e6465726c79696e67207072696365206572726f6040820152603960f91b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601f908201527f56616c696461746f723a20656e7465724d61726b657420726571756972656400604082015260600190565b6020808252602a908201527f56616c696461746f723a20696e76616c696420707269636543616c63756c61746040820152696f72206164647265737360b01b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b602080825260139082015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604082015260600190565b60208082526022908201527f56616c696461746f723a20746f6f20736d616c6c20626f72726f7720616d6f756040820152611b9d60f21b606082015260800190565b60208082526021908201527f56616c696461746f723a20496e73756666696369656e742073686f727466616c6040820152601b60fa1b606082015260800190565b6020808252601b908201527f56616c696461746f723a20636f726520616c7265616479207365740000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526033908201527f56616c696461746f723a2065786368616e676552617465206f662067546f6b656040820152726e436f6c6c61746572616c206973207a65726f60681b606082015260800190565b60208082526024908201527f56616c696461746f723a206d61726b657420626f72726f77206361702072656160408201526318da195960e21b606082015260800190565b6020808252601f908201527f56616c696461746f723a20696e76616c696420636f7265206164647265737300604082015260600190565b9283526020830191909152604082015260600190565b60405181810167ffffffffffffffff8111828210171561202357600080fd5b604052919050565b600067ffffffffffffffff821115612041578081fd5b5060209081020190565b6001600160a01b038116811461206057600080fd5b50565b801515811461206057600080fdfea264697066735822122032b228ae7a70fb6d4c110fdacc807b8c1cda8cf565871d1fc8df96a257849a2964736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063800096301161008c578063da3d454c11610066578063da3d454c146101b5578063eabe7d91146101c8578063f2f4eb26146101db578063f2fde38b146101e3576100ea565b806380009630146101875780638da5cb5b1461019a578063c4d66de8146101a2576100ea565b80635ec88c79116100c85780635ec88c79146101425780636922d7b614610155578063715018a61461016a5780637dc0d1d014610172576100ea565b8063158ef93e146100ef5780631ed4a1741461010d57806325d024621461012f575b600080fd5b6100f76101f6565b6040516101049190611bdb565b60405180910390f35b61012061011b3660046118d5565b610206565b60405161010493929190611fee565b6100f761013d366004611915565b6105cb565b61012061015036600461189d565b6106a6565b61016861016336600461189d565b610b08565b005b610168610b8f565b61017a610c18565b6040516101049190611b60565b61016861019536600461189d565b610c27565b61017a610cd7565b6101686101b036600461189d565b610ce6565b6100f76101c33660046118d5565b610d7f565b6100f76101d63660046118d5565b61102d565b61017a611048565b6101686101f136600461189d565b611057565b600354600160a01b900460ff1681565b60015460405163fc57d4df60e01b8152600091829182916001600160a01b03169063fc57d4df9061023b908990600401611b60565b60206040518083038186803b15801561025357600080fd5b505afa158015610267573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028b9190611b27565b15801590610317575060015460405163fc57d4df60e01b81526001600160a01b039091169063fc57d4df906102c4908890600401611b60565b60206040518083038186803b1580156102dc57600080fd5b505afa1580156102f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103149190611b27565b15155b61033c5760405162461bcd60e51b815260040161033390611be6565b60405180910390fd5b6000856001600160a01b0316638b9db0376040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561037957600080fd5b505af115801561038d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b19190611b27565b9050806103d05760405162461bcd60e51b815260040161033390611f20565b60006103db88611117565b905060006103e888611117565b60015460405163fc57d4df60e01b81529192506000916105a59161047c9187916001600160a01b03169063fc57d4df90610426908f90600401611b60565b60206040518083038186803b15801561043e57600080fd5b505afa158015610452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104769190611b27565b90611221565b61059f600160009054906101000a90046001600160a01b03166001600160a01b031663fc57d4df8e6040518263ffffffff1660e01b81526004016104c09190611b60565b60206040518083038186803b1580156104d857600080fd5b505afa1580156104ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105109190611b27565b6002546040805163231d97a560e21b81529051610476926001600160a01b031691638c765e94916004808301926020929190829003018186803b15801561055657600080fd5b505afa15801561056a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058e9190611b27565b6104768e60128b9003600a0a611221565b90611264565b90506105b8816012849003600a0a611264565b9a60009a508b9950975050505050505050565b6000806105dc856000806000611296565b915050806105fc5760405162461bcd60e51b815260040161033390611e32565b6040516341cce05d60e11b81526000906001600160a01b03881690638399c0ba9061062b908990600401611b60565b602060405180830381600087803b15801561064557600080fd5b505af1158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d9190611b27565b90506000610697670de0b6b3a764000061059f8785611221565b90951115979650505050505050565b6002546040516305189e1160e41b8152600091829182916060916001600160a01b0390911690635189e110906106e0908890600401611b60565b60006040518083038186803b1580156106f857600080fd5b505afa15801561070c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610734919081019061195a565b6001546040516348a1371b60e01b81529192506060916001600160a01b03909116906348a1371b9061076a908590600401611b8e565b60006040518083038186803b15801561078257600080fd5b505afa158015610796573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107be91908101906119f8565b905060005b8251811015610afe578181815181106107d857fe5b6020026020010151600014156108005760405162461bcd60e51b815260040161033390611be6565b600061081e84838151811061081157fe5b6020026020010151611117565b905061082861187c565b84838151811061083457fe5b60200260200101516001600160a01b031663014a296f8a6040518263ffffffff1660e01b81526004016108679190611b60565b60606040518083038186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b79190611a98565b60035486519192506000916001600160a01b03909116908790869081106108da57fe5b60200260200101516001600160a01b0316148015610912575067010a741a4627800085858151811061090857fe5b6020026020010151115b15610926575067010a741a4627800061093d565b84848151811061093257fe5b602002602001015190505b60025486516000916001600160a01b031690636e8584fd9089908890811061096157fe5b60200260200101516040518263ffffffff1660e01b81526004016109859190611b60565b60806040518083038186803b15801561099d57600080fd5b505afa1580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611ad5565b6060015190506000610a0b6ec097ce7bc90715b34b9f100000000061059f8461047687896040015161122190919063ffffffff16565b9050610a44610a3d670de0b6b3a764000061059f846104768a601203600a0a8a6000015161122190919063ffffffff16565b8c906117d1565b9a50610a9f610a986ec097ce7bc90715b34b9f100000000061059f8a8a81518110610a6b57fe5b60200260200101516104768a601203600a0a6104768b604001518c6000015161122190919063ffffffff16565b8b906117d1565b9950610aeb610ae4670de0b6b3a764000061059f8a8a81518110610abf57fe5b60200260200101516104768a601203600a0a8a6020015161122190919063ffffffff16565b8a906117d1565b985050600190940193506107c392505050565b5050509193909250565b610b106117f6565b6001600160a01b0316610b21610cd7565b6001600160a01b031614610b475760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b038116610b6d5760405162461bcd60e51b815260040161033390611d0b565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610b976117f6565b6001600160a01b0316610ba8610cd7565b6001600160a01b031614610bce5760405162461bcd60e51b815260040161033390611eeb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001546001600160a01b031681565b610c2f6117f6565b6001600160a01b0316610c40610cd7565b6001600160a01b031614610c665760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b038116610c8c5760405162461bcd60e51b815260040161033390611fb7565b6002546001600160a01b031615610cb55760405162461bcd60e51b815260040161033390611e73565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b610cee6117f6565b6001600160a01b0316610cff610cd7565b6001600160a01b031614610d255760405162461bcd60e51b815260040161033390611eeb565b600354600160a01b900460ff1615610d4f5760405162461bcd60e51b815260040161033390611dc3565b6003805460ff60a01b196001600160a01b039093166001600160a01b03199091161791909116600160a01b179055565b60006103e88211610da25760405162461bcd60e51b815260040161033390611df0565b60025460405163929fe9a160e01b81526001600160a01b039091169063929fe9a190610dd49086908890600401611b74565b60206040518083038186803b158015610dec57600080fd5b505afa158015610e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e249190611a7c565b610e405760405162461bcd60e51b815260040161033390611cd4565b60015460405163fc57d4df60e01b81526000916001600160a01b03169063fc57d4df90610e71908890600401611b60565b60206040518083038186803b158015610e8957600080fd5b505afa158015610e9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec19190611b27565b11610ede5760405162461bcd60e51b815260040161033390611c16565b600254604051636e8584fd60e01b81526000916001600160a01b031690636e8584fd90610f0f908890600401611b60565b60806040518083038186803b158015610f2757600080fd5b505afa158015610f3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5f9190611ad5565b6040015190508015611012576000856001600160a01b031663ecdaff7e6040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610fa857600080fd5b505af1158015610fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe09190611b27565b90506000610fee82866117d1565b905082811061100f5760405162461bcd60e51b815260040161033390611f73565b50505b60006110218587600087611296565b15979650505050505050565b60008061103d8486856000611296565b159695505050505050565b6002546001600160a01b031681565b61105f6117f6565b6001600160a01b0316611070610cd7565b6001600160a01b0316146110965760405162461bcd60e51b815260040161033390611eeb565b6001600160a01b0381166110bc5760405162461bcd60e51b815260040161033390611c57565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561115357600080fd5b505afa158015611167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118b91906118b9565b90506001600160a01b0381166111a4576012915061121b565b806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156111dd57600080fd5b505afa1580156111f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112159190611b3f565b60ff1691505b50919050565b6000826112305750600061125e565b8282028284828161123d57fe5b041461125b5760405162461bcd60e51b815260040161033390611eaa565b90505b92915050565b60008082116112855760405162461bcd60e51b815260040161033390611d8c565b81838161128e57fe5b049392505050565b6002546040516305189e1160e41b81526000918291829182916060916001600160a01b031690635189e110906112d0908c90600401611b60565b60006040518083038186803b1580156112e857600080fd5b505afa1580156112fc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611324919081019061195a565b6001546040516348a1371b60e01b81529192506060916001600160a01b03909116906348a1371b9061135a908590600401611b8e565b60006040518083038186803b15801561137257600080fd5b505afa158015611386573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113ae91908101906119f8565b905060005b825181101561178e5760006113cd84838151811061081157fe5b90508282815181106113db57fe5b6020026020010151600014156114035760405162461bcd60e51b815260040161033390611be6565b61140b61187c565b84838151811061141757fe5b60200260200101516001600160a01b03166392fa4e8e8e6040518263ffffffff1660e01b815260040161144a9190611b60565b606060405180830381600087803b15801561146457600080fd5b505af1158015611478573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149c9190611a98565b60035486519192506000916001600160a01b03909116908790869081106114bf57fe5b60200260200101516001600160a01b03161480156114f7575067010a741a462780008585815181106114ed57fe5b6020026020010151115b156115cc5760025486516115c5916ec097ce7bc90715b34b9f10000000009161059f916001600160a01b031690636e8584fd908b908a90811061153657fe5b60200260200101516040518263ffffffff1660e01b815260040161155a9190611b60565b60806040518083038186803b15801561157257600080fd5b505afa158015611586573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115aa9190611ad5565b6060015160408601516104769067010a741a46278000611221565b90506116ab565b60025486516116a8916ec097ce7bc90715b34b9f10000000009161059f916001600160a01b031690636e8584fd908b908a90811061160657fe5b60200260200101516040518263ffffffff1660e01b815260040161162a9190611b60565b60806040518083038186803b15801561164257600080fd5b505afa158015611656573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167a9190611ad5565b6060015161047689898151811061168d57fe5b6020026020010151876040015161122190919063ffffffff16565b90505b6116e26116db670de0b6b3a764000061059f8461047688601203600a0a886000015161122190919063ffffffff16565b89906117d1565b975061172e611727670de0b6b3a764000061059f88888151811061170257fe5b602002602001015161047688601203600a0a886020015161122190919063ffffffff16565b88906117d1565b96508c6001600160a01b031686858151811061174657fe5b60200260200101516001600160a01b03161415611783576117806117278d8d8489898151811061177257fe5b6020026020010151886117fa565b96505b5050506001016113b3565b5082841161179d5760006117a7565b6117a78484611854565b95508284116117bf576117ba8385611854565b6117c2565b60005b94505050505094509492505050565b60008282018381101561125b5760405162461bcd60e51b815260040161033390611c9d565b3390565b600061181d670de0b6b3a764000061059f866104768a6012889003600a0a611221565b905061184a611843670de0b6b3a764000061059f866104768a6012899003600a0a611221565b82906117d1565b9695505050505050565b6000828211156118765760405162461bcd60e51b815260040161033390611d55565b50900390565b60405180606001604052806000815260200160008152602001600081525090565b6000602082840312156118ae578081fd5b813561125b8161204b565b6000602082840312156118ca578081fd5b815161125b8161204b565b6000806000606084860312156118e9578182fd5b83356118f48161204b565b925060208401356119048161204b565b929592945050506040919091013590565b6000806000806080858703121561192a578081fd5b84356119358161204b565b935060208501356119458161204b565b93969395505050506040820135916060013590565b6000602080838503121561196c578182fd5b825167ffffffffffffffff811115611982578283fd5b8301601f81018513611992578283fd5b80516119a56119a08261202b565b612004565b81815283810190838501858402850186018910156119c1578687fd5b8694505b838510156119ec5780516119d88161204b565b8352600194909401939185019185016119c5565b50979650505050505050565b60006020808385031215611a0a578182fd5b825167ffffffffffffffff811115611a20578283fd5b8301601f81018513611a30578283fd5b8051611a3e6119a08261202b565b8181528381019083850185840285018601891015611a5a578687fd5b8694505b838510156119ec578051835260019490940193918501918501611a5e565b600060208284031215611a8d578081fd5b815161125b81612063565b600060608284031215611aa9578081fd5b611ab36060612004565b8251815260208301516020820152604083015160408201528091505092915050565b600060808284031215611ae6578081fd5b611af06080612004565b8251611afb81612063565b808252506020830151602082015260408301516040820152606083015160608201528091505092915050565b600060208284031215611b38578081fd5b5051919050565b600060208284031215611b50578081fd5b815160ff8116811461125b578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015611bcf5783516001600160a01b031683529284019291840191600101611baa565b50909695505050505050565b901515815260200190565b6020808252601690820152752b30b634b230ba37b91d10383934b1b29032b93937b960511b604082015260600190565b60208082526021908201527f56616c696461746f723a20556e6465726c79696e67207072696365206572726f6040820152603960f91b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601f908201527f56616c696461746f723a20656e7465724d61726b657420726571756972656400604082015260600190565b6020808252602a908201527f56616c696461746f723a20696e76616c696420707269636543616c63756c61746040820152696f72206164647265737360b01b606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b602080825260139082015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604082015260600190565b60208082526022908201527f56616c696461746f723a20746f6f20736d616c6c20626f72726f7720616d6f756040820152611b9d60f21b606082015260800190565b60208082526021908201527f56616c696461746f723a20496e73756666696369656e742073686f727466616c6040820152601b60fa1b606082015260800190565b6020808252601b908201527f56616c696461746f723a20636f726520616c7265616479207365740000000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526033908201527f56616c696461746f723a2065786368616e676552617465206f662067546f6b656040820152726e436f6c6c61746572616c206973207a65726f60681b606082015260800190565b60208082526024908201527f56616c696461746f723a206d61726b657420626f72726f77206361702072656160408201526318da195960e21b606082015260800190565b6020808252601f908201527f56616c696461746f723a20696e76616c696420636f7265206164647265737300604082015260600190565b9283526020830191909152604082015260600190565b60405181810167ffffffffffffffff8111828210171561202357600080fd5b604052919050565b600067ffffffffffffffff821115612041578081fd5b5060209081020190565b6001600160a01b038116811461206057600080fd5b50565b801515811461206057600080fdfea264697066735822122032b228ae7a70fb6d4c110fdacc807b8c1cda8cf565871d1fc8df96a257849a2964736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.