ETH Price: $2,521.10 (-0.16%)

Contract

0xC1f785B74a01dd9FAc0dE6070bC583fe9eaC7Ab5
 

Overview

ETH Balance

0.244339970022704348 ETH

Eth Value

$616.00 (@ $2,521.10/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Addresses156117192022-09-25 16:55:47705 days ago1664124947IN
DeFi Franc: Default Pool
0 ETH0.0021719420
0x60806040156116002022-09-25 16:31:35705 days ago1664123495IN
 Create: DefaultPool
0 ETH0.0244780220

Latest 17 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
205198062024-08-13 12:49:1118 days ago1723553351
DeFi Franc: Default Pool
0.03895227 ETH
204822322024-08-08 7:00:2323 days ago1723100423
DeFi Franc: Default Pool
0.07635804 ETH
204822282024-08-08 6:59:3523 days ago1723100375
DeFi Franc: Default Pool
0.03682584 ETH
204249132024-07-31 7:02:3531 days ago1722409355
DeFi Franc: Default Pool
0.03576263 ETH
204146482024-07-29 20:35:2332 days ago1722285323
DeFi Franc: Default Pool
0.09665575 ETH
204113062024-07-29 9:25:1133 days ago1722245111
DeFi Franc: Default Pool
0.19331151 ETH
204113012024-07-29 9:24:1133 days ago1722245051
DeFi Franc: Default Pool
0.04156197 ETH
204112982024-07-29 9:23:3533 days ago1722245015
DeFi Franc: Default Pool
0.03970618 ETH
203836982024-07-25 12:55:3537 days ago1721912135
DeFi Franc: Default Pool
0.46222106 ETH
201746322024-06-26 8:21:1166 days ago1719390071
DeFi Franc: Default Pool
0.05799345 ETH
200530772024-06-09 8:28:5983 days ago1717921739
DeFi Franc: Default Pool
0.03479607 ETH
199021742024-05-19 6:23:59104 days ago1716099839
DeFi Franc: Default Pool
0.04330178 ETH
198515392024-05-12 4:24:23111 days ago1715487863
DeFi Franc: Default Pool
0.01411174 ETH
197622992024-04-29 16:56:35123 days ago1714409795
DeFi Franc: Default Pool
0.12468592 ETH
197196152024-04-23 17:34:59129 days ago1713893699
DeFi Franc: Default Pool
0.17404041 ETH
196540192024-04-14 13:17:35139 days ago1713100655
DeFi Franc: Default Pool
0.01052605 ETH
196163542024-04-09 6:38:47144 days ago1712644727
DeFi Franc: Default Pool
1.72515071 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DefaultPool

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 14 : DefaultPool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./Interfaces/IDefaultPool.sol";
import "./Dependencies/CheckContract.sol";
import "./Dependencies/SafetyTransfer.sol";
import "./Dependencies/Initializable.sol";

/*
 * The Default Pool holds the ETH and DCHF debt (but not DCHF tokens) from liquidations that have been redistributed
 * to active troves but not yet "applied", i.e. not yet recorded on a recipient active trove's struct.
 *
 * When a trove makes an operation that applies its pending ETH and DCHF debt, its pending ETH and DCHF debt is moved
 * from the Default Pool to the Active Pool.
 */
contract DefaultPool is Ownable, CheckContract, Initializable, IDefaultPool {
	using SafeMath for uint256;
	using SafeERC20 for IERC20;

	string public constant NAME = "DefaultPool";

	address constant ETH_REF_ADDRESS = address(0);

	address public troveManagerAddress;
	address public troveManagerHelpersAddress;
	address public activePoolAddress;

	bool public isInitialized;

	mapping(address => uint256) internal assetsBalance;
	mapping(address => uint256) internal DCHFDebts; // debt

	// --- Dependency setters ---

	function setAddresses(
		address _troveManagerAddress, 
		address _troveManagerHelpersAddress, 
		address _activePoolAddress
	  ) external
		initializer
		onlyOwner
	{
		require(!isInitialized, "Already initialized");
		checkContract(_troveManagerAddress);
		checkContract(_activePoolAddress);
		checkContract(_troveManagerHelpersAddress);
		isInitialized = true;

		troveManagerAddress = _troveManagerAddress;
		troveManagerHelpersAddress = _troveManagerHelpersAddress;
		activePoolAddress = _activePoolAddress;

		emit TroveManagerAddressChanged(_troveManagerAddress);
		emit ActivePoolAddressChanged(_activePoolAddress);

		renounceOwnership();
	}

	// --- Getters for public variables. Required by IPool interface ---

	/*
	 * Returns the ETH state variable.
	 *
	 * Not necessarily equal to the the contract's raw ETH balance - ether can be forcibly sent to contracts.
	 */
	function getAssetBalance(address _asset) external view override returns (uint256) {
		return assetsBalance[_asset];
	}

	function getDCHFDebt(address _asset) external view override returns (uint256) {
		return DCHFDebts[_asset];
	}

	// --- Pool functionality ---

	function sendAssetToActivePool(address _asset, uint256 _amount)
		external
		override
		callerIsTroveManager
	{
		address activePool = activePoolAddress; // cache to save an SLOAD

		uint256 safetyTransferAmount = SafetyTransfer.decimalsCorrection(_asset, _amount);
		if (safetyTransferAmount == 0) return;

		assetsBalance[_asset] = assetsBalance[_asset].sub(_amount);

		if (_asset != ETH_REF_ADDRESS) {
			IERC20(_asset).safeTransfer(activePool, safetyTransferAmount);
			IDeposit(activePool).receivedERC20(_asset, _amount);
		} else {
			(bool success, ) = activePool.call{ value: _amount }("");
			require(success, "DefaultPool: sending ETH failed");
		}

		emit DefaultPoolAssetBalanceUpdated(_asset, assetsBalance[_asset]);
		emit AssetSent(activePool, _asset, safetyTransferAmount);
	}

	function increaseDCHFDebt(address _asset, uint256 _amount)
		external
		override
		callerIsTroveManager
	{
		DCHFDebts[_asset] = DCHFDebts[_asset].add(_amount);
		emit DefaultPoolDCHFDebtUpdated(_asset, DCHFDebts[_asset]);
	}

	function decreaseDCHFDebt(address _asset, uint256 _amount)
		external
		override
		callerIsTroveManager
	{
		DCHFDebts[_asset] = DCHFDebts[_asset].sub(_amount);
		emit DefaultPoolDCHFDebtUpdated(_asset, DCHFDebts[_asset]);
	}

	// --- 'require' functions ---

	modifier callerIsActivePool() {
		require(msg.sender == activePoolAddress, "DefaultPool: Caller is not the ActivePool");
		_;
	}

	modifier callerIsTroveManager() {
		require(
			msg.sender == troveManagerAddress ||
			msg.sender == troveManagerHelpersAddress, 
			"DefaultPool: Caller is not the TroveManager");
		_;
	}

	function receivedERC20(address _asset, uint256 _amount)
		external
		override
		callerIsActivePool
	{
		require(_asset != ETH_REF_ADDRESS, "ETH Cannot use this functions");

		assetsBalance[_asset] = assetsBalance[_asset].add(_amount);
		emit DefaultPoolAssetBalanceUpdated(_asset, assetsBalance[_asset]);
	}

	// --- Fallback function ---

	receive() external payable callerIsActivePool {
		assetsBalance[ETH_REF_ADDRESS] = assetsBalance[ETH_REF_ADDRESS].add(msg.value);
		emit DefaultPoolAssetBalanceUpdated(ETH_REF_ADDRESS, assetsBalance[ETH_REF_ADDRESS]);
	}
}

File 2 of 14 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 3 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 14 : IDefaultPool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;
import "./IPool.sol";

interface IDefaultPool is IPool {
	// --- Events ---
	event TroveManagerAddressChanged(address _newTroveManagerAddress);
	event DefaultPoolDCHFDebtUpdated(address _asset, uint256 _DCHFDebt);
	event DefaultPoolAssetBalanceUpdated(address _asset, uint256 _balance);

	// --- Functions ---
	function sendAssetToActivePool(address _asset, uint256 _amount) external;
}

File 6 of 14 : CheckContract.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;

contract CheckContract {
	function checkContract(address _account) internal view {
		require(_account != address(0), "Account cannot be zero address");

		uint256 size;
		assembly {
			size := extcodesize(_account)
		}
		require(size > 0, "Account code size cannot be zero");
	}
}

File 7 of 14 : SafetyTransfer.sol
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./ERC20Decimals.sol";

library SafetyTransfer {
	using SafeMath for uint256;

	//_amount is in ether (1e18) and we want to convert it to the token decimal
	function decimalsCorrection(address _token, uint256 _amount)
		internal
		view
		returns (uint256)
	{
		if (_token == address(0)) return _amount;
		if (_amount == 0) return 0;

		uint8 decimals = ERC20Decimals(_token).decimals();
		if (decimals < 18) {
			return _amount.div(10**(18 - decimals));
		} else {
			return _amount.mul(10**(decimals - 18));
		}
	}
}

File 8 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/utils/Address.sol";

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. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.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.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so 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.
     *
     * 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.
     */
    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.
     */
    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 Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 9 of 14 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 10 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 11 of 14 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 12 of 14 : IPool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;

import "./IDeposit.sol";

// Common interface for the Pools.
interface IPool is IDeposit {
	// --- Events ---

	event AssetBalanceUpdated(uint256 _newBalance);
	event DCHFBalanceUpdated(uint256 _newBalance);
	event ActivePoolAddressChanged(address _newActivePoolAddress);
	event DefaultPoolAddressChanged(address _newDefaultPoolAddress);
	event AssetAddressChanged(address _assetAddress);
	event StabilityPoolAddressChanged(address _newStabilityPoolAddress);
	event AssetSent(address _to, address indexed _asset, uint256 _amount);

	// --- Functions ---

	function getAssetBalance(address _asset) external view returns (uint256);

	function getDCHFDebt(address _asset) external view returns (uint256);

	function increaseDCHFDebt(address _asset, uint256 _amount) external;

	function decreaseDCHFDebt(address _asset, uint256 _amount) external;
}

File 13 of 14 : IDeposit.sol
pragma solidity ^0.8.14;

interface IDeposit {
	function receivedERC20(address _asset, uint256 _amount) external;
}

File 14 of 14 : ERC20Decimals.sol
pragma solidity ^0.8.14;

interface ERC20Decimals {
	function decimals() external view returns (uint8);
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newActivePoolAddress","type":"address"}],"name":"ActivePoolAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_assetAddress","type":"address"}],"name":"AssetAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newBalance","type":"uint256"}],"name":"AssetBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"AssetSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newBalance","type":"uint256"}],"name":"DCHFBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newDefaultPoolAddress","type":"address"}],"name":"DefaultPoolAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"_balance","type":"uint256"}],"name":"DefaultPoolAssetBalanceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"_DCHFDebt","type":"uint256"}],"name":"DefaultPoolDCHFDebtUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newStabilityPoolAddress","type":"address"}],"name":"StabilityPoolAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_newTroveManagerAddress","type":"address"}],"name":"TroveManagerAddressChanged","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activePoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"decreaseDCHFDebt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getAssetBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"getDCHFDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"increaseDCHFDebt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"receivedERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendAssetToActivePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_troveManagerAddress","type":"address"},{"internalType":"address","name":"_troveManagerHelpersAddress","type":"address"},{"internalType":"address","name":"_activePoolAddress","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"troveManagerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"troveManagerHelpersAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6114b88061007e6000396000f3fe6080604052600436106100ec5760003560e01c806387c333811161008a578063d1234da711610059578063d1234da714610394578063eb16f004146103ca578063f2fde38b146103ea578063fb24e5f71461040a57600080fd5b806387c33381146102f25780638da5cb5b14610312578063a3f4df7e14610330578063b08bc7221461037457600080fd5b80635373433f116100c65780635373433f146102415780635a4d28bb146102855780636df996d0146102bd578063715018a6146102dd57600080fd5b806329fc67c8146101c9578063363bf964146101eb578063392e53cd1461020b57600080fd5b366101c4576003546001600160a01b031633146101245760405162461bcd60e51b815260040161011b906110b9565b60405180910390fd5b6000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec54610159903461042a565b6000808052600460209081527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec83905560408051928352908201929092527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc61910160405180910390a1005b600080fd5b3480156101d557600080fd5b506101e96101e436600461111e565b61043f565b005b3480156101f757600080fd5b506101e9610206366004611148565b6106a8565b34801561021757600080fd5b5060035461022c90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561024d57600080fd5b5061027761025c36600461118b565b6001600160a01b031660009081526004602052604090205490565b604051908152602001610238565b34801561029157600080fd5b506001546102a5906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102c957600080fd5b506101e96102d836600461111e565b610938565b3480156102e957600080fd5b506101e96109f4565b3480156102fe57600080fd5b506002546102a5906001600160a01b031681565b34801561031e57600080fd5b506000546001600160a01b03166102a5565b34801561033c57600080fd5b506103676040518060400160405280600b81526020016a111959985d5b1d141bdbdb60aa1b81525081565b60405161023891906111d2565b34801561038057600080fd5b506003546102a5906001600160a01b031681565b3480156103a057600080fd5b506102776103af36600461118b565b6001600160a01b031660009081526005602052604090205490565b3480156103d657600080fd5b506101e96103e536600461111e565b610a2a565b3480156103f657600080fd5b506101e961040536600461118b565b610b1f565b34801561041657600080fd5b506101e961042536600461111e565b610bba565b6000610436828461121b565b90505b92915050565b6001546001600160a01b031633148061046257506002546001600160a01b031633145b61047e5760405162461bcd60e51b815260040161011b90611233565b6003546001600160a01b031660006104968484610c1c565b9050806000036104a65750505050565b6001600160a01b0384166000908152600460205260409020546104c99084610cfd565b6001600160a01b03851660008181526004602052604090209190915515610565576104fe6001600160a01b0385168383610d09565b604051633ac5bc0160e21b81526001600160a01b0385811660048301526024820185905283169063eb16f00490604401600060405180830381600087803b15801561054857600080fd5b505af115801561055c573d6000803e3d6000fd5b5050505061060a565b6000826001600160a01b03168460405160006040518083038185875af1925050503d80600081146105b2576040519150601f19603f3d011682016040523d82523d6000602084013e6105b7565b606091505b50509050806106085760405162461bcd60e51b815260206004820152601f60248201527f44656661756c74506f6f6c3a2073656e64696e6720455448206661696c656400604482015260640161011b565b505b6001600160a01b038416600081815260046020908152604091829020548251938452908301527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc61910160405180910390a1604080516001600160a01b038481168252602082018490528616917ff89c3306c782ffbbe4593aa5673e97e9ad6a8c65d240405e8986363fada66392910160405180910390a250505b5050565b600054600160a81b900460ff16158080156106d057506000546001600160a01b90910460ff16105b806106f15750303b1580156106f15750600054600160a01b900460ff166001145b6107545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161011b565b6000805460ff60a01b1916600160a01b1790558015610781576000805460ff60a81b1916600160a81b1790555b6000546001600160a01b031633146107ab5760405162461bcd60e51b815260040161011b9061127e565b600354600160a01b900460ff16156107fb5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640161011b565b61080484610d60565b61080d82610d60565b61081683610d60565b60038054600180546001600160a01b038089166001600160a01b03199283161790925560028054888416921691909117905584166001600160a81b031990911617600160a01b1790556040517f143219c9e69b09e07e095fcc889b43d8f46ca892bba65f08dc3a0050869a56789061089e9086906001600160a01b0391909116815260200190565b60405180910390a16040516001600160a01b03831681527f78f058b189175430c48dc02699e3a0031ea4ff781536dc2fab847de4babdd8829060200160405180910390a16108ea6109f4565b8015610932576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001546001600160a01b031633148061095b57506002546001600160a01b031633145b6109775760405162461bcd60e51b815260040161011b90611233565b6001600160a01b03821660009081526005602052604090205461099a908261042a565b6001600160a01b03831660008181526005602090815260409182902084905581519283528201929092527f370d9e07625e8a37df7014d7f9d851cd11f721c9c435c51608a15cbd73f640bd91015b60405180910390a15050565b6000546001600160a01b03163314610a1e5760405162461bcd60e51b815260040161011b9061127e565b610a286000610e05565b565b6003546001600160a01b03163314610a545760405162461bcd60e51b815260040161011b906110b9565b6001600160a01b038216610aaa5760405162461bcd60e51b815260206004820152601d60248201527f4554482043616e6e6f742075736520746869732066756e6374696f6e73000000604482015260640161011b565b6001600160a01b038216600090815260046020526040902054610acd908261042a565b6001600160a01b03831660008181526004602090815260409182902084905581519283528201929092527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc6191016109e8565b6000546001600160a01b03163314610b495760405162461bcd60e51b815260040161011b9061127e565b6001600160a01b038116610bae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161011b565b610bb781610e05565b50565b6001546001600160a01b0316331480610bdd57506002546001600160a01b031633145b610bf95760405162461bcd60e51b815260040161011b90611233565b6001600160a01b03821660009081526005602052604090205461099a9082610cfd565b60006001600160a01b038316610c33575080610439565b81600003610c4357506000610439565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca791906112b3565b905060128160ff161015610cdd57610cd5610cc38260126112d6565b610cce90600a6113dd565b8490610e55565b915050610439565b610cd5610ceb6012836112d6565b610cf690600a6113dd565b8490610e61565b600061043682846113ec565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d5b908490610e6d565b505050565b6001600160a01b038116610db65760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f20616464726573730000604482015260640161011b565b803b806106a45760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f604482015260640161011b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006104368284611403565b60006104368284611425565b6000610ec2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f3f9092919063ffffffff16565b805190915015610d5b5780806020019051810190610ee09190611444565b610d5b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161011b565b6060610f4e8484600085610f58565b90505b9392505050565b606082471015610fb95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161011b565b843b6110075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161011b565b600080866001600160a01b031685876040516110239190611466565b60006040518083038185875af1925050503d8060008114611060576040519150601f19603f3d011682016040523d82523d6000602084013e611065565b606091505b5091509150611075828286611080565b979650505050505050565b6060831561108f575081610f51565b82511561109f5782518084602001fd5b8160405162461bcd60e51b815260040161011b91906111d2565b60208082526029908201527f44656661756c74506f6f6c3a2043616c6c6572206973206e6f7420746865204160408201526818dd1a5d99541bdbdb60ba1b606082015260800190565b80356001600160a01b038116811461111957600080fd5b919050565b6000806040838503121561113157600080fd5b61113a83611102565b946020939093013593505050565b60008060006060848603121561115d57600080fd5b61116684611102565b925061117460208501611102565b915061118260408501611102565b90509250925092565b60006020828403121561119d57600080fd5b61043682611102565b60005b838110156111c15781810151838201526020016111a9565b838111156109325750506000910152565b60208152600082518060208401526111f18160408501602087016111a6565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561122e5761122e611205565b500190565b6020808252602b908201527f44656661756c74506f6f6c3a2043616c6c6572206973206e6f7420746865205460408201526a3937bb32a6b0b730b3b2b960a91b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156112c557600080fd5b815160ff81168114610f5157600080fd5b600060ff821660ff8416808210156112f0576112f0611205565b90039392505050565b600181815b8085111561133457816000190482111561131a5761131a611205565b8085161561132757918102915b93841c93908002906112fe565b509250929050565b60008261134b57506001610439565b8161135857506000610439565b816001811461136e576002811461137857611394565b6001915050610439565b60ff84111561138957611389611205565b50506001821b610439565b5060208310610133831016604e8410600b84101617156113b7575081810a610439565b6113c183836112f9565b80600019048211156113d5576113d5611205565b029392505050565b600061043660ff84168361133c565b6000828210156113fe576113fe611205565b500390565b60008261142057634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561143f5761143f611205565b500290565b60006020828403121561145657600080fd5b81518015158114610f5157600080fd5b600082516114788184602087016111a6565b919091019291505056fea264697066735822122055903d1d78a55a6fe494ddab9508afe5fdaa4f21b8671bff5b1a7b5b72c465ee64736f6c634300080e0033

Deployed Bytecode

0x6080604052600436106100ec5760003560e01c806387c333811161008a578063d1234da711610059578063d1234da714610394578063eb16f004146103ca578063f2fde38b146103ea578063fb24e5f71461040a57600080fd5b806387c33381146102f25780638da5cb5b14610312578063a3f4df7e14610330578063b08bc7221461037457600080fd5b80635373433f116100c65780635373433f146102415780635a4d28bb146102855780636df996d0146102bd578063715018a6146102dd57600080fd5b806329fc67c8146101c9578063363bf964146101eb578063392e53cd1461020b57600080fd5b366101c4576003546001600160a01b031633146101245760405162461bcd60e51b815260040161011b906110b9565b60405180910390fd5b6000805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec54610159903461042a565b6000808052600460209081527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec83905560408051928352908201929092527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc61910160405180910390a1005b600080fd5b3480156101d557600080fd5b506101e96101e436600461111e565b61043f565b005b3480156101f757600080fd5b506101e9610206366004611148565b6106a8565b34801561021757600080fd5b5060035461022c90600160a01b900460ff1681565b60405190151581526020015b60405180910390f35b34801561024d57600080fd5b5061027761025c36600461118b565b6001600160a01b031660009081526004602052604090205490565b604051908152602001610238565b34801561029157600080fd5b506001546102a5906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102c957600080fd5b506101e96102d836600461111e565b610938565b3480156102e957600080fd5b506101e96109f4565b3480156102fe57600080fd5b506002546102a5906001600160a01b031681565b34801561031e57600080fd5b506000546001600160a01b03166102a5565b34801561033c57600080fd5b506103676040518060400160405280600b81526020016a111959985d5b1d141bdbdb60aa1b81525081565b60405161023891906111d2565b34801561038057600080fd5b506003546102a5906001600160a01b031681565b3480156103a057600080fd5b506102776103af36600461118b565b6001600160a01b031660009081526005602052604090205490565b3480156103d657600080fd5b506101e96103e536600461111e565b610a2a565b3480156103f657600080fd5b506101e961040536600461118b565b610b1f565b34801561041657600080fd5b506101e961042536600461111e565b610bba565b6000610436828461121b565b90505b92915050565b6001546001600160a01b031633148061046257506002546001600160a01b031633145b61047e5760405162461bcd60e51b815260040161011b90611233565b6003546001600160a01b031660006104968484610c1c565b9050806000036104a65750505050565b6001600160a01b0384166000908152600460205260409020546104c99084610cfd565b6001600160a01b03851660008181526004602052604090209190915515610565576104fe6001600160a01b0385168383610d09565b604051633ac5bc0160e21b81526001600160a01b0385811660048301526024820185905283169063eb16f00490604401600060405180830381600087803b15801561054857600080fd5b505af115801561055c573d6000803e3d6000fd5b5050505061060a565b6000826001600160a01b03168460405160006040518083038185875af1925050503d80600081146105b2576040519150601f19603f3d011682016040523d82523d6000602084013e6105b7565b606091505b50509050806106085760405162461bcd60e51b815260206004820152601f60248201527f44656661756c74506f6f6c3a2073656e64696e6720455448206661696c656400604482015260640161011b565b505b6001600160a01b038416600081815260046020908152604091829020548251938452908301527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc61910160405180910390a1604080516001600160a01b038481168252602082018490528616917ff89c3306c782ffbbe4593aa5673e97e9ad6a8c65d240405e8986363fada66392910160405180910390a250505b5050565b600054600160a81b900460ff16158080156106d057506000546001600160a01b90910460ff16105b806106f15750303b1580156106f15750600054600160a01b900460ff166001145b6107545760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161011b565b6000805460ff60a01b1916600160a01b1790558015610781576000805460ff60a81b1916600160a81b1790555b6000546001600160a01b031633146107ab5760405162461bcd60e51b815260040161011b9061127e565b600354600160a01b900460ff16156107fb5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015260640161011b565b61080484610d60565b61080d82610d60565b61081683610d60565b60038054600180546001600160a01b038089166001600160a01b03199283161790925560028054888416921691909117905584166001600160a81b031990911617600160a01b1790556040517f143219c9e69b09e07e095fcc889b43d8f46ca892bba65f08dc3a0050869a56789061089e9086906001600160a01b0391909116815260200190565b60405180910390a16040516001600160a01b03831681527f78f058b189175430c48dc02699e3a0031ea4ff781536dc2fab847de4babdd8829060200160405180910390a16108ea6109f4565b8015610932576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001546001600160a01b031633148061095b57506002546001600160a01b031633145b6109775760405162461bcd60e51b815260040161011b90611233565b6001600160a01b03821660009081526005602052604090205461099a908261042a565b6001600160a01b03831660008181526005602090815260409182902084905581519283528201929092527f370d9e07625e8a37df7014d7f9d851cd11f721c9c435c51608a15cbd73f640bd91015b60405180910390a15050565b6000546001600160a01b03163314610a1e5760405162461bcd60e51b815260040161011b9061127e565b610a286000610e05565b565b6003546001600160a01b03163314610a545760405162461bcd60e51b815260040161011b906110b9565b6001600160a01b038216610aaa5760405162461bcd60e51b815260206004820152601d60248201527f4554482043616e6e6f742075736520746869732066756e6374696f6e73000000604482015260640161011b565b6001600160a01b038216600090815260046020526040902054610acd908261042a565b6001600160a01b03831660008181526004602090815260409182902084905581519283528201929092527f4d42ce079a4e464782330acbd88d008e74e55501cf9d29de797fa46bac59bc6191016109e8565b6000546001600160a01b03163314610b495760405162461bcd60e51b815260040161011b9061127e565b6001600160a01b038116610bae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161011b565b610bb781610e05565b50565b6001546001600160a01b0316331480610bdd57506002546001600160a01b031633145b610bf95760405162461bcd60e51b815260040161011b90611233565b6001600160a01b03821660009081526005602052604090205461099a9082610cfd565b60006001600160a01b038316610c33575080610439565b81600003610c4357506000610439565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca791906112b3565b905060128160ff161015610cdd57610cd5610cc38260126112d6565b610cce90600a6113dd565b8490610e55565b915050610439565b610cd5610ceb6012836112d6565b610cf690600a6113dd565b8490610e61565b600061043682846113ec565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d5b908490610e6d565b505050565b6001600160a01b038116610db65760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f20616464726573730000604482015260640161011b565b803b806106a45760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f604482015260640161011b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006104368284611403565b60006104368284611425565b6000610ec2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f3f9092919063ffffffff16565b805190915015610d5b5780806020019051810190610ee09190611444565b610d5b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161011b565b6060610f4e8484600085610f58565b90505b9392505050565b606082471015610fb95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161011b565b843b6110075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161011b565b600080866001600160a01b031685876040516110239190611466565b60006040518083038185875af1925050503d8060008114611060576040519150601f19603f3d011682016040523d82523d6000602084013e611065565b606091505b5091509150611075828286611080565b979650505050505050565b6060831561108f575081610f51565b82511561109f5782518084602001fd5b8160405162461bcd60e51b815260040161011b91906111d2565b60208082526029908201527f44656661756c74506f6f6c3a2043616c6c6572206973206e6f7420746865204160408201526818dd1a5d99541bdbdb60ba1b606082015260800190565b80356001600160a01b038116811461111957600080fd5b919050565b6000806040838503121561113157600080fd5b61113a83611102565b946020939093013593505050565b60008060006060848603121561115d57600080fd5b61116684611102565b925061117460208501611102565b915061118260408501611102565b90509250925092565b60006020828403121561119d57600080fd5b61043682611102565b60005b838110156111c15781810151838201526020016111a9565b838111156109325750506000910152565b60208152600082518060208401526111f18160408501602087016111a6565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561122e5761122e611205565b500190565b6020808252602b908201527f44656661756c74506f6f6c3a2043616c6c6572206973206e6f7420746865205460408201526a3937bb32a6b0b730b3b2b960a91b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156112c557600080fd5b815160ff81168114610f5157600080fd5b600060ff821660ff8416808210156112f0576112f0611205565b90039392505050565b600181815b8085111561133457816000190482111561131a5761131a611205565b8085161561132757918102915b93841c93908002906112fe565b509250929050565b60008261134b57506001610439565b8161135857506000610439565b816001811461136e576002811461137857611394565b6001915050610439565b60ff84111561138957611389611205565b50506001821b610439565b5060208310610133831016604e8410600b84101617156113b7575081810a610439565b6113c183836112f9565b80600019048211156113d5576113d5611205565b029392505050565b600061043660ff84168361133c565b6000828210156113fe576113fe611205565b500390565b60008261142057634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561143f5761143f611205565b500290565b60006020828403121561145657600080fd5b81518015158114610f5157600080fd5b600082516114788184602087016111a6565b919091019291505056fea264697066735822122055903d1d78a55a6fe494ddab9508afe5fdaa4f21b8671bff5b1a7b5b72c465ee64736f6c634300080e0033

Block Transaction Difficulty 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
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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