ETH Price: $2,003.83 (-2.94%)

Contract

0x0fa46e8cBCEff8468DB2Ec2fD77731D8a11d3D86
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer Ownersh...156118322022-09-25 17:18:351279 days ago1664126315IN
0x0fa46e8c...8a11d3D86
0 ETH0.0007162725
Set Addresses156117282022-09-25 16:57:351279 days ago1664125055IN
0x0fa46e8c...8a11d3D86
0 ETH0.0021301620

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

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

Contract Source Code Verified (Exact Match)

Contract Name:
CommunityIssuance

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;

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

import "../Interfaces/IStabilityPoolManager.sol";
import "../Interfaces/ICommunityIssuance.sol";
import "../Dependencies/BaseMath.sol";
import "../Dependencies/DfrancMath.sol";
import "../Dependencies/CheckContract.sol";
import "../Dependencies/Initializable.sol";

contract CommunityIssuance is
	ICommunityIssuance,
	Ownable,
	CheckContract,
	BaseMath,
	Initializable
{
	using SafeMath for uint256;
	using SafeERC20 for IERC20;

	string public constant NAME = "CommunityIssuance";
	uint256 public constant DISTRIBUTION_DURATION = 7 days / 60;
	uint256 public constant SECONDS_IN_ONE_MINUTE = 60;

	IERC20 public monToken;
	IStabilityPoolManager public stabilityPoolManager;

	mapping(address => uint256) public totalMONIssued;
	mapping(address => uint256) public lastUpdateTime; // lastUpdateTime is in minutes
	mapping(address => uint256) public MONSupplyCaps;
	mapping(address => uint256) public monDistributionsByPool; // monDistributionsByPool is in minutes

	address public adminContract;

	bool public isInitialized;

	modifier activeStabilityPoolOnly(address _pool) {
		require(lastUpdateTime[_pool] != 0, "CommunityIssuance: Pool needs to be added first.");
		_;
	}

	modifier isController() {
		require(msg.sender == owner() || msg.sender == adminContract, "Invalid Permission");
		_;
	}

	modifier isStabilityPool(address _pool) {
		require(
			stabilityPoolManager.isStabilityPool(_pool),
			"CommunityIssuance: caller is not SP"
		);
		_;
	}

	modifier onlyStabilityPool() {
		require(
			stabilityPoolManager.isStabilityPool(msg.sender),
			"CommunityIssuance: caller is not SP"
		);
		_;
	}

	// --- Functions ---
	function setAddresses(
		address _monTokenAddress,
		address _stabilityPoolManagerAddress,
		address _adminContract
	) external override initializer {
		require(!isInitialized, "Already initialized");
		checkContract(_monTokenAddress);
		checkContract(_stabilityPoolManagerAddress);
		checkContract(_adminContract);
		isInitialized = true;

		adminContract = _adminContract;

		monToken = IERC20(_monTokenAddress);
		stabilityPoolManager = IStabilityPoolManager(_stabilityPoolManagerAddress);

		emit MONTokenAddressSet(_monTokenAddress);
		emit StabilityPoolAddressSet(_stabilityPoolManagerAddress);
	}

	function setAdminContract(address _admin) external onlyOwner {
		require(_admin != address(0), "Admin address is zero");
		checkContract(_admin);
		adminContract = _admin;
	}

	function addFundToStabilityPool(address _pool, uint256 _assignedSupply)
		external
		override
		isController
	{
		_addFundToStabilityPoolFrom(_pool, _assignedSupply, msg.sender);
	}

	function removeFundFromStabilityPool(address _pool, uint256 _fundToRemove)
		external
		onlyOwner
		activeStabilityPoolOnly(_pool)
	{
		uint256 newCap = MONSupplyCaps[_pool].sub(_fundToRemove);
		require(
			totalMONIssued[_pool] <= newCap,
			"CommunityIssuance: Stability Pool doesn't have enough supply."
		);

		MONSupplyCaps[_pool] -= _fundToRemove;

		if (totalMONIssued[_pool] == MONSupplyCaps[_pool]) {
			disableStabilityPool(_pool);
		}

		monToken.safeTransfer(msg.sender, _fundToRemove);
	}

	function addFundToStabilityPoolFrom(
		address _pool,
		uint256 _assignedSupply,
		address _spender
	) external override isController {
		_addFundToStabilityPoolFrom(_pool, _assignedSupply, _spender);
	}

	function _addFundToStabilityPoolFrom(
		address _pool,
		uint256 _assignedSupply,
		address _spender
	) internal {
		require(
			stabilityPoolManager.isStabilityPool(_pool),
			"CommunityIssuance: Invalid Stability Pool"
		);

		if (lastUpdateTime[_pool] == 0) {
			lastUpdateTime[_pool] = (block.timestamp / SECONDS_IN_ONE_MINUTE);
		}

		MONSupplyCaps[_pool] += _assignedSupply;
		monToken.safeTransferFrom(_spender, address(this), _assignedSupply);
	}

	function transferFundToAnotherStabilityPool(
		address _target,
		address _receiver,
		uint256 _quantity
	)
		external
		override
		onlyOwner
		activeStabilityPoolOnly(_target)
		activeStabilityPoolOnly(_receiver)
	{
		uint256 newCap = MONSupplyCaps[_target].sub(_quantity);
		require(
			totalMONIssued[_target] <= newCap,
			"CommunityIssuance: Stability Pool doesn't have enough supply."
		);

		MONSupplyCaps[_target] -= _quantity;
		MONSupplyCaps[_receiver] += _quantity;

		if (totalMONIssued[_target] == MONSupplyCaps[_target]) {
			disableStabilityPool(_target);
		}
	}

	function disableStabilityPool(address _pool) internal {
		lastUpdateTime[_pool] = 0;
		MONSupplyCaps[_pool] = 0;
		totalMONIssued[_pool] = 0;
	}

	function issueMON() external override onlyStabilityPool returns (uint256) {
		return _issueMON(msg.sender);
	}

	function _issueMON(address _pool) internal isStabilityPool(_pool) returns (uint256) {
		uint256 maxPoolSupply = MONSupplyCaps[_pool];

		if (totalMONIssued[_pool] >= maxPoolSupply) return 0;

		uint256 issuance = _getLastUpdateTokenDistribution(_pool);
		uint256 totalIssuance = issuance.add(totalMONIssued[_pool]);

		if (totalIssuance > maxPoolSupply) {
			issuance = maxPoolSupply.sub(totalMONIssued[_pool]);
			totalIssuance = maxPoolSupply;
		}

		lastUpdateTime[_pool] = (block.timestamp / SECONDS_IN_ONE_MINUTE);
		totalMONIssued[_pool] = totalIssuance;
		emit TotalMONIssuedUpdated(_pool, totalIssuance);

		return issuance;
	}

	function _getLastUpdateTokenDistribution(address stabilityPool)
		internal
		view
		returns (uint256)
	{
		require(lastUpdateTime[stabilityPool] != 0, "Stability pool hasn't been assigned");
		uint256 timePassed = block.timestamp.div(SECONDS_IN_ONE_MINUTE).sub(
			lastUpdateTime[stabilityPool]
		);
		uint256 totalDistributedSinceBeginning = monDistributionsByPool[stabilityPool].mul(
			timePassed
		);

		return totalDistributedSinceBeginning;
	}

	function sendMON(address _account, uint256 _MONamount) external override onlyStabilityPool {
		uint256 balanceMON = monToken.balanceOf(address(this));
		uint256 safeAmount = balanceMON >= _MONamount ? _MONamount : balanceMON;

		if (safeAmount == 0) {
			return;
		}

		monToken.safeTransfer(_account, safeAmount);
	}

	function setWeeklyDfrancDistribution(address _stabilityPool, uint256 _weeklyReward)
		external
		isController
		isStabilityPool(_stabilityPool)
	{
		monDistributionsByPool[_stabilityPool] = _weeklyReward.div(DISTRIBUTION_DURATION);
	}
}

