Contract 0x92d804Ed49D92438aEA6fe552BD9163aacb7E841 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x9a5240b2fc734fee4afc554620fe87af3d31b12f95f0e76c4d74b56b6c07c5f80x6080604058563892022-02-11 13:25:10104 days 45 mins ago0xb5af4138f0f33be0d6414eb25271b9c2dc245fb5 IN  Create: RoundsManager0 ETH0.008831963093 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf6a0d512febe5f3e7b84d5e1d62aef3f76e9458b64c4071875ad77282fa74e97129974392022-05-26 13:57:3013 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0xf6a0d512febe5f3e7b84d5e1d62aef3f76e9458b64c4071875ad77282fa74e97129974392022-05-26 13:57:3013 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x7dc356f57cef50ec95344acb87ec8d3edce60a19220171eb4d6464753528e6eb129944382022-05-26 13:16:2754 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x7dc356f57cef50ec95344acb87ec8d3edce60a19220171eb4d6464753528e6eb129944382022-05-26 13:16:2754 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x7dc356f57cef50ec95344acb87ec8d3edce60a19220171eb4d6464753528e6eb129944382022-05-26 13:16:2754 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x7dc356f57cef50ec95344acb87ec8d3edce60a19220171eb4d6464753528e6eb129944382022-05-26 13:16:2754 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x89590f28223a57e78ef9bde9b66a1b79a114cdcd79581eccf64d3b06dfa046a0129904472022-05-26 12:00:432 hrs 10 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x89590f28223a57e78ef9bde9b66a1b79a114cdcd79581eccf64d3b06dfa046a0129904472022-05-26 12:00:432 hrs 10 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x89590f28223a57e78ef9bde9b66a1b79a114cdcd79581eccf64d3b06dfa046a0129904472022-05-26 12:00:432 hrs 10 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x89590f28223a57e78ef9bde9b66a1b79a114cdcd79581eccf64d3b06dfa046a0129904472022-05-26 12:00:432 hrs 10 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x89590f28223a57e78ef9bde9b66a1b79a114cdcd79581eccf64d3b06dfa046a0129904472022-05-26 12:00:432 hrs 10 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x27e8ffecafd619a8c8c8ad273bc1b9d8fa3fe0cbc7a94c410b34af1ed8892524129865542022-05-26 10:51:233 hrs 19 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x27e8ffecafd619a8c8c8ad273bc1b9d8fa3fe0cbc7a94c410b34af1ed8892524129865542022-05-26 10:51:233 hrs 19 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x27e8ffecafd619a8c8c8ad273bc1b9d8fa3fe0cbc7a94c410b34af1ed8892524129865542022-05-26 10:51:233 hrs 19 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x27e8ffecafd619a8c8c8ad273bc1b9d8fa3fe0cbc7a94c410b34af1ed8892524129865542022-05-26 10:51:233 hrs 19 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x27e8ffecafd619a8c8c8ad273bc1b9d8fa3fe0cbc7a94c410b34af1ed8892524129865542022-05-26 10:51:233 hrs 19 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x03fba1ece33dde26dce6b84558d259844785a19f6184b9a10580aad9e1216c37129861652022-05-26 10:42:443 hrs 28 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x03fba1ece33dde26dce6b84558d259844785a19f6184b9a10580aad9e1216c37129861652022-05-26 10:42:443 hrs 28 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x03fba1ece33dde26dce6b84558d259844785a19f6184b9a10580aad9e1216c37129861652022-05-26 10:42:443 hrs 28 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
0x249234b46803301d410bb21d51fb04a6acc8521cd984374649dc260fed20044b129844702022-05-26 10:11:093 hrs 59 mins ago 0xdd6f56dcc28d3f5f27084381fe8df634985cc39f 0x92d804ed49d92438aea6fe552bd9163aacb7e8410 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RoundsManager

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

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 generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

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

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

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

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

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

File 2 of 12 : IController.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./zeppelin/Pausable.sol";

abstract contract IController is Pausable {
    event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash);

    function setContractInfo(
        bytes32 _id,
        address _contractAddress,
        bytes20 _gitCommitHash
    ) external virtual;

    function updateController(bytes32 _id, address _controller) external virtual;

    function getContract(bytes32 _id) public view virtual returns (address);
}

File 3 of 12 : IManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IManager {
    event SetController(address controller);
    event ParameterUpdate(string param);

    function setController(address _controller) external;
}

