Contract Overview
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x132f869612886a54ae007d22a932c9eeb43898385e93b7d147627b180269be1b | Set Gov | 20212064 | 230 days 11 hrs ago | Mycelium: Deployer | IN | 0x2de28ab4827112cd3f89e5353ca5a8d80db7018f | 0 ETH | 0.000044280756 ETH | |
0x3e088e1b33758625510cb46040813c08b6023f3d919624cff99259dd3959a710 | Set Handler | 20211858 | 230 days 11 hrs ago | Mycelium: Deployer | IN | 0x2de28ab4827112cd3f89e5353ca5a8d80db7018f | 0 ETH | 0.000050299249 ETH | |
0x9afd407054201b234c9a6b7497798bc10d6268c8150d3e86518402b97fb0a057 | Set In Private M... | 20209922 | 230 days 11 hrs ago | Mycelium: Deployer | IN | 0x2de28ab4827112cd3f89e5353ca5a8d80db7018f | 0 ETH | 0.000046367228 ETH | |
0xb991eaf51cf0fd322b53884dc370b3eef33c36f7fd8787e60598c8a89dafa31d | 0x60806040 | 20209915 | 230 days 11 hrs ago | Mycelium: Deployer | IN | Create: MlpManager | 0 ETH | 0.002756167689 ETH |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
MlpManager
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT import "../libraries/math/SafeMath.sol"; import "../libraries/token/IERC20.sol"; import "../libraries/token/SafeERC20.sol"; import "../libraries/utils/ReentrancyGuard.sol"; import "./interfaces/IVault.sol"; import "./interfaces/IMlpManager.sol"; import "../tokens/interfaces/IUSDG.sol"; import "../tokens/interfaces/IMintable.sol"; import "../access/Governable.sol"; pragma solidity 0.6.12; contract MlpManager is ReentrancyGuard, Governable, IMlpManager { using SafeMath for uint256; using SafeERC20 for IERC20; uint256 public constant PRICE_PRECISION = 10**30; uint256 public constant USDG_DECIMALS = 18; uint256 public constant MAX_COOLDOWN_DURATION = 48 hours; IVault public vault; address public usdg; address public mlp; uint256 public override cooldownDuration; mapping(address => uint256) public override lastAddedAt; uint256 public aumAddition; uint256 public aumDeduction; bool public inPrivateMode; mapping(address => bool) public isHandler; event AddLiquidity( address account, address token, uint256 amount, uint256 aumInUsdg, uint256 mlpSupply, uint256 usdgAmount, uint256 mintAmount ); event RemoveLiquidity( address account, address token, uint256 mlpAmount, uint256 aumInUsdg, uint256 mlpSupply, uint256 usdgAmount, uint256 amountOut ); constructor( address _vault, address _usdg, address _mlp, uint256 _cooldownDuration ) public { gov = msg.sender; vault = IVault(_vault); usdg = _usdg; mlp = _mlp; cooldownDuration = _cooldownDuration; } function setInPrivateMode(bool _inPrivateMode) external onlyGov { inPrivateMode = _inPrivateMode; } function setHandler(address _handler, bool _isActive) external onlyGov { isHandler[_handler] = _isActive; } function setCooldownDuration(uint256 _cooldownDuration) external onlyGov { require(_cooldownDuration <= MAX_COOLDOWN_DURATION, "MlpManager: invalid _cooldownDuration"); cooldownDuration = _cooldownDuration; } function setAumAdjustment(uint256 _aumAddition, uint256 _aumDeduction) external onlyGov { aumAddition = _aumAddition; aumDeduction = _aumDeduction; } function addLiquidity( address _token, uint256 _amount, uint256 _minUsdg, uint256 _minMlp ) external override nonReentrant returns (uint256) { if (inPrivateMode) { revert("MlpManager: action not enabled"); } return _addLiquidity(msg.sender, msg.sender, _token, _amount, _minUsdg, _minMlp); } function addLiquidityForAccount( address _fundingAccount, address _account, address _token, uint256 _amount, uint256 _minUsdg, uint256 _minMlp ) external override nonReentrant returns (uint256) { _validateHandler(); return _addLiquidity(_fundingAccount, _account, _token, _amount, _minUsdg, _minMlp); } function removeLiquidity( address _tokenOut, uint256 _mlpAmount, uint256 _minOut, address _receiver ) external override nonReentrant returns (uint256) { if (inPrivateMode) { revert("MlpManager: action not enabled"); } return _removeLiquidity(msg.sender, _tokenOut, _mlpAmount, _minOut, _receiver); } function removeLiquidityForAccount( address _account, address _tokenOut, uint256 _mlpAmount, uint256 _minOut, address _receiver ) external override nonReentrant returns (uint256) { _validateHandler(); return _removeLiquidity(_account, _tokenOut, _mlpAmount, _minOut, _receiver); } function getAums() public view returns (uint256[] memory) { uint256[] memory amounts = new uint256[](2); amounts[0] = getAum(true); amounts[1] = getAum(false); return amounts; } function getAumInUsdg(bool maximise) public view returns (uint256) { uint256 aum = getAum(maximise); return aum.mul(10**USDG_DECIMALS).div(PRICE_PRECISION); } function getAum(bool maximise) public view returns (uint256) { uint256 length = vault.allWhitelistedTokensLength(); uint256 aum = aumAddition; uint256 shortProfits = 0; for (uint256 i = 0; i < length; i++) { address token = vault.allWhitelistedTokens(i); bool isWhitelisted = vault.whitelistedTokens(token); if (!isWhitelisted) { continue; } uint256 price = maximise ? vault.getMaxPrice(token) : vault.getMinPrice(token); uint256 poolAmount = vault.poolAmounts(token); uint256 decimals = vault.tokenDecimals(token); if (vault.stableTokens(token)) { aum = aum.add(poolAmount.mul(price).div(10**decimals)); } else { // add global short profit / loss uint256 size = vault.globalShortSizes(token); if (size > 0) { uint256 averagePrice = vault.globalShortAveragePrices(token); uint256 priceDelta = averagePrice > price ? averagePrice.sub(price) : price.sub(averagePrice); uint256 delta = size.mul(priceDelta).div(averagePrice); if (price > averagePrice) { // add losses from shorts aum = aum.add(delta); } else { shortProfits = shortProfits.add(delta); } } aum = aum.add(vault.guaranteedUsd(token)); uint256 reservedAmount = vault.reservedAmounts(token); aum = aum.add(poolAmount.sub(reservedAmount).mul(price).div(10**decimals)); } } aum = shortProfits > aum ? 0 : aum.sub(shortProfits); return aumDeduction > aum ? 0 : aum.sub(aumDeduction); } function _addLiquidity( address _fundingAccount, address _account, address _token, uint256 _amount, uint256 _minUsdg, uint256 _minMlp ) private returns (uint256) { require(_amount > 0, "MlpManager: invalid _amount"); // calculate aum before buyUSDG uint256 aumInUsdg = getAumInUsdg(true); uint256 mlpSupply = IERC20(mlp).totalSupply(); IERC20(_token).safeTransferFrom(_fundingAccount, address(vault), _amount); uint256 usdgAmount = vault.buyUSDG(_token, address(this)); require(usdgAmount >= _minUsdg, "MlpManager: insufficient USDG output"); uint256 mintAmount = aumInUsdg == 0 ? usdgAmount : usdgAmount.mul(mlpSupply).div(aumInUsdg); require(mintAmount >= _minMlp, "MlpManager: insufficient MLP output"); IMintable(mlp).mint(_account, mintAmount); lastAddedAt[_account] = block.timestamp; emit AddLiquidity(_account, _token, _amount, aumInUsdg, mlpSupply, usdgAmount, mintAmount); return mintAmount; } function _removeLiquidity( address _account, address _tokenOut, uint256 _mlpAmount, uint256 _minOut, address _receiver ) private returns (uint256) { require(_mlpAmount > 0, "MlpManager: invalid _mlpAmount"); require( lastAddedAt[_account].add(cooldownDuration) <= block.timestamp, "MlpManager: cooldown duration not yet passed" ); // calculate aum before sellUSDG uint256 aumInUsdg = getAumInUsdg(false); uint256 mlpSupply = IERC20(mlp).totalSupply(); uint256 usdgAmount = _mlpAmount.mul(aumInUsdg).div(mlpSupply); uint256 usdgBalance = IERC20(usdg).balanceOf(address(this)); if (usdgAmount > usdgBalance) { IUSDG(usdg).mint(address(this), usdgAmount.sub(usdgBalance)); } IMintable(mlp).burn(_account, _mlpAmount); IERC20(usdg).transfer(address(vault), usdgAmount); uint256 amountOut = vault.sellUSDG(_tokenOut, _receiver); require(amountOut >= _minOut, "MlpManager: insufficient output"); emit RemoveLiquidity(_account, _tokenOut, _mlpAmount, aumInUsdg, mlpSupply, usdgAmount, amountOut); return amountOut; } function _validateHandler() private view { require(isHandler[msg.sender], "MlpManager: forbidden"); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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, 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) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * 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); uint256 c = a - b; return c; } /** * @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) { // 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 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts 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) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message 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, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `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.12; import "./IERC20.sol"; import "../math/SafeMath.sol"; import "../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./IVaultUtils.sol"; interface IVault { function isInitialized() external view returns (bool); function isSwapEnabled() external view returns (bool); function isLeverageEnabled() external view returns (bool); function setVaultUtils(IVaultUtils _vaultUtils) external; function setError(uint256 _errorCode, string calldata _error) external; function router() external view returns (address); function usdg() external view returns (address); function gov() external view returns (address); function whitelistedTokenCount() external view returns (uint256); function maxLeverage() external view returns (uint256); function minProfitTime() external view returns (uint256); function hasDynamicFees() external view returns (bool); function fundingInterval() external view returns (uint256); function totalTokenWeights() external view returns (uint256); function getTargetUsdgAmount(address _token) external view returns (uint256); function inManagerMode() external view returns (bool); function inPrivateLiquidationMode() external view returns (bool); function maxGasPrice() external view returns (uint256); function approvedRouters(address _account, address _router) external view returns (bool); function isLiquidator(address _account) external view returns (bool); function isManager(address _account) external view returns (bool); function minProfitBasisPoints(address _token) external view returns (uint256); function tokenBalances(address _token) external view returns (uint256); function lastFundingTimes(address _token) external view returns (uint256); function setMaxLeverage(uint256 _maxLeverage) external; function setInManagerMode(bool _inManagerMode) external; function setManager(address _manager, bool _isManager) external; function setIsSwapEnabled(bool _isSwapEnabled) external; function setIsLeverageEnabled(bool _isLeverageEnabled) external; function setMaxGasPrice(uint256 _maxGasPrice) external; function setUsdgAmount(address _token, uint256 _amount) external; function setBufferAmount(address _token, uint256 _amount) external; function setMaxGlobalShortSize(address _token, uint256 _amount) external; function setInPrivateLiquidationMode(bool _inPrivateLiquidationMode) external; function setLiquidator(address _liquidator, bool _isActive) external; function setFundingRate( uint256 _fundingInterval, uint256 _fundingRateFactor, uint256 _stableFundingRateFactor ) external; function setFees( uint256 _taxBasisPoints, uint256 _stableTaxBasisPoints, uint256 _mintBurnFeeBasisPoints, uint256 _swapFeeBasisPoints, uint256 _stableSwapFeeBasisPoints, uint256 _marginFeeBasisPoints, uint256 _liquidationFeeUsd, uint256 _minProfitTime, bool _hasDynamicFees ) external; function setTokenConfig( address _token, uint256 _tokenDecimals, uint256 _redemptionBps, uint256 _minProfitBps, uint256 _maxUsdgAmount, bool _isStable, bool _isShortable ) external; function setPriceFeed(address _priceFeed) external; function withdrawFees(address _token, address _receiver) external returns (uint256); function directPoolDeposit(address _token) external; function buyUSDG(address _token, address _receiver) external returns (uint256); function sellUSDG(address _token, address _receiver) external returns (uint256); function swap( address _tokenIn, address _tokenOut, address _receiver ) external returns (uint256); function increasePosition( address _account, address _collateralToken, address _indexToken, uint256 _sizeDelta, bool _isLong ) external; function decreasePosition( address _account, address _collateralToken, address _indexToken, uint256 _collateralDelta, uint256 _sizeDelta, bool _isLong, address _receiver ) external returns (uint256); function liquidatePosition( address _account, address _collateralToken, address _indexToken, bool _isLong, address _feeReceiver ) external; function tokenToUsdMin(address _token, uint256 _tokenAmount) external view returns (uint256); function priceFeed() external view returns (address); function fundingRateFactor() external view returns (uint256); function stableFundingRateFactor() external view returns (uint256); function cumulativeFundingRates(address _token) external view returns (uint256); function getNextFundingRate(address _token) external view returns (uint256); function getFeeBasisPoints( address _token, uint256 _usdgDelta, uint256 _feeBasisPoints, uint256 _taxBasisPoints, bool _increment ) external view returns (uint256); function liquidationFeeUsd() external view returns (uint256); function taxBasisPoints() external view returns (uint256); function stableTaxBasisPoints() external view returns (uint256); function mintBurnFeeBasisPoints() external view returns (uint256); function swapFeeBasisPoints() external view returns (uint256); function stableSwapFeeBasisPoints() external view returns (uint256); function marginFeeBasisPoints() external view returns (uint256); function allWhitelistedTokensLength() external view returns (uint256); function allWhitelistedTokens(uint256) external view returns (address); function whitelistedTokens(address _token) external view returns (bool); function stableTokens(address _token) external view returns (bool); function shortableTokens(address _token) external view returns (bool); function feeReserves(address _token) external view returns (uint256); function globalShortSizes(address _token) external view returns (uint256); function globalShortAveragePrices(address _token) external view returns (uint256); function maxGlobalShortSizes(address _token) external view returns (uint256); function tokenDecimals(address _token) external view returns (uint256); function tokenWeights(address _token) external view returns (uint256); function guaranteedUsd(address _token) external view returns (uint256); function poolAmounts(address _token) external view returns (uint256); function bufferAmounts(address _token) external view returns (uint256); function reservedAmounts(address _token) external view returns (uint256); function usdgAmounts(address _token) external view returns (uint256); function maxUsdgAmounts(address _token) external view returns (uint256); function getRedemptionAmount(address _token, uint256 _usdgAmount) external view returns (uint256); function getMaxPrice(address _token) external view returns (uint256); function getMinPrice(address _token) external view returns (uint256); function getDelta( address _indexToken, uint256 _size, uint256 _averagePrice, bool _isLong, uint256 _lastIncreasedTime ) external view returns (bool, uint256); function getPosition( address _account, address _collateralToken, address _indexToken, bool _isLong ) external view returns ( uint256, uint256, uint256, uint256, uint256, uint256, bool, uint256 ); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IMlpManager { function cooldownDuration() external returns (uint256); function lastAddedAt(address _account) external returns (uint256); function addLiquidity( address _token, uint256 _amount, uint256 _minUsdg, uint256 _minMlp ) external returns (uint256); function addLiquidityForAccount( address _fundingAccount, address _account, address _token, uint256 _amount, uint256 _minUsdg, uint256 _minMlp ) external returns (uint256); function removeLiquidity( address _tokenOut, uint256 _mlpAmount, uint256 _minOut, address _receiver ) external returns (uint256); function removeLiquidityForAccount( address _account, address _tokenOut, uint256 _MlpAmount, uint256 _minOut, address _receiver ) external returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IUSDG { function addVault(address _vault) external; function removeVault(address _vault) external; function mint(address _account, uint256 _amount) external; function burn(address _account, uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IMintable { function isMinter(address _account) external returns (bool); function setMinter(address _minter, bool _isActive) external; function mint(address _account, uint256 _amount) external; function burn(address _account, uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; contract Governable { address public gov; constructor() public { gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "Governable: forbidden"); _; } function setGov(address _gov) external onlyGov { gov = _gov; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.3._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IVaultUtils { function updateCumulativeFundingRate(address _collateralToken, address _indexToken) external returns (bool); function validateIncreasePosition( address _account, address _collateralToken, address _indexToken, uint256 _sizeDelta, bool _isLong ) external view; function validateDecreasePosition( address _account, address _collateralToken, address _indexToken, uint256 _collateralDelta, uint256 _sizeDelta, bool _isLong, address _receiver ) external view; function validateLiquidation( address _account, address _collateralToken, address _indexToken, bool _isLong, bool _raise ) external view returns (uint256, uint256); function getEntryFundingRate( address _collateralToken, address _indexToken, bool _isLong ) external view returns (uint256); function getPositionFee( address _account, address _collateralToken, address _indexToken, bool _isLong, uint256 _sizeDelta ) external view returns (uint256); function getFundingFee( address _account, address _collateralToken, address _indexToken, bool _isLong, uint256 _size, uint256 _entryFundingRate ) external view returns (uint256); function getBuyUsdgFeeBasisPoints(address _token, uint256 _usdgAmount) external view returns (uint256); function getSellUsdgFeeBasisPoints(address _token, uint256 _usdgAmount) external view returns (uint256); function getSwapFeeBasisPoints( address _tokenIn, address _tokenOut, uint256 _usdgAmount ) external view returns (uint256); function getFeeBasisPoints( address _token, uint256 _usdgDelta, uint256 _feeBasisPoints, uint256 _taxBasisPoints, bool _increment ) external view returns (uint256); }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_usdg","type":"address"},{"internalType":"address","name":"_mlp","type":"address"},{"internalType":"uint256","name":"_cooldownDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"aumInUsdg","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mlpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"usdgAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"AddLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"mlpAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"aumInUsdg","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mlpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"usdgAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"RemoveLiquidity","type":"event"},{"inputs":[],"name":"MAX_COOLDOWN_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDG_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minUsdg","type":"uint256"},{"internalType":"uint256","name":"_minMlp","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_fundingAccount","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_minUsdg","type":"uint256"},{"internalType":"uint256","name":"_minMlp","type":"uint256"}],"name":"addLiquidityForAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"aumAddition","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aumDeduction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cooldownDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"maximise","type":"bool"}],"name":"getAum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"maximise","type":"bool"}],"name":"getAumInUsdg","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAums","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inPrivateMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isHandler","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastAddedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mlp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_mlpAmount","type":"uint256"},{"internalType":"uint256","name":"_minOut","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"removeLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_mlpAmount","type":"uint256"},{"internalType":"uint256","name":"_minOut","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"removeLiquidityForAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_aumAddition","type":"uint256"},{"internalType":"uint256","name":"_aumDeduction","type":"uint256"}],"name":"setAumAdjustment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_cooldownDuration","type":"uint256"}],"name":"setCooldownDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_handler","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_inPrivateMode","type":"bool"}],"name":"setInPrivateMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdg","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516120c03803806120c08339818101604052608081101561003357600080fd5b50805160208201516040830151606090930151600160008181558154336001600160a01b031991821681178216179092556002805483166001600160a01b03968716179055600380548316948616949094179093556004805490911693909416929092179092556005556120139081906100ad90396000f3fe608060405234801561001057600080fd5b50600436106101335760003560e01c80630339147614610138578063070eacee1461016957806312d43a511461018557806317eb2a15146101a9578063196b68cb146101f15780631e9049cf146101f95780631ece366a1461020157806335269315146102395780633e49e2131461024157806346ea87af1461024957806368a0a3e01461026f5780636a86da191461028e57806371d597ad146102af578063870d917c146102f35780638b770e11146102fb5780638fed0b2c146103215780639116c4ae1461035b57806395082d251461037e578063966be075146103865780639cb7de4b146103a3578063b172bb0c146103d1578063cfad57a2146103d9578063ed0d1c04146103ff578063f5b91b7b14610457578063fbfa77cf1461045f575b600080fd5b6101576004803603602081101561014e57600080fd5b50351515610467565b60408051918252519081900360200190f35b610171610b88565b604080519115158252519081900360200190f35b61018d610b91565b604080516001600160a01b039092168252519081900360200190f35b610157600480360360c08110156101bf57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135610ba0565b610157610c13565b610157610c19565b6101576004803603608081101561021757600080fd5b506001600160a01b038135169060208101359060408101359060600135610c20565b610157610ccf565b61018d610cd5565b6101716004803603602081101561025f57600080fd5b50356001600160a01b0316610ce4565b6101576004803603602081101561028557600080fd5b50351515610cf9565b6102ad600480360360208110156102a457600080fd5b50351515610d30565b005b610157600480360360a08110156102c557600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160809091013516610d90565b610157610e01565b6101576004803603602081101561031157600080fd5b50356001600160a01b0316610e06565b6101576004803603608081101561033757600080fd5b506001600160a01b0381358116916020810135916040820135916060013516610e18565b6102ad6004803603604081101561037157600080fd5b5080359060200135610eb8565b610157610f10565b6102ad6004803603602081101561039c57600080fd5b5035610f20565b6102ad600480360360408110156103b957600080fd5b506001600160a01b0381351690602001351515610fb4565b61015761102c565b6102ad600480360360208110156103ef57600080fd5b50356001600160a01b0316611032565b6104076110a1565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561044357818101518382015260200161042b565b505050509050019250505060405180910390f35b61018d61110f565b61018d61111e565b600080600260009054906101000a90046001600160a01b03166001600160a01b0316630842b0766040518163ffffffff1660e01b815260040160206040518083038186803b1580156104b857600080fd5b505afa1580156104cc573d6000803e3d6000fd5b505050506040513d60208110156104e257600080fd5b50516007549091506000805b83811015610b445760025460408051630e468baf60e41b81526004810184905290516000926001600160a01b03169163e468baf0916024808301926020929190829003018186803b15801561054257600080fd5b505afa158015610556573d6000803e3d6000fd5b505050506040513d602081101561056c57600080fd5b505160025460408051630daf9c2160e41b81526001600160a01b0380851660048301529151939450600093919092169163daf9c210916024808301926020929190829003018186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d60208110156105eb57600080fd5b50519050806105fb575050610b3c565b60008861068057600254604080516340d3096b60e11b81526001600160a01b038681166004830152915191909216916381a612d6916024808301926020929190829003018186803b15801561064f57600080fd5b505afa158015610663573d6000803e3d6000fd5b505050506040513d602081101561067957600080fd5b50516106fa565b60025460408051637092736960e11b81526001600160a01b0386811660048301529151919092169163e124e6d2916024808301926020929190829003018186803b1580156106cd57600080fd5b505afa1580156106e1573d6000803e3d6000fd5b505050506040513d60208110156106f757600080fd5b50515b600254604080516352f55eed60e01b81526001600160a01b038781166004830152915193945060009391909216916352f55eed916024808301926020929190829003018186803b15801561074d57600080fd5b505afa158015610761573d6000803e3d6000fd5b505050506040513d602081101561077757600080fd5b5051600254604080516323b95ceb60e21b81526001600160a01b03888116600483015291519394506000939190921691638ee573ac916024808301926020929190829003018186803b1580156107cc57600080fd5b505afa1580156107e0573d6000803e3d6000fd5b505050506040513d60208110156107f657600080fd5b5051600254604080516342b60b0360e01b81526001600160a01b03898116600483015291519394509116916342b60b0391602480820192602092909190829003018186803b15801561084757600080fd5b505afa15801561085b573d6000803e3d6000fd5b505050506040513d602081101561087157600080fd5b5051156108a15761089a610893600a83900a61088d858761112d565b9061118f565b89906111ce565b9750610b36565b6002546040805163114f1b5560e31b81526001600160a01b03888116600483015291516000939290921691638a78daa891602480820192602092909190829003018186803b1580156108f257600080fd5b505afa158015610906573d6000803e3d6000fd5b505050506040513d602081101561091c57600080fd5b505190508015610a055760025460408051636274980360e01b81526001600160a01b03898116600483015291516000939290921691636274980391602480820192602092909190829003018186803b15801561097757600080fd5b505afa15801561098b573d6000803e3d6000fd5b505050506040513d60208110156109a157600080fd5b5051905060008582116109bd576109b88683611226565b6109c7565b6109c78287611226565b905060006109d98361088d868561112d565b9050828711156109f4576109ed8c826111ce565b9b50610a01565b6109fe8b826111ce565b9a505b5050505b6002546040805163783a2b6760e11b81526001600160a01b0389811660048301529151610a8a93929092169163f07456ce91602480820192602092909190829003018186803b158015610a5757600080fd5b505afa158015610a6b573d6000803e3d6000fd5b505050506040513d6020811015610a8157600080fd5b50518a906111ce565b6002546040805163c3c7b9e960e01b81526001600160a01b038a811660048301529151939c50600093919092169163c3c7b9e9916024808301926020929190829003018186803b158015610add57600080fd5b505afa158015610af1573d6000803e3d6000fd5b505050506040513d6020811015610b0757600080fd5b50519050610b31610b2a600a85900a61088d88610b248987611226565b9061112d565b8b906111ce565b995050505b50505050505b6001016104ee565b50818111610b5b57610b568282611226565b610b5e565b60005b91508160085411610b7c57600854610b77908390611226565b610b7f565b60005b95945050505050565b60095460ff1681565b6001546001600160a01b031681565b600060026000541415610be8576040805162461bcd60e51b815260206004820152601f6024820152600080516020611e75833981519152604482015290519081900360640190fd5b6002600055610bf5611268565b610c038787878787876112c6565b6001600055979650505050505050565b60075481565b6202a30081565b600060026000541415610c68576040805162461bcd60e51b815260206004820152601f6024820152600080516020611e75833981519152604482015290519081900360640190fd5b600260005560095460ff1615610cb3576040805162461bcd60e51b815260206004820152601e6024820152600080516020611f50833981519152604482015290519081900360640190fd5b610cc13333878787876112c6565b600160005595945050505050565b60055481565b6004546001600160a01b031681565b600a6020526000908152604090205460ff1681565b600080610d0583610467565b9050610d2968327cb2734119d3b7a9601e1b61088d83670de0b6b3a764000061112d565b9392505050565b6001546001600160a01b03163314610d7d576040805162461bcd60e51b81526020600482015260156024820152600080516020611e95833981519152604482015290519081900360640190fd5b6009805460ff1916911515919091179055565b600060026000541415610dd8576040805162461bcd60e51b815260206004820152601f6024820152600080516020611e75833981519152604482015290519081900360640190fd5b6002600055610de5611268565b610df286868686866115e3565b60016000559695505050505050565b601281565b60066020526000908152604090205481565b600060026000541415610e60576040805162461bcd60e51b815260206004820152601f6024820152600080516020611e75833981519152604482015290519081900360640190fd5b600260005560095460ff1615610eab576040805162461bcd60e51b815260206004820152601e6024820152600080516020611f50833981519152604482015290519081900360640190fd5b610cc133868686866115e3565b6001546001600160a01b03163314610f05576040805162461bcd60e51b81526020600482015260156024820152600080516020611e95833981519152604482015290519081900360640190fd5b600791909155600855565b68327cb2734119d3b7a9601e1b81565b6001546001600160a01b03163314610f6d576040805162461bcd60e51b81526020600482015260156024820152600080516020611e95833981519152604482015290519081900360640190fd5b6202a300811115610faf5760405162461bcd60e51b8152600401808060200182810382526025815260200180611f2b6025913960400191505060405180910390fd5b600555565b6001546001600160a01b03163314611001576040805162461bcd60e51b81526020600482015260156024820152600080516020611e95833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600a60205260409020805460ff1916911515919091179055565b60085481565b6001546001600160a01b0316331461107f576040805162461bcd60e51b81526020600482015260156024820152600080516020611e95833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160028082526060808301845292839291906020830190803683370190505090506110cf6001610467565b816000815181106110dc57fe5b6020026020010181815250506110f26000610467565b816001815181106110ff57fe5b6020908102919091010152905090565b6003546001600160a01b031681565b6002546001600160a01b031681565b60008261113c57506000611189565b8282028284828161114957fe5b04146111865760405162461bcd60e51b8152600401808060200182810382526021815260200180611f706021913960400191505060405180910390fd5b90505b92915050565b600061118683836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b815250611a83565b600082820183811015611186576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b600061118683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b25565b336000908152600a602052604090205460ff166112c4576040805162461bcd60e51b815260206004820152601560248201527426b63826b0b730b3b2b91d103337b93134b23232b760591b604482015290519081900360640190fd5b565b600080841161131a576040805162461bcd60e51b815260206004820152601b60248201527a135b1c13585b9859d95c8e881a5b9d985b1a590817d85b5bdd5b9d602a1b604482015290519081900360640190fd5b60006113266001610cf9565b90506000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561137857600080fd5b505afa15801561138c573d6000803e3d6000fd5b505050506040513d60208110156113a257600080fd5b50516002549091506113c3906001600160a01b03898116918c911689611b7f565b6002546040805163817bb85760e01b81526001600160a01b038a811660048301523060248301529151600093929092169163817bb8579160448082019260209290919082900301818787803b15801561141b57600080fd5b505af115801561142f573d6000803e3d6000fd5b505050506040513d602081101561144557600080fd5b50519050858110156114885760405162461bcd60e51b8152600401808060200182810382526024815260200180611eb56024913960400191505060405180910390fd5b600083156114a35761149e8461088d848661112d565b6114a5565b815b9050858110156114e65760405162461bcd60e51b8152600401808060200182810382526023815260200180611f916023913960400191505060405180910390fd5b60048054604080516340c10f1960e01b81526001600160a01b038e81169482019490945260248101859052905192909116916340c10f199160448082019260009290919082900301818387803b15801561153f57600080fd5b505af1158015611553573d6000803e3d6000fd5b5050506001600160a01b03808c166000818152600660209081526040918290204290558151928352928d16928201929092528082018b9052606081018790526080810186905260a0810185905260c0810184905290517f38dc38b96482be64113daffd8d464ebda93e856b70ccfc605e69ccf892ab981e92509081900360e00190a19a9950505050505050505050565b6000808411611639576040805162461bcd60e51b815260206004820152601e60248201527f4d6c704d616e616765723a20696e76616c6964205f6d6c70416d6f756e740000604482015290519081900360640190fd5b6005546001600160a01b038716600090815260066020526040902054429161166191906111ce565b111561169e5760405162461bcd60e51b815260040180806020018281038252602c815260200180611ed9602c913960400191505060405180910390fd5b60006116aa6000610cf9565b90506000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156116fc57600080fd5b505afa158015611710573d6000803e3d6000fd5b505050506040513d602081101561172657600080fd5b50519050600061173a8261088d898661112d565b600354604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561178b57600080fd5b505afa15801561179f573d6000803e3d6000fd5b505050506040513d60208110156117b557600080fd5b505190508082111561183c576003546001600160a01b03166340c10f19306117dd8585611226565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561182357600080fd5b505af1158015611837573d6000803e3d6000fd5b505050505b6004805460408051632770a7eb60e21b81526001600160a01b038e811694820194909452602481018c905290519290911691639dc29fac9160448082019260009290919082900301818387803b15801561189557600080fd5b505af11580156118a9573d6000803e3d6000fd5b50506003546002546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905191909216935063a9059cbb925060448083019260209291908290030181600087803b15801561190657600080fd5b505af115801561191a573d6000803e3d6000fd5b505050506040513d602081101561193057600080fd5b505060025460408051630711e61960e41b81526001600160a01b038c8116600483015289811660248301529151600093929092169163711e61909160448082019260209290919082900301818787803b15801561198c57600080fd5b505af11580156119a0573d6000803e3d6000fd5b505050506040513d60208110156119b657600080fd5b5051905087811015611a0f576040805162461bcd60e51b815260206004820152601f60248201527f4d6c704d616e616765723a20696e73756666696369656e74206f757470757400604482015290519081900360640190fd5b604080516001600160a01b03808e1682528c1660208201528082018b9052606081018790526080810186905260a0810185905260c0810183905290517f87b9679bb9a4944bafa98c267e7cd4a00ab29fed48afdefae25f0fca5da279409181900360e00190a19a9950505050505050505050565b60008183611b0f5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ad4578181015183820152602001611abc565b50505050905090810190601f168015611b015780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611b1b57fe5b0495945050505050565b60008184841115611b775760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ad4578181015183820152602001611abc565b505050900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611bd9908590611bdf565b50505050565b6060611c34826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c959092919063ffffffff16565b805190915015611c9057808060200190516020811015611c5357600080fd5b5051611c905760405162461bcd60e51b815260040180806020018281038252602a815260200180611fb4602a913960400191505060405180910390fd5b505050565b6060611ca48484600085611cac565b949350505050565b606082471015611ced5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f056026913960400191505060405180910390fd5b611cf685611e08565b611d47576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611d865780518252601f199092019160209182019101611d67565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611de8576040519150601f19603f3d011682016040523d82523d6000602084013e611ded565b606091505b5091509150611dfd828286611e0e565b979650505050505050565b3b151590565b60608315611e1d575081610d29565b825115611e2d5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315611ad4578181015183820152602001611abc56fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c00476f7665726e61626c653a20666f7262696464656e00000000000000000000004d6c704d616e616765723a20696e73756666696369656e742055534447206f75747075744d6c704d616e616765723a20636f6f6c646f776e206475726174696f6e206e6f742079657420706173736564416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4d6c704d616e616765723a20696e76616c6964205f636f6f6c646f776e4475726174696f6e4d6c704d616e616765723a20616374696f6e206e6f7420656e61626c65640000536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d6c704d616e616765723a20696e73756666696369656e74204d4c50206f75747075745361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212203924f212384399610e0fe47b243228921c9bdfbb02febd5842b540c89c0e0fd864736f6c634300060c0033000000000000000000000000dfba8ad57d2c62f61f0a60b2c508bcdeb182f855000000000000000000000000e61a61b9ce1bd12e17a53aeeee1005ef6c1b2e80000000000000000000000000752b746426b6d0c3188bb530660374f92fd9cf7c0000000000000000000000000000000000000000000000000000000000000384
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000dfba8ad57d2c62f61f0a60b2c508bcdeb182f855000000000000000000000000e61a61b9ce1bd12e17a53aeeee1005ef6c1b2e80000000000000000000000000752b746426b6d0c3188bb530660374f92fd9cf7c0000000000000000000000000000000000000000000000000000000000000384
-----Decoded View---------------
Arg [0] : _vault (address): 0xdfba8ad57d2c62f61f0a60b2c508bcdeb182f855
Arg [1] : _usdg (address): 0xe61a61b9ce1bd12e17a53aeeee1005ef6c1b2e80
Arg [2] : _mlp (address): 0x752b746426b6d0c3188bb530660374f92fd9cf7c
Arg [3] : _cooldownDuration (uint256): 900
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000dfba8ad57d2c62f61f0a60b2c508bcdeb182f855
Arg [1] : 000000000000000000000000e61a61b9ce1bd12e17a53aeeee1005ef6c1b2e80
Arg [2] : 000000000000000000000000752b746426b6d0c3188bb530660374f92fd9cf7c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000384
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.