// 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;
        }
    }
}

// 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");
        }
    }
}

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

pragma solidity ^0.8.14;

import "./IStabilityPool.sol";

interface IStabilityPoolManager {
	event StabilityPoolAdded(address asset, address stabilityPool);
	event StabilityPoolRemoved(address asset, address stabilityPool);

	function isStabilityPool(address stabilityPool) external view returns (bool);

	function addStabilityPool(address asset, address stabilityPool) external;

	function getAssetStabilityPool(address asset) external view returns (IStabilityPool);

	function unsafeGetAssetStabilityPool(address asset) external view returns (address);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;

interface ICommunityIssuance {
	// --- Events ---

	event MONTokenAddressSet(address _MONTokenAddress);
	event StabilityPoolAddressSet(address _stabilityPoolAddress);
	event TotalMONIssuedUpdated(address indexed stabilityPool, uint256 _totalMONIssued);

	// --- Functions ---

	function setAddresses(
		address _MONTokenAddress,
		address _stabilityPoolAddress,
		address _adminContract
	) external;

	function issueMON() external returns (uint256);

	function sendMON(address _account, uint256 _MONamount) external;

	function addFundToStabilityPool(address _pool, uint256 _assignedSupply) external;

	function addFundToStabilityPoolFrom(
		address _pool,
		uint256 _assignedSupply,
		address _spender
	) external;

	function transferFundToAnotherStabilityPool(
		address _target,
		address _receiver,
		uint256 _quantity
	) external;

