S Price: $0.442181 (+7.71%)

Contract

0xDe62378B913337667c7a238caF695b146421E23d

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GyroConfig

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion, None license
File 1 of 10 : GyroConfig.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

import "IGyroConfig.sol";
import "GovernableUpgradeable.sol";
import "EnumerableMapping.sol";

contract GyroConfig is IGyroConfig, GovernableUpgradeable {
    using EnumerableMapping for EnumerableMapping.Bytes32ToUIntMap;

    uint8 internal constant ADDRESS_TYPE = 1;
    uint8 internal constant UINT_TYPE = 2;

    /// @notice Actual configuration values
    mapping(bytes32 => uint256) internal _config;

    /// @notice Configuration metadata such as existence, type, and frozen status
    EnumerableMapping.Bytes32ToUIntMap internal _configMeta;

    /// @inheritdoc IGyroConfig
    function listKeys() external view override returns (bytes32[] memory) {
        uint256 length = _configMeta.length();
        bytes32[] memory keys = new bytes32[](length);
        for (uint256 i = 0; i < length; i++) {
            (keys[i], ) = _configMeta.at(i);
        }
        return keys;
    }

    /// @inheritdoc IGyroConfig
    function hasKey(bytes32 key) external view override returns (bool) {
        return _configMeta.contains(key);
    }

    /// @inheritdoc IGyroConfig
    function getConfigMeta(bytes32 key) external view override returns (uint8, bool) {
        (bool exists, uint8 configType, bool frozen) = _getConfigMeta(key);
        require(exists, Errors.KEY_NOT_FOUND);
        return (configType, frozen);
    }

    /// @inheritdoc IGyroConfig
    function getUint(bytes32 key) external view override returns (uint256) {
        return _get(key, UINT_TYPE);
    }

    /// @inheritdoc IGyroConfig
    function getUint(bytes32 key, uint256 defaultValue) external view override returns (uint256) {
        return _get(key, UINT_TYPE, defaultValue);
    }

    /// @inheritdoc IGyroConfig
    function getAddress(bytes32 key) external view override returns (address) {
        return address(uint160(_get(key, ADDRESS_TYPE)));
    }

    /// @inheritdoc IGyroConfig
    function getAddress(bytes32 key, address defaultValue)
        external
        view
        override
        returns (address)
    {
        return address(uint160(_get(key, ADDRESS_TYPE, uint256(uint160(defaultValue)))));
    }

    /// @inheritdoc IGyroConfig
    function setUint(bytes32 key, uint256 newValue) external override governanceOnly {
        uint256 oldValue = _set(key, newValue, UINT_TYPE);
        emit ConfigChanged(key, oldValue, newValue);
    }

    /// @inheritdoc IGyroConfig
    function setAddress(bytes32 key, address newValue) external override governanceOnly {
        uint256 oldValue = _set(key, uint256(uint160(newValue)), ADDRESS_TYPE);
        emit ConfigChanged(key, address(uint160(oldValue)), newValue);
    }

    /// @inheritdoc IGyroConfig
    function unset(bytes32 key) external override governanceOnly {
        (bool exists, , bool frozen) = _getConfigMeta(key);
        require(exists, Errors.KEY_NOT_FOUND);
        require(!frozen, Errors.KEY_FROZEN);
        delete _config[key];
        _configMeta.remove(key);
        emit ConfigUnset(key);
    }

    /// @inheritdoc IGyroConfig
    function freeze(bytes32 key) external governanceOnly {
        (bool exists, uint8 configType, bool frozen) = _getConfigMeta(key);
        require(exists, Errors.KEY_NOT_FOUND);
        require(!frozen, Errors.KEY_FROZEN);
        _setConfigMeta(key, configType, true);

        emit ConfigFrozen(key);
    }

    function _get(bytes32 key, uint8 expectedType) internal view returns (uint256) {
        (bool exists, uint8 configType, ) = _getConfigMeta(key);
        require(exists && configType == expectedType, Errors.KEY_NOT_FOUND);
        return _config[key];
    }

    function _get(
        bytes32 key,
        uint8 expectedType,
        uint256 defaultValue
    ) internal view returns (uint256) {
        (bool exists, uint8 configType, ) = _getConfigMeta(key);
        if (!exists) return defaultValue;
        require(configType == expectedType, Errors.KEY_NOT_FOUND);
        return _config[key];
    }

    function _set(
        bytes32 key,
        uint256 newValue,
        uint8 expectedType
    ) internal returns (uint256) {
        (bool exists, uint8 configType, bool frozen) = _getConfigMeta(key);
        require(!exists || configType == expectedType, Errors.INVALID_ARGUMENT);
        require(!frozen, Errors.KEY_FROZEN);
        uint256 oldValue = _config[key];
        _config[key] = newValue;
        _setConfigMeta(key, expectedType, false);
        return oldValue;
    }

    function _setConfigMeta(
        bytes32 key,
        uint8 configType,
        bool frozen
    ) internal {
        uint256 frozenB = frozen ? 1 : 0;
        uint256 value = (uint256(configType) << 8) | frozenB;
        _configMeta.set(key, value);
    }

    function _getConfigMeta(bytes32 key)
        internal
        view
        returns (
            bool exists,
            uint8 configType,
            bool frozen
        )
    {
        uint256 meta;
        (exists, meta) = _configMeta.tryGet(key);
        if (exists) {
            frozen = meta & 0x1 == 1;
            configType = uint8(meta >> 8);
        }
    }
}

