Contract 0x01de6c50b697f2a02b90973bbb811c379915eaf7

Contract Overview

Balance:
0 tCRO
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x014897ef71b69abb4931ebfef23edc2632b5c968ddb568e2c9a7a573b5c1611f0x6080604061304262022-11-17 2:09:2372 days 18 hrs ago0x111e164336e0d0a2b9554f96a2cca80680fba449 IN  Contract Creation0 tCRO2.5960118552620
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0x5a10a0a5d33e72f740ea24d7ba5ff0e73e4b7a001e0f86f9c595c0666dde606372762642023-01-28 13:59:576 hrs 59 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x01de6c50b697f2a02b90973bbb811c379915eaf7 0x4b789d998ff47e06e7e4aed3045162d50dad76ab0 tCRO
0xea15d5d3345f5b8402cdd5d9d291c055829f69e1015b3ea9e1e2291ef56dced972760712023-01-28 13:42:267 hrs 17 mins ago 0x4b789d998ff47e06e7e4aed3045162d50dad76ab 0x01de6c50b697f2a02b90973bbb811c379915eaf70 tCRO
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xee8F18F45fdb764BbE9026F6967B90F876cB7B78

Contract Name:
VaultUtils

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)

File 1 of 6 : Governable.sol
// 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;
    }
}

File 2 of 6 : IVault.sol
// 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 validateLiquidation(address _account, address _collateralToken, address _indexToken, bool _isLong, bool _raise) external view returns (uint256, 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);
}

File 3 of 6 : IVaultUtils.sol
// 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);
}

File 4 of 6 : VaultUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "../libraries/math/SafeMath.sol";
import "../libraries/token/IERC20.sol";
import "./interfaces/IVault.sol";
import "./interfaces/IVaultUtils.sol";

import "../access/Governable.sol";