	function setWeeklyDfrancDistribution(address _stabilityPool, uint256 _weeklyReward) external;
}

File 7 of 15 : BaseMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;

abstract contract BaseMath {
	uint256 public constant DECIMAL_PRECISION = 1 ether;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

library DfrancMath {
	using SafeMath for uint256;

	uint256 internal constant DECIMAL_PRECISION = 1 ether;

	/* Precision for Nominal ICR (independent of price). Rationale for the value:
	 *
	 * - Making it “too high” could lead to overflows.
	 * - Making it “too low” could lead to an ICR equal to zero, due to truncation from Solidity floor division.
	 *
	 * This value of 1e20 is chosen for safety: the NICR will only overflow for numerator > ~1e39 ETH,
	 * and will only truncate to 0 if the denominator is at least 1e20 times greater than the numerator.
	 *
	 */
	uint256 internal constant NICR_PRECISION = 1e20;

	function _min(uint256 _a, uint256 _b) internal pure returns (uint256) {
		return (_a < _b) ? _a : _b;
	}

	function _max(uint256 _a, uint256 _b) internal pure returns (uint256) {
		return (_a >= _b) ? _a : _b;
	}

	/*
	 * Multiply two decimal numbers and use normal rounding rules:
	 * -round product up if 19'th mantissa digit >= 5
	 * -round product down if 19'th mantissa digit < 5
	 *
	 * Used only inside the exponentiation, _decPow().
	 */
	function decMul(uint256 x, uint256 y) internal pure returns (uint256 decProd) {
		uint256 prod_xy = x.mul(y);

		decProd = prod_xy.add(DECIMAL_PRECISION / 2).div(DECIMAL_PRECISION);
	}

	/*
	 * _decPow: Exponentiation function for 18-digit decimal base, and integer exponent n.
	 *
	 * Uses the efficient "exponentiation by squaring" algorithm. O(log(n)) complexity.
	 *
	 * Called by two functions that represent time in units of minutes:
	 * 1) TroveManager._calcDecayedBaseRate
	 * 2) CommunityIssuance._getCumulativeIssuanceFraction
	 *
	 * The exponent is capped to avoid reverting due to overflow. The cap 525600000 equals
	 * "minutes in 1000 years": 60 * 24 * 365 * 1000
	 *
	 * If a period of > 1000 years is ever used as an exponent in either of the above functions, the result will be
	 * negligibly different from just passing the cap, since:
	 *
	 * In function 1), the decayed base rate will be 0 for 1000 years or > 1000 years
	 * In function 2), the difference in tokens issued at 1000 years and any time > 1000 years, will be negligible
	 */
	function _decPow(uint256 _base, uint256 _minutes) internal pure returns (uint256) {
		if (_minutes > 525600000) {
			_minutes = 525600000;
		} // cap to avoid overflow

		if (_minutes == 0) {
			return DECIMAL_PRECISION;
		}

		uint256 y = DECIMAL_PRECISION;
		uint256 x = _base;
		uint256 n = _minutes;

		// Exponentiation-by-squaring
		while (n > 1) {
			if (n % 2 == 0) {
				x = decMul(x, x);
				n = n.div(2);
			} else {
				// if (n % 2 != 0)
				y = decMul(x, y);
				x = decMul(x, x);
				n = (n.sub(1)).div(2);
			}
		}

		return decMul(x, y);
	}

	function _getAbsoluteDifference(uint256 _a, uint256 _b) internal pure returns (uint256) {
		return (_a >= _b) ? _a.sub(_b) : _b.sub(_a);
	}

	function _computeNominalCR(uint256 _coll, uint256 _debt) internal pure returns (uint256) {
		if (_debt > 0) {
			return _coll.mul(NICR_PRECISION).div(_debt);
		}
		// Return the maximal value for uint256 if the Trove has a debt of 0. Represents "infinite" CR.
		else {
			// if (_debt == 0)
			return 2**256 - 1;
		}
	}

	function _computeCR(
		uint256 _coll,
		uint256 _debt,
		uint256 _price
	) internal pure returns (uint256) {
		if (_debt > 0) {

			return _coll.mul(_price).div(_debt);
		}
		// Return the maximal value for uint256 if the Trove has a debt of 0. Represents "infinite" CR.
		else {
			// if (_debt == 0)
			return type(uint256).max;
		}
	}
}

// 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");
	}
}

// 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;
    }
}

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

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

// 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;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.14;

import "./IDeposit.sol";

interface IStabilityPool is IDeposit {
	// --- Events ---
	event StabilityPoolAssetBalanceUpdated(uint256 _newBalance);
	event StabilityPoolDCHFBalanceUpdated(uint256 _newBalance);

	event BorrowerOperationsAddressChanged(address _newBorrowerOperationsAddress);
	event TroveManagerAddressChanged(address _newTroveManagerAddress);
	event DefaultPoolAddressChanged(address _newDefaultPoolAddress);
	event DCHFTokenAddressChanged(address _newDCHFTokenAddress);
	event SortedTrovesAddressChanged(address _newSortedTrovesAddress);
	event CommunityIssuanceAddressChanged(address _newCommunityIssuanceAddress);

	event P_Updated(uint256 _P);
	event S_Updated(uint256 _S, uint128 _epoch, uint128 _scale);
	event G_Updated(uint256 _G, uint128 _epoch, uint128 _scale);
	event EpochUpdated(uint128 _currentEpoch);
	event ScaleUpdated(uint128 _currentScale);

	event DepositSnapshotUpdated(address indexed _depositor, uint256 _P, uint256 _S, uint256 _G);
	event SystemSnapshotUpdated(uint256 _P, uint256 _G);
	event UserDepositChanged(address indexed _depositor, uint256 _newDeposit);
	event StakeChanged(uint256 _newSystemStake, address _depositor);

	event AssetGainWithdrawn(address indexed _depositor, uint256 _Asset, uint256 _DCHFLoss);
	event MONPaidToDepositor(address indexed _depositor, uint256 _MON);
	event AssetSent(address _to, uint256 _amount);

	// --- Functions ---

	function NAME() external view returns (string memory name);

	/*
	 * Called only once on init, to set addresses of other Dfranc contracts
	 * Callable only by owner, renounces ownership at the end
	 */
	function setAddresses(
		address _assetAddress,
		address _borrowerOperationsAddress,
		address _troveManagerAddress,
		address _troveManagerHelperAddress,
		address _dchfTokenAddress,
		address _sortedTrovesAddress,
		address _communityIssuanceAddress,
		address _dfrancParamsAddress
	) external;