File 4 of 12 : Manager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IManager.sol";
import "./IController.sol";

contract Manager is IManager {
    // Controller that contract is registered with
    IController public controller;

    // Check if sender is controller
    modifier onlyController() {
        _onlyController();
        _;
    }

    // Check if sender is controller owner
    modifier onlyControllerOwner() {
        _onlyControllerOwner();
        _;
    }

    // Check if controller is not paused
    modifier whenSystemNotPaused() {
        _whenSystemNotPaused();
        _;
    }

    // Check if controller is paused
    modifier whenSystemPaused() {
        _whenSystemPaused();
        _;
    }

    constructor(address _controller) {
        controller = IController(_controller);
    }

    /**
     * @notice Set controller. Only callable by current controller
     * @param _controller Controller contract address
     */
    function setController(address _controller) external onlyController {
        controller = IController(_controller);

        emit SetController(_controller);
    }

    function _onlyController() private view {
        require(msg.sender == address(controller), "caller must be Controller");
    }

    function _onlyControllerOwner() private view {
        require(msg.sender == controller.owner(), "caller must be Controller owner");
    }

    function _whenSystemNotPaused() private view {
        require(!controller.paused(), "system is paused");
    }

    function _whenSystemPaused() private view {
        require(controller.paused(), "system is not paused");
    }
}

File 5 of 12 : ManagerProxyTarget.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./Manager.sol";

/**
 * @title ManagerProxyTarget
 * @notice The base contract that target contracts used by a proxy contract should inherit from
 * @dev Both the target contract and the proxy contract (implemented as ManagerProxy) MUST inherit from ManagerProxyTarget in order to guarantee
 that both contracts have the same storage layout. Differing storage layouts in a proxy contract and target contract can
 potentially break the delegate proxy upgradeability mechanism
 */
abstract contract ManagerProxyTarget is Manager {
    // Used to look up target contract address in controller's registry
    bytes32 public targetContractId;
}

File 6 of 12 : IBondingManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Interface for BondingManager
 * TODO: switch to interface type
 */
interface IBondingManager {
    event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare);
    event TranscoderActivated(address indexed transcoder, uint256 activationRound);
    event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound);
    event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward);
    event Reward(address indexed transcoder, uint256 amount);
    event Bond(
        address indexed newDelegate,
        address indexed oldDelegate,
        address indexed delegator,
        uint256 additionalAmount,
        uint256 bondedAmount
    );
    event Unbond(
        address indexed delegate,
        address indexed delegator,
        uint256 unbondingLockId,
        uint256 amount,
        uint256 withdrawRound
    );
    event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount);
    event TransferBond(
        address indexed oldDelegator,
        address indexed newDelegator,
        uint256 oldUnbondingLockId,
        uint256 newUnbondingLockId,
        uint256 amount
    );
    event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound);
    event WithdrawFees(address indexed delegator, address recipient, uint256 amount);
    event EarningsClaimed(
        address indexed delegate,
        address indexed delegator,
        uint256 rewards,
        uint256 fees,
        uint256 startRound,
        uint256 endRound
    );

    // Deprecated events
    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding
    // to these deprecated events.
    // event Bond(address indexed delegate, address indexed delegator);
    // event Unbond(address indexed delegate, address indexed delegator);
    // event WithdrawStake(address indexed delegator);
    // event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered);
    // event TranscoderEvicted(address indexed transcoder);
    // event TranscoderResigned(address indexed transcoder);

    // External functions
    function updateTranscoderWithFees(
        address _transcoder,
        uint256 _fees,
        uint256 _round
    ) external;

    function slashTranscoder(
        address _transcoder,
        address _finder,
        uint256 _slashAmount,
        uint256 _finderFee
    ) external;

    function setCurrentRoundTotalActiveStake() external;

    // Public functions
    function getTranscoderPoolSize() external view returns (uint256);

    function transcoderTotalStake(address _transcoder) external view returns (uint256);

    function isActiveTranscoder(address _transcoder) external view returns (bool);

    function getTotalBonded() external view returns (uint256);
}

File 7 of 12 : MathUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";

