MNT Price: $0.90 (-0.49%)

Contract

0x1dBD1e94373b3163F4376d6ae1A39DB9fdA334cB
 

Overview

MNT Balance

Mantle Mainnet Network LogoMantle Mainnet Network LogoMantle Mainnet Network Logo0 MNT

MNT Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Config

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

import '../common/library/InitErrors.sol';
import '../common/library/ArrayLib.sol';

import {
    TokenFactors, IConfig, ModeConfig, ModeStatus, PoolConfig, EnumerableSet
} from '../interfaces/core/IConfig.sol';
import {UnderACM} from '../common/UnderACM.sol';

import {Initializable} from '@openzeppelin-contracts-upgradeable/proxy/utils/Initializable.sol';

contract Config is IConfig, UnderACM, Initializable {
    using EnumerableSet for EnumerableSet.AddressSet;
    using UncheckedIncrement for uint;

    // constants
    uint private constant ONE_E18 = 1e18;
    bytes32 private constant GUARDIAN = keccak256('guardian');
    bytes32 private constant GOVERNOR = keccak256('governor');

    // storages
    mapping(address => bool) public whitelistedWLps; // @inheritdoc IConfig
    mapping(address => PoolConfig) private __poolConfigs;
    mapping(uint16 => ModeConfig) private __modeConfigs;

    // modifiers
    modifier onlyGuardian() {
        ACM.checkRole(GUARDIAN, msg.sender);
        _;
    }

    modifier onlyGovernor() {
        ACM.checkRole(GOVERNOR, msg.sender);
        _;
    }

    // constructor
    constructor(address _acm) UnderACM(_acm) {
        _disableInitializers();
    }

    // initializer
    /// @dev initialize the contract
    function initialize() external initializer {}

    // functions
    /// @inheritdoc IConfig
    function getModeConfig(uint16 _mode)
        external
        view
        returns (address[] memory collTokens, address[] memory borrTokens, uint maxHealthAfterLiq_e18)
    {
        collTokens = __modeConfigs[_mode].collTokens.values();
        borrTokens = __modeConfigs[_mode].borrTokens.values();
        maxHealthAfterLiq_e18 = __modeConfigs[_mode].maxHealthAfterLiq_e18;
    }

    /// @inheritdoc IConfig
    function getPoolConfig(address _pool) external view returns (PoolConfig memory config) {
        config = __poolConfigs[_pool];
    }

    /// @inheritdoc IConfig
    function isAllowedForBorrow(uint16 _mode, address _pool) external view returns (bool flag) {
        flag = __modeConfigs[_mode].borrTokens.contains(_pool);
    }

    /// @inheritdoc IConfig
    function isAllowedForCollateral(uint16 _mode, address _pool) external view returns (bool flag) {
        flag = __modeConfigs[_mode].collTokens.contains(_pool);
    }

    /// @inheritdoc IConfig
    function getTokenFactors(uint16 _mode, address _pool) external view returns (TokenFactors memory factors) {
        factors = __modeConfigs[_mode].factors[_pool];
    }

    function getMaxHealthAfterLiq_e18(uint16 _mode) external view returns (uint maxHealthAfterLiq_e18) {
        maxHealthAfterLiq_e18 = __modeConfigs[_mode].maxHealthAfterLiq_e18;
    }

    /// @inheritdoc IConfig
    function getModeStatus(uint16 _mode) external view returns (ModeStatus memory modeStatus) {
        modeStatus = __modeConfigs[_mode].status;
    }

    /// @inheritdoc IConfig
    function setPoolConfig(address _pool, PoolConfig calldata _config) external onlyGuardian {
        __poolConfigs[_pool] = _config;
        emit SetPoolConfig(_pool, _config);
    }

    /// @inheritdoc IConfig
    function setCollFactors_e18(uint16 _mode, address[] calldata _pools, uint128[] calldata _factors_e18)
        external
        onlyGovernor
    {
        _require(_mode != 0, Errors.INVALID_MODE);
        _require(_pools.length == _factors_e18.length, Errors.ARRAY_LENGTH_MISMATCHED);
        _require(AddressArrayLib.isSortedAndNotDuplicate(_pools), Errors.NOT_SORTED_OR_DUPLICATED_INPUT);
        EnumerableSet.AddressSet storage collTokens = __modeConfigs[_mode].collTokens;
        for (uint i; i < _pools.length; i = i.uinc()) {
            _require(_factors_e18[i] <= ONE_E18, Errors.INVALID_FACTOR);
            collTokens.add(_pools[i]);
            __modeConfigs[_mode].factors[_pools[i]].collFactor_e18 = _factors_e18[i];
        }
        emit SetCollFactors_e18(_mode, _pools, _factors_e18);
    }

    /// @inheritdoc IConfig
    function setBorrFactors_e18(uint16 _mode, address[] calldata _pools, uint128[] calldata _factors_e18)
        external
        onlyGovernor
    {
        _require(_mode != 0, Errors.INVALID_MODE);
        _require(_pools.length == _factors_e18.length, Errors.ARRAY_LENGTH_MISMATCHED);
        _require(AddressArrayLib.isSortedAndNotDuplicate(_pools), Errors.NOT_SORTED_OR_DUPLICATED_INPUT);
        EnumerableSet.AddressSet storage borrTokens = __modeConfigs[_mode].borrTokens;
        for (uint i; i < _pools.length; i = i.uinc()) {
            borrTokens.add(_pools[i]);
            _require(_factors_e18[i] >= ONE_E18, Errors.INVALID_FACTOR);
            __modeConfigs[_mode].factors[_pools[i]].borrFactor_e18 = _factors_e18[i];
        }
        emit SetBorrFactors_e18(_mode, _pools, _factors_e18);
    }

    /// @inheritdoc IConfig
    function setModeStatus(uint16 _mode, ModeStatus calldata _status) external onlyGuardian {
        _require(_mode != 0, Errors.INVALID_MODE);
        __modeConfigs[_mode].status = _status;
        emit SetModeStatus(_mode, _status);
    }

    /// @inheritdoc IConfig
    function setMaxHealthAfterLiq_e18(uint16 _mode, uint64 _maxHealthAfterLiq_e18) external onlyGuardian {
        _require(_mode != 0, Errors.INVALID_MODE);
        _require(_maxHealthAfterLiq_e18 > ONE_E18, Errors.INPUT_TOO_LOW);
        __modeConfigs[_mode].maxHealthAfterLiq_e18 = _maxHealthAfterLiq_e18;
        emit SetMaxHealthAfterLiq_e18(_mode, _maxHealthAfterLiq_e18);
    }

    /// @inheritdoc IConfig
    function setWhitelistedWLps(address[] calldata _wLps, bool _status) external onlyGovernor {
        for (uint i; i < _wLps.length; i = i.uinc()) {
            whitelistedWLps[_wLps[i]] = _status;
        }
        emit SetWhitelistedWLps(_wLps, _status);
    }
}