	/*
	 * Initial checks:
	 * - Frontend is registered or zero address
	 * - Sender is not a registered frontend
	 * - _amount is not zero
	 * ---
	 * - Triggers a MON issuance, based on time passed since the last issuance. The MON issuance is shared between *all* depositors and front ends
	 * - Tags the deposit with the provided front end tag param, if it's a new deposit
	 * - Sends depositor's accumulated gains (MON, ETH) to depositor
	 * - Sends the tagged front end's accumulated MON gains to the tagged front end
	 * - Increases deposit and tagged front end's stake, and takes new snapshots for each.
	 */
	function provideToSP(uint256 _amount) external;

	/*
	 * Initial checks:
	 * - _amount is zero or there are no under collateralized troves left in the system
	 * - User has a non zero deposit
	 * ---
	 * - Triggers a MON issuance, based on time passed since the last issuance. The MON issuance is shared between *all* depositors and front ends
	 * - Removes the deposit's front end tag if it is a full withdrawal
	 * - Sends all depositor's accumulated gains (MON, ETH) to depositor
	 * - Sends the tagged front end's accumulated MON gains to the tagged front end
	 * - Decreases deposit and tagged front end's stake, and takes new snapshots for each.
	 *
	 * If _amount > userDeposit, the user withdraws all of their compounded deposit.
	 */
	function withdrawFromSP(uint256 _amount) external;

	/*
	 * Initial checks:
	 * - User has a non zero deposit
	 * - User has an open trove
	 * - User has some ETH gain
	 * ---
	 * - Triggers a MON issuance, based on time passed since the last issuance. The MON issuance is shared between *all* depositors and front ends
	 * - Sends all depositor's MON gain to  depositor
	 * - Sends all tagged front end's MON gain to the tagged front end
	 * - Transfers the depositor's entire ETH gain from the Stability Pool to the caller's trove
	 * - Leaves their compounded deposit in the Stability Pool
	 * - Updates snapshots for deposit and tagged front end stake
	 */
	function withdrawAssetGainToTrove(address _upperHint, address _lowerHint) external;

	/*
	 * Initial checks:
	 * - Caller is TroveManager
	 * ---
	 * Cancels out the specified debt against the DCHF contained in the Stability Pool (as far as possible)
	 * and transfers the Trove's ETH collateral from ActivePool to StabilityPool.
	 * Only called by liquidation functions in the TroveManager.
	 */
	function offset(uint256 _debt, uint256 _coll) external;

	/*
	 * Returns the total amount of ETH held by the pool, accounted in an internal variable instead of `balance`,
	 * to exclude edge cases like ETH received from a self-destruct.
	 */
	function getAssetBalance() external view returns (uint256);

	/*
	 * Returns DCHF held in the pool. Changes when users deposit/withdraw, and when Trove debt is offset.
	 */
	function getTotalDCHFDeposits() external view returns (uint256);

	/*
	 * Calculates the ETH gain earned by the deposit since its last snapshots were taken.
	 */
	function getDepositorAssetGain(address _depositor) external view returns (uint256);

	/*
	 * Calculate the MON gain earned by a deposit since its last snapshots were taken.
	 * If not tagged with a front end, the depositor gets a 100% cut of what their deposit earned.
	 * Otherwise, their cut of the deposit's earnings is equal to the kickbackRate, set by the front end through
	 * which they made their deposit.
	 */
	function getDepositorMONGain(address _depositor) external view returns (uint256);

	/*
	 * Return the user's compounded deposit.
	 */
	function getCompoundedDCHFDeposit(address _depositor) external view returns (uint256);

	/*
	 * Return the front end's compounded stake.
	 *
	 * The front end's compounded stake is equal to the sum of its depositors' compounded deposits.
	 */
	function getCompoundedTotalStake() external view returns (uint256);

	function getNameBytes() external view returns (bytes32);

	function getAssetType() external view returns (address);

	/*
	 * Fallback function
	 * Only callable by Active Pool, it just accounts for ETH received
	 * receive() external payable;
	 */
}

