Overview
ETH Balance
1.436395735619089332 ETH
Eth Value
$4,865.21 (@ $3,387.10/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x96a954dab36679fda30c4952ec76146ca931892af8c038abc41ea0dc1ac51359 | Unstake | (pending) | 6 days ago | IN | 0 ETH | (Pending) | |||
Unstake | 20188284 | 26 hrs ago | IN | 0 ETH | 0.00040101 | ||||
Unstake | 20188271 | 26 hrs ago | IN | 0 ETH | 0.00033562 | ||||
Unstake | 20185373 | 36 hrs ago | IN | 0 ETH | 0.00084916 | ||||
Stake | 20153881 | 5 days ago | IN | 0 ETH | 0.00035397 | ||||
Unstake | 20142982 | 7 days ago | IN | 0 ETH | 0.0006227 | ||||
Unstake | 20134394 | 8 days ago | IN | 0 ETH | 0.00349677 | ||||
Unstake | 20113382 | 11 days ago | IN | 0 ETH | 0.0019218 | ||||
Unstake | 20113379 | 11 days ago | IN | 0 ETH | 0.00185384 | ||||
Unstake | 20103890 | 12 days ago | IN | 0 ETH | 0.00053496 | ||||
Unstake | 20103886 | 12 days ago | IN | 0 ETH | 0.0008046 | ||||
Unstake | 20099004 | 13 days ago | IN | 0 ETH | 0.00055984 | ||||
Unstake | 20086242 | 15 days ago | IN | 0 ETH | 0.00117207 | ||||
Unstake | 20067466 | 18 days ago | IN | 0 ETH | 0.00130208 | ||||
Unstake | 20066915 | 18 days ago | IN | 0 ETH | 0.00093905 | ||||
Unstake | 20057149 | 19 days ago | IN | 0 ETH | 0.00114525 | ||||
Unstake | 20054457 | 19 days ago | IN | 0 ETH | 0.00151028 | ||||
Stake | 20047693 | 20 days ago | IN | 0 ETH | 0.00147789 | ||||
Unstake | 20016943 | 25 days ago | IN | 0 ETH | 0.00063133 | ||||
Unstake | 20016321 | 25 days ago | IN | 0 ETH | 0.00064639 | ||||
Unstake | 20013337 | 25 days ago | IN | 0 ETH | 0.00150992 | ||||
Unstake | 20003381 | 26 days ago | IN | 0 ETH | 0.00099061 | ||||
Unstake | 20003379 | 26 days ago | IN | 0 ETH | 0.00091629 | ||||
Unstake | 19996175 | 27 days ago | IN | 0 ETH | 0.00070516 | ||||
Unstake | 19995491 | 28 days ago | IN | 0 ETH | 0.00088471 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
20188284 | 26 hrs ago | 0.0005643 ETH | ||||
20188271 | 26 hrs ago | 0.00047749 ETH | ||||
20185373 | 36 hrs ago | 0.00010514 ETH | ||||
20153881 | 5 days ago | 0.00341808 ETH | ||||
20142982 | 7 days ago | 0.00263815 ETH | ||||
20134394 | 8 days ago | 0.00608473 ETH | ||||
20113379 | 11 days ago | 0.0012184 ETH | ||||
20103886 | 12 days ago | 0.00014422 ETH | ||||
20099004 | 13 days ago | 0.00062683 ETH | ||||
20086242 | 15 days ago | 0.00147349 ETH | ||||
20067466 | 18 days ago | 0.00076838 ETH | ||||
20066915 | 18 days ago | 0.00055604 ETH | ||||
20057149 | 19 days ago | 0.0014737 ETH | ||||
20054457 | 19 days ago | 0.00295754 ETH | ||||
20047693 | 20 days ago | 0.00105336 ETH | ||||
20016943 | 25 days ago | 0.00048471 ETH | ||||
20016321 | 25 days ago | 0.00918915 ETH | ||||
20013337 | 25 days ago | 0.00148001 ETH | ||||
20003379 | 26 days ago | 0.04009011 ETH | ||||
19996175 | 27 days ago | 0.00166404 ETH | ||||
19995491 | 28 days ago | 0.00625034 ETH | ||||
19992212 | 28 days ago | 0.00102076 ETH | ||||
19991760 | 28 days ago | 0.00071254 ETH | ||||
19989567 | 28 days ago | 0.00092898 ETH | ||||
19988509 | 29 days ago | 0.00372319 ETH |
Loading...
Loading
Contract Name:
MONStaking
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "../Dependencies/BaseMath.sol"; import "../Dependencies/CheckContract.sol"; import "../Dependencies/DfrancMath.sol"; import "../Dependencies/Initializable.sol"; import "../Interfaces/IMONStaking.sol"; import "../Interfaces/IDeposit.sol"; import "../Dependencies/SafetyTransfer.sol"; contract MONStaking is IMONStaking, Pausable, Ownable, CheckContract, BaseMath, ReentrancyGuard, Initializable { using SafeMath for uint256; using SafeERC20 for IERC20; bool public isInitialized; // --- Data --- string public constant NAME = "MONStaking"; address constant ETH_REF_ADDRESS = address(0); mapping(address => uint256) public stakes; uint256 public totalMONStaked; mapping(address => uint256) public F_ASSETS; // Running sum of ETH fees per-MON-staked uint256 public F_DCHF; // Running sum of MON fees per-MON-staked // User snapshots of F_ETH and F_DCHF, taken at the point at which their latest deposit was made mapping(address => Snapshot) public snapshots; struct Snapshot { mapping(address => uint256) F_ASSET_Snapshot; uint256 F_DCHF_Snapshot; } address[] ASSET_TYPE; mapping(address => bool) isAssetTracked; mapping(address => uint256) public sentToTreasuryTracker; IERC20 public monToken; IERC20 public dchfToken; address public troveManagerAddress; address public troveManagerHelpersAddress; address public borrowerOperationsAddress; address public activePoolAddress; address public treasury; // --- Functions --- function setAddresses( address _monTokenAddress, address _dchfTokenAddress, address _troveManagerAddress, address _troveManagerHelpersAddress, address _borrowerOperationsAddress, address _activePoolAddress, address _treasury ) external override initializer { require(!isInitialized, "Already Initialized"); require(_treasury != address(0), "Invalid Treausry Address"); checkContract(_monTokenAddress); checkContract(_dchfTokenAddress); checkContract(_troveManagerAddress); checkContract(_troveManagerHelpersAddress); checkContract(_borrowerOperationsAddress); checkContract(_activePoolAddress); isInitialized = true; _pause(); monToken = IERC20(_monTokenAddress); dchfToken = IERC20(_dchfTokenAddress); troveManagerAddress = _troveManagerAddress; troveManagerHelpersAddress = _troveManagerHelpersAddress; borrowerOperationsAddress = _borrowerOperationsAddress; activePoolAddress = _activePoolAddress; treasury = _treasury; isAssetTracked[ETH_REF_ADDRESS] = true; ASSET_TYPE.push(ETH_REF_ADDRESS); emit MONTokenAddressSet(_monTokenAddress); emit MONTokenAddressSet(_dchfTokenAddress); emit TroveManagerAddressSet(_troveManagerAddress); emit BorrowerOperationsAddressSet(_borrowerOperationsAddress); emit ActivePoolAddressSet(_activePoolAddress); } // If caller has a pre-existing stake, send any accumulated ETH and DCHF gains to them. function stake(uint256 _MONamount) external override nonReentrant whenNotPaused { require(_MONamount > 0, "MON amount is zero"); uint256 currentStake = stakes[msg.sender]; uint256 assetLength = ASSET_TYPE.length; uint256 AssetGain; address asset; for (uint256 i = 0; i < assetLength; i++) { asset = ASSET_TYPE[i]; if (currentStake != 0) { AssetGain = _getPendingAssetGain(asset, msg.sender); if (i == 0) { uint256 DCHFGain = _getPendingDCHFGain(msg.sender); dchfToken.safeTransfer(msg.sender, DCHFGain); emit StakingGainsDCHFWithdrawn(msg.sender, DCHFGain); } _sendAssetGainToUser(asset, AssetGain); emit StakingGainsAssetWithdrawn(msg.sender, asset, AssetGain); } _updateUserSnapshots(asset, msg.sender); } uint256 newStake = currentStake.add(_MONamount); // Increase user’s stake and total MON staked stakes[msg.sender] = newStake; totalMONStaked = totalMONStaked.add(_MONamount); emit TotalMONStakedUpdated(totalMONStaked); // Transfer MON from caller to this contract monToken.safeTransferFrom(msg.sender, address(this), _MONamount); emit StakeChanged(msg.sender, newStake); } // Unstake the MON and send the it back to the caller, along with their accumulated DCHF & ETH gains. // If requested amount > stake, send their entire stake. function unstake(uint256 _MONamount) external override nonReentrant { uint256 currentStake = stakes[msg.sender]; _requireUserHasStake(currentStake); uint256 assetLength = ASSET_TYPE.length; uint256 AssetGain; address asset; for (uint256 i = 0; i < assetLength; i++) { asset = ASSET_TYPE[i]; // Grab any accumulated ETH and DCHF gains from the current stake AssetGain = _getPendingAssetGain(asset, msg.sender); if (i == 0) { uint256 DCHFGain = _getPendingDCHFGain(msg.sender); dchfToken.safeTransfer(msg.sender, DCHFGain); emit StakingGainsDCHFWithdrawn(msg.sender, DCHFGain); } _updateUserSnapshots(asset, msg.sender); emit StakingGainsAssetWithdrawn(msg.sender, asset, AssetGain); _sendAssetGainToUser(asset, AssetGain); } if (_MONamount > 0) { uint256 MONToWithdraw = DfrancMath._min(_MONamount, currentStake); uint256 newStake = currentStake.sub(MONToWithdraw); // Decrease user's stake and total MON staked stakes[msg.sender] = newStake; totalMONStaked = totalMONStaked.sub(MONToWithdraw); emit TotalMONStakedUpdated(totalMONStaked); // Transfer unstaked MON to user monToken.safeTransfer(msg.sender, MONToWithdraw); emit StakeChanged(msg.sender, newStake); } } function pause() public onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function changeTreasuryAddress(address _treasury) public onlyOwner { require(_treasury != address(0), "Treasury address is zero"); treasury = _treasury; emit TreasuryAddressChanged(_treasury); } // --- Reward-per-unit-staked increase functions. Called by Dfranc core contracts --- function increaseF_Asset(address _asset, uint256 _AssetFee) external override callerIsTroveManager { if (paused()) { sendToTreasury(_asset, _AssetFee); return; } if (!isAssetTracked[_asset]) { isAssetTracked[_asset] = true; ASSET_TYPE.push(_asset); } uint256 AssetFeePerMONStaked; if (totalMONStaked > 0) { AssetFeePerMONStaked = _AssetFee.mul(DECIMAL_PRECISION).div(totalMONStaked); } F_ASSETS[_asset] = F_ASSETS[_asset].add(AssetFeePerMONStaked); emit F_AssetUpdated(_asset, F_ASSETS[_asset]); } function increaseF_DCHF(uint256 _DCHFFee) external override callerIsBorrowerOperations { if (paused()) { sendToTreasury(address(dchfToken), _DCHFFee); return; } uint256 DCHFFeePerMONStaked; if (totalMONStaked > 0) { DCHFFeePerMONStaked = _DCHFFee.mul(DECIMAL_PRECISION).div(totalMONStaked); } F_DCHF = F_DCHF.add(DCHFFeePerMONStaked); emit F_DCHFUpdated(F_DCHF); } function sendToTreasury(address _asset, uint256 _amount) internal { _sendAsset(treasury, _asset, _amount); sentToTreasuryTracker[_asset] += _amount; emit SentToTreasury(_asset, _amount); } // --- Pending reward functions --- function getPendingAssetGain(address _asset, address _user) external view override returns (uint256) { return _getPendingAssetGain(_asset, _user); } function _getPendingAssetGain(address _asset, address _user) internal view returns (uint256) { uint256 F_ASSET_Snapshot = snapshots[_user].F_ASSET_Snapshot[_asset]; uint256 AssetGain = stakes[_user].mul(F_ASSETS[_asset].sub(F_ASSET_Snapshot)).div( DECIMAL_PRECISION ); return AssetGain; } function getPendingDCHFGain(address _user) external view override returns (uint256) { return _getPendingDCHFGain(_user); } function _getPendingDCHFGain(address _user) internal view returns (uint256) { uint256 F_DCHF_Snapshot = snapshots[_user].F_DCHF_Snapshot; uint256 DCHFGain = stakes[_user].mul(F_DCHF.sub(F_DCHF_Snapshot)).div(DECIMAL_PRECISION); return DCHFGain; } // --- Internal helper functions --- function _updateUserSnapshots(address _asset, address _user) internal { snapshots[_user].F_ASSET_Snapshot[_asset] = F_ASSETS[_asset]; snapshots[_user].F_DCHF_Snapshot = F_DCHF; emit StakerSnapshotsUpdated(_user, F_ASSETS[_asset], F_DCHF); } function _sendAssetGainToUser(address _asset, uint256 _assetGain) internal { _assetGain = SafetyTransfer.decimalsCorrection(_asset, _assetGain); _sendAsset(msg.sender, _asset, _assetGain); emit AssetSent(_asset, msg.sender, _assetGain); } function _sendAsset( address _sendTo, address _asset, uint256 _amount ) internal { if (_asset == ETH_REF_ADDRESS) { (bool success, ) = _sendTo.call{ value: _amount }(""); require(success, "MONStaking: Failed to send accumulated AssetGain"); } else { IERC20(_asset).safeTransfer(_sendTo, _amount); } } // --- 'require' functions --- modifier callerIsTroveManager() { require( msg.sender == troveManagerAddress || msg.sender == troveManagerHelpersAddress, "MONStaking: caller is not TroveM" ); _; } modifier callerIsBorrowerOperations() { require(msg.sender == borrowerOperationsAddress, "MONStaking: caller is not BorrowerOps"); _; } modifier callerIsActivePool() { require(msg.sender == activePoolAddress, "MONStaking: caller is not ActivePool"); _; } function _requireUserHasStake(uint256 currentStake) internal pure { require(currentStake > 0, "MONStaking: User must have a non-zero stake"); } receive() external payable callerIsActivePool {} }
// 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 "../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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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.14; abstract contract BaseMath { uint256 public constant DECIMAL_PRECISION = 1 ether; }
// 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.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.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.14; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; interface IMONStaking { // --- Events -- event TreasuryAddressChanged(address _treausury); event SentToTreasury(address indexed _asset, uint256 _amount); event MONTokenAddressSet(address _MONTokenAddress); event DCHFTokenAddressSet(address _dchfTokenAddress); event TroveManagerAddressSet(address _troveManager); event BorrowerOperationsAddressSet(address _borrowerOperationsAddress); event ActivePoolAddressSet(address _activePoolAddress); event StakeChanged(address indexed staker, uint256 newStake); event StakingGainsAssetWithdrawn( address indexed staker, address indexed asset, uint256 AssetGain ); event StakingGainsDCHFWithdrawn(address indexed staker, uint256 DCHFGain); event F_AssetUpdated(address indexed _asset, uint256 _F_ASSET); event F_DCHFUpdated(uint256 _F_DCHF); event TotalMONStakedUpdated(uint256 _totalMONStaked); event AssetSent(address indexed _asset, address indexed _account, uint256 _amount); event StakerSnapshotsUpdated(address _staker, uint256 _F_Asset, uint256 _F_DCHF); function monToken() external view returns (IERC20); // --- Functions --- function setAddresses( address _MONTokenAddress, address _dchfTokenAddress, address _troveManagerAddress, address _troveManagerHelpersAddress, address _borrowerOperationsAddress, address _activePoolAddress, address _treasury ) external; function stake(uint256 _MONamount) external; function unstake(uint256 _MONamount) external; function increaseF_Asset(address _asset, uint256 _AssetFee) external; function increaseF_DCHF(uint256 _MONFee) external; function getPendingAssetGain(address _asset, address _user) external view returns (uint256); function getPendingDCHFGain(address _user) external view returns (uint256); }
pragma solidity ^0.8.14; interface IDeposit { function receivedERC20(address _asset, uint256 _amount) external; }
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)); } } }
// 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.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); } } } }
pragma solidity ^0.8.14; interface ERC20Decimals { function decimals() external view returns (uint8); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_activePoolAddress","type":"address"}],"name":"ActivePoolAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"},{"indexed":true,"internalType":"address","name":"_account","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"AssetSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_borrowerOperationsAddress","type":"address"}],"name":"BorrowerOperationsAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_dchfTokenAddress","type":"address"}],"name":"DCHFTokenAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"_F_ASSET","type":"uint256"}],"name":"F_AssetUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_F_DCHF","type":"uint256"}],"name":"F_DCHFUpdated","type":"event"},{"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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"SentToTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"newStake","type":"uint256"}],"name":"StakeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"_F_Asset","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_F_DCHF","type":"uint256"}],"name":"StakerSnapshotsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"AssetGain","type":"uint256"}],"name":"StakingGainsAssetWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"DCHFGain","type":"uint256"}],"name":"StakingGainsDCHFWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_totalMONStaked","type":"uint256"}],"name":"TotalMONStakedUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_treausury","type":"address"}],"name":"TreasuryAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_troveManager","type":"address"}],"name":"TroveManagerAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DECIMAL_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"F_ASSETS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"F_DCHF","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":"activePoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowerOperationsAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"changeTreasuryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dchfToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_user","type":"address"}],"name":"getPendingAssetGain","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getPendingDCHFGain","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"},{"internalType":"uint256","name":"_AssetFee","type":"uint256"}],"name":"increaseF_Asset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_DCHFFee","type":"uint256"}],"name":"increaseF_DCHF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sentToTreasuryTracker","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_monTokenAddress","type":"address"},{"internalType":"address","name":"_dchfTokenAddress","type":"address"},{"internalType":"address","name":"_troveManagerAddress","type":"address"},{"internalType":"address","name":"_troveManagerHelpersAddress","type":"address"},{"internalType":"address","name":"_borrowerOperationsAddress","type":"address"},{"internalType":"address","name":"_activePoolAddress","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"snapshots","outputs":[{"internalType":"uint256","name":"F_DCHF_Snapshot","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_MONamount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stakes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMONStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_MONamount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506000805460ff191690556100243361002d565b60018055610086565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b612228806100956000396000f3fe6080604052600436106101d15760003560e01c80638456cb59116100f7578063a6f353f011610095578063caaaa56c11610064578063caaaa56c146105e9578063dbcafee514610609578063eaa8ba7f1461061f578063f2fde38b1461063f57600080fd5b8063a6f353f014610569578063b08bc72214610589578063b4b5e540146105a9578063b7f8cf9b146105c957600080fd5b8063955d3ca4116100d1578063955d3ca4146104bd578063a20baee6146104ea578063a3f4df7e14610506578063a694fc3a1461054957600080fd5b80638456cb591461046557806387c333811461047a5780638da5cb5b1461049a57600080fd5b80633f4ba83a1161016f57806361d027b31161013e57806361d027b3146103e357806363eb9f9014610403578063715018a6146104235780638174a5f21461043857600080fd5b80633f4ba83a1461038057806346bca504146103955780635a4d28bb146103ab5780635c975abb146103cb57600080fd5b80632e17de78116101ab5780632e17de78146102e057806334b3081f146103005780633522c6e814610330578063392e53cd1461035057600080fd5b8063122581e61461024857806316934fc41461026857806323019524146102a857600080fd5b36610243576010546001600160a01b031633146102415760405162461bcd60e51b8152602060048201526024808201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f7420416374697665604482015263141bdbdb60e21b60648201526084015b60405180910390fd5b005b600080fd5b34801561025457600080fd5b50610241610263366004611e1b565b61065f565b34801561027457600080fd5b50610295610283366004611e45565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156102b457600080fd5b50600c546102c8906001600160a01b031681565b6040516001600160a01b03909116815260200161029f565b3480156102ec57600080fd5b506102416102fb366004611e60565b610818565b34801561030c57600080fd5b5061029561031b366004611e45565b60076020526000908152604090206001015481565b34801561033c57600080fd5b5061029561034b366004611e79565b610a6d565b34801561035c57600080fd5b506002546103709062010000900460ff1681565b604051901515815260200161029f565b34801561038c57600080fd5b50610241610a82565b3480156103a157600080fd5b5061029560065481565b3480156103b757600080fd5b50600d546102c8906001600160a01b031681565b3480156103d757600080fd5b5060005460ff16610370565b3480156103ef57600080fd5b506011546102c8906001600160a01b031681565b34801561040f57600080fd5b50600b546102c8906001600160a01b031681565b34801561042f57600080fd5b50610241610abc565b34801561044457600080fd5b50610295610453366004611e45565b60056020526000908152604090205481565b34801561047157600080fd5b50610241610af6565b34801561048657600080fd5b50600e546102c8906001600160a01b031681565b3480156104a657600080fd5b5060005461010090046001600160a01b03166102c8565b3480156104c957600080fd5b506102956104d8366004611e45565b600a6020526000908152604090205481565b3480156104f657600080fd5b50610295670de0b6b3a764000081565b34801561051257600080fd5b5061053c6040518060400160405280600a8152602001694d4f4e5374616b696e6760b01b81525081565b60405161029f9190611ed8565b34801561055557600080fd5b50610241610564366004611e60565b610b2e565b34801561057557600080fd5b50610241610584366004611e45565b610df7565b34801561059557600080fd5b506010546102c8906001600160a01b031681565b3480156105b557600080fd5b506102956105c4366004611e45565b610ed1565b3480156105d557600080fd5b50600f546102c8906001600160a01b031681565b3480156105f557600080fd5b50610241610604366004611e60565b610edc565b34801561061557600080fd5b5061029560045481565b34801561062b57600080fd5b5061024161063a366004611f0b565b610fd9565b34801561064b57600080fd5b5061024161065a366004611e45565b6113d7565b600d546001600160a01b03163314806106825750600e546001600160a01b031633145b6106ce5760405162461bcd60e51b815260206004820181905260248201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f742054726f76654d6044820152606401610238565b60005460ff16156106e7576106e38282611475565b5050565b6001600160a01b03821660009081526009602052604090205460ff1661076d576001600160a01b0382166000818152600960205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b03191690911790555b6004546000901561079a576004546107979061079184670de0b6b3a76400006114fb565b90611507565b90505b6001600160a01b0383166000908152600560205260409020546107bd9082611513565b6001600160a01b038416600081815260056020526040908190208390555190917fae1df072173f21c2cc2e0aa1368be1b6b7b0f4f295d82ccae83bd489a5575f299161080b91815260200190565b60405180910390a2505050565b60026001540361086a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610238565b6002600155336000908152600360205260409020546108888161151f565b600854600080805b8381101561099857600881815481106108ab576108ab611f91565b6000918252602090912001546001600160a01b031691506108cc8233611583565b9250806000036109325760006108e1336115fd565b600c549091506108fb906001600160a01b03163383611642565b60405181815233907f6a3166b01bcb942408af82481d1deb05a20a96b8ebb2435536f209d2a55c7a829060200160405180910390a2505b61093c82336116aa565b6040518381526001600160a01b0383169033907f5461929fc7866d2777ffdec3e8203fb397bb1c8d727549022e6128217bf80ae39060200160405180910390a3610986828461172d565b8061099081611fbd565b915050610890565b508415610a625760006109ab8686611788565b905060006109b9868361179e565b3360009081526003602052604090208190556004549091506109db908361179e565b60048190556040519081527f7948baf319df0d8005f8201a90ba64f118feebab1a4db38555ea4778aaca8ff89060200160405180910390a1600b54610a2a906001600160a01b03163384611642565b60405181815233907f39df0e5286a3ef2f42a0bf52f32cfe2c58e5b0405f47fe512f2c2439e4cfe2049060200160405180910390a250505b505060018055505050565b6000610a798383611583565b90505b92915050565b6000546001600160a01b03610100909104163314610ab25760405162461bcd60e51b815260040161023890611fd6565b610aba6117aa565b565b6000546001600160a01b03610100909104163314610aec5760405162461bcd60e51b815260040161023890611fd6565b610aba600061183d565b6000546001600160a01b03610100909104163314610b265760405162461bcd60e51b815260040161023890611fd6565b610aba611896565b600260015403610b805760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610238565b600260015560005460ff1615610bcb5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610238565b60008111610c105760405162461bcd60e51b81526020600482015260126024820152714d4f4e20616d6f756e74206973207a65726f60701b6044820152606401610238565b33600090815260036020526040812054600854909180805b83811015610d375760088181548110610c4357610c43611f91565b6000918252602090912001546001600160a01b031691508415610d1b57610c6a8233611583565b925080600003610cd0576000610c7f336115fd565b600c54909150610c99906001600160a01b03163383611642565b60405181815233907f6a3166b01bcb942408af82481d1deb05a20a96b8ebb2435536f209d2a55c7a829060200160405180910390a2505b610cda828461172d565b6040518381526001600160a01b0383169033907f5461929fc7866d2777ffdec3e8203fb397bb1c8d727549022e6128217bf80ae39060200160405180910390a35b610d2582336116aa565b80610d2f81611fbd565b915050610c28565b506000610d448587611513565b336000908152600360205260409020819055600454909150610d669087611513565b60048190556040519081527f7948baf319df0d8005f8201a90ba64f118feebab1a4db38555ea4778aaca8ff89060200160405180910390a1600b54610db6906001600160a01b0316333089611911565b60405181815233907f39df0e5286a3ef2f42a0bf52f32cfe2c58e5b0405f47fe512f2c2439e4cfe2049060200160405180910390a250506001805550505050565b6000546001600160a01b03610100909104163314610e275760405162461bcd60e51b815260040161023890611fd6565b6001600160a01b038116610e7d5760405162461bcd60e51b815260206004820152601860248201527f54726561737572792061646472657373206973207a65726f00000000000000006044820152606401610238565b601180546001600160a01b0319166001600160a01b0383169081179091556040519081527f9073dfac663173e64aa95665faedae52e2246f9bcdd3890fbfaf6733b46bba139060200160405180910390a150565b6000610a7c826115fd565b600f546001600160a01b03163314610f445760405162461bcd60e51b815260206004820152602560248201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f7420426f72726f7760448201526465724f707360d81b6064820152608401610238565b60005460ff1615610f6857600c54610f65906001600160a01b031682611475565b50565b60045460009015610f8f57600454610f8c9061079184670de0b6b3a76400006114fb565b90505b600654610f9c9082611513565b60068190556040519081527f3186b498819902d8f8768a5d1deaabbbdf0a0810af2dd82170e79e46230e8112906020015b60405180910390a15050565b600254610100900460ff1615808015610ff95750600254600160ff909116105b806110135750303b158015611013575060025460ff166001145b6110765760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610238565b6002805460ff191660011790558015611099576002805461ff0019166101001790555b60025462010000900460ff16156110e85760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e48125b9a5d1a585b1a5e9959606a1b6044820152606401610238565b6001600160a01b03821661113e5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964205472656175737279204164647265737300000000000000006044820152606401610238565b6111478861194f565b6111508761194f565b6111598661194f565b6111628561194f565b61116b8461194f565b6111748361194f565b6002805462ff000019166201000017905561118d611896565b600b80546001600160a01b03199081166001600160a01b038b8116918217909355600c805483168b8516179055600d805483168a8516179055600e80548316898516179055600f8054831688851617905560108054831687851617905560118054831693861693909317909255600960209081527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b805460ff191660019081179091556008805491820181556000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180549092169091556040519182527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b910160405180910390a16040516001600160a01b03881681527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b9060200160405180910390a16040516001600160a01b03871681527f41097dcc1f7cbd663d822443d7972f05b04f71918b30fe9fc59dd6e42e2280609060200160405180910390a16040516001600160a01b03851681527f5962f8af633c4df1ab230096f773a514ee5adf7785c621ecdcdb764cb7f6e3919060200160405180910390a16040516001600160a01b03841681527f8f6a6e7d20a3233e0a79883272259ffbd7a243734e397bc2b4642c79d7fa8a6d9060200160405180910390a180156113cd576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6000546001600160a01b036101009091041633146114075760405162461bcd60e51b815260040161023890611fd6565b6001600160a01b03811661146c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610238565b610f658161183d565b60115461148c906001600160a01b031683836119f4565b6001600160a01b0382166000908152600a6020526040812080548392906114b490849061200b565b90915550506040518181526001600160a01b038316907fcb3b1cf844e7338746f3d6afd66ab59782b22b7e485960c851b6e77689714da49060200160405180910390a25050565b6000610a798284612023565b6000610a798284612042565b6000610a79828461200b565b60008111610f655760405162461bcd60e51b815260206004820152602b60248201527f4d4f4e5374616b696e673a2055736572206d75737420686176652061206e6f6e60448201526a2d7a65726f207374616b6560a81b6064820152608401610238565b6001600160a01b03808216600090815260076020908152604080832093861683529281528282205460059091529181205490919082906115f490670de0b6b3a764000090610791906115d5908661179e565b6001600160a01b038816600090815260036020526040902054906114fb565b95945050505050565b6001600160a01b038116600090815260076020526040812060010154600654829061163a90670de0b6b3a764000090610791906115d5908661179e565b949350505050565b6040516001600160a01b0383166024820152604481018290526116a590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ad2565b505050565b6001600160a01b038281166000818152600560208181526040808420805496881680865260078452828620968652868452948290209690965560065460019095018590559181529354815192835293820193909352918201527f6b5cf27595af4428271524e0a5abd2b63f6fee1a61e31970490f5a10e257a1cd90606001610fcd565b6117378282611ba4565b90506117443383836119f4565b60405181815233906001600160a01b038416907ff89c3306c782ffbbe4593aa5673e97e9ad6a8c65d240405e8986363fada663929060200160405180910390a35050565b60008183106117975781610a79565b5090919050565b6000610a798284612064565b60005460ff166117f35760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610238565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60005460ff16156118dc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610238565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586118203390565b6040516001600160a01b03808516602483015283166044820152606481018290526119499085906323b872dd60e01b9060840161166e565b50505050565b6001600160a01b0381166119a55760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f206164647265737300006044820152606401610238565b803b806106e35760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f6044820152606401610238565b6001600160a01b038216611abe576000836001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a4f576040519150601f19603f3d011682016040523d82523d6000602084013e611a54565b606091505b50509050806119495760405162461bcd60e51b815260206004820152603060248201527f4d4f4e5374616b696e673a204661696c656420746f2073656e6420616363756d60448201526f3ab630ba32b21020b9b9b2ba23b0b4b760811b6064820152608401610238565b6116a56001600160a01b0383168483611642565b6000611b27826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c859092919063ffffffff16565b8051909150156116a55780806020019051810190611b45919061207b565b6116a55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610238565b60006001600160a01b038316611bbb575080610a7c565b81600003611bcb57506000610a7c565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2f919061209d565b905060128160ff161015611c6557611c5d611c4b8260126120c0565b611c5690600a6121c7565b8490611507565b915050610a7c565b611c5d611c736012836120c0565b611c7e90600a6121c7565b84906114fb565b6060611c948484600085611c9e565b90505b9392505050565b606082471015611cff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610238565b843b611d4d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610238565b600080866001600160a01b03168587604051611d6991906121d6565b60006040518083038185875af1925050503d8060008114611da6576040519150601f19603f3d011682016040523d82523d6000602084013e611dab565b606091505b5091509150611dbb828286611dc6565b979650505050505050565b60608315611dd5575081611c97565b825115611de55782518084602001fd5b8160405162461bcd60e51b81526004016102389190611ed8565b80356001600160a01b0381168114611e1657600080fd5b919050565b60008060408385031215611e2e57600080fd5b611e3783611dff565b946020939093013593505050565b600060208284031215611e5757600080fd5b610a7982611dff565b600060208284031215611e7257600080fd5b5035919050565b60008060408385031215611e8c57600080fd5b611e9583611dff565b9150611ea360208401611dff565b90509250929050565b60005b83811015611ec7578181015183820152602001611eaf565b838111156119495750506000910152565b6020815260008251806020840152611ef7816040850160208701611eac565b601f01601f19169190910160400192915050565b600080600080600080600060e0888a031215611f2657600080fd5b611f2f88611dff565b9650611f3d60208901611dff565b9550611f4b60408901611dff565b9450611f5960608901611dff565b9350611f6760808901611dff565b9250611f7560a08901611dff565b9150611f8360c08901611dff565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611fcf57611fcf611fa7565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561201e5761201e611fa7565b500190565b600081600019048311821515161561203d5761203d611fa7565b500290565b60008261205f57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561207657612076611fa7565b500390565b60006020828403121561208d57600080fd5b81518015158114611c9757600080fd5b6000602082840312156120af57600080fd5b815160ff81168114611c9757600080fd5b600060ff821660ff8416808210156120da576120da611fa7565b90039392505050565b600181815b8085111561211e57816000190482111561210457612104611fa7565b8085161561211157918102915b93841c93908002906120e8565b509250929050565b60008261213557506001610a7c565b8161214257506000610a7c565b816001811461215857600281146121625761217e565b6001915050610a7c565b60ff84111561217357612173611fa7565b50506001821b610a7c565b5060208310610133831016604e8410600b84101617156121a1575081810a610a7c565b6121ab83836120e3565b80600019048211156121bf576121bf611fa7565b029392505050565b6000610a7960ff841683612126565b600082516121e8818460208701611eac565b919091019291505056fea2646970667358221220e5547b455ce61b3f495255404af01bc1ed233330af64c89cb38a222b6cdfc85164736f6c634300080e0033
Deployed Bytecode
0x6080604052600436106101d15760003560e01c80638456cb59116100f7578063a6f353f011610095578063caaaa56c11610064578063caaaa56c146105e9578063dbcafee514610609578063eaa8ba7f1461061f578063f2fde38b1461063f57600080fd5b8063a6f353f014610569578063b08bc72214610589578063b4b5e540146105a9578063b7f8cf9b146105c957600080fd5b8063955d3ca4116100d1578063955d3ca4146104bd578063a20baee6146104ea578063a3f4df7e14610506578063a694fc3a1461054957600080fd5b80638456cb591461046557806387c333811461047a5780638da5cb5b1461049a57600080fd5b80633f4ba83a1161016f57806361d027b31161013e57806361d027b3146103e357806363eb9f9014610403578063715018a6146104235780638174a5f21461043857600080fd5b80633f4ba83a1461038057806346bca504146103955780635a4d28bb146103ab5780635c975abb146103cb57600080fd5b80632e17de78116101ab5780632e17de78146102e057806334b3081f146103005780633522c6e814610330578063392e53cd1461035057600080fd5b8063122581e61461024857806316934fc41461026857806323019524146102a857600080fd5b36610243576010546001600160a01b031633146102415760405162461bcd60e51b8152602060048201526024808201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f7420416374697665604482015263141bdbdb60e21b60648201526084015b60405180910390fd5b005b600080fd5b34801561025457600080fd5b50610241610263366004611e1b565b61065f565b34801561027457600080fd5b50610295610283366004611e45565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156102b457600080fd5b50600c546102c8906001600160a01b031681565b6040516001600160a01b03909116815260200161029f565b3480156102ec57600080fd5b506102416102fb366004611e60565b610818565b34801561030c57600080fd5b5061029561031b366004611e45565b60076020526000908152604090206001015481565b34801561033c57600080fd5b5061029561034b366004611e79565b610a6d565b34801561035c57600080fd5b506002546103709062010000900460ff1681565b604051901515815260200161029f565b34801561038c57600080fd5b50610241610a82565b3480156103a157600080fd5b5061029560065481565b3480156103b757600080fd5b50600d546102c8906001600160a01b031681565b3480156103d757600080fd5b5060005460ff16610370565b3480156103ef57600080fd5b506011546102c8906001600160a01b031681565b34801561040f57600080fd5b50600b546102c8906001600160a01b031681565b34801561042f57600080fd5b50610241610abc565b34801561044457600080fd5b50610295610453366004611e45565b60056020526000908152604090205481565b34801561047157600080fd5b50610241610af6565b34801561048657600080fd5b50600e546102c8906001600160a01b031681565b3480156104a657600080fd5b5060005461010090046001600160a01b03166102c8565b3480156104c957600080fd5b506102956104d8366004611e45565b600a6020526000908152604090205481565b3480156104f657600080fd5b50610295670de0b6b3a764000081565b34801561051257600080fd5b5061053c6040518060400160405280600a8152602001694d4f4e5374616b696e6760b01b81525081565b60405161029f9190611ed8565b34801561055557600080fd5b50610241610564366004611e60565b610b2e565b34801561057557600080fd5b50610241610584366004611e45565b610df7565b34801561059557600080fd5b506010546102c8906001600160a01b031681565b3480156105b557600080fd5b506102956105c4366004611e45565b610ed1565b3480156105d557600080fd5b50600f546102c8906001600160a01b031681565b3480156105f557600080fd5b50610241610604366004611e60565b610edc565b34801561061557600080fd5b5061029560045481565b34801561062b57600080fd5b5061024161063a366004611f0b565b610fd9565b34801561064b57600080fd5b5061024161065a366004611e45565b6113d7565b600d546001600160a01b03163314806106825750600e546001600160a01b031633145b6106ce5760405162461bcd60e51b815260206004820181905260248201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f742054726f76654d6044820152606401610238565b60005460ff16156106e7576106e38282611475565b5050565b6001600160a01b03821660009081526009602052604090205460ff1661076d576001600160a01b0382166000818152600960205260408120805460ff191660019081179091556008805491820181559091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b03191690911790555b6004546000901561079a576004546107979061079184670de0b6b3a76400006114fb565b90611507565b90505b6001600160a01b0383166000908152600560205260409020546107bd9082611513565b6001600160a01b038416600081815260056020526040908190208390555190917fae1df072173f21c2cc2e0aa1368be1b6b7b0f4f295d82ccae83bd489a5575f299161080b91815260200190565b60405180910390a2505050565b60026001540361086a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610238565b6002600155336000908152600360205260409020546108888161151f565b600854600080805b8381101561099857600881815481106108ab576108ab611f91565b6000918252602090912001546001600160a01b031691506108cc8233611583565b9250806000036109325760006108e1336115fd565b600c549091506108fb906001600160a01b03163383611642565b60405181815233907f6a3166b01bcb942408af82481d1deb05a20a96b8ebb2435536f209d2a55c7a829060200160405180910390a2505b61093c82336116aa565b6040518381526001600160a01b0383169033907f5461929fc7866d2777ffdec3e8203fb397bb1c8d727549022e6128217bf80ae39060200160405180910390a3610986828461172d565b8061099081611fbd565b915050610890565b508415610a625760006109ab8686611788565b905060006109b9868361179e565b3360009081526003602052604090208190556004549091506109db908361179e565b60048190556040519081527f7948baf319df0d8005f8201a90ba64f118feebab1a4db38555ea4778aaca8ff89060200160405180910390a1600b54610a2a906001600160a01b03163384611642565b60405181815233907f39df0e5286a3ef2f42a0bf52f32cfe2c58e5b0405f47fe512f2c2439e4cfe2049060200160405180910390a250505b505060018055505050565b6000610a798383611583565b90505b92915050565b6000546001600160a01b03610100909104163314610ab25760405162461bcd60e51b815260040161023890611fd6565b610aba6117aa565b565b6000546001600160a01b03610100909104163314610aec5760405162461bcd60e51b815260040161023890611fd6565b610aba600061183d565b6000546001600160a01b03610100909104163314610b265760405162461bcd60e51b815260040161023890611fd6565b610aba611896565b600260015403610b805760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610238565b600260015560005460ff1615610bcb5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610238565b60008111610c105760405162461bcd60e51b81526020600482015260126024820152714d4f4e20616d6f756e74206973207a65726f60701b6044820152606401610238565b33600090815260036020526040812054600854909180805b83811015610d375760088181548110610c4357610c43611f91565b6000918252602090912001546001600160a01b031691508415610d1b57610c6a8233611583565b925080600003610cd0576000610c7f336115fd565b600c54909150610c99906001600160a01b03163383611642565b60405181815233907f6a3166b01bcb942408af82481d1deb05a20a96b8ebb2435536f209d2a55c7a829060200160405180910390a2505b610cda828461172d565b6040518381526001600160a01b0383169033907f5461929fc7866d2777ffdec3e8203fb397bb1c8d727549022e6128217bf80ae39060200160405180910390a35b610d2582336116aa565b80610d2f81611fbd565b915050610c28565b506000610d448587611513565b336000908152600360205260409020819055600454909150610d669087611513565b60048190556040519081527f7948baf319df0d8005f8201a90ba64f118feebab1a4db38555ea4778aaca8ff89060200160405180910390a1600b54610db6906001600160a01b0316333089611911565b60405181815233907f39df0e5286a3ef2f42a0bf52f32cfe2c58e5b0405f47fe512f2c2439e4cfe2049060200160405180910390a250506001805550505050565b6000546001600160a01b03610100909104163314610e275760405162461bcd60e51b815260040161023890611fd6565b6001600160a01b038116610e7d5760405162461bcd60e51b815260206004820152601860248201527f54726561737572792061646472657373206973207a65726f00000000000000006044820152606401610238565b601180546001600160a01b0319166001600160a01b0383169081179091556040519081527f9073dfac663173e64aa95665faedae52e2246f9bcdd3890fbfaf6733b46bba139060200160405180910390a150565b6000610a7c826115fd565b600f546001600160a01b03163314610f445760405162461bcd60e51b815260206004820152602560248201527f4d4f4e5374616b696e673a2063616c6c6572206973206e6f7420426f72726f7760448201526465724f707360d81b6064820152608401610238565b60005460ff1615610f6857600c54610f65906001600160a01b031682611475565b50565b60045460009015610f8f57600454610f8c9061079184670de0b6b3a76400006114fb565b90505b600654610f9c9082611513565b60068190556040519081527f3186b498819902d8f8768a5d1deaabbbdf0a0810af2dd82170e79e46230e8112906020015b60405180910390a15050565b600254610100900460ff1615808015610ff95750600254600160ff909116105b806110135750303b158015611013575060025460ff166001145b6110765760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610238565b6002805460ff191660011790558015611099576002805461ff0019166101001790555b60025462010000900460ff16156110e85760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e48125b9a5d1a585b1a5e9959606a1b6044820152606401610238565b6001600160a01b03821661113e5760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964205472656175737279204164647265737300000000000000006044820152606401610238565b6111478861194f565b6111508761194f565b6111598661194f565b6111628561194f565b61116b8461194f565b6111748361194f565b6002805462ff000019166201000017905561118d611896565b600b80546001600160a01b03199081166001600160a01b038b8116918217909355600c805483168b8516179055600d805483168a8516179055600e80548316898516179055600f8054831688851617905560108054831687851617905560118054831693861693909317909255600960209081527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b805460ff191660019081179091556008805491820181556000527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180549092169091556040519182527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b910160405180910390a16040516001600160a01b03881681527fa7384698c144954fe68c239dc637604762f6e8b5c232e7fc528031ae5575706b9060200160405180910390a16040516001600160a01b03871681527f41097dcc1f7cbd663d822443d7972f05b04f71918b30fe9fc59dd6e42e2280609060200160405180910390a16040516001600160a01b03851681527f5962f8af633c4df1ab230096f773a514ee5adf7785c621ecdcdb764cb7f6e3919060200160405180910390a16040516001600160a01b03841681527f8f6a6e7d20a3233e0a79883272259ffbd7a243734e397bc2b4642c79d7fa8a6d9060200160405180910390a180156113cd576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050565b6000546001600160a01b036101009091041633146114075760405162461bcd60e51b815260040161023890611fd6565b6001600160a01b03811661146c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610238565b610f658161183d565b60115461148c906001600160a01b031683836119f4565b6001600160a01b0382166000908152600a6020526040812080548392906114b490849061200b565b90915550506040518181526001600160a01b038316907fcb3b1cf844e7338746f3d6afd66ab59782b22b7e485960c851b6e77689714da49060200160405180910390a25050565b6000610a798284612023565b6000610a798284612042565b6000610a79828461200b565b60008111610f655760405162461bcd60e51b815260206004820152602b60248201527f4d4f4e5374616b696e673a2055736572206d75737420686176652061206e6f6e60448201526a2d7a65726f207374616b6560a81b6064820152608401610238565b6001600160a01b03808216600090815260076020908152604080832093861683529281528282205460059091529181205490919082906115f490670de0b6b3a764000090610791906115d5908661179e565b6001600160a01b038816600090815260036020526040902054906114fb565b95945050505050565b6001600160a01b038116600090815260076020526040812060010154600654829061163a90670de0b6b3a764000090610791906115d5908661179e565b949350505050565b6040516001600160a01b0383166024820152604481018290526116a590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ad2565b505050565b6001600160a01b038281166000818152600560208181526040808420805496881680865260078452828620968652868452948290209690965560065460019095018590559181529354815192835293820193909352918201527f6b5cf27595af4428271524e0a5abd2b63f6fee1a61e31970490f5a10e257a1cd90606001610fcd565b6117378282611ba4565b90506117443383836119f4565b60405181815233906001600160a01b038416907ff89c3306c782ffbbe4593aa5673e97e9ad6a8c65d240405e8986363fada663929060200160405180910390a35050565b60008183106117975781610a79565b5090919050565b6000610a798284612064565b60005460ff166117f35760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610238565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60005460ff16156118dc5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610238565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586118203390565b6040516001600160a01b03808516602483015283166044820152606481018290526119499085906323b872dd60e01b9060840161166e565b50505050565b6001600160a01b0381166119a55760405162461bcd60e51b815260206004820152601e60248201527f4163636f756e742063616e6e6f74206265207a65726f206164647265737300006044820152606401610238565b803b806106e35760405162461bcd60e51b815260206004820181905260248201527f4163636f756e7420636f64652073697a652063616e6e6f74206265207a65726f6044820152606401610238565b6001600160a01b038216611abe576000836001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a4f576040519150601f19603f3d011682016040523d82523d6000602084013e611a54565b606091505b50509050806119495760405162461bcd60e51b815260206004820152603060248201527f4d4f4e5374616b696e673a204661696c656420746f2073656e6420616363756d60448201526f3ab630ba32b21020b9b9b2ba23b0b4b760811b6064820152608401610238565b6116a56001600160a01b0383168483611642565b6000611b27826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c859092919063ffffffff16565b8051909150156116a55780806020019051810190611b45919061207b565b6116a55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610238565b60006001600160a01b038316611bbb575080610a7c565b81600003611bcb57506000610a7c565b6000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2f919061209d565b905060128160ff161015611c6557611c5d611c4b8260126120c0565b611c5690600a6121c7565b8490611507565b915050610a7c565b611c5d611c736012836120c0565b611c7e90600a6121c7565b84906114fb565b6060611c948484600085611c9e565b90505b9392505050565b606082471015611cff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610238565b843b611d4d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610238565b600080866001600160a01b03168587604051611d6991906121d6565b60006040518083038185875af1925050503d8060008114611da6576040519150601f19603f3d011682016040523d82523d6000602084013e611dab565b606091505b5091509150611dbb828286611dc6565b979650505050505050565b60608315611dd5575081611c97565b825115611de55782518084602001fd5b8160405162461bcd60e51b81526004016102389190611ed8565b80356001600160a01b0381168114611e1657600080fd5b919050565b60008060408385031215611e2e57600080fd5b611e3783611dff565b946020939093013593505050565b600060208284031215611e5757600080fd5b610a7982611dff565b600060208284031215611e7257600080fd5b5035919050565b60008060408385031215611e8c57600080fd5b611e9583611dff565b9150611ea360208401611dff565b90509250929050565b60005b83811015611ec7578181015183820152602001611eaf565b838111156119495750506000910152565b6020815260008251806020840152611ef7816040850160208701611eac565b601f01601f19169190910160400192915050565b600080600080600080600060e0888a031215611f2657600080fd5b611f2f88611dff565b9650611f3d60208901611dff565b9550611f4b60408901611dff565b9450611f5960608901611dff565b9350611f6760808901611dff565b9250611f7560a08901611dff565b9150611f8360c08901611dff565b905092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611fcf57611fcf611fa7565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561201e5761201e611fa7565b500190565b600081600019048311821515161561203d5761203d611fa7565b500290565b60008261205f57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561207657612076611fa7565b500390565b60006020828403121561208d57600080fd5b81518015158114611c9757600080fd5b6000602082840312156120af57600080fd5b815160ff81168114611c9757600080fd5b600060ff821660ff8416808210156120da576120da611fa7565b90039392505050565b600181815b8085111561211e57816000190482111561210457612104611fa7565b8085161561211157918102915b93841c93908002906120e8565b509250929050565b60008261213557506001610a7c565b8161214257506000610a7c565b816001811461215857600281146121625761217e565b6001915050610a7c565b60ff84111561217357612173611fa7565b50506001821b610a7c565b5060208310610133831016604e8410600b84101617156121a1575081810a610a7c565b6121ab83836120e3565b80600019048211156121bf576121bf611fa7565b029392505050565b6000610a7960ff841683612126565b600082516121e8818460208701611eac565b919091019291505056fea2646970667358221220e5547b455ce61b3f495255404af01bc1ed233330af64c89cb38a222b6cdfc85164736f6c634300080e0033
Loading...
Loading
Loading...
Loading
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.