File 2 of 10 : UnderACM.sol
// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

import {IAccessControlManager} from '../interfaces/common/IAccessControlManager.sol';

abstract contract UnderACM {
    // immutables
    IAccessControlManager public immutable ACM; // access control manager

    // constructor
    constructor(address _acm) {
        ACM = IAccessControlManager(_acm);
    }
}

// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

import './UncheckedIncrement.sol';

library AddressArrayLib {
    using UncheckedIncrement for uint;

    /// @dev check that the array is sorted and has no duplicate
    /// @param _arr the array to be checked
    function isSortedAndNotDuplicate(address[] calldata _arr) internal pure returns (bool) {
        uint poolLen = _arr.length;
        for (uint i = 1; i < poolLen; i = i.uinc()) {
            if (_arr[i - 1] >= _arr[i]) return false;
        }
        return true;
    }
}

File 4 of 10 : InitErrors.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

pragma solidity >=0.7.1 <0.9.0;

// solhint-disable

/**
 * @dev Reverts if `condition` is false, with a revert reason containing `errorCode`. Only codes up to 999 are
 * supported.
 * Uses the default 'INC' prefix for the error code
 */
function _require(bool condition, uint errorCode) pure {
    if (!condition) _revert(errorCode);
}

/**
 * @dev Reverts if `condition` is false, with a revert reason containing `errorCode`. Only codes up to 999 are
 * supported.
 */
function _require(bool condition, uint errorCode, bytes3 prefix) pure {
    if (!condition) _revert(errorCode, prefix);
}

/**
 * @dev Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported.
 * Uses the default 'INC' prefix for the error code
 */
function _revert(uint errorCode) pure {
    _revert(errorCode, 0x494e43); // This is the raw byte representation of "INC"
}

/**
 * @dev Reverts with a revert reason containing `errorCode`. Only codes up to 999 are supported.
 */
function _revert(uint errorCode, bytes3 prefix) pure {
    uint prefixUint = uint(uint24(prefix));
    // We're going to dynamically create a revert string based on the error code, with the following format:
    // 'INC#{errorCode}'
    // where the code is left-padded with zeroes to three digits (so they range from 000 to 999).
    //
    // We don't have revert strings embedded in the contract to save bytecode size: it takes much less space to store a
    // number (8 to 16 bits) than the individual string characters.
    //
    // The dynamic string creation algorithm that follows could be implemented in Solidity, but assembly allows for a
    // much denser implementation, again saving bytecode size. Given this function unconditionally reverts, this is a
    // safe place to rely on it without worrying about how its usage might affect e.g. memory contents.
    assembly {
        // First, we need to compute the ASCII representation of the error code. We assume that it is in the 0-999
        // range, so we only need to convert three digits. To convert the digits to ASCII, we add 0x30, the value for
        // the '0' character.

        let units := add(mod(errorCode, 10), 0x30)

        errorCode := div(errorCode, 10)
        let tenths := add(mod(errorCode, 10), 0x30)

        errorCode := div(errorCode, 10)
        let hundreds := add(mod(errorCode, 10), 0x30)

        // With the individual characters, we can now construct the full string.
        // We first append the '#' character (0x23) to the prefix. In the case of 'INC', it results in 0x42414c23 ('INC#')
        // Then, we shift this by 24 (to provide space for the 3 bytes of the error code), and add the
        // characters to it, each shifted by a multiple of 8.
        // The revert reason is then shifted left by 200 bits (256 minus the length of the string, 7 characters * 8 bits
        // per character = 56) to locate it in the most significant part of the 256 slot (the beginning of a byte
        // array).
        let formattedPrefix := shl(24, add(0x23, shl(8, prefixUint)))

        let revertReason := shl(200, add(formattedPrefix, add(add(units, shl(8, tenths)), shl(16, hundreds))))

        // We can now encode the reason in memory, which can be safely overwritten as we're about to revert. The encoded
        // message will have the following layout:
        // [ revert reason identifier ] [ string location offset ] [ string length ] [ string contents ]

        // The Solidity revert reason identifier is 0x08c739a0, the function selector of the Error(string) function. We
        // also write zeroes to the next 28 bytes of memory, but those are about to be overwritten.
        mstore(0x0, 0x08c379a000000000000000000000000000000000000000000000000000000000)
        // Next is the offset to the location of the string, which will be placed immediately after (20 bytes away).
        mstore(0x04, 0x0000000000000000000000000000000000000000000000000000000000000020)
        // The string length is fixed: 7 characters.
        mstore(0x24, 7)
        // Finally, the string itself is stored.
        mstore(0x44, revertReason)

        // Even if the string is only 7 bytes long, we need to return a full 32 byte slot containing it. The length of
        // the encoded message is therefore 4 + 32 + 32 + 32 = 100.
        revert(0, 100)
    }
}