pragma solidity ^0.8.14;

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

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

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_MONTokenAddress","type":"address"}],"name":"MONTokenAddressSet","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":"_stabilityPoolAddress","type":"address"}],"name":"StabilityPoolAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stabilityPool","type":"address"},{"indexed":false,"internalType":"uint256","name":"_totalMONIssued","type":"uint256"}],"name":"TotalMONIssuedUpdated","type":"event"},{"inputs":[],"name":"DECIMAL_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DISTRIBUTION_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"MONSupplyCaps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SECONDS_IN_ONE_MINUTE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"_assignedSupply","type":"uint256"}],"name":"addFundToStabilityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"_assignedSupply","type":"uint256"},{"internalType":"address","name":"_spender","type":"address"}],"name":"addFundToStabilityPoolFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"issueMON","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"monDistributionsByPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"monToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"_fundToRemove","type":"uint256"}],"name":"removeFundFromStabilityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_MONamount","type":"uint256"}],"name":"sendMON","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_monTokenAddress","type":"address"},{"internalType":"address","name":"_stabilityPoolManagerAddress","type":"address"},{"internalType":"address","name":"_adminContract","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdminContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stabilityPool","type":"address"},{"internalType":"uint256","name":"_weeklyReward","type":"uint256"}],"name":"setWeeklyDfrancDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stabilityPoolManager","outputs":[{"internalType":"contract IStabilityPoolManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalMONIssued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"transferFundToAnotherStabilityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6119178061007e6000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80636a834215116100c3578063a20baee61161007c578063a20baee6146102f8578063a3f4df7e14610307578063b3e4043514610344578063c05c5e9414610357578063f2fde38b1461036a578063fd0da5c21461037d57600080fd5b80636a83421514610279578063715018a61461028c5780637e8a69c4146102945780638da5cb5b146102b45780638e6b51ca146102c55780639f4264d1146102e557600080fd5b8063440cc8d111610115578063440cc8d11461021057806349f3fcf5146102235780635a1a429b1461022b57806361ec893d1461024b57806363a812f91461025357806363eb9f901461026657600080fd5b806317766e181461015d57806328f7fdcf146101725780632ce9aead1461018e5780632f2b4e90146101ae578063363bf964146101d9578063392e53cd146101ec575b600080fd5b61017061016b36600461155d565b610390565b005b61017b61276081565b6040519081526020015b60405180910390f35b61017b61019c366004611599565b60046020526000908152604090205481565b6002546101c1906001600160a01b031681565b6040516001600160a01b039091168152602001610185565b6101706101e73660046115b4565b6103e8565b60075461020090600160a01b900460ff1681565b6040519015158152602001610185565b61017061021e3660046115ee565b61063b565b61017b610689565b61017b610239366004611599565b60056020526000908152604090205481565b61017b603c81565b610170610261366004611599565b610720565b6001546101c1906001600160a01b031681565b6101706102873660046115ee565b6107c3565b6101706108f3565b61017b6102a2366004611599565b60066020526000908152604090205481565b6000546001600160a01b03166101c1565b61017b6102d3366004611599565b60036020526000908152604090205481565b6101706102f33660046115ee565b610929565b61017b670de0b6b3a764000081565b61033760405180604001604052806011815260200170436f6d6d756e69747949737375616e636560781b81525081565b6040516101859190611644565b610170610352366004611677565b610a8c565b6007546101c1906001600160a01b031681565b610170610378366004611599565b610c45565b61017061038b3660046115ee565b610ce0565b6000546001600160a01b03163314806103b357506007546001600160a01b031633145b6103d85760405162461bcd60e51b81526004016103cf906116b3565b60405180910390fd5b6103e3838383610dd6565b505050565b600054600160a81b900460ff161580801561041057506000546001600160a01b90910460ff16105b806104315750303b1580156104315750600054600160a01b900460ff166001145b6104945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103cf565b6000805460ff60a01b1916600160a01b17905580156104c1576000805460ff60a81b1916600160a81b1790555b600754600160a01b900460ff16156105115760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016103cf565b61051a84610f2b565b61052383610f2b565b61052c82610f2b565b600780546001600160a01b038481166001600160a81b031990921691909117600160a01b17909155600180548683166001600160a01b031991821681179092556002805493871693909116929092179091556040519081527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b9060200160405180910390a16040516001600160a01b03841681527f45c53611bc8ba9e11f4f8173bda9e3faf89c395ddb83f9a55230b156828db3159060200160405180910390a18015610635576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000546001600160a01b031633148061065e57506007546001600160a01b031633145b61067a5760405162461bcd60e51b81526004016103cf906116b3565b610685828233610dd6565b5050565b600254604051633c5f6d8f60e21b81523360048201526000916001600160a01b03169063f17db63c90602401602060405180830381865afa1580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f691906116df565b6107125760405162461bcd60e51b81526004016103cf90611701565b61071b33610fd0565b905090565b6000546001600160a01b0316331461074a5760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b0381166107985760405162461bcd60e51b815260206004820152601560248201527441646d696e2061646472657373206973207a65726f60581b60448201526064016103cf565b6107a181610f2b565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051633c5f6d8f60e21b81523360048201526001600160a01b039091169063f17db63c90602401602060405180830381865afa15801561080b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082f91906116df565b61084b5760405162461bcd60e51b81526004016103cf90611701565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b89190611779565b90506000828210156108ca57816108cc565b825b9050806000036108dc5750505050565b600154610635906001600160a01b03168583611172565b6000546001600160a01b0316331461091d5760405162461bcd60e51b81526004016103cf90611744565b61092760006111d5565b565b6000546001600160a01b031633146109535760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b03821660009081526004602052604081205483910361098b5760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b0383166000908152600560205260408120546109ae9084611225565b6001600160a01b0385166000908152600360205260409020549091508110156109e95760405162461bcd60e51b81526004016103cf906117e2565b6001600160a01b03841660009081526005602052604081208054859290610a11908490611855565b90915550506001600160a01b03841660009081526005602090815260408083205460039092529091205403610a7557610a75846001600160a01b03166000908152600460209081526040808320839055600582528083208390556003909152812055565b600154610635906001600160a01b03163385611172565b6000546001600160a01b03163314610ab65760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b038316600090815260046020526040812054849103610aee5760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b038316600090815260046020526040812054849103610b265760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b038516600090815260056020526040812054610b499085611225565b6001600160a01b038716600090815260036020526040902054909150811015610b845760405162461bcd60e51b81526004016103cf906117e2565b6001600160a01b03861660009081526005602052604081208054869290610bac908490611855565b90915550506001600160a01b03851660009081526005602052604081208054869290610bd990849061186c565b90915550506001600160a01b03861660009081526005602090815260408083205460039092529091205403610c3d57610c3d866001600160a01b03166000908152600460209081526040808320839055600582528083208390556003909152812055565b505050505050565b6000546001600160a01b03163314610c6f5760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b038116610cd45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103cf565b610cdd816111d5565b50565b6000546001600160a01b0316331480610d0357506007546001600160a01b031633145b610d1f5760405162461bcd60e51b81526004016103cf906116b3565b600254604051633c5f6d8f60e21b81526001600160a01b0380851660048301528492169063f17db63c90602401602060405180830381865afa158015610d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8d91906116df565b610da95760405162461bcd60e51b81526004016103cf90611701565b610db582612760611238565b6001600160a01b039093166000908152600660205260409020929092555050565b600254604051633c5f6d8f60e21b81526001600160a01b0385811660048301529091169063f17db63c90602401602060405180830381865afa158015610e20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4491906116df565b610ea25760405162461bcd60e51b815260206004820152602960248201527f436f6d6d756e69747949737375616e63653a20496e76616c69642053746162696044820152681b1a5d1e48141bdbdb60ba1b60648201526084016103cf565b6001600160a01b0383166000908152600460205260408120549003610ee657610ecc603c42611884565b6001600160a01b0384166000908152600460205260409020555b6001600160a01b03831660009081526005602052604081208054849290610f0e90849061186c565b90915550506001546103e3906001600160a01b0316823085611244565b6001600160a01b038116610f815760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f2061646472657373000060448201526064016103cf565b803b806106855760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f60448201526064016103cf565b600254604051633c5f6d8f60e21b81526001600160a01b038084166004830152600092849291169063f17db63c90602401602060405180830381865afa15801561101e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104291906116df565b61105e5760405162461bcd60e51b81526004016103cf90611701565b6001600160a01b038316600090815260056020908152604080832054600390925290912054811161109357600092505061116c565b600061109e8561127c565b6001600160a01b038616600090815260036020526040812054919250906110c690839061134c565b9050828111156110fa576001600160a01b0386166000908152600360205260409020546110f4908490611225565b91508290505b611105603c42611884565b6001600160a01b0387166000818152600460209081526040808320949094556003905282902083905590517f417221cc4bcedf9d4b7afc59ff48e8f56bca0f3b2c43a4cef2cc207e5c55d3249061115f9084815260200190565b60405180910390a2509250505b50919050565b6040516001600160a01b0383166024820152604481018290526103e390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611358565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006112318284611855565b9392505050565b60006112318284611884565b6040516001600160a01b03808516602483015283166044820152606481018290526106359085906323b872dd60e01b9060840161119e565b6001600160a01b03811660009081526004602052604081205481036112ef5760405162461bcd60e51b815260206004820152602360248201527f53746162696c69747920706f6f6c206861736e2774206265656e2061737369676044820152621b995960ea1b60648201526084016103cf565b6001600160a01b03821660009081526004602052604081205461131d9061131742603c611238565b90611225565b6001600160a01b03841660009081526006602052604081205491925090611344908361142a565b949350505050565b6000611231828461186c565b60006113ad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114369092919063ffffffff16565b8051909150156103e357808060200190518101906113cb91906116df565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103cf565b600061123182846118a6565b6060611344848460008585843b61148f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103cf565b600080866001600160a01b031685876040516114ab91906118c5565b60006040518083038185875af1925050503d80600081146114e8576040519150601f19603f3d011682016040523d82523d6000602084013e6114ed565b606091505b50915091506114fd828286611508565b979650505050505050565b60608315611517575081611231565b8251156115275782518084602001fd5b8160405162461bcd60e51b81526004016103cf9190611644565b80356001600160a01b038116811461155857600080fd5b919050565b60008060006060848603121561157257600080fd5b61157b84611541565b92506020840135915061159060408501611541565b90509250925092565b6000602082840312156115ab57600080fd5b61123182611541565b6000806000606084860312156115c957600080fd5b6115d284611541565b92506115e060208501611541565b915061159060408501611541565b6000806040838503121561160157600080fd5b61160a83611541565b946020939093013593505050565b60005b8381101561163357818101518382015260200161161b565b838111156106355750506000910152565b6020815260008251806020840152611663816040850160208701611618565b601f01601f19169190910160400192915050565b60008060006060848603121561168c57600080fd5b61169584611541565b92506116a360208501611541565b9150604084013590509250925092565b60208082526012908201527124b73b30b634b2102832b936b4b9b9b4b7b760711b604082015260600190565b6000602082840312156116f157600080fd5b8151801515811461123157600080fd5b60208082526023908201527f436f6d6d756e69747949737375616e63653a2063616c6c6572206973206e6f7460408201526202053560ec1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561178b57600080fd5b5051919050565b60208082526030908201527f436f6d6d756e69747949737375616e63653a20506f6f6c206e6565647320746f60408201526f1031329030b23232b2103334b939ba1760811b606082015260800190565b6020808252603d908201527f436f6d6d756e69747949737375616e63653a2053746162696c69747920506f6f60408201527f6c20646f65736e2774206861766520656e6f75676820737570706c792e000000606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156118675761186761183f565b500390565b6000821982111561187f5761187f61183f565b500190565b6000826118a157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118c0576118c061183f565b500290565b600082516118d7818460208701611618565b919091019291505056fea2646970667358221220591126c31f3ad159bcb90d4a8e35fd0eddaa195b6584b1a7fba018f8711c3bb364736f6c634300080e0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101585760003560e01c80636a834215116100c3578063a20baee61161007c578063a20baee6146102f8578063a3f4df7e14610307578063b3e4043514610344578063c05c5e9414610357578063f2fde38b1461036a578063fd0da5c21461037d57600080fd5b80636a83421514610279578063715018a61461028c5780637e8a69c4146102945780638da5cb5b146102b45780638e6b51ca146102c55780639f4264d1146102e557600080fd5b8063440cc8d111610115578063440cc8d11461021057806349f3fcf5146102235780635a1a429b1461022b57806361ec893d1461024b57806363a812f91461025357806363eb9f901461026657600080fd5b806317766e181461015d57806328f7fdcf146101725780632ce9aead1461018e5780632f2b4e90146101ae578063363bf964146101d9578063392e53cd146101ec575b600080fd5b61017061016b36600461155d565b610390565b005b61017b61276081565b6040519081526020015b60405180910390f35b61017b61019c366004611599565b60046020526000908152604090205481565b6002546101c1906001600160a01b031681565b6040516001600160a01b039091168152602001610185565b6101706101e73660046115b4565b6103e8565b60075461020090600160a01b900460ff1681565b6040519015158152602001610185565b61017061021e3660046115ee565b61063b565b61017b610689565b61017b610239366004611599565b60056020526000908152604090205481565b61017b603c81565b610170610261366004611599565b610720565b6001546101c1906001600160a01b031681565b6101706102873660046115ee565b6107c3565b6101706108f3565b61017b6102a2366004611599565b60066020526000908152604090205481565b6000546001600160a01b03166101c1565b61017b6102d3366004611599565b60036020526000908152604090205481565b6101706102f33660046115ee565b610929565b61017b670de0b6b3a764000081565b61033760405180604001604052806011815260200170436f6d6d756e69747949737375616e636560781b81525081565b6040516101859190611644565b610170610352366004611677565b610a8c565b6007546101c1906001600160a01b031681565b610170610378366004611599565b610c45565b61017061038b3660046115ee565b610ce0565b6000546001600160a01b03163314806103b357506007546001600160a01b031633145b6103d85760405162461bcd60e51b81526004016103cf906116b3565b60405180910390fd5b6103e3838383610dd6565b505050565b600054600160a81b900460ff161580801561041057506000546001600160a01b90910460ff16105b806104315750303b1580156104315750600054600160a01b900460ff166001145b6104945760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103cf565b6000805460ff60a01b1916600160a01b17905580156104c1576000805460ff60a81b1916600160a81b1790555b600754600160a01b900460ff16156105115760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b60448201526064016103cf565b61051a84610f2b565b61052383610f2b565b61052c82610f2b565b600780546001600160a01b038481166001600160a81b031990921691909117600160a01b17909155600180548683166001600160a01b031991821681179092556002805493871693909116929092179091556040519081527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b9060200160405180910390a16040516001600160a01b03841681527f45c53611bc8ba9e11f4f8173bda9e3faf89c395ddb83f9a55230b156828db3159060200160405180910390a18015610635576000805460ff60a81b19169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6000546001600160a01b031633148061065e57506007546001600160a01b031633145b61067a5760405162461bcd60e51b81526004016103cf906116b3565b610685828233610dd6565b5050565b600254604051633c5f6d8f60e21b81523360048201526000916001600160a01b03169063f17db63c90602401602060405180830381865afa1580156106d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f691906116df565b6107125760405162461bcd60e51b81526004016103cf90611701565b61071b33610fd0565b905090565b6000546001600160a01b0316331461074a5760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b0381166107985760405162461bcd60e51b815260206004820152601560248201527441646d696e2061646472657373206973207a65726f60581b60448201526064016103cf565b6107a181610f2b565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600254604051633c5f6d8f60e21b81523360048201526001600160a01b039091169063f17db63c90602401602060405180830381865afa15801561080b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082f91906116df565b61084b5760405162461bcd60e51b81526004016103cf90611701565b6001546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b89190611779565b90506000828210156108ca57816108cc565b825b9050806000036108dc5750505050565b600154610635906001600160a01b03168583611172565b6000546001600160a01b0316331461091d5760405162461bcd60e51b81526004016103cf90611744565b61092760006111d5565b565b6000546001600160a01b031633146109535760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b03821660009081526004602052604081205483910361098b5760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b0383166000908152600560205260408120546109ae9084611225565b6001600160a01b0385166000908152600360205260409020549091508110156109e95760405162461bcd60e51b81526004016103cf906117e2565b6001600160a01b03841660009081526005602052604081208054859290610a11908490611855565b90915550506001600160a01b03841660009081526005602090815260408083205460039092529091205403610a7557610a75846001600160a01b03166000908152600460209081526040808320839055600582528083208390556003909152812055565b600154610635906001600160a01b03163385611172565b6000546001600160a01b03163314610ab65760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b038316600090815260046020526040812054849103610aee5760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b038316600090815260046020526040812054849103610b265760405162461bcd60e51b81526004016103cf90611792565b6001600160a01b038516600090815260056020526040812054610b499085611225565b6001600160a01b038716600090815260036020526040902054909150811015610b845760405162461bcd60e51b81526004016103cf906117e2565b6001600160a01b03861660009081526005602052604081208054869290610bac908490611855565b90915550506001600160a01b03851660009081526005602052604081208054869290610bd990849061186c565b90915550506001600160a01b03861660009081526005602090815260408083205460039092529091205403610c3d57610c3d866001600160a01b03166000908152600460209081526040808320839055600582528083208390556003909152812055565b505050505050565b6000546001600160a01b03163314610c6f5760405162461bcd60e51b81526004016103cf90611744565b6001600160a01b038116610cd45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103cf565b610cdd816111d5565b50565b6000546001600160a01b0316331480610d0357506007546001600160a01b031633145b610d1f5760405162461bcd60e51b81526004016103cf906116b3565b600254604051633c5f6d8f60e21b81526001600160a01b0380851660048301528492169063f17db63c90602401602060405180830381865afa158015610d69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8d91906116df565b610da95760405162461bcd60e51b81526004016103cf90611701565b610db582612760611238565b6001600160a01b039093166000908152600660205260409020929092555050565b600254604051633c5f6d8f60e21b81526001600160a01b0385811660048301529091169063f17db63c90602401602060405180830381865afa158015610e20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4491906116df565b610ea25760405162461bcd60e51b815260206004820152602960248201527f436f6d6d756e69747949737375616e63653a20496e76616c69642053746162696044820152681b1a5d1e48141bdbdb60ba1b60648201526084016103cf565b6001600160a01b0383166000908152600460205260408120549003610ee657610ecc603c42611884565b6001600160a01b0384166000908152600460205260409020555b6001600160a01b03831660009081526005602052604081208054849290610f0e90849061186c565b90915550506001546103e3906001600160a01b0316823085611244565b6001600160a01b038116610f815760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f2061646472657373000060448201526064016103cf565b803b806106855760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f60448201526064016103cf565b600254604051633c5f6d8f60e21b81526001600160a01b038084166004830152600092849291169063f17db63c90602401602060405180830381865afa15801561101e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104291906116df565b61105e5760405162461bcd60e51b81526004016103cf90611701565b6001600160a01b038316600090815260056020908152604080832054600390925290912054811161109357600092505061116c565b600061109e8561127c565b6001600160a01b038616600090815260036020526040812054919250906110c690839061134c565b9050828111156110fa576001600160a01b0386166000908152600360205260409020546110f4908490611225565b91508290505b611105603c42611884565b6001600160a01b0387166000818152600460209081526040808320949094556003905282902083905590517f417221cc4bcedf9d4b7afc59ff48e8f56bca0f3b2c43a4cef2cc207e5c55d3249061115f9084815260200190565b60405180910390a2509250505b50919050565b6040516001600160a01b0383166024820152604481018290526103e390849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611358565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006112318284611855565b9392505050565b60006112318284611884565b6040516001600160a01b03808516602483015283166044820152606481018290526106359085906323b872dd60e01b9060840161119e565b6001600160a01b03811660009081526004602052604081205481036112ef5760405162461bcd60e51b815260206004820152602360248201527f53746162696c69747920706f6f6c206861736e2774206265656e2061737369676044820152621b995960ea1b60648201526084016103cf565b6001600160a01b03821660009081526004602052604081205461131d9061131742603c611238565b90611225565b6001600160a01b03841660009081526006602052604081205491925090611344908361142a565b949350505050565b6000611231828461186c565b60006113ad826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114369092919063ffffffff16565b8051909150156103e357808060200190518101906113cb91906116df565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103cf565b600061123182846118a6565b6060611344848460008585843b61148f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103cf565b600080866001600160a01b031685876040516114ab91906118c5565b60006040518083038185875af1925050503d80600081146114e8576040519150601f19603f3d011682016040523d82523d6000602084013e6114ed565b606091505b50915091506114fd828286611508565b979650505050505050565b60608315611517575081611231565b8251156115275782518084602001fd5b8160405162461bcd60e51b81526004016103cf9190611644565b80356001600160a01b038116811461155857600080fd5b919050565b60008060006060848603121561157257600080fd5b61157b84611541565b92506020840135915061159060408501611541565b90509250925092565b6000602082840312156115ab57600080fd5b61123182611541565b6000806000606084860312156115c957600080fd5b6115d284611541565b92506115e060208501611541565b915061159060408501611541565b6000806040838503121561160157600080fd5b61160a83611541565b946020939093013593505050565b60005b8381101561163357818101518382015260200161161b565b838111156106355750506000910152565b6020815260008251806020840152611663816040850160208701611618565b601f01601f19169190910160400192915050565b60008060006060848603121561168c57600080fd5b61169584611541565b92506116a360208501611541565b9150604084013590509250925092565b60208082526012908201527124b73b30b634b2102832b936b4b9b9b4b7b760711b604082015260600190565b6000602082840312156116f157600080fd5b8151801515811461123157600080fd5b60208082526023908201527f436f6d6d756e69747949737375616e63653a2063616c6c6572206973206e6f7460408201526202053560ec1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561178b57600080fd5b5051919050565b60208082526030908201527f436f6d6d756e69747949737375616e63653a20506f6f6c206e6565647320746f60408201526f1031329030b23232b2103334b939ba1760811b606082015260800190565b6020808252603d908201527f436f6d6d756e69747949737375616e63653a2053746162696c69747920506f6f60408201527f6c20646f65736e2774206861766520656e6f75676820737570706c792e000000606082015260800190565b634e487b7160e01b600052601160045260246000fd5b6000828210156118675761186761183f565b500390565b6000821982111561187f5761187f61183f565b500190565b6000826118a157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118c0576118c061183f565b500290565b600082516118d7818460208701611618565b919091019291505056fea2646970667358221220591126c31f3ad159bcb90d4a8e35fd0eddaa195b6584b1a7fba018f8711c3bb364736f6c634300080e0033

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.