library MathUtils {
    using SafeMath for uint256;

    // Divisor used for representing percentages
    uint256 public constant PERC_DIVISOR = 1000000;

    /**
     * @dev Returns whether an amount is a valid percentage out of PERC_DIVISOR
     * @param _amount Amount that is supposed to be a percentage
     */
    function validPerc(uint256 _amount) internal pure returns (bool) {
        return _amount <= PERC_DIVISOR;
    }

    /**
     * @dev Compute percentage of a value with the percentage represented by a fraction
     * @param _amount Amount to take the percentage of
     * @param _fracNum Numerator of fraction representing the percentage
     * @param _fracDenom Denominator of fraction representing the percentage
     */
    function percOf(
        uint256 _amount,
        uint256 _fracNum,
        uint256 _fracDenom
    ) internal pure returns (uint256) {
        return _amount.mul(percPoints(_fracNum, _fracDenom)).div(PERC_DIVISOR);
    }

    /**
     * @dev Compute percentage of a value with the percentage represented by a fraction over PERC_DIVISOR
     * @param _amount Amount to take the percentage of
     * @param _fracNum Numerator of fraction representing the percentage with PERC_DIVISOR as the denominator
     */
    function percOf(uint256 _amount, uint256 _fracNum) internal pure returns (uint256) {
        return _amount.mul(_fracNum).div(PERC_DIVISOR);
    }

    /**
     * @dev Compute percentage representation of a fraction
     * @param _fracNum Numerator of fraction represeting the percentage
     * @param _fracDenom Denominator of fraction represeting the percentage
     */
    function percPoints(uint256 _fracNum, uint256 _fracDenom) internal pure returns (uint256) {
        return _fracNum.mul(PERC_DIVISOR).div(_fracDenom);
    }
}

File 8 of 12 : IRoundsManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title RoundsManager interface
 */
interface IRoundsManager {
    // Events
    event NewRound(uint256 indexed round, bytes32 blockHash);

    // Deprecated events
    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding
    // to these deprecated events.
    // event NewRound(uint256 round)

    // External functions
    function initializeRound() external;

    function lipUpgradeRound(uint256 _lip) external view returns (uint256);

    // Public functions
    function blockNum() external view returns (uint256);

    function blockHash(uint256 _block) external view returns (bytes32);

    function blockHashForRound(uint256 _round) external view returns (bytes32);

    function currentRound() external view returns (uint256);

    function currentRoundStartBlock() external view returns (uint256);

    function currentRoundInitialized() external view returns (bool);

    function currentRoundLocked() external view returns (bool);
}

File 9 of 12 : RoundsManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../ManagerProxyTarget.sol";
import "./IRoundsManager.sol";
import "../bonding/IBondingManager.sol";
import "../token/IMinter.sol";
import "../libraries/MathUtils.sol";

import "@openzeppelin/contracts/utils/math/SafeMath.sol";

/**
 * @title RoundsManager
 * @notice Manages round progression and other blockchain time related operations of the Livepeer protocol
 */