library Errors {
    // Common
    uint internal constant ZERO_VALUE = 100;
    uint internal constant NOT_INIT_CORE = 101;
    uint internal constant SLIPPAGE_CONTROL = 102;
    uint internal constant CALL_FAILED = 103;
    uint internal constant NOT_OWNER = 104;
    uint internal constant NOT_WNATIVE = 105;
    uint internal constant ALREADY_SET = 106;
    uint internal constant NOT_WHITELISTED = 107;

    // Input
    uint internal constant ARRAY_LENGTH_MISMATCHED = 200;
    uint internal constant INPUT_TOO_LOW = 201;
    uint internal constant INPUT_TOO_HIGH = 202;
    uint internal constant INVALID_INPUT = 203;
    uint internal constant INVALID_TOKEN_IN = 204;
    uint internal constant INVALID_TOKEN_OUT = 205;
    uint internal constant NOT_SORTED_OR_DUPLICATED_INPUT = 206;

    // Core
    uint internal constant POSITION_NOT_HEALTHY = 300;
    uint internal constant POSITION_NOT_FOUND = 301;
    uint internal constant LOCKED_MULTICALL = 302;
    uint internal constant POSITION_HEALTHY = 303;
    uint internal constant INVALID_HEALTH_AFTER_LIQUIDATION = 304;
    uint internal constant FLASH_PAUSED = 305;
    uint internal constant INVALID_FLASHLOAN = 306;
    uint internal constant NOT_AUTHORIZED = 307;
    uint internal constant INVALID_CALLBACK_ADDRESS = 308;

    // Lending Pool
    uint internal constant MINT_PAUSED = 400;
    uint internal constant REDEEM_PAUSED = 401;
    uint internal constant BORROW_PAUSED = 402;
    uint internal constant REPAY_PAUSED = 403;
    uint internal constant NOT_ENOUGH_CASH = 404;
    uint internal constant INVALID_AMOUNT_TO_REPAY = 405;
    uint internal constant SUPPLY_CAP_REACHED = 406;
    uint internal constant BORROW_CAP_REACHED = 407;

    // Config
    uint internal constant INVALID_MODE = 500;
    uint internal constant TOKEN_NOT_WHITELISTED = 501;
    uint internal constant INVALID_FACTOR = 502;

    // Position Manager
    uint internal constant COLLATERALIZE_PAUSED = 600;
    uint internal constant DECOLLATERALIZE_PAUSED = 601;
    uint internal constant MAX_COLLATERAL_COUNT_REACHED = 602;
    uint internal constant NOT_CONTAIN = 603;
    uint internal constant ALREADY_COLLATERALIZED = 604;

    // Oracle
    uint internal constant NO_VALID_SOURCE = 700;
    uint internal constant TOO_MUCH_DEVIATION = 701;
    uint internal constant MAX_PRICE_DEVIATION_TOO_LOW = 702;
    uint internal constant NO_PRICE_ID = 703;
    uint internal constant PYTH_CONFIG_NOT_SET = 704;
    uint internal constant DATAFEED_ID_NOT_SET = 705;
    uint internal constant MAX_STALETIME_NOT_SET = 706;
    uint internal constant MAX_STALETIME_EXCEEDED = 707;
    uint internal constant PRIMARY_SOURCE_NOT_SET = 708;

    // Risk Manager
    uint internal constant DEBT_CEILING_EXCEEDED = 800;

    // Misc
    uint internal constant UNIMPLEMENTED = 999;
}

File 5 of 10 : UncheckedIncrement.sol
// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

library UncheckedIncrement {
    function uinc(uint self) internal pure returns (uint) {
        unchecked {
            return self + 1;
        }
    }
}

// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

/// @title Access Control Manager Interface
interface IAccessControlManager {
    /// @dev check the role of the user, revert against an unauthorized user.
    /// @param _role keccak256 hash of role name
    /// @param _user user address to check for the role
    function checkRole(bytes32 _role, address _user) external;
}

// SPDX-License-Identifier: None
pragma solidity ^0.8.19;

import {EnumerableSet} from '@openzeppelin-contracts/utils/structs/EnumerableSet.sol';
// structs

struct TokenFactors {
    uint128 collFactor_e18; // collateral factor in 1e18 (1e18 = 100%)
    uint128 borrFactor_e18; // borrow factor in 1e18 (1e18 = 100%)
}

struct ModeConfig {
    EnumerableSet.AddressSet collTokens; // enumerable set of collateral tokens
    EnumerableSet.AddressSet borrTokens; // enumerable set of borrow tokens
    uint64 maxHealthAfterLiq_e18; // max health factor allowed after liquidation
    mapping(address => TokenFactors) factors; // token factors mapping
    ModeStatus status; // mode status
}

struct PoolConfig {
    uint128 supplyCap; // pool supply cap
    uint128 borrowCap; // pool borrow cap
    bool canMint; // pool mint status
    bool canBurn; // pool burn status
    bool canBorrow; // pool borrow status
    bool canRepay; // pool repay status
    bool canFlash; // pool flash status
}

struct ModeStatus {
    bool canCollateralize; // mode collateralize status
    bool canDecollateralize; // mode decollateralize status
    bool canBorrow; // mode borrow status
    bool canRepay; // mode repay status
}

/// @title Config Interface
/// @notice Configuration parameters for the protocol.
interface IConfig {
    event SetPoolConfig(address indexed pool, PoolConfig config);
    event SetCollFactors_e18(uint16 indexed mode, address[] tokens, uint128[] _factors);
    event SetBorrFactors_e18(uint16 indexed mode, address[] tokens, uint128[] factors);
    event SetMaxHealthAfterLiq_e18(uint16 indexed mode, uint64 maxHealthAfterLiq_e18);
    event SetWhitelistedWLps(address[] wLps, bool status);
    event SetModeStatus(uint16 mode, ModeStatus status);

    /// @dev check if the wrapped lp is whitelisted.
    /// @param _wlp wrapped lp address
    /// @return whether the wrapped lp is whitelisted.
    function whitelistedWLps(address _wlp) external view returns (bool);

    /// @dev get mode config
    /// @param _mode mode id
    /// @return collTokens collateral token list
    ///         borrTokens borrow token list
    ///         maxHealthAfterLiq_e18 max health factor allowed after liquidation
    function getModeConfig(uint16 _mode)
        external
        view
        returns (address[] memory collTokens, address[] memory borrTokens, uint maxHealthAfterLiq_e18);

    /// @dev get pool config
    /// @param _pool pool address
    /// @return poolConfig pool config
    function getPoolConfig(address _pool) external view returns (PoolConfig memory poolConfig);

