Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60c06040 | 18471090 | 267 days ago | IN | Create: RewardEthToken | 0 ETH | 0.13454526 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RewardEthToken
Compiler Version
v0.7.5+commit.eb77ed08
Optimization Enabled:
Yes with 5000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/SafeCastUpgradeable.sol"; import "../presets/OwnablePausableUpgradeable.sol"; import "../interfaces/IStakedEthToken.sol"; import "../interfaces/IRewardEthToken.sol"; import "../interfaces/IMerkleDistributor.sol"; import "../interfaces/IFeesEscrow.sol"; import "../interfaces/IEthGenesisVault.sol"; import "../interfaces/IPool.sol"; import "./ERC20PermitUpgradeable.sol"; /** * @title RewardEthToken * * @dev RewardEthToken contract stores pool reward tokens. * If deploying contract for the first time, the `initialize` function should replace the `upgrade` function. */ contract RewardEthToken is IRewardEthToken, OwnablePausableUpgradeable, ERC20PermitUpgradeable { using SafeMathUpgradeable for uint256; using SafeCastUpgradeable for uint256; // @dev Address of the Vault contract. address public immutable override vault; // @dev Address of the Pool contract. IPool private immutable pool; // @dev Address of the StakedEthToken contract. IStakedEthToken private stakedEthToken; // @dev Address of the Oracles contract. address private oracles; // @dev Maps account address to its reward checkpoint. mapping(address => Checkpoint) public override checkpoints; // @dev Address where protocol fee will be paid. address public override protocolFeeRecipient; // @dev Protocol percentage fee. uint256 public override protocolFee; // @dev Total amount of rewards. uint128 public override totalRewards; // @dev Reward per token for user reward calculation. uint128 public override rewardPerToken; // @dev Last rewards update block number by oracles. uint256 public override lastUpdateBlockNumber; // @dev Address of the MerkleDistributor contract. address public override merkleDistributor; // @dev Maps account address to whether rewards are distributed through the merkle distributor. mapping(address => bool) public override rewardsDisabled; // @dev Address of the FeesEscrow contract. IFeesEscrow private feesEscrow; // @dev Total amount of penalties received. uint256 public override totalPenalty; /** * @dev Constructor * @dev Since the immutable variable value is stored in the bytecode, * its value would be shared among all proxies pointing to a given contract instead of each proxy’s storage. * @param _vault Address of the StakeWise V3 vault. * @param _pool Address of the StakeWise V2 pool. */ constructor(address _vault, address _pool) { vault = _vault; pool = IPool(_pool); } /** * @dev See {IRewardEthToken-setRewardsDisabled}. */ function setRewardsDisabled(address account, bool isDisabled) external override { require(msg.sender == address(stakedEthToken), "RewardEthToken: access denied"); require(rewardsDisabled[account] != isDisabled, "RewardEthToken: value did not change"); uint128 _rewardPerToken = rewardPerToken; checkpoints[account] = Checkpoint({ reward: _balanceOf(account, _rewardPerToken).toUint128(), rewardPerToken: _rewardPerToken }); rewardsDisabled[account] = isDisabled; emit RewardsToggled(account, isDisabled); } /** * @dev See {IRewardEthToken-setProtocolFeeRecipient}. */ function setProtocolFeeRecipient(address recipient) external override onlyAdmin { // can be address(0) to distribute fee through the Merkle Distributor protocolFeeRecipient = recipient; emit ProtocolFeeRecipientUpdated(recipient); } /** * @dev See {IRewardEthToken-setProtocolFee}. */ function setProtocolFee(uint256 _protocolFee) external override onlyAdmin { require(_protocolFee < 1e4, "RewardEthToken: invalid protocol fee"); protocolFee = _protocolFee; emit ProtocolFeeUpdated(_protocolFee); } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() external view override returns (uint256) { return totalRewards; } /** * @dev See {IRewardEthToken-totalAssets}. */ function totalAssets() public view override returns (uint256) { return uint256(totalRewards).add(stakedEthToken.totalSupply()); } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) external view override returns (uint256) { return _balanceOf(account, rewardPerToken); } function _balanceOf(address account, uint256 _rewardPerToken) internal view returns (uint256) { Checkpoint memory cp = checkpoints[account]; // skip calculating period reward when it has not changed or when the rewards are disabled if (_rewardPerToken == cp.rewardPerToken || rewardsDisabled[account]) return cp.reward; uint256 stakedEthAmount; if (account == address(0)) { // fetch merkle distributor current principal stakedEthAmount = stakedEthToken.distributorPrincipal(); } else { stakedEthAmount = stakedEthToken.balanceOf(account); } if (stakedEthAmount == 0) return cp.reward; // return checkpoint reward + current reward return _calculateNewReward(cp.reward, stakedEthAmount, _rewardPerToken.sub(cp.rewardPerToken)); } /** * @dev See {ERC20-_transfer}. */ function _transfer(address sender, address recipient, uint256 amount) internal override whenNotPaused { require(sender != address(0), "RewardEthToken: invalid sender"); require(recipient != address(0), "RewardEthToken: invalid receiver"); require(block.number > lastUpdateBlockNumber, "RewardEthToken: cannot transfer during rewards update"); uint128 _rewardPerToken = rewardPerToken; // gas savings checkpoints[sender] = Checkpoint({ reward: _balanceOf(sender, _rewardPerToken).sub(amount).toUint128(), rewardPerToken: _rewardPerToken }); checkpoints[recipient] = Checkpoint({ reward: _balanceOf(recipient, _rewardPerToken).add(amount).toUint128(), rewardPerToken: _rewardPerToken }); emit Transfer(sender, recipient, amount); } /** * @dev See {IRewardEthToken-updateRewardCheckpoint}. */ function updateRewardCheckpoint(address account) public override returns (bool accRewardsDisabled) { accRewardsDisabled = rewardsDisabled[account]; if (!accRewardsDisabled) _updateRewardCheckpoint(account, rewardPerToken); } function _updateRewardCheckpoint(address account, uint128 newRewardPerToken) internal { Checkpoint memory cp = checkpoints[account]; if (newRewardPerToken == cp.rewardPerToken) return; uint256 stakedEthAmount; if (account == address(0)) { // fetch merkle distributor current principal stakedEthAmount = stakedEthToken.distributorPrincipal(); } else { stakedEthAmount = stakedEthToken.balanceOf(account); } if (stakedEthAmount == 0) { checkpoints[account] = Checkpoint({ reward: cp.reward, rewardPerToken: newRewardPerToken }); } else { uint256 periodRewardPerToken = uint256(newRewardPerToken).sub(cp.rewardPerToken); checkpoints[account] = Checkpoint({ reward: _calculateNewReward(cp.reward, stakedEthAmount, periodRewardPerToken).toUint128(), rewardPerToken: newRewardPerToken }); } } function _calculateNewReward( uint256 currentReward, uint256 stakedEthAmount, uint256 periodRewardPerToken ) internal pure returns (uint256) { return currentReward.add(stakedEthAmount.mul(periodRewardPerToken).div(1e18)); } /** * @dev See {IRewardEthToken-updateRewardCheckpoints}. */ function updateRewardCheckpoints(address account1, address account2) public override returns (bool rewardsDisabled1, bool rewardsDisabled2) { rewardsDisabled1 = rewardsDisabled[account1]; rewardsDisabled2 = rewardsDisabled[account2]; if (!rewardsDisabled1 || !rewardsDisabled2) { uint128 newRewardPerToken = rewardPerToken; if (!rewardsDisabled1) _updateRewardCheckpoint(account1, newRewardPerToken); if (!rewardsDisabled2) _updateRewardCheckpoint(account2, newRewardPerToken); } } /** * @dev See {IRewardEthToken-updateTotalRewards}. */ function updateTotalRewards(int256 rewardsDelta) external override { require(msg.sender == address(vault), "RewardEthToken: access denied"); uint256 periodRewards; if (rewardsDelta > 0) { periodRewards = uint256(rewardsDelta); uint256 _totalPenalty = totalPenalty; // gas savings if (periodRewards <= _totalPenalty) { totalPenalty = _totalPenalty.sub(periodRewards); periodRewards = 0; } else if (_totalPenalty > 0) { periodRewards = periodRewards.sub(_totalPenalty); totalPenalty = 0; } } else if (rewardsDelta < 0) { uint256 _totalPenalty = totalPenalty; // gas savings _totalPenalty = _totalPenalty.add(uint256(-rewardsDelta)); require(_totalPenalty <= totalAssets(), "RewardEthToken: invalid penalty amount"); totalPenalty = _totalPenalty; } if (periodRewards == 0) { lastUpdateBlockNumber = block.number; emit RewardsUpdated(0, totalRewards, rewardPerToken, 0, 0); return; } // calculate protocol reward and new reward per token amount uint256 newTotalRewards = uint256(totalRewards).add(periodRewards); uint256 protocolReward = periodRewards.mul(protocolFee).div(1e4); uint256 prevRewardPerToken = rewardPerToken; uint256 newRewardPerToken = prevRewardPerToken.add(periodRewards.sub(protocolReward).mul(1e18).div(stakedEthToken.totalDeposits())); uint128 newRewardPerToken128 = newRewardPerToken.toUint128(); // store previous distributor rewards for period reward calculation uint256 prevDistributorBalance = _balanceOf(address(0), prevRewardPerToken); // update total rewards and new reward per token (totalRewards, rewardPerToken) = (newTotalRewards.toUint128(), newRewardPerToken128); uint256 newDistributorBalance = _balanceOf(address(0), newRewardPerToken); address _protocolFeeRecipient = protocolFeeRecipient; if (_protocolFeeRecipient == address(0) && protocolReward > 0) { // add protocol reward to the merkle distributor newDistributorBalance = newDistributorBalance.add(protocolReward); } else if (protocolReward > 0) { // update fee recipient's checkpoint and add its period reward checkpoints[_protocolFeeRecipient] = Checkpoint({ reward: _balanceOf(_protocolFeeRecipient, newRewardPerToken).add(protocolReward).toUint128(), rewardPerToken: newRewardPerToken128 }); } // update distributor's checkpoint if (newDistributorBalance != prevDistributorBalance) { checkpoints[address(0)] = Checkpoint({ reward: newDistributorBalance.toUint128(), rewardPerToken: newRewardPerToken128 }); } // transfer accumulated fees if (address(feesEscrow).balance > 0) { feesEscrow.transferToPool(); pool.transferToPoolEscrow(); } lastUpdateBlockNumber = block.number; emit RewardsUpdated( periodRewards, newTotalRewards, newRewardPerToken, newDistributorBalance.sub(prevDistributorBalance), _protocolFeeRecipient == address(0) ? protocolReward: 0 ); } function _burn(uint256 amount) private { uint128 _rewardPerToken = rewardPerToken; // gas savings checkpoints[msg.sender] = Checkpoint({ reward: _balanceOf(msg.sender, _rewardPerToken).sub(amount).toUint128(), rewardPerToken: _rewardPerToken }); totalRewards = uint256(totalRewards).sub(amount).toUint128(); emit Transfer(msg.sender, address(0), amount); } /** * @dev See {IRewardEthToken-migrate}. */ function migrate(address receiver, uint256 principal, uint256 reward) external override { require(receiver != address(0), "RewardEthToken: invalid receiver"); require(block.number > lastUpdateBlockNumber, "RewardEthToken: cannot migrate during rewards update"); // calculate amount of assets to migrate uint256 assets = principal.add(reward); uint256 _totalPenalty = totalPenalty; // gas savings if (_totalPenalty > 0) { uint256 _totalAssets = totalAssets(); // gas savings // apply penalty to assets uint256 assetsAfterPenalty = assets.mul(_totalAssets.sub(_totalPenalty)).div(_totalAssets); totalPenalty = _totalPenalty.add(assetsAfterPenalty).sub(assets); assets = assetsAfterPenalty; } require(assets > 0, "RewardEthToken: zero assets"); // burn rewards and principal if (reward > 0) _burn(reward); if (principal > 0) stakedEthToken.burn(msg.sender, principal); IEthGenesisVault(vault).migrate(receiver, assets); } /** * @dev See {IRewardEthToken-claim}. */ function claim(address account, uint256 amount) external override { require(msg.sender == merkleDistributor, "RewardEthToken: access denied"); require(account != address(0), "RewardEthToken: invalid account"); // update checkpoints, transfer amount from distributor to account uint128 _rewardPerToken = rewardPerToken; checkpoints[address(0)] = Checkpoint({ reward: _balanceOf(address(0), _rewardPerToken).sub(amount).toUint128(), rewardPerToken: _rewardPerToken }); checkpoints[account] = Checkpoint({ reward: _balanceOf(account, _rewardPerToken).add(amount).toUint128(), rewardPerToken: _rewardPerToken }); emit Transfer(address(0), account, amount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMathUpgradeable { /** * @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) { 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) { 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) { // 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) { 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) { 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) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @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) { require(b <= a, "SafeMath: subtraction overflow"); 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) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @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. 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) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); 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) { require(b > 0, "SafeMath: modulo by zero"); 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) { 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. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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) { 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) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCastUpgradeable { /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { require(value < 2**255, "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "../interfaces/IOwnablePausable.sol"; /** * @title OwnablePausableUpgradeable * * @dev Bundles Access Control, Pausable and Upgradeable contracts in one. * */ abstract contract OwnablePausableUpgradeable is IOwnablePausable, PausableUpgradeable, AccessControlUpgradeable { bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Modifier for checking whether the caller is an admin. */ modifier onlyAdmin() { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "OwnablePausable: access denied"); _; } /** * @dev Modifier for checking whether the caller is a pauser. */ modifier onlyPauser() { require(hasRole(PAUSER_ROLE, msg.sender), "OwnablePausable: access denied"); _; } // solhint-disable-next-line func-name-mixedcase function __OwnablePausableUpgradeable_init(address _admin) internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); __Pausable_init_unchained(); __OwnablePausableUpgradeable_init_unchained(_admin); } /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `PAUSER_ROLE` to the admin account. */ // solhint-disable-next-line func-name-mixedcase function __OwnablePausableUpgradeable_init_unchained(address _admin) internal initializer { _setupRole(DEFAULT_ADMIN_ROLE, _admin); _setupRole(PAUSER_ROLE, _admin); } /** * @dev See {IOwnablePausable-isAdmin}. */ function isAdmin(address _account) external override view returns (bool) { return hasRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-addAdmin}. */ function addAdmin(address _account) external override { grantRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-removeAdmin}. */ function removeAdmin(address _account) external override { revokeRole(DEFAULT_ADMIN_ROLE, _account); } /** * @dev See {IOwnablePausable-isPauser}. */ function isPauser(address _account) external override view returns (bool) { return hasRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-addPauser}. */ function addPauser(address _account) external override { grantRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-removePauser}. */ function removePauser(address _account) external override { revokeRole(PAUSER_ROLE, _account); } /** * @dev See {IOwnablePausable-pause}. */ function pause() external override onlyPauser { _pause(); } /** * @dev See {IOwnablePausable-unpause}. */ function unpause() external override onlyPauser { _unpause(); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; /** * @dev Interface of the StakedEthToken contract. */ interface IStakedEthToken is IERC20Upgradeable { /** * @dev Function for retrieving the total deposits amount. */ function totalDeposits() external view returns (uint256); /** * @dev Function for retrieving the principal amount of the distributor. */ function distributorPrincipal() external view returns (uint256); /** * @dev Function for toggling rewards for the account. * @param account - address of the account. * @param isDisabled - whether to disable account's rewards distribution. */ function toggleRewards(address account, bool isDisabled) external; /** * @dev Function for burning `amount` tokens from `account`. * Can only be called by RewardEthToken contract. * @param account - address of the account to burn tokens from. * @param amount - amount of tokens to burn. */ function burn(address account, uint256 amount) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "./IFeesEscrow.sol"; /** * @dev Interface of the RewardEthToken contract. */ interface IRewardEthToken is IERC20Upgradeable { /** * @dev Structure for storing information about user reward checkpoint. * @param rewardPerToken - user reward per token. * @param reward - user reward checkpoint. */ struct Checkpoint { uint128 reward; uint128 rewardPerToken; } /** * @dev Event for tracking updated protocol fee recipient. * @param recipient - address of the new fee recipient. */ event ProtocolFeeRecipientUpdated(address recipient); /** * @dev Event for tracking updated protocol fee. * @param protocolFee - new protocol fee. */ event ProtocolFeeUpdated(uint256 protocolFee); /** * @dev Event for tracking whether rewards distribution through merkle distributor is enabled/disabled. * @param account - address of the account. * @param isDisabled - whether rewards distribution is disabled. */ event RewardsToggled(address indexed account, bool isDisabled); /** * @dev Event for tracking rewards update by oracles. * @param periodRewards - rewards since the last update. * @param totalRewards - total amount of rewards. * @param rewardPerToken - calculated reward per token for account reward calculation. * @param distributorReward - distributor reward. * @param protocolReward - protocol reward. */ event RewardsUpdated( uint256 periodRewards, uint256 totalRewards, uint256 rewardPerToken, uint256 distributorReward, uint256 protocolReward ); /** * @dev Function for getting the address of the merkle distributor. */ function merkleDistributor() external view returns (address); /** * @dev Function for getting the address of the protocol fee recipient. */ function protocolFeeRecipient() external view returns (address); /** * @dev Function for getting the address of the vault. */ function vault() external view returns (address); /** * @dev Function for getting the total assets. */ function totalAssets() external view returns (uint256); /** * @dev Function for getting the total penalty. */ function totalPenalty() external view returns (uint256); /** * @dev Function for changing the protocol fee recipient's address. * @param recipient - new protocol fee recipient's address. */ function setProtocolFeeRecipient(address recipient) external; /** * @dev Function for getting protocol fee. The percentage fee users pay from their reward for using the pool service. */ function protocolFee() external view returns (uint256); /** * @dev Function for changing the protocol fee. * @param _protocolFee - new protocol fee. Must be less than 10000 (100.00%). */ function setProtocolFee(uint256 _protocolFee) external; /** * @dev Function for retrieving the total rewards amount. */ function totalRewards() external view returns (uint128); /** * @dev Function for retrieving the last total rewards update block number. */ function lastUpdateBlockNumber() external view returns (uint256); /** * @dev Function for retrieving current reward per token used for account reward calculation. */ function rewardPerToken() external view returns (uint128); /** * @dev Function for setting whether rewards are disabled for the account. * Can only be called by the `StakedEthToken` contract. * @param account - address of the account to disable rewards for. * @param isDisabled - whether the rewards will be disabled. */ function setRewardsDisabled(address account, bool isDisabled) external; /** * @dev Function for retrieving account's current checkpoint. * @param account - address of the account to retrieve the checkpoint for. */ function checkpoints(address account) external view returns (uint128, uint128); /** * @dev Function for checking whether account's reward will be distributed through the merkle distributor. * @param account - address of the account. */ function rewardsDisabled(address account) external view returns (bool); /** * @dev Function for updating account's reward checkpoint. * @param account - address of the account to update the reward checkpoint for. */ function updateRewardCheckpoint(address account) external returns (bool); /** * @dev Function for updating reward checkpoints for two accounts simultaneously (for gas savings). * @param account1 - address of the first account to update the reward checkpoint for. * @param account2 - address of the second account to update the reward checkpoint for. */ function updateRewardCheckpoints(address account1, address account2) external returns (bool, bool); /** * @dev Function for updating validators total rewards. * Can only be called by Vault contract. * @param rewardsDelta - the total rewards earned or penalties received. */ function updateTotalRewards(int256 rewardsDelta) external; /** * @dev Function for migrating to the StakeWise V3 Vault. * @param receiver - address of the account the tokens will be assigned to. * @param principal - amount of sETH2 tokens to migrate. * @param reward - amount of rETH2 tokens to migrate. */ function migrate(address receiver, uint256 principal, uint256 reward) external; /** * @dev Function for claiming rETH2 from the merkle distribution. * Can only be called by MerkleDistributor contract. * @param account - address of the account the tokens will be assigned to. * @param amount - amount of tokens to assign to the account. */ function claim(address account, uint256 amount) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "./IOracles.sol"; /** * @dev Interface of the MerkleDistributor contract. * Allows anyone to claim a token if they exist in a merkle root. */ interface IMerkleDistributor { /** * @dev Event for tracking merkle root updates. * @param sender - address of the new transaction sender. * @param merkleRoot - new merkle root hash. * @param merkleProofs - link to the merkle proofs. */ event MerkleRootUpdated( address indexed sender, bytes32 indexed merkleRoot, string merkleProofs ); /** * @dev Event for tracking periodic tokens distributions. * @param from - address to transfer the tokens from. * @param token - address of the token. * @param beneficiary - address of the beneficiary, the allocation is added to. * @param amount - amount of tokens to distribute. * @param startBlock - start block of the tokens distribution. * @param endBlock - end block of the tokens distribution. */ event PeriodicDistributionAdded( address indexed from, address indexed token, address indexed beneficiary, uint256 amount, uint256 startBlock, uint256 endBlock ); /** * @dev Event for tracking one time tokens distributions. * @param from - address to transfer the tokens from. * @param origin - predefined origin address to label the distribution. * @param token - address of the token. * @param amount - amount of tokens to distribute. * @param rewardsLink - link to the file where rewards are stored. */ event OneTimeDistributionAdded( address indexed from, address indexed origin, address indexed token, uint256 amount, string rewardsLink ); /** * @dev Event for tracking tokens' claims. * @param account - the address of the user that has claimed the tokens. * @param index - the index of the user that has claimed the tokens. * @param tokens - list of token addresses the user got amounts in. * @param amounts - list of user token amounts. */ event Claimed(address indexed account, uint256 index, address[] tokens, uint256[] amounts); /** * @dev Function for getting the current merkle root. */ function merkleRoot() external view returns (bytes32); /** * @dev Function for getting the RewardEthToken contract address. */ function rewardEthToken() external view returns (address); /** * @dev Function for getting the Oracles contract address. */ function oracles() external view returns (IOracles); /** * @dev Function for retrieving the last total merkle root update block number. */ function lastUpdateBlockNumber() external view returns (uint256); /** * @dev Function for upgrading the MerkleDistributor contract. The `initialize` function must be defined * if deploying contract for the first time that will initialize the state variables above. * @param _oracles - address of the Oracles contract. */ function upgrade(address _oracles) external; /** * @dev Function for checking the claimed bit map. * @param _merkleRoot - the merkle root hash. * @param _wordIndex - the word index of te bit map. */ function claimedBitMap(bytes32 _merkleRoot, uint256 _wordIndex) external view returns (uint256); /** * @dev Function for changing the merkle root. Can only be called by `Oracles` contract. * @param newMerkleRoot - new merkle root hash. * @param merkleProofs - URL to the merkle proofs. */ function setMerkleRoot(bytes32 newMerkleRoot, string calldata merkleProofs) external; /** * @dev Function for distributing tokens periodically for the number of blocks. * @param from - address of the account to transfer the tokens from. * @param token - address of the token. * @param beneficiary - address of the beneficiary. * @param amount - amount of tokens to distribute. * @param durationInBlocks - duration in blocks when the token distribution should be stopped. */ function distributePeriodically( address from, address token, address beneficiary, uint256 amount, uint256 durationInBlocks ) external; /** * @dev Function for distributing tokens one time. * @param from - address of the account to transfer the tokens from. * @param origin - predefined origin address to label the distribution. * @param token - address of the token. * @param amount - amount of tokens to distribute. * @param rewardsLink - link to the file where rewards for the accounts are stored. */ function distributeOneTime( address from, address origin, address token, uint256 amount, string calldata rewardsLink ) external; /** * @dev Function for checking whether the tokens were already claimed. * @param index - the index of the user that is part of the merkle root. */ function isClaimed(uint256 index) external view returns (bool); /** * @dev Function for claiming the given amount of tokens to the account address. * Reverts if the inputs are invalid or the oracles are currently updating the merkle root. * @param index - the index of the user that is part of the merkle root. * @param account - the address of the user that is part of the merkle root. * @param tokens - list of the token addresses. * @param amounts - list of token amounts. * @param merkleProof - an array of hashes to verify whether the user is part of the merkle root. */ function claim( uint256 index, address account, address[] calldata tokens, uint256[] calldata amounts, bytes32[] calldata merkleProof ) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; /** * @dev Interface of the FeesEscrow contract. */ interface IFeesEscrow { /** * @dev Event for tracking fees withdrawals to Pool contract. * @param amount - the number of fees. */ event FeesTransferred(uint256 amount); /** * @dev Function is used to transfer accumulated rewards to Pool contract. * Can only be executed by the RewardEthToken contract. */ function transferToPool() external returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; /** * @title IEthGenesisVault * @author StakeWise * @notice Defines the interface for the EthGenesisVault contract */ interface IEthGenesisVault { /** * @notice Function for migrating from StakeWise v2. Can be called only by RewardEthToken contract. * @param receiver The address of the receiver * @param assets The amount of assets migrated * @return shares The amount of shares minted */ function migrate(address receiver, uint256 assets) external returns (uint256 shares); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; import "./IDepositContract.sol"; /** * @dev Interface of the Pool contract. */ interface IPool { /** * @dev Event for tracking registered validators. * @param publicKey - validator public key. * @param operator - address of the validator operator. */ event ValidatorRegistered(bytes publicKey, address operator); /** * @dev Event for tracking scheduled deposit activation. * @param sender - address of the deposit sender. * @param validatorIndex - index of the activated validator. * @param value - deposit amount to be activated. */ event ActivationScheduled(address indexed sender, uint256 validatorIndex, uint256 value); /** * @dev Event for tracking activated deposits. * @param account - account the deposit was activated for. * @param validatorIndex - index of the activated validator. * @param value - amount activated. * @param sender - address of the transaction sender. */ event Activated(address indexed account, uint256 validatorIndex, uint256 value, address indexed sender); /** * @dev Event for tracking activated validators updates. * @param activatedValidators - new total amount of activated validators. * @param sender - address of the transaction sender. */ event ActivatedValidatorsUpdated(uint256 activatedValidators, address sender); /** * @dev Event for tracking updates to the minimal deposit amount considered for the activation period. * @param minActivatingDeposit - new minimal deposit amount considered for the activation. * @param sender - address of the transaction sender. */ event MinActivatingDepositUpdated(uint256 minActivatingDeposit, address sender); /** * @dev Event for tracking pending validators limit. * When it's exceeded, the deposits will be set for the activation. * @param pendingValidatorsLimit - pending validators percent limit. * @param sender - address of the transaction sender. */ event PendingValidatorsLimitUpdated(uint256 pendingValidatorsLimit, address sender); /** * @dev Event for tracking added deposits with partner. * @param partner - address of the partner. * @param amount - the amount added. */ event StakedWithPartner(address indexed partner, uint256 amount); /** * @dev Event for tracking added deposits with referrer. * @param referrer - address of the referrer. * @param amount - the amount added. */ event StakedWithReferrer(address indexed referrer, uint256 amount); /** * @dev Returns PoolEscrow contract address. */ function poolEscrow() external view returns (address); /** * @dev Function for receiving native tokens without minting sETH. */ function receiveFees() external payable; /** * @dev Function for transferring all ETH accumulated in Pool contract to PoolEscrow contract. */ function transferToPoolEscrow() external; }
// SPDX-License-Identifier: MIT // Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/drafts/ERC20PermitUpgradeable.sol pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/drafts/IERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/cryptography/ECDSAUpgradeable.sol"; import "./ERC20Upgradeable.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; mapping (address => CountersUpgradeable.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private _PERMIT_TYPEHASH; /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ // solhint-disable-next-line func-name-mixedcase function __ERC20Permit_init(string memory name) internal initializer { __EIP712_init_unchained(name, "1"); __ERC20Permit_init_unchained(); } // solhint-disable-next-line func-name-mixedcase function __ERC20Permit_init_unchained() internal initializer { _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); } /** * @dev See {IERC20Permit-permit}. */ function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override { // solhint-disable-next-line not-rely-on-time require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256( abi.encode( _PERMIT_TYPEHASH, owner, spender, value, _nonces[owner].current(), deadline ) ); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSAUpgradeable.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _nonces[owner].increment(); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSetUpgradeable.sol"; import "../utils/AddressUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; using AddressUpgradeable for address; struct RoleData { EnumerableSetUpgradeable.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./ContextUpgradeable.sol"; import "../proxy/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable { /** * @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. */ function __Pausable_init() internal initializer { __Context_init_unchained(); __Pausable_init_unchained(); } function __Pausable_init_unchained() internal initializer { _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()); } uint256[49] private __gap; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; /** * @dev Interface of the OwnablePausableUpgradeable and OwnablePausable contracts. */ interface IOwnablePausable { /** * @dev Function for checking whether an account has an admin role. * @param _account - account to check. */ function isAdmin(address _account) external view returns (bool); /** * @dev Function for assigning an admin role to the account. * Can only be called by an account with an admin role. * @param _account - account to assign an admin role to. */ function addAdmin(address _account) external; /** * @dev Function for removing an admin role from the account. * Can only be called by an account with an admin role. * @param _account - account to remove an admin role from. */ function removeAdmin(address _account) external; /** * @dev Function for checking whether an account has a pauser role. * @param _account - account to check. */ function isPauser(address _account) external view returns (bool); /** * @dev Function for adding a pauser role to the account. * Can only be called by an account with an admin role. * @param _account - account to assign a pauser role to. */ function addPauser(address _account) external; /** * @dev Function for removing a pauser role from the account. * Can only be called by an account with an admin role. * @param _account - account to remove a pauser role from. */ function removePauser(address _account) external; /** * @dev Function for pausing the contract. */ function pause() external; /** * @dev Function for unpausing the contract. */ function unpause() external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ 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; // solhint-disable-next-line no-inline-assembly 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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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"); // solhint-disable-next-line avoid-low-level-calls (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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /* * @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 GSN 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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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: AGPL-3.0-only pragma solidity 0.7.5; pragma abicoder v2; /** * @dev Interface of the Oracles contract. */ interface IOracles { /** * @dev Event for tracking oracle merkle root votes. * @param sender - address of the transaction sender. * @param oracle - address of the account which submitted vote. * @param nonce - current nonce. * @param merkleRoot - new merkle root. * @param merkleProofs - link to the merkle proofs. */ event MerkleRootVoteSubmitted( address indexed sender, address indexed oracle, uint256 nonce, bytes32 indexed merkleRoot, string merkleProofs ); /** * @dev Event for tracking new or updates oracles. * @param oracle - address of new or updated oracle. */ event OracleAdded(address indexed oracle); /** * @dev Event for tracking removed oracles. * @param oracle - address of removed oracle. */ event OracleRemoved(address indexed oracle); /** * @dev Function for checking whether an account has an oracle role. * @param account - account to check. */ function isOracle(address account) external view returns (bool); /** * @dev Function for checking whether the oracles are currently voting for new merkle root. */ function isMerkleRootVoting() external view returns (bool); /** * @dev Function for retrieving current rewards nonce. */ function currentRewardsNonce() external view returns (uint256); /** * @dev Function for adding an oracle role to the account. * Can only be called by an account with an admin role. * @param account - account to assign an oracle role to. */ function addOracle(address account) external; /** * @dev Function for removing an oracle role from the account. * Can only be called by an account with an admin role. * @param account - account to remove an oracle role from. */ function removeOracle(address account) external; /** * @dev Function for submitting new merkle root. * The quorum of signatures over the same data is required to submit the new value. * @param merkleRoot - hash of the new merkle root. * @param merkleProofs - link to the merkle proofs. * @param signatures - oracles' signatures. */ function submitMerkleRoot( bytes32 merkleRoot, string calldata merkleProofs, bytes[] calldata signatures ) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.7.5; // This interface is designed to be compatible with the Vyper version. /// @notice This is the Ethereum 2.0 deposit contract interface. /// For more information see the Phase 0 specification under https://github.com/ethereum/eth2.0-specs /// https://github.com/ethereum/eth2.0-specs/blob/dev/solidity_deposit_contract/deposit_contract.sol interface IDepositContract { /// @notice A processed deposit event. event DepositEvent( bytes pubkey, bytes withdrawal_credentials, bytes amount, bytes signature, bytes index ); /// @notice Submit a Phase 0 DepositData object. /// @param pubkey A BLS12-381 public key. /// @param withdrawal_credentials Commitment to a public key for withdrawals. /// @param signature A BLS12-381 signature. /// @param deposit_data_root The SHA-256 hash of the SSZ-encoded DepositData object. /// Used as a protection against malformed input. function deposit( bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature, bytes32 deposit_data_root ) external payable; /// @notice Query the current deposit root hash. /// @return The deposit root hash. function get_deposit_root() external view returns (bytes32); /// @notice Query the current deposit count. /// @return The deposit count encoded as a little endian 64-bit number. function get_deposit_count() external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../math/SafeMathUpgradeable.sol"; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath} * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never * directly accessed. */ library CountersUpgradeable { using SafeMathUpgradeable for uint256; struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { // The {SafeMath} overflow check can be skipped here, see the comment at the top counter._value += 1; } function decrement(Counter storage counter) internal { counter._value = counter._value.sub(1); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens, * given `owner`'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal initializer { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal initializer { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) { return keccak256( abi.encode( typeHash, name, version, _getChainId(), address(this) ) ); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash)); } function _getChainId() private view returns (uint256 chainId) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 // solhint-disable-next-line no-inline-assembly assembly { chainId := chainid() } } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { revert("ECDSA: invalid signature length"); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return recover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value"); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * replicates the behavior of the * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`] * JSON-RPC method. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } }
// SPDX-License-Identifier: MIT // Adopted from https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v3.4.0/contracts/token/ERC20/ERC20Upgradeable.sol pragma solidity 0.7.5; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ abstract contract ERC20Upgradeable is Initializable, IERC20Upgradeable { using SafeMathUpgradeable for uint256; mapping (address => mapping (address => uint256)) private _allowances; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ // solhint-disable-next-line func-name-mixedcase function __ERC20_init(string memory name_, string memory symbol_) internal initializer { __ERC20_init_unchained(name_, symbol_); } // solhint-disable-next-line func-name-mixedcase function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(msg.sender, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][msg.sender]; if (sender != msg.sender && currentAllowance != uint256(-1)) { _approve(sender, msg.sender, currentAllowance.sub(amount)); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual; /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } uint256[44] private __gap; }
{ "optimizer": { "enabled": true, "runs": 5000000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"ProtocolFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"}],"name":"ProtocolFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isDisabled","type":"bool"}],"name":"RewardsToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"periodRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"distributorReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolReward","type":"uint256"}],"name":"RewardsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"addPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"checkpoints","outputs":[{"internalType":"uint128","name":"reward","type":"uint128"},{"internalType":"uint128","name":"rewardPerToken","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isPauser","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleDistributor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"principal","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"removePauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardsDisabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_protocolFee","type":"uint256"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"setProtocolFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isDisabled","type":"bool"}],"name":"setRewardsDisabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewards","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"updateRewardCheckpoint","outputs":[{"internalType":"bool","name":"accRewardsDisabled","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account1","type":"address"},{"internalType":"address","name":"account2","type":"address"}],"name":"updateRewardCheckpoints","outputs":[{"internalType":"bool","name":"rewardsDisabled1","type":"bool"},{"internalType":"bool","name":"rewardsDisabled2","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"rewardsDelta","type":"int256"}],"name":"updateTotalRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b50604051620043d1380380620043d18339818101604052604081101561003557600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c6143466200008b600039806120f2525080611a9f528061267852806128e752506143466000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c8063787dce3d116101bd578063c13c29ac116100f9578063dd62ed3e116100a2578063e6af61c81161007c578063e6af61c814610b71578063f4537f7814610b79578063fbfa77cf14610b81578063fc22d0e514610b8957610341565b8063dd62ed3e14610afb578063e521cb9214610b36578063e63ab1e914610b6957610341565b8063d505accf116100d3578063d505accf146109f0578063d547741f14610a4e578063dbb51d6e14610a8757610341565b8063c13c29ac146109ae578063ca15c873146109cb578063cd3daf9d146109e857610341565b806395d89b4111610166578063a9059cbb11610140578063a9059cbb1461092c578063aad3ec9614610965578063b0e21e8a1461099e578063b4c6e416146109a657610341565b806395d89b41146108e3578063a217fddf146108eb578063a457c2d7146108f357610341565b80638456cb59116101975780638456cb591461087f5780639010d07c1461088757806391d14854146108aa57610341565b8063787dce3d146107fc5780637ecebe001461081957806382dc1ec41461084c57610341565b80633644e5151161028c5780635bdc6d7e116102355780636a9ecedb1161020f5780636a9ecedb146107285780636b2c0f5514610763578063704802751461079657806370a08231146107c957610341565b80635bdc6d7e146106bc5780635c975abb146106ef57806364df049e146106f757610341565b80633b0c9d90116102665780633b0c9d901461062b5780633f4ba83a1461068157806346fbf68e1461068957610341565b80633644e515146105b157806336568abe146105b957806339509351146105f257610341565b806318160ddd116102ee57806324d7806c116102c857806324d7806c146105275780632f2ff15d1461055a578063313ce5671461059357610341565b806318160ddd146104bf57806323b872dd146104c7578063248a9ca31461050a57610341565b8063095ea7b31161031f578063095ea7b3146104245780630e15561a1461045d5780631785f53c1461048a57610341565b806301ba793b1461034657806301e1d1141461038d57806306fdde03146103a7575b600080fd5b6103796004803603602081101561035c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610bc8565b604080519115158252519081900360200190f35b610395610c31565b60408051918252519081900360200190f35b6103af610cec565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103e95781810151838201526020016103d1565b50505050905090810190601f1680156104165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103796004803603604081101561043a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610da0565b610465610db7565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104bd600480360360208110156104a057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610dd0565b005b610395610dde565b610379600480360360608110156104dd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610df7565b6103956004803603602081101561052057600080fd5b5035610e89565b6103796004803603602081101561053d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e9e565b6104bd6004803603604081101561057057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610eaa565b61059b610f30565b6040805160ff9092168252519081900360200190f35b610395610f39565b6104bd600480360360408110156105cf57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610f43565b6103796004803603604081101561060857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610fd8565b6106666004803603604081101561064157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661101b565b60408051921515835290151560208301528051918290030190f35b6104bd6110b4565b6103796004803603602081101561069f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611153565b610379600480360360208110156106d257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661117f565b610379611195565b6106ff61119e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104bd6004803603604081101561073e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013515156111bb565b6104bd6004803603602081101561077957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611416565b6104bd600480360360208110156107ac57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611440565b610395600480360360208110156107df57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661144b565b6104bd6004803603602081101561081257600080fd5b5035611483565b6103956004803603602081101561082f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661158f565b6104bd6004803603602081101561086257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166115bd565b6104bd6115e7565b6106ff6004803603604081101561089d57600080fd5b5080359060200135611684565b610379600480360360408110156108c057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166116a3565b6103af6116bb565b61039561173a565b6103796004803603604081101561090957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561173f565b6103796004803603604081101561094257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611782565b6104bd6004803603604081101561097b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561178f565b610395611a79565b610395611a80565b6104bd600480360360208110156109c457600080fd5b5035611a87565b610395600480360360208110156109e157600080fd5b50356121e0565b6104656121f7565b6104bd600480360360e0811015610a0657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135612224565b6104bd60048036036040811015610a6457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16612456565b610aba60048036036020811015610a9d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166124c9565b60405180836fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61039560048036036040811015610b1157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516612506565b6104bd60048036036020811015610b4c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661253e565b61039561262e565b610395612652565b6106ff612659565b6106ff612676565b6104bd60048036036060811015610b9f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020810135906040013561269a565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610136602052604090205460ff1680610c2c5761013354610c2c90839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166129a9565b919050565b6000610ce761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9f57600080fd5b505afa158015610cb3573d6000803e3d6000fd5b505050506040513d6020811015610cc957600080fd5b5051610133546fffffffffffffffffffffffffffffffff1690612d32565b905090565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d965780601f10610d6b57610100808354040283529160200191610d96565b820191906000526020600020905b815481529060010190602001808311610d7957829003601f168201915b5050505050905090565b6000610dad338484612da6565b5060015b92915050565b610133546fffffffffffffffffffffffffffffffff1681565b610ddb600082612456565b50565b610133546fffffffffffffffffffffffffffffffff1690565b6000610e04848484612eed565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610e6557507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610e7e57610e7e8533610e798487613295565b612da6565b506001949350505050565b60009081526065602052604090206002015490565b6000610db181836116a3565b600082815260656020526040902060020154610ecd90610ec861330c565b6116a3565b610f22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806140da602f913960400191505060405180910390fd5b610f2c8282613310565b5050565b609a5460ff1690565b6000610ce7613393565b610f4b61330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610fce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806142e2602f913960400191505060405180910390fd5b610f2c82826133ce565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610dad918590610e799086612d32565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610136602052604080822054928416825290205460ff918216911681158061105e575080155b156110ad576101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff168261109c5761109c85826129a9565b816110ab576110ab84826129a9565b505b9250929050565b6110de7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336116a3565b61114957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611151613451565b565b6000610db17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a836116a3565b6101366020526000908152604090205460ff1681565b60335460ff1690565b6101315473ffffffffffffffffffffffffffffffffffffffff1681565b61012e5473ffffffffffffffffffffffffffffffffffffffff16331461124257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152610136602052604090205460ff16151581151514156112c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061429a6024913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16908061131161130c868561353f565b6137cf565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925561013683529083902080548615157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911681179091558351908152925190927fef7566603852520a8be81b2924311bce365c73c01809a279f86ed6c6f69f824992908290030190a2505050565b610ddb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82612456565b610ddb600082610eaa565b61013354600090610db190839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661353f565b61148e6000336116a3565b6114f957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b6127108110611553576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806142be6024913960400191505060405180910390fd5b6101328190556040805182815290517fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de409181900360200190a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb60205260408120610db19061383e565b610ddb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610eaa565b6116117f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336116a3565b61167c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611151613842565b600082815260656020526040812061169c908361390a565b9392505050565b600082815260656020526040812061169c9083613916565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d965780601f10610d6b57610100808354040283529160200191610d96565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610dad918590610e799086613295565b6000610dad338484612eed565b6101355473ffffffffffffffffffffffffffffffffffffffff16331461181657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661189857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526577617264457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff1690806118e761130c856118e160008761353f565b90613295565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905260008052610130835283517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805495909401517fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169083161782167001000000000000000000000000000000009490921693909302179055604080518082019091529081906119aa9061130c9086906119a490899061353f565b90612d32565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925583518681529351909391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b6101325481565b6101345481565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614611b2b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b600080821315611b795750610138548190808211611b5a57611b4d8183613295565b6101385560009150611b73565b8015611b7357611b6a8282613295565b60006101385591505b50611bfb565b6000821215611bfb5761013854611b94816000859003612d32565b9050611b9e610c31565b811115611bf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806141bb6026913960400191505060405180910390fd5b610138555b80611c87574361013455610133546040805160008082526fffffffffffffffffffffffffffffffff808516602084015270010000000000000000000000000000000090940490931681830152606081018390526080810192909252517fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd79181900360a00190a150610ddb565b61013354600090611caa906fffffffffffffffffffffffffffffffff1683612d32565b90506000611cd0612710611cca610132548661393890919063ffffffff16565b906139ab565b6101335461012e54604080517f7d88209700000000000000000000000000000000000000000000000000000000815290519394507001000000000000000000000000000000009092046fffffffffffffffffffffffffffffffff1692600092611dc492611dbd9273ffffffffffffffffffffffffffffffffffffffff90911691637d882097916004808301926020929190829003018186803b158015611d7557600080fd5b505afa158015611d89573d6000803e3d6000fd5b505050506040513d6020811015611d9f57600080fd5b5051611cca670de0b6b3a7640000611db78a89613295565b90613938565b8390612d32565b90506000611dd1826137cf565b90506000611de060008561353f565b9050611deb866137cf565b61013380547fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff91821670010000000000000000000000000000000087841602171692169190911790556000611e51818561353f565b6101315490915073ffffffffffffffffffffffffffffffffffffffff1680158015611e7c5750600087115b15611e9257611e8b8288612d32565b9150611f46565b8615611f46576040518060400160405280611eb461130c8a6119a4868b61353f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff841660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317161790555b828214611ffb576040518060400160405280611f61846137cf565b6fffffffffffffffffffffffffffffffff908116825286811660209283015260008052610130825282517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805494909301518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317169190911790555b6101375473ffffffffffffffffffffffffffffffffffffffff1631156121525761013760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe1101166040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561208657600080fd5b505af115801561209a573d6000803e3d6000fd5b505050506040513d60208110156120b057600080fd5b5050604080517f13df7ca6000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916313df7ca691600480830192600092919082900301818387803b15801561213957600080fd5b505af115801561214d573d6000803e3d6000fd5b505050505b43610134557fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd78989876121858688613295565b73ffffffffffffffffffffffffffffffffffffffff8616156121a85760006121aa565b8b5b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190a150505050505050505050565b6000818152606560205260408120610db190613a2c565b6101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1681565b8342111561229357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc548888886122e260fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061383e565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061236582613a37565b9050600061237582878787613a9e565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461241157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb6020526040902061243f90613c8c565b61244a8a8a8a612da6565b50505050505050505050565b60008281526065602052604090206002015461247490610ec861330c565b610fce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806142036030913960400191505060405180910390fd5b610130602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b6125496000336116a3565b6125b457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610131805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d9181900360200190a150565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101385481565b6101355473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b73ffffffffffffffffffffffffffffffffffffffff831661271c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b610134544311612777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061412b6034913960400191505060405180910390fd5b60006127838383612d32565b6101385490915080156127ce57600061279a610c31565b905060006127b682611cca6127af8287613295565b8790613938565b90506127c6846118e18584612d32565b610138559250505b6000821161283d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f526577617264457468546f6b656e3a207a65726f206173736574730000000000604482015290519081900360640190fd5b821561284c5761284c83613c95565b83156128e55761012e54604080517f9dc29fac00000000000000000000000000000000000000000000000000000000815233600482015260248101879052905173ffffffffffffffffffffffffffffffffffffffff90921691639dc29fac9160448082019260009290919082900301818387803b1580156128cc57600080fd5b505af11580156128e0573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663ad68ebf786846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561297657600080fd5b505af115801561298a573d6000803e3d6000fd5b505050506040513d60208110156129a057600080fd5b50505050505050565b6129b16140a0565b5073ffffffffffffffffffffffffffffffffffffffff8216600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff8082168452700100000000000000000000000000000000909104811691830182905283161415612a265750610f2c565b600073ffffffffffffffffffffffffffffffffffffffff8416612adf5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612aac57600080fd5b505afa158015612ac0573d6000803e3d6000fd5b505050506040513d6020811015612ad657600080fd5b50519050612b82565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152915191909216916370a08231916024808301926020929190829003018186803b158015612b5357600080fd5b505afa158015612b67573d6000803e3d6000fd5b505050506040513d6020811015612b7d57600080fd5b505190505b80612c2b5760408051808201825283516fffffffffffffffffffffffffffffffff9081168252858116602080840191825273ffffffffffffffffffffffffffffffffffffffff89166000908152610130909152939093209151825493518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716919091179055612d2c565b6000612c6883602001516fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff1661329590919063ffffffff16565b90506040518060400160405280612c9961130c86600001516fffffffffffffffffffffffffffffffff168686613def565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff881660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716179055505b50505050565b60008282018381101561169c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316612e12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806142766024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216612e7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141096022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b612ef5611195565b15612f6157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316612fe357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f526577617264457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661306557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b6101345443116130c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603581526020018061415f6035913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16908061310861130c856118e1898761353f565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905273ffffffffffffffffffffffffffffffffffffffff8816600090815261013084526040908190208551815496909501518416700100000000000000000000000000000000029484167fffffffffffffffffffffffffffffffff000000000000000000000000000000009096169590951790921692909217909255815180830190925281906131c29061130c9086906119a490899061353f565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff8681166000818152610130855260409081902086518154978701517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090981690861617851670010000000000000000000000000000000097909516969096029390931790945581518681529151908816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a350505050565b60008282111561330657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b60008281526065602052604090206133289082613e19565b15610f2c5761333561330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ce77f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133c1613e3b565b6133c9613e41565b613e47565b60008281526065602052604090206133e69082613eb6565b15610f2c576133f361330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b613459611195565b6134c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61351561330c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b60006135496140a0565b5073ffffffffffffffffffffffffffffffffffffffff8316600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff8082168452700100000000000000000000000000000000909104169082018190528314806135e2575073ffffffffffffffffffffffffffffffffffffffff84166000908152610136602052604090205460ff165b1561360157516fffffffffffffffffffffffffffffffff169050610db1565b600073ffffffffffffffffffffffffffffffffffffffff85166136ba5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561368757600080fd5b505afa15801561369b573d6000803e3d6000fd5b505050506040513d60208110156136b157600080fd5b5051905061375d565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561372e57600080fd5b505afa158015613742573d6000803e3d6000fd5b505050506040513d602081101561375857600080fd5b505190505b8061377d5750516fffffffffffffffffffffffffffffffff169050610db1565b6137c682600001516fffffffffffffffffffffffffffffffff16826137c185602001516fffffffffffffffffffffffffffffffff168861329590919063ffffffff16565b613def565b95945050505050565b6000700100000000000000000000000000000000821061383a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806141946027913960400191505060405180910390fd5b5090565b5490565b61384a611195565b156138b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861351561330c565b600061169c8383613ed8565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613f56565b60008261394757506000610db1565b8282028284828161395457fe5b041461169c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806142556021913960400191505060405180910390fd5b6000808211613a1b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381613a2457fe5b049392505050565b6000610db18261383e565b6000613a41613393565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613b19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141e16022913960400191505060405180910390fd5b8360ff16601b1480613b2e57508360ff16601c145b613b83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806142336022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015613bdf573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166137c657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b80546001019055565b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080613cdd61130c856118e1338761353f565b6fffffffffffffffffffffffffffffffff90811682528381166020928301523360009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931781169190911790915561013354613d709161130c911684613295565b61013380547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9290921691909117905560408051838152905160009133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef916020908290030190a35050565b6000613e11613e0a670de0b6b3a7640000611cca8686613938565b8590612d32565b949350505050565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613f6e565b60c75490565b60c85490565b6000838383613e54613fb8565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613fbc565b81546000908210613f34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806140b86022913960400191505060405180910390fd5b826000018281548110613f4357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b6000613f7a8383613f56565b613fb057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610db1565b506000610db1565b4690565b600081815260018301602052604081205480156140965783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808301919081019060009087908390811061400d57fe5b906000526020600020015490508087600001848154811061402a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061405a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610db1565b6000915050610db1565b60408051808201909152600080825260208201529056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a20617070726f766520746f20746865207a65726f2061646472657373526577617264457468546f6b656e3a2063616e6e6f74206d69677261746520647572696e67207265776172647320757064617465526577617264457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746553616665436173743a2076616c756520646f65736e27742066697420696e203132382062697473526577617264457468546f6b656e3a20696e76616c69642070656e616c747920616d6f756e7445434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373526577617264457468546f6b656e3a2076616c756520646964206e6f74206368616e6765526577617264457468546f6b656e3a20696e76616c69642070726f746f636f6c20666565416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122008ca2b6ab7b05ef924f47c7d3c4fcba0d154066707580149191781d949105e4064736f6c63430007050033000000000000000000000000ac0f906e433d58fa868f936e8a43230473652885000000000000000000000000c874b064f465bdd6411d45734b56fac750cda29a
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103415760003560e01c8063787dce3d116101bd578063c13c29ac116100f9578063dd62ed3e116100a2578063e6af61c81161007c578063e6af61c814610b71578063f4537f7814610b79578063fbfa77cf14610b81578063fc22d0e514610b8957610341565b8063dd62ed3e14610afb578063e521cb9214610b36578063e63ab1e914610b6957610341565b8063d505accf116100d3578063d505accf146109f0578063d547741f14610a4e578063dbb51d6e14610a8757610341565b8063c13c29ac146109ae578063ca15c873146109cb578063cd3daf9d146109e857610341565b806395d89b4111610166578063a9059cbb11610140578063a9059cbb1461092c578063aad3ec9614610965578063b0e21e8a1461099e578063b4c6e416146109a657610341565b806395d89b41146108e3578063a217fddf146108eb578063a457c2d7146108f357610341565b80638456cb59116101975780638456cb591461087f5780639010d07c1461088757806391d14854146108aa57610341565b8063787dce3d146107fc5780637ecebe001461081957806382dc1ec41461084c57610341565b80633644e5151161028c5780635bdc6d7e116102355780636a9ecedb1161020f5780636a9ecedb146107285780636b2c0f5514610763578063704802751461079657806370a08231146107c957610341565b80635bdc6d7e146106bc5780635c975abb146106ef57806364df049e146106f757610341565b80633b0c9d90116102665780633b0c9d901461062b5780633f4ba83a1461068157806346fbf68e1461068957610341565b80633644e515146105b157806336568abe146105b957806339509351146105f257610341565b806318160ddd116102ee57806324d7806c116102c857806324d7806c146105275780632f2ff15d1461055a578063313ce5671461059357610341565b806318160ddd146104bf57806323b872dd146104c7578063248a9ca31461050a57610341565b8063095ea7b31161031f578063095ea7b3146104245780630e15561a1461045d5780631785f53c1461048a57610341565b806301ba793b1461034657806301e1d1141461038d57806306fdde03146103a7575b600080fd5b6103796004803603602081101561035c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610bc8565b604080519115158252519081900360200190f35b610395610c31565b60408051918252519081900360200190f35b6103af610cec565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103e95781810151838201526020016103d1565b50505050905090810190601f1680156104165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103796004803603604081101561043a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610da0565b610465610db7565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104bd600480360360208110156104a057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610dd0565b005b610395610dde565b610379600480360360608110156104dd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610df7565b6103956004803603602081101561052057600080fd5b5035610e89565b6103796004803603602081101561053d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e9e565b6104bd6004803603604081101561057057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610eaa565b61059b610f30565b6040805160ff9092168252519081900360200190f35b610395610f39565b6104bd600480360360408110156105cf57600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16610f43565b6103796004803603604081101561060857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610fd8565b6106666004803603604081101561064157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661101b565b60408051921515835290151560208301528051918290030190f35b6104bd6110b4565b6103796004803603602081101561069f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611153565b610379600480360360208110156106d257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661117f565b610379611195565b6106ff61119e565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6104bd6004803603604081101561073e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013515156111bb565b6104bd6004803603602081101561077957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611416565b6104bd600480360360208110156107ac57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611440565b610395600480360360208110156107df57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661144b565b6104bd6004803603602081101561081257600080fd5b5035611483565b6103956004803603602081101561082f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661158f565b6104bd6004803603602081101561086257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166115bd565b6104bd6115e7565b6106ff6004803603604081101561089d57600080fd5b5080359060200135611684565b610379600480360360408110156108c057600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff166116a3565b6103af6116bb565b61039561173a565b6103796004803603604081101561090957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561173f565b6103796004803603604081101561094257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611782565b6104bd6004803603604081101561097b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561178f565b610395611a79565b610395611a80565b6104bd600480360360208110156109c457600080fd5b5035611a87565b610395600480360360208110156109e157600080fd5b50356121e0565b6104656121f7565b6104bd600480360360e0811015610a0657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135612224565b6104bd60048036036040811015610a6457600080fd5b508035906020013573ffffffffffffffffffffffffffffffffffffffff16612456565b610aba60048036036020811015610a9d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166124c9565b60405180836fffffffffffffffffffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b61039560048036036040811015610b1157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516612506565b6104bd60048036036020811015610b4c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661253e565b61039561262e565b610395612652565b6106ff612659565b6106ff612676565b6104bd60048036036060811015610b9f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020810135906040013561269a565b73ffffffffffffffffffffffffffffffffffffffff81166000908152610136602052604090205460ff1680610c2c5761013354610c2c90839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff166129a9565b919050565b6000610ce761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9f57600080fd5b505afa158015610cb3573d6000803e3d6000fd5b505050506040513d6020811015610cc957600080fd5b5051610133546fffffffffffffffffffffffffffffffff1690612d32565b905090565b60988054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d965780601f10610d6b57610100808354040283529160200191610d96565b820191906000526020600020905b815481529060010190602001808311610d7957829003601f168201915b5050505050905090565b6000610dad338484612da6565b5060015b92915050565b610133546fffffffffffffffffffffffffffffffff1681565b610ddb600082612456565b50565b610133546fffffffffffffffffffffffffffffffff1690565b6000610e04848484612eed565b73ffffffffffffffffffffffffffffffffffffffff84166000818152609760209081526040808320338085529252909120549114801590610e6557507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610e7e57610e7e8533610e798487613295565b612da6565b506001949350505050565b60009081526065602052604090206002015490565b6000610db181836116a3565b600082815260656020526040902060020154610ecd90610ec861330c565b6116a3565b610f22576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806140da602f913960400191505060405180910390fd5b610f2c8282613310565b5050565b609a5460ff1690565b6000610ce7613393565b610f4b61330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610fce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806142e2602f913960400191505060405180910390fd5b610f2c82826133ce565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610dad918590610e799086612d32565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152610136602052604080822054928416825290205460ff918216911681158061105e575080155b156110ad576101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff168261109c5761109c85826129a9565b816110ab576110ab84826129a9565b505b9250929050565b6110de7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336116a3565b61114957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611151613451565b565b6000610db17f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a836116a3565b6101366020526000908152604090205460ff1681565b60335460ff1690565b6101315473ffffffffffffffffffffffffffffffffffffffff1681565b61012e5473ffffffffffffffffffffffffffffffffffffffff16331461124257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152610136602052604090205460ff16151581151514156112c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061429a6024913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16908061131161130c868561353f565b6137cf565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925561013683529083902080548615157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911681179091558351908152925190927fef7566603852520a8be81b2924311bce365c73c01809a279f86ed6c6f69f824992908290030190a2505050565b610ddb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82612456565b610ddb600082610eaa565b61013354600090610db190839070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1661353f565b61148e6000336116a3565b6114f957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b6127108110611553576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806142be6024913960400191505060405180910390fd5b6101328190556040805182815290517fd10d75876659a287a59a6ccfa2e3fff42f84d94b542837acd30bc184d562de409181900360200190a150565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260fb60205260408120610db19061383e565b610ddb7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a82610eaa565b6116117f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336116a3565b61167c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b611151613842565b600082815260656020526040812061169c908361390a565b9392505050565b600082815260656020526040812061169c9083613916565b60998054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d965780601f10610d6b57610100808354040283529160200191610d96565b600081565b33600081815260976020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091610dad918590610e799086613295565b6000610dad338484612eed565b6101355473ffffffffffffffffffffffffffffffffffffffff16331461181657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661189857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526577617264457468546f6b656e3a20696e76616c6964206163636f756e7400604482015290519081900360640190fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff1690806118e761130c856118e160008761353f565b90613295565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905260008052610130835283517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805495909401517fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169083161782167001000000000000000000000000000000009490921693909302179055604080518082019091529081906119aa9061130c9086906119a490899061353f565b90612d32565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff861660008181526101308452604080822086518154978701518616700100000000000000000000000000000000029086167fffffffffffffffffffffffffffffffff00000000000000000000000000000000909816979097179094169590951790925583518681529351909391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a3505050565b6101325481565b6101345481565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ac0f906e433d58fa868f936e8a432304736528851614611b2b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f526577617264457468546f6b656e3a206163636573732064656e696564000000604482015290519081900360640190fd5b600080821315611b795750610138548190808211611b5a57611b4d8183613295565b6101385560009150611b73565b8015611b7357611b6a8282613295565b60006101385591505b50611bfb565b6000821215611bfb5761013854611b94816000859003612d32565b9050611b9e610c31565b811115611bf6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806141bb6026913960400191505060405180910390fd5b610138555b80611c87574361013455610133546040805160008082526fffffffffffffffffffffffffffffffff808516602084015270010000000000000000000000000000000090940490931681830152606081018390526080810192909252517fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd79181900360a00190a150610ddb565b61013354600090611caa906fffffffffffffffffffffffffffffffff1683612d32565b90506000611cd0612710611cca610132548661393890919063ffffffff16565b906139ab565b6101335461012e54604080517f7d88209700000000000000000000000000000000000000000000000000000000815290519394507001000000000000000000000000000000009092046fffffffffffffffffffffffffffffffff1692600092611dc492611dbd9273ffffffffffffffffffffffffffffffffffffffff90911691637d882097916004808301926020929190829003018186803b158015611d7557600080fd5b505afa158015611d89573d6000803e3d6000fd5b505050506040513d6020811015611d9f57600080fd5b5051611cca670de0b6b3a7640000611db78a89613295565b90613938565b8390612d32565b90506000611dd1826137cf565b90506000611de060008561353f565b9050611deb866137cf565b61013380547fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffffff91821670010000000000000000000000000000000087841602171692169190911790556000611e51818561353f565b6101315490915073ffffffffffffffffffffffffffffffffffffffff1680158015611e7c5750600087115b15611e9257611e8b8288612d32565b9150611f46565b8615611f46576040518060400160405280611eb461130c8a6119a4868b61353f565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff841660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317161790555b828214611ffb576040518060400160405280611f61846137cf565b6fffffffffffffffffffffffffffffffff908116825286811660209283015260008052610130825282517f363eca0a79dc8ec297995f86b12cc61391ff0de52f1ba01ca23e9716f742e413805494909301518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff0000000000000000000000000000000090941693909317169190911790555b6101375473ffffffffffffffffffffffffffffffffffffffff1631156121525761013760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe1101166040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561208657600080fd5b505af115801561209a573d6000803e3d6000fd5b505050506040513d60208110156120b057600080fd5b5050604080517f13df7ca6000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c874b064f465bdd6411d45734b56fac750cda29a16916313df7ca691600480830192600092919082900301818387803b15801561213957600080fd5b505af115801561214d573d6000803e3d6000fd5b505050505b43610134557fb9c8611ba2eb0880a25df0ebde630048817ebee5f33710af0da51958c621ffd78989876121858688613295565b73ffffffffffffffffffffffffffffffffffffffff8616156121a85760006121aa565b8b5b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190a150505050505050505050565b6000818152606560205260408120610db190613a2c565b6101335470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff1681565b8342111561229357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b600060fc548888886122e260fb60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061383e565b89604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050604051602081830303815290604052805190602001209050600061236582613a37565b9050600061237582878787613a9e565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461241157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8a16600090815260fb6020526040902061243f90613c8c565b61244a8a8a8a612da6565b50505050505050505050565b60008281526065602052604090206002015461247490610ec861330c565b610fce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806142036030913960400191505060405180910390fd5b610130602052600090815260409020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260976020908152604080832093909416825291909152205490565b6125496000336116a3565b6125b457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e61626c655061757361626c653a206163636573732064656e6965640000604482015290519081900360640190fd5b610131805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915560408051918252517fc1b5345cce283376356748dc57f2dfa7120431d016fc7ca9ba641bc65f91411d9181900360200190a150565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6101385481565b6101355473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000ac0f906e433d58fa868f936e8a4323047365288581565b73ffffffffffffffffffffffffffffffffffffffff831661271c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b610134544311612777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603481526020018061412b6034913960400191505060405180910390fd5b60006127838383612d32565b6101385490915080156127ce57600061279a610c31565b905060006127b682611cca6127af8287613295565b8790613938565b90506127c6846118e18584612d32565b610138559250505b6000821161283d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f526577617264457468546f6b656e3a207a65726f206173736574730000000000604482015290519081900360640190fd5b821561284c5761284c83613c95565b83156128e55761012e54604080517f9dc29fac00000000000000000000000000000000000000000000000000000000815233600482015260248101879052905173ffffffffffffffffffffffffffffffffffffffff90921691639dc29fac9160448082019260009290919082900301818387803b1580156128cc57600080fd5b505af11580156128e0573d6000803e3d6000fd5b505050505b7f000000000000000000000000ac0f906e433d58fa868f936e8a4323047365288573ffffffffffffffffffffffffffffffffffffffff1663ad68ebf786846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561297657600080fd5b505af115801561298a573d6000803e3d6000fd5b505050506040513d60208110156129a057600080fd5b50505050505050565b6129b16140a0565b5073ffffffffffffffffffffffffffffffffffffffff8216600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff8082168452700100000000000000000000000000000000909104811691830182905283161415612a265750610f2c565b600073ffffffffffffffffffffffffffffffffffffffff8416612adf5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612aac57600080fd5b505afa158015612ac0573d6000803e3d6000fd5b505050506040513d6020811015612ad657600080fd5b50519050612b82565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152915191909216916370a08231916024808301926020929190829003018186803b158015612b5357600080fd5b505afa158015612b67573d6000803e3d6000fd5b505050506040513d6020811015612b7d57600080fd5b505190505b80612c2b5760408051808201825283516fffffffffffffffffffffffffffffffff9081168252858116602080840191825273ffffffffffffffffffffffffffffffffffffffff89166000908152610130909152939093209151825493518216700100000000000000000000000000000000029082167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716919091179055612d2c565b6000612c6883602001516fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff1661329590919063ffffffff16565b90506040518060400160405280612c9961130c86600001516fffffffffffffffffffffffffffffffff168686613def565b6fffffffffffffffffffffffffffffffff908116825286811660209283015273ffffffffffffffffffffffffffffffffffffffff881660009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931716179055505b50505050565b60008282018381101561169c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316612e12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806142766024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216612e7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141096022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260976020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b612ef5611195565b15612f6157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8316612fe357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f526577617264457468546f6b656e3a20696e76616c69642073656e6465720000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff821661306557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f526577617264457468546f6b656e3a20696e76616c6964207265636569766572604482015290519081900360640190fd5b6101345443116130c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603581526020018061415f6035913960400191505060405180910390fd5b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff16908061310861130c856118e1898761353f565b6fffffffffffffffffffffffffffffffff9081168252838116602092830181905273ffffffffffffffffffffffffffffffffffffffff8816600090815261013084526040908190208551815496909501518416700100000000000000000000000000000000029484167fffffffffffffffffffffffffffffffff000000000000000000000000000000009096169590951790921692909217909255815180830190925281906131c29061130c9086906119a490899061353f565b6fffffffffffffffffffffffffffffffff908116825283811660209283015273ffffffffffffffffffffffffffffffffffffffff8681166000818152610130855260409081902086518154978701517fffffffffffffffffffffffffffffffff0000000000000000000000000000000090981690861617851670010000000000000000000000000000000097909516969096029390931790945581518681529151908816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef928290030190a350505050565b60008282111561330657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3390565b60008281526065602052604090206133289082613e19565b15610f2c5761333561330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610ce77f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133c1613e3b565b6133c9613e41565b613e47565b60008281526065602052604090206133e69082613eb6565b15610f2c576133f361330c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b613459611195565b6134c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61351561330c565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190a1565b60006135496140a0565b5073ffffffffffffffffffffffffffffffffffffffff8316600090815261013060209081526040918290208251808401909352546fffffffffffffffffffffffffffffffff8082168452700100000000000000000000000000000000909104169082018190528314806135e2575073ffffffffffffffffffffffffffffffffffffffff84166000908152610136602052604090205460ff165b1561360157516fffffffffffffffffffffffffffffffff169050610db1565b600073ffffffffffffffffffffffffffffffffffffffff85166136ba5761012e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae5e0f7a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561368757600080fd5b505afa15801561369b573d6000803e3d6000fd5b505050506040513d60208110156136b157600080fd5b5051905061375d565b61012e54604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8881166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561372e57600080fd5b505afa158015613742573d6000803e3d6000fd5b505050506040513d602081101561375857600080fd5b505190505b8061377d5750516fffffffffffffffffffffffffffffffff169050610db1565b6137c682600001516fffffffffffffffffffffffffffffffff16826137c185602001516fffffffffffffffffffffffffffffffff168861329590919063ffffffff16565b613def565b95945050505050565b6000700100000000000000000000000000000000821061383a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806141946027913960400191505060405180910390fd5b5090565b5490565b61384a611195565b156138b657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b603380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861351561330c565b600061169c8383613ed8565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613f56565b60008261394757506000610db1565b8282028284828161395457fe5b041461169c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806142556021913960400191505060405180910390fd5b6000808211613a1b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381613a2457fe5b049392505050565b6000610db18261383e565b6000613a41613393565b8260405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0821115613b19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806141e16022913960400191505060405180910390fd5b8360ff16601b1480613b2e57508360ff16601c145b613b83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806142336022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015613bdf573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166137c657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b80546001019055565b61013354604080518082019091527001000000000000000000000000000000009091046fffffffffffffffffffffffffffffffff169080613cdd61130c856118e1338761353f565b6fffffffffffffffffffffffffffffffff90811682528381166020928301523360009081526101308352604090208351815494909301518216700100000000000000000000000000000000029282167fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169390931781169190911790915561013354613d709161130c911684613295565b61013380547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff9290921691909117905560408051838152905160009133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef916020908290030190a35050565b6000613e11613e0a670de0b6b3a7640000611cca8686613938565b8590612d32565b949350505050565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613f6e565b60c75490565b60c85490565b6000838383613e54613fb8565b30604051602001808681526020018581526020018481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b600061169c8373ffffffffffffffffffffffffffffffffffffffff8416613fbc565b81546000908210613f34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806140b86022913960400191505060405180910390fd5b826000018281548110613f4357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b6000613f7a8383613f56565b613fb057508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610db1565b506000610db1565b4690565b600081815260018301602052604081205480156140965783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808301919081019060009087908390811061400d57fe5b906000526020600020015490508087600001848154811061402a57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061405a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610db1565b6000915050610db1565b60408051808201909152600080825260208201529056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a20617070726f766520746f20746865207a65726f2061646472657373526577617264457468546f6b656e3a2063616e6e6f74206d69677261746520647572696e67207265776172647320757064617465526577617264457468546f6b656e3a2063616e6e6f74207472616e7366657220647572696e6720726577617264732075706461746553616665436173743a2076616c756520646f65736e27742066697420696e203132382062697473526577617264457468546f6b656e3a20696e76616c69642070656e616c747920616d6f756e7445434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545434453413a20696e76616c6964207369676e6174757265202776272076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373526577617264457468546f6b656e3a2076616c756520646964206e6f74206368616e6765526577617264457468546f6b656e3a20696e76616c69642070726f746f636f6c20666565416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c66a264697066735822122008ca2b6ab7b05ef924f47c7d3c4fcba0d154066707580149191781d949105e4064736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ac0f906e433d58fa868f936e8a43230473652885000000000000000000000000c874b064f465bdd6411d45734b56fac750cda29a
-----Decoded View---------------
Arg [0] : _vault (address): 0xAC0F906E433d58FA868F936E8A43230473652885
Arg [1] : _pool (address): 0xC874b064f465bdD6411D45734b56fac750Cda29A
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ac0f906e433d58fa868f936e8a43230473652885
Arg [1] : 000000000000000000000000c874b064f465bdd6411d45734b56fac750cda29a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.