contract VaultUtils is IVaultUtils, Governable {
    using SafeMath for uint256;

    struct Position {
        uint256 size;
        uint256 collateral;
        uint256 averagePrice;
        uint256 entryFundingRate;
        uint256 reserveAmount;
        int256 realisedPnl;
        uint256 lastIncreasedTime;
    }

    IVault public vault;

    uint256 public constant BASIS_POINTS_DIVISOR = 10000;
    uint256 public constant FUNDING_RATE_PRECISION = 1000000;

    constructor(IVault _vault) public {
        vault = _vault;
    }

    function updateCumulativeFundingRate(address /* _collateralToken */, address /* _indexToken */) public override returns (bool) {
        return true;
    }

    function validateIncreasePosition(address /* _account */, address /* _collateralToken */, address /* _indexToken */, uint256 /* _sizeDelta */, bool /* _isLong */) external override view {
        // no additional validations
    }

    function validateDecreasePosition(address /* _account */, address /* _collateralToken */, address /* _indexToken */ , uint256 /* _collateralDelta */, uint256 /* _sizeDelta */, bool /* _isLong */, address /* _receiver */) external override view {
        // no additional validations
    }

    function getPosition(address _account, address _collateralToken, address _indexToken, bool _isLong) internal view returns (Position memory) {
        IVault _vault = vault;
        Position memory position;
        {
            (uint256 size, uint256 collateral, uint256 averagePrice, uint256 entryFundingRate, /* reserveAmount */, /* realisedPnl */, /* hasProfit */, uint256 lastIncreasedTime) = _vault.getPosition(_account, _collateralToken, _indexToken, _isLong);
            position.size = size;
            position.collateral = collateral;
            position.averagePrice = averagePrice;
            position.entryFundingRate = entryFundingRate;
            position.lastIncreasedTime = lastIncreasedTime;
        }
        return position;
    }

    function validateLiquidation(address _account, address _collateralToken, address _indexToken, bool _isLong, bool _raise) public view override returns (uint256, uint256) {
        Position memory position = getPosition(_account, _collateralToken, _indexToken, _isLong);
        IVault _vault = vault;

        (bool hasProfit, uint256 delta) = _vault.getDelta(_indexToken, position.size, position.averagePrice, _isLong, position.lastIncreasedTime);
        uint256 marginFees = getFundingFee(_account, _collateralToken, _indexToken, _isLong, position.size, position.entryFundingRate);
        marginFees = marginFees.add(getPositionFee(_account, _collateralToken, _indexToken, _isLong, position.size));

        if (!hasProfit && position.collateral < delta) {
            if (_raise) { revert("Vault: losses exceed collateral"); }
            return (1, marginFees);
        }

        uint256 remainingCollateral = position.collateral;
        if (!hasProfit) {
            remainingCollateral = position.collateral.sub(delta);
        }

        if (remainingCollateral < marginFees) {
            if (_raise) { revert("Vault: fees exceed collateral"); }
            // cap the fees to the remainingCollateral
            return (1, remainingCollateral);
        }

        if (remainingCollateral < marginFees.add(_vault.liquidationFeeUsd())) {
            if (_raise) { revert("Vault: liquidation fees exceed collateral"); }
            return (1, marginFees);
        }

        if (remainingCollateral.mul(_vault.maxLeverage()) < position.size.mul(BASIS_POINTS_DIVISOR)) {
            if (_raise) { revert("Vault: maxLeverage exceeded"); }
            return (2, marginFees);
        }

        return (0, marginFees);
    }

    function getEntryFundingRate(address _collateralToken, address /* _indexToken */, bool /* _isLong */) public override view returns (uint256) {
        return vault.cumulativeFundingRates(_collateralToken);
    }

    function getPositionFee(address /* _account */, address /* _collateralToken */, address /* _indexToken */, bool /* _isLong */, uint256 _sizeDelta) public override view returns (uint256) {
        if (_sizeDelta == 0) { return 0; }
        uint256 afterFeeUsd = _sizeDelta.mul(BASIS_POINTS_DIVISOR.sub(vault.marginFeeBasisPoints())).div(BASIS_POINTS_DIVISOR);
        return _sizeDelta.sub(afterFeeUsd);
    }

    function getFundingFee(address /* _account */, address _collateralToken, address /* _indexToken */, bool /* _isLong */, uint256 _size, uint256 _entryFundingRate) public override view returns (uint256) {
        if (_size == 0) { return 0; }

        uint256 fundingRate = vault.cumulativeFundingRates(_collateralToken).sub(_entryFundingRate);
        if (fundingRate == 0) { return 0; }

        return _size.mul(fundingRate).div(FUNDING_RATE_PRECISION);
    }

    function getBuyUsdgFeeBasisPoints(address _token, uint256 _usdgAmount) public override view returns (uint256) {
        return getFeeBasisPoints(_token, _usdgAmount, vault.mintBurnFeeBasisPoints(), vault.taxBasisPoints(), true);
    }

    function getSellUsdgFeeBasisPoints(address _token, uint256 _usdgAmount) public override view returns (uint256) {
        return getFeeBasisPoints(_token, _usdgAmount, vault.mintBurnFeeBasisPoints(), vault.taxBasisPoints(), false);
    }

    function getSwapFeeBasisPoints(address _tokenIn, address _tokenOut, uint256 _usdgAmount) public override view returns (uint256) {
        bool isStableSwap = vault.stableTokens(_tokenIn) && vault.stableTokens(_tokenOut);
        uint256 baseBps = isStableSwap ? vault.stableSwapFeeBasisPoints() : vault.swapFeeBasisPoints();
        uint256 taxBps = isStableSwap ? vault.stableTaxBasisPoints() : vault.taxBasisPoints();
        uint256 feesBasisPoints0 = getFeeBasisPoints(_tokenIn, _usdgAmount, baseBps, taxBps, true);
        uint256 feesBasisPoints1 = getFeeBasisPoints(_tokenOut, _usdgAmount, baseBps, taxBps, false);
        // use the higher of the two fee basis points
        return feesBasisPoints0 > feesBasisPoints1 ? feesBasisPoints0 : feesBasisPoints1;
    }

    // cases to consider
    // 1. initialAmount is far from targetAmount, action increases balance slightly => high rebate
    // 2. initialAmount is far from targetAmount, action increases balance largely => high rebate
    // 3. initialAmount is close to targetAmount, action increases balance slightly => low rebate
    // 4. initialAmount is far from targetAmount, action reduces balance slightly => high tax
    // 5. initialAmount is far from targetAmount, action reduces balance largely => high tax
    // 6. initialAmount is close to targetAmount, action reduces balance largely => low tax
    // 7. initialAmount is above targetAmount, nextAmount is below targetAmount and vice versa
    // 8. a large swap should have similar fees as the same trade split into multiple smaller swaps
    function getFeeBasisPoints(address _token, uint256 _usdgDelta, uint256 _feeBasisPoints, uint256 _taxBasisPoints, bool _increment) public override view returns (uint256) {
        if (!vault.hasDynamicFees()) { return _feeBasisPoints; }

        uint256 initialAmount = vault.usdgAmounts(_token);
        uint256 nextAmount = initialAmount.add(_usdgDelta);
        if (!_increment) {
            nextAmount = _usdgDelta > initialAmount ? 0 : initialAmount.sub(_usdgDelta);
        }

        uint256 targetAmount = vault.getTargetUsdgAmount(_token);
        if (targetAmount == 0) { return _feeBasisPoints; }

        uint256 initialDiff = initialAmount > targetAmount ? initialAmount.sub(targetAmount) : targetAmount.sub(initialAmount);
        uint256 nextDiff = nextAmount > targetAmount ? nextAmount.sub(targetAmount) : targetAmount.sub(nextAmount);

        // action improves relative asset balance
        if (nextDiff < initialDiff) {
            uint256 rebateBps = _taxBasisPoints.mul(initialDiff).div(targetAmount);
            return rebateBps > _feeBasisPoints ? 0 : _feeBasisPoints.sub(rebateBps);
        }

        uint256 averageDiff = initialDiff.add(nextDiff).div(2);
        if (averageDiff > targetAmount) {
            averageDiff = targetAmount;
        }
        uint256 taxBps = _taxBasisPoints.mul(averageDiff).div(targetAmount);
        return _feeBasisPoints.add(taxBps);
    }
}