    /// @dev check if the pool within the specified mode is allowed for borrowing.
    /// @param _mode mode id
    /// @param _pool lending pool address
    /// @return whether the pool within the mode is allowed for borrowing.
    function isAllowedForBorrow(uint16 _mode, address _pool) external view returns (bool);

    /// @dev check if the pool within the specified mode is allowed for collateralizing.
    /// @param _mode mode id
    /// @param _pool lending pool address
    /// @return whether the pool within the mode is allowed for collateralizing.
    function isAllowedForCollateral(uint16 _mode, address _pool) external view returns (bool);

    /// @dev get the token factors (collateral and borrow factors)
    /// @param _mode mode id
    /// @param _pool lending pool address
    /// @return tokenFactors token factors
    function getTokenFactors(uint16 _mode, address _pool) external view returns (TokenFactors memory tokenFactors);

    /// @notice if return the value of type(uint64).max, skip the health check after liquidation
    /// @dev get the mode max health allowed after liquidation
    /// @param _mode mode id
    /// @param maxHealthAfterLiq_e18 max allowed health factor after liquidation
    function getMaxHealthAfterLiq_e18(uint16 _mode) external view returns (uint maxHealthAfterLiq_e18);

    /// @dev get the current mode status
    /// @param _mode mode id
    /// @return modeStatus mode status (collateralize, decollateralize, borrow or repay)
    function getModeStatus(uint16 _mode) external view returns (ModeStatus memory modeStatus);

    /// @dev set pool config
    /// @param _pool lending pool address
    /// @param _config new pool config
    function setPoolConfig(address _pool, PoolConfig calldata _config) external;

    /// @dev set pool collateral factors
    /// @param _pools lending pool address list
    /// @param _factors new collateral factor list in 1e18 (1e18 = 100%)
    function setCollFactors_e18(uint16 _mode, address[] calldata _pools, uint128[] calldata _factors) external;

    /// @dev set pool borrow factors
    /// @param _pools lending pool address list
    /// @param _factors new borrow factor list in 1e18 (1e18 = 100%)
    function setBorrFactors_e18(uint16 _mode, address[] calldata _pools, uint128[] calldata _factors) external;

    /// @dev set mode status
    /// @param _status new mode status to set to (collateralize, decollateralize, borrow and repay)
    function setModeStatus(uint16 _mode, ModeStatus calldata _status) external;

    /// @notice only governor role can call
    /// @dev set whitelisted wrapped lp statuses
    /// @param _wLps wrapped lp list
    /// @param _status whitelisted status to set to
    function setWhitelistedWLps(address[] calldata _wLps, bool _status) external;