File 2 of 10 : IGyroConfig.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

import "IGovernable.sol";

/// @notice IGyroConfig stores the global configuration of the Gyroscope protocol
interface IGyroConfig is IGovernable {
    /// @notice Event emitted every time a configuration is changed
    event ConfigChanged(bytes32 key, uint256 previousValue, uint256 newValue);
    event ConfigChanged(bytes32 key, address previousValue, address newValue);

    /// @notice Event emitted when a configuration is unset
    event ConfigUnset(bytes32 key);

    /// @notice Event emitted when a configuration is frozen
    event ConfigFrozen(bytes32 key);

    /// @notice Returns a set of known configuration keys
    function listKeys() external view returns (bytes32[] memory);

    /// @notice Returns true if the configuration has the given key
    function hasKey(bytes32 key) external view returns (bool);

    /// @notice Returns the metadata associated with a particular config key
    function getConfigMeta(bytes32 key) external view returns (uint8, bool);

    /// @notice Returns a uint256 value from the config
    function getUint(bytes32 key) external view returns (uint256);

    /// @notice Returns a uint256 value from the config or `defaultValue` if it does not exist
    function getUint(bytes32 key, uint256 defaultValue) external view returns (uint256);

    /// @notice Returns an address value from the config
    function getAddress(bytes32 key) external view returns (address);

    /// @notice Returns an address value from the config or `defaultValue` if it does not exist
    function getAddress(bytes32 key, address defaultValue) external view returns (address);

    /// @notice Set a uint256 config
    /// NOTE: We avoid overloading to avoid complications with some clients
    function setUint(bytes32 key, uint256 newValue) external;

    /// @notice Set an address config
    function setAddress(bytes32 key, address newValue) external;

    /// @notice Unset a key in the config
    function unset(bytes32 key) external;

    /// @notice Freezes a key, making it impossible to update or unset
    function freeze(bytes32 key) external;
}

File 3 of 10 : IGovernable.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

interface IGovernable {
    /// @notice Emmited when the governor is changed
    event GovernorChanged(address oldGovernor, address newGovernor);

    /// @notice Emmited when the governor is change is requested
    event GovernorChangeRequested(address newGovernor);

    /// @notice Returns the current governor
    function governor() external view returns (address);

    /// @notice Returns the pending governor
    function pendingGovernor() external view returns (address);

    /// @notice Changes the governor
    /// can only be called by the current governor
    function changeGovernor(address newGovernor) external;

    /// @notice Called by the pending governor to approve the change
    function acceptGovernance() external;
}

File 4 of 10 : GovernableUpgradeable.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

import "GovernableBase.sol";
import "Initializable.sol";

contract GovernableUpgradeable is GovernableBase, Initializable {
    uint256[50] internal __gap;

    constructor() {
        _disableInitializers();
    }

    // solhint-disable-next-line func-name-mixedcase
    function __GovernableUpgradeable_initialize(address _governor) internal {
        governor = _governor;
        emit GovernorChanged(address(0), _governor);
    }

    function initialize(address _governor) external virtual initializer {
        __GovernableUpgradeable_initialize(_governor);
    }
}