contract RoundsManager is ManagerProxyTarget, IRoundsManager {
    using SafeMath for uint256;

    // Round length in blocks
    uint256 public roundLength;
    // Lock period of a round as a % of round length
    // Transcoders cannot join the transcoder pool or change their rates during the lock period at the end of a round
    // The lock period provides delegators time to review transcoder information without changes
    // # of blocks in the lock period = (roundLength * roundLockAmount) / PERC_DIVISOR
    uint256 public roundLockAmount;
    // Last initialized round. After first round, this is the last round during which initializeRound() was called
    uint256 public lastInitializedRound;
    // Round in which roundLength was last updated
    uint256 public lastRoundLengthUpdateRound;
    // Start block of the round in which roundLength was last updated
    uint256 public lastRoundLengthUpdateStartBlock;

    // Mapping round number => block hash for the round
    mapping(uint256 => bytes32) internal _blockHashForRound;

    // LIP Upgrade Rounds
    // These can be used in conditionals to ensure backwards compatibility or skip such backwards compatibility logic
    // in case 'currentRound' > LIP-X upgrade round
    mapping(uint256 => uint256) public lipUpgradeRound; // mapping (LIP-number > round number)

    /**
     * @notice RoundsManager constructor. Only invokes constructor of base Manager contract with provided Controller address
     * @dev This constructor will not initialize any state variables besides `controller`. The following setter functions
     * should be used to initialize state variables post-deployment:
     * - setRoundLength()
     * - setRoundLockAmount()
     * @param _controller Address of Controller that this contract will be registered with
     */
    constructor(address _controller) Manager(_controller) {}

    /**
     * @notice Set round length. Only callable by the controller owner
     * @param _roundLength Round length in blocks
     */
    function setRoundLength(uint256 _roundLength) external onlyControllerOwner {
        require(_roundLength > 0, "round length cannot be 0");

        if (roundLength == 0) {
            // If first time initializing roundLength, set roundLength before
            // lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
            roundLength = _roundLength;
            lastRoundLengthUpdateRound = currentRound();
            lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
        } else {
            // If updating roundLength, set roundLength after
            // lastRoundLengthUpdateRound and lastRoundLengthUpdateStartBlock
            lastRoundLengthUpdateRound = currentRound();
            lastRoundLengthUpdateStartBlock = currentRoundStartBlock();
            roundLength = _roundLength;
        }

        emit ParameterUpdate("roundLength");
    }

    /**
     * @notice Set round lock amount. Only callable by the controller owner
     * @param _roundLockAmount Round lock amount as a % of the number of blocks in a round
     */
    function setRoundLockAmount(uint256 _roundLockAmount) external onlyControllerOwner {
        require(MathUtils.validPerc(_roundLockAmount), "round lock amount must be a valid percentage");

        roundLockAmount = _roundLockAmount;

        emit ParameterUpdate("roundLockAmount");
    }

    /**
     * @notice Initialize the current round. Called once at the start of any round
     */
    function initializeRound() external whenSystemNotPaused {
        uint256 currRound = currentRound();

        // Check if already called for the current round
        require(lastInitializedRound < currRound, "round already initialized");

        // Set current round as initialized
        lastInitializedRound = currRound;
        // Store block hash for round
        bytes32 roundBlockHash = blockHash(blockNum().sub(1));
        _blockHashForRound[currRound] = roundBlockHash;
        // Set total active stake for the round
        bondingManager().setCurrentRoundTotalActiveStake();
        // Set mintable rewards for the round
        minter().setCurrentRewardTokens();

        emit NewRound(currRound, roundBlockHash);
    }

    /**
     * @notice setLIPUpgradeRound sets the round an LIP upgrade would become active.
     * @param _lip the LIP number.
     * @param _round (optional) the round in which the LIP becomes active
     */
    function setLIPUpgradeRound(uint256 _lip, uint256 _round) external onlyControllerOwner {
        require(lipUpgradeRound[_lip] == 0, "LIP upgrade round already set");
        lipUpgradeRound[_lip] = _round;
    }

    /**
     * @notice Return current block number
     */
    function blockNum() public view virtual returns (uint256) {
        return block.number;
    }

    /**
     * @notice Return blockhash for a block
     */
    function blockHash(uint256 _block) public view virtual returns (bytes32) {
        uint256 currentBlock = blockNum();
        require(_block < currentBlock, "can only retrieve past block hashes");
        require(currentBlock < 256 || _block >= currentBlock - 256, "can only retrieve hashes for last 256 blocks");

        return blockhash(_block);
    }

    /**
     * @notice Return blockhash for a round
     * @param _round Round number
     * @return Blockhash for `_round`
     */
    function blockHashForRound(uint256 _round) public view returns (bytes32) {
        return _blockHashForRound[_round];
    }

    /**
     * @notice Return current round
     */
    function currentRound() public view returns (uint256) {
        // Compute # of rounds since roundLength was last updated
        uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
        // Current round = round that roundLength was last updated + # of rounds since roundLength was last updated
        return lastRoundLengthUpdateRound.add(roundsSinceUpdate);
    }

    /**
     * @notice Return start block of current round
     */
    function currentRoundStartBlock() public view returns (uint256) {
        // Compute # of rounds since roundLength was last updated
        uint256 roundsSinceUpdate = blockNum().sub(lastRoundLengthUpdateStartBlock).div(roundLength);
        // Current round start block = start block of round that roundLength was last updated + (# of rounds since roundLenght was last updated * roundLength)
        return lastRoundLengthUpdateStartBlock.add(roundsSinceUpdate.mul(roundLength));
    }

    /**
     * @notice Check if current round is initialized
     */
    function currentRoundInitialized() public view returns (bool) {
        return lastInitializedRound == currentRound();
    }

    /**
     * @notice Check if we are in the lock period of the current round
     */
    function currentRoundLocked() public view returns (bool) {
        uint256 lockedBlocks = MathUtils.percOf(roundLength, roundLockAmount);
        return blockNum().sub(currentRoundStartBlock()) >= roundLength.sub(lockedBlocks);
    }

    /**
     * @dev Return BondingManager interface
     */
    function bondingManager() internal view returns (IBondingManager) {
        return IBondingManager(controller.getContract(keccak256("BondingManager")));
    }

    /**
     * @dev Return Minter interface
     */
    function minter() internal view returns (IMinter) {
        return IMinter(controller.getContract(keccak256("Minter")));
    }
}