    /// @dev set max health after liquidation (type(uint64).max means infinite, or no check)
    /// @param _mode mode id
    /// @param _maxHealthAfterLiq_e18 new max allowed health factor after liquidation
    function setMaxHealthAfterLiq_e18(uint16 _mode, uint64 _maxHealthAfterLiq_e18) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    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.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

Settings
{
  "evmVersion": "paris",
  "libraries": {},
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@forge-std/=lib/forge-std/src/",
    "@openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "@openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts copy/=lib/openzeppelin-contracts copy/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/"
  ]
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_acm","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"mode","type":"uint16"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"uint128[]","name":"factors","type":"uint128[]"}],"name":"SetBorrFactors_e18","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"mode","type":"uint16"},{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"uint128[]","name":"_factors","type":"uint128[]"}],"name":"SetCollFactors_e18","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint16","name":"mode","type":"uint16"},{"indexed":false,"internalType":"uint64","name":"maxHealthAfterLiq_e18","type":"uint64"}],"name":"SetMaxHealthAfterLiq_e18","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"mode","type":"uint16"},{"components":[{"internalType":"bool","name":"canCollateralize","type":"bool"},{"internalType":"bool","name":"canDecollateralize","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"}],"indexed":false,"internalType":"struct ModeStatus","name":"status","type":"tuple"}],"name":"SetModeStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"components":[{"internalType":"uint128","name":"supplyCap","type":"uint128"},{"internalType":"uint128","name":"borrowCap","type":"uint128"},{"internalType":"bool","name":"canMint","type":"bool"},{"internalType":"bool","name":"canBurn","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"},{"internalType":"bool","name":"canFlash","type":"bool"}],"indexed":false,"internalType":"struct PoolConfig","name":"config","type":"tuple"}],"name":"SetPoolConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"wLps","type":"address[]"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SetWhitelistedWLps","type":"event"},{"inputs":[],"name":"ACM","outputs":[{"internalType":"contract IAccessControlManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"}],"name":"getMaxHealthAfterLiq_e18","outputs":[{"internalType":"uint256","name":"maxHealthAfterLiq_e18","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"}],"name":"getModeConfig","outputs":[{"internalType":"address[]","name":"collTokens","type":"address[]"},{"internalType":"address[]","name":"borrTokens","type":"address[]"},{"internalType":"uint256","name":"maxHealthAfterLiq_e18","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"}],"name":"getModeStatus","outputs":[{"components":[{"internalType":"bool","name":"canCollateralize","type":"bool"},{"internalType":"bool","name":"canDecollateralize","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"}],"internalType":"struct ModeStatus","name":"modeStatus","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"getPoolConfig","outputs":[{"components":[{"internalType":"uint128","name":"supplyCap","type":"uint128"},{"internalType":"uint128","name":"borrowCap","type":"uint128"},{"internalType":"bool","name":"canMint","type":"bool"},{"internalType":"bool","name":"canBurn","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"},{"internalType":"bool","name":"canFlash","type":"bool"}],"internalType":"struct PoolConfig","name":"config","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"address","name":"_pool","type":"address"}],"name":"getTokenFactors","outputs":[{"components":[{"internalType":"uint128","name":"collFactor_e18","type":"uint128"},{"internalType":"uint128","name":"borrFactor_e18","type":"uint128"}],"internalType":"struct TokenFactors","name":"factors","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"address","name":"_pool","type":"address"}],"name":"isAllowedForBorrow","outputs":[{"internalType":"bool","name":"flag","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"address","name":"_pool","type":"address"}],"name":"isAllowedForCollateral","outputs":[{"internalType":"bool","name":"flag","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"uint128[]","name":"_factors_e18","type":"uint128[]"}],"name":"setBorrFactors_e18","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"address[]","name":"_pools","type":"address[]"},{"internalType":"uint128[]","name":"_factors_e18","type":"uint128[]"}],"name":"setCollFactors_e18","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"internalType":"uint64","name":"_maxHealthAfterLiq_e18","type":"uint64"}],"name":"setMaxHealthAfterLiq_e18","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_mode","type":"uint16"},{"components":[{"internalType":"bool","name":"canCollateralize","type":"bool"},{"internalType":"bool","name":"canDecollateralize","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"}],"internalType":"struct ModeStatus","name":"_status","type":"tuple"}],"name":"setModeStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"components":[{"internalType":"uint128","name":"supplyCap","type":"uint128"},{"internalType":"uint128","name":"borrowCap","type":"uint128"},{"internalType":"bool","name":"canMint","type":"bool"},{"internalType":"bool","name":"canBurn","type":"bool"},{"internalType":"bool","name":"canBorrow","type":"bool"},{"internalType":"bool","name":"canRepay","type":"bool"},{"internalType":"bool","name":"canFlash","type":"bool"}],"internalType":"struct PoolConfig","name":"_config","type":"tuple"}],"name":"setPoolConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_wLps","type":"address[]"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setWhitelistedWLps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedWLps","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b5060405162001ab338038062001ab3833981016040819052620000349162000113565b6001600160a01b0381166080526200004b62000052565b5062000145565b600054610100900460ff1615620000bf5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161462000111576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012657600080fd5b81516001600160a01b03811681146200013e57600080fd5b9392505050565b6080516119286200018b6000396000818161045f0152818161056d015281816107ce0152818161090a01528181610b3801528181610d8c0152610f0601526119286000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063903b46ce11610097578063e5a1762211610066578063e5a17622146102fc578063f29486a11461030f578063f9b80da11461045a578063fea1a64f1461049957600080fd5b8063903b46ce14610291578063989f9fc9146102a457806399a28d26146102c6578063aff4969a146102d957600080fd5b80635eedee13116100d35780635eedee131461016857806369fc8a851461017b5780638129fc1c146101ba5780638309d575146101c257600080fd5b806302420df7146101055780630b0a245d1461011a578063191914371461012d5780634389787014610155575b600080fd5b610118610113366004611293565b610532565b005b610118610128366004611314565b610793565b61014061013b36600461136a565b6108a8565b60405190151581526020015b60405180910390f35b610118610163366004611293565b6108cf565b6101186101763660046113b6565b610afd565b6101ac61018936600461140d565b61ffff1660009081526003602052604090206004015467ffffffffffffffff1690565b60405190815260200161014c565b610118610c44565b6102566101d036600461140d565b6040805160808101825260008082526020820181905291810182905260608101919091525061ffff16600090815260036020908152604091829020825160808101845260069091015460ff808216151583526101008204811615159383019390935262010000810483161515938201939093526301000000909204161515606082015290565b60405161014c919081511515815260208083015115159082015260408083015115159082015260609182015115159181019190915260800190565b61011861029f366004611428565b610d51565b6102b76102b236600461140d565b610e5c565b60405161014c9392919061149e565b6101186102d43660046114d4565b610ecb565b6101406102e7366004611518565b60016020526000908152604090205460ff1681565b61014061030a36600461136a565b611002565b6103ed61031d366004611518565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506001600160a01b0316600090815260026020908152604091829020825160e08101845281546001600160801b038082168352600160801b90910416928101929092526001015460ff8082161515938301939093526101008104831615156060830152620100008104831615156080830152630100000081048316151560a08301526401000000009004909116151560c082015290565b60405161014c9190600060e0820190506001600160801b038084511683528060208501511660208401525060408301511515604083015260608301511515606083015260808301511515608083015260a0830151151560a083015260c0830151151560c083015292915050565b6104817f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161014c565b61050b6104a736600461136a565b6040805180820182526000808252602091820181905261ffff949094168452600381528184206001600160a01b03909316845260059092018252918290208251808401909352546001600160801b038082168452600160801b909104169082015290565b6040805182516001600160801b03908116825260209384015116928101929092520161014c565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506105e58561ffff16600014156101f461101f565b6105f283821460c861101f565b6106066105ff8585611031565b60ce61101f565b61ffff85166000908152600360205260408120905b8481101561074857610669670de0b6b3a764000085858481811061064157610641611533565b9050602002016020810190610656919061155e565b6001600160801b031611156101f661101f565b61069a86868381811061067e5761067e611533565b90506020020160208101906106939190611518565b83906110ce565b508383828181106106ad576106ad611533565b90506020020160208101906106c2919061155e565b61ffff88166000908152600360205260408120600501908888858181106106eb576106eb611533565b90506020020160208101906107009190611518565b6001600160a01b03168152602081019190915260400160002080546fffffffffffffffffffffffffffffffff19166001600160801b039290921691909117905560010161061b565b508561ffff167fb269e820084e049385306573d346a25d9c7642d368f26782513272f200ec143a8686868660405161078394939291906115b7565b60405180910390a2505050505050565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b15801561081a57600080fd5b505af115801561082e573d6000803e3d6000fd5b505050506108468261ffff16600014156101f461101f565b61ffff821660009081526003602052604090208190600601610868828261161c565b9050507fc82bca1e9fedc6d47698e89262987cc9fcb518c37802135f018224ea9e10fb4c828260405161089c9291906116a8565b60405180910390a15050565b61ffff821660009081526003602052604081206108c890600201836110e3565b9392505050565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b15801561095657600080fd5b505af115801561096a573d6000803e3d6000fd5b505050506109828561ffff16600014156101f461101f565b61098f83821460c861101f565b61099c6105ff8585611031565b61ffff85166000908152600360205260408120600201905b84811015610ac2576109d186868381811061067e5761067e611533565b50610a18670de0b6b3a76400008585848181106109f0576109f0611533565b9050602002016020810190610a05919061155e565b6001600160801b031610156101f661101f565b838382818110610a2a57610a2a611533565b9050602002016020810190610a3f919061155e565b61ffff8816600090815260036020526040812060050190888885818110610a6857610a68611533565b9050602002016020810190610a7d9190611518565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b029216919091179055610abb8160010190565b90506109b4565b508561ffff167fb32b0d03b1a8f5dbca5719a90f26c6c6c37dc68383514dd611b3116249a5ec5f8686868660405161078394939291906115b7565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610b8457600080fd5b505af1158015610b98573d6000803e3d6000fd5b5050505060005b82811015610c03578160016000868685818110610bbe57610bbe611533565b9050602002016020810190610bd39190611518565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600101610b9f565b507fbb1cd903231077138a8cf9e16bb5b1af6e0e8474614d759d592f17ad5e9e27aa838383604051610c3793929190611713565b60405180910390a1505050565b600054610100900460ff1615808015610c645750600054600160ff909116105b80610c7e5750303b158015610c7e575060005460ff166001145b610ce55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015610d08576000805461ff0019166101001790555b8015610d4e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610dd857600080fd5b505af1158015610dec573d6000803e3d6000fd5b5050506001600160a01b0383166000908152600260205260409020829150610e148282611739565b905050816001600160a01b03167feba89a3dc5d5c81fc0f4ce0e75e9fd52010bee6ce91219a29c9621ede81f4dd282604051610e509190611833565b60405180910390a25050565b61ffff811660009081526003602052604081206060918291610e7d90611105565b61ffff85166000908152600360205260409020909350610e9f90600201611105565b61ffff909416600090815260036020526040902060040154929467ffffffffffffffff90931692915050565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610f5257600080fd5b505af1158015610f66573d6000803e3d6000fd5b50505050610f7e8261ffff16600014156101f461101f565b610f9d670de0b6b3a76400008267ffffffffffffffff161160c961101f565b61ffff8216600081815260036020908152604091829020600401805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527f17a6bbee94d3823c3e09e802bbe3a71362ed85117b86cfd4a43fe9a2395ca1899101610e50565b61ffff821660009081526003602052604081206108c890836110e3565b8161102d5761102d81611112565b5050565b60008160015b818110156110c15784848281811061105157611051611533565b90506020020160208101906110669190611518565b6001600160a01b0316858561107c6001856118d1565b81811061108b5761108b611533565b90506020020160208101906110a09190611518565b6001600160a01b0316106110b9576000925050506110c8565b600101611037565b5060019150505b92915050565b60006108c8836001600160a01b038416611122565b6001600160a01b038116600090815260018301602052604081205415156108c8565b606060006108c883611171565b610d4e8162494e4360e81b6111cd565b6000818152600183016020526040812054611169575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110c8565b5060006110c8565b6060816000018054806020026020016040519081016040528092919081815260200182805480156111c157602002820191906000526020600020905b8154815260200190600101908083116111ad575b50505050509050919050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b604481905260e883901c91606490fd5b803561ffff8116811461124257600080fd5b919050565b60008083601f84011261125957600080fd5b50813567ffffffffffffffff81111561127157600080fd5b6020830191508360208260051b850101111561128c57600080fd5b9250929050565b6000806000806000606086880312156112ab57600080fd5b6112b486611230565b9450602086013567ffffffffffffffff808211156112d157600080fd5b6112dd89838a01611247565b909650945060408801359150808211156112f657600080fd5b5061130388828901611247565b969995985093965092949392505050565b60008082840360a081121561132857600080fd5b61133184611230565b92506080601f198201121561134557600080fd5b506020830190509250929050565b80356001600160a01b038116811461124257600080fd5b6000806040838503121561137d57600080fd5b61138683611230565b915061139460208401611353565b90509250929050565b8015158114610d4e57600080fd5b80356112428161139d565b6000806000604084860312156113cb57600080fd5b833567ffffffffffffffff8111156113e257600080fd5b6113ee86828701611247565b90945092505060208401356114028161139d565b809150509250925092565b60006020828403121561141f57600080fd5b6108c882611230565b60008082840361010081121561143d57600080fd5b61144684611353565b925060e0601f198201121561134557600080fd5b600081518084526020808501945080840160005b838110156114935781516001600160a01b03168752958201959082019060010161146e565b509495945050505050565b6060815260006114b1606083018661145a565b82810360208401526114c3818661145a565b915050826040830152949350505050565b600080604083850312156114e757600080fd5b6114f083611230565b9150602083013567ffffffffffffffff8116811461150d57600080fd5b809150509250929050565b60006020828403121561152a57600080fd5b6108c882611353565b634e487b7160e01b600052603260045260246000fd5b6001600160801b0381168114610d4e57600080fd5b60006020828403121561157057600080fd5b81356108c881611549565b8183526000602080850194508260005b85811015611493576001600160a01b036115a483611353565b168752958201959082019060010161158b565b6040815260006115cb60408301868861157b565b8281036020848101919091528482528591810160005b8681101561160f5783356115f481611549565b6001600160801b0316825292820192908201906001016115e1565b5098975050505050505050565b81356116278161139d565b815460ff191660ff821515161782555060208201356116458161139d565b815461ff00191681151560081b61ff00161782555060408201356116688161139d565b815462ff0000191681151560101b62ff00001617825550606082013561168d8161139d565b815463ff000000191690151560181b63ff0000001617905550565b61ffff8316815260a0810182356116be8161139d565b80151560208401525060208301356116d58161139d565b80151560408401525060408301356116ec8161139d565b80151560608401525060608301356117038161139d565b8015156080840152509392505050565b60408152600061172760408301858761157b565b90508215156020830152949350505050565b813561174481611549565b6001600160801b03811690506001600160801b03198181845416178355602084013561176f81611549565b60801b161781556001810160408301356117888161139d565b815460ff191660ff821515161782555060608301356117a68161139d565b815461ff00191681151560081b61ff00161782555060808301356117c98161139d565b815462ff0000191681151560101b62ff0000161782555060a08301356117ee8161139d565b815463ff000000191681151560181b63ff000000161782555060c08301356118158161139d565b815464ff00000000191690151560201b64ff00000000161790555050565b60e08101823561184281611549565b6001600160801b03908116835260208401359061185e82611549565b16602083015260408301356118728161139d565b1515604083015260608301356118878161139d565b15156060830152608083013561189c8161139d565b151560808301526118af60a084016113ab565b151560a08301526118c260c084016113ab565b80151560c08401525092915050565b818103818111156110c857634e487b7160e01b600052601160045260246000fdfea26469706673582212209ef3c89779a58a6cd10e8523b8a00861feab12f69f5c4b330566ecc37f0acdb864736f6c63430008130033000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063903b46ce11610097578063e5a1762211610066578063e5a17622146102fc578063f29486a11461030f578063f9b80da11461045a578063fea1a64f1461049957600080fd5b8063903b46ce14610291578063989f9fc9146102a457806399a28d26146102c6578063aff4969a146102d957600080fd5b80635eedee13116100d35780635eedee131461016857806369fc8a851461017b5780638129fc1c146101ba5780638309d575146101c257600080fd5b806302420df7146101055780630b0a245d1461011a578063191914371461012d5780634389787014610155575b600080fd5b610118610113366004611293565b610532565b005b610118610128366004611314565b610793565b61014061013b36600461136a565b6108a8565b60405190151581526020015b60405180910390f35b610118610163366004611293565b6108cf565b6101186101763660046113b6565b610afd565b6101ac61018936600461140d565b61ffff1660009081526003602052604090206004015467ffffffffffffffff1690565b60405190815260200161014c565b610118610c44565b6102566101d036600461140d565b6040805160808101825260008082526020820181905291810182905260608101919091525061ffff16600090815260036020908152604091829020825160808101845260069091015460ff808216151583526101008204811615159383019390935262010000810483161515938201939093526301000000909204161515606082015290565b60405161014c919081511515815260208083015115159082015260408083015115159082015260609182015115159181019190915260800190565b61011861029f366004611428565b610d51565b6102b76102b236600461140d565b610e5c565b60405161014c9392919061149e565b6101186102d43660046114d4565b610ecb565b6101406102e7366004611518565b60016020526000908152604090205460ff1681565b61014061030a36600461136a565b611002565b6103ed61031d366004611518565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152506001600160a01b0316600090815260026020908152604091829020825160e08101845281546001600160801b038082168352600160801b90910416928101929092526001015460ff8082161515938301939093526101008104831615156060830152620100008104831615156080830152630100000081048316151560a08301526401000000009004909116151560c082015290565b60405161014c9190600060e0820190506001600160801b038084511683528060208501511660208401525060408301511515604083015260608301511515606083015260808301511515608083015260a0830151151560a083015260c0830151151560c083015292915050565b6104817f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a81565b6040516001600160a01b03909116815260200161014c565b61050b6104a736600461136a565b6040805180820182526000808252602091820181905261ffff949094168452600381528184206001600160a01b03909316845260059092018252918290208251808401909352546001600160801b038082168452600160801b909104169082015290565b6040805182516001600160801b03908116825260209384015116928101929092520161014c565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506105e58561ffff16600014156101f461101f565b6105f283821460c861101f565b6106066105ff8585611031565b60ce61101f565b61ffff85166000908152600360205260408120905b8481101561074857610669670de0b6b3a764000085858481811061064157610641611533565b9050602002016020810190610656919061155e565b6001600160801b031611156101f661101f565b61069a86868381811061067e5761067e611533565b90506020020160208101906106939190611518565b83906110ce565b508383828181106106ad576106ad611533565b90506020020160208101906106c2919061155e565b61ffff88166000908152600360205260408120600501908888858181106106eb576106eb611533565b90506020020160208101906107009190611518565b6001600160a01b03168152602081019190915260400160002080546fffffffffffffffffffffffffffffffff19166001600160801b039290921691909117905560010161061b565b508561ffff167fb269e820084e049385306573d346a25d9c7642d368f26782513272f200ec143a8686868660405161078394939291906115b7565b60405180910390a2505050505050565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b15801561081a57600080fd5b505af115801561082e573d6000803e3d6000fd5b505050506108468261ffff16600014156101f461101f565b61ffff821660009081526003602052604090208190600601610868828261161c565b9050507fc82bca1e9fedc6d47698e89262987cc9fcb518c37802135f018224ea9e10fb4c828260405161089c9291906116a8565b60405180910390a15050565b61ffff821660009081526003602052604081206108c890600201836110e3565b9392505050565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b15801561095657600080fd5b505af115801561096a573d6000803e3d6000fd5b505050506109828561ffff16600014156101f461101f565b61098f83821460c861101f565b61099c6105ff8585611031565b61ffff85166000908152600360205260408120600201905b84811015610ac2576109d186868381811061067e5761067e611533565b50610a18670de0b6b3a76400008585848181106109f0576109f0611533565b9050602002016020810190610a05919061155e565b6001600160801b031610156101f661101f565b838382818110610a2a57610a2a611533565b9050602002016020810190610a3f919061155e565b61ffff8816600090815260036020526040812060050190888885818110610a6857610a68611533565b9050602002016020810190610a7d9190611518565b6001600160a01b03168152602081019190915260400160002080546001600160801b03928316600160801b029216919091179055610abb8160010190565b90506109b4565b508561ffff167fb32b0d03b1a8f5dbca5719a90f26c6c6c37dc68383514dd611b3116249a5ec5f8686868660405161078394939291906115b7565b6040516312d9a6ad60e01b81527f1e46cebd6689d8c64011118478db0c61a89aa2646c860df401de476fbf37898360048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610b8457600080fd5b505af1158015610b98573d6000803e3d6000fd5b5050505060005b82811015610c03578160016000868685818110610bbe57610bbe611533565b9050602002016020810190610bd39190611518565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055600101610b9f565b507fbb1cd903231077138a8cf9e16bb5b1af6e0e8474614d759d592f17ad5e9e27aa838383604051610c3793929190611713565b60405180910390a1505050565b600054610100900460ff1615808015610c645750600054600160ff909116105b80610c7e5750303b158015610c7e575060005460ff166001145b610ce55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015610d08576000805461ff0019166101001790555b8015610d4e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610dd857600080fd5b505af1158015610dec573d6000803e3d6000fd5b5050506001600160a01b0383166000908152600260205260409020829150610e148282611739565b905050816001600160a01b03167feba89a3dc5d5c81fc0f4ce0e75e9fd52010bee6ce91219a29c9621ede81f4dd282604051610e509190611833565b60405180910390a25050565b61ffff811660009081526003602052604081206060918291610e7d90611105565b61ffff85166000908152600360205260409020909350610e9f90600201611105565b61ffff909416600090815260036020526040902060040154929467ffffffffffffffff90931692915050565b6040516312d9a6ad60e01b81527f8fbcb4375b910093bcf636b6b2f26b26eda2a29ef5a8ee7de44b5743c3bf9a2860048201523360248201527f000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a6001600160a01b0316906312d9a6ad90604401600060405180830381600087803b158015610f5257600080fd5b505af1158015610f66573d6000803e3d6000fd5b50505050610f7e8261ffff16600014156101f461101f565b610f9d670de0b6b3a76400008267ffffffffffffffff161160c961101f565b61ffff8216600081815260036020908152604091829020600401805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527f17a6bbee94d3823c3e09e802bbe3a71362ed85117b86cfd4a43fe9a2395ca1899101610e50565b61ffff821660009081526003602052604081206108c890836110e3565b8161102d5761102d81611112565b5050565b60008160015b818110156110c15784848281811061105157611051611533565b90506020020160208101906110669190611518565b6001600160a01b0316858561107c6001856118d1565b81811061108b5761108b611533565b90506020020160208101906110a09190611518565b6001600160a01b0316106110b9576000925050506110c8565b600101611037565b5060019150505b92915050565b60006108c8836001600160a01b038416611122565b6001600160a01b038116600090815260018301602052604081205415156108c8565b606060006108c883611171565b610d4e8162494e4360e81b6111cd565b6000818152600183016020526040812054611169575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556110c8565b5060006110c8565b6060816000018054806020026020016040519081016040528092919081815260200182805480156111c157602002820191906000526020600020905b8154815260200190600101908083116111ad575b50505050509050919050565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b604481905260e883901c91606490fd5b803561ffff8116811461124257600080fd5b919050565b60008083601f84011261125957600080fd5b50813567ffffffffffffffff81111561127157600080fd5b6020830191508360208260051b850101111561128c57600080fd5b9250929050565b6000806000806000606086880312156112ab57600080fd5b6112b486611230565b9450602086013567ffffffffffffffff808211156112d157600080fd5b6112dd89838a01611247565b909650945060408801359150808211156112f657600080fd5b5061130388828901611247565b969995985093965092949392505050565b60008082840360a081121561132857600080fd5b61133184611230565b92506080601f198201121561134557600080fd5b506020830190509250929050565b80356001600160a01b038116811461124257600080fd5b6000806040838503121561137d57600080fd5b61138683611230565b915061139460208401611353565b90509250929050565b8015158114610d4e57600080fd5b80356112428161139d565b6000806000604084860312156113cb57600080fd5b833567ffffffffffffffff8111156113e257600080fd5b6113ee86828701611247565b90945092505060208401356114028161139d565b809150509250925092565b60006020828403121561141f57600080fd5b6108c882611230565b60008082840361010081121561143d57600080fd5b61144684611353565b925060e0601f198201121561134557600080fd5b600081518084526020808501945080840160005b838110156114935781516001600160a01b03168752958201959082019060010161146e565b509495945050505050565b6060815260006114b1606083018661145a565b82810360208401526114c3818661145a565b915050826040830152949350505050565b600080604083850312156114e757600080fd5b6114f083611230565b9150602083013567ffffffffffffffff8116811461150d57600080fd5b809150509250929050565b60006020828403121561152a57600080fd5b6108c882611353565b634e487b7160e01b600052603260045260246000fd5b6001600160801b0381168114610d4e57600080fd5b60006020828403121561157057600080fd5b81356108c881611549565b8183526000602080850194508260005b85811015611493576001600160a01b036115a483611353565b168752958201959082019060010161158b565b6040815260006115cb60408301868861157b565b8281036020848101919091528482528591810160005b8681101561160f5783356115f481611549565b6001600160801b0316825292820192908201906001016115e1565b5098975050505050505050565b81356116278161139d565b815460ff191660ff821515161782555060208201356116458161139d565b815461ff00191681151560081b61ff00161782555060408201356116688161139d565b815462ff0000191681151560101b62ff00001617825550606082013561168d8161139d565b815463ff000000191690151560181b63ff0000001617905550565b61ffff8316815260a0810182356116be8161139d565b80151560208401525060208301356116d58161139d565b80151560408401525060408301356116ec8161139d565b80151560608401525060608301356117038161139d565b8015156080840152509392505050565b60408152600061172760408301858761157b565b90508215156020830152949350505050565b813561174481611549565b6001600160801b03811690506001600160801b03198181845416178355602084013561176f81611549565b60801b161781556001810160408301356117888161139d565b815460ff191660ff821515161782555060608301356117a68161139d565b815461ff00191681151560081b61ff00161782555060808301356117c98161139d565b815462ff0000191681151560101b62ff0000161782555060a08301356117ee8161139d565b815463ff000000191681151560181b63ff000000161782555060c08301356118158161139d565b815464ff00000000191690151560201b64ff00000000161790555050565b60e08101823561184281611549565b6001600160801b03908116835260208401359061185e82611549565b16602083015260408301356118728161139d565b1515604083015260608301356118878161139d565b15156060830152608083013561189c8161139d565b151560808301526118af60a084016113ab565b151560a08301526118c260c084016113ab565b80151560c08401525092915050565b818103818111156110c857634e487b7160e01b600052601160045260246000fdfea26469706673582212209ef3c89779a58a6cd10e8523b8a00861feab12f69f5c4b330566ecc37f0acdb864736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a

-----Decoded View---------------
Arg [0] : _acm (address): 0xCE3292cA5AbbdFA1Db02142A67CFFc708530675a

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce3292ca5abbdfa1db02142a67cffc708530675a


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.