File 5 of 10 : GovernableBase.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

import "Errors.sol";
import "IGovernable.sol";

contract GovernableBase is IGovernable {
    address public override governor;
    address public override pendingGovernor;

    modifier governanceOnly() {
        require(msg.sender == governor, Errors.NOT_AUTHORIZED);
        _;
    }

    /// @inheritdoc IGovernable
    function changeGovernor(address newGovernor) external override governanceOnly {
        require(address(newGovernor) != address(0), Errors.INVALID_ARGUMENT);
        pendingGovernor = newGovernor;
        emit GovernorChangeRequested(newGovernor);
    }

    /// @inheritdoc IGovernable
    function acceptGovernance() external override {
        require(msg.sender == pendingGovernor, Errors.NOT_AUTHORIZED);
        address currentGovernor = governor;
        governor = pendingGovernor;
        pendingGovernor = address(0);
        emit GovernorChanged(currentGovernor, msg.sender);
    }
}

File 6 of 10 : Errors.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

/// @notice Defines different errors emitted by Gyroscope contracts
library Errors {
    string public constant TOKEN_AND_AMOUNTS_LENGTH_DIFFER = "1";
    string public constant TOO_MUCH_SLIPPAGE = "2";
    string public constant EXCHANGER_NOT_FOUND = "3";
    string public constant POOL_IDS_NOT_FOUND = "4";
    string public constant WOULD_UNBALANCE_GYROSCOPE = "5";
    string public constant VAULT_ALREADY_EXISTS = "6";
    string public constant VAULT_NOT_FOUND = "7";

    string public constant X_OUT_OF_BOUNDS = "20";
    string public constant Y_OUT_OF_BOUNDS = "21";
    string public constant PRODUCT_OUT_OF_BOUNDS = "22";
    string public constant INVALID_EXPONENT = "23";
    string public constant OUT_OF_BOUNDS = "24";
    string public constant ZERO_DIVISION = "25";
    string public constant ADD_OVERFLOW = "26";
    string public constant SUB_OVERFLOW = "27";
    string public constant MUL_OVERFLOW = "28";
    string public constant DIV_INTERNAL = "29";

    // User errors
    string public constant NOT_AUTHORIZED = "30";
    string public constant INVALID_ARGUMENT = "31";
    string public constant KEY_NOT_FOUND = "32";
    string public constant KEY_FROZEN = "33";
    string public constant INSUFFICIENT_BALANCE = "34";
    string public constant INVALID_ASSET = "35";
    string public constant FORBIDDEN_EXTERNAL_ACTION = "35";

    // Oracle related errors
    string public constant ASSET_NOT_SUPPORTED = "40";
    string public constant STALE_PRICE = "41";
    string public constant NEGATIVE_PRICE = "42";
    string public constant INVALID_MESSAGE = "43";
    string public constant TOO_MUCH_VOLATILITY = "44";
    string public constant WETH_ADDRESS_NOT_FIRST = "44";
    string public constant ROOT_PRICE_NOT_GROUNDED = "45";
    string public constant NOT_ENOUGH_TWAPS = "46";
    string public constant ZERO_PRICE_TWAP = "47";
    string public constant INVALID_NUMBER_WEIGHTS = "48";
    string public constant NO_WETH_PRICE = "49";

    //Vault safety check related errors
    string public constant A_VAULT_HAS_ALL_STABLECOINS_OFF_PEG = "51";
    string public constant NOT_SAFE_TO_MINT = "52";
    string public constant NOT_SAFE_TO_REDEEM = "53";
    string public constant AMOUNT_AND_PRICE_LENGTH_DIFFER = "54";
    string public constant TOKEN_PRICES_TOO_SMALL = "55";
    string public constant TRYING_TO_REDEEM_MORE_THAN_VAULT_CONTAINS = "56";
    string public constant CALLER_NOT_MOTHERBOARD = "57";
    string public constant CALLER_NOT_RESERVE_MANAGER = "58";
    string public constant VAULT_CANNOT_BE_REMOVED = "59";

    string public constant VAULT_FLOW_TOO_HIGH = "60";
    string public constant OPERATION_SUCCEEDS_BUT_SAFETY_MODE_ACTIVATED = "61";
    string public constant ORACLE_GUARDIAN_TIME_LIMIT = "62";
    string public constant NOT_ENOUGH_FLOW_DATA = "63";
    string public constant SUPPLY_CAP_EXCEEDED = "64";
    string public constant SAFETY_MODE_ACTIVATED = "65";

    // misc errors
    string public constant REDEEM_AMOUNT_BUG = "100";
    string public constant EXTERNAL_ACTION_FAILED = "101";
    string public constant TOKENS_NOT_SORTED = "102";
    string public constant NO_SHARES_MINTED = "103";
    string public constant TRYING_TO_REDEEM_MORE_THAN_SUPPLY = "104";
}

