Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 28 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Withdraw | 23618489 | 145 days ago | IN | 0 ETH | 0.00013138 | ||||
| Permit And Stake | 23561285 | 153 days ago | IN | 0 ETH | 0.00004728 | ||||
| Withdraw | 23561179 | 153 days ago | IN | 0 ETH | 0.00001371 | ||||
| Permit And Stake | 23560604 | 153 days ago | IN | 0 ETH | 0.00005146 | ||||
| Permit And Stake | 23364997 | 180 days ago | IN | 0 ETH | 0.00041869 | ||||
| Permit And Stake | 23292314 | 190 days ago | IN | 0 ETH | 0.00010117 | ||||
| Permit And Stake | 23003133 | 231 days ago | IN | 0 ETH | 0.00007387 | ||||
| Permit And Stake | 22998031 | 231 days ago | IN | 0 ETH | 0.00040529 | ||||
| Permit And Stake | 22535699 | 296 days ago | IN | 0 ETH | 0.00054607 | ||||
| Permit And Stake | 22422573 | 312 days ago | IN | 0 ETH | 0.00022389 | ||||
| Permit And Stake | 22196301 | 344 days ago | IN | 0 ETH | 0.00054448 | ||||
| Permit And Stake | 22038223 | 366 days ago | IN | 0 ETH | 0.00040621 | ||||
| Permit And Stake | 21928039 | 381 days ago | IN | 0 ETH | 0.0005119 | ||||
| Permit And Stake | 21759473 | 405 days ago | IN | 0 ETH | 0.00013727 | ||||
| Alter Delegatee | 21722370 | 410 days ago | IN | 0 ETH | 0.00093492 | ||||
| Permit And Stake | 21455405 | 447 days ago | IN | 0 ETH | 0.00261838 | ||||
| Permit And Stake | 21271120 | 473 days ago | IN | 0 ETH | 0.00347308 | ||||
| Withdraw | 21053753 | 503 days ago | IN | 0 ETH | 0.00038792 | ||||
| Withdraw | 21053737 | 503 days ago | IN | 0 ETH | 0.00057547 | ||||
| Permit And Stake | 21053691 | 503 days ago | IN | 0 ETH | 0.00104044 | ||||
| Permit And Stake | 21053669 | 503 days ago | IN | 0 ETH | 0.00148286 | ||||
| Alter Delegatee | 20982211 | 513 days ago | IN | 0 ETH | 0.00236887 | ||||
| Permit And Stake | 20982015 | 513 days ago | IN | 0 ETH | 0.00369451 | ||||
| Stake | 19940753 | 659 days ago | IN | 0 ETH | 0.00317142 | ||||
| Stake | 19940707 | 659 days ago | IN | 0 ETH | 0.00650353 |
Latest 16 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 23561285 | 153 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 23560604 | 153 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 23364997 | 180 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22535699 | 296 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22422573 | 312 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22196301 | 344 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 22038223 | 366 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21928039 | 381 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21722370 | 410 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21455405 | 447 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21271120 | 473 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21053691 | 503 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 21053669 | 503 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 20982211 | 513 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 20982015 | 513 days ago | Contract Creation | 0 ETH | |||
| 0x60806040 | 19940707 | 659 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
UniStaker
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.23;
import {DelegationSurrogate} from "src/DelegationSurrogate.sol";
import {INotifiableRewardReceiver} from "src/interfaces/INotifiableRewardReceiver.sol";
import {IERC20Delegates} from "src/interfaces/IERC20Delegates.sol";
import {IERC20} from "openzeppelin/token/ERC20/IERC20.sol";
import {SafeERC20} from "openzeppelin/token/ERC20/utils/SafeERC20.sol";
import {Multicall} from "openzeppelin/utils/Multicall.sol";
import {Nonces} from "openzeppelin/utils/Nonces.sol";
import {SignatureChecker} from "openzeppelin/utils/cryptography/SignatureChecker.sol";
import {EIP712} from "openzeppelin/utils/cryptography/EIP712.sol";
/// @title UniStaker
/// @author ScopeLift
/// @notice This contract manages the distribution of rewards to stakers. Rewards are denominated
/// in an ERC20 token and sent to the contract by authorized reward notifiers. To stake means to
/// deposit a designated, delegable ERC20 governance token and leave it over a period of time.
/// The contract allows stakers to delegate the voting power of the tokens they stake to any
/// governance delegatee on a per deposit basis. The contract also allows stakers to designate the
/// beneficiary address that earns rewards for the associated deposit.
///
/// The staking mechanism of this contract is directly inspired by the Synthetix StakingRewards.sol
/// implementation. The core mechanic involves the streaming of rewards over a designated period
/// of time. Each staker earns rewards proportional to their share of the total stake, and each
/// staker earns only while their tokens are staked. Stakers may add or withdraw their stake at any
/// point. Beneficiaries can claim the rewards they've earned at any point. When a new reward is
/// received, the reward duration restarts, and the rate at which rewards are streamed is updated
/// to include the newly received rewards along with any remaining rewards that have finished
/// streaming since the last time a reward was received.
contract UniStaker is INotifiableRewardReceiver, Multicall, EIP712, Nonces {
type DepositIdentifier is uint256;
/// @notice Emitted when stake is deposited by a depositor, either to a new deposit or one that
/// already exists.
event StakeDeposited(
address owner, DepositIdentifier indexed depositId, uint256 amount, uint256 depositBalance
);
/// @notice Emitted when a depositor withdraws some portion of stake from a given deposit.
event StakeWithdrawn(DepositIdentifier indexed depositId, uint256 amount, uint256 depositBalance);
/// @notice Emitted when a deposit's delegatee is changed.
event DelegateeAltered(
DepositIdentifier indexed depositId, address oldDelegatee, address newDelegatee
);
/// @notice Emitted when a deposit's beneficiary is changed.
event BeneficiaryAltered(
DepositIdentifier indexed depositId,
address indexed oldBeneficiary,
address indexed newBeneficiary
);
/// @notice Emitted when a beneficiary claims their earned reward.
event RewardClaimed(address indexed beneficiary, uint256 amount);
/// @notice Emitted when this contract is notified of a new reward.
event RewardNotified(uint256 amount, address notifier);
/// @notice Emitted when the admin address is set.
event AdminSet(address indexed oldAdmin, address indexed newAdmin);
/// @notice Emitted when a reward notifier address is enabled or disabled.
event RewardNotifierSet(address indexed account, bool isEnabled);
/// @notice Emitted when a surrogate contract is deployed.
event SurrogateDeployed(address indexed delegatee, address indexed surrogate);
/// @notice Thrown when an account attempts a call for which it lacks appropriate permission.
/// @param reason Human readable code explaining why the call is unauthorized.
/// @param caller The address that attempted the unauthorized call.
error UniStaker__Unauthorized(bytes32 reason, address caller);
/// @notice Thrown if the new rate after a reward notification would be zero.
error UniStaker__InvalidRewardRate();
/// @notice Thrown if the following invariant is broken after a new reward: the contract should
/// always have a reward balance sufficient to distribute at the reward rate across the reward
/// duration.
error UniStaker__InsufficientRewardBalance();
/// @notice Thrown if a caller attempts to specify address zero for certain designated addresses.
error UniStaker__InvalidAddress();
/// @notice Thrown when an onBehalf method is called with a deadline that has expired.
error UniStaker__ExpiredDeadline();
/// @notice Thrown if a caller supplies an invalid signature to a method that requires one.
error UniStaker__InvalidSignature();
/// @notice Metadata associated with a discrete staking deposit.
/// @param balance The deposit's staked balance.
/// @param owner The owner of this deposit.
/// @param delegatee The governance delegate who receives the voting weight for this deposit.
/// @param beneficiary The address that accrues staking rewards earned by this deposit.
struct Deposit {
uint96 balance;
address owner;
address delegatee;
address beneficiary;
}
/// @notice Type hash used when encoding data for `stakeOnBehalf` calls.
bytes32 public constant STAKE_TYPEHASH = keccak256(
"Stake(uint96 amount,address delegatee,address beneficiary,address depositor,uint256 nonce,uint256 deadline)"
);
/// @notice Type hash used when encoding data for `stakeMoreOnBehalf` calls.
bytes32 public constant STAKE_MORE_TYPEHASH = keccak256(
"StakeMore(uint256 depositId,uint96 amount,address depositor,uint256 nonce,uint256 deadline)"
);
/// @notice Type hash used when encoding data for `alterDelegateeOnBehalf` calls.
bytes32 public constant ALTER_DELEGATEE_TYPEHASH = keccak256(
"AlterDelegatee(uint256 depositId,address newDelegatee,address depositor,uint256 nonce,uint256 deadline)"
);
/// @notice Type hash used when encoding data for `alterBeneficiaryOnBehalf` calls.
bytes32 public constant ALTER_BENEFICIARY_TYPEHASH = keccak256(
"AlterBeneficiary(uint256 depositId,address newBeneficiary,address depositor,uint256 nonce,uint256 deadline)"
);
/// @notice Type hash used when encoding data for `withdrawOnBehalf` calls.
bytes32 public constant WITHDRAW_TYPEHASH = keccak256(
"Withdraw(uint256 depositId,uint96 amount,address depositor,uint256 nonce,uint256 deadline)"
);
/// @notice Type hash used when encoding data for `claimRewardOnBehalf` calls.
bytes32 public constant CLAIM_REWARD_TYPEHASH =
keccak256("ClaimReward(address beneficiary,uint256 nonce,uint256 deadline)");
/// @notice ERC20 token in which rewards are denominated and distributed.
IERC20 public immutable REWARD_TOKEN;
/// @notice Delegable governance token which users stake to earn rewards.
IERC20Delegates public immutable STAKE_TOKEN;
/// @notice Length of time over which rewards sent to this contract are distributed to stakers.
uint256 public constant REWARD_DURATION = 30 days;
/// @notice Scale factor used in reward calculation math to reduce rounding errors caused by
/// truncation during division.
uint256 public constant SCALE_FACTOR = 1e36;
/// @dev Unique identifier that will be used for the next deposit.
DepositIdentifier private nextDepositId;
/// @notice Permissioned actor that can enable/disable `rewardNotifier` addresses.
address public admin;
/// @notice Global amount currently staked across all deposits.
uint256 public totalStaked;
/// @notice Tracks the total staked by a depositor across all unique deposits.
mapping(address depositor => uint256 amount) public depositorTotalStaked;
/// @notice Tracks the total stake actively earning rewards for a given beneficiary account.
mapping(address beneficiary => uint256 amount) public earningPower;
/// @notice Stores the metadata associated with a given deposit.
mapping(DepositIdentifier depositId => Deposit deposit) public deposits;
/// @notice Maps the account of each governance delegate with the surrogate contract which holds
/// the staked tokens from deposits which assign voting weight to said delegate.
mapping(address delegatee => DelegationSurrogate surrogate) public surrogates;
/// @notice Time at which rewards distribution will complete if there are no new rewards.
uint256 public rewardEndTime;
/// @notice Last time at which the global rewards accumulator was updated.
uint256 public lastCheckpointTime;
/// @notice Global rate at which rewards are currently being distributed to stakers,
/// denominated in scaled reward tokens per second, using the SCALE_FACTOR.
uint256 public scaledRewardRate;
/// @notice Checkpoint value of the global reward per token accumulator.
uint256 public rewardPerTokenAccumulatedCheckpoint;
/// @notice Checkpoint of the reward per token accumulator on a per account basis. It represents
/// the value of the global accumulator at the last time a given beneficiary's rewards were
/// calculated and stored. The difference between the global value and this value can be
/// used to calculate the interim rewards earned by given account.
mapping(address account => uint256) public beneficiaryRewardPerTokenCheckpoint;
/// @notice Checkpoint of the unclaimed rewards earned by a given beneficiary with the scale
/// factor included. This value is stored any time an action is taken that specifically impacts
/// the rate at which rewards are earned by a given beneficiary account. Total unclaimed rewards
/// for an account are thus this value plus all rewards earned after this checkpoint was taken.
/// This value is reset to zero when a beneficiary account claims their earned rewards.
mapping(address account => uint256 amount) public scaledUnclaimedRewardCheckpoint;
/// @notice Maps addresses to whether they are authorized to call `notifyRewardAmount`.
mapping(address rewardNotifier => bool) public isRewardNotifier;
/// @param _rewardToken ERC20 token in which rewards will be denominated.
/// @param _stakeToken Delegable governance token which users will stake to earn rewards.
/// @param _admin Address which will have permission to manage rewardNotifiers.
constructor(IERC20 _rewardToken, IERC20Delegates _stakeToken, address _admin)
EIP712("UniStaker", "1")
{
REWARD_TOKEN = _rewardToken;
STAKE_TOKEN = _stakeToken;
_setAdmin(_admin);
}
/// @notice Set the admin address.
/// @param _newAdmin Address of the new admin.
/// @dev Caller must be the current admin.
function setAdmin(address _newAdmin) external {
_revertIfNotAdmin();
_setAdmin(_newAdmin);
}
/// @notice Enables or disables a reward notifier address.
/// @param _rewardNotifier Address of the reward notifier.
/// @param _isEnabled `true` to enable the `_rewardNotifier`, or `false` to disable.
/// @dev Caller must be the current admin.
function setRewardNotifier(address _rewardNotifier, bool _isEnabled) external {
_revertIfNotAdmin();
isRewardNotifier[_rewardNotifier] = _isEnabled;
emit RewardNotifierSet(_rewardNotifier, _isEnabled);
}
/// @notice Timestamp representing the last time at which rewards have been distributed, which is
/// either the current timestamp (because rewards are still actively being streamed) or the time
/// at which the reward duration ended (because all rewards to date have already been streamed).
/// @return Timestamp representing the last time at which rewards have been distributed.
function lastTimeRewardDistributed() public view returns (uint256) {
if (rewardEndTime <= block.timestamp) return rewardEndTime;
else return block.timestamp;
}
/// @notice Live value of the global reward per token accumulator. It is the sum of the last
/// checkpoint value with the live calculation of the value that has accumulated in the interim.
/// This number should monotonically increase over time as more rewards are distributed.
/// @return Live value of the global reward per token accumulator.
function rewardPerTokenAccumulated() public view returns (uint256) {
if (totalStaked == 0) return rewardPerTokenAccumulatedCheckpoint;
return rewardPerTokenAccumulatedCheckpoint
+ (scaledRewardRate * (lastTimeRewardDistributed() - lastCheckpointTime)) / totalStaked;
}
/// @notice Live value of the unclaimed rewards earned by a given beneficiary account. It is the
/// sum of the last checkpoint value of their unclaimed rewards with the live calculation of the
/// rewards that have accumulated for this account in the interim. This value can only increase,
/// until it is reset to zero once the beneficiary account claims their unearned rewards.
///
/// Note that the contract tracks the unclaimed rewards internally with the scale factor
/// included, in order to avoid the accrual of precision losses as users takes actions that
/// cause rewards to be checkpointed. This external helper method is useful for integrations, and
/// returns the value after it has been scaled down to the reward token's raw decimal amount.
/// @return Live value of the unclaimed rewards earned by a given beneficiary account.
function unclaimedReward(address _beneficiary) external view returns (uint256) {
return _scaledUnclaimedReward(_beneficiary) / SCALE_FACTOR;
}
/// @notice Stake tokens to a new deposit. The caller must pre-approve the staking contract to
/// spend at least the would-be staked amount of the token.
/// @param _amount The amount of the staking token to stake.
/// @param _delegatee The address to assign the governance voting weight of the staked tokens.
/// @return _depositId The unique identifier for this deposit.
/// @dev The delegatee may not be the zero address. The deposit will be owned by the message
/// sender, and the beneficiary will also be the message sender.
function stake(uint96 _amount, address _delegatee)
external
returns (DepositIdentifier _depositId)
{
_depositId = _stake(msg.sender, _amount, _delegatee, msg.sender);
}
/// @notice Method to stake tokens to a new deposit. The caller must pre-approve the staking
/// contract to spend at least the would-be staked amount of the token.
/// @param _amount Quantity of the staking token to stake.
/// @param _delegatee Address to assign the governance voting weight of the staked tokens.
/// @param _beneficiary Address that will accrue rewards for this stake.
/// @return _depositId Unique identifier for this deposit.
/// @dev Neither the delegatee nor the beneficiary may be the zero address. The deposit will be
/// owned by the message sender.
function stake(uint96 _amount, address _delegatee, address _beneficiary)
external
returns (DepositIdentifier _depositId)
{
_depositId = _stake(msg.sender, _amount, _delegatee, _beneficiary);
}
/// @notice Method to stake tokens to a new deposit. Before the staking operation occurs, a
/// signature is passed to the token contract's permit method to spend the would-be staked amount
/// of the token.
/// @param _amount Quantity of the staking token to stake.
/// @param _delegatee Address to assign the governance voting weight of the staked tokens.
/// @param _beneficiary Address that will accrue rewards for this stake.
/// @param _deadline The timestamp after which the permit signature should expire.
/// @param _v ECDSA signature component: Parity of the `y` coordinate of point `R`
/// @param _r ECDSA signature component: x-coordinate of `R`
/// @param _s ECDSA signature component: `s` value of the signature
/// @return _depositId Unique identifier for this deposit.
/// @dev Neither the delegatee nor the beneficiary may be the zero address. The deposit will be
/// owned by the message sender.
function permitAndStake(
uint96 _amount,
address _delegatee,
address _beneficiary,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external returns (DepositIdentifier _depositId) {
try STAKE_TOKEN.permit(msg.sender, address(this), _amount, _deadline, _v, _r, _s) {} catch {}
_depositId = _stake(msg.sender, _amount, _delegatee, _beneficiary);
}
/// @notice Stake tokens to a new deposit on behalf of a user, using a signature to validate the
/// user's intent. The caller must pre-approve the staking contract to spend at least the
/// would-be staked amount of the token.
/// @param _amount Quantity of the staking token to stake.
/// @param _delegatee Address to assign the governance voting weight of the staked tokens.
/// @param _beneficiary Address that will accrue rewards for this stake.
/// @param _depositor Address of the user on whose behalf this stake is being made.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the user authorizing this stake.
/// @return _depositId Unique identifier for this deposit.
/// @dev Neither the delegatee nor the beneficiary may be the zero address.
function stakeOnBehalf(
uint96 _amount,
address _delegatee,
address _beneficiary,
address _depositor,
uint256 _deadline,
bytes memory _signature
) external returns (DepositIdentifier _depositId) {
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_depositor,
_hashTypedDataV4(
keccak256(
abi.encode(
STAKE_TYPEHASH,
_amount,
_delegatee,
_beneficiary,
_depositor,
_useNonce(_depositor),
_deadline
)
)
),
_signature
);
_depositId = _stake(_depositor, _amount, _delegatee, _beneficiary);
}
/// @notice Add more staking tokens to an existing deposit. A staker should call this method when
/// they have an existing deposit, and wish to stake more while retaining the same delegatee and
/// beneficiary.
/// @param _depositId Unique identifier of the deposit to which stake will be added.
/// @param _amount Quantity of stake to be added.
/// @dev The message sender must be the owner of the deposit.
function stakeMore(DepositIdentifier _depositId, uint96 _amount) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, msg.sender);
_stakeMore(deposit, _depositId, _amount);
}
/// @notice Add more staking tokens to an existing deposit. A staker should call this method when
/// they have an existing deposit, and wish to stake more while retaining the same delegatee and
/// beneficiary. Before the staking operation occurs, a signature is passed to the token
/// contract's permit method to spend the would-be staked amount of the token.
/// @param _depositId Unique identifier of the deposit to which stake will be added.
/// @param _amount Quantity of stake to be added.
/// @param _deadline The timestamp after which the permit signature should expire.
/// @param _v ECDSA signature component: Parity of the `y` coordinate of point `R`
/// @param _r ECDSA signature component: x-coordinate of `R`
/// @param _s ECDSA signature component: `s` value of the signature
/// @dev The message sender must be the owner of the deposit.
function permitAndStakeMore(
DepositIdentifier _depositId,
uint96 _amount,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, msg.sender);
try STAKE_TOKEN.permit(msg.sender, address(this), _amount, _deadline, _v, _r, _s) {} catch {}
_stakeMore(deposit, _depositId, _amount);
}
/// @notice Add more staking tokens to an existing deposit on behalf of a user, using a signature
/// to validate the user's intent. A staker should call this method when they have an existing
/// deposit, and wish to stake more while retaining the same delegatee and beneficiary.
/// @param _depositId Unique identifier of the deposit to which stake will be added.
/// @param _amount Quantity of stake to be added.
/// @param _depositor Address of the user on whose behalf this stake is being made.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the user authorizing this stake.
function stakeMoreOnBehalf(
DepositIdentifier _depositId,
uint96 _amount,
address _depositor,
uint256 _deadline,
bytes memory _signature
) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, _depositor);
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_depositor,
_hashTypedDataV4(
keccak256(
abi.encode(
STAKE_MORE_TYPEHASH, _depositId, _amount, _depositor, _useNonce(_depositor), _deadline
)
)
),
_signature
);
_stakeMore(deposit, _depositId, _amount);
}
/// @notice For an existing deposit, change the address to which governance voting power is
/// assigned.
/// @param _depositId Unique identifier of the deposit which will have its delegatee altered.
/// @param _newDelegatee Address of the new governance delegate.
/// @dev The new delegatee may not be the zero address. The message sender must be the owner of
/// the deposit.
function alterDelegatee(DepositIdentifier _depositId, address _newDelegatee) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, msg.sender);
_alterDelegatee(deposit, _depositId, _newDelegatee);
}
/// @notice For an existing deposit, change the address to which governance voting power is
/// assigned on behalf of a user, using a signature to validate the user's intent.
/// @param _depositId Unique identifier of the deposit which will have its delegatee altered.
/// @param _newDelegatee Address of the new governance delegate.
/// @param _depositor Address of the user on whose behalf this stake is being made.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the user authorizing this stake.
/// @dev The new delegatee may not be the zero address.
function alterDelegateeOnBehalf(
DepositIdentifier _depositId,
address _newDelegatee,
address _depositor,
uint256 _deadline,
bytes memory _signature
) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, _depositor);
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_depositor,
_hashTypedDataV4(
keccak256(
abi.encode(
ALTER_DELEGATEE_TYPEHASH,
_depositId,
_newDelegatee,
_depositor,
_useNonce(_depositor),
_deadline
)
)
),
_signature
);
_alterDelegatee(deposit, _depositId, _newDelegatee);
}
/// @notice For an existing deposit, change the beneficiary to which staking rewards are
/// accruing.
/// @param _depositId Unique identifier of the deposit which will have its beneficiary altered.
/// @param _newBeneficiary Address of the new rewards beneficiary.
/// @dev The new beneficiary may not be the zero address. The message sender must be the owner of
/// the deposit.
function alterBeneficiary(DepositIdentifier _depositId, address _newBeneficiary) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, msg.sender);
_alterBeneficiary(deposit, _depositId, _newBeneficiary);
}
/// @notice For an existing deposit, change the beneficiary to which staking rewards are
/// accruing on behalf of a user, using a signature to validate the user's intent.
/// @param _depositId Unique identifier of the deposit which will have its beneficiary altered.
/// @param _newBeneficiary Address of the new rewards beneficiary.
/// @param _depositor Address of the user on whose behalf this stake is being made.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the user authorizing this stake.
/// @dev The new beneficiary may not be the zero address.
function alterBeneficiaryOnBehalf(
DepositIdentifier _depositId,
address _newBeneficiary,
address _depositor,
uint256 _deadline,
bytes memory _signature
) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, _depositor);
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_depositor,
_hashTypedDataV4(
keccak256(
abi.encode(
ALTER_BENEFICIARY_TYPEHASH,
_depositId,
_newBeneficiary,
_depositor,
_useNonce(_depositor),
_deadline
)
)
),
_signature
);
_alterBeneficiary(deposit, _depositId, _newBeneficiary);
}
/// @notice Withdraw staked tokens from an existing deposit.
/// @param _depositId Unique identifier of the deposit from which stake will be withdrawn.
/// @param _amount Quantity of staked token to withdraw.
/// @dev The message sender must be the owner of the deposit. Stake is withdrawn to the message
/// sender's account.
function withdraw(DepositIdentifier _depositId, uint96 _amount) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, msg.sender);
_withdraw(deposit, _depositId, _amount);
}
/// @notice Withdraw staked tokens from an existing deposit on behalf of a user, using a
/// signature to validate the user's intent.
/// @param _depositId Unique identifier of the deposit from which stake will be withdrawn.
/// @param _amount Quantity of staked token to withdraw.
/// @param _depositor Address of the user on whose behalf this stake is being made.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the user authorizing this stake.
/// @dev Stake is withdrawn to the deposit owner's account.
function withdrawOnBehalf(
DepositIdentifier _depositId,
uint96 _amount,
address _depositor,
uint256 _deadline,
bytes memory _signature
) external {
Deposit storage deposit = deposits[_depositId];
_revertIfNotDepositOwner(deposit, _depositor);
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_depositor,
_hashTypedDataV4(
keccak256(
abi.encode(
WITHDRAW_TYPEHASH, _depositId, _amount, _depositor, _useNonce(_depositor), _deadline
)
)
),
_signature
);
_withdraw(deposit, _depositId, _amount);
}
/// @notice Claim reward tokens the message sender has earned as a stake beneficiary. Tokens are
/// sent to the message sender.
/// @return Amount of reward tokens claimed.
function claimReward() external returns (uint256) {
return _claimReward(msg.sender);
}
/// @notice Claim earned reward tokens for a beneficiary, using a signature to validate the
/// beneficiary's intent. Tokens are sent to the beneficiary.
/// @param _beneficiary Address of the beneficiary who will receive the reward.
/// @param _deadline The timestamp after which the signature should expire.
/// @param _signature Signature of the beneficiary authorizing this reward claim.
/// @return Amount of reward tokens claimed.
function claimRewardOnBehalf(address _beneficiary, uint256 _deadline, bytes memory _signature)
external
returns (uint256)
{
_revertIfPastDeadline(_deadline);
_revertIfSignatureIsNotValidNow(
_beneficiary,
_hashTypedDataV4(
keccak256(
abi.encode(CLAIM_REWARD_TYPEHASH, _beneficiary, _useNonce(_beneficiary), _deadline)
)
),
_signature
);
return _claimReward(_beneficiary);
}
/// @notice Called by an authorized rewards notifier to alert the staking contract that a new
/// reward has been transferred to it. It is assumed that the reward has already been
/// transferred to this staking contract before the rewards notifier calls this method.
/// @param _amount Quantity of reward tokens the staking contract is being notified of.
/// @dev It is critical that only well behaved contracts are approved by the admin to call this
/// method, for two reasons.
///
/// 1. A misbehaving contract could grief stakers by frequently notifying this contract of tiny
/// rewards, thereby continuously stretching out the time duration over which real rewards are
/// distributed. It is required that reward notifiers supply reasonable rewards at reasonable
/// intervals.
// 2. A misbehaving contract could falsely notify this contract of rewards that were not actually
/// distributed, creating a shortfall for those claiming their rewards after others. It is
/// required that a notifier contract always transfers the `_amount` to this contract before
/// calling this method.
function notifyRewardAmount(uint256 _amount) external {
if (!isRewardNotifier[msg.sender]) revert UniStaker__Unauthorized("not notifier", msg.sender);
// We checkpoint the accumulator without updating the timestamp at which it was updated,
// because that second operation will be done after updating the reward rate.
rewardPerTokenAccumulatedCheckpoint = rewardPerTokenAccumulated();
if (block.timestamp >= rewardEndTime) {
scaledRewardRate = (_amount * SCALE_FACTOR) / REWARD_DURATION;
} else {
uint256 _remainingReward = scaledRewardRate * (rewardEndTime - block.timestamp);
scaledRewardRate = (_remainingReward + _amount * SCALE_FACTOR) / REWARD_DURATION;
}
rewardEndTime = block.timestamp + REWARD_DURATION;
lastCheckpointTime = block.timestamp;
if ((scaledRewardRate / SCALE_FACTOR) == 0) revert UniStaker__InvalidRewardRate();
// This check cannot _guarantee_ sufficient rewards have been transferred to the contract,
// because it cannot isolate the unclaimed rewards owed to stakers left in the balance. While
// this check is useful for preventing degenerate cases, it is not sufficient. Therefore, it is
// critical that only safe reward notifier contracts are approved to call this method by the
// admin.
if (
(scaledRewardRate * REWARD_DURATION) > (REWARD_TOKEN.balanceOf(address(this)) * SCALE_FACTOR)
) revert UniStaker__InsufficientRewardBalance();
emit RewardNotified(_amount, msg.sender);
}
/// @notice Live value of the unclaimed rewards earned by a given beneficiary account with the
/// scale factor included. Used internally for calculating reward checkpoints while minimizing
/// precision loss.
/// @return Live value of the unclaimed rewards earned by a given beneficiary account with the
/// scale factor included.
/// @dev See documentation for the public, non-scaled `unclaimedReward` method for more details.
function _scaledUnclaimedReward(address _beneficiary) internal view returns (uint256) {
return scaledUnclaimedRewardCheckpoint[_beneficiary]
+ (
earningPower[_beneficiary]
* (rewardPerTokenAccumulated() - beneficiaryRewardPerTokenCheckpoint[_beneficiary])
);
}
/// @notice Allows an address to increment their nonce and therefore invalidate any pending signed
/// actions.
function invalidateNonce() external {
_useNonce(msg.sender);
}
/// @notice Internal method which finds the existing surrogate contract—or deploys a new one if
/// none exists—for a given delegatee.
/// @param _delegatee Account for which a surrogate is sought.
/// @return _surrogate The address of the surrogate contract for the delegatee.
function _fetchOrDeploySurrogate(address _delegatee)
internal
returns (DelegationSurrogate _surrogate)
{
_surrogate = surrogates[_delegatee];
if (address(_surrogate) == address(0)) {
_surrogate = new DelegationSurrogate(STAKE_TOKEN, _delegatee);
surrogates[_delegatee] = _surrogate;
emit SurrogateDeployed(_delegatee, address(_surrogate));
}
}
/// @notice Internal convenience method which calls the `transferFrom` method on the stake token
/// contract and reverts on failure.
/// @param _from Source account from which stake token is to be transferred.
/// @param _to Destination account of the stake token which is to be transferred.
/// @param _value Quantity of stake token which is to be transferred.
function _stakeTokenSafeTransferFrom(address _from, address _to, uint256 _value) internal {
SafeERC20.safeTransferFrom(IERC20(address(STAKE_TOKEN)), _from, _to, _value);
}
/// @notice Internal method which generates and returns a unique, previously unused deposit
/// identifier.
/// @return _depositId Previously unused deposit identifier.
function _useDepositId() internal returns (DepositIdentifier _depositId) {
_depositId = nextDepositId;
nextDepositId = DepositIdentifier.wrap(DepositIdentifier.unwrap(_depositId) + 1);
}
/// @notice Internal convenience methods which performs the staking operations.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public stake methods for additional documentation.
function _stake(address _depositor, uint96 _amount, address _delegatee, address _beneficiary)
internal
returns (DepositIdentifier _depositId)
{
_revertIfAddressZero(_delegatee);
_revertIfAddressZero(_beneficiary);
_checkpointGlobalReward();
_checkpointReward(_beneficiary);
DelegationSurrogate _surrogate = _fetchOrDeploySurrogate(_delegatee);
_depositId = _useDepositId();
totalStaked += _amount;
depositorTotalStaked[_depositor] += _amount;
earningPower[_beneficiary] += _amount;
deposits[_depositId] = Deposit({
balance: _amount,
owner: _depositor,
delegatee: _delegatee,
beneficiary: _beneficiary
});
_stakeTokenSafeTransferFrom(_depositor, address(_surrogate), _amount);
emit StakeDeposited(_depositor, _depositId, _amount, _amount);
emit BeneficiaryAltered(_depositId, address(0), _beneficiary);
emit DelegateeAltered(_depositId, address(0), _delegatee);
}
/// @notice Internal convenience method which adds more stake to an existing deposit.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public stakeMore methods for additional documentation.
function _stakeMore(Deposit storage deposit, DepositIdentifier _depositId, uint96 _amount)
internal
{
_checkpointGlobalReward();
_checkpointReward(deposit.beneficiary);
DelegationSurrogate _surrogate = surrogates[deposit.delegatee];
totalStaked += _amount;
depositorTotalStaked[deposit.owner] += _amount;
earningPower[deposit.beneficiary] += _amount;
deposit.balance += _amount;
_stakeTokenSafeTransferFrom(deposit.owner, address(_surrogate), _amount);
emit StakeDeposited(deposit.owner, _depositId, _amount, deposit.balance);
}
/// @notice Internal convenience method which alters the delegatee of an existing deposit.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public alterDelegatee methods for additional documentation.
function _alterDelegatee(
Deposit storage deposit,
DepositIdentifier _depositId,
address _newDelegatee
) internal {
_revertIfAddressZero(_newDelegatee);
DelegationSurrogate _oldSurrogate = surrogates[deposit.delegatee];
emit DelegateeAltered(_depositId, deposit.delegatee, _newDelegatee);
deposit.delegatee = _newDelegatee;
DelegationSurrogate _newSurrogate = _fetchOrDeploySurrogate(_newDelegatee);
_stakeTokenSafeTransferFrom(address(_oldSurrogate), address(_newSurrogate), deposit.balance);
}
/// @notice Internal convenience method which alters the beneficiary of an existing deposit.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public alterBeneficiary methods for additional documentation.
function _alterBeneficiary(
Deposit storage deposit,
DepositIdentifier _depositId,
address _newBeneficiary
) internal {
_revertIfAddressZero(_newBeneficiary);
_checkpointGlobalReward();
_checkpointReward(deposit.beneficiary);
earningPower[deposit.beneficiary] -= deposit.balance;
_checkpointReward(_newBeneficiary);
emit BeneficiaryAltered(_depositId, deposit.beneficiary, _newBeneficiary);
deposit.beneficiary = _newBeneficiary;
earningPower[_newBeneficiary] += deposit.balance;
}
/// @notice Internal convenience method which withdraws the stake from an existing deposit.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public withdraw methods for additional documentation.
function _withdraw(Deposit storage deposit, DepositIdentifier _depositId, uint96 _amount)
internal
{
_checkpointGlobalReward();
_checkpointReward(deposit.beneficiary);
deposit.balance -= _amount; // overflow prevents withdrawing more than balance
totalStaked -= _amount;
depositorTotalStaked[deposit.owner] -= _amount;
earningPower[deposit.beneficiary] -= _amount;
_stakeTokenSafeTransferFrom(address(surrogates[deposit.delegatee]), deposit.owner, _amount);
emit StakeWithdrawn(_depositId, _amount, deposit.balance);
}
/// @notice Internal convenience method which claims earned rewards.
/// @return Amount of reward tokens claimed.
/// @dev This method must only be called after proper authorization has been completed.
/// @dev See public claimReward methods for additional documentation.
function _claimReward(address _beneficiary) internal returns (uint256) {
_checkpointGlobalReward();
_checkpointReward(_beneficiary);
uint256 _reward = scaledUnclaimedRewardCheckpoint[_beneficiary] / SCALE_FACTOR;
if (_reward == 0) return 0;
// retain sub-wei dust that would be left due to the precision loss
scaledUnclaimedRewardCheckpoint[_beneficiary] =
scaledUnclaimedRewardCheckpoint[_beneficiary] - (_reward * SCALE_FACTOR);
emit RewardClaimed(_beneficiary, _reward);
SafeERC20.safeTransfer(REWARD_TOKEN, _beneficiary, _reward);
return _reward;
}
/// @notice Checkpoints the global reward per token accumulator.
function _checkpointGlobalReward() internal {
rewardPerTokenAccumulatedCheckpoint = rewardPerTokenAccumulated();
lastCheckpointTime = lastTimeRewardDistributed();
}
/// @notice Checkpoints the unclaimed rewards and reward per token accumulator of a given
/// beneficiary account.
/// @param _beneficiary The account for which reward parameters will be checkpointed.
/// @dev This is a sensitive internal helper method that must only be called after global rewards
/// accumulator has been checkpointed. It assumes the global `rewardPerTokenCheckpoint` is up to
/// date.
function _checkpointReward(address _beneficiary) internal {
scaledUnclaimedRewardCheckpoint[_beneficiary] = _scaledUnclaimedReward(_beneficiary);
beneficiaryRewardPerTokenCheckpoint[_beneficiary] = rewardPerTokenAccumulatedCheckpoint;
}
/// @notice Internal helper method which sets the admin address.
/// @param _newAdmin Address of the new admin.
function _setAdmin(address _newAdmin) internal {
_revertIfAddressZero(_newAdmin);
emit AdminSet(admin, _newAdmin);
admin = _newAdmin;
}
/// @notice Internal helper method which reverts UniStaker__Unauthorized if the message sender is
/// not the admin.
function _revertIfNotAdmin() internal view {
if (msg.sender != admin) revert UniStaker__Unauthorized("not admin", msg.sender);
}
/// @notice Internal helper method which reverts UniStaker__Unauthorized if the alleged owner is
/// not the true owner of the deposit.
/// @param deposit Deposit to validate.
/// @param owner Alleged owner of deposit.
function _revertIfNotDepositOwner(Deposit storage deposit, address owner) internal view {
if (owner != deposit.owner) revert UniStaker__Unauthorized("not owner", owner);
}
/// @notice Internal helper method which reverts with UniStaker__InvalidAddress if the account in
/// question is address zero.
/// @param _account Account to verify.
function _revertIfAddressZero(address _account) internal pure {
if (_account == address(0)) revert UniStaker__InvalidAddress();
}
function _revertIfPastDeadline(uint256 _deadline) internal view {
if (block.timestamp > _deadline) revert UniStaker__ExpiredDeadline();
}
/// @notice Internal helper method which reverts with UniStaker__InvalidSignature if the signature
/// is invalid.
/// @param _signer Address of the signer.
/// @param _hash Hash of the message.
/// @param _signature Signature to validate.
function _revertIfSignatureIsNotValidNow(address _signer, bytes32 _hash, bytes memory _signature)
internal
view
{
bool _isValid = SignatureChecker.isValidSignatureNow(_signer, _hash, _signature);
if (!_isValid) revert UniStaker__InvalidSignature();
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity 0.8.23;
import {IERC20Delegates} from "src/interfaces/IERC20Delegates.sol";
/// @title DelegationSurrogate
/// @author ScopeLift
/// @notice A dead-simple contract whose only purpose is to hold governance tokens on behalf of
/// users while delegating voting power to one specific delegatee. This is needed because a single
/// address can only delegate its (full) token weight to a single address at a time. Thus, when a
/// contract holds governance tokens in a pool on behalf of disparate token holders, those holders
/// are typically disenfranchised from their governance rights.
///
/// If a pool contract deploys a DelegationSurrogate for each delegatee, and transfers each
/// depositor's tokens to the appropriate surrogate—or deploys it on their behalf—users can retain
/// their governance rights.
///
/// The pool contract deploying the surrogates must handle all accounting. The surrogate simply
/// delegates its voting weight and max-approves its deployer to allow tokens to be reclaimed.
contract DelegationSurrogate {
/// @param _token The governance token that will be held by this surrogate
/// @param _delegatee The address of the would-be voter to which this surrogate will delegate its
/// voting weight. 100% of all voting tokens held by this surrogate will be delegated to this
/// address.
constructor(IERC20Delegates _token, address _delegatee) {
_token.delegate(_delegatee);
_token.approve(msg.sender, type(uint256).max);
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.23;
/// @title INotifiableRewardReceiver
/// @author ScopeLift
/// @notice The communication interface between the V3FactoryOwner contract and the UniStaker
/// contract. In particular, the V3FactoryOwner only needs to know the latter implements the
/// specified method in order to forward payouts to the UniStaker contract. The UniStaker contract
/// receives the rewards and abstracts the distribution mechanics
interface INotifiableRewardReceiver {
/// @notice Method called to notify a reward receiver it has received a reward.
/// @param _amount The amount of reward.
function notifyRewardAmount(uint256 _amount) external;
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.23;
/// @notice A subset of the ERC20Votes-style governance token to which UNI conforms.
/// Methods related to standard ERC20 functionality and to delegation are included.
/// These methods are needed in the context of this system. Methods related to check pointing,
/// past voting weights, and other functionality are omitted.
interface IERC20Delegates {
// ERC20 related methods
function allowance(address account, address spender) external view returns (uint256);
function approve(address spender, uint256 rawAmount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function transfer(address dst, uint256 rawAmount) external returns (bool);
function transferFrom(address src, address dst, uint256 rawAmount) external returns (bool);
function permit(
address owner,
address spender,
uint256 rawAmount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
// ERC20Votes delegation methods
function delegate(address delegatee) external;
function delegates(address) external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Multicall.sol)
pragma solidity ^0.8.20;
import {Address} from "./Address.sol";
/**
* @dev Provides a function to batch together multiple calls in a single external call.
*/
abstract contract Multicall {
/**
* @dev Receives and executes a batch of function calls on this contract.
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
results[i] = Address.functionDelegateCall(address(this), data[i]);
}
return results;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides tracking nonces for addresses. Nonces will only increment.
*/
abstract contract Nonces {
/**
* @dev The nonce used for an `account` is not the expected current nonce.
*/
error InvalidAccountNonce(address account, uint256 currentNonce);
mapping(address account => uint256) private _nonces;
/**
* @dev Returns the next unused nonce for an address.
*/
function nonces(address owner) public view virtual returns (uint256) {
return _nonces[owner];
}
/**
* @dev Consumes a nonce.
*
* Returns the current value and increments nonce.
*/
function _useNonce(address owner) internal virtual returns (uint256) {
// For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
// decremented or reset. This guarantees that the nonce never overflows.
unchecked {
// It is important to do x++ and not ++x here.
return _nonces[owner]++;
}
}
/**
* @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
*/
function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
uint256 current = _useNonce(owner);
if (nonce != current) {
revert InvalidAccountNonce(owner, current);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol)
pragma solidity ^0.8.20;
import {ECDSA} from "./ECDSA.sol";
import {IERC1271} from "../../interfaces/IERC1271.sol";
/**
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
* signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
* Argent and Safe Wallet (previously Gnosis Safe).
*/
library SignatureChecker {
/**
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature);
return
(error == ECDSA.RecoverError.NoError && recovered == signer) ||
isValidERC1271SignatureNow(signer, hash, signature);
}
/**
* @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
* against the signer smart contract using ERC1271.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidERC1271SignatureNow(
address signer,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
(bool success, bytes memory result) = signer.staticcall(
abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
);
return (success &&
result.length >= 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.20;
import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
* encoding is very generic and therefore its 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 order to
* produce the hash of their typed data 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].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* @custom:oz-upgrades-unsafe-allow state-variable-immutable
*/
abstract contract EIP712 is IERC5267 {
using ShortStrings for *;
bytes32 private constant TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;
bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;
ShortString private immutable _name;
ShortString private immutable _version;
string private _nameFallback;
string private _versionFallback;
/**
* @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].
*/
constructor(string memory name, string memory version) {
_name = name.toShortStringWithFallback(_nameFallback);
_version = version.toShortStringWithFallback(_versionFallback);
_hashedName = keccak256(bytes(name));
_hashedVersion = keccak256(bytes(version));
_cachedChainId = block.chainid;
_cachedDomainSeparator = _buildDomainSeparator();
_cachedThis = address(this);
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
return _cachedDomainSeparator;
} else {
return _buildDomainSeparator();
}
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, 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 MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {IERC-5267}.
*/
function eip712Domain()
public
view
virtual
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: By default this function reads _name which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Name() internal view returns (string memory) {
return _name.toStringWithFallback(_nameFallback);
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: By default this function reads _version which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Version() internal view returns (string memory) {
return _version.toStringWithFallback(_versionFallback);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @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].
*
* CAUTION: See Security Considerations above.
*/
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
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @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 ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// 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 (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): 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.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS, s);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*/
interface IERC1271 {
/**
* @dev Should return whether the signature provided is valid for the provided data
* @param hash Hash of the data to be signed
* @param signature Signature byte array associated with _data
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.20;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}{
"remappings": [
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"uniswap-periphery/=lib/v3-periphery/contracts/",
"@uniswap/v3-core/=lib/v3-core/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"v3-core/=lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 10000000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IERC20Delegates","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[],"name":"UniStaker__ExpiredDeadline","type":"error"},{"inputs":[],"name":"UniStaker__InsufficientRewardBalance","type":"error"},{"inputs":[],"name":"UniStaker__InvalidAddress","type":"error"},{"inputs":[],"name":"UniStaker__InvalidRewardRate","type":"error"},{"inputs":[],"name":"UniStaker__InvalidSignature","type":"error"},{"inputs":[{"internalType":"bytes32","name":"reason","type":"bytes32"},{"internalType":"address","name":"caller","type":"address"}],"name":"UniStaker__Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"UniStaker.DepositIdentifier","name":"depositId","type":"uint256"},{"indexed":true,"internalType":"address","name":"oldBeneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"newBeneficiary","type":"address"}],"name":"BeneficiaryAltered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"UniStaker.DepositIdentifier","name":"depositId","type":"uint256"},{"indexed":false,"internalType":"address","name":"oldDelegatee","type":"address"},{"indexed":false,"internalType":"address","name":"newDelegatee","type":"address"}],"name":"DelegateeAltered","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"notifier","type":"address"}],"name":"RewardNotified","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"RewardNotifierSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"UniStaker.DepositIdentifier","name":"depositId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositBalance","type":"uint256"}],"name":"StakeDeposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"UniStaker.DepositIdentifier","name":"depositId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositBalance","type":"uint256"}],"name":"StakeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":true,"internalType":"address","name":"surrogate","type":"address"}],"name":"SurrogateDeployed","type":"event"},{"inputs":[],"name":"ALTER_BENEFICIARY_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ALTER_DELEGATEE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CLAIM_REWARD_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SCALE_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_MORE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_TOKEN","outputs":[{"internalType":"contract IERC20Delegates","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"address","name":"_newBeneficiary","type":"address"}],"name":"alterBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"address","name":"_newBeneficiary","type":"address"},{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"alterBeneficiaryOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"address","name":"_newDelegatee","type":"address"}],"name":"alterDelegatee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"address","name":"_newDelegatee","type":"address"},{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"alterDelegateeOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"beneficiaryRewardPerTokenCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"claimRewardOnBehalf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"}],"name":"depositorTotalStaked","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"depositId","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"uint96","name":"balance","type":"uint96"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"earningPower","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"invalidateNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rewardNotifier","type":"address"}],"name":"isRewardNotifier","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastCheckpointTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"address","name":"_beneficiary","type":"address"},{"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":"permitAndStake","outputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"uint96","name":"_amount","type":"uint96"},{"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":"permitAndStakeMore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenAccumulated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenAccumulatedCheckpoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scaledRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"scaledUnclaimedRewardCheckpoint","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardNotifier","type":"address"},{"internalType":"bool","name":"_isEnabled","type":"bool"}],"name":"setRewardNotifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"stake","outputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_delegatee","type":"address"}],"name":"stake","outputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"uint96","name":"_amount","type":"uint96"}],"name":"stakeMore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"stakeMoreOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_delegatee","type":"address"},{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"stakeOnBehalf","outputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"surrogates","outputs":[{"internalType":"contract DelegationSurrogate","name":"surrogate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"unclaimedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"uint96","name":"_amount","type":"uint96"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"UniStaker.DepositIdentifier","name":"_depositId","type":"uint256"},{"internalType":"uint96","name":"_amount","type":"uint96"},{"internalType":"address","name":"_depositor","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"withdrawOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101a06040523480156200001257600080fd5b506040516200415438038062004154833981016040819052620000359162000279565b60408051808201825260098152682ab734a9ba30b5b2b960b91b602080830191909152825180840190935260018352603160f81b90830152906200007b8260006200014c565b610120526200008c8160016200014c565b61014052815160208084019190912060e052815190820120610100524660a0526200011a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0526001600160a01b0383811661016052821661018052620001438162000185565b505050620004b6565b60006020835110156200016c576200016483620001ec565b90506200017f565b8162000179848262000374565b5060ff90505b92915050565b620001908162000238565b6004546040516001600160a01b038084169216907fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff9790600090a3600480546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f8151111562000223578260405163305a27a960e01b81526004016200021a919062000440565b60405180910390fd5b8051620002308262000491565b179392505050565b6001600160a01b038116620002605760405163602c43ef60e11b815260040160405180910390fd5b50565b6001600160a01b03811681146200026057600080fd5b6000806000606084860312156200028f57600080fd5b83516200029c8162000263565b6020850151909350620002af8162000263565b6040850151909250620002c28162000263565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002f857607f821691505b6020821081036200031957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200036f576000816000526020600020601f850160051c810160208610156200034a5750805b601f850160051c820191505b818110156200036b5782815560010162000356565b5050505b505050565b81516001600160401b03811115620003905762000390620002cd565b620003a881620003a18454620002e3565b846200031f565b602080601f831160018114620003e05760008415620003c75750858301515b600019600386901b1c1916600185901b1785556200036b565b600085815260208120601f198616915b828110156200041157888601518255948401946001909101908401620003f0565b5085821015620004305787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020808352835180602085015260005b81811015620004705785810183015185820160400152820162000452565b506000604082860101526040601f19601f8301168501019250505092915050565b80516020808301519190811015620003195760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516101605161018051613c0362000551600039600081816103c601528181610bcf01528181611286015281816125e001526126da01526000818161069301528181610eb90152611a1a015260006122ac0152600061227d015260006127ec015260006127c40152600061271c01526000612747015260006127720152613c036000f3fe60806040523480156200001157600080fd5b5060043610620003615760003560e01c806389ee09f011620001c9578063b88a802f1162000101578063e69f949511620000a3578063e70f9445116200007a578063e70f944514620008e6578063edafe2c8146200091d578063f851a440146200094057600080fd5b8063e69f9495146200087f578063e6a612c31462000896578063e6dec27014620008ad57600080fd5b8063c6f6173b11620000d8578063c6f6173b1462000854578063ce4b5bbe146200085e578063ddda8a11146200087557600080fd5b8063b88a802f146200081d578063c3be99781462000827578063c3c16e4e146200084a57600080fd5b8063a677a37b116200016b578063ae0d27b61162000142578063ae0d27b61462000743578063b02c43d0146200074d578063b1fadf80146200080657600080fd5b8063a677a37b14620006e3578063a841ee281462000706578063ac9650d8146200071d57600080fd5b806399248ea711620001a057806399248ea7146200068d5780639a9b116514620006b55780639e544fff14620006cc57600080fd5b806389ee09f014620006375780638cf0f587146200065f57806398f2b576146200067657600080fd5b80635a57b46f116200029d57806376c5d758116200023f578063817b1cd21162000216578063817b1cd214620005f757806384b0196e146200060157806386312a81146200062057600080fd5b806376c5d758146200056e57806377d7a92114620005965780637ecebe0014620005be57600080fd5b806361dc0549116200027457806361dc054914620005365780636bad5e041462000540578063704b6c02146200055757600080fd5b80635a57b46f14620004f85780635ade228a14620005145780635ba8fcfe146200051f57600080fd5b80632be3a2c2116200030757806337e9f64a11620002de57806337e9f64a14620004af57806339aab4b014620004b95780633c6b16ab14620004e157600080fd5b80632be3a2c2146200043c5780632d7ef361146200045f57806331cb4bea146200048757600080fd5b80631c39b672116200033c5780631c39b67214620003c0578063228e1f3d146200040e578063255a4f73146200042557600080fd5b8063073a2ae9146200036657806314a7bcaf146200037f57806316463c5b14620003a9575b600080fd5b6200037d6200037736600462003062565b62000961565b005b620003966200039036600462003173565b6200098d565b6040519081526020015b60405180910390f35b6200037d620003ba366004620031ed565b62000a73565b620003e87f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620003a0565b620003966200041f36600462003279565b62000b66565b6200037d6200043636600462003302565b62000c56565b620003966200044d3660046200333e565b60076020526000908152604090205481565b620003967fd5e4d3028bb2c1dddfe7c51559a12df9cdd4bf3c0579f14d78e276a15e87ea4f81565b620003967f420c9ec84cf25c36dead54f6e6827a954e8e601dea0a7d82594581c54138773281565b62000396600a5481565b620003967f300c1a75d358323d4ec7b212cd1e88afbd0250186b09c957b383ee5e6ad897f581565b6200037d620004f23660046200335c565b62000cea565b6200037d33600090815260026020526040902080546001019055565b6200039662278d0081565b6200037d6200053036600462003376565b62000fd2565b62000396600b5481565b6200037d62000551366004620033a1565b620010b0565b6200037d620005683660046200333e565b620010d7565b620003967f277b94e6cefe6a0f880d649624078c4df18c5639ffab0db19ad83a5c59b67a9681565b620003967f6bac54099c7bf34385b0fcc7cec4b62c6138950310516bf6d92b106726e80b6881565b62000396620005cf3660046200333e565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b6200039660055481565b6200060b620010ec565b604051620003a0979695949392919062003439565b6200037d6200063136600462003376565b62001152565b620003967f02b86dfac8c39cc498eeafc5b86f375784c18fd83dfdc4e3620b4f0ec1042c9481565b620003966200067036600462003501565b620011e6565b62000396620006873660046200354b565b620011f6565b620003e87f000000000000000000000000000000000000000000000000000000000000000081565b6200037d620006c63660046200357a565b62001206565b62000396620006dd3660046200333e565b62001309565b62000396620006f43660046200333e565b600f6020526000908152604090205481565b6200037d62000717366004620033a1565b62001338565b620007346200072e366004620035d7565b6200135f565b604051620003a0919062003651565b620003966200145a565b620007ba6200075e3660046200335c565b6008602052600090815260409020805460018201546002909201546bffffffffffffffffffffffff82169273ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000909304831692908116911684565b604080516bffffffffffffffffffffffff909516855273ffffffffffffffffffffffffffffffffffffffff938416602086015291831691840191909152166060820152608001620003a0565b6200037d62000817366004620031ed565b620014b9565b620003966200154d565b62000396620008383660046200333e565b60066020526000908152604090205481565b62000396600c5481565b62000396600d5481565b620003966ec097ce7bc90715b34b9f100000000081565b620003966200155a565b6200039662000890366004620036d7565b62001572565b6200037d620008a736600462003062565b6200165f565b620003e8620008be3660046200333e565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6200090c620008f73660046200333e565b60106020526000908152604090205460ff1681565b6040519015158152602001620003a0565b620003966200092e3660046200333e565b600e6020526000908152604090205481565b600454620003e89073ffffffffffffffffffffffffffffffffffffffff1681565b60008281526008602052604090206200097b813362001686565b620009888184846200172d565b505050565b60006200099a8362001820565b62000a5e8462000a577f420c9ec84cf25c36dead54f6e6827a954e8e601dea0a7d82594581c54138773287620009fa8973ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b8860405160200162000a3b949392919093845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b604051602081830303815290604052805190602001206200185b565b84620018a6565b62000a6984620018f5565b90505b9392505050565b600085815260086020526040902062000a8d818562001686565b62000a988362001820565b62000b518462000a577f277b94e6cefe6a0f880d649624078c4df18c5639ffab0db19ad83a5c59b67a9689898962000afa8b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b6040805160208101969096528501939093526bffffffffffffffffffffffff909116606084015273ffffffffffffffffffffffffffffffffffffffff16608083015260a082015260c0810187905260e00162000a3b565b62000b5e81878762001a41565b505050505050565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081523360048201523060248201526bffffffffffffffffffffffff881660448201526064810185905260ff8416608482015260a4810183905260c481018290526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b15801562000c2957600080fd5b505af192505050801562000c3b575060015b5062000c4a3389898962001c43565b98975050505050505050565b62000c6062001f1d565b73ffffffffffffffffffffffffffffffffffffffff821660008181526010602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527fb33ca1dabfb28a2e1bd06b332c396b1a3d538278691341a5503bbad53f919197910160405180910390a25050565b3360009081526010602052604090205460ff1662000d61576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f74206e6f746966696572000000000000000000000000000000000000000060048201523360248201526044015b60405180910390fd5b62000d6b6200145a565b600d55600a54421062000dac5762278d0062000d976ec097ce7bc90715b34b9f1000000000836200379a565b62000da39190620037b4565b600c5562000e0b565b600042600a5462000dbe9190620037f0565b600c5462000dcd91906200379a565b905062278d0062000dee6ec097ce7bc90715b34b9f1000000000846200379a565b62000dfa908362003806565b62000e069190620037b4565b600c55505b62000e1a62278d004262003806565b600a5542600b55600c5462000e40906ec097ce7bc90715b34b9f100000000090620037b4565b60000362000e7a576040517f2fe5e38f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526ec097ce7bc90715b34b9f1000000000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801562000f16573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f3c91906200381c565b62000f4891906200379a565b62278d00600c5462000f5b91906200379a565b111562000f94576040517fee554ac900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518281523360208201527f48f411442545d43fc993afadc0fd408cf0d1c606f3d10d1de7b05c994463ed97910160405180910390a150565b50565b600085815260086020526040902062000fec818562001686565b62000ff78362001820565b620010a38462000a577f300c1a75d358323d4ec7b212cd1e88afbd0250186b09c957b383ee5e6ad897f5898989620010598b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935273ffffffffffffffffffffffffffffffffffffffff918216606085015216608083015260a082015260c0810187905260e00162000a3b565b62000b5e8187876200172d565b6000828152600860205260409020620010ca813362001686565b6200098881848462001f9a565b620010e162001f1d565b62000fcf81620021dc565b6000606080600080600060606200110262002275565b6200110c620022a4565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b60008581526008602052604090206200116c818562001686565b620011778362001820565b620011d98462000a577fd5e4d3028bb2c1dddfe7c51559a12df9cdd4bf3c0579f14d78e276a15e87ea4f898989620010598b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b62000b5e818787620022d3565b600062000a693385858562001c43565b600062000a6c3384843362001c43565b600086815260086020526040902062001220813362001686565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081523360048201523060248201526bffffffffffffffffffffffff871660448201526064810186905260ff8516608482015260a4810184905260c481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b158015620012e057600080fd5b505af1925050508015620012f2575060015b506200130081888862001f9a565b50505050505050565b60006ec097ce7bc90715b34b9f1000000000620013268362002439565b620013329190620037b4565b92915050565b600082815260086020526040902062001352813362001686565b6200098881848462001a41565b60608167ffffffffffffffff8111156200137d576200137d62003091565b604051908082528060200260200182016040528015620013b257816020015b60608152602001906001900390816200139c5790505b50905060005b8281101562001453576200142a30858584818110620013db57620013db62003836565b9050602002810190620013ef919062003865565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250620024d992505050565b8282815181106200143f576200143f62003836565b6020908102919091010152600101620013b8565b5092915050565b60006005546000036200146e5750600d5490565b600554600b546200147e6200155a565b6200148a9190620037f0565b600c546200149991906200379a565b620014a59190620037b4565b600d54620014b4919062003806565b905090565b6000858152600860205260409020620014d3818562001686565b620014de8362001820565b620015408462000a577f6bac54099c7bf34385b0fcc7cec4b62c6138950310516bf6d92b106726e80b6889898962000afa8b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b62000b5e81878762001f9a565b6000620014b433620018f5565b600042600a54116200156d5750600a5490565b504290565b60006200157f8362001820565b620016468462000a577f02b86dfac8c39cc498eeafc5b86f375784c18fd83dfdc4e3620b4f0ec1042c948a8a8a8a620015e28c73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b6040805160208101979097526bffffffffffffffffffffffff9095169486019490945273ffffffffffffffffffffffffffffffffffffffff928316606086015290821660808501521660a083015260c082015260e081018790526101000162000a3b565b620016548488888862001c43565b979650505050505050565b600082815260086020526040902062001679813362001686565b62000988818484620022d3565b815473ffffffffffffffffffffffffffffffffffffffff8281166c01000000000000000000000000909204161462001729576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f74206f776e65720000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216602482015260440162000d58565b5050565b620017388162002562565b600183015473ffffffffffffffffffffffffffffffffffffffff908116600081815260096020908152604091829020548251938452858516918401919091529092169184917f4ac5bca5b979462f72ac2586d359f46427c09a49b337dcbd3ca9975140101694910160405180910390a26001840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556000620017f783620025b0565b85549091506200181990839083906bffffffffffffffffffffffff16620026d4565b5050505050565b8042111562000fcf576040517f537c993600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000620013326200186b62002702565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b6000620018b58484846200283d565b905080620018ef576040517fb0d4837c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b600062001901620028c2565b6200190c82620028de565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600f60205260408120546200194e906ec097ce7bc90715b34b9f100000000090620037b4565b905080600003620019625750600092915050565b6200197d6ec097ce7bc90715b34b9f1000000000826200379a565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600f6020526040902054620019af9190620037f0565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600f6020526040908190209290925590517f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72419062001a0c9084815260200190565b60405180910390a2620013327f0000000000000000000000000000000000000000000000000000000000000000848362002924565b62001a4b620028c2565b600283015462001a719073ffffffffffffffffffffffffffffffffffffffff16620028de565b82548190849060009062001a959084906bffffffffffffffffffffffff16620038d4565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550806bffffffffffffffffffffffff166005600082825462001ae59190620037f0565b909155505082546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040812080546bffffffffffffffffffffffff8416929062001b40908490620037f0565b9091555050600283015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff8416929062001b8e908490620037f0565b9091555050600183015473ffffffffffffffffffffffffffffffffffffffff908116600090815260096020526040902054845462001bf192918216916c01000000000000000000000000909104166bffffffffffffffffffffffff8416620026d4565b8254604080516bffffffffffffffffffffffff8085168252909216602083015283917fcda86d0ec3f513f43f5512de1982307d90747e4da0550585ca8744cbc7d8619f910160405180910390a2505050565b600062001c508362002562565b62001c5b8262002562565b62001c65620028c2565b62001c7082620028de565b600062001c7d84620025b0565b905062001c89620029a7565b9150846bffffffffffffffffffffffff166005600082825462001cad919062003806565b909155505073ffffffffffffffffffffffffffffffffffffffff8616600090815260066020526040812080546bffffffffffffffffffffffff8816929062001cf790849062003806565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600090815260076020526040812080546bffffffffffffffffffffffff8816929062001d4190849062003806565b9091555050604080516080810182526bffffffffffffffffffffffff80881680835273ffffffffffffffffffffffffffffffffffffffff808b1660208086019182528a83168688019081528a84166060880190815260008b81526008909352979091209551915183166c01000000000000000000000000029190941617845591516001840180549184167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055935160029093018054939092169290931691909117905562001e189087908390620026d4565b6040805173ffffffffffffffffffffffffffffffffffffffff881681526bffffffffffffffffffffffff87166020820181905281830152905183917feb6032fe8d7a2f7003e5b33948bdc807f994be970351cd021a033784812c8baa919081900360600190a260405173ffffffffffffffffffffffffffffffffffffffff84169060009084907fe1fcac5fc7d2f61f04d109cb8169e6163bdf912d84879a78652bb7b93573cc7c908390a4604080516000815273ffffffffffffffffffffffffffffffffffffffff8616602082015283917f4ac5bca5b979462f72ac2586d359f46427c09a49b337dcbd3ca9975140101694910160405180910390a250949350505050565b60045473ffffffffffffffffffffffffffffffffffffffff16331462001f98576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f742061646d696e0000000000000000000000000000000000000000000000600482015233602482015260440162000d58565b565b62001fa4620028c2565b600283015462001fca9073ffffffffffffffffffffffffffffffffffffffff16620028de565b600183015473ffffffffffffffffffffffffffffffffffffffff9081166000908152600960205260408120546005805491909316926bffffffffffffffffffffffff85169290916200201e90849062003806565b909155505083546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040812080546bffffffffffffffffffffffff851692906200207990849062003806565b9091555050600284015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff85169290620020c790849062003806565b9091555050835482908590600090620020f09084906bffffffffffffffffffffffff16620038fc565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506200215d84600001600c9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682846bffffffffffffffffffffffff16620026d4565b8354604080516c01000000000000000000000000830473ffffffffffffffffffffffffffffffffffffffff1681526bffffffffffffffffffffffff80861660208301529092169082015283907feb6032fe8d7a2f7003e5b33948bdc807f994be970351cd021a033784812c8baa9060600160405180910390a250505050565b620021e78162002562565b60045460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff9790600090a3600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060620014b47f00000000000000000000000000000000000000000000000000000000000000006000620029bd565b6060620014b47f00000000000000000000000000000000000000000000000000000000000000006001620029bd565b620022de8162002562565b620022e8620028c2565b60028301546200230e9073ffffffffffffffffffffffffffffffffffffffff16620028de565b8254600284015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff909316929091906200235c908490620037f0565b909155506200236d905081620028de565b600283015460405173ffffffffffffffffffffffffffffffffffffffff80841692169084907fe1fcac5fc7d2f61f04d109cb8169e6163bdf912d84879a78652bb7b93573cc7c90600090a46002830180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091558354600091825260076020526040822080546bffffffffffffffffffffffff9092169290916200242f90849062003806565b9091555050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e6020526040812054620024696200145a565b620024759190620037f0565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260076020526040902054620024a791906200379a565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205462001332919062003806565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405162002505919062003924565b600060405180830381855af49150503d806000811462002542576040519150601f19603f3d011682016040523d82523d6000602084013e62002547565b606091505b50915091506200255985838362002a75565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff811662000fcf576040517fc05887de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600960205260409020541680620026cf577f0000000000000000000000000000000000000000000000000000000000000000826040516200260e906200302f565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f0801580156200264f573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff83811660008181526009602052604080822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016948616948517905551939450919290917f53ff145c5d53f9465a0d97719aeab68428f349b2cf0b009e9dd75b94b315d7be91a35b919050565b620009887f000000000000000000000000000000000000000000000000000000000000000084848462002b0c565b60003073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480156200276957507f000000000000000000000000000000000000000000000000000000000000000046145b156200279457507f000000000000000000000000000000000000000000000000000000000000000090565b620014b4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060006200284e858562002b54565b50909250905060008160038111156200286b576200286b62003942565b148015620028a457508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80620028b85750620028b886868662002ba5565b9695505050505050565b620028cc6200145a565b600d55620028d96200155a565b600b55565b620028e98162002439565b73ffffffffffffffffffffffffffffffffffffffff9091166000908152600f6020908152604080832093909355600d54600e90915291902055565b60405173ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390526200098891859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062002cfc565b600354620029b781600162003806565b60035590565b606060ff8314620029db57620029d38362002d99565b905062001332565b818054620029e99062003971565b80601f016020809104026020016040519081016040528092919081815260200182805462002a179062003971565b801562002a685780601f1062002a3c5761010080835404028352916020019162002a68565b820191906000526020600020905b81548152906001019060200180831162002a4a57829003601f168201915b5050505050905062001332565b60608262002a8e5762002a888262002dda565b62000a6c565b815115801562002ab3575073ffffffffffffffffffffffffffffffffffffffff84163b155b1562002b04576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000d58565b508062000a6c565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052620018ef9186918216906323b872dd906084016200295f565b6000806000835160410362002b925760208401516040850151606086015160001a62002b838882858562002e1d565b95509550955050505062002b9e565b50508151600091506002905b9250925092565b60008060008573ffffffffffffffffffffffffffffffffffffffff16858560405160240162002bd6929190620039c6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f1626ba7e000000000000000000000000000000000000000000000000000000001790525162002c59919062003924565b600060405180830381855afa9150503d806000811462002c96576040519150601f19603f3d011682016040523d82523d6000602084013e62002c9b565b606091505b509150915081801562002cb057506020815110155b8015620028b8575080517f1626ba7e000000000000000000000000000000000000000000000000000000009062002cf190830160209081019084016200381c565b149695505050505050565b600062002d2073ffffffffffffffffffffffffffffffffffffffff84168362002f1c565b9050805160001415801562002d4857508080602001905181019062002d469190620039e1565b155b1562000988576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240162000d58565b6060600062002da88362002f2c565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b80511562002deb5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562002e5a575060009150600390508262002f12565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562002eaf573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811662002f085750600092506001915082905062002f12565b9250600091508190505b9450945094915050565b606062000a6c8383600062002f6e565b600060ff8216601f81111562001332576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608147101562002fae576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240162000d58565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405162002fd9919062003924565b60006040518083038185875af1925050503d806000811462003018576040519150601f19603f3d011682016040523d82523d6000602084013e6200301d565b606091505b5091509150620028b886838362002a75565b6101cc8062003a0283390190565b803573ffffffffffffffffffffffffffffffffffffffff81168114620026cf57600080fd5b600080604083850312156200307657600080fd5b8235915062003088602084016200303d565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112620030d257600080fd5b813567ffffffffffffffff80821115620030f057620030f062003091565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171562003139576200313962003091565b816040528381528660208588010111156200315357600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156200318957600080fd5b62003194846200303d565b925060208401359150604084013567ffffffffffffffff811115620031b857600080fd5b620031c686828701620030c0565b9150509250925092565b80356bffffffffffffffffffffffff81168114620026cf57600080fd5b600080600080600060a086880312156200320657600080fd5b853594506200321860208701620031d0565b935062003228604087016200303d565b925060608601359150608086013567ffffffffffffffff8111156200324c57600080fd5b6200325a88828901620030c0565b9150509295509295909350565b803560ff81168114620026cf57600080fd5b600080600080600080600060e0888a0312156200329557600080fd5b620032a088620031d0565b9650620032b0602089016200303d565b9550620032c0604089016200303d565b945060608801359350620032d76080890162003267565b925060a0880135915060c0880135905092959891949750929550565b801515811462000fcf57600080fd5b600080604083850312156200331657600080fd5b62003321836200303d565b915060208301356200333381620032f3565b809150509250929050565b6000602082840312156200335157600080fd5b62000a6c826200303d565b6000602082840312156200336f57600080fd5b5035919050565b600080600080600060a086880312156200338f57600080fd5b8535945062003218602087016200303d565b60008060408385031215620033b557600080fd5b823591506200308860208401620031d0565b60005b83811015620033e4578181015183820152602001620033ca565b50506000910152565b6000815180845262003407816020860160208601620033c7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e060208401526200347860e084018a620033ed565b83810360408501526200348c818a620033ed565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b81811015620034ef57835183529284019291840191600101620034d1565b50909c9b505050505050505050505050565b6000806000606084860312156200351757600080fd5b6200352284620031d0565b925062003532602085016200303d565b915062003542604085016200303d565b90509250925092565b600080604083850312156200355f57600080fd5b6200356a83620031d0565b915062003088602084016200303d565b60008060008060008060c087890312156200359457600080fd5b86359550620035a660208801620031d0565b945060408701359350620035bd6060880162003267565b92506080870135915060a087013590509295509295509295565b60008060208385031215620035eb57600080fd5b823567ffffffffffffffff808211156200360457600080fd5b818501915085601f8301126200361957600080fd5b8135818111156200362957600080fd5b8660208260051b85010111156200363f57600080fd5b60209290920196919550909350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015620036ca577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452620036b7858351620033ed565b945092850192908501906001016200367a565b5092979650505050505050565b60008060008060008060c08789031215620036f157600080fd5b620036fc87620031d0565b95506200370c602088016200303d565b94506200371c604088016200303d565b93506200372c606088016200303d565b92506080870135915060a087013567ffffffffffffffff8111156200375057600080fd5b6200375e89828a01620030c0565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176200133257620013326200376b565b600082620037eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156200133257620013326200376b565b808201808211156200133257620013326200376b565b6000602082840312156200382f57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126200389b57600080fd5b83018035915067ffffffffffffffff821115620038b757600080fd5b602001915036819003821315620038cd57600080fd5b9250929050565b6bffffffffffffffffffffffff8281168282160390808211156200145357620014536200376b565b6bffffffffffffffffffffffff8181168382160190808211156200145357620014536200376b565b6000825162003938818460208701620033c7565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c908216806200398657607f821691505b602082108103620039c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b82815260406020820152600062000a696040830184620033ed565b600060208284031215620039f457600080fd5b815162000a6c81620032f356fe608060405234801561001057600080fd5b506040516101cc3803806101cc83398101604081905261002f9161011c565b6040516317066a5760e21b81526001600160a01b038281166004830152831690635c19a95c90602401600060405180830381600087803b15801561007257600080fd5b505af1158015610086573d6000803e3d6000fd5b505060405163095ea7b360e01b815233600482015260001960248201526001600160a01b038516925063095ea7b391506044016020604051808303816000875af11580156100d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fc9190610156565b50505061017f565b6001600160a01b038116811461011957600080fd5b50565b6000806040838503121561012f57600080fd5b825161013a81610104565b602084015190925061014b81610104565b809150509250929050565b60006020828403121561016857600080fd5b8151801515811461017857600080fd5b9392505050565b603f8061018d6000396000f3fe6080604052600080fdfea2646970667358221220defe974d338236b7160b55d8085409609e608cac3ae33625fa36e65bc712a3f364736f6c63430008170033a2646970667358221220881acdf2b86321ce5553f215df4ff4b0142142c1d27dc4e4686ac1dfc4d2076264736f6c63430008170033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98400000000000000000000000071218d9e40cac8f7c76a9aba2de7e6aae4e9c736
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620003615760003560e01c806389ee09f011620001c9578063b88a802f1162000101578063e69f949511620000a3578063e70f9445116200007a578063e70f944514620008e6578063edafe2c8146200091d578063f851a440146200094057600080fd5b8063e69f9495146200087f578063e6a612c31462000896578063e6dec27014620008ad57600080fd5b8063c6f6173b11620000d8578063c6f6173b1462000854578063ce4b5bbe146200085e578063ddda8a11146200087557600080fd5b8063b88a802f146200081d578063c3be99781462000827578063c3c16e4e146200084a57600080fd5b8063a677a37b116200016b578063ae0d27b61162000142578063ae0d27b61462000743578063b02c43d0146200074d578063b1fadf80146200080657600080fd5b8063a677a37b14620006e3578063a841ee281462000706578063ac9650d8146200071d57600080fd5b806399248ea711620001a057806399248ea7146200068d5780639a9b116514620006b55780639e544fff14620006cc57600080fd5b806389ee09f014620006375780638cf0f587146200065f57806398f2b576146200067657600080fd5b80635a57b46f116200029d57806376c5d758116200023f578063817b1cd21162000216578063817b1cd214620005f757806384b0196e146200060157806386312a81146200062057600080fd5b806376c5d758146200056e57806377d7a92114620005965780637ecebe0014620005be57600080fd5b806361dc0549116200027457806361dc054914620005365780636bad5e041462000540578063704b6c02146200055757600080fd5b80635a57b46f14620004f85780635ade228a14620005145780635ba8fcfe146200051f57600080fd5b80632be3a2c2116200030757806337e9f64a11620002de57806337e9f64a14620004af57806339aab4b014620004b95780633c6b16ab14620004e157600080fd5b80632be3a2c2146200043c5780632d7ef361146200045f57806331cb4bea146200048757600080fd5b80631c39b672116200033c5780631c39b67214620003c0578063228e1f3d146200040e578063255a4f73146200042557600080fd5b8063073a2ae9146200036657806314a7bcaf146200037f57806316463c5b14620003a9575b600080fd5b6200037d6200037736600462003062565b62000961565b005b620003966200039036600462003173565b6200098d565b6040519081526020015b60405180910390f35b6200037d620003ba366004620031ed565b62000a73565b620003e87f0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98481565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001620003a0565b620003966200041f36600462003279565b62000b66565b6200037d6200043636600462003302565b62000c56565b620003966200044d3660046200333e565b60076020526000908152604090205481565b620003967fd5e4d3028bb2c1dddfe7c51559a12df9cdd4bf3c0579f14d78e276a15e87ea4f81565b620003967f420c9ec84cf25c36dead54f6e6827a954e8e601dea0a7d82594581c54138773281565b62000396600a5481565b620003967f300c1a75d358323d4ec7b212cd1e88afbd0250186b09c957b383ee5e6ad897f581565b6200037d620004f23660046200335c565b62000cea565b6200037d33600090815260026020526040902080546001019055565b6200039662278d0081565b6200037d6200053036600462003376565b62000fd2565b62000396600b5481565b6200037d62000551366004620033a1565b620010b0565b6200037d620005683660046200333e565b620010d7565b620003967f277b94e6cefe6a0f880d649624078c4df18c5639ffab0db19ad83a5c59b67a9681565b620003967f6bac54099c7bf34385b0fcc7cec4b62c6138950310516bf6d92b106726e80b6881565b62000396620005cf3660046200333e565b73ffffffffffffffffffffffffffffffffffffffff1660009081526002602052604090205490565b6200039660055481565b6200060b620010ec565b604051620003a0979695949392919062003439565b6200037d6200063136600462003376565b62001152565b620003967f02b86dfac8c39cc498eeafc5b86f375784c18fd83dfdc4e3620b4f0ec1042c9481565b620003966200067036600462003501565b620011e6565b62000396620006873660046200354b565b620011f6565b620003e87f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6200037d620006c63660046200357a565b62001206565b62000396620006dd3660046200333e565b62001309565b62000396620006f43660046200333e565b600f6020526000908152604090205481565b6200037d62000717366004620033a1565b62001338565b620007346200072e366004620035d7565b6200135f565b604051620003a0919062003651565b620003966200145a565b620007ba6200075e3660046200335c565b6008602052600090815260409020805460018201546002909201546bffffffffffffffffffffffff82169273ffffffffffffffffffffffffffffffffffffffff6c01000000000000000000000000909304831692908116911684565b604080516bffffffffffffffffffffffff909516855273ffffffffffffffffffffffffffffffffffffffff938416602086015291831691840191909152166060820152608001620003a0565b6200037d62000817366004620031ed565b620014b9565b620003966200154d565b62000396620008383660046200333e565b60066020526000908152604090205481565b62000396600c5481565b62000396600d5481565b620003966ec097ce7bc90715b34b9f100000000081565b620003966200155a565b6200039662000890366004620036d7565b62001572565b6200037d620008a736600462003062565b6200165f565b620003e8620008be3660046200333e565b60096020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b6200090c620008f73660046200333e565b60106020526000908152604090205460ff1681565b6040519015158152602001620003a0565b620003966200092e3660046200333e565b600e6020526000908152604090205481565b600454620003e89073ffffffffffffffffffffffffffffffffffffffff1681565b60008281526008602052604090206200097b813362001686565b620009888184846200172d565b505050565b60006200099a8362001820565b62000a5e8462000a577f420c9ec84cf25c36dead54f6e6827a954e8e601dea0a7d82594581c54138773287620009fa8973ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b8860405160200162000a3b949392919093845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b604051602081830303815290604052805190602001206200185b565b84620018a6565b62000a6984620018f5565b90505b9392505050565b600085815260086020526040902062000a8d818562001686565b62000a988362001820565b62000b518462000a577f277b94e6cefe6a0f880d649624078c4df18c5639ffab0db19ad83a5c59b67a9689898962000afa8b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b6040805160208101969096528501939093526bffffffffffffffffffffffff909116606084015273ffffffffffffffffffffffffffffffffffffffff16608083015260a082015260c0810187905260e00162000a3b565b62000b5e81878762001a41565b505050505050565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081523360048201523060248201526bffffffffffffffffffffffff881660448201526064810185905260ff8416608482015260a4810183905260c481018290526000907f0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98473ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b15801562000c2957600080fd5b505af192505050801562000c3b575060015b5062000c4a3389898962001c43565b98975050505050505050565b62000c6062001f1d565b73ffffffffffffffffffffffffffffffffffffffff821660008181526010602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527fb33ca1dabfb28a2e1bd06b332c396b1a3d538278691341a5503bbad53f919197910160405180910390a25050565b3360009081526010602052604090205460ff1662000d61576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f74206e6f746966696572000000000000000000000000000000000000000060048201523360248201526044015b60405180910390fd5b62000d6b6200145a565b600d55600a54421062000dac5762278d0062000d976ec097ce7bc90715b34b9f1000000000836200379a565b62000da39190620037b4565b600c5562000e0b565b600042600a5462000dbe9190620037f0565b600c5462000dcd91906200379a565b905062278d0062000dee6ec097ce7bc90715b34b9f1000000000846200379a565b62000dfa908362003806565b62000e069190620037b4565b600c55505b62000e1a62278d004262003806565b600a5542600b55600c5462000e40906ec097ce7bc90715b34b9f100000000090620037b4565b60000362000e7a576040517f2fe5e38f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526ec097ce7bc90715b34b9f1000000000907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801562000f16573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f3c91906200381c565b62000f4891906200379a565b62278d00600c5462000f5b91906200379a565b111562000f94576040517fee554ac900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080518281523360208201527f48f411442545d43fc993afadc0fd408cf0d1c606f3d10d1de7b05c994463ed97910160405180910390a150565b50565b600085815260086020526040902062000fec818562001686565b62000ff78362001820565b620010a38462000a577f300c1a75d358323d4ec7b212cd1e88afbd0250186b09c957b383ee5e6ad897f5898989620010598b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935273ffffffffffffffffffffffffffffffffffffffff918216606085015216608083015260a082015260c0810187905260e00162000a3b565b62000b5e8187876200172d565b6000828152600860205260409020620010ca813362001686565b6200098881848462001f9a565b620010e162001f1d565b62000fcf81620021dc565b6000606080600080600060606200110262002275565b6200110c620022a4565b604080516000808252602082019092527f0f000000000000000000000000000000000000000000000000000000000000009b939a50919850469750309650945092509050565b60008581526008602052604090206200116c818562001686565b620011778362001820565b620011d98462000a577fd5e4d3028bb2c1dddfe7c51559a12df9cdd4bf3c0579f14d78e276a15e87ea4f898989620010598b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b62000b5e818787620022d3565b600062000a693385858562001c43565b600062000a6c3384843362001c43565b600086815260086020526040902062001220813362001686565b6040517fd505accf0000000000000000000000000000000000000000000000000000000081523360048201523060248201526bffffffffffffffffffffffff871660448201526064810186905260ff8516608482015260a4810184905260c481018390527f0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98473ffffffffffffffffffffffffffffffffffffffff169063d505accf9060e401600060405180830381600087803b158015620012e057600080fd5b505af1925050508015620012f2575060015b506200130081888862001f9a565b50505050505050565b60006ec097ce7bc90715b34b9f1000000000620013268362002439565b620013329190620037b4565b92915050565b600082815260086020526040902062001352813362001686565b6200098881848462001a41565b60608167ffffffffffffffff8111156200137d576200137d62003091565b604051908082528060200260200182016040528015620013b257816020015b60608152602001906001900390816200139c5790505b50905060005b8281101562001453576200142a30858584818110620013db57620013db62003836565b9050602002810190620013ef919062003865565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250620024d992505050565b8282815181106200143f576200143f62003836565b6020908102919091010152600101620013b8565b5092915050565b60006005546000036200146e5750600d5490565b600554600b546200147e6200155a565b6200148a9190620037f0565b600c546200149991906200379a565b620014a59190620037b4565b600d54620014b4919062003806565b905090565b6000858152600860205260409020620014d3818562001686565b620014de8362001820565b620015408462000a577f6bac54099c7bf34385b0fcc7cec4b62c6138950310516bf6d92b106726e80b6889898962000afa8b73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b62000b5e81878762001f9a565b6000620014b433620018f5565b600042600a54116200156d5750600a5490565b504290565b60006200157f8362001820565b620016468462000a577f02b86dfac8c39cc498eeafc5b86f375784c18fd83dfdc4e3620b4f0ec1042c948a8a8a8a620015e28c73ffffffffffffffffffffffffffffffffffffffff16600090815260026020526040902080546001810190915590565b6040805160208101979097526bffffffffffffffffffffffff9095169486019490945273ffffffffffffffffffffffffffffffffffffffff928316606086015290821660808501521660a083015260c082015260e081018790526101000162000a3b565b620016548488888862001c43565b979650505050505050565b600082815260086020526040902062001679813362001686565b62000988818484620022d3565b815473ffffffffffffffffffffffffffffffffffffffff8281166c01000000000000000000000000909204161462001729576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f74206f776e65720000000000000000000000000000000000000000000000600482015273ffffffffffffffffffffffffffffffffffffffff8216602482015260440162000d58565b5050565b620017388162002562565b600183015473ffffffffffffffffffffffffffffffffffffffff908116600081815260096020908152604091829020548251938452858516918401919091529092169184917f4ac5bca5b979462f72ac2586d359f46427c09a49b337dcbd3ca9975140101694910160405180910390a26001840180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84161790556000620017f783620025b0565b85549091506200181990839083906bffffffffffffffffffffffff16620026d4565b5050505050565b8042111562000fcf576040517f537c993600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000620013326200186b62002702565b836040517f19010000000000000000000000000000000000000000000000000000000000008152600281019290925260228201526042902090565b6000620018b58484846200283d565b905080620018ef576040517fb0d4837c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b600062001901620028c2565b6200190c82620028de565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600f60205260408120546200194e906ec097ce7bc90715b34b9f100000000090620037b4565b905080600003620019625750600092915050565b6200197d6ec097ce7bc90715b34b9f1000000000826200379a565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600f6020526040902054620019af9190620037f0565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600f6020526040908190209290925590517f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f72419062001a0c9084815260200190565b60405180910390a2620013327f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2848362002924565b62001a4b620028c2565b600283015462001a719073ffffffffffffffffffffffffffffffffffffffff16620028de565b82548190849060009062001a959084906bffffffffffffffffffffffff16620038d4565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550806bffffffffffffffffffffffff166005600082825462001ae59190620037f0565b909155505082546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040812080546bffffffffffffffffffffffff8416929062001b40908490620037f0565b9091555050600283015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff8416929062001b8e908490620037f0565b9091555050600183015473ffffffffffffffffffffffffffffffffffffffff908116600090815260096020526040902054845462001bf192918216916c01000000000000000000000000909104166bffffffffffffffffffffffff8416620026d4565b8254604080516bffffffffffffffffffffffff8085168252909216602083015283917fcda86d0ec3f513f43f5512de1982307d90747e4da0550585ca8744cbc7d8619f910160405180910390a2505050565b600062001c508362002562565b62001c5b8262002562565b62001c65620028c2565b62001c7082620028de565b600062001c7d84620025b0565b905062001c89620029a7565b9150846bffffffffffffffffffffffff166005600082825462001cad919062003806565b909155505073ffffffffffffffffffffffffffffffffffffffff8616600090815260066020526040812080546bffffffffffffffffffffffff8816929062001cf790849062003806565b909155505073ffffffffffffffffffffffffffffffffffffffff8316600090815260076020526040812080546bffffffffffffffffffffffff8816929062001d4190849062003806565b9091555050604080516080810182526bffffffffffffffffffffffff80881680835273ffffffffffffffffffffffffffffffffffffffff808b1660208086019182528a83168688019081528a84166060880190815260008b81526008909352979091209551915183166c01000000000000000000000000029190941617845591516001840180549184167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055935160029093018054939092169290931691909117905562001e189087908390620026d4565b6040805173ffffffffffffffffffffffffffffffffffffffff881681526bffffffffffffffffffffffff87166020820181905281830152905183917feb6032fe8d7a2f7003e5b33948bdc807f994be970351cd021a033784812c8baa919081900360600190a260405173ffffffffffffffffffffffffffffffffffffffff84169060009084907fe1fcac5fc7d2f61f04d109cb8169e6163bdf912d84879a78652bb7b93573cc7c908390a4604080516000815273ffffffffffffffffffffffffffffffffffffffff8616602082015283917f4ac5bca5b979462f72ac2586d359f46427c09a49b337dcbd3ca9975140101694910160405180910390a250949350505050565b60045473ffffffffffffffffffffffffffffffffffffffff16331462001f98576040517f93bf15a50000000000000000000000000000000000000000000000000000000081527f6e6f742061646d696e0000000000000000000000000000000000000000000000600482015233602482015260440162000d58565b565b62001fa4620028c2565b600283015462001fca9073ffffffffffffffffffffffffffffffffffffffff16620028de565b600183015473ffffffffffffffffffffffffffffffffffffffff9081166000908152600960205260408120546005805491909316926bffffffffffffffffffffffff85169290916200201e90849062003806565b909155505083546c01000000000000000000000000900473ffffffffffffffffffffffffffffffffffffffff16600090815260066020526040812080546bffffffffffffffffffffffff851692906200207990849062003806565b9091555050600284015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff85169290620020c790849062003806565b9091555050835482908590600090620020f09084906bffffffffffffffffffffffff16620038fc565b92506101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506200215d84600001600c9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682846bffffffffffffffffffffffff16620026d4565b8354604080516c01000000000000000000000000830473ffffffffffffffffffffffffffffffffffffffff1681526bffffffffffffffffffffffff80861660208301529092169082015283907feb6032fe8d7a2f7003e5b33948bdc807f994be970351cd021a033784812c8baa9060600160405180910390a250505050565b620021e78162002562565b60045460405173ffffffffffffffffffffffffffffffffffffffff8084169216907fbf265e8326285a2747e33e54d5945f7111f2b5edb826eb8c08d4677779b3ff9790600090a3600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6060620014b47f556e695374616b657200000000000000000000000000000000000000000000096000620029bd565b6060620014b47f31000000000000000000000000000000000000000000000000000000000000016001620029bd565b620022de8162002562565b620022e8620028c2565b60028301546200230e9073ffffffffffffffffffffffffffffffffffffffff16620028de565b8254600284015473ffffffffffffffffffffffffffffffffffffffff16600090815260076020526040812080546bffffffffffffffffffffffff909316929091906200235c908490620037f0565b909155506200236d905081620028de565b600283015460405173ffffffffffffffffffffffffffffffffffffffff80841692169084907fe1fcac5fc7d2f61f04d109cb8169e6163bdf912d84879a78652bb7b93573cc7c90600090a46002830180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091558354600091825260076020526040822080546bffffffffffffffffffffffff9092169290916200242f90849062003806565b9091555050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600e6020526040812054620024696200145a565b620024759190620037f0565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260076020526040902054620024a791906200379a565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205462001332919062003806565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405162002505919062003924565b600060405180830381855af49150503d806000811462002542576040519150601f19603f3d011682016040523d82523d6000602084013e62002547565b606091505b50915091506200255985838362002a75565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff811662000fcf576040517fc05887de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600960205260409020541680620026cf577f0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984826040516200260e906200302f565b73ffffffffffffffffffffffffffffffffffffffff928316815291166020820152604001604051809103906000f0801580156200264f573d6000803e3d6000fd5b5073ffffffffffffffffffffffffffffffffffffffff83811660008181526009602052604080822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016948616948517905551939450919290917f53ff145c5d53f9465a0d97719aeab68428f349b2cf0b009e9dd75b94b315d7be91a35b919050565b620009887f0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98484848462002b0c565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000e3071e87a7e6dd19a911dbf1127ba9dd67aa6fc8161480156200276957507f000000000000000000000000000000000000000000000000000000000000000146145b156200279457507f9b0ae2b51170961a4d7e84ed990e39a51cedb1ace97494899b41a972550ded3190565b620014b4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f833291eb12edb53f48380faca042a9af540fd535b297b7ba9409afdecc9fbba9918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060006200284e858562002b54565b50909250905060008160038111156200286b576200286b62003942565b148015620028a457508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80620028b85750620028b886868662002ba5565b9695505050505050565b620028cc6200145a565b600d55620028d96200155a565b600b55565b620028e98162002439565b73ffffffffffffffffffffffffffffffffffffffff9091166000908152600f6020908152604080832093909355600d54600e90915291902055565b60405173ffffffffffffffffffffffffffffffffffffffff8381166024830152604482018390526200098891859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505062002cfc565b600354620029b781600162003806565b60035590565b606060ff8314620029db57620029d38362002d99565b905062001332565b818054620029e99062003971565b80601f016020809104026020016040519081016040528092919081815260200182805462002a179062003971565b801562002a685780601f1062002a3c5761010080835404028352916020019162002a68565b820191906000526020600020905b81548152906001019060200180831162002a4a57829003601f168201915b5050505050905062001332565b60608262002a8e5762002a888262002dda565b62000a6c565b815115801562002ab3575073ffffffffffffffffffffffffffffffffffffffff84163b155b1562002b04576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240162000d58565b508062000a6c565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052620018ef9186918216906323b872dd906084016200295f565b6000806000835160410362002b925760208401516040850151606086015160001a62002b838882858562002e1d565b95509550955050505062002b9e565b50508151600091506002905b9250925092565b60008060008573ffffffffffffffffffffffffffffffffffffffff16858560405160240162002bd6929190620039c6565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f1626ba7e000000000000000000000000000000000000000000000000000000001790525162002c59919062003924565b600060405180830381855afa9150503d806000811462002c96576040519150601f19603f3d011682016040523d82523d6000602084013e62002c9b565b606091505b509150915081801562002cb057506020815110155b8015620028b8575080517f1626ba7e000000000000000000000000000000000000000000000000000000009062002cf190830160209081019084016200381c565b149695505050505050565b600062002d2073ffffffffffffffffffffffffffffffffffffffff84168362002f1c565b9050805160001415801562002d4857508080602001905181019062002d469190620039e1565b155b1562000988576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8416600482015260240162000d58565b6060600062002da88362002f2c565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b80511562002deb5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111562002e5a575060009150600390508262002f12565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801562002eaf573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811662002f085750600092506001915082905062002f12565b9250600091508190505b9450945094915050565b606062000a6c8383600062002f6e565b600060ff8216601f81111562001332576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608147101562002fae576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240162000d58565b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405162002fd9919062003924565b60006040518083038185875af1925050503d806000811462003018576040519150601f19603f3d011682016040523d82523d6000602084013e6200301d565b606091505b5091509150620028b886838362002a75565b6101cc8062003a0283390190565b803573ffffffffffffffffffffffffffffffffffffffff81168114620026cf57600080fd5b600080604083850312156200307657600080fd5b8235915062003088602084016200303d565b90509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112620030d257600080fd5b813567ffffffffffffffff80821115620030f057620030f062003091565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171562003139576200313962003091565b816040528381528660208588010111156200315357600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156200318957600080fd5b62003194846200303d565b925060208401359150604084013567ffffffffffffffff811115620031b857600080fd5b620031c686828701620030c0565b9150509250925092565b80356bffffffffffffffffffffffff81168114620026cf57600080fd5b600080600080600060a086880312156200320657600080fd5b853594506200321860208701620031d0565b935062003228604087016200303d565b925060608601359150608086013567ffffffffffffffff8111156200324c57600080fd5b6200325a88828901620030c0565b9150509295509295909350565b803560ff81168114620026cf57600080fd5b600080600080600080600060e0888a0312156200329557600080fd5b620032a088620031d0565b9650620032b0602089016200303d565b9550620032c0604089016200303d565b945060608801359350620032d76080890162003267565b925060a0880135915060c0880135905092959891949750929550565b801515811462000fcf57600080fd5b600080604083850312156200331657600080fd5b62003321836200303d565b915060208301356200333381620032f3565b809150509250929050565b6000602082840312156200335157600080fd5b62000a6c826200303d565b6000602082840312156200336f57600080fd5b5035919050565b600080600080600060a086880312156200338f57600080fd5b8535945062003218602087016200303d565b60008060408385031215620033b557600080fd5b823591506200308860208401620031d0565b60005b83811015620033e4578181015183820152602001620033ca565b50506000910152565b6000815180845262003407816020860160208601620033c7565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b7fff00000000000000000000000000000000000000000000000000000000000000881681526000602060e060208401526200347860e084018a620033ed565b83810360408501526200348c818a620033ed565b6060850189905273ffffffffffffffffffffffffffffffffffffffff8816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b81811015620034ef57835183529284019291840191600101620034d1565b50909c9b505050505050505050505050565b6000806000606084860312156200351757600080fd5b6200352284620031d0565b925062003532602085016200303d565b915062003542604085016200303d565b90509250925092565b600080604083850312156200355f57600080fd5b6200356a83620031d0565b915062003088602084016200303d565b60008060008060008060c087890312156200359457600080fd5b86359550620035a660208801620031d0565b945060408701359350620035bd6060880162003267565b92506080870135915060a087013590509295509295509295565b60008060208385031215620035eb57600080fd5b823567ffffffffffffffff808211156200360457600080fd5b818501915085601f8301126200361957600080fd5b8135818111156200362957600080fd5b8660208260051b85010111156200363f57600080fd5b60209290920196919550909350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015620036ca577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452620036b7858351620033ed565b945092850192908501906001016200367a565b5092979650505050505050565b60008060008060008060c08789031215620036f157600080fd5b620036fc87620031d0565b95506200370c602088016200303d565b94506200371c604088016200303d565b93506200372c606088016200303d565b92506080870135915060a087013567ffffffffffffffff8111156200375057600080fd5b6200375e89828a01620030c0565b9150509295509295509295565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176200133257620013326200376b565b600082620037eb577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156200133257620013326200376b565b808201808211156200133257620013326200376b565b6000602082840312156200382f57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126200389b57600080fd5b83018035915067ffffffffffffffff821115620038b757600080fd5b602001915036819003821315620038cd57600080fd5b9250929050565b6bffffffffffffffffffffffff8281168282160390808211156200145357620014536200376b565b6bffffffffffffffffffffffff8181168382160190808211156200145357620014536200376b565b6000825162003938818460208701620033c7565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600181811c908216806200398657607f821691505b602082108103620039c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b82815260406020820152600062000a696040830184620033ed565b600060208284031215620039f457600080fd5b815162000a6c81620032f356fe608060405234801561001057600080fd5b506040516101cc3803806101cc83398101604081905261002f9161011c565b6040516317066a5760e21b81526001600160a01b038281166004830152831690635c19a95c90602401600060405180830381600087803b15801561007257600080fd5b505af1158015610086573d6000803e3d6000fd5b505060405163095ea7b360e01b815233600482015260001960248201526001600160a01b038516925063095ea7b391506044016020604051808303816000875af11580156100d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fc9190610156565b50505061017f565b6001600160a01b038116811461011957600080fd5b50565b6000806040838503121561012f57600080fd5b825161013a81610104565b602084015190925061014b81610104565b809150509250929050565b60006020828403121561016857600080fd5b8151801515811461017857600080fd5b9392505050565b603f8061018d6000396000f3fe6080604052600080fdfea2646970667358221220defe974d338236b7160b55d8085409609e608cac3ae33625fa36e65bc712a3f364736f6c63430008170033a2646970667358221220881acdf2b86321ce5553f215df4ff4b0142142c1d27dc4e4686ac1dfc4d2076264736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f98400000000000000000000000071218d9e40cac8f7c76a9aba2de7e6aae4e9c736
-----Decoded View---------------
Arg [0] : _rewardToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [1] : _stakeToken (address): 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984
Arg [2] : _admin (address): 0x71218d9e40CaC8F7C76A9ABA2De7e6aAE4E9c736
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] : 0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984
Arg [2] : 00000000000000000000000071218d9e40cac8f7c76a9aba2de7e6aae4e9c736
Deployed Bytecode Sourcemap
2028:39420:18:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21467:251;;;;;;:::i;:::-;;:::i;:::-;;27646:451;;;;;;:::i;:::-;;:::i;:::-;;;2096:25:21;;;2084:2;2069:18;27646:451:18;;;;;;;;26284:633;;;;;;:::i;:::-;;:::i;6873:44::-;;;;;;;;3163:42:21;3151:55;;;3133:74;;3121:2;3106:18;6873:44:18;2963:250:21;15900:390:18;;;;;;:::i;:::-;;:::i;10979:217::-;;;;;;:::i;:::-;;:::i;7824:66::-;;;;;;:::i;:::-;;;;;;;;;;;;;;6044:181;;6097:128;6044:181;;6547:128;;6599:76;6547:128;;8394:28;;;;;;5779:175;;5830:124;5779:175;;29242:1513;;;;;;:::i;:::-;;:::i;31616:68::-;;31668:10;819:7:7;1121:14;;;:7;:14;;;;;:16;;;;;;31616:68:18;7020:49;;7062:7;7020:49;;22356:731;;;;;;:::i;:::-;;:::i;8504:33::-;;;;;;18246:228;;;;;;:::i;:::-;;:::i;10619:102::-;;;;;;:::i;:::-;;:::i;6307:155::-;;6351:111;6307:155;;5533:158;;5579:112;5533:158;;538:107:7;;;;;;:::i;:::-;624:14;;598:7;624:14;;;:7;:14;;;;;;;538:107;7540:26:18;;;;;;5144:557:12;;;:::i;:::-;;;;;;;;;;;;;:::i;24384:743:18:-;;;;;;:::i;:::-;;:::i;5281:169::-;;5322:128;5281:169;;14748:208;;;;;;:::i;:::-;;:::i;13968:184::-;;;;;;:::i;:::-;;:::i;6756:36::-;;;;;19355:417;;;;;;:::i;:::-;;:::i;13270:148::-;;;;;;:::i;:::-;;:::i;9789:81::-;;;;;;:::i;:::-;;;;;;;;;;;;;;25468:226;;;;;;:::i;:::-;;:::i;456:308:6:-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;12116:285:18:-;;;:::i;7962:71::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11484:26:21;11472:39;;;11454:58;;11531:42;11609:15;;;11604:2;11589:18;;11582:43;11661:15;;;11641:18;;;11634:43;;;;11713:15;11708:2;11693:18;;11686:43;11441:3;11426:19;7962:71:18;11225:510:21;20436:637:18;;;;;;:::i;:::-;;:::i;27101:92::-;;;:::i;7652:72::-;;;;;;:::i;:::-;;;;;;;;;;;;;;8707:31;;;;;;8818:50;;;;;;7203:43;;7242:4;7203:43;;11589:169;;;:::i;17130:691::-;;;;;;:::i;:::-;;:::i;23484:259::-;;;;;;:::i;:::-;;:::i;8220:77::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;9965:63;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;12854:14:21;;12847:22;12829:41;;12817:2;12802:18;9965:63:18;12689:187:21;9226:78:18;;;;;;:::i;:::-;;;;;;;;;;;;;;7449:20;;;;;;;;;21467:251;21559:23;21585:20;;;:8;:20;;;;;21611:45;21585:20;21645:10;21611:24;:45::i;:::-;21662:51;21678:7;21687:10;21699:13;21662:15;:51::i;:::-;21553:165;21467:251;;:::o;27646:451::-;27767:7;27784:32;27806:9;27784:21;:32::i;:::-;27822:231;27861:12;27881:148;6599:76;27962:12;27976:23;27986:12;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;27976:23:18;28001:9;27928:83;;;;;;;;;;13343:25:21;;;13416:42;13404:55;;;;13399:2;13384:18;;13377:83;13491:2;13476:18;;13469:34;13534:2;13519:18;;13512:34;13330:3;13315:19;;13112:440;27928:83:18;;;;;;;;;;;;;27907:114;;;;;;27881:16;:148::i;:::-;28037:10;27822:31;:231::i;:::-;28066:26;28079:12;28066;:26::i;:::-;28059:33;;27646:451;;;;;;:::o;26284:633::-;26459:23;26485:20;;;:8;:20;;;;;26511:45;26485:20;26545:10;26511:24;:45::i;:::-;26562:32;26584:9;26562:21;:32::i;:::-;26600:266;26639:10;26657:185;6351:111;26747:10;26759:7;26768:10;26780:21;26790:10;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;26780:21:18;26704:120;;;;;;13880:25:21;;;;13921:18;;13914:34;;;;13996:26;13984:39;;;13964:18;;;13957:67;14072:42;14060:55;14040:18;;;14033:83;14132:19;;;14125:35;14176:19;;;14169:35;;;13852:19;;26704:120:18;13557:653:21;26600:266:18;26873:39;26883:7;26892:10;26904:7;26873:9;:39::i;:::-;26453:464;26284:633;;;;;:::o;15900:390::-;16125:77;;;;;16144:10;16125:77;;;14586:34:21;16164:4:18;14636:18:21;;;14629:43;14720:26;14708:39;;14688:18;;;14681:67;14764:18;;;14757:34;;;14840:4;14828:17;;14807:19;;;14800:46;14862:19;;;14855:35;;;14906:19;;;14899:35;;;16085:28:18;;16125:11;:18;;;;;14497:19:21;;16125:77:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16121:93;16232:53;16239:10;16251:7;16260:10;16272:12;16232:6;:53::i;:::-;16219:66;15900:390;-1:-1:-1;;;;;;;;15900:390:18:o;10979:217::-;11063:19;:17;:19::i;:::-;11088:33;;;;;;;:16;:33;;;;;;;;;:46;;;;;;;;;;;;;11145;;12829:41:21;;;11145:46:18;;12802:18:21;11145:46:18;;;;;;;10979:217;;:::o;29242:1513::-;29324:10;29307:28;;;;:16;:28;;;;;;;;29302:93;;29344:51;;;;;15200:14:21;29344:51:18;;;15182:33:21;29384:10:18;15231:18:21;;;15224:83;15155:18;;29344:51:18;;;;;;;;29302:93;29615:27;:25;:27::i;:::-;29577:35;:65;29672:13;;29653:15;:32;29649:302;;7062:7;29715:22;7242:4;29715:7;:22;:::i;:::-;29714:42;;;;:::i;:::-;29695:16;:61;29649:302;;;29777:24;29840:15;29824:13;;:31;;;;:::i;:::-;29804:16;;:52;;;;:::i;:::-;29777:79;-1:-1:-1;7062:7:18;29903:22;7242:4;29903:7;:22;:::i;:::-;29884:41;;:16;:41;:::i;:::-;29883:61;;;;:::i;:::-;29864:16;:80;-1:-1:-1;29649:302:18;29973:33;7062:7;29973:15;:33;:::i;:::-;29957:13;:49;30033:15;30012:18;:36;30060:16;;:31;;7242:4;;30060:31;:::i;:::-;30096:1;30059:38;30055:81;;30106:30;;;;;;;;;;;;;;30055:81;30598:37;;;;;30629:4;30598:37;;;3133:74:21;7242:4:18;;30598:12;:22;;;;;3106:18:21;;30598:37:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:52;;;;:::i;:::-;7062:7;30559:16;;:34;;;;:::i;:::-;30558:93;30547:156;;;30665:38;;;;;;;;;;;;;;30547:156;30715:35;;;16585:25:21;;;30739:10:18;16641:2:21;16626:18;;16619:83;30715:35:18;;16558:18:21;30715:35:18;;;;;;;29242:1513;:::o;31658:21::-;;31616:68::o;22356:731::-;22544:23;22570:20;;;:8;:20;;;;;22596:45;22570:20;22630:10;22596:24;:45::i;:::-;22647:32;22669:9;22647:21;:32::i;:::-;22685:339;22724:10;22742:258;5830:124;22851:10;22875:13;22902:10;22926:21;22936:10;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;22926:21:18;22789:193;;;;;;17038:25:21;;;;17079:18;;17072:34;;;;17125:42;17203:15;;;17183:18;;;17176:43;17255:15;17235:18;;;17228:43;17287:19;;;17280:35;17331:19;;;17324:35;;;17010:19;;22789:193:18;16713:652:21;22685:339:18;23031:51;23047:7;23056:10;23068:13;23031:15;:51::i;18246:228::-;18326:23;18352:20;;;:8;:20;;;;;18378:45;18352:20;18412:10;18378:24;:45::i;:::-;18429:40;18440:7;18449:10;18461:7;18429:10;:40::i;10619:102::-;10671:19;:17;:19::i;:::-;10696:20;10706:9;10696;:20::i;5144:557:12:-;5242:13;5269:18;5301:21;5336:15;5365:25;5404:12;5430:27;5533:13;:11;:13::i;:::-;5560:16;:14;:16::i;:::-;5668;;;5652:1;5668:16;;;;;;;;;5482:212;;;;-1:-1:-1;5482:212:12;;-1:-1:-1;5590:13:12;;-1:-1:-1;5625:4:12;;-1:-1:-1;5652:1:12;-1:-1:-1;5668:16:12;-1:-1:-1;5482:212:12;-1:-1:-1;5144:557:12:o;24384:743:18:-;24576:23;24602:20;;;:8;:20;;;;;24628:45;24602:20;24662:10;24628:24;:45::i;:::-;24679:32;24701:9;24679:21;:32::i;:::-;24717:343;24756:10;24774:262;6097:128;24885:10;24909:15;24938:10;24962:21;24972:10;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;24717:343:18;25067:55;25085:7;25094:10;25106:15;25067:17;:55::i;14748:208::-;14847:28;14898:53;14905:10;14917:7;14926:10;14938:12;14898:6;:53::i;13968:184::-;14045:28;14096:51;14103:10;14115:7;14124:10;14136;14096:6;:51::i;19355:417::-;19525:23;19551:20;;;:8;:20;;;;;19577:45;19551:20;19611:10;19577:24;:45::i;:::-;19633:77;;;;;19652:10;19633:77;;;14586:34:21;19672:4:18;14636:18:21;;;14629:43;14720:26;14708:39;;14688:18;;;14681:67;14764:18;;;14757:34;;;14840:4;14828:17;;14807:19;;;14800:46;14862:19;;;14855:35;;;14906:19;;;14899:35;;;19633:11:18;:18;;;;;14497:19:21;;19633:77:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19629:93;19727:40;19738:7;19747:10;19759:7;19727:10;:40::i;:::-;19519:253;19355:417;;;;;;:::o;13270:148::-;13340:7;7242:4;13362:36;13385:12;13362:22;:36::i;:::-;:51;;;;:::i;:::-;13355:58;13270:148;-1:-1:-1;;13270:148:18:o;25468:226::-;25547:23;25573:20;;;:8;:20;;;;;25599:45;25573:20;25633:10;25599:24;:45::i;:::-;25650:39;25660:7;25669:10;25681:7;25650:9;:39::i;456:308:6:-;524:22;580:4;568:24;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;558:34;;607:9;602:132;622:15;;;602:132;;;671:52;708:4;715;;720:1;715:7;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;671:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;671:28:6;;-1:-1:-1;;;671:52:6:i;:::-;658:7;666:1;658:10;;;;;;;;:::i;:::-;;;;;;;;;;:65;639:3;;602:132;;;;456:308;;;;:::o;12116:285:18:-;12174:7;12193:11;;12208:1;12193:16;12189:64;;-1:-1:-1;12218:35:18;;;12116:285::o;12189:64::-;12385:11;;12362:18;;12332:27;:25;:27::i;:::-;:48;;;;:::i;:::-;12312:16;;:69;;;;:::i;:::-;12311:85;;;;:::i;:::-;12267:35;;:129;;;;:::i;:::-;12260:136;;12116:285;:::o;20436:637::-;20612:23;20638:20;;;:8;:20;;;;;20664:45;20638:20;20698:10;20664:24;:45::i;:::-;20715:32;20737:9;20715:21;:32::i;:::-;20753:268;20792:10;20810:187;5579:112;20902:10;20914:7;20923:10;20935:21;20945:10;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;20753:268:18;21028:40;21039:7;21048:10;21060:7;21028:10;:40::i;27101:92::-;27142:7;27164:24;27177:10;27164:12;:24::i;11589:169::-;11647:7;11683:15;11666:13;;:32;11662:91;;-1:-1:-1;11707:13:18;;;11589:169::o;11662:91::-;-1:-1:-1;11738:15:18;;11589:169::o;17130:691::-;17321:28;17357:32;17379:9;17357:21;:32::i;:::-;17395:349;17434:10;17452:268;5322:128;17551:7;17572:10;17596:12;17622:10;17646:21;17656:10;1121:14:7;;819:7;1121:14;;;:7;:14;;;;;:16;;;;;;;;;759:395;17646:21:18;17499:203;;;;;;18457:25:21;;;;18530:26;18518:39;;;18498:18;;;18491:67;;;;18577:42;18655:15;;;18635:18;;;18628:43;18707:15;;;18687:18;;;18680:43;18760:15;18739:19;;;18732:44;18792:19;;;18785:35;18836:19;;;18829:35;;;18429:19;;17499:203:18;18144:726:21;17395:349:18;17763:53;17770:10;17782:7;17791:10;17803:12;17763:6;:53::i;:::-;17750:66;17130:691;-1:-1:-1;;;;;;;17130:691:18:o;23484:259::-;23580:23;23606:20;;;:8;:20;;;;;23632:45;23606:20;23666:10;23632:24;:45::i;:::-;23683:55;23701:7;23710:10;23722:15;23683:17;:55::i;40286:177::-;40393:13;;;40384:22;;;40393:13;;;;;40384:22;40380:78;;40415:43;;;;;19130:11:21;40415:43:18;;;19112:30:21;19190:42;19178:55;;19158:18;;;19151:83;19085:18;;40415:43:18;18875:365:21;40380:78:18;40286:177;;:::o;35584:535::-;35718:35;35739:13;35718:20;:35::i;:::-;35806:17;;;;;;;;35759:33;35795:29;;;:10;:29;;;;;;;;;;35835:62;;19480:34:21;;;19550:15;;;19530:18;;;19523:43;;;;35795:29:18;;;;35852:10;;35835:62;;19392:18:21;35835:62:18;;;;;;;35903:17;;;:33;;;;;;;;;;-1:-1:-1;35978:38:18;35903:33;35978:23;:38::i;:::-;36098:15;;35942:74;;-1:-1:-1;36022:92:18;;36058:13;;35942:74;;36098:15;;36022:27;:92::i;:::-;35712:407;;35584:535;;;:::o;40779:143::-;40871:9;40853:15;:27;40849:68;;;40889:28;;;;;;;;;;;;;;4917:176:12;4994:7;5020:66;5053:20;:18;:20::i;:::-;5075:10;3555:4:13;3549:11;3585:10;3573:23;;3625:4;3616:14;;3609:39;;;;3677:4;3668:14;;3661:34;3733:4;3718:20;;;3353:401;41176:270:18;41304:13;41320:64;41357:7;41366:5;41373:10;41320:36;:64::i;:::-;41304:80;;41395:8;41390:51;;41412:29;;;;;;;;;;;;;;41390:51;41298:148;41176:270;;;:::o;38015:599::-;38077:7;38092:25;:23;:25::i;:::-;38123:31;38141:12;38123:17;:31::i;:::-;38179:45;;;38161:15;38179:45;;;:31;:45;;;;;;:60;;7242:4;;38179:60;:::i;:::-;38161:78;;38249:7;38260:1;38249:12;38245:26;;-1:-1:-1;38270:1:18;;38015:599;-1:-1:-1;;38015:599:18:o;38245:26::-;38453:22;7242:4;38453:7;:22;:::i;:::-;38404:45;;;;;;;:31;:45;;;;;;:72;;;;:::i;:::-;38350:45;;;;;;;:31;:45;;;;;;;:126;;;;38487:36;;;;;;38515:7;2096:25:21;;2084:2;2069:18;;1950:177;38487:36:18;;;;;;;;38530:59;38553:12;38567;38581:7;38530:22;:59::i;37172:559::-;37283:25;:23;:25::i;:::-;37332:19;;;;37314:38;;37332:19;;37314:17;:38::i;:::-;37359:26;;37378:7;;37359;;:15;;:26;;37378:7;;37359:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;37457:7;37442:22;;:11;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;37491:13:18;;;;;;;37470:35;;;;:20;:35;;;;;:46;;;;;;:35;:46;;;;;:::i;:::-;;;;-1:-1:-1;;37535:19:18;;;;;;37522:33;;;;:12;:33;;;;;:44;;;;;;:33;:44;;;;;:::i;:::-;;;;-1:-1:-1;;37619:17:18;;;;;;;;37608:29;;;;:10;:29;;;;;;37640:13;;37572:91;;37608:29;;;;37640:13;;;;;37572:91;;;:27;:91::i;:::-;37710:15;;37674:52;;;37710:15;20008::21;;;19990:34;;37710:15:18;;;20055:2:21;20040:18;;20033:43;37689:10:18;;37674:52;;19918:18:21;37674:52:18;;;;;;;37172:559;;;:::o;33535:961::-;33655:28;33693:32;33714:10;33693:20;:32::i;:::-;33731:34;33752:12;33731:20;:34::i;:::-;33772:25;:23;:25::i;:::-;33803:31;33821:12;33803:17;:31::i;:::-;33841:30;33874:35;33898:10;33874:23;:35::i;:::-;33841:68;;33928:15;:13;:15::i;:::-;33915:28;;33965:7;33950:22;;:11;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;33978:32:18;;;;;;;:20;:32;;;;;:43;;;;;;:32;:43;;;;;:::i;:::-;;;;-1:-1:-1;;34027:26:18;;;;;;;:12;:26;;;;;:37;;;;;;:26;:37;;;;;:::i;:::-;;;;-1:-1:-1;;34093:126:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;34070:20:18;;;:8;:20;;;;;;;:149;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;34225:69;;34140:10;;34273;;34225:27;:69::i;:::-;34305:56;;;20317:42:21;20305:55;;20287:74;;20380:26;20442:15;;20437:2;20422:18;;20415:43;;;20474:18;;;20467:43;34305:56:18;;34332:10;;34305:56;;;;;;20275:2:21;34305:56:18;;;34372;;;;;;34411:1;;34391:10;;34372:56;;34411:1;;34372:56;34439:52;;;34476:1;19480:34:21;;19429:42;19550:15;;19545:2;19530:18;;19523:43;34456:10:18;;34439:52;;19392:18:21;34439:52:18;;;;;;;33687:809;33535:961;;;;;;:::o;39921:134::-;39988:5;;;;39974:10;:19;39970:80;;40002:48;;;;;20776:11:21;40002:48:18;;;20758:30:21;40039:10:18;20804:18:21;;;20797:83;20731:18;;40002:48:18;20521:365:21;39970:80:18;39921:134::o;34748:574::-;34860:25;:23;:25::i;:::-;34909:19;;;;34891:38;;34909:19;;34891:17;:38::i;:::-;34980:17;;;;;;;;34936:30;34969:29;;;:10;:29;;;;;;35005:11;:22;;34969:29;;;;;35005:22;;;;:11;;:22;;;;;:::i;:::-;;;;-1:-1:-1;;35054:13:18;;;;;;;35033:35;;;;:20;:35;;;;;:46;;;;;;:35;:46;;;;;:::i;:::-;;;;-1:-1:-1;;35098:19:18;;;;;;35085:33;;;;:12;:33;;;;;:44;;;;;;:33;:44;;;;;:::i;:::-;;;;-1:-1:-1;;35135:26:18;;35154:7;;35135;;:15;;:26;;35154:7;;35135:26;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;35167:72;35195:7;:13;;;;;;;;;;;;35218:10;35231:7;35167:72;;:27;:72::i;:::-;35265:13;;35250:67;;;35265:13;;;;;20287:74:21;;35301:15:18;20442::21;;;20437:2;20422:18;;20415:43;35301:15:18;;;20474:18:21;;;20467:43;35280:10:18;;35250:67;;20275:2:21;20260:18;35250:67:18;;;;;;;34854:468;34748:574;;;:::o;39647:149::-;39700:31;39721:9;39700:20;:31::i;:::-;39751:5;;39742:26;;;;;;;39751:5;;39742:26;;39751:5;;39742:26;39774:5;:17;;;;;;;;;;;;;;;39647:149::o;6021:126:12:-;6067:13;6099:41;:5;6126:13;6099:26;:41::i;6473:135::-;6522:13;6554:47;:8;6584:16;6554:29;:47::i;36385:530:18:-;36523:37;36544:15;36523:20;:37::i;:::-;36566:25;:23;:25::i;:::-;36615:19;;;;36597:38;;36615:19;;36597:17;:38::i;:::-;36678:15;;36654:19;;;;;;36678:15;36641:33;;;:12;:33;;;;;:52;;36678:15;;;;;36641:33;;36678:15;36641:52;;36678:15;;36641:52;:::i;:::-;;;;-1:-1:-1;36700:34:18;;-1:-1:-1;36718:15:18;36700:17;:34::i;:::-;36776:19;;;;36745:68;;;;;;;36776:19;;36764:10;;36745:68;;36776:19;;36745:68;36819:19;;;:37;;;;;;;;;;;;;36895:15;;-1:-1:-1;36862:29:18;;;:12;:29;;;;;:48;;36895:15;;;;;36862:29;;:48;;36895:15;;36862:48;:::i;:::-;;;;-1:-1:-1;;;;;36385:530:18:o;31200:296::-;31433:49;;;31277:7;31433:49;;;:35;:49;;;;;;31403:27;:25;:27::i;:::-;:79;;;;:::i;:::-;31363:26;;;;;;;:12;:26;;;;;;:120;;;;:::i;:::-;31299:45;;;;;;;:31;:45;;;;;;:192;;;;:::i;4106:253:5:-;4189:12;4214;4228:23;4255:6;:19;;4275:4;4255:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4213:67;;;;4297:55;4324:6;4332:7;4341:10;4297:26;:55::i;:::-;4290:62;4106:253;-1:-1:-1;;;;;4106:253:5:o;40640:135:18:-;40712:22;;;40708:62;;40743:27;;;;;;;;;;;;;;31978:386;32110:22;;;;32057:30;32110:22;;;:10;:22;;;;;;;;32139:221;;32223:11;32236:10;32199:48;;;;;:::i;:::-;19429:42:21;19498:15;;;19480:34;;19550:15;;19545:2;19530:18;;19523:43;19407:2;19392:18;32199:48:18;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;32255:22:18;;;;;;;;:10;:22;;;;;;:35;;;;;;;;;;;;32303:50;32255:35;;-1:-1:-1;32255:35:18;;:22;;32303:50;;;32139:221;31978:386;;;:::o;32741:177::-;32837:76;32879:11;32894:5;32901:3;32906:6;32837:26;:76::i;3845:262:12:-;3898:7;3929:4;3921:28;3938:11;3921:28;;:63;;;;;3970:14;3953:13;:31;3921:63;3917:184;;;-1:-1:-1;4007:22:12;;3845:262::o;3917:184::-;4067:23;4204:80;;;2079:95;4204:80;;;23327:25:21;4226:11:12;23368:18:21;;;23361:34;;;;4239:14:12;23411:18:21;;;23404:34;4255:13:12;23454:18:21;;;23447:34;4278:4:12;23497:19:21;;;23490:84;4168:7:12;;23299:19:21;;4204:80:12;;;;;;;;;;;;4194:91;;;;;;4187:98;;4113:179;;1039:368:14;1145:4;1162:17;1181:24;1211:33;1228:4;1234:9;1211:16;:33::i;:::-;-1:-1:-1;1161:83:14;;-1:-1:-1;1161:83:14;-1:-1:-1;1283:26:14;1274:5;:35;;;;;;;;:::i;:::-;;:58;;;;;1326:6;1313:19;;:9;:19;;;1274:58;1273:127;;;;1349:51;1376:6;1384:4;1390:9;1349:26;:51::i;:::-;1254:146;1039:368;-1:-1:-1;;;;;;1039:368:14:o;38685:174:18:-;38773:27;:25;:27::i;:::-;38735:35;:65;38827:27;:25;:27::i;:::-;38806:18;:48;38685:174::o;39281:246::-;39393:36;39416:12;39393:22;:36::i;:::-;39345:45;;;;;;;;:31;:45;;;;;;;;:84;;;;39487:35;;39435;:49;;;;;;:87;39281:246::o;1303:160:4:-;1412:43;;1427:14;22113:55:21;;;1412:43:4;;;22095:74:21;22185:18;;;22178:34;;;1385:71:4;;1405:5;;1427:14;;;;;22068:18:21;;1412:43:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1385:19;:71::i;33097:196:18:-;33189:13;;33247:40;33189:13;33286:1;33247:40;:::i;:::-;33208:13;:80;33097:196;:::o;3385:267:8:-;3479:13;1390:66;3508:46;;3504:142;;3577:15;3586:5;3577:8;:15::i;:::-;3570:22;;;;3504:142;3630:5;3623:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4625:582:5;4769:12;4798:7;4793:408;;4821:19;4829:10;4821:7;:19::i;:::-;4793:408;;;5045:17;;:22;:49;;;;-1:-1:-1;5071:18:5;;;;:23;5045:49;5041:119;;;5121:24;;;;;3163:42:21;3151:55;;5121:24:5;;;3133:74:21;3106:18;;5121:24:5;2963:250:21;5041:119:5;-1:-1:-1;5180:10:5;5173:17;;1702:188:4;1829:53;;1844:18;22946:15:21;;;1829:53:4;;;22928:34:21;22998:15;;;22978:18;;;22971:43;23030:18;;;23023:34;;;1802:81:4;;1822:5;;1844:18;;;;;22840::21;;1829:53:4;22665:398:21;2129:766:11;2210:7;2219:12;2233:7;2256:9;:16;2276:2;2256:22;2252:637;;2592:4;2577:20;;2571:27;2641:4;2626:20;;2620:27;2698:4;2683:20;;2677:27;2294:9;2669:36;2739:25;2750:4;2669:36;2571:27;2620;2739:10;:25::i;:::-;2732:32;;;;;;;;;;;2252:637;-1:-1:-1;;2860:16:11;;2811:1;;-1:-1:-1;2815:35:11;;2252:637;2129:766;;;;;:::o;1813:458:14:-;1956:4;1973:12;1987:19;2010:6;:17;;2084:4;2090:9;2041:60;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;2010:101;;;2041:60;2010:101;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1972:139;;;;2129:7;:42;;;;;2169:2;2152:6;:13;:19;;2129:42;:134;;;;-1:-1:-1;2187:29:14;;2228:34;;2187:29;;;;;;;;;;;;:::i;:::-;:76;;1813:458;-1:-1:-1;;;;;;1813:458:14:o;4059:629:4:-;4478:23;4504:33;:27;;;4532:4;4504:27;:33::i;:::-;4478:59;;4551:10;:17;4572:1;4551:22;;:57;;;;;4589:10;4578:30;;;;;;;;;;;;:::i;:::-;4577:31;4551:57;4547:135;;;4631:40;;;;;3163:42:21;3151:55;;4631:40:4;;;3133:74:21;3106:18;;4631:40:4;2963:250:21;2078:405:8;2137:13;2162:11;2176:16;2187:4;2176:10;:16::i;:::-;2300:14;;;2311:2;2300:14;;;;;;;;;2162:30;;-1:-1:-1;2280:17:8;;2300:14;;;;;;;;;-1:-1:-1;;;2390:16:8;;;-1:-1:-1;2435:4:8;2426:14;;2419:28;;;;-1:-1:-1;2390:16:8;2078:405::o;5743:516:5:-;5874:17;;:21;5870:383;;6102:10;6096:17;6158:15;6145:10;6141:2;6137:19;6130:44;5870:383;6225:17;;;;;;;;;;;;;;5140:1530:11;5266:7;;;6199:66;6186:79;;6182:164;;;-1:-1:-1;6297:1:11;;-1:-1:-1;6301:30:11;;-1:-1:-1;6333:1:11;6281:54;;6182:164;6457:24;;;6440:14;6457:24;;;;;;;;;24545:25:21;;;24618:4;24606:17;;24586:18;;;24579:45;;;;24640:18;;;24633:34;;;24683:18;;;24676:34;;;6457:24:11;;24517:19:21;;6457:24:11;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6457:24:11;;;;;;-1:-1:-1;;6495:20:11;;;6491:113;;-1:-1:-1;6547:1:11;;-1:-1:-1;6551:29:11;;-1:-1:-1;6547:1:11;;-1:-1:-1;6531:62:11;;6491:113;6622:6;-1:-1:-1;6630:20:11;;-1:-1:-1;6630:20:11;;-1:-1:-1;5140:1530:11;;;;;;;;;:::o;2705:151:5:-;2780:12;2811:38;2833:6;2841:4;2847:1;2811:21;:38::i;2555:245:8:-;2616:7;2688:4;2652:40;;2715:2;2706:11;;2702:69;;;2740:20;;;;;;;;;;;;;;3180:392:5;3279:12;3331:5;3307:21;:29;3303:108;;;3359:41;;;;;3394:4;3359:41;;;3133:74:21;3106:18;;3359:41:5;2963:250:21;3303:108:5;3421:12;3435:23;3462:6;:11;;3481:5;3488:4;3462:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3420:73;;;;3510:55;3537:6;3545:7;3554:10;3510:26;:55::i;-1:-1:-1:-;;;;;;;;:::o;14:196:21:-;82:20;;142:42;131:54;;121:65;;111:93;;200:1;197;190:12;215:292;321:6;329;382:2;370:9;361:7;357:23;353:32;350:52;;;398:1;395;388:12;350:52;434:9;421:23;411:33;;463:38;497:2;486:9;482:18;463:38;:::i;:::-;453:48;;215:292;;;;;:::o;512:184::-;564:77;561:1;554:88;661:4;658:1;651:15;685:4;682:1;675:15;701:777;743:5;796:3;789:4;781:6;777:17;773:27;763:55;;814:1;811;804:12;763:55;850:6;837:20;876:18;913:2;909;906:10;903:36;;;919:18;;:::i;:::-;1053:2;1047:9;1115:4;1107:13;;958:66;1103:22;;;1127:2;1099:31;1095:40;1083:53;;;1151:18;;;1171:22;;;1148:46;1145:72;;;1197:18;;:::i;:::-;1237:10;1233:2;1226:22;1272:2;1264:6;1257:18;1318:3;1311:4;1306:2;1298:6;1294:15;1290:26;1287:35;1284:55;;;1335:1;1332;1325:12;1284:55;1399:2;1392:4;1384:6;1380:17;1373:4;1365:6;1361:17;1348:54;1446:1;1439:4;1434:2;1426:6;1422:15;1418:26;1411:37;1466:6;1457:15;;;;;;701:777;;;;:::o;1483:462::-;1569:6;1577;1585;1638:2;1626:9;1617:7;1613:23;1609:32;1606:52;;;1654:1;1651;1644:12;1606:52;1677:29;1696:9;1677:29;:::i;:::-;1667:39;;1753:2;1742:9;1738:18;1725:32;1715:42;;1808:2;1797:9;1793:18;1780:32;1835:18;1827:6;1824:30;1821:50;;;1867:1;1864;1857:12;1821:50;1890:49;1931:7;1922:6;1911:9;1907:22;1890:49;:::i;:::-;1880:59;;;1483:462;;;;;:::o;2132:179::-;2199:20;;2259:26;2248:38;;2238:49;;2228:77;;2301:1;2298;2291:12;2316:642;2457:6;2465;2473;2481;2489;2542:3;2530:9;2521:7;2517:23;2513:33;2510:53;;;2559:1;2556;2549:12;2510:53;2595:9;2582:23;2572:33;;2624:37;2657:2;2646:9;2642:18;2624:37;:::i;:::-;2614:47;;2680:38;2714:2;2703:9;2699:18;2680:38;:::i;:::-;2670:48;;2765:2;2754:9;2750:18;2737:32;2727:42;;2820:3;2809:9;2805:19;2792:33;2848:18;2840:6;2837:30;2834:50;;;2880:1;2877;2870:12;2834:50;2903:49;2944:7;2935:6;2924:9;2920:22;2903:49;:::i;:::-;2893:59;;;2316:642;;;;;;;;:::o;3218:156::-;3284:20;;3344:4;3333:16;;3323:27;;3313:55;;3364:1;3361;3354:12;3379:610;3489:6;3497;3505;3513;3521;3529;3537;3590:3;3578:9;3569:7;3565:23;3561:33;3558:53;;;3607:1;3604;3597:12;3558:53;3630:28;3648:9;3630:28;:::i;:::-;3620:38;;3677;3711:2;3700:9;3696:18;3677:38;:::i;:::-;3667:48;;3734:38;3768:2;3757:9;3753:18;3734:38;:::i;:::-;3724:48;;3819:2;3808:9;3804:18;3791:32;3781:42;;3842:37;3874:3;3863:9;3859:19;3842:37;:::i;:::-;3832:47;;3926:3;3915:9;3911:19;3898:33;3888:43;;3978:3;3967:9;3963:19;3950:33;3940:43;;3379:610;;;;;;;;;;:::o;4214:118::-;4300:5;4293:13;4286:21;4279:5;4276:32;4266:60;;4322:1;4319;4312:12;4337:315;4402:6;4410;4463:2;4451:9;4442:7;4438:23;4434:32;4431:52;;;4479:1;4476;4469:12;4431:52;4502:29;4521:9;4502:29;:::i;:::-;4492:39;;4581:2;4570:9;4566:18;4553:32;4594:28;4616:5;4594:28;:::i;:::-;4641:5;4631:15;;;4337:315;;;;;:::o;4657:186::-;4716:6;4769:2;4757:9;4748:7;4744:23;4740:32;4737:52;;;4785:1;4782;4775:12;4737:52;4808:29;4827:9;4808:29;:::i;5030:180::-;5089:6;5142:2;5130:9;5121:7;5117:23;5113:32;5110:52;;;5158:1;5155;5148:12;5110:52;-1:-1:-1;5181:23:21;;5030:180;-1:-1:-1;5030:180:21:o;5215:644::-;5357:6;5365;5373;5381;5389;5442:3;5430:9;5421:7;5417:23;5413:33;5410:53;;;5459:1;5456;5449:12;5410:53;5495:9;5482:23;5472:33;;5524:38;5558:2;5547:9;5543:18;5524:38;:::i;5864:290::-;5969:6;5977;6030:2;6018:9;6009:7;6005:23;6001:32;5998:52;;;6046:1;6043;6036:12;5998:52;6082:9;6069:23;6059:33;;6111:37;6144:2;6133:9;6129:18;6111:37;:::i;6159:250::-;6244:1;6254:113;6268:6;6265:1;6262:13;6254:113;;;6344:11;;;6338:18;6325:11;;;6318:39;6290:2;6283:10;6254:113;;;-1:-1:-1;;6401:1:21;6383:16;;6376:27;6159:250::o;6414:330::-;6456:3;6494:5;6488:12;6521:6;6516:3;6509:19;6537:76;6606:6;6599:4;6594:3;6590:14;6583:4;6576:5;6572:16;6537:76;:::i;:::-;6658:2;6646:15;6663:66;6642:88;6633:98;;;;6733:4;6629:109;;6414:330;-1:-1:-1;;6414:330:21:o;6749:1335::-;7146:66;7138:6;7134:79;7123:9;7116:98;7097:4;7233:2;7271:3;7266:2;7255:9;7251:18;7244:31;7298:46;7339:3;7328:9;7324:19;7316:6;7298:46;:::i;:::-;7392:9;7384:6;7380:22;7375:2;7364:9;7360:18;7353:50;7426:33;7452:6;7444;7426:33;:::i;:::-;7490:2;7475:18;;7468:34;;;7551:42;7539:55;;7533:3;7518:19;;7511:84;7626:3;7611:19;;7604:35;;;7676:22;;;7670:3;7655:19;;7648:51;7748:13;;7770:22;;;7820:2;7846:15;;;;-1:-1:-1;7808:15:21;;;;-1:-1:-1;7889:169:21;7903:6;7900:1;7897:13;7889:169;;;7964:13;;7952:26;;8033:15;;;;7998:12;;;;7925:1;7918:9;7889:169;;;-1:-1:-1;8075:3:21;;6749:1335;-1:-1:-1;;;;;;;;;;;;6749:1335:21:o;8089:332::-;8165:6;8173;8181;8234:2;8222:9;8213:7;8209:23;8205:32;8202:52;;;8250:1;8247;8240:12;8202:52;8273:28;8291:9;8273:28;:::i;:::-;8263:38;;8320;8354:2;8343:9;8339:18;8320:38;:::i;:::-;8310:48;;8377:38;8411:2;8400:9;8396:18;8377:38;:::i;:::-;8367:48;;8089:332;;;;;:::o;8426:258::-;8493:6;8501;8554:2;8542:9;8533:7;8529:23;8525:32;8522:52;;;8570:1;8567;8560:12;8522:52;8593:28;8611:9;8593:28;:::i;:::-;8583:38;;8640;8674:2;8663:9;8659:18;8640:38;:::i;8934:567::-;9073:6;9081;9089;9097;9105;9113;9166:3;9154:9;9145:7;9141:23;9137:33;9134:53;;;9183:1;9180;9173:12;9134:53;9219:9;9206:23;9196:33;;9248:37;9281:2;9270:9;9266:18;9248:37;:::i;:::-;9238:47;;9332:2;9321:9;9317:18;9304:32;9294:42;;9355:36;9387:2;9376:9;9372:18;9355:36;:::i;:::-;9345:46;;9438:3;9427:9;9423:19;9410:33;9400:43;;9490:3;9479:9;9475:19;9462:33;9452:43;;8934:567;;;;;;;;:::o;9506:626::-;9603:6;9611;9664:2;9652:9;9643:7;9639:23;9635:32;9632:52;;;9680:1;9677;9670:12;9632:52;9720:9;9707:23;9749:18;9790:2;9782:6;9779:14;9776:34;;;9806:1;9803;9796:12;9776:34;9844:6;9833:9;9829:22;9819:32;;9889:7;9882:4;9878:2;9874:13;9870:27;9860:55;;9911:1;9908;9901:12;9860:55;9951:2;9938:16;9977:2;9969:6;9966:14;9963:34;;;9993:1;9990;9983:12;9963:34;10046:7;10041:2;10031:6;10028:1;10024:14;10020:2;10016:23;10012:32;10009:45;10006:65;;;10067:1;10064;10057:12;10006:65;10098:2;10090:11;;;;;10120:6;;-1:-1:-1;9506:626:21;;-1:-1:-1;;;;9506:626:21:o;10137:860::-;10297:4;10326:2;10366;10355:9;10351:18;10396:2;10385:9;10378:21;10419:6;10454;10448:13;10485:6;10477;10470:22;10523:2;10512:9;10508:18;10501:25;;10585:2;10575:6;10572:1;10568:14;10557:9;10553:30;10549:39;10535:53;;10623:2;10615:6;10611:15;10644:1;10654:314;10668:6;10665:1;10662:13;10654:314;;;10757:66;10745:9;10737:6;10733:22;10729:95;10724:3;10717:108;10848:40;10881:6;10872;10866:13;10848:40;:::i;:::-;10838:50;-1:-1:-1;10946:12:21;;;;10911:15;;;;10690:1;10683:9;10654:314;;;-1:-1:-1;10985:6:21;;10137:860;-1:-1:-1;;;;;;;10137:860:21:o;11740:685::-;11852:6;11860;11868;11876;11884;11892;11945:3;11933:9;11924:7;11920:23;11916:33;11913:53;;;11962:1;11959;11952:12;11913:53;11985:28;12003:9;11985:28;:::i;:::-;11975:38;;12032;12066:2;12055:9;12051:18;12032:38;:::i;:::-;12022:48;;12089:38;12123:2;12112:9;12108:18;12089:38;:::i;:::-;12079:48;;12146:38;12180:2;12169:9;12165:18;12146:38;:::i;:::-;12136:48;;12231:3;12220:9;12216:19;12203:33;12193:43;;12287:3;12276:9;12272:19;12259:33;12315:18;12307:6;12304:30;12301:50;;;12347:1;12344;12337:12;12301:50;12370:49;12411:7;12402:6;12391:9;12387:22;12370:49;:::i;:::-;12360:59;;;11740:685;;;;;;;;:::o;15318:184::-;15370:77;15367:1;15360:88;15467:4;15464:1;15457:15;15491:4;15488:1;15481:15;15507:168;15580:9;;;15611;;15628:15;;;15622:22;;15608:37;15598:71;;15649:18;;:::i;15680:274::-;15720:1;15746;15736:189;;15781:77;15778:1;15771:88;15882:4;15879:1;15872:15;15910:4;15907:1;15900:15;15736:189;-1:-1:-1;15939:9:21;;15680:274::o;15959:128::-;16026:9;;;16047:11;;;16044:37;;;16061:18;;:::i;16092:125::-;16157:9;;;16178:10;;;16175:36;;;16191:18;;:::i;16222:184::-;16292:6;16345:2;16333:9;16324:7;16320:23;16316:32;16313:52;;;16361:1;16358;16351:12;16313:52;-1:-1:-1;16384:16:21;;16222:184;-1:-1:-1;16222:184:21:o;17370:::-;17422:77;17419:1;17412:88;17519:4;17516:1;17509:15;17543:4;17540:1;17533:15;17559:580;17636:4;17642:6;17702:11;17689:25;17792:66;17781:8;17765:14;17761:29;17757:102;17737:18;17733:127;17723:155;;17874:1;17871;17864:12;17723:155;17901:33;;17953:20;;;-1:-1:-1;17996:18:21;17985:30;;17982:50;;;18028:1;18025;18018:12;17982:50;18061:4;18049:17;;-1:-1:-1;18092:14:21;18088:27;;;18078:38;;18075:58;;;18129:1;18126;18119:12;18075:58;17559:580;;;;;:::o;19577:191::-;19645:26;19704:10;;;19692;;;19688:27;;19727:12;;;19724:38;;;19742:18;;:::i;20891:188::-;20958:26;21004:10;;;21016;;;21000:27;;21039:11;;;21036:37;;;21053:18;;:::i;21084:287::-;21213:3;21251:6;21245:13;21267:66;21326:6;21321:3;21314:4;21306:6;21302:17;21267:66;:::i;:::-;21349:16;;;;;21084:287;-1:-1:-1;;21084:287:21:o;21732:184::-;21784:77;21781:1;21774:88;21881:4;21878:1;21871:15;21905:4;21902:1;21895:15;22223:437;22302:1;22298:12;;;;22345;;;22366:61;;22420:4;22412:6;22408:17;22398:27;;22366:61;22473:2;22465:6;22462:14;22442:18;22439:38;22436:218;;22510:77;22507:1;22500:88;22611:4;22608:1;22601:15;22639:4;22636:1;22629:15;22436:218;;22223:437;;;:::o;23585:289::-;23760:6;23749:9;23742:25;23803:2;23798;23787:9;23783:18;23776:30;23723:4;23823:45;23864:2;23853:9;23849:18;23841:6;23823:45;:::i;24068:245::-;24135:6;24188:2;24176:9;24167:7;24163:23;24159:32;24156:52;;;24204:1;24201;24194:12;24156:52;24236:9;24230:16;24255:28;24277:5;24255:28;:::i
Swarm Source
ipfs://881acdf2b86321ce5553f215df4ff4b0142142c1d27dc4e4686ac1dfc4d20762
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.