File 10 of 12 : IMinter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../IController.sol";

/**
 * @title Minter interface
 */
interface IMinter {
    // Events
    event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation);

    // External functions
    function createReward(uint256 _fracNum, uint256 _fracDenom) external returns (uint256);

    function trustedTransferTokens(address _to, uint256 _amount) external;

    function trustedBurnTokens(uint256 _amount) external;

    function trustedWithdrawETH(address payable _to, uint256 _amount) external;

    function depositETH() external payable returns (bool);

    function setCurrentRewardTokens() external;

    function currentMintableTokens() external view returns (uint256);

    function currentMintedTokens() external view returns (uint256);

    // Public functions
    function getController() external view returns (IController);
}

File 11 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address public owner;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor() {
        owner = msg.sender;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

File 12 of 12 : Pausable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./Ownable.sol";

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
    event Pause();
    event Unpause();

    bool public paused;

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     */
    modifier whenPaused() {
        require(paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() public onlyOwner whenNotPaused {
        paused = true;
        emit Pause();
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() public onlyOwner whenPaused {
        paused = false;
        emit Unpause();
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"blockHash","type":"bytes32"}],"name":"NewRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"param","type":"string"}],"name":"ParameterUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"controller","type":"address"}],"name":"SetController","type":"event"},{"inputs":[{"internalType":"uint256","name":"_block","type":"uint256"}],"name":"blockHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"blockHashForRound","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockNum","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRoundInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRoundLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRoundStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastInitializedRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRoundLengthUpdateRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRoundLengthUpdateStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lipUpgradeRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundLockAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lip","type":"uint256"},{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"setLIPUpgradeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundLength","type":"uint256"}],"name":"setRoundLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_roundLockAmount","type":"uint256"}],"name":"setRoundLockAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"targetContractId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50604051610d6d380380610d6d83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610cda806100936000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c806385df51fd116100ad5780638fa148f2116100715780638fa148f21461022d57806392eefe9b14610235578063d4807fb214610248578063f5b490d514610250578063f77c47911461025957600080fd5b806385df51fd146101fa5780638807f36e1461020d5780638a19c8bc146102165780638ae63d6d1461021e5780638b649b941461022457600080fd5b80633aa4add4116100f45780633aa4add4146101ad57806351720b41146101cd578063668abff7146101d6578063681312f5146101df5780636841f253146101f257600080fd5b80630b1573b8146101315780630fe1dfa81461014657806313013e7a146101625780631e6d4c2214610175578063219bc76c14610195575b600080fd5b61014461013f366004610b6f565b610284565b005b61014f60055481565b6040519081526020015b60405180910390f35b610144610170366004610b88565b610361565b61014f610183366004610b6f565b60086020526000908152604090205481565b61019d6103d7565b6040519015158152602001610159565b61014f6101bb366004610b6f565b60009081526007602052604090205490565b61014f60015481565b61014f60065481565b6101446101ed366004610b6f565b6103ea565b61019d6104d2565b61014f610208366004610b6f565b61050e565b61014f60045481565b61014f6105ee565b4361014f565b61014f60025481565b61014f610620565b610144610243366004610bc2565b610659565b6101446106af565b61014f60035481565b60005461026c906001600160a01b031681565b6040516001600160a01b039091168152602001610159565b61028c61082e565b61029981620f4240101590565b6102ff5760405162461bcd60e51b815260206004820152602c60248201527f726f756e64206c6f636b20616d6f756e74206d75737420626520612076616c6960448201526b642070657263656e7461676560a01b60648201526084015b60405180910390fd5b60038190556040517f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd67490610356906020808252600f908201526e1c9bdd5b99131bd8dad05b5bdd5b9d608a1b604082015260600190565b60405180910390a150565b61036961082e565b600082815260086020526040902054156103c55760405162461bcd60e51b815260206004820152601d60248201527f4c4950207570677261646520726f756e6420616c72656164792073657400000060448201526064016102f6565b60009182526008602052604090912055565b60006103e16105ee565b60045414905090565b6103f261082e565b600081116104425760405162461bcd60e51b815260206004820152601860248201527f726f756e64206c656e6774682063616e6e6f742062652030000000000000000060448201526064016102f6565b6002546104695760028190556104566105ee565b600555610461610620565b600655610485565b6104716105ee565b60055561047c610620565b60065560028190555b7f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd674604051610356906020808252600b908201526a0e4deeadcc898cadccee8d60ab1b604082015260600190565b6000806104e3600254600354610914565b6002549091506104f3908261092e565b6105066104fe610620565b435b9061092e565b101591505090565b60004380831061056c5760405162461bcd60e51b815260206004820152602360248201527f63616e206f6e6c79207265747269657665207061737420626c6f636b2068617360448201526268657360e81b60648201526084016102f6565b610100811080610587575061058361010082610bf5565b8310155b6105e85760405162461bcd60e51b815260206004820152602c60248201527f63616e206f6e6c792072657472696576652068617368657320666f72206c617360448201526b742032353620626c6f636b7360a01b60648201526084016102f6565b50504090565b60008061060a6002546106046006546105004390565b9061093a565b60055490915061061a9082610946565b91505090565b6000806106366002546106046006546105004390565b905061061a6106506002548361095290919063ffffffff16565b60065490610946565b61066161095e565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f7090602001610356565b6106b76109b8565b60006106c16105ee565b905080600454106107145760405162461bcd60e51b815260206004820152601960248201527f726f756e6420616c726561647920696e697469616c697a65640000000000000060448201526064016102f6565b60048190556000610729610208600143610500565b60008381526007602052604090208190559050610744610a7c565b6001600160a01b031663713f22166040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561077e57600080fd5b505af1158015610792573d6000803e3d6000fd5b5050505061079e610b1e565b6001600160a01b031663ece2064c6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107d857600080fd5b505af11580156107ec573d6000803e3d6000fd5b50505050817f22f2fc17c5daf07db2379b3a03a8ef20a183f761097a58fce219c8a14619e7868260405161082291815260200190565b60405180910390a25050565b60008054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087a57600080fd5b505afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b29190610c0c565b6001600160a01b0316336001600160a01b0316146109125760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572206f776e65720060448201526064016102f6565b565b6000610927620f42406106048585610952565b9392505050565b60006109278284610bf5565b60006109278284610c29565b60006109278284610c4b565b60006109278284610c63565b6000546001600160a01b031633146109125760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206d75737420626520436f6e74726f6c6c65720000000000000060448201526064016102f6565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0457600080fd5b505afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3c9190610c82565b156109125760405162461bcd60e51b815260206004820152601060248201526f1cde5cdd195b481a5cc81c185d5cd95960821b60448201526064016102f6565b60008054604051631c2d8fb360e31b81527f2517d59a36a86548e38734e8ab416f42afff4bca78706a66ad65750dae7f9e3760048201526001600160a01b039091169063e16c7d98906024015b60206040518083038186803b158015610ae157600080fd5b505afa158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b199190610c0c565b905090565b60008054604051631c2d8fb360e31b81527f6e58ad548d72b425ea94c15f453bf26caddb061d82b2551db7fdd3cefe0e994060048201526001600160a01b039091169063e16c7d9890602401610ac9565b600060208284031215610b8157600080fd5b5035919050565b60008060408385031215610b9b57600080fd5b50508035926020909101359150565b6001600160a01b0381168114610bbf57600080fd5b50565b600060208284031215610bd457600080fd5b813561092781610baa565b634e487b7160e01b600052601160045260246000fd5b600082821015610c0757610c07610bdf565b500390565b600060208284031215610c1e57600080fd5b815161092781610baa565b600082610c4657634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115610c5e57610c5e610bdf565b500190565b6000816000190483118215151615610c7d57610c7d610bdf565b500290565b600060208284031215610c9457600080fd5b8151801515811461092757600080fdfea264697066735822122038a3be6ebcad41c67dfb6b79971be280af806be29f54716b4573e7ec12cd640264736f6c63430008090033000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4

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

000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4

-----Decoded View---------------
Arg [0] : _controller (address): 0xd8e8328501e9645d16cf49539efc04f734606ee4

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


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.