File 7 of 10 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "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]
 * ```
 * 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;
    }
}

File 8 of 10 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (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 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);
        }
    }
}

File 9 of 10 : EnumerableMapping.sol
// SPDX-License-Identifier: LicenseRef-Gyro-1.0
// for information on licensing please see the README in the GitHub repository <https://github.com/gyrostable/core-protocol>.
pragma solidity ^0.8.4;

import "EnumerableSet.sol";

library EnumerableMapping {
    using EnumerableSet for EnumerableSet.Bytes32Set;

    // Code take from contracts/utils/structs/EnumerableMap.sol
    // because the helper functions are private

    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct Map {
        // Storage of keys
        EnumerableSet.Bytes32Set _keys;
        mapping(bytes32 => bytes32) _values;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(
        Map storage map,
        bytes32 key,
        bytes32 value
    ) private returns (bool) {
        map._values[key] = value;
        return map._keys.add(key);
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        delete map._values[key];
        return map._keys.remove(key);
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key) private view returns (bool) {
        return map._keys.contains(key);
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._keys.length();
    }

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

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
        bytes32 value = map._values[key];
        if (value == bytes32(0)) {
            return (_contains(map, key), bytes32(0));
        } else {
            return (true, value);
        }
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        bytes32 value = map._values[key];
        require(value != 0 || _contains(map, key), "EnumerableMap: nonexistent key");
        return value;
    }

    // AddressToAddressMap

    struct AddressToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        AddressToAddressMap storage map,
        address key,
        address value
    ) internal returns (bool) {
        return _set(map._inner, bytes32(uint256(uint160(key))), bytes32(uint256(uint160(value))));
    }

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

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

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

    /**
     * @dev Returns the element 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(AddressToAddressMap storage map, uint256 index)
        internal
        view
        returns (address, address)
    {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (address(uint160(uint256(key))), address(uint160(uint256(value))));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(AddressToAddressMap storage map, address key)
        internal
        view
        returns (bool, address)
    {
        (bool success, bytes32 value) = _tryGet(map._inner, bytes32(uint256(uint160(key))));
        return (success, address(uint160(uint256(value))));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(AddressToAddressMap storage map, address key) internal view returns (address) {
        return address(uint160(uint256(_get(map._inner, bytes32(uint256(uint160(key)))))));
    }

    // AddressToUintMap

    struct AddressToUintMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        AddressToUintMap storage map,
        address key,
        uint256 value
    ) internal returns (bool) {
        return _set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
    }

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

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

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

    /**
     * @dev Returns the element 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(AddressToUintMap storage map, uint256 index)
        internal
        view
        returns (address, uint256)
    {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (address(uint160(uint256(key))), uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(AddressToUintMap storage map, address key)
        internal
        view
        returns (bool, uint256)
    {
        (bool success, bytes32 value) = _tryGet(map._inner, bytes32(uint256(uint160(key))));
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
        return uint256(_get(map._inner, bytes32(uint256(uint160(key)))));
    }

    // Bytes32ToUIntMap

    struct Bytes32ToUIntMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        Bytes32ToUIntMap storage map,
        bytes32 key,
        uint256 value
    ) internal returns (bool) {
        return _set(map._inner, key, bytes32(value));
    }

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

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

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

    /**
     * @dev Returns the element 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(Bytes32ToUIntMap storage map, uint256 index)
        internal
        view
        returns (bytes32, uint256)
    {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (key, uint256(value));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(Bytes32ToUIntMap storage map, bytes32 key)
        internal
        view
        returns (bool, uint256)
    {
        (bool success, bytes32 value) = _tryGet(map._inner, key);
        return (success, uint256(value));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(Bytes32ToUIntMap storage map, bytes32 key) internal view returns (uint256) {
        return uint256(_get(map._inner, key));
    }
}

File 10 of 10 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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.
 *
 * ```
 * 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": "london",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "GyroConfig.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"ConfigChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"},{"indexed":false,"internalType":"address","name":"previousValue","type":"address"},{"indexed":false,"internalType":"address","name":"newValue","type":"address"}],"name":"ConfigChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"ConfigFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"ConfigUnset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newGovernor","type":"address"}],"name":"GovernorChangeRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldGovernor","type":"address"},{"indexed":false,"internalType":"address","name":"newGovernor","type":"address"}],"name":"GovernorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[],"name":"acceptGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGovernor","type":"address"}],"name":"changeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"freeze","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"defaultValue","type":"address"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getConfigMeta","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"defaultValue","type":"uint256"}],"name":"getUint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"hasKey","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_governor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"listKeys","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingGovernor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"newValue","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"setUint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"unset","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001961001e565b6100eb565b600154600160a81b900460ff161561008c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60015460ff600160a01b909104811610156100e9576001805460ff60a01b191660ff60a01b17905560405160ff81527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611131806100fa6000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063ca446dd911610097578063e4c0aaf411610066578063e4c0aaf414610234578063e964da1514610247578063ec13cc7b1461025a578063fd322c141461026d57600080fd5b8063ca446dd9146101cf578063cd014f0c146101e2578063e2a4853a1461020e578063e3056a341461022157600080fd5b8063696eb375116100d3578063696eb375146101655780639141d6f914610188578063bd02d0f51461019b578063c4d66de8146101bc57600080fd5b80630c340a241461010557806320d06ff91461013557806321f8a72114610148578063238efcbc1461015b575b600080fd5b600054610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610118610143366004610f63565b610282565b610118610156366004610f8f565b6102a2565b6101636102af565b005b610178610173366004610f8f565b610368565b604051901515815260200161012c565b610163610196366004610f8f565b610375565b6101ae6101a9366004610f8f565b610494565b60405190815260200161012c565b6101636101ca366004610fa8565b6104a1565b6101636101dd366004610f63565b6105cb565b6101f56101f0366004610f8f565b610675565b6040805160ff909316835290151560208301520161012c565b61016361021c366004610fc3565b6106d2565b600154610118906001600160a01b031681565b610163610242366004610fa8565b610767565b6101ae610255366004610fc3565b61083c565b610163610268366004610f8f565b61084a565b61027561095d565b60405161012c9190610fe5565b6000610299836001846001600160a01b0316610a01565b90505b92915050565b600061029c826001610a81565b600154604080518082019091526002815261033360f41b6020820152906001600160a01b031633146102fd5760405162461bcd60e51b81526004016102f49190611029565b60405180910390fd5b5060008054600180546001600160a01b03198084166001600160a01b03808416919091179095551690556040805192909116808352336020840152917fde4b3f61490b74c0ed6237523974fe299126bbbf8a8a7482fd220104c59b0c8491015b60405180910390a150565b600061029c603583610af6565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146103ba5760405162461bcd60e51b81526004016102f49190611029565b506000806103c783610b02565b92505091508160405180604001604052806002815260200161199960f11b815250906104065760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b6020820152811561043f5760405162461bcd60e51b81526004016102f49190611029565b5060008381526034602052604081205561045a603584610b36565b506040518381527f90e6f6dc5a05702effb7cb4f1eb2d30a76a0a0c4cb7accd3c069c2b8149d3594906020015b60405180910390a1505050565b600061029c826002610a81565b600154600160a81b900460ff16158080156104c7575060018054600160a01b900460ff16105b806104e75750303b1580156104e7575060018054600160a01b900460ff16145b61054a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102f4565b6001805460ff60a01b1916600160a01b1790558015610577576001805460ff60a81b1916600160a81b1790555b61058082610b42565b80156105c7576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146106105760405162461bcd60e51b81526004016102f49190611029565b50600061062883836001600160a01b03166001610b96565b604080518581526001600160a01b0380841660208301528516918101919091529091507f86709719730335e655237ec19f947f910603bbf35b01de8f98e5eb05922edb4390606001610487565b600080600080600061068686610b02565b9250925092508260405180604001604052806002815260200161199960f11b815250906106c65760405162461bcd60e51b81526004016102f49190611029565b50909590945092505050565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146107175760405162461bcd60e51b81526004016102f49190611029565b50600061072683836002610b96565b60408051858152602081018390529081018490529091507fda2476af668c5f7eb48f492f9bbd5a7e9d4293d64144b3b7be75a156803fb8be90606001610487565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146107ac5760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333160f01b60208201526001600160a01b0382166107ed5760405162461bcd60e51b81526004016102f49190611029565b50600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f67235ba2e63c748a35b95c4f92a3bbc2a1389938170a5ce6c9add5d0b03a314a9060200161035d565b600061029983600284610a01565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b0316331461088f5760405162461bcd60e51b81526004016102f49190611029565b50600080600061089e84610b02565b9250925092508260405180604001604052806002815260200161199960f11b815250906108de5760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b602082015281156109175760405162461bcd60e51b81526004016102f49190611029565b5061092484836001610c5d565b6040518481527f540251d20c832db9ca5e1ad5faa4320509054d7067fc1d7fa5856f4ccb69cf5c9060200160405180910390a150505050565b6060600061096b6035610c92565b905060008167ffffffffffffffff81111561098857610988611077565b6040519080825280602002602001820160405280156109b1578160200160208202803683370190505b50905060005b828110156109fa576109ca603582610c9d565b508282815181106109dd576109dd61108d565b6020908102919091010152806109f2816110b9565b9150506109b7565b5092915050565b6000806000610a0f86610b02565b509150915081610a23578392505050610a7a565b8460ff168160ff161460405180604001604052806002815260200161199960f11b81525090610a655760405162461bcd60e51b81526004016102f49190611029565b50505060008481526034602052604090205490505b9392505050565b6000806000610a8f85610b02565b5091509150818015610aa657508360ff168160ff16145b60405180604001604052806002815260200161199960f11b81525090610adf5760405162461bcd60e51b81526004016102f49190611029565b505050600092835250506034602052604090205490565b60006102998383610cbb565b6000808080610b12603586610cc7565b90945090508315610b2e57806001166001149150600881901c92505b509193909250565b60006102998383610cd6565b600080546001600160a01b0319166001600160a01b03831690811782556040805192835260208301919091527fde4b3f61490b74c0ed6237523974fe299126bbbf8a8a7482fd220104c59b0c84910161035d565b600080600080610ba587610b02565b925092509250821580610bbd57508460ff168260ff16145b60405180604001604052806002815260200161333160f01b81525090610bf65760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b60208201528115610c2f5760405162461bcd60e51b81526004016102f49190611029565b50600087815260346020526040812080549088905590610c529089908890610c5d565b979650505050505050565b600081610c6b576000610c6e565b60015b60ff16905061ff00600884901b168117610c8a60358683610cf3565b505050505050565b600061029c82610d08565b6000808080610cac8686610d13565b909450925050505b9250929050565b60006102998383610d3e565b6000808080610cac8686610d56565b600081815260028301602052604081208190556102998383610d90565b6000610d00848484610d9c565b949350505050565b600061029c82610db9565b60008080610d218585610dc3565b600081815260029690960160205260409095205494959350505050565b60008181526001830160205260408120541515610299565b6000818152600283016020526040812054819080610d8557610d788585610cbb565b925060009150610cb49050565b600192509050610cb4565b60006102998383610dcf565b60008281526002840160205260408120829055610d008484610ec2565b600061029c825490565b60006102998383610ece565b60008181526001830160205260408120548015610eb8576000610df36001836110d2565b8554909150600090610e07906001906110d2565b9050818114610e6c576000866000018281548110610e2757610e2761108d565b9060005260206000200154905080876000018481548110610e4a57610e4a61108d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e7d57610e7d6110e5565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029c565b600091505061029c565b60006102998383610ef8565b6000826000018281548110610ee557610ee561108d565b9060005260206000200154905092915050565b6000818152600183016020526040812054610f3f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029c565b50600061029c565b80356001600160a01b0381168114610f5e57600080fd5b919050565b60008060408385031215610f7657600080fd5b82359150610f8660208401610f47565b90509250929050565b600060208284031215610fa157600080fd5b5035919050565b600060208284031215610fba57600080fd5b61029982610f47565b60008060408385031215610fd657600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561101d57835183529284019291840191600101611001565b50909695505050505050565b600060208083528351808285015260005b818110156110565785810183015185820160400152820161103a565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110cb576110cb6110a3565b5060010190565b8181038181111561029c5761029c6110a3565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204700aa615b6b2f9bd1b9195129c173076b42888f01da04cde88896d8ffdc283b64736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063ca446dd911610097578063e4c0aaf411610066578063e4c0aaf414610234578063e964da1514610247578063ec13cc7b1461025a578063fd322c141461026d57600080fd5b8063ca446dd9146101cf578063cd014f0c146101e2578063e2a4853a1461020e578063e3056a341461022157600080fd5b8063696eb375116100d3578063696eb375146101655780639141d6f914610188578063bd02d0f51461019b578063c4d66de8146101bc57600080fd5b80630c340a241461010557806320d06ff91461013557806321f8a72114610148578063238efcbc1461015b575b600080fd5b600054610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610118610143366004610f63565b610282565b610118610156366004610f8f565b6102a2565b6101636102af565b005b610178610173366004610f8f565b610368565b604051901515815260200161012c565b610163610196366004610f8f565b610375565b6101ae6101a9366004610f8f565b610494565b60405190815260200161012c565b6101636101ca366004610fa8565b6104a1565b6101636101dd366004610f63565b6105cb565b6101f56101f0366004610f8f565b610675565b6040805160ff909316835290151560208301520161012c565b61016361021c366004610fc3565b6106d2565b600154610118906001600160a01b031681565b610163610242366004610fa8565b610767565b6101ae610255366004610fc3565b61083c565b610163610268366004610f8f565b61084a565b61027561095d565b60405161012c9190610fe5565b6000610299836001846001600160a01b0316610a01565b90505b92915050565b600061029c826001610a81565b600154604080518082019091526002815261033360f41b6020820152906001600160a01b031633146102fd5760405162461bcd60e51b81526004016102f49190611029565b60405180910390fd5b5060008054600180546001600160a01b03198084166001600160a01b03808416919091179095551690556040805192909116808352336020840152917fde4b3f61490b74c0ed6237523974fe299126bbbf8a8a7482fd220104c59b0c8491015b60405180910390a150565b600061029c603583610af6565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146103ba5760405162461bcd60e51b81526004016102f49190611029565b506000806103c783610b02565b92505091508160405180604001604052806002815260200161199960f11b815250906104065760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b6020820152811561043f5760405162461bcd60e51b81526004016102f49190611029565b5060008381526034602052604081205561045a603584610b36565b506040518381527f90e6f6dc5a05702effb7cb4f1eb2d30a76a0a0c4cb7accd3c069c2b8149d3594906020015b60405180910390a1505050565b600061029c826002610a81565b600154600160a81b900460ff16158080156104c7575060018054600160a01b900460ff16105b806104e75750303b1580156104e7575060018054600160a01b900460ff16145b61054a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102f4565b6001805460ff60a01b1916600160a01b1790558015610577576001805460ff60a81b1916600160a81b1790555b61058082610b42565b80156105c7576001805460ff60a81b191681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146106105760405162461bcd60e51b81526004016102f49190611029565b50600061062883836001600160a01b03166001610b96565b604080518581526001600160a01b0380841660208301528516918101919091529091507f86709719730335e655237ec19f947f910603bbf35b01de8f98e5eb05922edb4390606001610487565b600080600080600061068686610b02565b9250925092508260405180604001604052806002815260200161199960f11b815250906106c65760405162461bcd60e51b81526004016102f49190611029565b50909590945092505050565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146107175760405162461bcd60e51b81526004016102f49190611029565b50600061072683836002610b96565b60408051858152602081018390529081018490529091507fda2476af668c5f7eb48f492f9bbd5a7e9d4293d64144b3b7be75a156803fb8be90606001610487565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b031633146107ac5760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333160f01b60208201526001600160a01b0382166107ed5760405162461bcd60e51b81526004016102f49190611029565b50600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f67235ba2e63c748a35b95c4f92a3bbc2a1389938170a5ce6c9add5d0b03a314a9060200161035d565b600061029983600284610a01565b600054604080518082019091526002815261033360f41b6020820152906001600160a01b0316331461088f5760405162461bcd60e51b81526004016102f49190611029565b50600080600061089e84610b02565b9250925092508260405180604001604052806002815260200161199960f11b815250906108de5760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b602082015281156109175760405162461bcd60e51b81526004016102f49190611029565b5061092484836001610c5d565b6040518481527f540251d20c832db9ca5e1ad5faa4320509054d7067fc1d7fa5856f4ccb69cf5c9060200160405180910390a150505050565b6060600061096b6035610c92565b905060008167ffffffffffffffff81111561098857610988611077565b6040519080825280602002602001820160405280156109b1578160200160208202803683370190505b50905060005b828110156109fa576109ca603582610c9d565b508282815181106109dd576109dd61108d565b6020908102919091010152806109f2816110b9565b9150506109b7565b5092915050565b6000806000610a0f86610b02565b509150915081610a23578392505050610a7a565b8460ff168160ff161460405180604001604052806002815260200161199960f11b81525090610a655760405162461bcd60e51b81526004016102f49190611029565b50505060008481526034602052604090205490505b9392505050565b6000806000610a8f85610b02565b5091509150818015610aa657508360ff168160ff16145b60405180604001604052806002815260200161199960f11b81525090610adf5760405162461bcd60e51b81526004016102f49190611029565b505050600092835250506034602052604090205490565b60006102998383610cbb565b6000808080610b12603586610cc7565b90945090508315610b2e57806001166001149150600881901c92505b509193909250565b60006102998383610cd6565b600080546001600160a01b0319166001600160a01b03831690811782556040805192835260208301919091527fde4b3f61490b74c0ed6237523974fe299126bbbf8a8a7482fd220104c59b0c84910161035d565b600080600080610ba587610b02565b925092509250821580610bbd57508460ff168260ff16145b60405180604001604052806002815260200161333160f01b81525090610bf65760405162461bcd60e51b81526004016102f49190611029565b50604080518082019091526002815261333360f01b60208201528115610c2f5760405162461bcd60e51b81526004016102f49190611029565b50600087815260346020526040812080549088905590610c529089908890610c5d565b979650505050505050565b600081610c6b576000610c6e565b60015b60ff16905061ff00600884901b168117610c8a60358683610cf3565b505050505050565b600061029c82610d08565b6000808080610cac8686610d13565b909450925050505b9250929050565b60006102998383610d3e565b6000808080610cac8686610d56565b600081815260028301602052604081208190556102998383610d90565b6000610d00848484610d9c565b949350505050565b600061029c82610db9565b60008080610d218585610dc3565b600081815260029690960160205260409095205494959350505050565b60008181526001830160205260408120541515610299565b6000818152600283016020526040812054819080610d8557610d788585610cbb565b925060009150610cb49050565b600192509050610cb4565b60006102998383610dcf565b60008281526002840160205260408120829055610d008484610ec2565b600061029c825490565b60006102998383610ece565b60008181526001830160205260408120548015610eb8576000610df36001836110d2565b8554909150600090610e07906001906110d2565b9050818114610e6c576000866000018281548110610e2757610e2761108d565b9060005260206000200154905080876000018481548110610e4a57610e4a61108d565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e7d57610e7d6110e5565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061029c565b600091505061029c565b60006102998383610ef8565b6000826000018281548110610ee557610ee561108d565b9060005260206000200154905092915050565b6000818152600183016020526040812054610f3f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561029c565b50600061029c565b80356001600160a01b0381168114610f5e57600080fd5b919050565b60008060408385031215610f7657600080fd5b82359150610f8660208401610f47565b90509250929050565b600060208284031215610fa157600080fd5b5035919050565b600060208284031215610fba57600080fd5b61029982610f47565b60008060408385031215610fd657600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561101d57835183529284019291840191600101611001565b50909695505050505050565b600060208083528351808285015260005b818110156110565785810183015185820160400152820161103a565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110cb576110cb6110a3565b5060010190565b8181038181111561029c5761029c6110a3565b634e487b7160e01b600052603160045260246000fdfea26469706673582212204700aa615b6b2f9bd1b9195129c173076b42888f01da04cde88896d8ffdc283b64736f6c63430008110033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

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.