File 5 of 6 : SafeMath.sol
// 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;
    }
}

File 6 of 6 : IERC20.sol
// 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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"contract IVault","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BASIS_POINTS_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNDING_RATE_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_usdgAmount","type":"uint256"}],"name":"getBuyUsdgFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"getEntryFundingRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_usdgDelta","type":"uint256"},{"internalType":"uint256","name":"_feeBasisPoints","type":"uint256"},{"internalType":"uint256","name":"_taxBasisPoints","type":"uint256"},{"internalType":"bool","name":"_increment","type":"bool"}],"name":"getFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"_size","type":"uint256"},{"internalType":"uint256","name":"_entryFundingRate","type":"uint256"}],"name":"getFundingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"_sizeDelta","type":"uint256"}],"name":"getPositionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_usdgAmount","type":"uint256"}],"name":"getSellUsdgFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_usdgAmount","type":"uint256"}],"name":"getSwapFeeBasisPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_gov","type":"address"}],"name":"setGov","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"updateCumulativeFundingRate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"},{"internalType":"address","name":"","type":"address"}],"name":"validateDecreasePosition","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"name":"validateIncreasePosition","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"address","name":"_indexToken","type":"address"},{"internalType":"bool","name":"_isLong","type":"bool"},{"internalType":"bool","name":"_raise","type":"bool"}],"name":"validateLiquidation","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"contract IVault","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516116e13803806116e18339818101604052602081101561003357600080fd5b5051600080546001600160a01b03199081163317909155600180546001600160a01b039093169290911691909117905561166f806100726000396000f3fe608060405234801561001057600080fd5b50600436106100d05760003560e01c8063126082cf146100d557806312d43a51146100ef5780634adeddc6146101135780636be6026b1461013f57806381d11a23146101475780639d5c28fa1461019d578063b1cc53ab146101e1578063c7e074c314610219578063cfad57a214610259578063d54d5a9f1461027f578063da133816146102de578063da76524c14610314578063eb0835bf1461035e578063fbfa77cf1461038a578063fbfded6d14610392578063fdaf6ac3146103d4575b600080fd5b6100dd610418565b60408051918252519081900360200190f35b6100f761041e565b604080516001600160a01b039092168252519081900360200190f35b6100dd6004803603604081101561012957600080fd5b506001600160a01b03813516906020013561042d565b6100dd61052f565b61019b600480360360e081101561015d57600080fd5b506001600160a01b0381358116916020810135821691604082013581169160608101359160808201359160a081013515159160c09091013516610536565b005b61019b600480360360a08110156101b357600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135151561053f565b6100dd600480360360608110156101f757600080fd5b506001600160a01b038135811691602081013590911690604001351515610546565b6100dd600480360360a081101561022f57600080fd5b506001600160a01b03813516906020810135906040810135906060810135906080013515156105cb565b61019b6004803603602081101561026f57600080fd5b50356001600160a01b031661085f565b6102c5600480360360a081101561029557600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101351515906080013515156108d8565b6040805192835260208301919091528051918290030190f35b6100dd600480360360608110156102f457600080fd5b506001600160a01b03813581169160208101359091169060400135610ca0565b6100dd600480360360c081101561032a57600080fd5b506001600160a01b038135811691602081013582169160408201351690606081013515159060808101359060a00135610fe4565b6100dd6004803603604081101561037457600080fd5b506001600160a01b0381351690602001356110aa565b6100f76111a3565b6103c0600480360360408110156103a857600080fd5b506001600160a01b03813581169160200135166111b2565b604080519115158252519081900360200190f35b6100dd600480360360a08110156103ea57600080fd5b506001600160a01b0381358116916020810135821691604082013516906060810135151590608001356111ba565b61271081565b6000546001600160a01b031681565b60006105268383600160009054906101000a90046001600160a01b03166001600160a01b0316634d47b3046040518163ffffffff1660e01b815260040160206040518083038186803b15801561048257600080fd5b505afa158015610496573d6000803e3d6000fd5b505050506040513d60208110156104ac57600080fd5b505160015460408051637a210a2b60e01b815290516001600160a01b0390921691637a210a2b91600480820192602092909190829003018186803b1580156104f357600080fd5b505afa158015610507573d6000803e3d6000fd5b505050506040513d602081101561051d57600080fd5b505160016105cb565b90505b92915050565b620f424081565b50505050505050565b5050505050565b6001546040805163c65bc7b160e01b81526001600160a01b0386811660048301529151600093929092169163c65bc7b191602480820192602092909190829003018186803b15801561059757600080fd5b505afa1580156105ab573d6000803e3d6000fd5b505050506040513d60208110156105c157600080fd5b5051949350505050565b60015460408051639f392eb360e01b815290516000926001600160a01b031691639f392eb3916004808301926020929190829003018186803b15801561061057600080fd5b505afa158015610624573d6000803e3d6000fd5b505050506040513d602081101561063a57600080fd5b5051610647575082610856565b60015460408051631aa4ace560e01b81526001600160a01b03898116600483015291516000939290921691631aa4ace591602480820192602092909190829003018186803b15801561069857600080fd5b505afa1580156106ac573d6000803e3d6000fd5b505050506040513d60208110156106c257600080fd5b5051905060006106d28288611278565b9050836106f5578187116106ef576106ea82886112d0565b6106f2565b60005b90505b60015460408051633a05dcc160e01b81526001600160a01b038b8116600483015291516000939290921691633a05dcc191602480820192602092909190829003018186803b15801561074657600080fd5b505afa15801561075a573d6000803e3d6000fd5b505050506040513d602081101561077057600080fd5b505190508061078457869350505050610856565b600081841161079c5761079782856112d0565b6107a6565b6107a684836112d0565b905060008284116107c0576107bb83856112d0565b6107ca565b6107ca84846112d0565b9050818110156108125760006107ea846107e48b86611312565b9061136b565b9050898111610802576107fd8a826112d0565b610805565b60005b9650505050505050610856565b600061082360026107e48585611278565b9050838111156108305750825b6000610840856107e48c85611312565b905061084c8b82611278565b9750505050505050505b95945050505050565b6000546001600160a01b031633146108b6576040805162461bcd60e51b815260206004820152601560248201527423b7bb32b93730b136329d103337b93134b23232b760591b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000806108e36115b2565b6108ef888888886113aa565b600154815160408084015160c08501518251635c07eaab60e01b81526001600160a01b038d81166004830152602482019590955260448101929092528a1515606483015260848201528151949550919092169260009283928592635c07eaab9260a480840193919291829003018186803b15801561096c57600080fd5b505afa158015610980573d6000803e3d6000fd5b505050506040513d604081101561099657600080fd5b508051602090910151855160608701519294509092506000916109c1918e918e918e918e9190610fe4565b90506109de6109d78d8d8d8d8a600001516111ba565b8290611278565b9050821580156109f15750818560200151105b15610a59578715610a49576040805162461bcd60e51b815260206004820152601f60248201527f5661756c743a206c6f737365732065786365656420636f6c6c61746572616c00604482015290519081900360640190fd5b600196509450610c969350505050565b602085015183610a75576020860151610a7290846112d0565b90505b81811015610ae1578815610ad0576040805162461bcd60e51b815260206004820152601d60248201527f5661756c743a20666565732065786365656420636f6c6c61746572616c000000604482015290519081900360640190fd5b600197509550610c96945050505050565b610b50856001600160a01b031663174d26946040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1d57600080fd5b505afa158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b50518390611278565b811015610ba5578815610b945760405162461bcd60e51b81526004018080602001828103825260298152602001806115f06029913960400191505060405180910390fd5b50600196509450610c969350505050565b8551610bb390612710611312565b610c22866001600160a01b031663ae3302c26040518163ffffffff1660e01b815260040160206040518083038186803b158015610bef57600080fd5b505afa158015610c03573d6000803e3d6000fd5b505050506040513d6020811015610c1957600080fd5b50518390611312565b1015610c8a578815610c79576040805162461bcd60e51b815260206004820152601b60248201527a15985d5b1d0e881b585e13195d995c9859d948195e18d959591959602a1b604482015290519081900360640190fd5b50600296509450610c969350505050565b50600096509450505050505b9550959350505050565b600154604080516342b60b0360e01b81526001600160a01b0386811660048301529151600093849316916342b60b03916024808301926020929190829003018186803b158015610cef57600080fd5b505afa158015610d03573d6000803e3d6000fd5b505050506040513d6020811015610d1957600080fd5b50518015610d9c5750600154604080516342b60b0360e01b81526001600160a01b038781166004830152915191909216916342b60b03916024808301926020929190829003018186803b158015610d6f57600080fd5b505afa158015610d83573d6000803e3d6000fd5b505050506040513d6020811015610d9957600080fd5b50515b9050600081610e2457600160009054906101000a90046001600160a01b03166001600160a01b031663a22f23926040518163ffffffff1660e01b815260040160206040518083038186803b158015610df357600080fd5b505afa158015610e07573d6000803e3d6000fd5b505050506040513d6020811015610e1d57600080fd5b5051610e9f565b600160009054906101000a90046001600160a01b03166001600160a01b031663df73a2676040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7257600080fd5b505afa158015610e86573d6000803e3d6000fd5b505050506040513d6020811015610e9c57600080fd5b50515b9050600082610f2757600160009054906101000a90046001600160a01b03166001600160a01b0316637a210a2b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ef657600080fd5b505afa158015610f0a573d6000803e3d6000fd5b505050506040513d6020811015610f2057600080fd5b5051610fa2565b600160009054906101000a90046001600160a01b03166001600160a01b03166310eb56c26040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7557600080fd5b505afa158015610f89573d6000803e3d6000fd5b505050506040513d6020811015610f9f57600080fd5b50515b90506000610fb48887858560016105cb565b90506000610fc68888868660006105cb565b9050808211610fd55780610fd7565b815b9998505050505050505050565b600082610ff3575060006110a0565b6001546040805163c65bc7b160e01b81526001600160a01b038981166004830152915160009361107a93879391169163c65bc7b191602480820192602092909190829003018186803b15801561104857600080fd5b505afa15801561105c573d6000803e3d6000fd5b505050506040513d602081101561107257600080fd5b5051906112d0565b90508061108b5760009150506110a0565b61109c620f42406107e48684611312565b9150505b9695505050505050565b60006105268383600160009054906101000a90046001600160a01b03166001600160a01b0316634d47b3046040518163ffffffff1660e01b815260040160206040518083038186803b1580156110ff57600080fd5b505afa158015611113573d6000803e3d6000fd5b505050506040513d602081101561112957600080fd5b505160015460408051637a210a2b60e01b815290516001600160a01b0390921691637a210a2b91600480820192602092909190829003018186803b15801561117057600080fd5b505afa158015611184573d6000803e3d6000fd5b505050506040513d602081101561119a57600080fd5b505160006105cb565b6001546001600160a01b031681565b600192915050565b6000816111c957506000610856565b60006112616127106107e461125a600160009054906101000a90046001600160a01b03166001600160a01b031663318bc6896040518163ffffffff1660e01b815260040160206040518083038186803b15801561122557600080fd5b505afa158015611239573d6000803e3d6000fd5b505050506040513d602081101561124f57600080fd5b5051612710906112d0565b8690611312565b905061126d83826112d0565b979650505050505050565b600082820183811015610526576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b600061052683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114b6565b60008261132157506000610529565b8282028284828161132e57fe5b04146105265760405162461bcd60e51b81526004018080602001828103825260218152602001806116196021913960400191505060405180910390fd5b600061052683836040518060400160405280601a815260200179536166654d6174683a206469766973696f6e206279207a65726f60301b81525061154d565b6113b26115b2565b6001546001600160a01b03166113c66115b2565b6000806000806000866001600160a01b0316634a3f088d8d8d8d8d6040518563ffffffff1660e01b815260040180856001600160a01b03168152602001846001600160a01b03168152602001836001600160a01b0316815260200182151581526020019450505050506101006040518083038186803b15801561144857600080fd5b505afa15801561145c573d6000803e3d6000fd5b505050506040513d61010081101561147357600080fd5b50805160208083015160408085015160608087015160e090970151958d52938c01929092528a015288019190915260c087015250939a9950505050505050505050565b600081848411156115455760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561150a5781810151838201526020016114f2565b50505050905090810190601f1680156115375780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000818361159c5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561150a5781810151838201526020016114f2565b5060008385816115a857fe5b0495945050505050565b6040518060e0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe5661756c743a206c69717569646174696f6e20666565732065786365656420636f6c6c61746572616c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220ba4562d03bad1c26fdc0d919bc9ead04fc79a19fb677812a5a86aab9c9e8f61a64736f6c634300060c003300000000000000000000000062cee390a2835d6c09d62d0f30cdea53592b2e1e

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading