Source Code
Overview
MON Balance
MON Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ShMonad
Compiler Version
v0.8.30+commit.73712a01
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { Math as OZMath } from "@openzeppelin/contracts/utils/math/Math.sol";
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
// OVERRIDE STUFF
import { Policies } from "./Policies.sol";
import { CommittedData, Delivery, UserUnstakeRequest, AdminValues } from "./Types.sol";
import { EIP1967_ADMIN_SLOT, OWNER_COMMISSION_ACCOUNT } from "./Constants.sol";
import { IShMonad } from "./interfaces/IShMonad.sol";
import { AccountingLib } from "./libraries/AccountingLib.sol";
/**
* @title ShMonad - Liquid Staking Token on Monad
* @notice ShMonad is an LST integrated with the FastLane ecosystem
* @dev Extends Policies which provides ERC4626 functionality plus policy-based commitment mechanisms
* @author FastLane Labs
*/
contract ShMonad is Policies {
using SafeTransferLib for address;
using SafeCast for uint256;
using Math for uint256;
constructor() {
// Disable initializers on implementation
_disableInitializers();
}
/**
* @notice Initializes the contract with ownership set to the deployer
* @dev This is part of the OpenZeppelin Upgradeable pattern
* @dev Protected against front-running: constructor disables initializers on implementation
* @dev For proxy upgrades, this must be called via ProxyAdmin.upgradeAndCall()
* @param deployer The address that will own the contract
*/
function initialize(address deployer) public reinitializer(10) {
// Prevent unauthorized initialization during upgrades
// Only allow if called by current owner (for upgrades)
address _proxyAdmin = _getProxyAdmin();
require(msg.sender == _proxyAdmin, UnauthorizedInitializer());
__EIP712_init("ShMonad", "3");
__Ownable_init(deployer);
__AtomicUnstakePool_init();
__ReentrancyGuardTransient_init();
__StakeTracker_init();
}
/// @dev Returns the proxy admin when running behind a TransparentUpgradeableProxy.
function _getProxyAdmin() private view returns (address _proxyAdmin) {
// Assembly required to sload the admin slot defined by the proxy standard.
// Pseudocode: proxyAdmin = StorageSlot(EIP1967_ADMIN_SLOT).read();
assembly ("memory-safe") {
_proxyAdmin := sload(EIP1967_ADMIN_SLOT)
}
}
// --------------------------------------------- //
// Agent Functions //
// --------------------------------------------- //
/**
* @notice Transfers committed shares from one account to another within the same policy.
* @dev Implementation details:
* 1. Releases any holds on the source account if requested.
* 2. If `inUnderlying` is true, interprets `amount` as MON (post-fee, ignoring liquidity limits) and converts
* to shares via `_convertToShares(amount)` semantics.
* 3. Updates the source account's committed balance in memory then persists to storage.
* 4. Updates the destination account's committed balance directly in storage.
* 5. Does not decrease committedTotalSupply as the value remains committed.
* @param policyID The ID of the policy powering the transfer.
* @param from The address providing the committed shares.
* @param to The address receiving the committed shares.
* @param amount The amount to transfer (shares or assets depending on `inUnderlying`).
* @param fromReleaseAmount Shares to release from holds before transferring.
* @param inUnderlying Whether `amount` is specified in MON (`true`) or shMON (`false`).
*/
function agentTransferFromCommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool inUnderlying
)
external
nonReentrant
onlyPolicyAgentAndActive(policyID)
{
// Agents cannot transfer their own committed funds, otherwise they could circumvent the rule that disallows
// them from instantly uncommitting their own funds by first transferring them to a non-agent account.
require(!_isPolicyAgent(policyID, from), AgentInstantUncommittingDisallowed(policyID, from));
// Release hold on `from` account if necessary
if (fromReleaseAmount > 0) _release(policyID, from, fromReleaseAmount);
// Interpret `amount` in underlying units using the vault exchange rate (no fee path)
if (inUnderlying) amount = _convertToShares(amount, OZMath.Rounding.Ceil, false, false);
uint128 sharesToDeduct = amount.toUint128();
// Changes to the `from` account - done in memory then persisted to storage:
// - decrease committed balance (respecting any holds if not released above)
// - do not decrease committedTotalSupply (value stays in committed form)
CommittedData memory fromCommittedData = s_committedData[policyID][from];
_spendFromCommitted(fromCommittedData, policyID, from, sharesToDeduct, Delivery.Committed);
s_committedData[policyID][from] = fromCommittedData;
// Changes to the `to` account - done directly in storage:
// - increase committed balance (holds not applicable if increasing)
s_committedData[policyID][to].committed += sharesToDeduct;
s_balances[to].committed += sharesToDeduct;
emit AgentTransferFromCommitted(policyID, from, to, amount);
}
/**
* @notice Transfers committed shares from an account into another account's uncommitted balance.
* @dev Implementation details:
* 1. Prevents agents from uncommitting their own balance.
* 2. Releases any holds on the source account if requested.
* 3. If `inUnderlying` is true, interprets `amount` as MON and converts to shares via `_convertToShares`.
* 4. Updates the source account's committed balance in memory then persists to storage.
* 5. Increases the destination account's uncommitted balance.
* 6. Decreases committedTotalSupply because value leaves the committed form.
* @param policyID The ID of the policy powering the transfer.
* @param from The address providing the committed shares.
* @param to The address receiving the uncommitted shares.
* @param amount The amount to transfer (shares or assets depending on `inUnderlying`).
* @param fromReleaseAmount Shares to release from holds before transferring.
* @param inUnderlying Whether `amount` is specified in MON (`true`) or shMON (`false`).
*/
function agentTransferToUncommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool inUnderlying
)
external
onlyPolicyAgentAndActive(policyID)
{
// Agents cannot instantly uncommit their own or other agents' balances
require(!_isPolicyAgent(policyID, from), AgentInstantUncommittingDisallowed(policyID, from));
// Release hold on `from` account if necessary
if (fromReleaseAmount > 0) _release(policyID, from, fromReleaseAmount);
// Interpret `amount` in underlying units using the vault exchange rate (no fee path)
if (inUnderlying) amount = _convertToShares(amount, OZMath.Rounding.Ceil, false, false);
uint128 sharesToDeduct = amount.toUint128();
// Changes to the `from` account - done in memory then persisted to storage:
// - decrease committed balance (respecting any holds if not released above)
// - decreases committedTotalSupply (value converts to uncommitted form)
CommittedData memory fromCommittedData = s_committedData[policyID][from];
_spendFromCommitted(fromCommittedData, policyID, from, sharesToDeduct, Delivery.Uncommitted);
s_committedData[policyID][from] = fromCommittedData;
// Increase uncommitted balance
s_balances[to].uncommitted += sharesToDeduct;
emit AgentTransferToUncommitted(policyID, from, to, amount);
}
/**
* @notice Withdraws MON from an account's committed balance to a recipient.
* @dev Implementation details:
* 1. Prevents agents from withdrawing their own balance.
* 2. Releases any holds on the source account if requested.
* 3. Handles conversion between shares and assets based on the `amountSpecifiedInUnderlying` flag.
* 4. Updates the source account's committed balance in memory then persists to storage.
* 5. Temporarily increases the destination's uncommitted balance.
* 6. Burns the shares from the destination account.
* 7. Transfers the underlying assets (MON) to the destination.
* NOTE: Conversions go through the AtomicUnstakePool. Fees and liquidity limits apply; agents should consult
* `previewWithdraw()`/`previewRedeem()` before calling.
* @param policyID The ID of the policy powering the withdrawal.
* @param from The address providing the committed shares.
* @param to The address receiving the withdrawn MON.
* @param amount The amount to withdraw (shares or assets depending on `amountSpecifiedInUnderlying`).
* @param fromReleaseAmount Shares to release from holds before withdrawing.
* @param amountSpecifiedInUnderlying Whether `amount` is specified in MON (`true`) or shMON (`false`).
*/
function agentWithdrawFromCommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool amountSpecifiedInUnderlying
)
external
nonReentrant
onlyPolicyAgentAndActive(policyID)
{
// Agents cannot instantly uncommit their own or other agents' balances
require(!_isPolicyAgent(policyID, from), AgentInstantUncommittingDisallowed(policyID, from));
// Release hold on `from` account if necessary
if (fromReleaseAmount > 0) _release(policyID, from, fromReleaseAmount);
uint128 _sharesToDeduct;
uint256 _assetsToReceive;
uint256 _feeTaken;
if (amountSpecifiedInUnderlying) {
// CASE: amount is a net assets (MON) figure.
_assetsToReceive = amount;
uint256 _grossAssets;
(_grossAssets, _feeTaken) = _getGrossAndFeeFromNetAssets(_assetsToReceive);
// Burn shares equivalent to the required before-fee gross (ceil rounding).
_sharesToDeduct = _convertToShares(_grossAssets, OZMath.Rounding.Ceil, true, false).toUint128();
} else {
// CASE: amount is a gross shares (shMON) figure.
uint256 _grossAssetsWanted = _convertToAssets(amount, OZMath.Rounding.Floor, true, false);
uint256 _grossAssetsCapped;
(_grossAssetsCapped, _feeTaken) = _getGrossCappedAndFeeFromGrossAssets(_grossAssetsWanted);
_assetsToReceive = _grossAssetsCapped - _feeTaken;
_sharesToDeduct = amount.toUint128();
}
// Changes to the `from` account - done in memory then persisted to storage:
// - decrease committed balance (respecting any holds if not released above)
// - decrease committedTotalSupply (value leaving committed form)
CommittedData memory fromCommittedData = s_committedData[policyID][from];
_spendFromCommitted(fromCommittedData, policyID, from, _sharesToDeduct, Delivery.Underlying);
s_committedData[policyID][from] = fromCommittedData;
// Call StakeTracker hook to account for assets leaving via instant unstake
_accountForWithdraw(_assetsToReceive.toUint128(), _feeTaken.toUint128());
// Send net assets to the `to` address
to.safeTransferETH(_assetsToReceive);
emit AgentWithdrawFromCommitted(policyID, from, to, _assetsToReceive);
}
// --------------------------------------------- //
// Unstake Functions //
// --------------------------------------------- //
function requestUnstake(uint256 shares) external notWhenClosed returns (uint64 completionEpoch) {
completionEpoch = _requestUnstake(shares);
}
function _requestUnstake(uint256 shares) internal returns (uint64 completionEpoch) {
require(shares != 0, CannotUnstakeZeroShares());
require(shares <= balanceOf(msg.sender), InsufficientBalanceForUnstake());
uint256 amount = previewUnstake(shares);
// burn shMON → record request into global trackers
_burn(msg.sender, shares);
_afterRequestUnstake(amount);
// Calculate the internal epoch when the unstake request can be completed
completionEpoch = _calcUnstakeRequestCompletionEpoch(amount);
// Load the user's previous completion epoch to ensure we do not move it backwards
uint64 _prevCompletionEpoch = s_unstakeRequests[msg.sender].completionEpoch;
// We take the furthest completion epoch between the new request and the previous one
completionEpoch = uint64(Math.max(completionEpoch, _prevCompletionEpoch));
// Store the user's cumulative unstaking amount, and the furthest completion epoch
s_unstakeRequests[msg.sender].amountMon += amount.toUint128();
s_unstakeRequests[msg.sender].completionEpoch = completionEpoch;
emit RequestUnstake(msg.sender, shares, amount, completionEpoch);
}
function completeUnstake() external virtual notWhenClosed {
_completeUnstake(msg.sender);
}
function _completeUnstake(address account) internal {
// pull request
uint64 _currentInternalEpoch = s_admin.internalEpoch;
UserUnstakeRequest memory _unstakeRequest = s_unstakeRequests[account];
require(_unstakeRequest.amountMon != 0, NoUnstakeRequestFound());
require(
_currentInternalEpoch >= _unstakeRequest.completionEpoch,
CompletionEpochNotReached(_currentInternalEpoch, _unstakeRequest.completionEpoch)
);
uint128 _amount = _unstakeRequest.amountMon;
delete s_unstakeRequests[account];
_beforeCompleteUnstake(_amount);
account.safeTransferETH(_amount);
emit CompleteUnstake(account, _amount);
}
function _calcUnstakeRequestCompletionEpoch(uint256 amount) internal view returns (uint64 completionEpoch) {
uint64 _currentInternalEpoch = s_admin.internalEpoch;
// Worst case: users can `completeUnstake()` [k + 4] internal (ShMonad) epochs after calling `requestUnstake()`
// where k is the native withdrawal delay (currently 1 Monad epoch)
completionEpoch = _currentInternalEpoch + STAKING_WITHDRAWAL_DELAY + 4;
// TIMING - Assumption of Worst Case
// Epoch N+0 Request Unstake
// Epoch N+1 (boundary) Last validator cranked
// Epoch N+2 (effective epoch of crank due to boundary)
// Epoch N+3 EPOCH_DELAY_PERIOD
// Epoch N+4 collect unstaked amount from validators
// Epoch N+5 user can withdraw safely
uint256 _maxGlobalRedemptionAllowed = AccountingLib.maximumNewGlobalRedemptionAmount(
s_globalCapital, s_globalLiabilities, s_admin, s_globalPending, address(this).balance
);
// If the requested amount exceeds the maximum global redemption allowed, the completion epoch is extended by 2
// additional epochs to account for the activation of pending stake.
if (amount > _maxGlobalRedemptionAllowed) {
// TIMING - Assumption of Worst Case
// NOTE: We must wait for deposit to finish before we can start unstaking it
// Epoch N+0 Deposit requested in boundary block
// Epoch N+1 effective deposit block
// Epoch N+2 verify deposit complete + Request Unstake
// Epoch N+3 (boundary) Last validator cranked
// Epoch N+4 (effective epoch of crank due to boundary)
// Epoch N+5 EPOCH_DELAY_PERIOD
// Epoch N+6 collect unstaked amount from validators <- Net New Delay
// Epoch N+7 user can withdraw safely <- Net New Delay
completionEpoch += 2;
}
}
// --------------------------------------------- //
// Zero Yield Tranche Functions //
// --------------------------------------------- //
/// @notice Deposits assets into the zero-yield tranche, crediting the balance to the receiver
/// @dev The zero-yield tranche does not earn any yield. Yield earned on the deposited assets go towards boosting
/// shMON yield. Accounts with zero-yield tranche balances can convert their balances into yield-bearing shMON at
/// any time, via `convertZeroYieldTrancheToShMON()`.
/// @param assets The amount of underlying assets (MON) to deposit
/// @param receiver The address receiving the zero-yield tranche shares
function depositToZeroYieldTranche(uint256 assets, address receiver) external payable notWhenClosed nonReentrant {
_depositToZeroYieldTranche(assets, msg.sender, receiver);
}
function _depositToZeroYieldTranche(uint256 assets, address from, address to) internal {
AdminValues memory _admin = s_admin;
require(msg.value == assets, IncorrectNativeTokenAmountSent());
// Increase zero-yield tranche balance
s_zeroYieldBalances[to] += assets;
// Increase total liabilities to reflect the new assets held in the zero-yield tranche
_admin.totalZeroYieldPayable += uint128(assets);
// Queue up the new funds to be staked
_accountForDeposit(assets.toUint128());
// Persist AdminValues changes to storage
s_admin = _admin;
emit DepositToZeroYieldTranche(from, to, assets);
}
/// @notice Converts zero-yield tranche balances into yield-bearing shMON shares.
/// @param assets The amount of underlying assets (MON) to convert
/// @param receiver The address receiving the yield-bearing shMON shares
/// @return shares The amount of yield-bearing shMON shares minted to the receiver
function convertZeroYieldTrancheToShares(
uint256 assets,
address receiver
)
external
notWhenClosed
nonReentrant
returns (uint256 shares)
{
shares = _convertZeroYieldBalanceToShares(assets, msg.sender, receiver);
}
/// @notice Allows the contract owner to claim their accumulated commission as yield-bearing shMON shares.
/// @param assets The amount of underlying assets (MON) to convert
/// @param receiver The address receiving the yield-bearing shMON shares
/// @return shares The amount of yield-bearing shMON shares minted to the receiver
function claimOwnerCommissionAsShares(
uint256 assets,
address receiver
)
external
onlyOwner
nonReentrant
returns (uint256 shares)
{
shares = _convertZeroYieldBalanceToShares(assets, OWNER_COMMISSION_ACCOUNT, receiver);
emit AdminCommissionClaimedAsShares(receiver, assets, shares);
}
function _convertZeroYieldBalanceToShares(
uint256 assets,
address from,
address to
)
internal
returns (uint256 shares)
{
AdminValues memory _admin = s_admin;
require(s_zeroYieldBalances[from] >= assets, InsufficientZeroYieldBalance(s_zeroYieldBalances[from], assets));
// Instead of depositing new assets, we decrease totalZeroYieldPayable, which decreases total liabilities. Thus
// there is still an increase in totalEquity that is commensurate with the increase in totalSupply caused by new
// shares minted below.
_admin.totalZeroYieldPayable -= uint128(assets);
// Decrease the `from` account's zero-yield balance
s_zeroYieldBalances[from] -= assets;
// Logic below is similar to standard `deposit()` logic, but bypasseses maxDeposit and msg.value checks.
// `false` indicates that msg.value should not be deducted from total assets before calculating shares. Recent
// revenue will also not be deducted from total assets.
shares = _previewDeposit(assets, false);
_mint(to, shares);
// NOTE: `_accountForDeposit()` not called, as no new assets are being deposited
// Persist AdminValues changes to storage
s_admin = _admin;
// Transfer event emitted by _mint(). Additional Deposit event emitted here.
emit ZeroYieldBalanceConvertedToShares(from, to, assets, shares);
emit Deposit(from, to, assets, shares);
}
/// @notice Returns the zero-yield tranche balance of an account
/// @param account The account to query
/// @return The zero-yield tranche balance of the account, in MON
function balanceOfZeroYieldTranche(address account) external view returns (uint256) {
return s_zeroYieldBalances[account];
}
/// @notice Returns the unclaimed owner commission balance
/// @return The unclaimed owner commission balance, in MON
function unclaimedOwnerCommission() external view returns (uint256) {
return s_zeroYieldBalances[OWNER_COMMISSION_ACCOUNT];
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)
///
/// @dev Note:
/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.
library SafeTransferLib {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ETH transfer has failed.
error ETHTransferFailed();
/// @dev The ERC20 `transferFrom` has failed.
error TransferFromFailed();
/// @dev The ERC20 `transfer` has failed.
error TransferFailed();
/// @dev The ERC20 `approve` has failed.
error ApproveFailed();
/// @dev The ERC20 `totalSupply` query has failed.
error TotalSupplyQueryFailed();
/// @dev The Permit2 operation has failed.
error Permit2Failed();
/// @dev The Permit2 amount must be less than `2**160 - 1`.
error Permit2AmountOverflow();
/// @dev The Permit2 approve operation has failed.
error Permit2ApproveFailed();
/// @dev The Permit2 lockdown operation has failed.
error Permit2LockdownFailed();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.
uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;
/// @dev Suggested gas stipend for contract receiving ETH to perform a few
/// storage reads and writes, but low enough to prevent griefing.
uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;
/// @dev The unique EIP-712 domain separator for the DAI token contract.
bytes32 internal constant DAI_DOMAIN_SEPARATOR =
0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;
/// @dev The address for the WETH9 contract on Ethereum mainnet.
address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/// @dev The canonical Permit2 address.
/// [Github](https://github.com/Uniswap/permit2)
/// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
/// @dev The canonical address of the `SELFDESTRUCT` ETH mover.
/// See: https://gist.github.com/Vectorized/1cb8ad4cf393b1378e08f23f79bd99fa
/// [Etherscan](https://etherscan.io/address/0x00000000000073c48c8055bD43D1A53799176f0D)
address internal constant ETH_MOVER = 0x00000000000073c48c8055bD43D1A53799176f0D;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ETH OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.
//
// The regular variants:
// - Forwards all remaining gas to the target.
// - Reverts if the target reverts.
// - Reverts if the current contract has insufficient balance.
//
// The force variants:
// - Forwards with an optional gas stipend
// (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).
// - If the target reverts, or if the gas stipend is exhausted,
// creates a temporary contract to force send the ETH via `SELFDESTRUCT`.
// Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.
// - Reverts if the current contract has insufficient balance.
//
// The try variants:
// - Forwards with a mandatory gas stipend.
// - Instead of reverting, returns whether the transfer succeeded.
/// @dev Sends `amount` (in wei) ETH to `to`.
function safeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Sends all the ETH in the current contract to `to`.
function safeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// Transfer all the ETH and check if it succeeded or not.
if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.
function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// forgefmt: disable-next-item
if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)
}
}
/// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.
function trySafeTransferAllETH(address to, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)
}
}
/// @dev Force transfers ETH to `to`, without triggering the fallback (if any).
/// This method attempts to use a separate contract to send via `SELFDESTRUCT`,
/// and upon failure, deploys a minimal vault to accrue the ETH.
function safeMoveETH(address to, uint256 amount) internal returns (address vault) {
/// @solidity memory-safe-assembly
assembly {
to := shr(96, shl(96, to)) // Clean upper 96 bits.
for { let mover := ETH_MOVER } iszero(eq(to, address())) {} {
let selfBalanceBefore := selfbalance()
if or(lt(selfBalanceBefore, amount), eq(to, mover)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if extcodesize(mover) {
let balanceBefore := balance(to) // Check via delta, in case `SELFDESTRUCT` is bricked.
mstore(0x00, to)
pop(call(gas(), mover, amount, 0x00, 0x20, codesize(), 0x00))
// If `address(to).balance >= amount + balanceBefore`, skip vault workflow.
if iszero(lt(balance(to), add(amount, balanceBefore))) { break }
// Just in case `SELFDESTRUCT` is changed to not revert and do nothing.
if lt(selfBalanceBefore, selfbalance()) { invalid() }
}
let m := mload(0x40)
// If the mover is missing or bricked, deploy a minimal vault
// that withdraws all ETH to `to` when being called only by `to`.
// forgefmt: disable-next-item
mstore(add(m, 0x20), 0x33146025575b600160005260206000f35b3d3d3d3d47335af1601a5760003dfd)
mstore(m, or(to, shl(160, 0x6035600b3d3960353df3fe73)))
// Compute and store the bytecode hash.
mstore8(0x00, 0xff) // Write the prefix.
mstore(0x35, keccak256(m, 0x40))
mstore(0x01, shl(96, address())) // Deployer.
mstore(0x15, 0) // Salt.
vault := keccak256(0x00, 0x55)
pop(call(gas(), vault, amount, codesize(), 0x00, codesize(), 0x00))
// The vault returns a single word on success. Failure reverts with empty data.
if iszero(returndatasize()) {
if iszero(create2(0, m, 0x40, 0)) { revert(codesize(), codesize()) } // For gas estimation.
}
mstore(0x40, m) // Restore the free memory pointer.
break
}
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ERC20 OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for
/// the current contract to manage.
function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
let success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function trySafeTransferFrom(address token, address from, address to, uint256 amount)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
success := lt(or(iszero(extcodesize(token)), returndatasize()), success)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends all of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have their entire balance approved for the current contract to manage.
function safeTransferAllFrom(address token, address from, address to)
internal
returns (uint256 amount)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.
amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.
// Perform the transfer, reverting upon failure.
let success := call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransfer(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sends all of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransferAll(address token, address to) internal returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
mstore(0x20, address()) // Store the address of the current contract.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x14, to) // Store the `to` argument.
amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// Reverts upon failure.
function safeApprove(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
/// then retries the approval again (some tokens, e.g. USDT, requires this).
/// Reverts upon failure.
function safeApproveWithRetry(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
// Perform the approval, retrying upon failure.
let success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x34, 0) // Store 0 for the `amount`.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.
mstore(0x34, amount) // Store back the original `amount`.
// Retry the approval, reverting upon failure.
success := call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
if iszero(and(eq(mload(0x00), 1), success)) {
// Check the `extcodesize` again just in case the token selfdestructs lol.
if iszero(lt(or(iszero(extcodesize(token)), returndatasize()), success)) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
}
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Returns the amount of ERC20 `token` owned by `account`.
/// Returns zero if the `token` does not exist.
function balanceOf(address token, address account) internal view returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, account) // Store the `account` argument.
mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
amount :=
mul( // The arguments of `mul` are evaluated from right to left.
mload(0x20),
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
)
}
}
/// @dev Performs a `token.balanceOf(account)` check.
/// `implemented` denotes whether the `token` does not implement `balanceOf`.
/// `amount` is zero if the `token` does not implement `balanceOf`.
function checkBalanceOf(address token, address account)
internal
view
returns (bool implemented, uint256 amount)
{
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, account) // Store the `account` argument.
mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
implemented :=
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
amount := mul(mload(0x20), implemented)
}
}
/// @dev Returns the total supply of the `token`.
/// Reverts if the token does not exist or does not implement `totalSupply()`.
function totalSupply(address token) internal view returns (uint256 result) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, 0x18160ddd) // `totalSupply()`.
if iszero(
and(gt(returndatasize(), 0x1f), staticcall(gas(), token, 0x1c, 0x04, 0x00, 0x20))
) {
mstore(0x00, 0x54cd9435) // `TotalSupplyQueryFailed()`.
revert(0x1c, 0x04)
}
result := mload(0x00)
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// If the initial attempt fails, try to use Permit2 to transfer the token.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {
if (!trySafeTransferFrom(token, from, to, amount)) {
permit2TransferFrom(token, from, to, amount);
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.
/// Reverts upon failure.
function permit2TransferFrom(address token, address from, address to, uint256 amount)
internal
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(add(m, 0x74), shr(96, shl(96, token)))
mstore(add(m, 0x54), amount)
mstore(add(m, 0x34), to)
mstore(add(m, 0x20), shl(96, from))
// `transferFrom(address,address,uint160,address)`.
mstore(m, 0x36c78516000000000000000000000000)
let p := PERMIT2
let exists := eq(chainid(), 1)
if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }
if iszero(
and(
call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00),
lt(iszero(extcodesize(token)), exists) // Token has code and Permit2 exists.
)
) {
mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)
}
}
}
/// @dev Permit a user to spend a given amount of
/// another user's tokens via native EIP-2612 permit if possible, falling
/// back to Permit2 if native permit fails or is not implemented on the token.
function permit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
for {} shl(96, xor(token, WETH9)) {} {
mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.
// Gas stipend to limit gas burn for tokens that don't refund gas when
// an non-existing function is called. 5K should be enough for a SLOAD.
staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)
)
) { break }
// After here, we can be sure that token is a contract.
let m := mload(0x40)
mstore(add(m, 0x34), spender)
mstore(add(m, 0x20), shl(96, owner))
mstore(add(m, 0x74), deadline)
if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {
mstore(0x14, owner)
mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.
mstore(
add(m, 0x94),
lt(iszero(amount), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))
)
mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.
// `nonces` is already at `add(m, 0x54)`.
// `amount != 0` is already stored at `add(m, 0x94)`.
mstore(add(m, 0xb4), and(0xff, v))
mstore(add(m, 0xd4), r)
mstore(add(m, 0xf4), s)
success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)
break
}
mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.
mstore(add(m, 0x54), amount)
mstore(add(m, 0x94), and(0xff, v))
mstore(add(m, 0xb4), r)
mstore(add(m, 0xd4), s)
success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)
break
}
}
if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);
}
/// @dev Simple permit on the Permit2 contract.
function simplePermit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(m, 0x927da105) // `allowance(address,address,address)`.
{
let addressMask := shr(96, not(0))
mstore(add(m, 0x20), and(addressMask, owner))
mstore(add(m, 0x40), and(addressMask, token))
mstore(add(m, 0x60), and(addressMask, spender))
mstore(add(m, 0xc0), and(addressMask, spender))
}
let p := mul(PERMIT2, iszero(shr(160, amount)))
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.
staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)
)
) {
mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(p))), 0x04)
}
mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).
// `owner` is already `add(m, 0x20)`.
// `token` is already at `add(m, 0x40)`.
mstore(add(m, 0x60), amount)
mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.
// `nonce` is already at `add(m, 0xa0)`.
// `spender` is already at `add(m, 0xc0)`.
mstore(add(m, 0xe0), deadline)
mstore(add(m, 0x100), 0x100) // `signature` offset.
mstore(add(m, 0x120), 0x41) // `signature` length.
mstore(add(m, 0x140), r)
mstore(add(m, 0x160), s)
mstore(add(m, 0x180), shl(248, v))
if iszero( // Revert if token does not have code, or if the call fails.
mul(extcodesize(token), call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00))) {
mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Approves `spender` to spend `amount` of `token` for `address(this)`.
function permit2Approve(address token, address spender, uint160 amount, uint48 expiration)
internal
{
/// @solidity memory-safe-assembly
assembly {
let addressMask := shr(96, not(0))
let m := mload(0x40)
mstore(m, 0x87517c45) // `approve(address,address,uint160,uint48)`.
mstore(add(m, 0x20), and(addressMask, token))
mstore(add(m, 0x40), and(addressMask, spender))
mstore(add(m, 0x60), and(addressMask, amount))
mstore(add(m, 0x80), and(0xffffffffffff, expiration))
if iszero(call(gas(), PERMIT2, 0, add(m, 0x1c), 0xa0, codesize(), 0x00)) {
mstore(0x00, 0x324f14ae) // `Permit2ApproveFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Revokes an approval for `token` and `spender` for `address(this)`.
function permit2Lockdown(address token, address spender) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(m, 0xcc53287f) // `Permit2.lockdown`.
mstore(add(m, 0x20), 0x20) // Offset of the `approvals`.
mstore(add(m, 0x40), 1) // `approvals.length`.
mstore(add(m, 0x60), shr(96, shl(96, token)))
mstore(add(m, 0x80), shr(96, shl(96, spender)))
if iszero(call(gas(), PERMIT2, 0, add(m, 0x1c), 0xa0, codesize(), 0x00)) {
mstore(0x00, 0x96b3de23) // `Permit2LockdownFailed()`.
revert(0x1c, 0x04)
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
assembly ("memory-safe") {
u := iszero(iszero(b))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
import {Panic} from "../Panic.sol";
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Return the 512-bit addition of two uint256.
*
* The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.
*/
function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
assembly ("memory-safe") {
low := add(a, b)
high := lt(low, a)
}
}
/**
* @dev Return the 512-bit multiplication of two uint256.
*
* The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.
*/
function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {
// 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = high * 2²⁵⁶ + low.
assembly ("memory-safe") {
let mm := mulmod(a, b, not(0))
low := mul(a, b)
high := sub(sub(mm, low), lt(mm, low))
}
}
/**
* @dev Returns the addition of two unsigned integers, with a success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
success = c >= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a - b;
success = c <= a;
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a * b;
assembly ("memory-safe") {
// Only true when the multiplication doesn't overflow
// (c / a == b) || (a == 0)
success := or(eq(div(c, a), b), iszero(a))
}
// equivalent to: success ? c : 0
result = c * SafeCast.toUint(success);
}
}
/**
* @dev Returns the division of two unsigned integers, with a success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
success = b > 0;
assembly ("memory-safe") {
// The `DIV` opcode returns zero when the denominator is 0.
result := div(a, b)
}
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
success = b > 0;
assembly ("memory-safe") {
// The `MOD` opcode returns zero when the denominator is 0.
result := mod(a, b)
}
}
}
/**
* @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryAdd(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.
*/
function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {
(, uint256 result) = trySub(a, b);
return result;
}
/**
* @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.
*/
function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {
(bool success, uint256 result) = tryMul(a, b);
return ternary(success, result, type(uint256).max);
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(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.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* 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 {
(uint256 high, uint256 low) = mul512(x, y);
// Handle non-overflow cases, 256 by 256 division.
if (high == 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 low / denominator;
}
// Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.
if (denominator <= high) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [high low].
uint256 remainder;
assembly ("memory-safe") {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
high := sub(high, gt(remainder, low))
low := sub(low, 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 ("memory-safe") {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [high low] by twos.
low := div(low, twos)
// Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from high into low.
low |= high * twos;
// Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
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⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// 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²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high
// is no longer required.
result = low * inverse;
return result;
}
}
/**
* @dev 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) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.
*/
function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {
unchecked {
(uint256 high, uint256 low) = mul512(x, y);
if (high >= 1 << n) {
Panic.panic(Panic.UNDER_OVERFLOW);
}
return (high << (256 - n)) | (low >> n);
}
}
/**
* @dev Calculates x * y >> n with full precision, following the selected rounding direction.
*/
function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {
return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// If upper 8 bits of 16-bit half set, add 8 to result
r |= SafeCast.toUint((x >> r) > 0xff) << 3;
// If upper 4 bits of 8-bit half set, add 4 to result
r |= SafeCast.toUint((x >> r) > 0xf) << 2;
// Shifts value right by the current result and use it as an index into this lookup table:
//
// | x (4 bits) | index | table[index] = MSB position |
// |------------|---------|-----------------------------|
// | 0000 | 0 | table[0] = 0 |
// | 0001 | 1 | table[1] = 0 |
// | 0010 | 2 | table[2] = 1 |
// | 0011 | 3 | table[3] = 1 |
// | 0100 | 4 | table[4] = 2 |
// | 0101 | 5 | table[5] = 2 |
// | 0110 | 6 | table[6] = 2 |
// | 0111 | 7 | table[7] = 2 |
// | 1000 | 8 | table[8] = 3 |
// | 1001 | 9 | table[9] = 3 |
// | 1010 | 10 | table[10] = 3 |
// | 1011 | 11 | table[11] = 3 |
// | 1100 | 12 | table[12] = 3 |
// | 1101 | 13 | table[13] = 3 |
// | 1110 | 14 | table[14] = 3 |
// | 1111 | 15 | table[15] = 3 |
//
// The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.
assembly ("memory-safe") {
r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))
}
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @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 x) internal pure returns (uint256 r) {
// If value has upper 128 bits set, log2 result is at least 128
r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;
// If upper 64 bits of 128-bit half set, add 64 to result
r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;
// If upper 32 bits of 64-bit half set, add 32 to result
r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;
// If upper 16 bits of 32-bit half set, add 16 to result
r |= SafeCast.toUint((x >> r) > 0xffff) << 4;
// Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8
return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @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
pragma solidity ^0.8.4;
/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
library FixedPointMathLib {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The operation failed, as the output exceeds the maximum value of uint256.
error ExpOverflow();
/// @dev The operation failed, as the output exceeds the maximum value of uint256.
error FactorialOverflow();
/// @dev The operation failed, due to an overflow.
error RPowOverflow();
/// @dev The mantissa is too big to fit.
error MantissaOverflow();
/// @dev The operation failed, due to an multiplication overflow.
error MulWadFailed();
/// @dev The operation failed, due to an multiplication overflow.
error SMulWadFailed();
/// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.
error DivWadFailed();
/// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.
error SDivWadFailed();
/// @dev The operation failed, either due to a multiplication overflow, or a division by a zero.
error MulDivFailed();
/// @dev The division failed, as the denominator is zero.
error DivFailed();
/// @dev The full precision multiply-divide operation failed, either due
/// to the result being larger than 256 bits, or a division by a zero.
error FullMulDivFailed();
/// @dev The output is undefined, as the input is less-than-or-equal to zero.
error LnWadUndefined();
/// @dev The input outside the acceptable domain.
error OutOfDomain();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The scalar of ETH and most ERC20s.
uint256 internal constant WAD = 1e18;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* SIMPLIFIED FIXED POINT OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Equivalent to `(x * y) / WAD` rounded down.
function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.
if gt(x, div(not(0), y)) {
if y {
mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.
revert(0x1c, 0x04)
}
}
z := div(mul(x, y), WAD)
}
}
/// @dev Equivalent to `(x * y) / WAD` rounded down.
function sMulWad(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(x, y)
// Equivalent to `require((x == 0 || z / x == y) && !(x == -1 && y == type(int256).min))`.
if iszero(gt(or(iszero(x), eq(sdiv(z, x), y)), lt(not(x), eq(y, shl(255, 1))))) {
mstore(0x00, 0xedcd4dd4) // `SMulWadFailed()`.
revert(0x1c, 0x04)
}
z := sdiv(z, WAD)
}
}
/// @dev Equivalent to `(x * y) / WAD` rounded down, but without overflow checks.
function rawMulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := div(mul(x, y), WAD)
}
}
/// @dev Equivalent to `(x * y) / WAD` rounded down, but without overflow checks.
function rawSMulWad(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := sdiv(mul(x, y), WAD)
}
}
/// @dev Equivalent to `(x * y) / WAD` rounded up.
function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(x, y)
// Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.
if iszero(eq(div(z, y), x)) {
if y {
mstore(0x00, 0xbac65e5b) // `MulWadFailed()`.
revert(0x1c, 0x04)
}
}
z := add(iszero(iszero(mod(z, WAD))), div(z, WAD))
}
}
/// @dev Equivalent to `(x * y) / WAD` rounded up, but without overflow checks.
function rawMulWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := add(iszero(iszero(mod(mul(x, y), WAD))), div(mul(x, y), WAD))
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded down.
function divWad(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to `require(y != 0 && x <= type(uint256).max / WAD)`.
if iszero(mul(y, lt(x, add(1, div(not(0), WAD))))) {
mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.
revert(0x1c, 0x04)
}
z := div(mul(x, WAD), y)
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded down.
function sDivWad(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(x, WAD)
// Equivalent to `require(y != 0 && ((x * WAD) / WAD == x))`.
if iszero(mul(y, eq(sdiv(z, WAD), x))) {
mstore(0x00, 0x5c43740d) // `SDivWadFailed()`.
revert(0x1c, 0x04)
}
z := sdiv(z, y)
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded down, but without overflow and divide by zero checks.
function rawDivWad(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := div(mul(x, WAD), y)
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded down, but without overflow and divide by zero checks.
function rawSDivWad(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := sdiv(mul(x, WAD), y)
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded up.
function divWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Equivalent to `require(y != 0 && x <= type(uint256).max / WAD)`.
if iszero(mul(y, lt(x, add(1, div(not(0), WAD))))) {
mstore(0x00, 0x7c5f487d) // `DivWadFailed()`.
revert(0x1c, 0x04)
}
z := add(iszero(iszero(mod(mul(x, WAD), y))), div(mul(x, WAD), y))
}
}
/// @dev Equivalent to `(x * WAD) / y` rounded up, but without overflow and divide by zero checks.
function rawDivWadUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := add(iszero(iszero(mod(mul(x, WAD), y))), div(mul(x, WAD), y))
}
}
/// @dev Equivalent to `x` to the power of `y`.
/// because `x ** y = (e ** ln(x)) ** y = e ** (ln(x) * y)`.
/// Note: This function is an approximation.
function powWad(int256 x, int256 y) internal pure returns (int256) {
// Using `ln(x)` means `x` must be greater than 0.
return expWad((lnWad(x) * y) / int256(WAD));
}
/// @dev Returns `exp(x)`, denominated in `WAD`.
/// Credit to Remco Bloemen under MIT license: https://2π.com/22/exp-ln
/// Note: This function is an approximation. Monotonically increasing.
function expWad(int256 x) internal pure returns (int256 r) {
unchecked {
// When the result is less than 0.5 we return zero.
// This happens when `x <= (log(1e-18) * 1e18) ~ -4.15e19`.
if (x <= -41446531673892822313) return r;
/// @solidity memory-safe-assembly
assembly {
// When the result is greater than `(2**255 - 1) / 1e18` we can not represent it as
// an int. This happens when `x >= floor(log((2**255 - 1) / 1e18) * 1e18) ≈ 135`.
if iszero(slt(x, 135305999368893231589)) {
mstore(0x00, 0xa37bfec9) // `ExpOverflow()`.
revert(0x1c, 0x04)
}
}
// `x` is now in the range `(-42, 136) * 1e18`. Convert to `(-42, 136) * 2**96`
// for more intermediate precision and a binary basis. This base conversion
// is a multiplication by 1e18 / 2**96 = 5**18 / 2**78.
x = (x << 78) / 5 ** 18;
// Reduce range of x to (-½ ln 2, ½ ln 2) * 2**96 by factoring out powers
// of two such that exp(x) = exp(x') * 2**k, where k is an integer.
// Solving this gives k = round(x / log(2)) and x' = x - k * log(2).
int256 k = ((x << 96) / 54916777467707473351141471128 + 2 ** 95) >> 96;
x = x - k * 54916777467707473351141471128;
// `k` is in the range `[-61, 195]`.
// Evaluate using a (6, 7)-term rational approximation.
// `p` is made monic, we'll multiply by a scale factor later.
int256 y = x + 1346386616545796478920950773328;
y = ((y * x) >> 96) + 57155421227552351082224309758442;
int256 p = y + x - 94201549194550492254356042504812;
p = ((p * y) >> 96) + 28719021644029726153956944680412240;
p = p * x + (4385272521454847904659076985693276 << 96);
// We leave `p` in `2**192` basis so we don't need to scale it back up for the division.
int256 q = x - 2855989394907223263936484059900;
q = ((q * x) >> 96) + 50020603652535783019961831881945;
q = ((q * x) >> 96) - 533845033583426703283633433725380;
q = ((q * x) >> 96) + 3604857256930695427073651918091429;
q = ((q * x) >> 96) - 14423608567350463180887372962807573;
q = ((q * x) >> 96) + 26449188498355588339934803723976023;
/// @solidity memory-safe-assembly
assembly {
// Div in assembly because solidity adds a zero check despite the unchecked.
// The q polynomial won't have zeros in the domain as all its roots are complex.
// No scaling is necessary because p is already `2**96` too large.
r := sdiv(p, q)
}
// r should be in the range `(0.09, 0.25) * 2**96`.
// We now need to multiply r by:
// - The scale factor `s ≈ 6.031367120`.
// - The `2**k` factor from the range reduction.
// - The `1e18 / 2**96` factor for base conversion.
// We do this all at once, with an intermediate result in `2**213`
// basis, so the final right shift is always by a positive amount.
r = int256(
(uint256(r) * 3822833074963236453042738258902158003155416615667) >> uint256(195 - k)
);
}
}
/// @dev Returns `ln(x)`, denominated in `WAD`.
/// Credit to Remco Bloemen under MIT license: https://2π.com/22/exp-ln
/// Note: This function is an approximation. Monotonically increasing.
function lnWad(int256 x) internal pure returns (int256 r) {
/// @solidity memory-safe-assembly
assembly {
// We want to convert `x` from `10**18` fixed point to `2**96` fixed point.
// We do this by multiplying by `2**96 / 10**18`. But since
// `ln(x * C) = ln(x) + ln(C)`, we can simply do nothing here
// and add `ln(2**96 / 10**18)` at the end.
// Compute `k = log2(x) - 96`, `r = 159 - k = 255 - log2(x) = 255 ^ log2(x)`.
r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
r := or(r, shl(4, lt(0xffff, shr(r, x))))
r := or(r, shl(3, lt(0xff, shr(r, x))))
// We place the check here for more optimal stack operations.
if iszero(sgt(x, 0)) {
mstore(0x00, 0x1615e638) // `LnWadUndefined()`.
revert(0x1c, 0x04)
}
// forgefmt: disable-next-item
r := xor(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),
0xf8f9f9faf9fdfafbf9fdfcfdfafbfcfef9fafdfafcfcfbfefafafcfbffffffff))
// Reduce range of x to (1, 2) * 2**96
// ln(2^k * x) = k * ln(2) + ln(x)
x := shr(159, shl(r, x))
// Evaluate using a (8, 8)-term rational approximation.
// `p` is made monic, we will multiply by a scale factor later.
// forgefmt: disable-next-item
let p := sub( // This heavily nested expression is to avoid stack-too-deep for via-ir.
sar(96, mul(add(43456485725739037958740375743393,
sar(96, mul(add(24828157081833163892658089445524,
sar(96, mul(add(3273285459638523848632254066296,
x), x))), x))), x)), 11111509109440967052023855526967)
p := sub(sar(96, mul(p, x)), 45023709667254063763336534515857)
p := sub(sar(96, mul(p, x)), 14706773417378608786704636184526)
p := sub(mul(p, x), shl(96, 795164235651350426258249787498))
// We leave `p` in `2**192` basis so we don't need to scale it back up for the division.
// `q` is monic by convention.
let q := add(5573035233440673466300451813936, x)
q := add(71694874799317883764090561454958, sar(96, mul(x, q)))
q := add(283447036172924575727196451306956, sar(96, mul(x, q)))
q := add(401686690394027663651624208769553, sar(96, mul(x, q)))
q := add(204048457590392012362485061816622, sar(96, mul(x, q)))
q := add(31853899698501571402653359427138, sar(96, mul(x, q)))
q := add(909429971244387300277376558375, sar(96, mul(x, q)))
// `p / q` is in the range `(0, 0.125) * 2**96`.
// Finalization, we need to:
// - Multiply by the scale factor `s = 5.549…`.
// - Add `ln(2**96 / 10**18)`.
// - Add `k * ln(2)`.
// - Multiply by `10**18 / 2**96 = 5**18 >> 78`.
// The q polynomial is known not to have zeros in the domain.
// No scaling required because p is already `2**96` too large.
p := sdiv(p, q)
// Multiply by the scaling factor: `s * 5**18 * 2**96`, base is now `5**18 * 2**192`.
p := mul(1677202110996718588342820967067443963516166, p)
// Add `ln(2) * k * 5**18 * 2**192`.
// forgefmt: disable-next-item
p := add(mul(16597577552685614221487285958193947469193820559219878177908093499208371, sub(159, r)), p)
// Add `ln(2**96 / 10**18) * 5**18 * 2**192`.
p := add(600920179829731861736702779321621459595472258049074101567377883020018308, p)
// Base conversion: mul `2**18 / 2**192`.
r := sar(174, p)
}
}
/// @dev Returns `W_0(x)`, denominated in `WAD`.
/// See: https://en.wikipedia.org/wiki/Lambert_W_function
/// a.k.a. Product log function. This is an approximation of the principal branch.
/// Note: This function is an approximation. Monotonically increasing.
function lambertW0Wad(int256 x) internal pure returns (int256 w) {
// forgefmt: disable-next-item
unchecked {
if ((w = x) <= -367879441171442322) revert OutOfDomain(); // `x` less than `-1/e`.
(int256 wad, int256 p) = (int256(WAD), x);
uint256 c; // Whether we need to avoid catastrophic cancellation.
uint256 i = 4; // Number of iterations.
if (w <= 0x1ffffffffffff) {
if (-0x4000000000000 <= w) {
i = 1; // Inputs near zero only take one step to converge.
} else if (w <= -0x3ffffffffffffff) {
i = 32; // Inputs near `-1/e` take very long to converge.
}
} else if (uint256(w >> 63) == uint256(0)) {
/// @solidity memory-safe-assembly
assembly {
// Inline log2 for more performance, since the range is small.
let v := shr(49, w)
let l := shl(3, lt(0xff, v))
l := add(or(l, byte(and(0x1f, shr(shr(l, v), 0x8421084210842108cc6318c6db6d54be)),
0x0706060506020504060203020504030106050205030304010505030400000000)), 49)
w := sdiv(shl(l, 7), byte(sub(l, 31), 0x0303030303030303040506080c13))
c := gt(l, 60)
i := add(2, add(gt(l, 53), c))
}
} else {
int256 ll = lnWad(w = lnWad(w));
/// @solidity memory-safe-assembly
assembly {
// `w = ln(x) - ln(ln(x)) + b * ln(ln(x)) / ln(x)`.
w := add(sdiv(mul(ll, 1023715080943847266), w), sub(w, ll))
i := add(3, iszero(shr(68, x)))
c := iszero(shr(143, x))
}
if (c == uint256(0)) {
do { // If `x` is big, use Newton's so that intermediate values won't overflow.
int256 e = expWad(w);
/// @solidity memory-safe-assembly
assembly {
let t := mul(w, div(e, wad))
w := sub(w, sdiv(sub(t, x), div(add(e, t), wad)))
}
if (p <= w) break;
p = w;
} while (--i != uint256(0));
/// @solidity memory-safe-assembly
assembly {
w := sub(w, sgt(w, 2))
}
return w;
}
}
do { // Otherwise, use Halley's for faster convergence.
int256 e = expWad(w);
/// @solidity memory-safe-assembly
assembly {
let t := add(w, wad)
let s := sub(mul(w, e), mul(x, wad))
w := sub(w, sdiv(mul(s, wad), sub(mul(e, t), sdiv(mul(add(t, wad), s), add(t, t)))))
}
if (p <= w) break;
p = w;
} while (--i != c);
/// @solidity memory-safe-assembly
assembly {
w := sub(w, sgt(w, 2))
}
// For certain ranges of `x`, we'll use the quadratic-rate recursive formula of
// R. Iacono and J.P. Boyd for the last iteration, to avoid catastrophic cancellation.
if (c == uint256(0)) return w;
int256 t = w | 1;
/// @solidity memory-safe-assembly
assembly {
x := sdiv(mul(x, wad), t)
}
x = (t * (wad + lnWad(x)));
/// @solidity memory-safe-assembly
assembly {
w := sdiv(x, add(wad, t))
}
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* GENERAL NUMBER UTILITIES */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns `a * b == x * y`, with full precision.
function fullMulEq(uint256 a, uint256 b, uint256 x, uint256 y)
internal
pure
returns (bool result)
{
/// @solidity memory-safe-assembly
assembly {
result := and(eq(mul(a, b), mul(x, y)), eq(mulmod(x, y, not(0)), mulmod(a, b, not(0))))
}
}
/// @dev Calculates `floor(x * y / d)` with full precision.
/// Throws if result overflows a uint256 or when `d` is zero.
/// Credit to Remco Bloemen under MIT license: https://2π.com/21/muldiv
function fullMulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// 512-bit multiply `[p1 p0] = x * y`.
// Compute the product mod `2**256` and mod `2**256 - 1`
// then use the Chinese Remainder Theorem to reconstruct
// the 512 bit result. The result is stored in two 256
// variables such that `product = p1 * 2**256 + p0`.
// Temporarily use `z` as `p0` to save gas.
z := mul(x, y) // Lower 256 bits of `x * y`.
for {} 1 {} {
// If overflows.
if iszero(mul(or(iszero(x), eq(div(z, x), y)), d)) {
let mm := mulmod(x, y, not(0))
let p1 := sub(mm, add(z, lt(mm, z))) // Upper 256 bits of `x * y`.
/*------------------- 512 by 256 division --------------------*/
// Make division exact by subtracting the remainder from `[p1 p0]`.
let r := mulmod(x, y, d) // Compute remainder using mulmod.
let t := and(d, sub(0, d)) // The least significant bit of `d`. `t >= 1`.
// Make sure `z` is less than `2**256`. Also prevents `d == 0`.
// Placing the check here seems to give more optimal stack operations.
if iszero(gt(d, p1)) {
mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.
revert(0x1c, 0x04)
}
d := div(d, t) // Divide `d` by `t`, which is a power of two.
// Invert `d mod 2**256`
// Now that `d` is an odd number, it has an inverse
// modulo `2**256` such that `d * inv = 1 mod 2**256`.
// Compute the inverse by starting with a seed that is correct
// correct for four bits. That is, `d * inv = 1 mod 2**4`.
let inv := xor(2, mul(3, d))
// Now use 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.
inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**8
inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**16
inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**32
inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**64
inv := mul(inv, sub(2, mul(d, inv))) // inverse mod 2**128
z :=
mul(
// Divide [p1 p0] by the factors of two.
// Shift in bits from `p1` into `p0`. For this we need
// to flip `t` such that it is `2**256 / t`.
or(mul(sub(p1, gt(r, z)), add(div(sub(0, t), t), 1)), div(sub(z, r), t)),
mul(sub(2, mul(d, inv)), inv) // inverse mod 2**256
)
break
}
z := div(z, d)
break
}
}
}
/// @dev Calculates `floor(x * y / d)` with full precision.
/// Behavior is undefined if `d` is zero or the final result cannot fit in 256 bits.
/// Performs the full 512 bit calculation regardless.
function fullMulDivUnchecked(uint256 x, uint256 y, uint256 d)
internal
pure
returns (uint256 z)
{
/// @solidity memory-safe-assembly
assembly {
z := mul(x, y)
let mm := mulmod(x, y, not(0))
let p1 := sub(mm, add(z, lt(mm, z)))
let t := and(d, sub(0, d))
let r := mulmod(x, y, d)
d := div(d, t)
let inv := xor(2, mul(3, d))
inv := mul(inv, sub(2, mul(d, inv)))
inv := mul(inv, sub(2, mul(d, inv)))
inv := mul(inv, sub(2, mul(d, inv)))
inv := mul(inv, sub(2, mul(d, inv)))
inv := mul(inv, sub(2, mul(d, inv)))
z :=
mul(
or(mul(sub(p1, gt(r, z)), add(div(sub(0, t), t), 1)), div(sub(z, r), t)),
mul(sub(2, mul(d, inv)), inv)
)
}
}
/// @dev Calculates `floor(x * y / d)` with full precision, rounded up.
/// Throws if result overflows a uint256 or when `d` is zero.
/// Credit to Uniswap-v3-core under MIT license:
/// https://github.com/Uniswap/v3-core/blob/main/contracts/libraries/FullMath.sol
function fullMulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
z = fullMulDiv(x, y, d);
/// @solidity memory-safe-assembly
assembly {
if mulmod(x, y, d) {
z := add(z, 1)
if iszero(z) {
mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.
revert(0x1c, 0x04)
}
}
}
}
/// @dev Calculates `floor(x * y / 2 ** n)` with full precision.
/// Throws if result overflows a uint256.
/// Credit to Philogy under MIT license:
/// https://github.com/SorellaLabs/angstrom/blob/main/contracts/src/libraries/X128MathLib.sol
function fullMulDivN(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// Temporarily use `z` as `p0` to save gas.
z := mul(x, y) // Lower 256 bits of `x * y`. We'll call this `z`.
for {} 1 {} {
if iszero(or(iszero(x), eq(div(z, x), y))) {
let k := and(n, 0xff) // `n`, cleaned.
let mm := mulmod(x, y, not(0))
let p1 := sub(mm, add(z, lt(mm, z))) // Upper 256 bits of `x * y`.
// | p1 | z |
// Before: | p1_0 ¦ p1_1 | z_0 ¦ z_1 |
// Final: | 0 ¦ p1_0 | p1_1 ¦ z_0 |
// Check that final `z` doesn't overflow by checking that p1_0 = 0.
if iszero(shr(k, p1)) {
z := add(shl(sub(256, k), p1), shr(k, z))
break
}
mstore(0x00, 0xae47f702) // `FullMulDivFailed()`.
revert(0x1c, 0x04)
}
z := shr(and(n, 0xff), z)
break
}
}
}
/// @dev Returns `floor(x * y / d)`.
/// Reverts if `x * y` overflows, or `d` is zero.
function mulDiv(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(x, y)
// Equivalent to `require(d != 0 && (y == 0 || x <= type(uint256).max / y))`.
if iszero(mul(or(iszero(x), eq(div(z, x), y)), d)) {
mstore(0x00, 0xad251c27) // `MulDivFailed()`.
revert(0x1c, 0x04)
}
z := div(z, d)
}
}
/// @dev Returns `ceil(x * y / d)`.
/// Reverts if `x * y` overflows, or `d` is zero.
function mulDivUp(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(x, y)
// Equivalent to `require(d != 0 && (y == 0 || x <= type(uint256).max / y))`.
if iszero(mul(or(iszero(x), eq(div(z, x), y)), d)) {
mstore(0x00, 0xad251c27) // `MulDivFailed()`.
revert(0x1c, 0x04)
}
z := add(iszero(iszero(mod(z, d))), div(z, d))
}
}
/// @dev Returns `x`, the modular multiplicative inverse of `a`, such that `(a * x) % n == 1`.
function invMod(uint256 a, uint256 n) internal pure returns (uint256 x) {
/// @solidity memory-safe-assembly
assembly {
let g := n
let r := mod(a, n)
for { let y := 1 } 1 {} {
let q := div(g, r)
let t := g
g := r
r := sub(t, mul(r, q))
let u := x
x := y
y := sub(u, mul(y, q))
if iszero(r) { break }
}
x := mul(eq(g, 1), add(x, mul(slt(x, 0), n)))
}
}
/// @dev Returns `ceil(x / d)`.
/// Reverts if `d` is zero.
function divUp(uint256 x, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
if iszero(d) {
mstore(0x00, 0x65244e4e) // `DivFailed()`.
revert(0x1c, 0x04)
}
z := add(iszero(iszero(mod(x, d))), div(x, d))
}
}
/// @dev Returns `max(0, x - y)`. Alias for `saturatingSub`.
function zeroFloorSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(gt(x, y), sub(x, y))
}
}
/// @dev Returns `max(0, x - y)`.
function saturatingSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(gt(x, y), sub(x, y))
}
}
/// @dev Returns `min(2 ** 256 - 1, x + y)`.
function saturatingAdd(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := or(sub(0, lt(add(x, y), x)), add(x, y))
}
}
/// @dev Returns `min(2 ** 256 - 1, x * y)`.
function saturatingMul(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := or(sub(or(iszero(x), eq(div(mul(x, y), x), y)), 1), mul(x, y))
}
}
/// @dev Returns `condition ? x : y`, without branching.
function ternary(bool condition, uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), iszero(condition)))
}
}
/// @dev Returns `condition ? x : y`, without branching.
function ternary(bool condition, bytes32 x, bytes32 y) internal pure returns (bytes32 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), iszero(condition)))
}
}
/// @dev Returns `condition ? x : y`, without branching.
function ternary(bool condition, address x, address y) internal pure returns (address z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), iszero(condition)))
}
}
/// @dev Returns `x != 0 ? x : y`, without branching.
function coalesce(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := or(x, mul(y, iszero(x)))
}
}
/// @dev Returns `x != bytes32(0) ? x : y`, without branching.
function coalesce(bytes32 x, bytes32 y) internal pure returns (bytes32 z) {
/// @solidity memory-safe-assembly
assembly {
z := or(x, mul(y, iszero(x)))
}
}
/// @dev Returns `x != address(0) ? x : y`, without branching.
function coalesce(address x, address y) internal pure returns (address z) {
/// @solidity memory-safe-assembly
assembly {
z := or(x, mul(y, iszero(shl(96, x))))
}
}
/// @dev Exponentiate `x` to `y` by squaring, denominated in base `b`.
/// Reverts if the computation overflows.
function rpow(uint256 x, uint256 y, uint256 b) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mul(b, iszero(y)) // `0 ** 0 = 1`. Otherwise, `0 ** n = 0`.
if x {
z := xor(b, mul(xor(b, x), and(y, 1))) // `z = isEven(y) ? scale : x`
let half := shr(1, b) // Divide `b` by 2.
// Divide `y` by 2 every iteration.
for { y := shr(1, y) } y { y := shr(1, y) } {
let xx := mul(x, x) // Store x squared.
let xxRound := add(xx, half) // Round to the nearest number.
// Revert if `xx + half` overflowed, or if `x ** 2` overflows.
if or(lt(xxRound, xx), shr(128, x)) {
mstore(0x00, 0x49f7642b) // `RPowOverflow()`.
revert(0x1c, 0x04)
}
x := div(xxRound, b) // Set `x` to scaled `xxRound`.
// If `y` is odd:
if and(y, 1) {
let zx := mul(z, x) // Compute `z * x`.
let zxRound := add(zx, half) // Round to the nearest number.
// If `z * x` overflowed or `zx + half` overflowed:
if or(xor(div(zx, x), z), lt(zxRound, zx)) {
// Revert if `x` is non-zero.
if x {
mstore(0x00, 0x49f7642b) // `RPowOverflow()`.
revert(0x1c, 0x04)
}
}
z := div(zxRound, b) // Return properly scaled `zxRound`.
}
}
}
}
}
/// @dev Returns the square root of `x`, rounded down.
function sqrt(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
// `floor(sqrt(2**15)) = 181`. `sqrt(2**15) - 181 = 2.84`.
z := 181 // The "correct" value is 1, but this saves a multiplication later.
// This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
// start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.
// Let `y = x / 2**r`. We check `y >= 2**(k + 8)`
// but shift right by `k` bits to ensure that if `x >= 256`, then `y >= 256`.
let r := shl(7, lt(0xffffffffffffffffffffffffffffffffff, x))
r := or(r, shl(6, lt(0xffffffffffffffffff, shr(r, x))))
r := or(r, shl(5, lt(0xffffffffff, shr(r, x))))
r := or(r, shl(4, lt(0xffffff, shr(r, x))))
z := shl(shr(1, r), z)
// Goal was to get `z*z*y` within a small factor of `x`. More iterations could
// get y in a tighter range. Currently, we will have y in `[256, 256*(2**16))`.
// We ensured `y >= 256` so that the relative difference between `y` and `y+1` is small.
// That's not possible if `x < 256` but we can just verify those cases exhaustively.
// Now, `z*z*y <= x < z*z*(y+1)`, and `y <= 2**(16+8)`, and either `y >= 256`, or `x < 256`.
// Correctness can be checked exhaustively for `x < 256`, so we assume `y >= 256`.
// Then `z*sqrt(y)` is within `sqrt(257)/sqrt(256)` of `sqrt(x)`, or about 20bps.
// For `s` in the range `[1/256, 256]`, the estimate `f(s) = (181/1024) * (s+1)`
// is in the range `(1/2.84 * sqrt(s), 2.84 * sqrt(s))`,
// with largest error when `s = 1` and when `s = 256` or `1/256`.
// Since `y` is in `[256, 256*(2**16))`, let `a = y/65536`, so that `a` is in `[1/256, 256)`.
// Then we can estimate `sqrt(y)` using
// `sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2**18`.
// There is no overflow risk here since `y < 2**136` after the first branch above.
z := shr(18, mul(z, add(shr(r, x), 65536))) // A `mul()` is saved from starting `z` at 181.
// Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
// If `x+1` is a perfect square, the Babylonian method cycles between
// `floor(sqrt(x))` and `ceil(sqrt(x))`. This statement ensures we return floor.
// See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
z := sub(z, lt(div(x, z), z))
}
}
/// @dev Returns the cube root of `x`, rounded down.
/// Credit to bout3fiddy and pcaversaccio under AGPLv3 license:
/// https://github.com/pcaversaccio/snekmate/blob/main/src/snekmate/utils/math.vy
/// Formally verified by xuwinnie:
/// https://github.com/vectorized/solady/blob/main/audits/xuwinnie-solady-cbrt-proof.pdf
function cbrt(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
let r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
r := or(r, shl(4, lt(0xffff, shr(r, x))))
r := or(r, shl(3, lt(0xff, shr(r, x))))
// Makeshift lookup table to nudge the approximate log2 result.
z := div(shl(div(r, 3), shl(lt(0xf, shr(r, x)), 0xf)), xor(7, mod(r, 3)))
// Newton-Raphson's.
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
z := div(add(add(div(x, mul(z, z)), z), z), 3)
// Round down.
z := sub(z, lt(div(x, mul(z, z)), z))
}
}
/// @dev Returns the square root of `x`, denominated in `WAD`, rounded down.
function sqrtWad(uint256 x) internal pure returns (uint256 z) {
unchecked {
if (x <= type(uint256).max / 10 ** 18) return sqrt(x * 10 ** 18);
z = (1 + sqrt(x)) * 10 ** 9;
z = (fullMulDivUnchecked(x, 10 ** 18, z) + z) >> 1;
}
/// @solidity memory-safe-assembly
assembly {
z := sub(z, gt(999999999999999999, sub(mulmod(z, z, x), 1))) // Round down.
}
}
/// @dev Returns the cube root of `x`, denominated in `WAD`, rounded down.
/// Formally verified by xuwinnie:
/// https://github.com/vectorized/solady/blob/main/audits/xuwinnie-solady-cbrt-proof.pdf
function cbrtWad(uint256 x) internal pure returns (uint256 z) {
unchecked {
if (x <= type(uint256).max / 10 ** 36) return cbrt(x * 10 ** 36);
z = (1 + cbrt(x)) * 10 ** 12;
z = (fullMulDivUnchecked(x, 10 ** 36, z * z) + z + z) / 3;
}
/// @solidity memory-safe-assembly
assembly {
let p := x
for {} 1 {} {
if iszero(shr(229, p)) {
if iszero(shr(199, p)) {
p := mul(p, 100000000000000000) // 10 ** 17.
break
}
p := mul(p, 100000000) // 10 ** 8.
break
}
if iszero(shr(249, p)) { p := mul(p, 100) }
break
}
let t := mulmod(mul(z, z), z, p)
z := sub(z, gt(lt(t, shr(1, p)), iszero(t))) // Round down.
}
}
/// @dev Returns `sqrt(x * y)`. Also called the geometric mean.
function mulSqrt(uint256 x, uint256 y) internal pure returns (uint256 z) {
if (x == y) return x;
uint256 p = rawMul(x, y);
if (y == rawDiv(p, x)) return sqrt(p);
for (z = saturatingMul(rawAdd(sqrt(x), 1), rawAdd(sqrt(y), 1));; z = avg(z, p)) {
if ((p = fullMulDivUnchecked(x, y, z)) >= z) break;
}
}
/// @dev Returns the factorial of `x`.
function factorial(uint256 x) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := 1
if iszero(lt(x, 58)) {
mstore(0x00, 0xaba0f2a2) // `FactorialOverflow()`.
revert(0x1c, 0x04)
}
for {} x { x := sub(x, 1) } { z := mul(z, x) }
}
}
/// @dev Returns the log2 of `x`.
/// Equivalent to computing the index of the most significant bit (MSB) of `x`.
/// Returns 0 if `x` is zero.
function log2(uint256 x) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
r := or(r, shl(4, lt(0xffff, shr(r, x))))
r := or(r, shl(3, lt(0xff, shr(r, x))))
// forgefmt: disable-next-item
r := or(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),
0x0706060506020504060203020504030106050205030304010505030400000000))
}
}
/// @dev Returns the log2 of `x`, rounded up.
/// Returns 0 if `x` is zero.
function log2Up(uint256 x) internal pure returns (uint256 r) {
r = log2(x);
/// @solidity memory-safe-assembly
assembly {
r := add(r, lt(shl(r, 1), x))
}
}
/// @dev Returns the log10 of `x`.
/// Returns 0 if `x` is zero.
function log10(uint256 x) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
if iszero(lt(x, 100000000000000000000000000000000000000)) {
x := div(x, 100000000000000000000000000000000000000)
r := 38
}
if iszero(lt(x, 100000000000000000000)) {
x := div(x, 100000000000000000000)
r := add(r, 20)
}
if iszero(lt(x, 10000000000)) {
x := div(x, 10000000000)
r := add(r, 10)
}
if iszero(lt(x, 100000)) {
x := div(x, 100000)
r := add(r, 5)
}
r := add(r, add(gt(x, 9), add(gt(x, 99), add(gt(x, 999), gt(x, 9999)))))
}
}
/// @dev Returns the log10 of `x`, rounded up.
/// Returns 0 if `x` is zero.
function log10Up(uint256 x) internal pure returns (uint256 r) {
r = log10(x);
/// @solidity memory-safe-assembly
assembly {
r := add(r, lt(exp(10, r), x))
}
}
/// @dev Returns the log256 of `x`.
/// Returns 0 if `x` is zero.
function log256(uint256 x) internal pure returns (uint256 r) {
/// @solidity memory-safe-assembly
assembly {
r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
r := or(r, shl(4, lt(0xffff, shr(r, x))))
r := or(shr(3, r), lt(0xff, shr(r, x)))
}
}
/// @dev Returns the log256 of `x`, rounded up.
/// Returns 0 if `x` is zero.
function log256Up(uint256 x) internal pure returns (uint256 r) {
r = log256(x);
/// @solidity memory-safe-assembly
assembly {
r := add(r, lt(shl(shl(3, r), 1), x))
}
}
/// @dev Returns the scientific notation format `mantissa * 10 ** exponent` of `x`.
/// Useful for compressing prices (e.g. using 25 bit mantissa and 7 bit exponent).
function sci(uint256 x) internal pure returns (uint256 mantissa, uint256 exponent) {
/// @solidity memory-safe-assembly
assembly {
mantissa := x
if mantissa {
if iszero(mod(mantissa, 1000000000000000000000000000000000)) {
mantissa := div(mantissa, 1000000000000000000000000000000000)
exponent := 33
}
if iszero(mod(mantissa, 10000000000000000000)) {
mantissa := div(mantissa, 10000000000000000000)
exponent := add(exponent, 19)
}
if iszero(mod(mantissa, 1000000000000)) {
mantissa := div(mantissa, 1000000000000)
exponent := add(exponent, 12)
}
if iszero(mod(mantissa, 1000000)) {
mantissa := div(mantissa, 1000000)
exponent := add(exponent, 6)
}
if iszero(mod(mantissa, 10000)) {
mantissa := div(mantissa, 10000)
exponent := add(exponent, 4)
}
if iszero(mod(mantissa, 100)) {
mantissa := div(mantissa, 100)
exponent := add(exponent, 2)
}
if iszero(mod(mantissa, 10)) {
mantissa := div(mantissa, 10)
exponent := add(exponent, 1)
}
}
}
}
/// @dev Convenience function for packing `x` into a smaller number using `sci`.
/// The `mantissa` will be in bits [7..255] (the upper 249 bits).
/// The `exponent` will be in bits [0..6] (the lower 7 bits).
/// Use `SafeCastLib` to safely ensure that the `packed` number is small
/// enough to fit in the desired unsigned integer type:
/// ```
/// uint32 packed = SafeCastLib.toUint32(FixedPointMathLib.packSci(777 ether));
/// ```
function packSci(uint256 x) internal pure returns (uint256 packed) {
(x, packed) = sci(x); // Reuse for `mantissa` and `exponent`.
/// @solidity memory-safe-assembly
assembly {
if shr(249, x) {
mstore(0x00, 0xce30380c) // `MantissaOverflow()`.
revert(0x1c, 0x04)
}
packed := or(shl(7, x), packed)
}
}
/// @dev Convenience function for unpacking a packed number from `packSci`.
function unpackSci(uint256 packed) internal pure returns (uint256 unpacked) {
unchecked {
unpacked = (packed >> 7) * 10 ** (packed & 0x7f);
}
}
/// @dev Returns the average of `x` and `y`. Rounds towards zero.
function avg(uint256 x, uint256 y) internal pure returns (uint256 z) {
unchecked {
z = (x & y) + ((x ^ y) >> 1);
}
}
/// @dev Returns the average of `x` and `y`. Rounds towards negative infinity.
function avg(int256 x, int256 y) internal pure returns (int256 z) {
unchecked {
z = (x >> 1) + (y >> 1) + (x & y & 1);
}
}
/// @dev Returns the absolute value of `x`.
function abs(int256 x) internal pure returns (uint256 z) {
unchecked {
z = (uint256(x) + uint256(x >> 255)) ^ uint256(x >> 255);
}
}
/// @dev Returns the absolute distance between `x` and `y`.
function dist(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := add(xor(sub(0, gt(x, y)), sub(y, x)), gt(x, y))
}
}
/// @dev Returns the absolute distance between `x` and `y`.
function dist(int256 x, int256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := add(xor(sub(0, sgt(x, y)), sub(y, x)), sgt(x, y))
}
}
/// @dev Returns the minimum of `x` and `y`.
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), lt(y, x)))
}
}
/// @dev Returns the minimum of `x` and `y`.
function min(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), slt(y, x)))
}
}
/// @dev Returns the maximum of `x` and `y`.
function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), gt(y, x)))
}
}
/// @dev Returns the maximum of `x` and `y`.
function max(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, y), sgt(y, x)))
}
}
/// @dev Returns `x`, bounded to `minValue` and `maxValue`.
function clamp(uint256 x, uint256 minValue, uint256 maxValue)
internal
pure
returns (uint256 z)
{
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, minValue), gt(minValue, x)))
z := xor(z, mul(xor(z, maxValue), lt(maxValue, z)))
}
}
/// @dev Returns `x`, bounded to `minValue` and `maxValue`.
function clamp(int256 x, int256 minValue, int256 maxValue) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := xor(x, mul(xor(x, minValue), sgt(minValue, x)))
z := xor(z, mul(xor(z, maxValue), slt(maxValue, z)))
}
}
/// @dev Returns greatest common divisor of `x` and `y`.
function gcd(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
for { z := x } y {} {
let t := y
y := mod(z, y)
z := t
}
}
}
/// @dev Returns `a + (b - a) * (t - begin) / (end - begin)`,
/// with `t` clamped between `begin` and `end` (inclusive).
/// Agnostic to the order of (`a`, `b`) and (`end`, `begin`).
/// If `begins == end`, returns `t <= begin ? a : b`.
function lerp(uint256 a, uint256 b, uint256 t, uint256 begin, uint256 end)
internal
pure
returns (uint256)
{
if (begin > end) (t, begin, end) = (~t, ~begin, ~end);
if (t <= begin) return a;
if (t >= end) return b;
unchecked {
if (b >= a) return a + fullMulDiv(b - a, t - begin, end - begin);
return a - fullMulDiv(a - b, t - begin, end - begin);
}
}
/// @dev Returns `a + (b - a) * (t - begin) / (end - begin)`.
/// with `t` clamped between `begin` and `end` (inclusive).
/// Agnostic to the order of (`a`, `b`) and (`end`, `begin`).
/// If `begins == end`, returns `t <= begin ? a : b`.
function lerp(int256 a, int256 b, int256 t, int256 begin, int256 end)
internal
pure
returns (int256)
{
if (begin > end) (t, begin, end) = (~t, ~begin, ~end);
if (t <= begin) return a;
if (t >= end) return b;
// forgefmt: disable-next-item
unchecked {
if (b >= a) return int256(uint256(a) + fullMulDiv(uint256(b - a),
uint256(t - begin), uint256(end - begin)));
return int256(uint256(a) - fullMulDiv(uint256(a - b),
uint256(t - begin), uint256(end - begin)));
}
}
/// @dev Returns if `x` is an even number. Some people may need this.
function isEven(uint256 x) internal pure returns (bool) {
return x & uint256(1) == uint256(0);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* RAW NUMBER OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns `x + y`, without checking for overflow.
function rawAdd(uint256 x, uint256 y) internal pure returns (uint256 z) {
unchecked {
z = x + y;
}
}
/// @dev Returns `x + y`, without checking for overflow.
function rawAdd(int256 x, int256 y) internal pure returns (int256 z) {
unchecked {
z = x + y;
}
}
/// @dev Returns `x - y`, without checking for underflow.
function rawSub(uint256 x, uint256 y) internal pure returns (uint256 z) {
unchecked {
z = x - y;
}
}
/// @dev Returns `x - y`, without checking for underflow.
function rawSub(int256 x, int256 y) internal pure returns (int256 z) {
unchecked {
z = x - y;
}
}
/// @dev Returns `x * y`, without checking for overflow.
function rawMul(uint256 x, uint256 y) internal pure returns (uint256 z) {
unchecked {
z = x * y;
}
}
/// @dev Returns `x * y`, without checking for overflow.
function rawMul(int256 x, int256 y) internal pure returns (int256 z) {
unchecked {
z = x * y;
}
}
/// @dev Returns `x / y`, returning 0 if `y` is zero.
function rawDiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := div(x, y)
}
}
/// @dev Returns `x / y`, returning 0 if `y` is zero.
function rawSDiv(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := sdiv(x, y)
}
}
/// @dev Returns `x % y`, returning 0 if `y` is zero.
function rawMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mod(x, y)
}
}
/// @dev Returns `x % y`, returning 0 if `y` is zero.
function rawSMod(int256 x, int256 y) internal pure returns (int256 z) {
/// @solidity memory-safe-assembly
assembly {
z := smod(x, y)
}
}
/// @dev Returns `(x + y) % d`, return 0 if `d` if zero.
function rawAddMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := addmod(x, y, d)
}
}
/// @dev Returns `(x * y) % d`, return 0 if `d` if zero.
function rawMulMod(uint256 x, uint256 y, uint256 d) internal pure returns (uint256 z) {
/// @solidity memory-safe-assembly
assembly {
z := mulmod(x, y, d)
}
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { AtomicUnstakePool } from "./AtomicUnstakePool.sol";
import { IShMonad } from "./interfaces/IShMonad.sol";
import {
Balance,
Policy,
PolicyAccount,
CommittedData,
UncommittingData,
TopUpData,
TopUpSettings,
Delivery,
Supply,
UncommitApproval
} from "./Types.sol";
import { MIN_TOP_UP_PERIOD_BLOCKS } from "./Constants.sol";
/**
* @title Policies - Core commit and uncommit actions relating to ShMonad policies
* @author FastLane Labs
* @dev Implements commitment mechanism for shMON shares to policies with agent-controlled operations
* and secure uncommitting with escrow periods. Uses an approval-based mechanism for uncommit completion.
*/
abstract contract Policies is AtomicUnstakePool {
using SafeTransferLib for address;
using SafeCast for uint256;
/**
* @notice Initializes the Policies contract
*/
constructor() { }
// --------------------------------------------- //
// Commit, RequestUncommit, CompleteUncommit //
// --------------------------------------------- //
/**
* @dev Commitment lifecycle:
* - Commit: Moves shares from uncommitted to committed under policy control
* - RequestUncommit: Starts escrow period defined by policy's escrowDuration
* - CompleteUncommit: After escrow, moves shares from uncommitting to uncommitted state
*/
/**
* @notice Commits shMON shares to a specific policy.
* @dev Directly calls _commitToPolicy with msg.sender as the source. Always review the policy's escrow duration,
* as extremely long escrows can make uncommitting effectively impossible.
* @param policyID The ID of the policy to commit into.
* @param commitRecipient The address that will own the committed shares.
* @param shares The amount of shMON shares to commit.
*/
function commit(uint64 policyID, address commitRecipient, uint256 shares) external onlyActivePolicy(policyID) {
_commitToPolicy(policyID, msg.sender, commitRecipient, shares);
}
/**
* @notice Deposits MON and commits the resulting shMON shares to a specific policy.
* @dev Combines deposit and commit for gas efficiency. Always review the policy's escrow duration before
* committing, as extremely long escrows can make uncommitting effectively impossible.
* @param policyID The ID of the policy to commit shares to.
* @param sharesRecipient The address that will own the committed shares.
* @param sharesToCommit The number of shMON shares to commit (use type(uint256).max to commit all newly minted
* shares).
* @return sharesMinted The amount of shMON shares minted (before any optional partial commit occurs).
*/
function depositAndCommit(
uint64 policyID,
address sharesRecipient,
uint256 sharesToCommit
)
external
payable
onlyActivePolicy(policyID)
returns (uint256 sharesMinted)
{
// Mint shMON for msg.sender using the normal `deposit()` function.
// Includes a Transfer event for the minted shMON.
sharesMinted = deposit(msg.value, msg.sender);
if (sharesToCommit == type(uint256).max) sharesToCommit = sharesMinted;
// Then, commit the `sharesToCommit` in `sharesRecipient`'s policy committed balance.
// This will also decrease the msg.sender's uncommitted balance.
_commitToPolicy(policyID, msg.sender, sharesRecipient, sharesToCommit);
}
/**
* @notice Requests uncommitment of shares from a policy, starting the escrow countdown before completion.
* @dev Delegates to _requestUncommitFromPolicy for the core accounting and event emission.
* @param policyID The ID of the policy to request uncommitment from.
* @param shares The amount of shMON shares to request uncommitment for.
* @param newMinBalance The new minimum committed balance to maintain for automatic top-ups.
* @return uncommitCompleteBlock The block number when the uncommitting period will be complete.
*/
function requestUncommit(
uint64 policyID,
uint256 shares,
uint256 newMinBalance
)
external
returns (uint256 uncommitCompleteBlock)
{
uncommitCompleteBlock = _requestUncommitFromPolicy(policyID, msg.sender, shares, newMinBalance);
}
/**
* @notice Requests uncommitment and sets or updates an approval for a future completor.
* @dev Approval behavior accumulates share allowance and overwrites the completor address:
* - Shares: adds the requested `shares` to the existing approval allowance for future completions.
* - Completor: replaces the approved completor (use address(0) for an open approval).
* - Infinite approval: `type(uint96).max` represents an unlimited share allowance.
* @param policyID The ID of the policy to request uncommitment from.
* @param shares The amount of shMON shares to uncommit (and add to the approval allowance).
* @param newMinBalance The new minimum committed balance to maintain.
* @param completor The address authorized to complete the uncommit (zero address allows anyone).
* @return uncommitCompleteBlock The block number when the uncommitting period will be complete.
*/
function requestUncommitWithApprovedCompletor(
uint64 policyID,
uint256 shares,
uint256 newMinBalance,
address completor
)
external
returns (uint256 uncommitCompleteBlock)
{
uncommitCompleteBlock = _requestUncommitFromPolicy(policyID, msg.sender, shares, newMinBalance);
UncommitApproval memory _uncommitApproval = s_uncommitApprovals[policyID][msg.sender];
// Approval semantics: accumulates share allowance, overrides completor address.
// - Passing address(0) makes approval open (anyone can complete).
// - Use type(uint96).max via setUncommitApproval for infinite allowance.
_uncommitApproval.completor = completor; // override completor for subsequent completions
_uncommitApproval.shares += shares.toUint96(); // accumulate allowance by requested shares
// Persist UncommitApproval changes to storage
s_uncommitApprovals[policyID][msg.sender] = _uncommitApproval;
emit UncommitApprovalUpdated(policyID, msg.sender, _uncommitApproval.completor, _uncommitApproval.shares);
}
/**
* @notice Completes uncommitment of shares after escrow, honoring any outstanding approval.
* @dev Operates on the passed `account`'s balances (not the caller's) and enforces approval semantics:
* - Completor: requires `msg.sender` to match the approved completor unless approval uses `address(0)`.
* - Allowance: decreases the approved shares unless it is `type(uint96).max` (infinite).
* @param policyID The ID of the policy to complete uncommitment from.
* @param shares The amount of shMON shares to complete uncommitment for.
* @param account The address whose uncommitting will be completed and who receives the shares.
*/
function completeUncommitWithApproval(uint64 policyID, uint256 shares, address account) external {
UncommitApproval memory _uncommitApproval = s_uncommitApprovals[policyID][account];
// Operates on `account` balances, not caller's.
// If completor == address(0) the approval is open and anyone may call.
if (_uncommitApproval.completor != address(0)) {
require(_uncommitApproval.completor == msg.sender, InvalidUncommitCompletor());
}
// If shares approval is not infinite (type(uint96).max), ensure sufficient allowance and reduce it
if (_uncommitApproval.shares != type(uint96).max) {
uint96 _shares96 = shares.toUint96();
require(
_uncommitApproval.shares >= _shares96, InsufficientUncommitApproval(_uncommitApproval.shares, shares)
);
_uncommitApproval.shares -= _shares96;
// Only persist UncommitApproval changes to storage and emit event if shares were actually reduced
s_uncommitApprovals[policyID][account] = _uncommitApproval;
emit UncommitApprovalUpdated(policyID, account, _uncommitApproval.completor, _uncommitApproval.shares);
}
_completeUncommitFromPolicy(policyID, account, shares);
}
/**
* @notice Completes uncommitment of shares after the escrow period finishes.
* @dev Thin wrapper around _completeUncommitFromPolicy with msg.sender as the beneficiary.
* @param policyID The ID of the policy to complete uncommitment from.
* @param shares The amount of shMON shares to complete uncommitment for.
*/
function completeUncommit(uint64 policyID, uint256 shares) external {
_completeUncommitFromPolicy(policyID, msg.sender, shares);
}
/**
* @notice Completes uncommitment of shMON and immediately redeems the resulting shares for MON.
* @param policyID The ID of the policy from which to complete uncommitment of shMON.
* @param shares The amount of shMON to complete uncommitment for and then redeem for MON.
* @return assets The amount of MON redeemed for the given shMON shares.
*/
function completeUncommitAndRedeem(uint64 policyID, uint256 shares) external returns (uint256 assets) {
_completeUncommitFromPolicy(policyID, msg.sender, shares);
assets = redeem(shares, msg.sender, msg.sender);
}
/**
* @notice Completes uncommitment of shMON from one policy and commits it into another policy in a single call.
* @dev Maintains total committed supply by recommitting immediately after completing the uncommitment.
* @param fromPolicyID The policy to complete uncommitment from.
* @param toPolicyID The policy to commit shares to.
* @param sharesRecipient The address that will own the recommitted shares.
* @param shares The amount of shMON shares to move between policies.
*/
function completeUncommitAndRecommit(
uint64 fromPolicyID,
uint64 toPolicyID,
address sharesRecipient,
uint256 shares
)
external
onlyActivePolicy(toPolicyID)
{
// changeCommittedTotalSupply = true in _commitToPolicy() below, as it would have decreased in the
// requestUncommit() step
// before the completeUncommit() step here
_completeUncommitFromPolicy(fromPolicyID, msg.sender, shares);
_commitToPolicy(toPolicyID, msg.sender, sharesRecipient, shares);
}
/**
* @notice Sets or overwrites the caller's uncommit approval for a policy.
* @dev Overrides any existing approval. Use `type(uint96).max` for infinite allowance and `address(0)` for an open
* approval that allows anyone to complete the uncommitment.
* @param policyID The ID of the policy for which to configure approval.
* @param completor The address authorized to complete uncommitment (zero address allows anyone).
* @param shares The maximum shares that can be completed using this approval.
*/
function setUncommitApproval(uint64 policyID, address completor, uint256 shares) external {
// Overrides any existing approval. For open approval set completor = address(0).
// Use type(uint96).max to grant infinite allowance.
s_uncommitApprovals[policyID][msg.sender] =
UncommitApproval({ completor: completor, shares: shares.toUint96() });
emit UncommitApprovalUpdated(policyID, msg.sender, completor, shares.toUint96());
}
// --------------------------------------------- //
// Top-Up Management Functions //
// --------------------------------------------- //
/**
* @dev Top-Up Mechanism Design:
*
* The top-up system automatically maintains a minimum committed balance, ensuring users
* always have sufficient committed shares available for policy operations:
*
* 1. Purpose:
* - Ensures users can always cover operational costs via their committed balance
* - Prevents accounts from becoming inoperable due to insufficient committed shares
* - Allows users to set predictable limits on automatic recommitting
*
* 2. Parameters:
* - minCommitted: The minimum balance to maintain in the committed state
* - maxTopUpPerPeriod: Limit on how much can be automatically committed in a period
* - topUpPeriodDuration: Time window controlling top-up frequency (in blocks)
*
* 3. Mechanism:
* - When a user's committed balance falls below minCommitted, the system attempts to commit
* more shares from their uncommitted balance
* - Top-ups are capped by maxTopUpPerPeriod to prevent unexpected large transfers
* - Each period resets the top-up counter, managing frequency of automatic committing
*
* 4. Integration:
* - Top-up occurs automatically during _spendFromCommitted operations when needed
* - Users can disable top-up by setting parameters to zero
*/
/**
* @notice Sets the caller's minimum committed balance and automatic top-up settings for a policy.
* @dev Updates top-up settings in memory then persists to storage. Validates minimum period duration.
* @param policyID The ID of the policy whose thresholds are being updated.
* @param minCommitted The minimum committed balance to maintain.
* @param maxTopUpPerPeriod The maximum amount automatically recommitted per period.
* @param topUpPeriodDuration The duration of each top-up period in blocks.
*/
function setMinCommittedBalance(
uint64 policyID,
uint128 minCommitted,
uint128 maxTopUpPerPeriod,
uint32 topUpPeriodDuration
)
external
onlyActivePolicy(policyID)
{
TopUpSettings memory topUpSettings = s_topUpSettings[policyID][msg.sender];
// Only enforce minimum duration if top-up is being enabled (non-zero values)
// Users can disable top-up by setting all parameters to zero
if (topUpPeriodDuration > 0) {
require(
topUpPeriodDuration >= MIN_TOP_UP_PERIOD_BLOCKS,
TopUpPeriodDurationTooShort(topUpPeriodDuration, MIN_TOP_UP_PERIOD_BLOCKS)
);
}
topUpSettings.maxTopUpPerPeriod = maxTopUpPerPeriod;
topUpSettings.topUpPeriodDuration = topUpPeriodDuration;
s_committedData[policyID][msg.sender].minCommitted = minCommitted;
// Persist topUpSettings to storage
s_topUpSettings[policyID][msg.sender] = topUpSettings;
emit SetTopUp(policyID, msg.sender, minCommitted, maxTopUpPerPeriod, topUpPeriodDuration);
}
// --------------------------------------------- //
// Policy Management Functions //
// --------------------------------------------- //
/**
* @dev Policies organize committed shares:
* - Each has unique ID, configuration, and authorized agents
* - Balances tracked per-user per-policy
* - Agents perform operations on committed shares
* - Policies can be disabled to prevent new commitments
*/
/**
* @notice Creates a new policy with the specified escrow duration.
* @dev Adds the caller as the first policy agent.
* @param escrowDuration The duration in blocks that uncommitting must wait before completion (<= type(uint48).max).
* @return policyID The ID of the newly created policy.
*/
function createPolicy(uint48 escrowDuration) external returns (uint64 policyID) {
policyID = ++s_policyCount; // First policyID is 1
s_policies[policyID] = Policy(escrowDuration, true, msg.sender);
_addPolicyAgent(policyID, msg.sender); // Add caller as first agent of the policy
emit CreatePolicy(policyID, msg.sender, escrowDuration);
}
/**
* @notice Adds a policy agent to the specified policy.
* @dev Only callable by the contract owner; delegates to the internal _addPolicyAgent helper.
* @param policyID The ID of the policy.
* @param agent The address of the agent to add.
*/
function addPolicyAgent(uint64 policyID, address agent) external onlyOwner {
_addPolicyAgent(policyID, agent);
emit AddPolicyAgent(policyID, agent);
}
/**
* @notice Removes a policy agent from the specified policy.
* @dev Only callable by the contract owner; delegates to the internal _removePolicyAgent helper.
* @param policyID The ID of the policy.
* @param agent The address of the agent to remove.
*/
function removePolicyAgent(uint64 policyID, address agent) external onlyOwner {
_removePolicyAgent(policyID, agent);
emit RemovePolicyAgent(policyID, agent);
}
/**
* @notice Disables a policy, blocking new commitments but still allowing uncommitting.
* @dev Only callable by a policy agent. This action is irreversible and policies cannot be re-enabled.
* @param policyID The ID of the policy to disable.
*/
function disablePolicy(uint64 policyID) external onlyPolicyAgentAndActive(policyID) {
s_policies[policyID].active = false;
emit DisablePolicy(policyID);
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/**
* @notice Gets the block number when uncommitting will be complete for an account in a policy.
* @param policyID The ID of the policy to inspect.
* @param account The address whose uncommitting schedule is being queried.
* @return The block number when uncommitting will be complete.
*/
function uncommittingCompleteBlock(uint64 policyID, address account) external view returns (uint256) {
return s_uncommittingData[policyID][account].uncommitStartBlock + s_policies[policyID].escrowDuration;
}
/**
* @notice Returns the maximum amount a policy agent could take from an account.
* @dev Calculated as committed - held + uncommitting + remaining top-up allowance.
* @param policyID The ID of the policy being queried.
* @param account The account whose balances are evaluated.
* @param inUnderlying Whether to express the result in MON (true) or shMON (false).
* @return balanceAvailable The amount available for agent operations.
*/
function policyBalanceAvailable(
uint64 policyID,
address account,
bool inUnderlying
)
external
view
returns (uint256 balanceAvailable)
{
// Add account's committed balance
balanceAvailable = s_committedData[policyID][account].committed;
// Add account's uncommitting balance
balanceAvailable += s_uncommittingData[policyID][account].uncommitting;
// Add account's max top-up amount available
balanceAvailable += topUpAvailable(policyID, account, false);
// Subtract any holds on the account's committed balance
balanceAvailable -= _getHoldAmount(policyID, account);
// Convert from shMON to MON if required
if (inUnderlying) balanceAvailable = previewRedeem(balanceAvailable);
}
/**
* @notice Returns the amount currently available via automatic top-up for an account in a policy.
* @param policyID The ID of the policy being queried.
* @param account The account whose top-up allowance is evaluated.
* @param inUnderlying Whether to express the result in MON (true) or shMON (false).
* @return amountAvailable The amount that can still be auto-committed this period.
*/
function topUpAvailable(
uint64 policyID,
address account,
bool inUnderlying
)
public
view
returns (uint256 amountAvailable)
{
TopUpSettings memory topUpSettings = s_topUpSettings[policyID][account];
// Early returns for zero balances
if (topUpSettings.maxTopUpPerPeriod == 0) return 0;
uint256 uncommittedBalance = s_balances[account].uncommitted;
if (uncommittedBalance == 0) return 0;
TopUpData memory topUpData = s_topUpData[policyID][account];
uint256 topUpLeftInPeriod;
if (block.number > topUpData.topUpPeriodStartBlock + topUpSettings.topUpPeriodDuration) {
// If in new top-up period, max top-up is available
topUpLeftInPeriod = topUpSettings.maxTopUpPerPeriod;
} else {
// If in same top-up period, calc remaining top-up allowance
if (topUpSettings.maxTopUpPerPeriod > topUpData.totalPeriodTopUps) {
topUpLeftInPeriod = topUpSettings.maxTopUpPerPeriod - topUpData.totalPeriodTopUps;
} else {
return 0;
}
}
// Top-up amount available is capped by the account's uncommitted balance
amountAvailable = uncommittedBalance < topUpLeftInPeriod ? uncommittedBalance : topUpLeftInPeriod;
// Convert from shMON to MON if required
if (inUnderlying) amountAvailable = previewRedeem(amountAvailable);
return amountAvailable;
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/// @notice Returns top-up settings for an account (no structs).
/// @return maxTopUpPerPeriod Maximum top-up per period
/// @return topUpPeriodDuration Duration of top-up period in blocks
function getTopUpSettings(
uint64 policyID,
address account
)
external
view
returns (uint128 maxTopUpPerPeriod, uint32 topUpPeriodDuration)
{
TopUpSettings memory _topUpSettings = s_topUpSettings[policyID][account];
return (_topUpSettings.maxTopUpPerPeriod, _topUpSettings.topUpPeriodDuration);
}
/// @notice Returns committed data (committed amount and minCommitted threshold).
function getCommittedData(
uint64 policyID,
address account
)
external
view
returns (uint128 committed, uint128 minCommitted)
{
CommittedData memory _committedData = s_committedData[policyID][account];
return (_committedData.committed, _committedData.minCommitted);
}
/// @notice Returns uncommitting data (uncommitting amount and start block).
function getUncommittingData(
uint64 policyID,
address account
)
external
view
returns (uint128 uncommitting, uint48 uncommitStartBlock)
{
UncommittingData memory _uncommittingData = s_uncommittingData[policyID][account];
return (_uncommittingData.uncommitting, _uncommittingData.uncommitStartBlock);
}
/**
* @notice Gets the uncommit approval settings for an account in a policy
* @param policyID The ID of the policy
* @param account The address to check
* @return approval The uncommit approval (completor and approved shares)
*/
function getUncommitApproval(
uint64 policyID,
address account
)
external
view
returns (UncommitApproval memory approval)
{
approval = s_uncommitApprovals[policyID][account];
}
// --------------------------------------------- //
// Internal Functions //
// --------------------------------------------- //
/**
* @dev Commits shares to a policy from one account to a recipient
* @param policyID The ID of the policy
* @param accountFrom The address providing the shares
* @param sharesRecipient The address receiving the committed shares
* @param shares The amount of shMON shares to commit
* @dev Implementation details:
* 1. Checks if accountFrom has sufficient uncommitted balance
* 2. If accountFrom != sharesRecipient, handles as a transfer + commit
* 3. If accountFrom == sharesRecipient, handles as a simple commit
* 4. Updates committed balance in the policy and total committed supply if requested
* 5. Emits Transfer event for cross-account transfers and Commit event in all cases
*/
function _commitToPolicy(uint64 policyID, address accountFrom, address sharesRecipient, uint256 shares) internal {
Balance memory fromBalance = s_balances[accountFrom];
uint128 shares128 = shares.toUint128();
require(sharesRecipient != address(0), CommitRecipientCannotBeZeroAddress());
require(fromBalance.uncommitted >= shares128, InsufficientUncommittedBalance(fromBalance.uncommitted, shares));
if (sharesRecipient != accountFrom) {
// from and recipient are different --> effectively a transfer(), then a commit()
// Increase recipient's committed balance, then persist to storage
Balance memory recipientBalance = s_balances[sharesRecipient];
recipientBalance.committed += shares128;
s_balances[sharesRecipient] = recipientBalance;
// Same event as if transfer() was called
emit Transfer(accountFrom, sharesRecipient, shares);
} else {
// from and recipient are the same --> effectively just a commit() action
fromBalance.committed += shares128;
// No transfer event required
}
// Safe unchecked arithmetic due to [uncommitted >= amount] check above
unchecked {
// In both cases above, from's uncommitted balance decreases. Underflow check at start of func.
fromBalance.uncommitted -= shares128;
// Increase sharesRecipient's committed balance in the policy
s_committedData[policyID][sharesRecipient].committed += shares128;
// Increase committedTotalSupply
s_supply.committedTotal += shares128;
}
// Persist changes in from's balance to storage
s_balances[accountFrom] = fromBalance;
emit Commit(policyID, sharesRecipient, shares);
// For frontends: we track commits/uncommits as transfers to/from this ShMonad contract
emit Transfer(accountFrom, address(this), shares);
}
/**
* @dev Requests uncommitment of shares from a policy, starting the escrow period
* @param policyID The ID of the policy
* @param account The address uncommitting shares
* @param shares The amount of shMON shares to uncommit
* @param newMinBalance The new minimum balance for top-up settings
* @return uncommitCompleteBlock The block number when the uncommitting period will be complete
* @dev Implementation details:
* 1. Checks if account has sufficient unheld committed balance
* 2. Decreases account's committed balance and the total committed supply
* 3. Increases account's uncommitting balance and sets the uncommit start block
* 4. Updates the caller's minCommitted threshold to the new minimum balance
* 5. Calculates and returns the block when uncommitting will be complete
*/
function _requestUncommitFromPolicy(
uint64 policyID,
address account,
uint256 shares,
uint256 newMinBalance
)
internal
returns (uint256 uncommitCompleteBlock)
{
CommittedData memory committedData = s_committedData[policyID][account];
UncommittingData memory uncommittingData = s_uncommittingData[policyID][account];
uint128 shares128 = shares.toUint128();
uint128 held128 = _getHoldAmount(policyID, account).toUint128();
require(
committedData.committed - held128 >= shares128,
InsufficientUnheldCommittedBalance(committedData.committed, held128, shares128)
);
// Should not be able to underflow due to check above
unchecked {
// Decrease account's total committed and policy committed balances
committedData.committed -= shares128;
s_balances[account].committed -= shares128;
// Also decrease totalCommittedSupply due to decrease in committed balance
s_supply.committedTotal -= shares128;
// Increase account's uncommitting balance and update uncommitStartBlock
uncommittingData.uncommitting += shares128;
uncommittingData.uncommitStartBlock = uint48(block.number);
}
// Persist the caller's new minimum committed balance threshold
committedData.minCommitted = newMinBalance.toUint128();
// Persist changes in memory struct to storage
s_committedData[policyID][account] = committedData;
s_uncommittingData[policyID][account] = uncommittingData;
// Calculate the block at which the uncommitting will be complete, for event and return value
uncommitCompleteBlock = block.number + s_policies[policyID].escrowDuration;
emit RequestUncommit(policyID, account, shares, uncommitCompleteBlock);
}
/**
* @dev Completes uncommitment after escrow period completion
* @param policyID The ID of the policy
* @param account The address completing uncommitment
* @param shares The amount of shMON shares to complete uncommitment for
* @dev Implementation details:
* 1. Checks if the uncommitting period is complete
* 2. Verifies account has sufficient uncommitting balance
* 3. Decreases account's uncommitting balance and increases their uncommitted balance
*/
function _completeUncommitFromPolicy(uint64 policyID, address account, uint256 shares) internal {
UncommittingData memory uncommittingData = s_uncommittingData[policyID][account];
uint256 policyEscrowDuration = s_policies[policyID].escrowDuration;
uint128 shares128 = shares.toUint128();
require(
block.number > uncommittingData.uncommitStartBlock + policyEscrowDuration,
UncommittingPeriodIncomplete(uncommittingData.uncommitStartBlock + policyEscrowDuration)
);
// This check ensures no overflows or underflows below
require(
uncommittingData.uncommitting >= shares128,
InsufficientUncommittingBalance(uncommittingData.uncommitting, shares)
);
unchecked {
// Decrease account's uncommitting balance
uncommittingData.uncommitting -= shares128;
// Increase account's uncommitted balance
s_balances[account].uncommitted += shares128;
}
// Persist changes in memory struct to storage
s_uncommittingData[policyID][account] = uncommittingData;
emit CompleteUncommit(policyID, account, shares);
// For frontends: we track commits/uncommits as transfers to/from this ShMonad contract
emit Transfer(address(this), account, shares);
}
/**
* @dev Respects any holds on the account's committed balance and decreases it if sufficient after deducting holds.
* May attempt top-up if needed, then draws from uncommitting if necessary.
* @param committedData Memory struct containing the account's committed data
* @param policyID The ID of the policy
* @param account The address whose committed balance is being decreased
* @param shares The amount of shMON shares to spend
* @param out Whether to decrease the committedTotalSupply
* @dev Implementation details:
* 1. Calculates available funds after deducting holds
* 2. If insufficient funds, first try take from account's uncommitting balance
* 3. If still insufficient funds, attempt top-up from account's uncommitted balance
* 4. If still insufficient after trying uncommitting and top-up sources, reverts with InsufficientFunds error
* 5. Updates balances in memory structures (must be persisted to storage separately)
* 6. Decreases both committedTotalSupply and totalSupply, depending on the `out` parameter
*/
function _spendFromCommitted(
CommittedData memory committedData,
uint64 policyID,
address account,
uint128 shares,
Delivery out
)
internal
{
Balance memory balance = s_balances[account];
uint128 held128 = _getHoldAmount(policyID, account).toUint128();
uint128 fundsAvailable = committedData.committed - held128; // Initially just unheld committed balance
uint128 newSharesCommitted; // Cumulative shares committed through the `_increaseTopUpSpend()` calls
// If account's committed balance is insufficient, try make up the shortfall from other sources in this order:
// 1) Uncommitting balance
// 2) Uncommitted balance, if top-up is enabled
// First, try take from uncommitting balance
if (fundsAvailable < shares + committedData.minCommitted) {
// Load account's uncommitting data
UncommittingData memory uncommittingData = s_uncommittingData[policyID][account];
// Take the shortfall from uncommitting, up to a max of the account's total uncommitting balance
uint128 takenFromUncommitting =
uint128(Math.min(shares + committedData.minCommitted - fundsAvailable, uncommittingData.uncommitting));
// Decrease account's uncommitting balance
uncommittingData.uncommitting -= takenFromUncommitting;
// Increase account's policy-specific committed balance
committedData.committed += takenFromUncommitting;
// Increase account's total committed balance
balance.committed += takenFromUncommitting;
// Increase the total committed supply by the amount taken from uncommitting
newSharesCommitted = takenFromUncommitting;
// Persist uncommitting data to storage
s_uncommittingData[policyID][account] = uncommittingData;
// Update fundsAvailable after moving funds from uncommitting to committed above
fundsAvailable = committedData.committed - held128;
// TODO add new event here to indicate flow of funds from uncommitting back to committed
}
// Second, if fundsAvailable is still insufficient, try top-up from uncommitted balance
if (fundsAvailable < shares + committedData.minCommitted) {
uint128 committedShortfall = shares + committedData.minCommitted - fundsAvailable;
// NOTE: will attempt to top up to user's minCommitted level in addition to any shortfall top-up
newSharesCommitted += _tryTopUp(balance, committedData, policyID, account, committedShortfall);
// Update fundsAvailable again after top-up
fundsAvailable = committedData.committed - held128;
// NOTE: No additional Commit/Transfer events needed here as the `_tryTopUp()` call above emits them.
}
// If fundsAvailable is still insufficient after attempting to draw from uncommitting and uncommitted via
// top-up, revert with InsufficientFunds error
require(
fundsAvailable >= shares,
InsufficientFunds(
committedData.committed, s_uncommittingData[policyID][account].uncommitting, held128, shares
)
);
// Safe to do unchecked subtractions due to early revert above if underflow would occur
unchecked {
// Decrease account's committed balance (in the policy and total balances)
committedData.committed -= shares;
balance.committed -= shares;
}
// Persist Balance changes to storage before early return - not modified again in this function.
s_balances[account] = balance;
// No new shares committed from uncommitting or top-up, and no change to committedTotalSupply --> return early
if (newSharesCommitted == 0 && out == Delivery.Committed) return;
// Finally, make the net changes to totalSupply and committedTotalSupply
Supply memory supply = s_supply;
if (out == Delivery.Committed) {
// CASE: Committed shMON -> Committed shMON
// --> No change to totalSupply (as no shMON burnt).
// --> No decrease to committedTotalSupply (as it stays in committed form), but there is an increase due to
// either
// taken from uncommitting or uncommitted via top-up.
supply.committedTotal += newSharesCommitted;
} else if (out == Delivery.Uncommitted) {
// CASE: Committed shMON -> Uncommitted shMON
// --> No change to totalSupply (as no shMON burnt).
// --> Decrease committedTotalSupply by `shares` being spent.
// --> Potentially increase committedTotalSupply either taken from uncommitting or uncommitted via top-up.
// NOTE: Cannot assume shares > committedSupplyIncrease, due to potential top-up to minCommitted level
// First increase supply.committedTotal by any newly-committed shares
supply.committedTotal += newSharesCommitted;
// Then decrease supply.committedTotal by the shares being spent
supply.committedTotal -= shares;
} else {
// CASE: Committed shMON -> Underlying MON
// (i.e. if out == Delivery.Underlying)
// --> Decrease totalSupply by `shares` being spent (shMON burnt).
// --> Decrease committedTotalSupply by `shares` being spent.
// --> Potentially increase committedTotalSupply either taken from uncommitting or uncommitted via top-up.
// NOTE: Cannot assume shares > committedSupplyIncrease, due to potential top-up to minCommitted level
// First increase supply.committedTotal by any newly-committed shares
supply.committedTotal += newSharesCommitted;
// Then decrease supply.committedTotal by the shares being spent
supply.committedTotal -= shares;
// Finally, decrease supply.total (uncommitted) by shares which will be burnt for underlying
supply.total -= shares;
// TODO add event to indicate that committed shMON was instantly uncommitted + completed + withdrawn
}
// Persist supply changes to storage
s_supply = supply;
// NOTE: CommittedData changes must be persisted to storage separately.
}
// Returns the amount of new shares committed via top-up. Possible values are between 0 and the requested shortfall,
// clamped by both the account's remaining top-up allowance and uncommitted balance.
function _tryTopUp(
Balance memory balance,
CommittedData memory committedData,
uint64 policyID,
address account,
uint128 sharesRequested
)
internal
returns (uint128)
{
TopUpData memory topUpData = s_topUpData[policyID][account];
TopUpSettings memory topUpSettings = s_topUpSettings[policyID][account];
uint128 sharesCommitted; // Will be set to the shMON amount taken from uncommitted balance and committed here
// If in new top-up period, reset period vars
if (block.number > topUpData.topUpPeriodStartBlock + topUpSettings.topUpPeriodDuration) {
topUpData.totalPeriodTopUps = 0;
topUpData.topUpPeriodStartBlock = uint48(block.number);
}
// Determine how much headroom remains in the current top-up period
uint128 remainingTopUpAllowance;
if (topUpSettings.maxTopUpPerPeriod > topUpData.totalPeriodTopUps) {
remainingTopUpAllowance = topUpSettings.maxTopUpPerPeriod - topUpData.totalPeriodTopUps;
} else {
return 0;
}
// Clamp the next top-up by both remaining allowance and the user's uncommitted balance
uint128 capacity = Math.min(balance.uncommitted, remainingTopUpAllowance).toUint128();
if (capacity == 0) return 0;
// Never commit more than the shortfall requested by the caller
sharesCommitted = Math.min(sharesRequested, capacity).toUint128();
unchecked {
// Changes to account's memory structs.
committedData.committed += sharesCommitted;
topUpData.totalPeriodTopUps += sharesCommitted;
// Decrease account's uncommitted balance
balance.uncommitted -= sharesCommitted;
// Increase account's total committed balance
balance.committed += sharesCommitted;
}
// Persist topUpData changes to storage
s_topUpData[policyID][account] = topUpData;
// Commit event indicates the total flow of funds from uncommitted --> committed here
emit Commit(policyID, account, sharesCommitted);
// For frontends: we track commits/uncommits as transfers to/from this ShMonad contract
emit Transfer(account, address(this), sharesCommitted);
// committedTotalSupply has increased by `sharesCommitted`. This change to the storage value must be made
// separately
// to minimize gas useage.
return sharesCommitted;
}
/**
* @dev Adds a policy agent to the specified policy
* @param policyID The ID of the policy
* @param agent The address of the agent to add
* @dev Implementation details:
* 1. Checks that the address is not already an agent for the policy
* 2. Sets the mapping flag and adds to the agents array
*/
function _addPolicyAgent(uint64 policyID, address agent) internal {
require(!_isPolicyAgent(policyID, agent), PolicyAgentAlreadyExists(policyID, agent));
s_isPolicyAgent[policyID][agent] = true; // Set agent to true in isPolicyAgent mapping
s_policyAgents[policyID].push(agent); // Add agent to policyAgents array
}
/**
* @dev Removes a policy agent from the specified policy
* @param policyID The ID of the policy
* @param agent The address of the agent to remove
* @dev Implementation details:
* 1. Ensures the policy still has at least one agent after removal
* 2. Verifies the address is currently an agent
* 3. Sets the mapping flag to false and removes from the agents array
* 4. Replaces the removed agent with the last agent in the array and pops the array
*/
function _removePolicyAgent(uint64 policyID, address agent) internal {
uint256 agentCount = s_policyAgents[policyID].length;
require(agentCount > 1, PolicyNeedsAtLeastOneAgent(policyID));
require(_isPolicyAgent(policyID, agent), PolicyAgentNotFound(policyID, agent));
// Set agent to false in isPolicyAgent mapping
s_isPolicyAgent[policyID][agent] = false;
// Remove agent from policyAgents array
for (uint256 i = 0; i < agentCount; ++i) {
if (s_policyAgents[policyID][i] == agent) {
s_policyAgents[policyID][i] = s_policyAgents[policyID][agentCount - 1];
s_policyAgents[policyID].pop();
break;
}
}
// Remove as primary, if applicable
if (agent == s_policies[policyID].primaryAgent && s_policyAgents[policyID].length != 0) {
s_policies[policyID].primaryAgent = s_policyAgents[policyID][0];
}
}
/**
* @dev Reverts if policy is not active
* @param policyID The ID of the policy to check
*/
function _onlyActivePolicy(uint64 policyID) internal view {
require(s_policies[policyID].active, PolicyInactive(policyID));
}
// --------------------------------------------- //
// Modifiers //
// --------------------------------------------- //
/**
* @dev Modifier that reverts if the policy is not active
* @param policyID The ID of the policy to check
*/
modifier onlyActivePolicy(uint64 policyID) {
_onlyActivePolicy(policyID);
_;
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
// 3 types of mutually exclusive shMON balances:
// - Uncommitted: shMON that can be transferred freely.
// - Committed: shMON that is committed to a Policy and has not yet started uncommitting.
// - Uncommitting: shMON that is in the process of uncommitting from a Policy.
// NOTE: we do not track an account's total uncommitting balance.
// Would need to add array of policies active per account to calc total uncommitting balance.
struct Balance {
uint128 uncommitted; // Account's uncommitted shMON balance
uint128 committed; // Account's committed shMON balance across all policies
}
struct Supply {
uint128 total;
uint128 committedTotal;
}
struct CommittedData {
uint128 committed; // Account's committed amount in the current Policy (excl. uncommitting)
uint128 minCommitted; // Account's minimum committed amount in the current Policy
}
struct UncommittingData {
uint128 uncommitting; // Account's uncommitting amount in the current Policy
uint48 uncommitStartBlock; // Block at which account last started uncommitting
uint80 placeholder; // Placeholder for future use
}
struct TopUpData {
uint128 totalPeriodTopUps; // Sum of all top-ups in the current top-up period
uint48 topUpPeriodStartBlock; // block.number of start of last top-up period
uint80 placeholder; // Placeholder for future use
}
struct TopUpSettings {
uint128 maxTopUpPerPeriod; // Max uncommitted shMON allowed per top-up of committed
uint32 topUpPeriodDuration; // Duration of the top-up period, in blocks
uint96 placeholder; // Placeholder for future use
}
struct Policy {
uint48 escrowDuration; // Uncommitting period of the Policy
bool active; // Whether the Policy is active or not
address primaryAgent; // Most frequently-calling agent (for gas efficiency)
}
// For HoldsLib - never used in storage
struct PolicyAccount {
uint64 policyID;
address account;
}
struct UncommitApproval {
address completor; // Account allowed to `completeUncommit()` on user's behalf
uint96 shares; // Max shares where uncommit can be completed on user's behalf
}
enum Delivery {
Committed,
Uncommitted,
Underlying
}
// ================================================== //
// CapitalAllocator Types //
// ================================================== //
// Lightweight view snapshot assembled from validator epoch/reward trackers.
struct ValidatorStats {
bool isActive;
address coinbase;
uint64 lastEpoch;
uint128 targetStakeAmount;
uint128 rewardsPayableLast;
uint128 earnedRevenueLast;
uint128 rewardsPayableCurrent;
uint128 earnedRevenueCurrent;
}
// UnstakeRequest at the User <> ShMonad level
struct UserUnstakeRequest {
uint128 amountMon; // Amount in MON being unstaked
uint64 completionEpoch; // Epoch when the unstake request is able to be completed
}
// ================================================== //
// StakeTracker Types //
// ================================================== //
struct Epoch {
uint64 epoch;
uint8 withdrawalId;
bool hasWithdrawal;
bool hasDeposit;
bool crankedInBoundaryPeriod;
bool wasCranked; // refers to the placeholder validator if global, or the validator if specific
bool frozen;
bool closed;
uint128 targetStakeAmount;
}
struct RevenueSmoother {
uint120 earnedRevenueLast;
uint64 epochChangeBlockNumber;
}
struct ValidatorDataStorage {
uint64 epoch;
uint64 id;
bool isActive;
bool inActiveSet_Current;
bool inActiveSet_Last;
}
struct ValidatorData {
uint64 epoch;
uint64 id;
bool isPlaceholder;
bool isActive;
bool inActiveSet_Current;
bool inActiveSet_Last;
address coinbase;
}
struct AdminValues {
uint64 internalEpoch;
uint16 targetLiquidityPercentage;
uint16 incentiveAlignmentPercentage;
uint16 stakingCommission;
uint16 boostCommissionRate; // measured in basis points
uint128 totalZeroYieldPayable; // liability, total zero-yield tranche funds, incl owner commission
}
struct FeeParams {
uint128 mRay; // slope rate (RAY)
uint128 cRay; // y-intercept/base fee rate (RAY)
}
struct CashFlows {
uint120 queueToStake; // MON units,
uint120 queueForUnstake; // MON units
bool alwaysTrue; // Avoids storing a zero slot to save gas on future writes
}
struct AtomicCapital {
uint128 allocatedAmount;
uint128 distributedAmount;
}
struct StakingEscrow {
uint120 pendingStaking; // MON units
uint120 pendingUnstaking; // MON units
bool alwaysTrue; // Avoids storing a zero slot to save gas on future writes
}
struct Revenue {
uint120 allocatedRevenue; // MON units used to offset the atomic unstaking pool
uint120 earnedRevenue; // MON units retained by protocol
bool alwaysTrue; // Avoids storing a zero slot to save gas on future writes
}
struct PendingBoost {
uint120 rewardsPayable; // MON units earmarked for validator payouts
uint120 earnedRevenue; // MON units retained by protocol
bool alwaysTrue; // Avoids storing a zero slot to save gas on future writes
}
struct WorkingCapital {
uint128 stakedAmount;
uint128 reservedAmount; // portion reserved for validator payments or withdrawals
}
struct CurrentLiabilities {
uint128 rewardsPayable; // to validators
uint128 redemptionsPayable; // illiquid
}
enum CashFlowType {
Goodwill, // The null value
Deposit,
Revenue,
AllocationReduction
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
IMonadStaking constant STAKING = IMonadStaking(0x0000000000000000000000000000000000001000);
// NOTE: These constants exist internally in the precompile but are NOT exposed as view functions.
// Only constants used in production code are defined here. Test-only constants remain in MockMonadStakingPrecompile.
uint256 constant DUST_THRESHOLD = 1e9; // Minimum stake amount (1 gwei)
uint256 constant WITHDRAWAL_DELAY = 1; // Epochs
address constant NATIVE_TOKEN = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
address constant OWNER_COMMISSION_ACCOUNT = address(0x1111111111111111111111111111111111111111);
// Deterministic deployment salt namespace for Coinbase contracts
uint256 constant COINBASE_PROCESS_GAS_LIMIT = 100_000;
bytes32 constant COINBASE_SALT = keccak256("SHMONAD_COINBASE");
uint256 constant TRANSFER_GAS_LIMIT = 50_000; // gas headroom for multisig recipient support
// Monad staking precompile gas guidance (docs.monad.xyz) + adjustable buffer for mocks/in-flight gas bumps
uint256 constant STAKING_GAS_BUFFER = 10_000;
uint256 constant STAKING_GAS_CLAIM_REWARDS = 155_375;
uint256 constant STAKING_GAS_EXTERNAL_REWARD = 62_300;
uint256 constant STAKING_GAS_DELEGATE = 260_850;
uint256 constant STAKING_GAS_UNDELEGATE = 147_750;
uint256 constant STAKING_GAS_WITHDRAW = 68_675;
uint256 constant STAKING_GAS_GET_WITHDRAWAL_REQUEST = 24_300;
uint256 constant STAKING_GAS_GET_DELEGATOR = 184_900;
uint256 constant STAKING_GAS_GET_VALIDATOR = 97_200;
uint256 constant STAKING_GAS_PROPOSER_VAL_ID = 100;
// EIP-1967 admin slot: bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)
bytes32 constant EIP1967_ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
// NOTE: Top-up period duration is compared against `block.number` in policy logic and is measured in blocks.
// Set to ~1 day on Monad (0.4s blocks): 24*60*60 / 0.4 = 216_000 blocks.
uint32 constant MIN_TOP_UP_PERIOD_BLOCKS = 216_000;
bytes32 constant PERMIT_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
uint256 constant ZERO = 0;
uint16 constant BPS_SCALE = 10_000; // Still used for percentage weights/targets outside fee curve math
uint256 constant MIN_VALIDATOR_DEPOSIT = 1e18; // Min amount to do a validator deposit
uint256 constant STAKE_ITERATION_MIN_GAS = 100_000; // Min gas for 1 stake iteration in loop
uint88 constant UNSTAKE_BLOCK_DELAY = 1_209_600; // 7 days if block time is 0.5 seconds
uint256 constant SLASHING_FREEZE_THRESHOLD = 7e16; // 7% of total equity, out of SCALE
uint256 constant ATOMIC_MIN_FEE_WEI = 1e9; // 1 gwei floor for atomic paths
uint256 constant EPOCHS_TRACKED = 8; // Must be a power of 2
uint256 constant MONAD_EPOCH_LENGTH = 50_000; // Measured in blocks
uint256 constant MONAD_EPOCH_DELAY_PERIOD = 5000; // Measured in blocks
uint256 constant MIN_FREE_WITHDRAW_IDS = 8; // Min free withdraw IDs to keep available per validator
uint256 constant SHMONAD_VALIDATOR_DEACTIVATION_PERIOD = 7; // How long it takes to cycle out an inactive validator
uint256 constant SCALE = 1e18; // 100%
uint256 constant TARGET_FLOAT = 2e16; // 2%
uint256 constant FLOAT_REBALANCE_SENSITIVITY = 1e14; // 1bp
uint256 constant FLOAT_PLACEHOLDER = 1;
uint64 constant UNKNOWN_VAL_ID = type(uint64).max - 1;
address constant UNKNOWN_VAL_ADDRESS = address(uint160(type(uint160).max - 1));
// ID-based sentinels for validator crank linked list
uint64 constant FIRST_VAL_ID = 1_111_111_111_111_111_111; // 1.111e18 sentinel (fits in uint64)
uint64 constant LAST_VAL_ID = 9_999_999_999_999_999_999; // 9.999e18 sentinel (fits in uint64)
uint256 constant UINT120_MASK = type(uint120).max;
// feeLib constant
uint256 constant RAY = 1e27;
// Default affine fee curve parameters (Ray precision)
// Fee curve: r(u) = m*u + c with
// - c = 8% / 1600 = 1/20000 = 0.005%
// - m chosen so r(1) = 1% + c => m = 1%
// Therefore: at u = 0 => 0.005%; at u = 1 => 1.005%
uint128 constant DEFAULT_SLOPE_RATE_RAY = uint128(RAY / 100); // m = 1.00%
uint128 constant DEFAULT_Y_INTERCEPT_RAY = uint128(RAY / 20_000); // c = 0.005%//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { IERC4626Custom } from "./IERC4626Custom.sol";
import { IERC20Full } from "./IERC20Full.sol";
import { IMonadStaking } from "./IMonadStaking.sol";
import { Policy, UncommitApproval, ValidatorStats } from "../Types.sol";
/**
* @title IShMonad - Interface for the ShMonad Liquid Staking Token contract
* @notice Canonical NatSpec lives on the concrete mixins; this interface captures every external/public entrypoint.
*/
interface IShMonad is IERC4626Custom, IERC20Full {
// --------------------------------------------- //
// Initialization & Supply Views //
// --------------------------------------------- //
function initialize(address deployer) external;
function realTotalSupply() external view returns (uint256);
function committedTotalSupply() external view returns (uint256);
// --------------------------------------------- //
// Yield & Detailed ERC4626 Previews //
// --------------------------------------------- //
function boostYield(address yieldOriginator) external payable;
function boostYield(uint256 shares, address from, address yieldOriginator) external;
function sendValidatorRewards(uint64 validatorId, uint256 feeRate) external payable;
function previewRedeemDetailed(uint256 shares)
external
view
returns (uint256 grossAssets, uint256 feeAssets, uint256 netAssets);
function previewWithdrawDetailed(uint256 netAssets)
external
view
returns (uint256 shares, uint256 grossAssets, uint256 feeAssets);
function previewUnstake(uint256 shares) external view returns (uint256 assets);
// --------------------------------------------- //
// Account & Commitment Flow //
// --------------------------------------------- //
function commit(uint64 policyID, address commitRecipient, uint256 shares) external;
function depositAndCommit(
uint64 policyID,
address commitRecipient,
uint256 shMonToCommit
)
external
payable
returns (uint256 sharesMinted);
function requestUncommit(
uint64 policyID,
uint256 shares,
uint256 newMinBalance
)
external
returns (uint256 uncommitCompleteBlock);
function requestUncommitWithApprovedCompletor(
uint64 policyID,
uint256 shares,
uint256 newMinBalance,
address completor
)
external
returns (uint256 uncommitCompleteBlock);
function completeUncommit(uint64 policyID, uint256 shares) external;
function completeUncommitAndRedeem(uint64 policyID, uint256 shares) external returns (uint256 assets);
function completeUncommitAndRecommit(
uint64 fromPolicyID,
uint64 toPolicyID,
address commitRecipient,
uint256 shares
)
external;
function completeUncommitWithApproval(uint64 policyID, uint256 shares, address account) external;
function setUncommitApproval(uint64 policyID, address completor, uint256 shares) external;
// --------------------------------------------- //
// Unstake Lifecycle //
// --------------------------------------------- //
function requestUnstake(uint256 shares) external returns (uint64 completionEpoch);
function completeUnstake() external;
function getUnstakeRequest(address account) external view returns (uint128 amountMon, uint64 completionEpoch);
// --------------------------------------------- //
// Agent & Hold Operations //
// --------------------------------------------- //
function hold(uint64 policyID, address account, uint256 shares) external;
function release(uint64 policyID, address account, uint256 shares) external;
function batchHold(uint64 policyID, address[] calldata accounts, uint256[] memory amounts) external;
function batchRelease(uint64 policyID, address[] calldata accounts, uint256[] calldata amounts) external;
function agentTransferFromCommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool inUnderlying
)
external;
function agentTransferToUncommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool inUnderlying
)
external;
function agentWithdrawFromCommitted(
uint64 policyID,
address from,
address to,
uint256 amount,
uint256 fromReleaseAmount,
bool amountSpecifiedInUnderlying
)
external;
function getHoldAmount(uint64 policyID, address account) external view returns (uint256);
// --------------------------------------------- //
// Top-Up Settings & Balance Views //
// --------------------------------------------- //
function setMinCommittedBalance(
uint64 policyID,
uint128 minCommitted,
uint128 maxTopUpPerPeriod,
uint32 topUpPeriodDuration
)
external;
function getTopUpSettings(
uint64 policyID,
address account
)
external
view
returns (uint128 maxTopUpPerPeriod, uint32 topUpPeriodDuration);
function getCommittedData(
uint64 policyID,
address account
)
external
view
returns (uint128 committed, uint128 minCommitted);
function getUncommittingData(
uint64 policyID,
address account
)
external
view
returns (uint128 uncommitting, uint48 uncommitStartBlock);
function policyBalanceAvailable(
uint64 policyID,
address account,
bool inUnderlying
)
external
view
returns (uint256 balanceAvailable);
function topUpAvailable(
uint64 policyID,
address account,
bool inUnderlying
)
external
view
returns (uint256 amountAvailable);
function getUncommitApproval(
uint64 policyID,
address account
)
external
view
returns (UncommitApproval memory approval);
function uncommittingCompleteBlock(uint64 policyID, address account) external view returns (uint256);
function balanceOfCommitted(address account) external view returns (uint256);
function balanceOfCommitted(uint64 policyID, address account) external view returns (uint256);
function balanceOfUncommitting(uint64 policyID, address account) external view returns (uint256);
// --------------------------------------------- //
// Policy Management //
// --------------------------------------------- //
function createPolicy(uint48 escrowDuration) external returns (uint64 policyID);
function addPolicyAgent(uint64 policyID, address agent) external;
function removePolicyAgent(uint64 policyID, address agent) external;
function disablePolicy(uint64 policyID) external;
function policyCount() external view returns (uint64);
function getPolicy(uint64 policyID) external view returns (Policy memory);
function isPolicyAgent(uint64 policyID, address agent) external view returns (bool);
function getPolicyAgents(uint64 policyID) external view returns (address[] memory);
// --------------------------------------------- //
// Atomic Unstake Pool Management //
// --------------------------------------------- //
function setPoolTargetLiquidityPercentage(uint256 newPercentageScaled) external;
function setUnstakeFeeCurve(uint256 newSlopeRateRay, uint256 newYInterceptRay) external;
function yInterceptRay() external view returns (uint256);
function slopeRateRay() external view returns (uint256);
function getCurrentLiquidity() external view returns (uint256);
function getTargetLiquidity() external view returns (uint256);
function getPendingTargetLiquidity() external view returns (uint256);
function getAtomicPoolUtilization()
external
view
returns (uint256 utilized, uint256 allocated, uint256 available, uint256 utilizationWad);
function getFeeCurveParams() external view returns (uint256 slopeRateRayOut, uint256 yInterceptRayOut);
function getAtomicUtilizationWad() external view returns (uint256 utilizationWad);
function getCurrentUnstakeFeeRateRay() external view returns (uint256 feeRateRay);
// --------------------------------------------- //
// Global Accounting & Cranking //
// --------------------------------------------- //
function crank() external returns (bool complete);
function isGlobalCrankAvailable() external returns (bool);
function isValidatorCrankAvailable(uint64 validatorId) external view returns (bool);
function getWorkingCapital() external view returns (uint128 stakedAmount, uint128 reservedAmount);
function getAtomicCapital() external view returns (uint128 allocatedAmount, uint128 distributedAmount);
function getGlobalPending() external view returns (uint120 pendingStaking, uint120 pendingUnstaking);
function getGlobalCashFlows(int256 epochPointer)
external
view
returns (uint120 queueToStake, uint120 queueForUnstake);
function getGlobalRevenue(int256 epochPointer)
external
view
returns (uint120 rewardsPayable, uint120 earnedRevenue);
function getGlobalEpoch(int256 epochPointer)
external
view
returns (
uint64 epoch,
uint8 withdrawalId,
bool hasWithdrawal,
bool hasDeposit,
bool crankedInBoundaryPeriod,
bool wasCranked,
bool frozen,
bool closed,
uint128 targetStakeAmount
);
function getInternalEpoch() external view returns (uint64);
function getGlobalStatus(int256 epochPointer) external view returns (bool frozen, bool closed);
function getScaledTargetLiquidityPercentage() external view returns (uint256);
function getGlobalAmountAvailableToUnstake() external view returns (uint256 amount);
function getCurrentAssets() external view returns (uint256);
function globalLiabilities()
external
view
returns (uint128 rewardsPayable, uint128 redemptionsPayable, uint128 commissionPayable);
function getAdminValues()
external
view
returns (
uint64 internalEpoch,
uint16 targetLiquidityPercentage,
uint16 incentiveAlignmentPercentage,
uint16 stakingCommission,
uint16 boostCommissionRate,
uint128 commissionPayable
);
function STAKING_PRECOMPILE() external pure returns (IMonadStaking);
// --------------------------------------------- //
// Validator Administration //
// --------------------------------------------- //
function deactivateValidator(uint64 validatorId) external;
function addValidator(uint64 validatorId, address coinbase) external;
function addValidator(uint64 validatorId) external returns (address coinbase);
function updateStakingCommission(uint16 feeInBps) external;
function updateBoostCommission(uint16 feeInBps) external;
function updateIncentiveAlignmentPercentage(uint16 percentageInBps) external;
function setFrozenStatus(bool isFrozen) external;
function setClosedStatus(bool isClosed) external;
function claimOwnerCommissionAsShares(uint256 assets, address receiver) external returns (uint256 sharesMinted);
// --------------------------------------------- //
// Validator Views //
// --------------------------------------------- //
function previewCoinbaseAddress(uint64 validatorId) external view returns (address predicted);
function getValidatorStats(uint64 validatorId) external view returns (ValidatorStats memory stats);
function isValidatorActive(uint64 validatorId) external view returns (bool);
function getEpochInfo() external returns (uint256 epochNumber, uint256 epochStartBlock);
function getValidatorCoinbase(uint256 validatorId) external view returns (address);
function getValidatorIdForCoinbase(address coinbase) external view returns (uint256);
function getValidatorData(uint64 validatorId)
external
view
returns (
uint64 epoch,
uint64 id,
bool isPlaceholder,
bool isActive,
bool inActiveSet_Current,
bool inActiveSet_Last,
address coinbase
);
function listActiveValidators() external view returns (uint64[] memory validatorIds, address[] memory coinbases);
function getValidatorEpochs(uint64 validatorId)
external
view
returns (uint64 lastEpoch, uint128 lastTargetStakeAmount, uint64 currentEpoch, uint128 currentTargetStakeAmount);
function getValidatorPendingEscrow(uint64 validatorId)
external
view
returns (
uint120 lastPendingStaking,
uint120 lastPendingUnstaking,
uint120 currentPendingStaking,
uint120 currentPendingUnstaking
);
function getValidatorRewards(uint64 validatorId)
external
view
returns (
uint120 lastRewardsPayable,
uint120 lastEarnedRevenue,
uint120 currentRewardsPayable,
uint120 currentEarnedRevenue
);
function getValidatorNeighbors(uint64 validatorId) external view returns (address previous, address next);
function getActiveValidatorCount() external view returns (uint256);
function getNextValidatorToCrank() external view returns (address);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import {
PendingBoost,
CashFlows,
WorkingCapital,
StakingEscrow,
AtomicCapital,
CurrentLiabilities,
AdminValues
} from "../Types.sol";
import { SCALE } from "../Constants.sol";
/*
ShMonad Accounting 101:
Double-Entry Bookkeeping means that every ledger change must be consist of two journal entries: a DEBIT and a CREDIT.
RULE: for a single entry, DEBIT = CREDIT
RULE: for all entries, sum of DEBITs = sum of CREDITs
Ledgers fall into one of three types: ASSETS, EQUITY, LIABILITIES
RULE: DEBIT (dr) entries cause ASSETS to *increase*, but EQUITY and LIABILITIES to *decrease*
RULE: CREDIT (cr) entries cause ASSETS to *decrease*, but EQUITY and LIABILITIES to *increase*
And the most important rule of all:
RULE: ASSETS = EQUITY + LIABILITIES
Sometimes, ShMonad uses a CONTRA ASSET ledger to help track the correct balance in an ASSET
RULE: ASSET = UNADJUSTED ASSET - CONTRA ASSET
RULE: CREDIT entries cause CONTRA ASSETS to *increase*, DEBIT entries cause CONTRA ASSETS to *decrease*.
NOTE: the ASSET "totalAllocated" is considered an UNADJUSTED ASSET and is offset by the "totalUtilized" CONTRA ASSET.
Enforcing these rules at all times ensures balances are tracked properly and *verifiable*.
These are the ledger balances that ShMonad tracks:
ASSETS:
- totalStaked: includes active stake, pending staking, and pending unstaking
- totalAllocated: (MON) the maximum MON allocated as liquidity for the atomic unstaking pool (UNADJUSTED)
- totalCurrent: (MON) unassigned MON that will be assigned on the next crank
- totalReserved: (MON) reserved, liquid MON intended to pay out to validators or to shMON redeemers
CONTRA ASSETS:
- totalUtilized: (-MON) the amount of totalAllocated that has already been paid out to atomic unstakers
LIABILITIES:
- rewardsPayable: MEV payments owed to validators that are escrowed temporarily by ShMonad
- redemptionsPayable: withdrawals owed to those who have burned their shMON but not yet collected their MON.
- totalZeroYieldPayable: the amount of MON that is held in the zero-yield tranche, includes owner commission.
NOTE: ShMonad does not directly track EQUITY (the total MON attributable to holders of shMON shares). Instead, we
calculate EQUITY via the following equation:
RULE: EQUITY = ASSETS - CONTRA ASSETS - LIABILITIES
Regarding the timing:
- shMON shares are minted on deposit / mint and ASSETS are increased at the same time.
- shMON shares are burned at 'beginUnstake' rather than 'completeUnstake', but the ASSETS (either staked or
unstaked) owed to the redeemer are held in the contract until the redemption is completed. To handle this,
we add the future withdrawal amount to the redemptionsPayable liability.
Reconciling accounting principles with the values visible on-chain is not always easy. We must make special
accomodations in order to handle the native MON balance of a smart contract. Because there are only three
assets that are denominated in liquid MON, we know the following is always true for the ShMonad contract:
RULE: MON balance = totalAllocated + totalCurrent + totalReserved
Therefore,
RULE: totalCurrent = MON balance - totalAllocated - totalReserved
The totalCurrent balance is tracked indirectly by starting with the MON balance and then subtracting out
the other two ASSETs that show in in the MON balance. This means that actions that increase ShMonad's
MON balance but that don't also increase either totalAllocated or totalReserved are therefore increasing
the totalCurrent balance.
NOTE: This means that the code will often not explicitly handle increases (debits) or decreases (credits)
intended for totalCurrent because the change to ShMonad's MON balance is already accounting for it. To
improve readability, many parts of the code that implicitly increase or decrease the totalCurrent ledger
have commented-out code for the totalCurrent entry placed directly above or below the offsetting entry.
The "totalReserved" ASSET is intended to reserve (and thereby prevent from getting put into the staking queue) MON
intended to pay off the LIABILITIES. One of the LIABILITIES, "rewardsPayable," is always collected as MON and
therefore *currently* does not need to go through the unstaking process. The other of the LIABILITIES,
"redemptionsPayable", may have had some of its balance finish unstaking as MON but it's very likely that not all
of the amounts intended for redemptions has completed the unstaking / waiting process yet:
RULE: redemptionsPayable = redemptionsPayable(MON) + redemptionsPayable(staked / unstaking)
This leads to the following deduction:
RULE: redemptionsPayable(MON) = totalReserved - rewardsPayable
ShMonad also tracks other values. The two most in-tune with the accounting system are "queueToStake" and
"queueForUnstake". These values are NOT accounting values:
- "queueToStake" helps allocate portions of totalCurrent to be staked with the correct validator (or
the atomic unstaking pool), at which point that amount becomes credited from totalCurrent and debited
to either totalStaked or totalAllocated.
- "queueForUnstake" helps allocate portions of totalStaked to be unstaked from the correct validator
(or the atomic unstaking pool), at which point that amount becomes credited from totalStaked and
debited to totalReserved or totalCurrent.
NOTE: To make sure the "queueForUnstake" funds don't get reinserted into the staking cycle, when MON funds are received
during the completion of the unstaking process they are debited to totalReserved if totalReserved is less than
rewardsPayable+redemptionsPayable and debited to totalCurrent otherwise.
ERC-4626 is a vault standard and interface used by many apps. As such, ShMonad is ERC-4626-compliant.
ERC-4626 has a function called "totalAssets()", the purpose of which is to show how much MON is owned by
the holders of shMON. Unfortunately, the team that designed ERC-4626 is unfamiliar with accounting terminology,
because the value returned by their funcction "totalAssets()" matches the exact description of EQUITY.
ShMonad is constantly earning revenue and increasing the amount of MON available to holders of shMON. To
prevent dilution attacks ("JIT Liquidity") in which a large amount of revenue is going to be earned and
so new attackers mint new shMON in order to gain exposure to this revenue (thereby diluting the existing
holders), the ERC-4626 "totalAssets()" function returns a different value for depositors than for
redeemers.
NOTE: Remember that ERC-4626's totalAssets() is improperly named in the context of accounting.
RULE: When calculating the shMON / MON rate for depositors:
ERC-4626's totalAssets() = totalEquity
NOTE: This is a higher rate that lowers the shMON per MON deposited.
RULE: When calculating the shMON / MON rate for withdrawals:
ERC-4626's totalAssets() = totalEquity - recentRevenue
NOTE: This is a lower rate that lowers the MON per shMON withdrawn.
*/
library AccountingLib {
/// @dev Saturating subtraction: returns a - b if a > b, else 0.
function _saturatingSub(uint256 a, uint256 b) private pure returns (uint256) {
return a > b ? a - b : 0;
}
function currentLiabilities(CurrentLiabilities memory liabilities) internal pure returns (uint256) {
return liabilities.redemptionsPayable + liabilities.rewardsPayable;
}
function totalLiabilities(
CurrentLiabilities memory liabilities,
AdminValues memory admin
)
internal
pure
returns (uint256)
{
return liabilities.redemptionsPayable + liabilities.rewardsPayable + admin.totalZeroYieldPayable;
}
// Free-floating MON that isn't staked (illiquid), reserved for liability settlement, or allocated to atomic
// unstaking.
function currentAssets(
WorkingCapital memory workingCapital,
AtomicCapital memory atomicCapital,
uint256 nativeTokenBalance
)
internal
pure
returns (uint256)
{
uint256 _atomicAssets = atomicAssets(atomicCapital);
uint256 _reservedAssets = workingCapital.reservedAmount;
return _saturatingSub(nativeTokenBalance, _atomicAssets + _reservedAssets);
}
// Assets available for atomic unstaking
// NOTE: This is unadjusted by earnedRevenue and is meant to be used when calculating liquidity,
// not when calculating the atomic unstaking fee
function atomicAssets(AtomicCapital memory atomicCapital) internal pure returns (uint256) {
uint256 _totalAllocated = atomicCapital.allocatedAmount;
uint256 _totalDistributed = atomicCapital.distributedAmount;
return _saturatingSub(_totalAllocated, _totalDistributed);
}
/*
// Long form to show the full reasoning
function totalEquity(WorkingCapital memory workingCapital, AtomicCapital memory atomicCapital, AdminValues memory
admin, uint256
nativeTokenBalance) internal pure returns (uint256) {
// Contra Assets
uint256 _totalDistributed = uint256(atomicCapital.distributedAmount); // cancels out: -B
// Assets
uint256 _totalStaked = uint256(workingCapital.stakedAmount);
uint256 _totalAllocated = uint256(atomicCapital.allocatedAmount); // cancels out: +A
uint256 _totalReserved = uint256(workingCapital.reservedAmount); // cancels out: +C
uint256 _totalCurrent = nativeTokenBalance - _totalReserved - _totalAllocated + _totalDistributed; // cancels out:
+_, -C, -A, +B,
// Liabilities
uint256 _redemptionsPayable = uint256(liabilities.redemptionsPayable);
uint256 _rewardsPayable = uint256(liabilities.rewardsPayable);
uint256 _totalZeroYieldPayable = uint256(admin.totalZeroYieldPayable);
return _totalStaked + _totalAllocated + _totalReserved + _totalCurrent - _totalDistributed - _redemptionsPayable -
_rewardsPayable - _totalZeroYieldPayable;
the equation:
totalEquity = _totalStaked + _totalAllocated + _totalReserved + _totalCurrent - _totalDistributed -
_redemptionsPayable - _rewardsPayable - _totalZeroYieldPayable;
can replace _totalCurrent with its unsimplified form and expand into:
totalEquity = _totalStaked + _totalAllocated + _totalReserved + nativeTokenBalance - _totalReserved -
_totalAllocated + _totalDistributed - _totalDistributed - _redemptionsPayable - _rewardsPayable -
_totalZeroYieldPayable;
which simplifies down to:
totalEquity = _totalStaked + nativeTokenBalance - _totalLiabilities;
}
*/
/// @notice Total MON attributable to shMON holders (ERC-4626 totalAssets).
/// @dev In this system, ERC-4626 "totalAssets" corresponds to equity, not on-balance-sheet assets.
/// Excludes pending redemptions and rewards payable; includes native balance and staked.
/// shMON burns occur at beginUnstake, so redemptions remain as liabilities until paid.
/// Rewards are escrowed briefly before distribution, so they remain liabilities until paid.
/// @param workingCapital Current working capital snapshot (staked + reserved).
/// @param liabilities Current liabilities (redemptions, rewards).
/// @param admin Admin values containing totalZeroYieldPayable.
/// @param nativeTokenBalance `address(this).balance` passed in by caller.
/// @return equity The computed equity value.
function totalEquity(
WorkingCapital memory workingCapital,
CurrentLiabilities memory liabilities,
AdminValues memory admin,
uint256 nativeTokenBalance
)
internal
pure
returns (uint256 equity)
{
uint256 _totalStaked = workingCapital.stakedAmount;
return _totalStaked + nativeTokenBalance - totalLiabilities(liabilities, admin);
}
function maximumNewGlobalRedemptionAmount(
WorkingCapital memory globalCapital,
CurrentLiabilities memory liabilities,
AdminValues memory admin,
StakingEscrow memory globalPending,
uint256 nativeTokenBalance
)
internal
pure
returns (uint256)
{
// We should not add amounts to the unstakingQueue that are in excess of what is unstakable.
// NOTE The atomic liquidity is technically available, but takes an epoch to have its target amount lowered
// thereby releasing the allocated capital to be available for non-atomic redemptions. Withdrawals that
// would use that liquidity pull it by increasing the contrasset amountUtilized when necessary.
uint256 _illiquidAmount = globalPending.pendingStaking;
uint256 _equity = totalEquity(globalCapital, liabilities, admin, nativeTokenBalance);
return _saturatingSub(_equity, _illiquidAmount);
}
// MON balance that is "unpurposed"
function goodwill(
WorkingCapital memory workingCapital,
AtomicCapital memory atomicCapital,
CashFlows memory globalCashFlows_T0,
uint256 nativeTokenBalance
)
internal
pure
returns (uint256)
{
uint256 _currentAssets = currentAssets(workingCapital, atomicCapital, nativeTokenBalance);
uint256 _currentStakingQueue = globalCashFlows_T0.queueToStake;
return _saturatingSub(_currentAssets, _currentStakingQueue);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
pragma solidity ^0.8.20;
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { StakeTracker } from "./StakeTracker.sol";
import { FeeParams, AtomicCapital } from "./Types.sol";
import {
RAY,
DEFAULT_Y_INTERCEPT_RAY,
DEFAULT_SLOPE_RATE_RAY,
FLOAT_PLACEHOLDER,
SCALE,
ATOMIC_MIN_FEE_WEI
} from "./Constants.sol";
import { FeeLib } from "./libraries/FeeLib.sol";
/// @notice See `FeeLib` for the detailed affine-in-utilization fee derivation and solver docs.
abstract contract AtomicUnstakePool is StakeTracker {
using SafeTransferLib for address;
using SafeCastLib for uint256;
using Math for uint256;
using FeeLib for uint256;
function __AtomicUnstakePool_init() internal {
FeeParams memory _feeParams = s_feeParams;
if (_feeParams.mRay == 0 && _feeParams.cRay == 0) {
// Initialize to default fee curve if not already set
_feeParams = FeeParams({ mRay: DEFAULT_SLOPE_RATE_RAY, cRay: DEFAULT_Y_INTERCEPT_RAY });
s_feeParams = _feeParams;
emit FeeCurveUpdated(0, 0, _feeParams.mRay, _feeParams.cRay);
}
}
// ================================================== //
// Parameter Management //
// ================================================== //
// Fees are always enabled. To disable fees, set the fee curve to (0, 0)
// via `setUnstakeFeeCurve(0, 0)`.
function setPoolTargetLiquidityPercentage(uint256 newPercentageScaled) public virtual onlyOwner {
require(newPercentageScaled <= SCALE, TargetLiquidityCannotExceed100Percent());
// Pending target liquidity percentages are tracked in 1e18-scaled units.
s_pendingTargetAtomicLiquidityPercent = newPercentageScaled;
}
/// @notice Update fee curve parameters.
/// @dev The fee curve is defined as y = mx + c, where:
/// - y is the fee rate in RAY (1e27)
/// - m is the slopeRateRay (RAY at u=1)
/// - c is the yInterceptRay (intercept/base fee in RAY)
/// - x is the pool utilization
/// @param newSlopeRateRay slope a (RAY at u=1)
/// @param newYInterceptRay intercept/base fee (RAY)
function setUnstakeFeeCurve(uint256 newSlopeRateRay, uint256 newYInterceptRay) external onlyOwner {
require(newYInterceptRay <= RAY, YInterceptExceedsRay());
require(newSlopeRateRay <= RAY, SlopeRateExceedsRay());
require(newYInterceptRay + newSlopeRateRay <= RAY, FeeCurveFullUtilizationExceedsRay());
FeeParams memory _oldParams = s_feeParams;
s_feeParams = FeeParams({ mRay: uint128(newSlopeRateRay), cRay: uint128(newYInterceptRay) });
emit FeeCurveUpdated(_oldParams.mRay, _oldParams.cRay, s_feeParams.mRay, s_feeParams.cRay);
}
// ================================================== //
// View Functions //
// ================================================== //
function yInterceptRay() public view returns (uint256) {
return uint256(s_feeParams.cRay);
}
function slopeRateRay() public view returns (uint256) {
return uint256(s_feeParams.mRay);
}
function getCurrentLiquidity() external view returns (uint256) {
(uint256 _currentAvailableAmount, uint256 _totalAllocatedAmount) = _getLiquidityForAtomicUnstaking();
// No allocation implies no withdrawable liquidity even if idle balance exists.
if (_totalAllocatedAmount == 0) return 0;
return _currentAvailableAmount;
}
function getTargetLiquidity() external view returns (uint256) {
return _getTargetLiquidity();
}
function getPendingTargetLiquidity() external view returns (uint256) {
uint256 _targetLiquidity = _getTargetLiquidity();
uint256 _newScaledTargetPercent = s_pendingTargetAtomicLiquidityPercent;
if (_newScaledTargetPercent == FLOAT_PLACEHOLDER) {
return _targetLiquidity;
} else {
uint256 _oldScaledTargetPercent = _scaledTargetLiquidityPercentage();
if (_oldScaledTargetPercent == 0) return 0;
return _targetLiquidity * _newScaledTargetPercent / _oldScaledTargetPercent;
}
}
function getFeeCurveParams() external view returns (uint256 slopeRateRayOut, uint256 yInterceptRayOut) {
slopeRateRayOut = s_feeParams.mRay;
yInterceptRayOut = s_feeParams.cRay;
}
/// @notice Current atomic pool utilization in 1e18 scale (0 to 1e18).
/// @return utilizationWad Utilization scaled by 1e18
function getAtomicUtilizationWad() external view returns (uint256 utilizationWad) {
(uint256 available, uint256 allocated) = _getLiquidityForAtomicUnstaking();
if (allocated == 0) return 0;
uint256 frac = available * SCALE / allocated; // available / allocated in 1e18
utilizationWad = frac >= SCALE ? 0 : (SCALE - frac);
}
/// @notice Current marginal unstake fee rate (RAY) under y = min(c + m*u, c + m).
/// @return feeRateRay Fee rate in RAY (1e27)
function getCurrentUnstakeFeeRateRay() external view returns (uint256 feeRateRay) {
(uint256 available, uint256 allocated) = _getLiquidityForAtomicUnstaking();
if (allocated == 0) return uint256(s_feeParams.cRay) + uint256(s_feeParams.mRay); // capped full utilization
uint256 frac = available * SCALE / allocated;
uint256 u = frac >= SCALE ? 0 : (SCALE - frac); // utilization in 1e18
uint256 c = uint256(s_feeParams.cRay);
uint256 m = uint256(s_feeParams.mRay);
uint256 y = c + (m * u) / SCALE;
uint256 yMax = c + m;
feeRateRay = Math.min(yMax, y);
}
/// @notice Detailed atomic pool state and utilization in one call.
/// @return utilized Amount utilized (distributed) adjusted for smoothing
/// @return allocated Total allocated (target) for atomic pool
/// @return available Currently available liquidity
/// @return utilizationWad Utilization scaled to 1e18
function getAtomicPoolUtilization()
external
view
returns (uint256 utilized, uint256 allocated, uint256 available, uint256 utilizationWad)
{
(available, allocated) = _getLiquidityForAtomicUnstaking();
utilized = allocated - available;
if (allocated == 0) return (0, 0, 0, 0);
uint256 frac = available * SCALE / allocated;
utilizationWad = frac >= SCALE ? 0 : (SCALE - frac);
}
// ================================================== //
// Fee Math Functions //
// ================================================== //
// Forward (runtime): compute net from a gross budget; if that net exceeds liquidity R0,
// recompute at a NET cap (cap applies to what actually leaves the pool).
function _getGrossCappedAndFeeFromGrossAssets(uint256 grossRequested)
internal
view
override
returns (uint256 grossCapped, uint256 feeAssets)
{
if (grossRequested == 0) return (0, 0);
(uint256 R0, uint256 L) = _getLiquidityForAtomicUnstaking();
// First, calculate the net given gross (ignoring available liquidity)
uint256 netOut;
(feeAssets, netOut) =
FeeLib.solveNetGivenGrossWithMinFee(grossRequested, R0, L, s_feeParams, ATOMIC_MIN_FEE_WEI);
// If that net exceeds current liquidity, clamp by net and recalculate gross + fee exactly.
if (netOut > R0) {
(grossCapped, feeAssets) = FeeLib.solveGrossGivenNetWithMinFee(R0, R0, L, s_feeParams, ATOMIC_MIN_FEE_WEI);
return (grossCapped, feeAssets); // implied net = R0 (since grossCapped - feeAssets == R0)
}
// Otherwise we can spend the full grossRequested.
return (grossRequested, feeAssets);
}
// Forward (for previewRedeem): no liquidity clamp; uses net-path forward solver.
// L==0 flat-max behavior is handled inside the library.
function _quoteFeeFromGrossAssetsNoLiquidityLimit(uint256 grossRequested)
internal
view
override
returns (uint256 feeAssets)
{
if (grossRequested == 0) return 0;
(uint256 R0, uint256 L) = _getLiquidityForAtomicUnstaking();
(feeAssets,) = FeeLib.solveNetGivenGrossWithMinFee(grossRequested, R0, L, s_feeParams, ATOMIC_MIN_FEE_WEI);
}
// Inverse (runtime): liquidity cap applies to net (the amount that actually leaves the pool), not gross.
function _getGrossAndFeeFromNetAssets(uint256 netAssets)
internal
view
returns (uint256 grossAssets, uint256 feeAssets)
{
(uint256 R0, uint256 L) = _getLiquidityForAtomicUnstaking();
if (netAssets == 0) return (0, 0);
// NOTE: This function is only called by `agentWithdrawFromCommitted()`, and should revert if the specified
// netAssets amount cannot be fulfilled given the current liquidity available.
require(netAssets <= R0, InsufficientPoolLiquidity(netAssets, R0));
(grossAssets, feeAssets) =
FeeLib.solveGrossGivenNetWithMinFee(netAssets, R0, L, s_feeParams, ATOMIC_MIN_FEE_WEI);
}
// Inverse (for previewWithdraw): no liquidity limit; L==0 fallback handled in library.
function _quoteGrossAndFeeFromNetAssetsNoLiquidityLimit(uint256 targetNet)
internal
view
override
returns (uint256 gross, uint256 fee)
{
if (targetNet == 0) return (0, 0);
(uint256 R0, uint256 L) = _getLiquidityForAtomicUnstaking();
(gross, fee) = FeeLib.solveGrossGivenNetWithMinFee(targetNet, R0, L, s_feeParams, ATOMIC_MIN_FEE_WEI);
}
// ================================================== //
// Internal Accounting Helpers //
// ================================================== //
function _getTargetLiquidity() internal view returns (uint128 targetLiquidity) {
// Calculate target liquidity as a percentage of total assets
targetLiquidity = s_atomicAssets.allocatedAmount;
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
struct ValidatorView {
address authAddress;
uint64 flags;
uint256 executionStake;
uint256 executionAccumulator;
uint256 executionCommission;
uint256 executionUnclaimedRewards;
uint256 consensusStake;
uint256 consensusCommission;
uint256 snapshotStake;
uint256 snapshotCommission;
bytes secpPubkey;
bytes blsPubkey;
}
struct DelInfo {
uint256 stake;
uint256 lastAccumulator;
uint256 rewards;
uint256 deltaStake;
uint256 nextDeltaStake;
uint64 deltaEpoch;
uint64 nextDeltaEpoch;
}
struct WithdrawalRequest {
uint256 amount;
uint256 accumulator;
uint64 epoch;
}
interface IMonadStaking {
function addValidator(
bytes calldata payload,
bytes calldata signedSecpMessage,
bytes calldata signedBlsMessage
)
external
payable
returns (uint64 validatorId);
function delegate(uint64 validatorId) external payable returns (bool success);
function undelegate(uint64 validatorId, uint256 amount, uint8 withdrawId) external returns (bool success);
function compound(uint64 validatorId) external returns (bool success);
function withdraw(uint64 validatorId, uint8 withdrawId) external returns (bool success);
function claimRewards(uint64 validatorId) external returns (bool success);
function changeCommission(uint64 validatorId, uint256 commission) external returns (bool success);
function externalReward(uint64 validatorId) external payable returns (bool success);
function getValidator(uint64 validatorId)
external
returns (
address authAddress,
uint64 flags,
uint256 stake,
uint256 accRewardPerToken,
uint256 commission,
uint256 unclaimedRewards,
uint256 consensusStake,
uint256 consensusCommission,
uint256 snapshotStake,
uint256 snapshotCommission,
bytes memory secpPubkey,
bytes memory blsPubkey
);
function getDelegator(
uint64 validatorId,
address delegator
)
external
returns (
uint256 stake,
uint256 accRewardPerToken,
uint256 unclaimedRewards,
uint256 deltaStake,
uint256 nextDeltaStake,
uint64 deltaEpoch,
uint64 nextDeltaEpoch
);
function getWithdrawalRequest(
uint64 validatorId,
address delegator,
uint8 withdrawId
)
external
returns (uint256 withdrawalAmount, uint256 accRewardPerToken, uint64 withdrawEpoch);
function getConsensusValidatorSet(uint32 startIndex)
external
returns (bool isDone, uint32 nextIndex, uint64[] memory valIds);
function getSnapshotValidatorSet(uint32 startIndex)
external
returns (bool isDone, uint32 nextIndex, uint64[] memory valIds);
function getExecutionValidatorSet(uint32 startIndex)
external
returns (bool isDone, uint32 nextIndex, uint64[] memory valIds);
function getDelegations(
address delegator,
uint64 startValId
)
external
returns (bool isDone, uint64 nextValId, uint64[] memory valIds);
function getDelegators(
uint64 validatorId,
address startDelegator
)
external
returns (bool isDone, address nextDelegator, address[] memory delegators);
function getEpoch() external returns (uint64 epoch, bool inEpochDelayPeriod);
/// @notice Returns the validator ID of the current block proposer/author for this block
/// @dev Temporary method name used by ShMonad to avoid relying on block.coinbase; mocked in tests
function getProposerValId() external returns (uint64 val_id);
function syscallOnEpochChange(uint64 epoch) external;
function syscallReward(address blockAuthor) external;
function syscallSnapshot() external;
// ================================ //
// Constants //
// ================================ //
// NOTE: The precompile has these constants internally but does NOT expose them as view functions.
// Production code uses DUST_THRESHOLD and WITHDRAWAL_DELAY from Constants.sol.
// Test code uses all constants from MockMonadStakingPrecompile.sol:
// - MON = 1e18
// - MIN_VALIDATE_STAKE = 100_000 * 1e18
// - ACTIVE_VALIDATOR_STAKE = 25_000_000 * 1e18
// - UNIT_BIAS = 1e36
// - DUST_THRESHOLD = 1e9 (used in production)
// - MAX_EXTERNAL_REWARD = 1e25
// - WITHDRAWAL_DELAY = 1 (used in production)
// - PAGINATED_RESULTS_SIZE = 100
event ValidatorCreated(uint64 indexed validatorId, address indexed authAddress);
event ValidatorStatusChanged(uint64 indexed validatorId, address indexed authAddress, uint64 flags);
event Delegate(uint64 indexed validatorId, address indexed delegator, uint256 amount, uint64 activationEpoch);
event Undelegate(
uint64 indexed validatorId, address indexed delegator, uint8 withdrawId, uint256 amount, uint64 activationEpoch
);
event Withdraw(
uint64 indexed validatorId, address indexed delegator, uint8 withdrawId, uint256 amount, uint64 withdrawEpoch
);
event ClaimRewards(uint256 indexed validatorId, address indexed delegator, uint256 amount);
event CommissionChanged(uint256 indexed validatorId, uint256 oldCommission, uint256 newCommission);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/**
* @dev Based on the interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. With some modifications.
*
* @dev Excludes IERC20 and IERC20Metadata interfaces, which are already included in IERC20Full.
*/
interface IERC4626Custom {
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares
);
/**
* @dev Attempted to deposit more assets than the max amount for `receiver`.
*/
error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max);
/**
* @dev Attempted to mint more shares than the max amount for `receiver`.
*/
error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max);
/**
* @dev Attempted to withdraw more assets than the max amount for `receiver`.
*/
error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max);
/**
* @dev Attempted to redeem more shares than the max amount for `receiver`.
*/
error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max);
/**
* @dev Exceeds the slippage set by user in the non-standard withdrawWithSlippageProtection function.
*/
error ERC4626WithdrawSlippageExceeded(address owner, uint256 sharesRequired, uint256 maxBurntShares);
/**
* @dev Exceeds the slippage set by user in the non-standard redeemWithSlippageProtection function.
*/
error ERC4626RedeemSlippageExceeded(address owner, uint256 netAssets, uint256 minNetAssets);
/**
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
*
* - MUST be an ERC-20 token contract.
* - MUST NOT revert.
*/
function asset() external view returns (address assetTokenAddress);
/**
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
*
* - SHOULD include any compounding that occurs from yield.
* - MUST be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT revert.
*/
function totalAssets() external view returns (uint256 totalManagedAssets);
/**
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToShares(uint256 assets) external view returns (uint256 shares);
/**
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToAssets(uint256 shares) external view returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
* through a deposit call.
*
* - MUST return a limited value if receiver is subject to some deposit limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
* - MUST NOT revert.
*/
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
* in the same transaction.
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewDeposit(uint256 assets) external view returns (uint256 shares);
/**
* @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* deposit execution, and are accounted for during deposit.
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: No pre-approval required, but native tokens (of `assets` amount) must be sent as msg.value.
*/
function deposit(uint256 assets, address receiver) external payable returns (uint256 shares);
/**
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
* - MUST return a limited value if receiver is subject to some mint limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
* - MUST NOT revert.
*/
function maxMint(address receiver) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
* same transaction.
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
* would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by minting.
*/
function previewMint(uint256 shares) external view returns (uint256 assets);
/**
* @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
* execution, and are accounted for during mint.
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: No pre-approval required, but native tokens (of `assets` amount) must be sent as msg.value.
*/
function mint(uint256 shares, address receiver) external payable returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
* Vault, through a withdraw call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
* called
* in the same transaction.
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* withdraw execution, and are accounted for during withdraw.
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver with slippage protection.
* @param assets The amount of assets to withdraw.
* @param receiver The address to receive the assets.
* @param owner The address of the owner of the shares.
* @param maxBurntShares The maximum amount of shares that can be burnt.
* @return shares The amount of shares withdrawn.
*/
function withdrawWithSlippageProtection(
uint256 assets,
address receiver,
address owner,
uint256 maxBurntShares
)
external
returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
* through a redeem call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxRedeem(address owner) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
* same transaction.
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
* redemption would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by redeeming.
*/
function previewRedeem(uint256 shares) external view returns (uint256 assets);
/**
* @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* redeem execution, and are accounted for during redeem.
* - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets);
/**
* @dev Burns shares from owner and sends assets of underlying tokens to receiver with slippage protection.
* @param shares The amount of shares to redeem.
* @param receiver The address to receive the assets.
* @param owner The address of the owner of the shares.
* @param minAmountOut The minimum amount of assets that must be received.
* @return assets The amount of assets redeemed.
*/
function redeemWithSlippageProtection(
uint256 shares,
address receiver,
address owner,
uint256 minAmountOut
)
external
returns (uint256 assets);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import { IERC20Errors } from "@openzeppelin/contracts/interfaces/draft-IERC6093.sol";
/// @dev Aggregation of OpenZeppelin's interfaces required for an ERC20 token with permit.
interface IERC20Full is IERC20, IERC20Metadata, IERC20Errors, IERC20Permit {
/**
* @dev Permit deadline has expired.
*/
error ERC2612ExpiredSignature(uint256 deadline);
/**
* @dev Mismatched signature.
*/
error ERC2612InvalidSigner(address signer, address owner);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Safe integer casting library that reverts on overflow.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeCastLib.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)
/// @dev Optimized for runtime gas for very high number of optimizer runs (i.e. >= 1000000).
library SafeCastLib {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Unable to cast to the target type due to overflow.
error Overflow();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* UNSIGNED INTEGER SAFE CASTING OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Casts `x` to a uint8. Reverts on overflow.
function toUint8(uint256 x) internal pure returns (uint8) {
if (x >= 1 << 8) _revertOverflow();
return uint8(x);
}
/// @dev Casts `x` to a uint16. Reverts on overflow.
function toUint16(uint256 x) internal pure returns (uint16) {
if (x >= 1 << 16) _revertOverflow();
return uint16(x);
}
/// @dev Casts `x` to a uint24. Reverts on overflow.
function toUint24(uint256 x) internal pure returns (uint24) {
if (x >= 1 << 24) _revertOverflow();
return uint24(x);
}
/// @dev Casts `x` to a uint32. Reverts on overflow.
function toUint32(uint256 x) internal pure returns (uint32) {
if (x >= 1 << 32) _revertOverflow();
return uint32(x);
}
/// @dev Casts `x` to a uint40. Reverts on overflow.
function toUint40(uint256 x) internal pure returns (uint40) {
if (x >= 1 << 40) _revertOverflow();
return uint40(x);
}
/// @dev Casts `x` to a uint48. Reverts on overflow.
function toUint48(uint256 x) internal pure returns (uint48) {
if (x >= 1 << 48) _revertOverflow();
return uint48(x);
}
/// @dev Casts `x` to a uint56. Reverts on overflow.
function toUint56(uint256 x) internal pure returns (uint56) {
if (x >= 1 << 56) _revertOverflow();
return uint56(x);
}
/// @dev Casts `x` to a uint64. Reverts on overflow.
function toUint64(uint256 x) internal pure returns (uint64) {
if (x >= 1 << 64) _revertOverflow();
return uint64(x);
}
/// @dev Casts `x` to a uint72. Reverts on overflow.
function toUint72(uint256 x) internal pure returns (uint72) {
if (x >= 1 << 72) _revertOverflow();
return uint72(x);
}
/// @dev Casts `x` to a uint80. Reverts on overflow.
function toUint80(uint256 x) internal pure returns (uint80) {
if (x >= 1 << 80) _revertOverflow();
return uint80(x);
}
/// @dev Casts `x` to a uint88. Reverts on overflow.
function toUint88(uint256 x) internal pure returns (uint88) {
if (x >= 1 << 88) _revertOverflow();
return uint88(x);
}
/// @dev Casts `x` to a uint96. Reverts on overflow.
function toUint96(uint256 x) internal pure returns (uint96) {
if (x >= 1 << 96) _revertOverflow();
return uint96(x);
}
/// @dev Casts `x` to a uint104. Reverts on overflow.
function toUint104(uint256 x) internal pure returns (uint104) {
if (x >= 1 << 104) _revertOverflow();
return uint104(x);
}
/// @dev Casts `x` to a uint112. Reverts on overflow.
function toUint112(uint256 x) internal pure returns (uint112) {
if (x >= 1 << 112) _revertOverflow();
return uint112(x);
}
/// @dev Casts `x` to a uint120. Reverts on overflow.
function toUint120(uint256 x) internal pure returns (uint120) {
if (x >= 1 << 120) _revertOverflow();
return uint120(x);
}
/// @dev Casts `x` to a uint128. Reverts on overflow.
function toUint128(uint256 x) internal pure returns (uint128) {
if (x >= 1 << 128) _revertOverflow();
return uint128(x);
}
/// @dev Casts `x` to a uint136. Reverts on overflow.
function toUint136(uint256 x) internal pure returns (uint136) {
if (x >= 1 << 136) _revertOverflow();
return uint136(x);
}
/// @dev Casts `x` to a uint144. Reverts on overflow.
function toUint144(uint256 x) internal pure returns (uint144) {
if (x >= 1 << 144) _revertOverflow();
return uint144(x);
}
/// @dev Casts `x` to a uint152. Reverts on overflow.
function toUint152(uint256 x) internal pure returns (uint152) {
if (x >= 1 << 152) _revertOverflow();
return uint152(x);
}
/// @dev Casts `x` to a uint160. Reverts on overflow.
function toUint160(uint256 x) internal pure returns (uint160) {
if (x >= 1 << 160) _revertOverflow();
return uint160(x);
}
/// @dev Casts `x` to a uint168. Reverts on overflow.
function toUint168(uint256 x) internal pure returns (uint168) {
if (x >= 1 << 168) _revertOverflow();
return uint168(x);
}
/// @dev Casts `x` to a uint176. Reverts on overflow.
function toUint176(uint256 x) internal pure returns (uint176) {
if (x >= 1 << 176) _revertOverflow();
return uint176(x);
}
/// @dev Casts `x` to a uint184. Reverts on overflow.
function toUint184(uint256 x) internal pure returns (uint184) {
if (x >= 1 << 184) _revertOverflow();
return uint184(x);
}
/// @dev Casts `x` to a uint192. Reverts on overflow.
function toUint192(uint256 x) internal pure returns (uint192) {
if (x >= 1 << 192) _revertOverflow();
return uint192(x);
}
/// @dev Casts `x` to a uint200. Reverts on overflow.
function toUint200(uint256 x) internal pure returns (uint200) {
if (x >= 1 << 200) _revertOverflow();
return uint200(x);
}
/// @dev Casts `x` to a uint208. Reverts on overflow.
function toUint208(uint256 x) internal pure returns (uint208) {
if (x >= 1 << 208) _revertOverflow();
return uint208(x);
}
/// @dev Casts `x` to a uint216. Reverts on overflow.
function toUint216(uint256 x) internal pure returns (uint216) {
if (x >= 1 << 216) _revertOverflow();
return uint216(x);
}
/// @dev Casts `x` to a uint224. Reverts on overflow.
function toUint224(uint256 x) internal pure returns (uint224) {
if (x >= 1 << 224) _revertOverflow();
return uint224(x);
}
/// @dev Casts `x` to a uint232. Reverts on overflow.
function toUint232(uint256 x) internal pure returns (uint232) {
if (x >= 1 << 232) _revertOverflow();
return uint232(x);
}
/// @dev Casts `x` to a uint240. Reverts on overflow.
function toUint240(uint256 x) internal pure returns (uint240) {
if (x >= 1 << 240) _revertOverflow();
return uint240(x);
}
/// @dev Casts `x` to a uint248. Reverts on overflow.
function toUint248(uint256 x) internal pure returns (uint248) {
if (x >= 1 << 248) _revertOverflow();
return uint248(x);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* SIGNED INTEGER SAFE CASTING OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Casts `x` to a int8. Reverts on overflow.
function toInt8(int256 x) internal pure returns (int8) {
unchecked {
if (((1 << 7) + uint256(x)) >> 8 == uint256(0)) return int8(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int16. Reverts on overflow.
function toInt16(int256 x) internal pure returns (int16) {
unchecked {
if (((1 << 15) + uint256(x)) >> 16 == uint256(0)) return int16(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int24. Reverts on overflow.
function toInt24(int256 x) internal pure returns (int24) {
unchecked {
if (((1 << 23) + uint256(x)) >> 24 == uint256(0)) return int24(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int32. Reverts on overflow.
function toInt32(int256 x) internal pure returns (int32) {
unchecked {
if (((1 << 31) + uint256(x)) >> 32 == uint256(0)) return int32(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int40. Reverts on overflow.
function toInt40(int256 x) internal pure returns (int40) {
unchecked {
if (((1 << 39) + uint256(x)) >> 40 == uint256(0)) return int40(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int48. Reverts on overflow.
function toInt48(int256 x) internal pure returns (int48) {
unchecked {
if (((1 << 47) + uint256(x)) >> 48 == uint256(0)) return int48(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int56. Reverts on overflow.
function toInt56(int256 x) internal pure returns (int56) {
unchecked {
if (((1 << 55) + uint256(x)) >> 56 == uint256(0)) return int56(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int64. Reverts on overflow.
function toInt64(int256 x) internal pure returns (int64) {
unchecked {
if (((1 << 63) + uint256(x)) >> 64 == uint256(0)) return int64(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int72. Reverts on overflow.
function toInt72(int256 x) internal pure returns (int72) {
unchecked {
if (((1 << 71) + uint256(x)) >> 72 == uint256(0)) return int72(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int80. Reverts on overflow.
function toInt80(int256 x) internal pure returns (int80) {
unchecked {
if (((1 << 79) + uint256(x)) >> 80 == uint256(0)) return int80(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int88. Reverts on overflow.
function toInt88(int256 x) internal pure returns (int88) {
unchecked {
if (((1 << 87) + uint256(x)) >> 88 == uint256(0)) return int88(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int96. Reverts on overflow.
function toInt96(int256 x) internal pure returns (int96) {
unchecked {
if (((1 << 95) + uint256(x)) >> 96 == uint256(0)) return int96(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int104. Reverts on overflow.
function toInt104(int256 x) internal pure returns (int104) {
unchecked {
if (((1 << 103) + uint256(x)) >> 104 == uint256(0)) return int104(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int112. Reverts on overflow.
function toInt112(int256 x) internal pure returns (int112) {
unchecked {
if (((1 << 111) + uint256(x)) >> 112 == uint256(0)) return int112(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int120. Reverts on overflow.
function toInt120(int256 x) internal pure returns (int120) {
unchecked {
if (((1 << 119) + uint256(x)) >> 120 == uint256(0)) return int120(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int128. Reverts on overflow.
function toInt128(int256 x) internal pure returns (int128) {
unchecked {
if (((1 << 127) + uint256(x)) >> 128 == uint256(0)) return int128(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int136. Reverts on overflow.
function toInt136(int256 x) internal pure returns (int136) {
unchecked {
if (((1 << 135) + uint256(x)) >> 136 == uint256(0)) return int136(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int144. Reverts on overflow.
function toInt144(int256 x) internal pure returns (int144) {
unchecked {
if (((1 << 143) + uint256(x)) >> 144 == uint256(0)) return int144(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int152. Reverts on overflow.
function toInt152(int256 x) internal pure returns (int152) {
unchecked {
if (((1 << 151) + uint256(x)) >> 152 == uint256(0)) return int152(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int160. Reverts on overflow.
function toInt160(int256 x) internal pure returns (int160) {
unchecked {
if (((1 << 159) + uint256(x)) >> 160 == uint256(0)) return int160(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int168. Reverts on overflow.
function toInt168(int256 x) internal pure returns (int168) {
unchecked {
if (((1 << 167) + uint256(x)) >> 168 == uint256(0)) return int168(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int176. Reverts on overflow.
function toInt176(int256 x) internal pure returns (int176) {
unchecked {
if (((1 << 175) + uint256(x)) >> 176 == uint256(0)) return int176(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int184. Reverts on overflow.
function toInt184(int256 x) internal pure returns (int184) {
unchecked {
if (((1 << 183) + uint256(x)) >> 184 == uint256(0)) return int184(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int192. Reverts on overflow.
function toInt192(int256 x) internal pure returns (int192) {
unchecked {
if (((1 << 191) + uint256(x)) >> 192 == uint256(0)) return int192(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int200. Reverts on overflow.
function toInt200(int256 x) internal pure returns (int200) {
unchecked {
if (((1 << 199) + uint256(x)) >> 200 == uint256(0)) return int200(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int208. Reverts on overflow.
function toInt208(int256 x) internal pure returns (int208) {
unchecked {
if (((1 << 207) + uint256(x)) >> 208 == uint256(0)) return int208(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int216. Reverts on overflow.
function toInt216(int256 x) internal pure returns (int216) {
unchecked {
if (((1 << 215) + uint256(x)) >> 216 == uint256(0)) return int216(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int224. Reverts on overflow.
function toInt224(int256 x) internal pure returns (int224) {
unchecked {
if (((1 << 223) + uint256(x)) >> 224 == uint256(0)) return int224(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int232. Reverts on overflow.
function toInt232(int256 x) internal pure returns (int232) {
unchecked {
if (((1 << 231) + uint256(x)) >> 232 == uint256(0)) return int232(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int240. Reverts on overflow.
function toInt240(int256 x) internal pure returns (int240) {
unchecked {
if (((1 << 239) + uint256(x)) >> 240 == uint256(0)) return int240(x);
_revertOverflow();
}
}
/// @dev Casts `x` to a int248. Reverts on overflow.
function toInt248(int256 x) internal pure returns (int248) {
unchecked {
if (((1 << 247) + uint256(x)) >> 248 == uint256(0)) return int248(x);
_revertOverflow();
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* OTHER SAFE CASTING OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Casts `x` to a int8. Reverts on overflow.
function toInt8(uint256 x) internal pure returns (int8) {
if (x >= 1 << 7) _revertOverflow();
return int8(int256(x));
}
/// @dev Casts `x` to a int16. Reverts on overflow.
function toInt16(uint256 x) internal pure returns (int16) {
if (x >= 1 << 15) _revertOverflow();
return int16(int256(x));
}
/// @dev Casts `x` to a int24. Reverts on overflow.
function toInt24(uint256 x) internal pure returns (int24) {
if (x >= 1 << 23) _revertOverflow();
return int24(int256(x));
}
/// @dev Casts `x` to a int32. Reverts on overflow.
function toInt32(uint256 x) internal pure returns (int32) {
if (x >= 1 << 31) _revertOverflow();
return int32(int256(x));
}
/// @dev Casts `x` to a int40. Reverts on overflow.
function toInt40(uint256 x) internal pure returns (int40) {
if (x >= 1 << 39) _revertOverflow();
return int40(int256(x));
}
/// @dev Casts `x` to a int48. Reverts on overflow.
function toInt48(uint256 x) internal pure returns (int48) {
if (x >= 1 << 47) _revertOverflow();
return int48(int256(x));
}
/// @dev Casts `x` to a int56. Reverts on overflow.
function toInt56(uint256 x) internal pure returns (int56) {
if (x >= 1 << 55) _revertOverflow();
return int56(int256(x));
}
/// @dev Casts `x` to a int64. Reverts on overflow.
function toInt64(uint256 x) internal pure returns (int64) {
if (x >= 1 << 63) _revertOverflow();
return int64(int256(x));
}
/// @dev Casts `x` to a int72. Reverts on overflow.
function toInt72(uint256 x) internal pure returns (int72) {
if (x >= 1 << 71) _revertOverflow();
return int72(int256(x));
}
/// @dev Casts `x` to a int80. Reverts on overflow.
function toInt80(uint256 x) internal pure returns (int80) {
if (x >= 1 << 79) _revertOverflow();
return int80(int256(x));
}
/// @dev Casts `x` to a int88. Reverts on overflow.
function toInt88(uint256 x) internal pure returns (int88) {
if (x >= 1 << 87) _revertOverflow();
return int88(int256(x));
}
/// @dev Casts `x` to a int96. Reverts on overflow.
function toInt96(uint256 x) internal pure returns (int96) {
if (x >= 1 << 95) _revertOverflow();
return int96(int256(x));
}
/// @dev Casts `x` to a int104. Reverts on overflow.
function toInt104(uint256 x) internal pure returns (int104) {
if (x >= 1 << 103) _revertOverflow();
return int104(int256(x));
}
/// @dev Casts `x` to a int112. Reverts on overflow.
function toInt112(uint256 x) internal pure returns (int112) {
if (x >= 1 << 111) _revertOverflow();
return int112(int256(x));
}
/// @dev Casts `x` to a int120. Reverts on overflow.
function toInt120(uint256 x) internal pure returns (int120) {
if (x >= 1 << 119) _revertOverflow();
return int120(int256(x));
}
/// @dev Casts `x` to a int128. Reverts on overflow.
function toInt128(uint256 x) internal pure returns (int128) {
if (x >= 1 << 127) _revertOverflow();
return int128(int256(x));
}
/// @dev Casts `x` to a int136. Reverts on overflow.
function toInt136(uint256 x) internal pure returns (int136) {
if (x >= 1 << 135) _revertOverflow();
return int136(int256(x));
}
/// @dev Casts `x` to a int144. Reverts on overflow.
function toInt144(uint256 x) internal pure returns (int144) {
if (x >= 1 << 143) _revertOverflow();
return int144(int256(x));
}
/// @dev Casts `x` to a int152. Reverts on overflow.
function toInt152(uint256 x) internal pure returns (int152) {
if (x >= 1 << 151) _revertOverflow();
return int152(int256(x));
}
/// @dev Casts `x` to a int160. Reverts on overflow.
function toInt160(uint256 x) internal pure returns (int160) {
if (x >= 1 << 159) _revertOverflow();
return int160(int256(x));
}
/// @dev Casts `x` to a int168. Reverts on overflow.
function toInt168(uint256 x) internal pure returns (int168) {
if (x >= 1 << 167) _revertOverflow();
return int168(int256(x));
}
/// @dev Casts `x` to a int176. Reverts on overflow.
function toInt176(uint256 x) internal pure returns (int176) {
if (x >= 1 << 175) _revertOverflow();
return int176(int256(x));
}
/// @dev Casts `x` to a int184. Reverts on overflow.
function toInt184(uint256 x) internal pure returns (int184) {
if (x >= 1 << 183) _revertOverflow();
return int184(int256(x));
}
/// @dev Casts `x` to a int192. Reverts on overflow.
function toInt192(uint256 x) internal pure returns (int192) {
if (x >= 1 << 191) _revertOverflow();
return int192(int256(x));
}
/// @dev Casts `x` to a int200. Reverts on overflow.
function toInt200(uint256 x) internal pure returns (int200) {
if (x >= 1 << 199) _revertOverflow();
return int200(int256(x));
}
/// @dev Casts `x` to a int208. Reverts on overflow.
function toInt208(uint256 x) internal pure returns (int208) {
if (x >= 1 << 207) _revertOverflow();
return int208(int256(x));
}
/// @dev Casts `x` to a int216. Reverts on overflow.
function toInt216(uint256 x) internal pure returns (int216) {
if (x >= 1 << 215) _revertOverflow();
return int216(int256(x));
}
/// @dev Casts `x` to a int224. Reverts on overflow.
function toInt224(uint256 x) internal pure returns (int224) {
if (x >= 1 << 223) _revertOverflow();
return int224(int256(x));
}
/// @dev Casts `x` to a int232. Reverts on overflow.
function toInt232(uint256 x) internal pure returns (int232) {
if (x >= 1 << 231) _revertOverflow();
return int232(int256(x));
}
/// @dev Casts `x` to a int240. Reverts on overflow.
function toInt240(uint256 x) internal pure returns (int240) {
if (x >= 1 << 239) _revertOverflow();
return int240(int256(x));
}
/// @dev Casts `x` to a int248. Reverts on overflow.
function toInt248(uint256 x) internal pure returns (int248) {
if (x >= 1 << 247) _revertOverflow();
return int248(int256(x));
}
/// @dev Casts `x` to a int256. Reverts on overflow.
function toInt256(uint256 x) internal pure returns (int256) {
if (int256(x) >= 0) return int256(x);
_revertOverflow();
}
/// @dev Casts `x` to a uint256. Reverts on overflow.
function toUint256(int256 x) internal pure returns (uint256) {
if (x >= 0) return uint256(x);
_revertOverflow();
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PRIVATE HELPERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
function _revertOverflow() private pure {
/// @solidity memory-safe-assembly
assembly {
// Store the function selector of `Overflow()`.
mstore(0x00, 0x35278d12)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
import { ValidatorRegistry } from "./ValidatorRegistry.sol";
import {
Epoch,
PendingBoost,
CashFlows,
StakingEscrow,
AtomicCapital,
ValidatorData,
WorkingCapital,
CashFlowType,
CurrentLiabilities,
RevenueSmoother,
Revenue
} from "./Types.sol";
import { StakeAllocationLib } from "./libraries/StakeAllocationLib.sol";
import { StorageLib } from "./libraries/StorageLib.sol";
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
import { ICoinbase } from "./interfaces/ICoinbase.sol";
import {
MIN_VALIDATOR_DEPOSIT,
SCALE,
TARGET_FLOAT,
STAKING,
SHMONAD_VALIDATOR_DEACTIVATION_PERIOD,
FLOAT_PLACEHOLDER,
FLOAT_REBALANCE_SENSITIVITY,
BPS_SCALE,
EPOCHS_TRACKED,
UINT120_MASK,
DUST_THRESHOLD,
UNKNOWN_VAL_ID,
UNKNOWN_VAL_ADDRESS,
LAST_VAL_ID,
FIRST_VAL_ID,
SLASHING_FREEZE_THRESHOLD,
OWNER_COMMISSION_ACCOUNT,
COINBASE_PROCESS_GAS_LIMIT
} from "./Constants.sol";
import { AccountingLib } from "./libraries/AccountingLib.sol";
/// @notice Consolidated StakeTracker using Monad precompile epochs and a single crank() entrypoint.
/// @dev Removes legacy startNextEpoch()/queue/bitmap flows; relies on _crankGlobal + _crankActiveValidators.
abstract contract StakeTracker is ValidatorRegistry {
using SafeTransferLib for address;
using SafeCastLib for uint256;
using SafeCastLib for uint128;
using Math for uint256;
using AccountingLib for WorkingCapital;
using AccountingLib for AtomicCapital;
using AccountingLib for CurrentLiabilities;
using StorageLib for CashFlows;
using StorageLib for StakingEscrow;
using StorageLib for PendingBoost;
using StorageLib for Revenue;
// ================================================== //
// Init //
// ================================================== //
/// @notice Initializes the StakeTracker contract with initial state and validator setup
/// @dev Sets up the initial epoch structure, registers placeholder validators, and initializes global state
function __StakeTracker_init() internal {
if (globalEpochPtr_N(0).epoch != 0) return;
if (s_admin.internalEpoch == 0) {
// Register the "unregistered" validator placeholder
s_valLinkNext[FIRST_VAL_ID] = LAST_VAL_ID;
s_valLinkPrevious[LAST_VAL_ID] = FIRST_VAL_ID;
_addValidator(UNKNOWN_VAL_ID, UNKNOWN_VAL_ADDRESS);
s_nextValidatorToCrank = UNKNOWN_VAL_ID;
// Do not count the placeholder validator as an active validator
// for purposes of rolling stake / unstake queue forward
--s_activeValidatorCount;
s_validatorData[UNKNOWN_VAL_ID].inActiveSet_Last = true;
s_validatorData[UNKNOWN_VAL_ID].inActiveSet_Current = true;
// we initialize the epoch to 10 to avoid the first epoch being 0, which is not valid.
// internal, the epoch is independent of the monad epoch.
uint64 _currentEpoch = 10;
// Start s_admin off as the current monad epoch
// NOTE: They will diverge over time.
s_admin.internalEpoch = _currentEpoch;
globalEpochPtr_N(-2).epoch = _currentEpoch < 3 ? 0 : _currentEpoch - 3;
globalEpochPtr_N(-2).epoch = _currentEpoch < 2 ? 0 : _currentEpoch - 2;
globalEpochPtr_N(-1).epoch = _currentEpoch < 1 ? 0 : _currentEpoch - 1;
globalEpochPtr_N(0).epoch = _currentEpoch;
globalEpochPtr_N(1).epoch = _currentEpoch + 1;
globalEpochPtr_N(2).epoch = _currentEpoch + 2;
s_pendingTargetAtomicLiquidityPercent = TARGET_FLOAT;
for (int256 i; i < int256(EPOCHS_TRACKED); i++) {
globalRevenuePtr_N(i).alwaysTrue = true;
globalCashFlowsPtr_N(i).alwaysTrue = true;
}
uint256 _goodwill = s_globalCapital.goodwill(s_atomicAssets, globalCashFlowsPtr_N(0), address(this).balance);
// this is a hack to get the legacy balance into the system. We should remove this migration after the
// initial testnet upgrade.
if (_goodwill > 0) {
(bool _delegationsDone,, uint64[] memory _delegatedValidators) =
STAKING.getDelegations(address(this), 0);
if (!_delegationsDone) revert LegacyDelegationsPaginationIncomplete();
if (_delegatedValidators.length != 0) revert LegacyDelegationsDetected();
if (s_globalCapital.stakedAmount != 0 || s_globalCapital.reservedAmount != 0) {
revert LegacyStakeDetected();
}
if (
s_globalLiabilities.rewardsPayable != 0 || s_globalLiabilities.redemptionsPayable != 0
|| s_admin.totalZeroYieldPayable != 0
) {
revert LegacyLiabilitiesDetected();
}
if (s_atomicAssets.allocatedAmount != 0 || s_atomicAssets.distributedAmount != 0) {
revert LegacyAtomicStateDetected();
}
globalCashFlowsPtr_N(0).queueToStake += _goodwill.toUint120();
}
_crankGlobal();
_crankValidators();
}
}
// ================================================== //
// `receive()` Function //
// ================================================== //
/// @notice Handles incoming ETH payments and classifies them for proper accounting
/// @dev Processes received ETH and updates transient capital tracking for staking operations
receive() external payable {
(CashFlowType flowType, uint256 existingAmountIn, uint256 lastKnownBalance) = _getTransientCapital();
// Goodwill is the null type of CashFlowType
if (flowType == CashFlowType.Goodwill) {
// NOTE: must clear if contract does any payments in between receives.
if (address(this).balance >= lastKnownBalance + msg.value) {
globalCashFlowsPtr_N(0).queueToStake += msg.value.toUint120();
}
}
_setTransientCapital(flowType, existingAmountIn + msg.value);
}
// t_cashFlowClassifier pack layout (uint256):
// [255..128] lastKnownBalance
// [127..8] existingAmountIn (uint120)
// [7..0] flowType (CashFlowType as uint8)
/// @notice Retrieves current transient capital state for cash flow classification
/// @return flowType The type of cash flow currently being processed
/// @return existingAmountIn The amount already processed in the current flow
/// @return lastKnownBalance The last recorded contract balance
function _getTransientCapital()
internal
view
returns (CashFlowType flowType, uint256 existingAmountIn, uint256 lastKnownBalance)
{
uint256 _checkValue = t_cashFlowClassifier;
flowType = CashFlowType(uint8(_checkValue));
existingAmountIn = (_checkValue >> 8) & UINT120_MASK;
lastKnownBalance = _checkValue >> 128;
}
/// @notice Updates transient capital state with new flow type and amount
/// @param flowType The type of cash flow being processed
/// @param existingAmount The amount to set for the current flow
function _setTransientCapital(CashFlowType flowType, uint256 existingAmount) internal {
require(existingAmount <= type(uint120).max, WillOverflowOnBitshift());
uint256 _setValue = (address(this).balance << 128) | existingAmount << 8 | uint256(uint8(flowType));
t_cashFlowClassifier = _setValue;
}
/// @notice Clears transient capital state and resets cash flow classification
/// @dev This also deletes the last known balance - watch out!
function _clearTransientCapital() internal {
t_cashFlowClassifier = 0;
}
// ================================================== //
// Crank Entry Point //
// ================================================== //
/// @notice Single public entrypoint to advance global + per-validator state
/// Can be called by anyone, timing does not affect the outcome.
/// @dev Processes global epoch advancement and validator state updates
/// @return complete True if all cranking operations completed successfully
function crank() public notWhenFrozen returns (bool complete) {
complete = _crankGlobal();
if (!complete) {
complete = _crankValidators();
}
}
/// @notice Processes validator state updates for all validators
/// @dev Iterates through validators and updates their state within gas limits
/// @return allValidatorsCranked True if all validators were processed successfully
function _crankValidators() internal returns (bool allValidatorsCranked) {
uint64 _nextValidatorToCrank = s_nextValidatorToCrank;
// TODO: calculate the actual gas needed per validator crank
while (gasleft() > 1_000_000) {
if (_nextValidatorToCrank == LAST_VAL_ID) break;
t_validatorActiveSetCheckValId = 0;
_crankValidator(_nextValidatorToCrank);
t_validatorActiveSetCheckValId = 0;
_nextValidatorToCrank = s_valLinkNext[_nextValidatorToCrank];
}
s_nextValidatorToCrank = _nextValidatorToCrank;
return _nextValidatorToCrank == LAST_VAL_ID;
}
// ================================================== //
// Core Crank Functions & Accounting //
// ================================================== //
/// @notice Advances global epoch state and updates global accounting in one pass.
/// @dev Steps (ordering matters):
/// 1) Prime next epoch storage (carry flags, compute target stake)
/// 2) Offset uncovered liabilities using deposits (queueToStake vs queueForUnstake vs currentAssets)
/// 3) Reconcile atomic pool accounting without changing utilization jumps
/// 4) Carry over atomic-unstake into the global unstake queue
/// 5) Apply goodwill (unexpected donations) into stake queue
/// 6) Clamp queues to stakable/unstakable capacity (or roll excess forward)
/// 7) Update revenue smoother and bump internal epoch
/// 8) Reset validator cursor to start of linked list
/// Returns false early if monad epoch did not advance or validators are still pending from prior round.
/// @return complete True if global crank completed (epoch advanced and validators ready to crank)
function _crankGlobal() internal returns (bool complete) {
uint64 _monadEpoch = _getEpoch();
// All validators must have finished cranking in the previous round
if (s_nextValidatorToCrank != LAST_VAL_ID) return false;
// Monad epoch must have increased
if (globalEpochPtr_N(0).epoch >= _monadEpoch) return true;
// Load the just-ended epoch's data into memory to help with rolling the epoch forwards
Epoch memory _epochThatJustEnded = globalEpochPtr_N(0);
_primeNextGlobalEpoch(_epochThatJustEnded);
// Prepare the upcoming epoch's data by zeroing out any previous values and setting any carryovers.
globalRevenuePtr_N(2).clear();
globalCashFlowsPtr_N(2).clear();
// Handle any net staking allocations to the reserved MON amount
_offsetLiabilitiesWithDeposits();
// Adjust for any goodwill (unexpected donations)
_applyGoodwillToStakeQueue();
// Update (if applicable) and adjust the global net cash flow (MON) for flows to the atomic unstaking pool,
// while being sure to keep the utilization rate unchanged.
_settleGlobalNetMONAgainstAtomicUnstaking();
// Calculate and carry forward the unstaking aount from the atomic unstaking pool
_carryOverAtomicUnstakeIntoQueue();
// Net excess queue capacity, roll unassignable stake, and then roll any unnetted surpluses to the next epoch
_offsetExcessQueueCapacityWithNet();
_rollUnassignableStakingQueue();
_clampQueuesToCapacityOrRoll();
_updateRevenueSmootherAfterEpochChange();
_advanceEpochPointersAndResetValidatorCursor();
return false;
}
/// @notice Offsets uncovered liabilities using available deposits and current assets.
/// @dev Increases reservedAmount and reduces both `queueToStake` and `queueForUnstake` by the settled amount.
/// Caps by: uncovered liabilities, `queueForUnstake`, `queueToStake`, and current assets.
function _offsetLiabilitiesWithDeposits() internal {
uint256 _queueToStake = globalCashFlowsPtr_N(0).queueToStake;
uint256 _queueForUnstake = globalCashFlowsPtr_N(0).queueForUnstake;
// Check for any outstanding liabilities
uint256 _currentLiabilities = s_globalLiabilities.currentLiabilities();
uint256 _reserves = s_globalCapital.reservedAmount;
uint256 _pendingUnstaking = s_globalPending.pendingUnstaking;
if (_currentLiabilities > _reserves + _pendingUnstaking) {
// Start with the max value of the uncovered liabilities
uint256 _liabilitiesToSettleWithDeposits = _currentLiabilities - _reserves - _pendingUnstaking;
// Do not settle more than is currently requested to queue for unstaking
if (_liabilitiesToSettleWithDeposits > _queueForUnstake) {
_liabilitiesToSettleWithDeposits = _queueForUnstake;
}
// Do not use more than is currently queued for staking in the settlement process
if (_liabilitiesToSettleWithDeposits > _queueToStake) {
_liabilitiesToSettleWithDeposits = _queueToStake;
}
// We can only settle with MON (currentAssets) that hasn't been allocated for another purpose
uint256 _currentAssets = s_globalCapital.currentAssets(s_atomicAssets, address(this).balance);
if (_liabilitiesToSettleWithDeposits > _currentAssets) {
_liabilitiesToSettleWithDeposits = _currentAssets;
}
// If we have enough funds to offset, perform the offset
if (_liabilitiesToSettleWithDeposits > 0) {
// Increase the reserved amount
s_globalCapital.reservedAmount += _liabilitiesToSettleWithDeposits.toUint128();
// Implied: currentAssets -= _liabilitiesToSettleWithDeposits
emit ReservesIncreasedBySurplusDeposits(_liabilitiesToSettleWithDeposits);
// Remove the funds from both the queueToStake and the queueForUnstake - the deposit offsets the
// withdrawal.
globalCashFlowsPtr_N(0).queueToStake = (_queueToStake - _liabilitiesToSettleWithDeposits).toUint120();
globalCashFlowsPtr_N(0).queueForUnstake =
(_queueForUnstake - _liabilitiesToSettleWithDeposits).toUint120();
}
}
}
/// @notice Carries over atomic pool unstake amount into the global unstake queue for the current epoch.
function _carryOverAtomicUnstakeIntoQueue() internal {
// NOTE: We set this to globalRevenue.earnedRevenue so that there is no "jump" in the fee cost
// whenever we crank
uint120 _amountToSettle =
Math.min(globalRevenuePtr_N(0).earnedRevenue, s_atomicAssets.distributedAmount).toUint120();
// NOTE: allocatedRevenue cannot exceed either earnedRevenue or distributedAmount.
globalRevenuePtr_N(0).allocatedRevenue = 0;
s_atomicAssets.distributedAmount -= _amountToSettle; // -Contra_Asset Dr _amountToSettle
// Implied: currentAssets -= _amountToSettle; // -Asset Cr _amountToSettle
globalCashFlowsPtr_N(0).queueForUnstake += _amountToSettle;
}
/// @notice Applies any goodwill (unexpected donations) to the queueToStake and emits tracking event.
function _applyGoodwillToStakeQueue() internal {
uint256 _goodwill =
AccountingLib.goodwill(s_globalCapital, s_atomicAssets, globalCashFlowsPtr_N(0), address(this).balance);
if (_goodwill > 0) {
globalCashFlowsPtr_N(0).queueToStake += _goodwill.toUint120();
emit UnexpectedGoodwill(s_admin.internalEpoch, _goodwill);
}
}
/// @notice Updates revenue smoother using just-ended epoch's earnedRevenue and current block number.
function _updateRevenueSmootherAfterEpochChange() internal {
// Update the revenue smoother so that we can offset _totalEquity by a smoothed revenue
// from this epoch (which will be last epoch by the end of this call).
s_revenueSmoother = RevenueSmoother({
earnedRevenueLast: globalRevenuePtr_N(0).earnedRevenue,
epochChangeBlockNumber: uint64(block.number)
});
}
/// @notice Advances internal epoch pointer and resets validator crank cursor to the start of the list.
function _advanceEpochPointersAndResetValidatorCursor() internal {
// Increase the global internal epoch.
// NOTE: After incrementing the internal epoch:
// epoch_N(-1) is now epoch_N(-2)
// epoch_N(0) is now epoch_N(-1)
// epoch_N(1) is now epoch_N(0)
// ETC...
++s_admin.internalEpoch;
// Set the next validator to crank - always start off with the FIRST_VAL_ID sentinel
s_nextValidatorToCrank = FIRST_VAL_ID;
}
/// @notice Primes the next global epoch storage entry with carried flags and new target.
function _primeNextGlobalEpoch(Epoch memory epochThatJustEnded) internal {
// Prepare the upcoming epoch's storage slot
_setEpochStorage(
globalEpochPtr_N(1),
Epoch({
epoch: _getEpochBarrierAdj(), // Use the potentially higher epoch check here to make sure at least one
// full epoch passes
withdrawalId: 0, // unused
hasWithdrawal: false, // unused
hasDeposit: false, // unused
crankedInBoundaryPeriod: _inEpochDelayPeriod(), // can probably use later on
wasCranked: false, // bool indicating if the placeholder validator was cranked
frozen: epochThatJustEnded.frozen,
closed: epochThatJustEnded.closed,
targetStakeAmount: 0 // unused at the Global Epoch level, only used at Validator Epoch level
})
);
}
/// @notice Advances in-active-set flags for a validator at the start of its crank.
function _advanceActiveSetFlags(uint64 validatorId) internal {
if (s_validatorData[validatorId].isActive) {
s_validatorData[validatorId].inActiveSet_Last = s_validatorData[validatorId].inActiveSet_Current;
s_validatorData[validatorId].inActiveSet_Current = true; // Assume active, adjust later if needed
}
}
/// @notice Settles ready staking/unstaking edges across the last three epochs for a validator.
function _settlePastEpochEdges(uint64 valId) internal {
// Check the last three epochs for completion of staking and unstaking actions
Epoch storage _validatorEpochPtr = validatorEpochPtr_N(-3, valId);
if (_validatorEpochPtr.crankedInBoundaryPeriod) {
// The "three-epochs-ago" slot should have a withdrawal if it was initiated late during the boundary period.
if (_validatorEpochPtr.hasWithdrawal) {
_settleCompletedStakeAllocationDecrease(valId, _validatorEpochPtr, validatorPendingPtr_N(-3, valId));
}
}
_validatorEpochPtr = validatorEpochPtr_N(-2, valId);
if (!_validatorEpochPtr.crankedInBoundaryPeriod) {
// The unstaking initiated in epoch n-2 should be ready as long as it didn't start in a boundary period
if (_validatorEpochPtr.hasWithdrawal) {
_settleCompletedStakeAllocationDecrease(valId, _validatorEpochPtr, validatorPendingPtr_N(-2, valId));
}
} else {
// The staking initiated in epoch n-2 that was delayed by the boundary period should now be ready
if (_validatorEpochPtr.hasDeposit) {
_handleCompleteIncreasedAllocation(_validatorEpochPtr, validatorPendingPtr_N(-2, valId));
}
}
_validatorEpochPtr = validatorEpochPtr_N(-1, valId);
if (!_validatorEpochPtr.crankedInBoundaryPeriod) {
// The staking initiated in epoch n-1 should be ready now as long as it wasn't cranked in a boundary period
if (_validatorEpochPtr.hasDeposit) {
_handleCompleteIncreasedAllocation(_validatorEpochPtr, validatorPendingPtr_N(-1, valId));
}
}
}
/// @notice Computes per-validator stake delta using last windows and availability snapshots.
function _computeStakeDelta(uint64 validatorId)
internal
view
returns (
uint128 nextTarget,
uint128 netAmount,
bool isWithdrawal,
uint256 stakeAllocationIncrease,
uint256 stakeAllocationDecrease
)
{
uint256 _validatorUnstakableAmount = StakeAllocationLib.getValidatorAmountAvailableToUnstake(
validatorEpochPtr_N(-2, validatorId),
validatorEpochPtr_N(-1, validatorId),
validatorPendingPtr_N(-1, validatorId),
validatorPendingPtr_N(-2, validatorId)
);
Epoch memory _validatorEpochLast = validatorEpochPtr_N(-1, validatorId);
require(
_validatorUnstakableAmount <= uint256(_validatorEpochLast.targetStakeAmount),
ValidatorAvailableExceedsTargetStake(_validatorUnstakableAmount, _validatorEpochLast.targetStakeAmount)
);
uint256 _globalUnstakableAmount =
StakeAllocationLib.getGlobalAmountAvailableToUnstake(s_globalCapital, s_globalPending);
// Assume Validator is part of the active set to get the intended weights based on staking queue values
(nextTarget, netAmount, isWithdrawal, stakeAllocationIncrease, stakeAllocationDecrease) = StakeAllocationLib
.calculateValidatorEpochStakeDelta(
globalCashFlowsPtr_N(-1),
globalRevenuePtr_N(-2),
globalRevenuePtr_N(-1),
validatorRewardsPtr_N(-2, validatorId),
validatorRewardsPtr_N(-1, validatorId),
validatorEpochPtr_N(-1, validatorId),
_validatorUnstakableAmount,
_globalUnstakableAmount
);
}
/// @notice Applies the computed stake delta via skip/decrease/increase helpers and returns updated values.
function _applyStakeDelta(
uint64 valId,
uint128 nextTarget,
uint128 netAmount,
bool isWithdrawal
)
internal
returns (uint128 nextTargetOut, uint128 netAmountOut)
{
nextTargetOut = nextTarget;
netAmountOut = netAmount;
if (netAmountOut < DUST_THRESHOLD) {
// CASE: Amount is too small to warrant staking or unstaking
(nextTargetOut, netAmountOut) =
_initiateStakeAllocationSkip(valId, nextTargetOut, netAmountOut.toUint120(), isWithdrawal);
} else if (isWithdrawal) {
// CASE: Decrease allocation to validator
(nextTargetOut, netAmountOut) = _initiateStakeAllocationDecrease(valId, nextTargetOut, netAmountOut);
} else {
// CASE: Increase allocation to validator
(nextTargetOut, netAmountOut) = _initiateStakeAllocationIncrease(valId, nextTargetOut, netAmountOut);
}
}
/// @notice Net any excess stake/unstake queue capacity against each other
function _offsetExcessQueueCapacityWithNet() internal {
// Perform this prior to clamping and rolling queue capacity but after adjusting queues
// for the atomic unstaking pool deltas.
// Get the available amounts and their respective queues
uint256 _globalUnstakableAmount =
StakeAllocationLib.getGlobalAmountAvailableToUnstake(s_globalCapital, s_globalPending);
uint256 _queuedForUnstakeAmount = globalCashFlowsPtr_N(0).queueForUnstake;
uint256 _globalStakableAmount = s_globalCapital.currentAssets(s_atomicAssets, address(this).balance);
uint256 _queuedToStakeAmount = globalCashFlowsPtr_N(0).queueToStake;
// First, get the max offset by taking the lesser queue amount
uint256 _maxOffsetAmount =
_queuedForUnstakeAmount > _queuedToStakeAmount ? _queuedToStakeAmount : _queuedForUnstakeAmount;
// Second, calculate the target offset amount as the greater of the two queue's balance shortfalls
uint256 _targetOffsetAmount =
_queuedForUnstakeAmount > _globalUnstakableAmount ? _queuedForUnstakeAmount - _globalUnstakableAmount : 0;
if (_queuedToStakeAmount > _globalStakableAmount) {
uint256 _stakableMinOffsetAmount = _queuedToStakeAmount - _globalStakableAmount;
if (_stakableMinOffsetAmount > _targetOffsetAmount) {
_targetOffsetAmount = _stakableMinOffsetAmount;
}
}
// Cap the target offset amount at the max offset amount
// NOTE: Any "leftovers" will be picked up in the _clampQueuesToCapacityOrRoll() method, which rolls over any
// surplus queue amounts to the next epoch
if (_targetOffsetAmount > _maxOffsetAmount) {
_targetOffsetAmount = _maxOffsetAmount;
}
// Get the amount that needs to be reserved
uint256 _targetReservedAmount = s_globalLiabilities.currentLiabilities();
uint256 _currentReservedAmount = s_globalCapital.reservedAmount;
if (_targetReservedAmount > _currentReservedAmount) {
uint256 _netToReservesAmount = _targetReservedAmount - _currentReservedAmount;
// Can only move min(currentAssets, _reservesDeficit, _targetOffsetAmount) to reserves
if (_netToReservesAmount > _globalStakableAmount) {
_netToReservesAmount = _globalStakableAmount;
}
if (_netToReservesAmount > _targetOffsetAmount) {
_netToReservesAmount = _targetOffsetAmount;
}
emit ReservesIncreasedByExcessQueueCapacity(_netToReservesAmount);
// Increase the reserved amount
s_globalCapital.reservedAmount += _netToReservesAmount.toUint128(); // +Asset Dr _netToReservesAmount
// Implied: currentAssets -= _netToReservesAmount // -Asset Cr _netToReservesAmount
}
emit QueuesOffsetViaNet(
_targetOffsetAmount,
_globalUnstakableAmount,
_queuedForUnstakeAmount,
_globalStakableAmount,
_queuedToStakeAmount
);
// Net the offsets against each other
uint120 _targetOffsetAmount120 = _targetOffsetAmount.toUint120();
globalCashFlowsPtr_N(0).queueToStake -= _targetOffsetAmount120;
globalCashFlowsPtr_N(0).queueForUnstake -= _targetOffsetAmount120;
// Any remaining queue surpluses will get rolled forward to the next epoch
}
/// @notice Rolls any staking queued balance forward if the target validator is unassignable
function _rollUnassignableStakingQueue() internal {
// Stake deposits are assigned based on revenue. If global revenue is less than MIN_VALIDATOR_DEPOSIT,
// no stake will be assigned
if (s_activeValidatorCount > 0 && globalRevenuePtr_N(0).earnedRevenue < MIN_VALIDATOR_DEPOSIT) {
uint120 _stakeQueue = globalCashFlowsPtr_N(0).queueToStake;
emit StakeUnassignableNoGlobalRevenue(_stakeQueue);
globalCashFlowsPtr_N(0).queueToStake = 0;
globalCashFlowsPtr_N(1).queueToStake += _stakeQueue;
}
// NOTE: if s_activeValidatorCount == 0, the _clampQueuesToCapacityOrRoll() method called next will handle
// rolling the stake queue forwards.
}
/// @notice Clamps queues to available stake/unstake capacity or rolls forward when no validators are active.
function _clampQueuesToCapacityOrRoll() internal {
// Handle accounting for max / min amounts that can be staked / unstaked, but only if there are
// validators to stake / unstake with
if (s_activeValidatorCount > 0) {
// Calculate and carry forward any unstakable amount that cannot be covered by the global unstakable assets
// during the next epoch. This could occur when the majority of assets are stuck in staking escrow or
// unstaking escrow.
uint256 _globalUnstakableAmount =
StakeAllocationLib.getGlobalAmountAvailableToUnstake(s_globalCapital, s_globalPending);
uint256 _queuedForUnstakeAmount = globalCashFlowsPtr_N(0).queueForUnstake;
if (_queuedForUnstakeAmount > _globalUnstakableAmount) {
uint256 _unstakeQueueDeficit = _queuedForUnstakeAmount - _globalUnstakableAmount;
emit UnstakingQueueExceedsUnstakableAmount(_queuedForUnstakeAmount, _globalUnstakableAmount);
uint120 _unstakeQueueDeficit120 = _unstakeQueueDeficit.toUint120();
globalCashFlowsPtr_N(0).queueForUnstake -= _unstakeQueueDeficit120;
globalCashFlowsPtr_N(1).queueForUnstake += _unstakeQueueDeficit120;
}
uint256 _queuedToStakeAmount = globalCashFlowsPtr_N(0).queueToStake;
uint256 _globalStakableAmount = s_globalCapital.currentAssets(s_atomicAssets, address(this).balance);
if (_queuedToStakeAmount > _globalStakableAmount) {
uint256 _stakeQueueSurplus = _queuedToStakeAmount - _globalStakableAmount;
emit StakingQueueExceedsStakableAmount(_queuedToStakeAmount, _globalStakableAmount);
uint120 _stakeQueueSurplus120 = _stakeQueueSurplus.toUint120();
globalCashFlowsPtr_N(0).queueToStake -= _stakeQueueSurplus120;
globalCashFlowsPtr_N(1).queueToStake += _stakeQueueSurplus120;
}
// Next, we add in the "turnover" / "incentive-aligning" amount to the unstaking queue. This happens after
// the settling of deposits against withdrawals in order to promote the rebalancing even when the net
// cashflow is flat.
// NOTE: The "staking" portion happens when this amount finishes unstaking.
// NOTE: We only do this if there are multiple active validators from which to rebalance between.
if (s_activeValidatorCount > 1 && _globalUnstakableAmount > 0) {
uint256 _incentiveAlignmentPercentage = s_admin.incentiveAlignmentPercentage;
if (_incentiveAlignmentPercentage > 0) {
// Divide by four because unstaking takes two epochs and depositing takes another two epochs
uint256 _alignmentUnstakeAmount =
_globalUnstakableAmount * _incentiveAlignmentPercentage / BPS_SCALE / 4;
uint256 _currentUnstakeAmount = globalCashFlowsPtr_N(0).queueForUnstake;
// Treat the incentive-aligning portion as a floor for withdrawals that should be inclusive of
// existing withdrawals.
if (_currentUnstakeAmount < _alignmentUnstakeAmount) {
globalCashFlowsPtr_N(0).queueForUnstake = _alignmentUnstakeAmount.toUint120();
}
}
}
// If there are no active validators, roll forward any balances since there wont be anyone to stake them
// with, then net them out since performance-weighting is not relevant
} else {
uint256 _queueToStake = globalCashFlowsPtr_N(0).queueToStake;
uint256 _queueForUnstake = globalCashFlowsPtr_N(0).queueForUnstake;
emit UnexpectedNoValidators(s_admin.internalEpoch, _queueToStake, _queueForUnstake);
if (_queueToStake > _queueForUnstake) {
uint256 _netQueueToStake = _queueToStake - _queueForUnstake;
globalCashFlowsPtr_N(1).queueToStake += _netQueueToStake.toUint120();
// Implied: globalCashFlowsPtr_N(1).queueForUnstake = 0;
} else {
uint256 _netQueueForUnstake = _queueForUnstake - _queueToStake;
globalCashFlowsPtr_N(1).queueForUnstake += _netQueueForUnstake.toUint120();
// Implied: globalCashFlowsPtr_N(1).queueToStake = 0;
}
globalCashFlowsPtr_N(0).clear();
}
}
/// @notice Processes one validator's epoch roll, yield settlement, and (un)stake delta.
/// @dev Skips placeholder and already-cranked validators to be idempotent within an epoch.
/// Steps:
/// 1) Guard for sentinel/unknown/zero-id validators
/// 2) Mark last epoch as cranked (idempotency)
/// 3) Advance active set flags and eligibility
/// 4) Pull and book validator yield (precompile), updating rewards/liabilities
/// 5) Settle past epoch edges and pay or redirect rewards
/// 6) Compute per-validator stake delta (increase/decrease)
/// 7) Apply delta (stake or unstake), respecting availability and dust rules
/// 8) Roll validator epoch forwards with the next target
/// @param valId The validator ID to process
function _crankValidator(uint64 valId) internal {
// If at start of the linked list, skip to the next, first real validator in list
if (valId == FIRST_VAL_ID) return;
// Make sure we have a valid valId before proceeding.
uint64 _valId = valId;
if (_valId == UNKNOWN_VAL_ID) {
_crankPlaceholderValidator();
return;
} else if (_valId == 0) {
// This should be unreachable, but emits diagnostic event just in case
emit CrankSkippedOnValidatorIdZero(block.coinbase);
return;
}
// Crank only once per epoch per validator and only after the global state advanced.
Epoch storage _lastEpoch = validatorEpochPtr_N(-1, _valId);
if (_lastEpoch.wasCranked) return;
_lastEpoch.wasCranked = true;
// NOTE:
// Global has already been cranked.
// The epoch that is currently ongoing is validatorEpochPtr_N(0, coinbase)
// The most recent epoch that has fully completed is is validatorEpochPtr_N(-1, coinbase)
_advanceActiveSetFlags(_valId);
// Pull validator rewards (net of commission) so rebalancing reflects latest earnings.
_settleEarnedStakingYield(_valId);
_settlePastEpochEdges(_valId);
// Send any unsent rewardsPayable (i.e., MEV payments)
_settleValidatorRewardsPayable(_valId);
_handleStakeBalanceVerification(_valId, validatorEpochPtr_N(-1, _valId));
// Calculate and then handle the net staking / unstaking
(uint128 _nextTargetStakeAmount, uint128 _netAmount, bool _isWithdrawal, uint256 _stakeAllocationIncrease,) =
_computeStakeDelta(_valId);
// CASE: Validator was tagged as inactive for the cranked period
if (!s_validatorData[_valId].isActive || _nextTargetStakeAmount < MIN_VALIDATOR_DEPOSIT) {
uint256 _validatorUnstakableAmount = StakeAllocationLib.getValidatorAmountAvailableToUnstake(
validatorEpochPtr_N(-2, _valId),
validatorEpochPtr_N(-1, _valId),
validatorPendingPtr_N(-1, _valId),
validatorPendingPtr_N(-2, _valId)
);
// We're withdrawing _validatorUnstakableAmount, Roll forward any allocations that should've happened but
// were blocked due to inactivity
if (_stakeAllocationIncrease > 0) {
// NOTE: The max value for _netAmount is _validatorUnstakableAmount, which is only reached when
// _stakeAllocationIncrease is zero. We need to re-queue net stake that goes unstaked due to the
// adjustment to be staked next epoch, since it won't be staked this epoch.
uint256 _maxDelta = _isWithdrawal
? _validatorUnstakableAmount - uint256(_netAmount)
: _validatorUnstakableAmount + uint256(_netAmount);
uint256 _maxCarryover = Math.min(_maxDelta, _stakeAllocationIncrease);
if (_maxCarryover > 0) globalCashFlowsPtr_N(0).queueToStake += _maxCarryover.toUint120();
// NOTE: No need to de-queue surplus unstake.
}
_netAmount = _validatorUnstakableAmount.toUint128();
_nextTargetStakeAmount = validatorEpochPtr_N(-1, _valId).targetStakeAmount - _netAmount;
_isWithdrawal = true;
}
(_nextTargetStakeAmount, _netAmount) =
_applyStakeDelta(_valId, _nextTargetStakeAmount, _netAmount, _isWithdrawal);
// Roll the storage slots forwards
_rollValidatorEpochForwards(_valId, _nextTargetStakeAmount);
// If coinbase is a contract, attempt to process it via a try/catch
address coinbase = _validatorCoinbase(_valId);
if (coinbase.code.length > 0) {
try ICoinbase(coinbase).process{ gas: COINBASE_PROCESS_GAS_LIMIT }() { } catch { }
}
}
/// @notice Handles cranking for the placeholder validator (unregistered validators)
/// @dev Processes revenue attribution for unregistered validators
function _crankPlaceholderValidator() internal {
if (globalEpochPtr_N(-1).wasCranked) return;
emit UnregisteredValidatorRevenue(
globalEpochPtr_N(-1).epoch,
uint256(validatorRewardsPtr_N(0, UNKNOWN_VAL_ID).rewardsPayable),
uint256(validatorRewardsPtr_N(0, UNKNOWN_VAL_ID).earnedRevenue)
);
// Set the placeholder validator as having been cranked via the global epoch
_rollValidatorEpochForwards(UNKNOWN_VAL_ID, 0);
}
/// @notice Advances validator epoch state and updates validator accounting
/// @param valId The validator's ID
/// @param newTargetStakeAmount The new target stake amount for the validator
function _rollValidatorEpochForwards(uint64 valId, uint128 newTargetStakeAmount) internal {
// Load the ongoing validator epoch into memory for convenience
Epoch memory _ongoingValidatorEpoch = validatorEpochPtr_N(0, valId);
uint64 _internalEpoch = s_admin.internalEpoch;
// Store the next withdrawal id after incrementing if a withdrawal was initiated during this crank.
uint8 _withdrawalId = _ongoingValidatorEpoch.withdrawalId;
if (_ongoingValidatorEpoch.hasWithdrawal) {
unchecked {
if (++_withdrawalId == 0) _withdrawalId = 1;
}
}
// Set the target stake amount
validatorEpochPtr_N(0, valId).targetStakeAmount = newTargetStakeAmount;
// Clear out the next next shmonad epoch's slots
validatorRewardsPtr_N(2, valId).clear();
validatorPendingPtr_N(2, valId).clear();
_setEpochStorage(
validatorEpochPtr_N(1, valId),
Epoch({
epoch: _internalEpoch + 1,
withdrawalId: _withdrawalId,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: false,
frozen: _ongoingValidatorEpoch.frozen,
closed: _ongoingValidatorEpoch.closed,
targetStakeAmount: 0
})
);
// Update ValidatorData
if (s_validatorData[valId].isActive) {
s_validatorData[valId].epoch = _internalEpoch;
// Handle special deactivation logic - we don't increment the validatorData epoch if they're deactivated
// (even though we do increment the s_validatorEpoch if they're deactivated)
if (!s_validatorData[valId].inActiveSet_Last && !s_validatorData[valId].inActiveSet_Current) {
_beginDeactivatingValidator(valId);
}
// Handle special deactivation logic - we don't increment the validatorData epoch if they're deactivated
// (even though we do increment the s_validatorEpoch if they're deactivated)
} else {
// If SHMONAD_VALIDATOR_DEACTIVATION_PERIOD epochs have passed, fully remove the validator
if (_internalEpoch >= s_validatorData[valId].epoch + SHMONAD_VALIDATOR_DEACTIVATION_PERIOD) {
_completeDeactivatingValidator(valId);
}
}
}
/// @notice Checks and sets new atomic liquidity target based on current conditions
/// @param oldAllocatedAmount The previous allocated amount for comparison
/// @return scaledTargetPercent The new scaled target percentage
/// @return newAllocatedAmount The new allocated amount for atomic unstaking
function _checkSetNewAtomicLiquidityTarget(
uint128 oldUtilizedAmount,
uint128 oldAllocatedAmount
)
internal
returns (uint256 scaledTargetPercent, uint128 newAllocatedAmount)
{
// Load any pending atomic liquidity percentage
uint256 _newScaledTargetPercent = s_pendingTargetAtomicLiquidityPercent;
// Load relevant values
WorkingCapital memory _globalCapital = s_globalCapital;
uint256 _totalEquity = _globalCapital.totalEquity(s_globalLiabilities, s_admin, address(this).balance);
uint256 _currentAssets = _globalCapital.currentAssets(s_atomicAssets, address(this).balance);
// See if there is a new target percent - if not, check for minor rebalances and then return the old data.
if (_newScaledTargetPercent == FLOAT_PLACEHOLDER) {
// Check to see if the allocated amount has drifted too far away due to increases during
// _accountForWithdraw
uint256 _scaledTargetAllocatedPercentage = _scaledTargetLiquidityPercentage();
uint256 _scaledCurrentAllocatedPercentage = _scaledPercentFromAmounts(oldAllocatedAmount, _totalEquity);
if (_scaledTargetAllocatedPercentage > _scaledCurrentAllocatedPercentage + FLOAT_REBALANCE_SENSITIVITY) {
// CASE: Need to rebalance up
_newScaledTargetPercent = _scaledTargetAllocatedPercentage;
s_pendingTargetAtomicLiquidityPercent = _scaledTargetAllocatedPercentage;
} else if (
// CASE: rebalance down
_scaledTargetAllocatedPercentage + FLOAT_REBALANCE_SENSITIVITY < _scaledCurrentAllocatedPercentage
) {
_newScaledTargetPercent = _scaledTargetAllocatedPercentage;
s_pendingTargetAtomicLiquidityPercent = _scaledTargetAllocatedPercentage;
} else {
// CASE: Allocation is within threshold
return (_scaledTargetAllocatedPercentage, oldAllocatedAmount);
}
}
// Calculate an initial allocation amount for the atomic unstaking pool
newAllocatedAmount = _amountFromScaledPercent(_totalEquity, _newScaledTargetPercent).toUint128();
if (newAllocatedAmount > oldAllocatedAmount) {
// CASE: Increasing the liquidity target
uint128 _maxNetAmount = _currentAssets.toUint128();
if (oldAllocatedAmount + _maxNetAmount < newAllocatedAmount) {
// CASE: we cannot increase by the full max amount, so calculate the new scaledTargetPercent
newAllocatedAmount = oldAllocatedAmount + _maxNetAmount;
_newScaledTargetPercent = _scaledPercentFromAmounts(newAllocatedAmount, _totalEquity);
} else {
// CASE: we can increase by the full net amount, so we fully remove the
// s_pendingTargetAtomicLiquidityPercent and consider the update complete.
// Clear the pending target - we can fully update.
s_pendingTargetAtomicLiquidityPercent = FLOAT_PLACEHOLDER;
}
} else {
if (newAllocatedAmount < oldUtilizedAmount) {
// CASE: Trying to reduce beyond the utilized amount - we must adjust to avoid underflowing in other
// calculations.
// Apply cap and then backwards calculate the in-step target percent
newAllocatedAmount = oldUtilizedAmount;
_newScaledTargetPercent = _scaledPercentFromAmounts(newAllocatedAmount, _totalEquity);
} else {
// Fully remove the s_pendingTargetAtomicLiquidityPercent
s_pendingTargetAtomicLiquidityPercent = FLOAT_PLACEHOLDER;
}
}
// Store data and return
s_admin.targetLiquidityPercentage = _unscaledTargetLiquidityPercentage(Math.min(_newScaledTargetPercent, SCALE));
return (_newScaledTargetPercent, newAllocatedAmount);
}
/// @notice Settles completed stake allocation changes (staking/unstaking) for a validator
/// @param valId The validator ID
/// @param validatorEpochPtr Storage pointer to validator epoch data
/// @param validatorPendingPtr Storage pointer to validator pending data
function _settleCompletedStakeAllocationDecrease(
uint64 valId,
Epoch storage validatorEpochPtr,
StakingEscrow storage validatorPendingPtr
)
internal
{
address coinbase = _validatorCoinbase(valId);
(uint128 _amountReceived, bool _success, bool _delayed) =
_completeWithdrawal(valId, validatorEpochPtr.withdrawalId);
if (_delayed) {
// Treat boundary-period delays as cranked-in-boundary so the N(-3) path retries next epoch.
validatorEpochPtr.crankedInBoundaryPeriod = true;
// NOTE: This frame is just for testing purposes - it indicates a timing synchronization problem
emit WithdrawSettlementDelayed(
coinbase,
valId,
_getEpoch(),
validatorPendingPtr.pendingUnstaking,
_amountReceived,
validatorEpochPtr.withdrawalId
);
} else if (_success) {
_handleCompleteDecreasedAllocation(
valId, validatorEpochPtr, validatorPendingPtr, _amountReceived.toUint120()
);
emit UnexpectedStakeSettlementError(coinbase, valId, _amountReceived, 1);
} else {
_markValidatorNotInActiveSet(valId, 2);
emit UnexpectedStakeSettlementError(coinbase, valId, _amountReceived, 2);
}
}
/// @notice Settles earned (received) staking yield from a validator
/// @param valId The validator ID
function _settleEarnedStakingYield(uint64 valId) internal {
(uint120 _amountRewarded, bool _success) = _claimRewards(valId);
if (_success) {
_handleEarnedStakingYield(valId, _amountRewarded);
} else {
_markValidatorNotInActiveSet(valId, 1);
address coinbase = _validatorCoinbase(valId);
emit UnexpectedYieldSettlementError(coinbase, valId, _amountRewarded, address(this).balance, 1);
}
}
/// @notice Settles validator rewards payable (MEV payments *TO* a validator).
/// @param valId The validator ID
function _settleValidatorRewardsPayable(uint64 valId) internal {
uint120 _validatorRewardsPayable = validatorRewardsPtr_N(-1, valId).rewardsPayable;
if (_validatorRewardsPayable >= MIN_VALIDATOR_DEPOSIT) {
// NOTE: if _sendRewards fails it means the validator is no longer a part of the active validator set
(bool _success, uint120 _actualAmountSent) = _sendRewards(valId, _validatorRewardsPayable);
if (_success) {
if (_actualAmountSent < _validatorRewardsPayable) {
// NOTE: This frame is for testing - if it's triggered it signifies an underlying issue
emit InsufficientLocalBalance(
_validatorRewardsPayable, _actualAmountSent, address(this).balance, _totalEquity(false), 2
);
address coinbase = _validatorCoinbase(valId);
emit UnexpectedValidatorRewardsPayError(
coinbase, valId, _validatorRewardsPayable, address(this).balance, 1
);
_handleRewardsPaidFail(valId, _validatorRewardsPayable - _actualAmountSent);
_handleRewardsPaidSuccess(_actualAmountSent);
} else {
_handleRewardsPaidSuccess(_validatorRewardsPayable);
}
} else {
address coinbase = _validatorCoinbase(valId);
emit UnexpectedValidatorRewardsPayError(
coinbase, valId, _validatorRewardsPayable, address(this).balance, 2
);
_handleRewardsRedirect(_validatorRewardsPayable);
_markValidatorNotInActiveSet(valId, 3);
}
} else if (_validatorRewardsPayable > 0) {
address coinbase = _validatorCoinbase(valId);
emit UnexpectedValidatorRewardsPayError(coinbase, valId, _validatorRewardsPayable, address(this).balance, 3);
_handleRewardsPaidFail(valId, _validatorRewardsPayable);
}
}
/// @notice Handles stake allocation skip when amount is below dust threshold
/// @param valId The validator ID
/// @param nextTargetStakeAmount The next target stake amount
/// @param netAmount The net amount to process
/// @param isWithdrawal Whether this is a withdrawal operation
/// @return The updated target stake amount and net amount
function _initiateStakeAllocationSkip(
uint64 valId,
uint128 nextTargetStakeAmount,
uint120 netAmount,
bool isWithdrawal
)
internal
returns (uint128, uint120)
{
if (netAmount == 0) {
// pass
address coinbase = _validatorCoinbase(valId);
emit LowValidatorStakeDeltaNetZero(
coinbase,
valId,
globalEpochPtr_N(-1).epoch,
nextTargetStakeAmount,
netAmount,
s_validatorData[valId].inActiveSet_Current,
s_validatorData[valId].inActiveSet_Last
);
} else if (isWithdrawal) {
// Adjust the target, then resubmit the amount into the unstaking queue
nextTargetStakeAmount += netAmount;
globalCashFlowsPtr_N(0).queueForUnstake += netAmount;
netAmount = 0;
address coinbase = _validatorCoinbase(valId);
emit LowValidatorStakeDeltaOnDecrease(
coinbase,
valId,
globalEpochPtr_N(-1).epoch,
nextTargetStakeAmount,
netAmount,
s_validatorData[valId].inActiveSet_Current,
s_validatorData[valId].inActiveSet_Last
);
} else {
// Adjust the target, then resubmit the amount into the staking queue
nextTargetStakeAmount -= netAmount;
globalCashFlowsPtr_N(0).queueToStake += netAmount;
netAmount = 0;
address coinbase = _validatorCoinbase(valId);
emit LowValidatorStakeDeltaOnIncrease(
coinbase,
valId,
globalEpochPtr_N(-1).epoch,
nextTargetStakeAmount,
netAmount,
s_validatorData[valId].inActiveSet_Current,
s_validatorData[valId].inActiveSet_Last
);
}
return (nextTargetStakeAmount, netAmount);
}
/// @notice Initiates stake allocation decrease for a validator
/// @param valId The validator ID
/// @param nextTargetStakeAmount The next target stake amount
/// @param netAmount The net amount to decrease
/// @return The updated target stake amount and net amount
function _initiateStakeAllocationDecrease(
uint64 valId,
uint128 nextTargetStakeAmount,
uint128 netAmount
)
internal
returns (uint128, uint128)
{
// Kick off the next-stage unstake;
(bool _success, uint128 _amountWithdrawing) =
_initiateWithdrawal(valId, netAmount, validatorEpochPtr_N(0, valId).withdrawalId);
if (_success) {
// CASE: Unstaking initiated successfully
if (_amountWithdrawing < netAmount) {
// CASE: Unstaking initiated successfully but unable to initiate the intended amount
address coinbase = _validatorCoinbase(valId);
emit InsufficientActiveDelegatedBalance(coinbase, valId, _getEpoch(), netAmount, _amountWithdrawing);
// Readd the netAmount to the nextTargetStakeAmount and resubmit the amount to the unstaking queue.
uint120 _deficit = (netAmount - _amountWithdrawing).toUint120();
nextTargetStakeAmount += _deficit;
globalCashFlowsPtr_N(0).queueForUnstake += _deficit;
netAmount -= _deficit;
}
_handleInitiateDecreasedAllocation(valId, _amountWithdrawing.toUint120());
} else {
// CASE: Unstaking failed to initiate
_markValidatorNotInActiveSet(valId, 4);
// Readd the netAmount to the nextTargetStakeAmount and resubmit the amount to the unstaking queue.
nextTargetStakeAmount += netAmount;
globalCashFlowsPtr_N(0).queueForUnstake += netAmount.toUint120();
netAmount = 0;
address coinbase = _validatorCoinbase(valId);
emit UnexpectedFailureInitiateUnstake(coinbase, valId, nextTargetStakeAmount, netAmount);
}
return (nextTargetStakeAmount, netAmount);
}
/// @notice Initiates stake allocation increase for a validator
/// @param valId The validator ID
/// @param nextTargetStakeAmount The next target stake amount
/// @param netAmount The net amount to increase
/// @return The updated target stake amount and net amount
function _initiateStakeAllocationIncrease(
uint64 valId,
uint128 nextTargetStakeAmount,
uint128 netAmount
)
internal
returns (uint128, uint128)
{
// Deploy additional stake to the validator
(bool _success, uint128 _actualAmount) = _initiateStaking(valId, netAmount);
if (_success) {
// CASE: Staking initiated successfully
if (_actualAmount < netAmount) {
// CASE: Staking initiated successfully but unable to initiate the intended amount
// NOTE: This frame is for testing - if it's triggered it signifies an underlying issue
emit InsufficientLocalBalance(netAmount, _actualAmount, address(this).balance, _totalEquity(false), 1);
// Reduce the nextTargetStakeAmount and the netAmount by the missing allocation and then
// resubmit the amount to the staking queue.
uint120 _deficit = (netAmount - _actualAmount).toUint120();
nextTargetStakeAmount -= _deficit;
globalCashFlowsPtr_N(0).queueToStake += _deficit;
netAmount = _actualAmount;
}
_handleInitiateIncreasedAllocation(valId, netAmount.toUint120());
} else {
// CASE: Staking failed to initiate
_markValidatorNotInActiveSet(valId, 5);
// Remove the netAmount from the nextTargetStakeAmount and resubmit the missing amount to the staking queue.
nextTargetStakeAmount -= netAmount;
globalCashFlowsPtr_N(0).queueToStake += netAmount.toUint120();
netAmount = 0;
address coinbase = _validatorCoinbase(valId);
emit UnexpectedFailureInitiateStake(coinbase, valId, nextTargetStakeAmount, netAmount);
}
return (nextTargetStakeAmount, netAmount);
}
// ================================================== //
// Accounting Handlers - MEV and Revenue //
// ================================================== //
/// @notice Handles the accounting, collection and escrow of MEV rewards that will be paid out to a validator in the
/// next epoch. This also collects and processes shMonad's share of the MEV payments.
/// @param valId The validator ID
/// @param amount The total reward amount
/// @param feeRate The fee rate to apply
/// @return validatorPayout The amount paid to the validator
/// @return feeTaken The fee amount taken by the protocol
function _handleValidatorRewards(
uint64 valId,
uint256 amount,
uint256 feeRate
)
internal
override
returns (uint120 validatorPayout, uint120 feeTaken)
{
// NOTE: The `feeTaken` portion is earnedRevenue - realized as shMON yield immediately.
// The validator payout after fees is delayed until the next epoch's crank is called.
uint120 _grossFeeTaken = _amountFromScaledPercent(amount, feeRate).toUint120();
uint256 _boostCommissionRate = s_admin.boostCommissionRate;
uint120 _commissionTaken = (_grossFeeTaken * _boostCommissionRate / BPS_SCALE).toUint120();
feeTaken = _grossFeeTaken - _commissionTaken;
validatorPayout = amount.toUint120() - feeTaken - _commissionTaken;
// Load the validator's data
ValidatorData memory _vData = _getValidatorData(valId);
if (!_vData.isPlaceholder && _vData.inActiveSet_Current) {
// CASE: Validator is registered with FastLane - hold their MEV rewards (net of FastLane fee)
// in escrow for them and pay them out next epoch.
PendingBoost storage validatorRewardsPtr = validatorRewardsPtr_N(0, valId);
validatorRewardsPtr.rewardsPayable += validatorPayout;
validatorRewardsPtr.earnedRevenue += feeTaken;
globalRevenuePtr_N(0).earnedRevenue += feeTaken;
s_globalLiabilities.rewardsPayable += validatorPayout; // +Liability Cr validatorPayout
s_admin.totalZeroYieldPayable += _commissionTaken; // +Liability Cr _commissionTaken
s_globalCapital.reservedAmount += validatorPayout; // +Asset Dr validatorPayout,
// Implied currentAssets += _commissionTaken // +Asset Dr +_commissionTaken
} else {
// CASE: Validator is NOT registered with FastLane - use all the MEV to boost shMON yield,
// but don't increase the global (all validators) earnedRevenue because we don't want this
// revenue to 'dilute' the revenue weights of the registered validators.
PendingBoost storage validatorRewardsPtr = validatorRewardsPtr_N(0, UNKNOWN_VAL_ID);
validatorRewardsPtr.rewardsPayable += validatorPayout;
validatorRewardsPtr.earnedRevenue += feeTaken;
// Treat full amount as a debit rather than revenue to avoid diluting the revenue of active validators.
feeTaken += validatorPayout;
validatorPayout = 0;
s_admin.totalZeroYieldPayable += _commissionTaken; // +Liability Cr _commissionTaken
// Implied currentAssets += _commissionTaken; // +Asset Dr _commissionTaken
// Implied currentAssets += feeTaken; // +Asset Dr feeTaken
// Implied equity += feeTaken; // +Equity Cr feeTaken
}
// Track commission taken above by increasing the owner's zero-yield balance
s_zeroYieldBalances[OWNER_COMMISSION_ACCOUNT] += _commissionTaken;
// Queue the net new unencumbered MON for staking
globalCashFlowsPtr_N(0).queueToStake += (feeTaken + _commissionTaken);
// Re-add _commissionTaken to feeTaken when returning the amount that doesn't go to the validator
return (validatorPayout, feeTaken + _commissionTaken);
}
/// @notice Handles the accounting for contract interactions that boost shMonad's yield.
/// @param amount The boost yield amount to distribute
function _handleBoostYield(uint128 amount) internal override {
// NOTE: `amount` is pure earnedRevenue - realized as shMON yield immediately.
uint128 _grossBoostCommission = amount * s_admin.boostCommissionRate / BPS_SCALE;
if (_grossBoostCommission > 0) {
s_admin.totalZeroYieldPayable += _grossBoostCommission; // +Liability Cr _grossBoostCommission
// Implied: currentAssets += _grossBoostCommission // +Asset Dr _grossBoostCommission
// Track commission taken above by increasing the owner's zero-yield balance
s_zeroYieldBalances[OWNER_COMMISSION_ACCOUNT] += _grossBoostCommission;
amount -= _grossBoostCommission;
}
// Implied currentAssets += amount; // +Asset Dr amount
// Implied equity += amount; // +Equity Cr amount
// Load the validator's data
uint64 _currentValId = _getCurrentValidatorId();
ValidatorData memory _vData = _getValidatorData(_currentValId);
uint120 _amount120 = amount.toUint120();
// Only increment global earned revenus if validator is not placeholder -
// this is to prevent diluting real validators' proportional revenue-weighted allocations
if (!_vData.isPlaceholder && _vData.inActiveSet_Current) {
// CASE: Active, valid validator
validatorRewardsPtr_N(0, _currentValId).earnedRevenue += _amount120;
globalRevenuePtr_N(0).earnedRevenue += _amount120;
} else {
// CASE: Inactive or placeholder validator
validatorRewardsPtr_N(0, UNKNOWN_VAL_ID).earnedRevenue += _amount120;
}
globalCashFlowsPtr_N(0).queueToStake += (amount + _grossBoostCommission).toUint120();
}
/// @notice Handles the accounting for contract interactions that boost shMonad's yield.
/// @param assetValueOfShares The boost yield amount to distribute that came from existing
/// shares
function _handleBoostYieldFromShares(uint128 assetValueOfShares) internal override {
// NOTE: `assetValueOfShares` comes from burning existing shMON shares without paying out
// the equivalent amount of MON to any party. No unstaking required, but we must be mindful
// of accounting invariants - specifically that an increase in earnedRevenue is assumed to be matched entirely
// by MON in this contract and that no portion of that earnedRevenue increase is currently staked.
// see `_accountForWithdraw()`
uint128 _grossBoostCommission = assetValueOfShares * s_admin.boostCommissionRate / BPS_SCALE;
if (_grossBoostCommission > 0) {
s_admin.totalZeroYieldPayable += _grossBoostCommission; // +Liability Cr _grossBoostCommission
// Implied: currentAssets += _grossBoostCommission // +Asset Dr _grossBoostCommission
// Track commission taken above by increasing the owner's zero-yield balance
s_zeroYieldBalances[OWNER_COMMISSION_ACCOUNT] += _grossBoostCommission;
assetValueOfShares -= _grossBoostCommission;
}
// No accounting entries - equity stays the same, it's just divided up among fewer issued shares.
// Load the validator's data
uint64 _currentValId = _getCurrentValidatorId();
ValidatorData memory _vData = _getValidatorData(_currentValId);
// Only increment global earned revenus if validator is not placeholder -
// this is to prevent diluting real validators' proportional revenue-weighted allocations
if (!_vData.isPlaceholder && _vData.inActiveSet_Current) {
// CASE: Active, valid validator
// We must clamp the amount added to revenue and then offset the appropriate buckets due to the
// atomicUnstakingPool assuming all revenue is collected in MON.
AtomicCapital memory _atomicCapital = s_atomicAssets;
uint128 _atomicLiquidityAvailable = _atomicCapital.allocatedAmount - _atomicCapital.distributedAmount;
if (_atomicLiquidityAvailable < assetValueOfShares) {
// We must clamp the tracked revenue to prevent the atomic unstaking pool from thinking
// it has MON available that is still staked shMON.
assetValueOfShares = _atomicLiquidityAvailable;
}
// NOTE: distributedAmount is offset by revenue. First we increase the distributed amount, and then
// we increase the revenue - this offset is to make sure that we have have MON liquidity for the atomic
// unstaking pool from these burned shMON shares.
_atomicCapital.distributedAmount += assetValueOfShares; // +ContraAsset Cr assetValueOfShares
// Implied: currentAssets += assetValueOfShares // +Asset Dr assetValueOfShares
// Persist AtomicCapital changes to storage
s_atomicAssets = _atomicCapital;
uint120 _amount120 = assetValueOfShares.toUint120();
validatorRewardsPtr_N(0, _currentValId).earnedRevenue += _amount120;
globalRevenuePtr_N(0).earnedRevenue += _amount120;
} else {
// CASE: Inactive or placeholder validator
// No clamp on amount for inactive validator since this revenue does not flow to the
// atomicLiquidityAvailable.
uint120 _amount120 = assetValueOfShares.toUint120();
validatorRewardsPtr_N(0, UNKNOWN_VAL_ID).earnedRevenue += _amount120;
}
}
// ================================================== //
// Accounting Handlers - Validators / Crank //
// ================================================== //
/// @notice Verifies that expected staking balances match actual staking balances and then handles any discrepancies
/// @param valId The validator ID in the Monad staking precompile
/// @param validatorEpochPtrLast Storage pointer to validator's last epoch data
function _handleStakeBalanceVerification(uint64 valId, Epoch storage validatorEpochPtrLast) internal {
// Call the monad staking precompile to get the current balances staked with this validator
(uint256 _actualActiveStake, uint256 _actualPendingDeposits) = _getStakeInfo(valId);
// Declare variables and calculate expected values
uint256 _expectedTotalStake = validatorEpochPtrLast.targetStakeAmount;
uint256 _actualTotalStake = _actualActiveStake + _actualPendingDeposits;
uint256 _expectedPendingDeposits;
uint256 _expectedPendingWithdrawals;
uint256 _actualPendingWithdrawals;
// NOTE: Because the shMonad epochs are always at least equal to but could be longer than Monad epochs,
// we always sum up the pending totals rather than breaking down per epoch and finding a false negative.
for (int256 i = -4; i < 0; i++) {
Epoch storage _validatorEpochPtr = validatorEpochPtr_N(i, valId);
StakingEscrow storage _validatorPendingPtr = validatorPendingPtr_N(i, valId);
if (_validatorEpochPtr.hasWithdrawal) {
_expectedPendingWithdrawals += _validatorPendingPtr.pendingUnstaking;
_actualPendingWithdrawals += _getWithdrawalAmount(valId, _validatorEpochPtr.withdrawalId);
}
if (_validatorEpochPtr.hasDeposit) {
_expectedPendingDeposits += _validatorPendingPtr.pendingStaking;
}
}
// Check the total stake first and emit an event identifying anything unexpected
if (_actualTotalStake != _expectedTotalStake) {
emit UnexpectedTotalStakeExpectedIsNotActual(
valId,
s_admin.internalEpoch,
_expectedTotalStake,
_actualTotalStake,
_expectedPendingWithdrawals,
_actualPendingWithdrawals,
_expectedPendingDeposits,
_actualPendingDeposits
);
}
// Flag any mismatches between pending withdrawals and actual withdrawals but do not adjust yet - wait until
// the withdrawal completes.
if (_expectedPendingWithdrawals != _actualPendingWithdrawals) {
emit UnexpectedStakeWithdrawalsExpectedIsNotActual(
valId, s_admin.internalEpoch, _expectedPendingWithdrawals, _actualPendingWithdrawals
);
}
// Track and flag any mismatches in expected deposits but do not adjust them - wait until we the stake
// is active (and therefore finalized) to adjust.
if (_expectedPendingDeposits != _actualPendingDeposits) {
emit UnexpectedPendingStakeExpectedIsNotActual(
valId, s_admin.internalEpoch, _expectedPendingDeposits, _actualPendingDeposits
);
// NOTE: Because multiple Monad epochs can pass during a single ShMonad epoch, it is possible
// and within expectations for _expectedPendingDeposits to be greater than _pendingDeposits due to
// the Monad epoch settling what the ShMonad epoch hasn't reached yet. If this is the case, the actual
// active stake balance should be greater than the expected stake balance by the same amount that the
// actual pending stake is less than the expected pending stake.
}
// Check for underflow and return early if detected - totalStake should include pendingDeposits
if (_actualPendingDeposits > _expectedTotalStake) {
emit UnexpectedPendingStakeExceedsExpectedActive(
valId, s_admin.internalEpoch, _actualPendingDeposits, _expectedTotalStake
);
return;
}
// Expected active is calculated by subtracting expected pending from expected total, so we subtract expected
// total by the real actual to compare and flag a mismatch, which let's us identify any actual settled
// difference.
uint256 _expectedActiveStake = _expectedTotalStake - _actualPendingDeposits;
if (_expectedActiveStake != _actualActiveStake) {
emit UnexpectedActiveStakeExpectedIsNotActual(
valId, s_admin.internalEpoch, _expectedActiveStake, _actualActiveStake
);
// There are many "dilutive" attack vectors through which someone with prior knowledge
// of slashing or an unexpected "increase" could manipulate balances to profit from this
// spontaneous change in equity value. Unfortunately, such an actor could still do the attack even without
// shMonad's delays. Our approach is therefore to avoid scenarios in which this can happen rather than to
// focus on mitigating the damage in the unlikely (or impossible) event in which it occurs.
// NOTE: In future versions of shMonad, the validator-specific staking system from testnet will be
// re-integrated and the unexpected changes to equity will be absorbed first by any validator-specific
// stakers.
if (_actualActiveStake > _expectedActiveStake) {
// Unexpected windfall
uint256 _delta = _actualActiveStake - _expectedActiveStake;
// If expected deposits are too high, subtract that delta from the active stake delta
if (_expectedPendingDeposits > _actualPendingDeposits) {
uint256 _pendingDepositDelta = _expectedPendingDeposits - _actualPendingDeposits;
_delta = _delta > _pendingDepositDelta ? _delta - _pendingDepositDelta : 0;
}
uint128 _delta128 = _delta.toUint128();
validatorEpochPtrLast.targetStakeAmount += _delta128;
s_globalCapital.stakedAmount += _delta128; // +Asset Dr _delta
// Implied equity += _delta; // +Equity Cr _delta
} else {
// NOTE: Slashing is not live yet on Monad.
uint256 _delta = _expectedActiveStake - _actualActiveStake;
// If expected deposits are too low, subtract that delta from the active stake delta
if (_actualPendingDeposits > _expectedPendingDeposits) {
uint256 _pendingDepositDelta = _actualPendingDeposits - _expectedPendingDeposits;
_delta = _delta > _pendingDepositDelta ? _delta - _pendingDepositDelta : 0;
}
// Check the circuit breaker and freeze the protocol if threshold is passed
if (_delta * SCALE > _totalEquity(true) * SLASHING_FREEZE_THRESHOLD) {
globalEpochPtr_N(0).frozen = true; // Freeze crank
globalEpochPtr_N(0).closed = true; // Block deposits and non-atomic withdrawals
// NOTE: Many apps have dependencies on atomic withdrawals, and the amount of value
// that shMonad can lose due to atomic withdrawals is capped at TARGET_FLOAT% of equity.
// NOTE: This is currently expected to never be triggered and is meant to catch theoretical
// exploits on either shMonad or the staking precompile itself. Once slashing is added to Monad
// staking, the circuit breaker thresholds can be reevaluated with bespoke logic.
}
// Convert to uint128 while checking for underflow
uint128 _delta128 = (_delta > _expectedTotalStake ? _delta - _expectedTotalStake : 0).toUint128();
validatorEpochPtrLast.targetStakeAmount -= _delta128;
s_globalCapital.stakedAmount -= _delta128; // -Asset Cr _delta
// Implied equity -= _delta128; // -Equity Dr _delta
}
}
}
/// @notice Handles accounting of the initiation of increased stake allocation with a validator
/// @param amount The amount to allocate
function _handleInitiateIncreasedAllocation(uint64 valId, uint120 amount) internal {
// Method called before calling the validator
// NOTE: This is called after any handleComplete_Allocation methods
// Push forward but don't rotate the withdrawal ID
// Update the target amount and flag as not having a withdrawal
Epoch storage validatorEpochPtr = validatorEpochPtr_N(0, valId);
validatorEpochPtr.hasDeposit = true;
validatorEpochPtr.hasWithdrawal = false;
validatorEpochPtr.crankedInBoundaryPeriod = _inEpochDelayPeriod();
// Initiate ShMonad MON -> Validator
validatorPendingPtr_N(0, valId).pendingStaking += amount;
s_globalPending.pendingStaking += amount;
s_globalCapital.stakedAmount += amount; // +Asset Dr amount
// Implied currentAssets -= amount; // -Asset Cr amount
}
/// @notice Handles accounting of the completion of increased stake allocation with a validator
/// @param validatorEpochPtr Storage pointer to validator epoch data
/// @param validatorPendingPtr Storage pointer to validator pending data
function _handleCompleteIncreasedAllocation(
Epoch storage validatorEpochPtr,
StakingEscrow storage validatorPendingPtr
)
internal
{
// Complete ShMonad MON -> Validator
// validatorPendingPtr_N(-2, coinbase).pendingStaking -= amount;
validatorEpochPtr.hasDeposit = false;
uint120 _amount = validatorPendingPtr.pendingStaking;
s_globalPending.pendingStaking -= _amount;
}
/// @notice Handles initiation of decreased stake allocation for a validator
/// @param amount The amount to deallocate
function _handleInitiateDecreasedAllocation(uint64 valId, uint120 amount) internal {
// Method called before calling the validator
// Flag as having a withdrawal
// NOTE: This is after any handleComplete_Allocation methods
validatorEpochPtr_N(0, valId).hasWithdrawal = true;
validatorEpochPtr_N(0, valId).hasDeposit = false;
validatorEpochPtr_N(0, valId).crankedInBoundaryPeriod = _inEpochDelayPeriod();
// Initiate Validator MON -> ShMonad
validatorPendingPtr_N(0, valId).pendingUnstaking += amount;
s_globalPending.pendingUnstaking += amount;
}
/// @notice Handles accounting of the completion of decreased stake allocation with a validator
/// @param validatorEpochPtr Storage pointer to validator epoch data
/// @param validatorPendingPtr Storage pointer to validator pending data
/// @param amount The amount that was deallocated
function _handleCompleteDecreasedAllocation(
uint64 valId,
Epoch storage validatorEpochPtr,
StakingEscrow storage validatorPendingPtr,
uint120 amount
)
internal
{
// Complete Validator MON -> ShMonad
// NOTE: Global has been cranked already. Validator is in the process of being cranked
// but the validator storage has not yet been shifted forwards. Therefore,
// Global_LastLast corresponds with Validator_Last
uint256 _amount = amount; // Gives us a uint256 and a uint128 version of `amount`
uint120 _expectedAmount = validatorPendingPtr.pendingUnstaking;
// Adjust globals with the expected amount
s_globalPending.pendingUnstaking -= _expectedAmount;
// Implied currentAssets += _expectedAmount; // +Asset Dr _expectedAmount
s_globalCapital.stakedAmount -= _expectedAmount; // -Asset Cr _expectedAmount
// Mark withdrawal as complete
validatorEpochPtr.hasWithdrawal = false;
uint120 _surplus;
// Reconcile the difference between expected and actual amount received.
if (amount > _expectedAmount) {
// CASE: Received more than expected
_surplus = amount - _expectedAmount;
// Implied currentAssets += _surplus // +Asset Dr _surplus
// Implied equity += _surplus // +Equity Cr _surplus
// Update global target w/ the surplus then correct the unstaking journal entry
validatorPendingPtr.pendingUnstaking += _surplus;
// Track any surplus as earned staking yield for the validator
_handleEarnedStakingYield(valId, _surplus);
// Global accounting entries:
// Implied currentAssets += _surplus; // +Asset Dr _expectedAmount
// Implied equity += _surplus // +Equity Cr _surplus
} else if (amount < _expectedAmount) {
// CASE: Received less than expected
uint120 _deficit = _expectedAmount - amount;
// Update global target w/ the deficit then correct the unstaking journal entry
validatorPendingPtr.pendingUnstaking -= _deficit;
// Global accounting entries:
// Implied currentAssets -= _deficit; // -Asset Cr _deficit
// Implied equity -= _deficit // -Equity Dr _deficit
emit UnexpectedDeficitOnUnstakeSettle(_expectedAmount, _amount, 1);
}
// Assign the unstaking funds to the 'reservedAssets' account if it does not
// currently have enough to cover the liabilities
uint256 _reservedAssets = s_globalCapital.reservedAmount;
uint256 _currentLiabilities = s_globalLiabilities.currentLiabilities();
// If any surplus was queued to stake in the `_handleEarnedStakingYield()` call above, this reflects the portion
// of `_amount` that is not yet queued to stake
uint120 _unqueuedAmount = uint120(_amount) - _surplus;
if (_currentLiabilities > _reservedAssets) {
// CASE: `_currentLiabilities` not fully covered by `_reservedAssets`, so received funds top up
// `_reservedAssets` first.
uint256 _shortfall = _currentLiabilities - _reservedAssets;
if (_shortfall > _unqueuedAmount) {
s_globalCapital.reservedAmount += _unqueuedAmount; // +Asset Dr _unqueuedAmount
// Implied: currentAssets -= _unqueuedAmount; // -Asset Cr _unqueuedAmount
} else {
s_globalCapital.reservedAmount += _shortfall.toUint128(); // +Asset Dr _shortfall
// Implied: currentAssets -= _shortfall // -Asset Cr _shortfall
// Queue the remainder to be staked
globalCashFlowsPtr_N(0).queueToStake += (_unqueuedAmount - _shortfall).toUint120();
}
} else {
// CASE: `_currentLiabilities` is already fully covered by `_reservedAssets`, so all received funds can be
// queued to stake.
globalCashFlowsPtr_N(0).queueToStake += _unqueuedAmount;
}
}
/// @notice Handles accounting of earned (realized and received) staking yield for a validator
/// @param valId The validator's ID
/// @param amount The earned yield amount
function _handleEarnedStakingYield(uint64 valId, uint120 amount) internal {
// Implied currentAssets += _surplus; // +Asset Dr amount
// Implied equity += _surplus // +Equity Cr amount
uint256 _stakingCommissionRate = s_admin.stakingCommission;
uint120 _grossStakingCommission;
if (_stakingCommissionRate > 0) {
_grossStakingCommission = (amount * _stakingCommissionRate / BPS_SCALE).toUint120();
s_admin.totalZeroYieldPayable += _grossStakingCommission; // +Liability Cr _grossStakingCommission
// Implied currentAssets += _grossStakingCommission // +Asset Dr _grossStakingCommission
// Track commission taken above by increasing the owner's zero-yield balance
s_zeroYieldBalances[OWNER_COMMISSION_ACCOUNT] += _grossStakingCommission;
amount -= _grossStakingCommission;
}
// Validator MON -> ShMonad
validatorRewardsPtr_N(0, valId).earnedRevenue += amount;
// Validator is being cranked.
globalRevenuePtr_N(0).earnedRevenue += amount;
// Queue the rewards to be staked
globalCashFlowsPtr_N(0).queueToStake += (amount + _grossStakingCommission);
}
/// @notice Handles accounting of successful payment / transfer of escrowed MEV rewards to a validator
/// @param amount The amount successfully paid
function _handleRewardsPaidSuccess(uint128 amount) internal {
// ShMonad MON -> Validator
s_globalCapital.reservedAmount -= amount; // -Asset Cr amount
s_globalLiabilities.rewardsPayable -= amount; // -Liability Dr amount
}
/// @notice Handles accounting of failed payment / transfer of escrowed MEV rewards to a validator
/// @param valId The validator's ID
/// @param amount The amount that failed to be paid
function _handleRewardsPaidFail(uint64 valId, uint120 amount) internal {
// ShMonad MON -> Validator
// Shift epoch from last to current
validatorRewardsPtr_N(-1, valId).rewardsPayable -= amount;
validatorRewardsPtr_N(0, valId).rewardsPayable += amount;
}
/// @notice Handles accounting of rewards redirection when validator payment fails due to ineligibility
/// @param amount The amount to redirect
function _handleRewardsRedirect(uint120 amount) internal {
// ShMonad MON -> ShMonad MON
// Remove it as rewards / reserved amount and queue it to stake
s_globalCapital.reservedAmount -= amount; // -Asset Cr amount
s_globalLiabilities.rewardsPayable -= amount; // -Liability Dr amount
globalCashFlowsPtr_N(0).queueToStake += amount;
}
/// @notice Reconciles atomic pool allocation/utilization with current state during global crank.
/// @dev Preserves utilization continuity across cranks by proportionally adjusting `distributedAmount`
/// and `allocatedAmount` to the new target, then books their effects into stake/unstake queues.
function _settleGlobalNetMONAgainstAtomicUnstaking() internal {
// Called during the Global crank
// Get the current utilization rate - we want to make sure the utilization doesn't jump due to being cranked
(uint128 _oldUtilizedAmount, uint128 _oldAllocatedAmount) = _getAdjustedAmountsForAtomicUnstaking();
// Handle any overflow that may have been created by updating the targetLiquidityPercent to a smaller
// percentage of total and potentially overflowing the atomic liquidity pool. Get the new allocated and
// utilized amounts
(, uint128 _newAllocatedAmount) = _checkSetNewAtomicLiquidityTarget(_oldUtilizedAmount, _oldAllocatedAmount);
// Calculate the utilized numbers. Avoid div by zero
// Keep utilization ratio constant relative to allocation size.
uint256 _utilizedFraction =
_oldAllocatedAmount > 0 ? _scaledPercentFromAmounts(_oldUtilizedAmount, _oldAllocatedAmount) : 0;
uint128 _newUtilizedAmount = _amountFromScaledPercent(_newAllocatedAmount, _utilizedFraction).toUint128();
// Calculate the deltas
uint120 _allocatedAmountDelta = Math.dist(_oldAllocatedAmount, _newAllocatedAmount).toUint120();
uint120 _utilizedAmountDelta = Math.dist(_oldUtilizedAmount, _newUtilizedAmount).toUint120();
// NOTE: This occurs during the global crank right before the shift of globalCashFlowsPtr_N(0) ->
// globalCashFlowsPtr_N(-1). Track the adjustments we need to make to the amount being staked.
uint120 _stakeIn;
uint120 _unstakeOut;
if (_newAllocatedAmount > _oldAllocatedAmount) {
// CASE: We are increasing the atomic unstaking pool's liquidity and therefore decreasing the amount
// that will be staked next epoch.
_unstakeOut += _allocatedAmountDelta;
s_atomicAssets.allocatedAmount += _allocatedAmountDelta;
// Implied: currentAssets -= _allocatedAmountDelta;
} else {
// CASE: We are decreasing the atomic unstaking pool's liquidity and therefore increasing the amount
// that will be staked next epoch.
_stakeIn += _allocatedAmountDelta;
s_atomicAssets.allocatedAmount -= _allocatedAmountDelta; // -Asset Cr _allocatedAmountDelta
// Implied: currentAssets += _allocatedAmountDelta; // +Asset Dr _allocatedAmountDelta
}
// Avoid overflow / underflow - we can't assume that allocatedAmountDelta and utilizedAmountDelta
// are moving in the same direction
if (_newUtilizedAmount > _oldUtilizedAmount) {
// CASE: We are decreasing the atomic unstaking pool's liquidity by increasing the amount
// we treat as having already been distributed
_stakeIn += _utilizedAmountDelta;
s_atomicAssets.distributedAmount += _utilizedAmountDelta; // Contra Asset Cr +_utilizedAmountDelta
// Implied: currentAssets += _utilizedAmountDelta; // +Asset Dr _utilizedAmountDelta
} else {
// CASE: We are increasing the atomic unstaking pool's liquidity by decreasing the amount
// we treat as having already been distributed
_unstakeOut += _utilizedAmountDelta;
s_atomicAssets.distributedAmount -= _utilizedAmountDelta; // -Contra_Asset Dr _utilizedAmountDelta
// Implied: currentAssets -= _utilizedAmountDelta; // -Asset Cr _utilizedAmountDelta
}
// Apply the adjustments to the assets that will be staked next epoch
// NOTE: we try to offset debits against credits and vice versa when possible because
// this will reduce the net turnover and therefore the amount of 'unproductive' assets
CashFlows memory _globalCashFlows = globalCashFlowsPtr_N(0);
// CASE: stake delta is positive - we need to stake more unstaked assets
if (_stakeIn > _unstakeOut) {
uint120 _netStakeIn = _stakeIn - _unstakeOut;
uint120 _currentQueueForUnstake = _globalCashFlows.queueForUnstake;
// First try to net the net stake in against the queueForUnstake
if (_netStakeIn > _globalCashFlows.queueForUnstake) {
_globalCashFlows.queueForUnstake -= _currentQueueForUnstake; // = 0
_globalCashFlows.queueToStake += (_netStakeIn - _currentQueueForUnstake);
} else {
_globalCashFlows.queueForUnstake -= _netStakeIn;
}
// CASE: stake delta is negative - we need to unstake more staked assets.
} else {
uint120 _netUnstakeOut = _unstakeOut - _stakeIn;
uint120 _currentQueueToStake = _globalCashFlows.queueToStake;
// First try to net the net unstake out against the queueToStake
if (_netUnstakeOut > _currentQueueToStake) {
uint120 _netUnavailableAssets = _netUnstakeOut - _currentQueueToStake;
_globalCashFlows.queueToStake -= _currentQueueToStake; // = 0
_globalCashFlows.queueForUnstake += _netUnavailableAssets;
emit UnexpectedAtomicSettlementUnavailableAssets(
s_admin.internalEpoch,
_netUnavailableAssets,
_stakeIn,
_unstakeOut,
_globalCashFlows.queueToStake,
_globalCashFlows.queueForUnstake,
s_atomicAssets.distributedAmount,
s_atomicAssets.allocatedAmount,
uint256(s_atomicAssets.allocatedAmount) - uint256(_netUnavailableAssets)
);
// The _netUnavailableAssets take time to unstake and are not currently
// usable for atomic unstaking, so for now we decrease the allocated amount
// NOTE: _unstakeOut (and therefore _netUnstakeOut and _netUnavailableAssets)
// cannot exceed the sum of (net increase to allocatedAmount + net decrease to
// distributedAmount), making it impossible for this subtraction to break the
// invariant "allocatedAmount >= distributedAmount."
s_atomicAssets.allocatedAmount -= uint256(_netUnavailableAssets).toUint128();
} else {
_globalCashFlows.queueToStake -= _netUnstakeOut;
}
}
_setStakingQueueStorage(globalCashFlowsPtr_N(0), _globalCashFlows);
}
// ================================================== //
// Accounting Handlers - User Withdrawals + Deposits //
// ================================================== //
/// @notice Handles accounting for user withdrawals from atomic unstaking pool
/// @param netAmount The withdrawal amount (net of fee)
/// @param fee The fee amount
function _accountForWithdraw(uint256 netAmount, uint256 fee) internal override {
uint256 _allocatedAmount = s_atomicAssets.allocatedAmount;
uint256 _distributedAmount = s_atomicAssets.distributedAmount;
// Avoid SLOAD'ing the globalRevenuePtr_N(0) unless necessary. We aren't finding fee here.
// NOTE: In most cases the slot is already hot because of _getAdjustedAmountsForAtomicUnstaking()
if (_distributedAmount + netAmount > _allocatedAmount) {
Revenue storage _globalRevenuePtr = globalRevenuePtr_N(0);
uint256 _maxEarnedRevenueOffset = _globalRevenuePtr.earnedRevenue - _globalRevenuePtr.allocatedRevenue;
if (_distributedAmount + netAmount > _allocatedAmount + _maxEarnedRevenueOffset) {
revert InsufficientBalanceAtomicUnstakingPool(netAmount + fee, _allocatedAmount - _distributedAmount);
}
// Offset directly with a credit entry, initiating the unstaking process
uint120 _shortfallAmount = (_distributedAmount + netAmount - _allocatedAmount).toUint120();
globalCashFlowsPtr_N(0).queueForUnstake += _shortfallAmount;
_globalRevenuePtr.allocatedRevenue += _shortfallAmount;
// Global Accounting entries
s_atomicAssets.allocatedAmount += _shortfallAmount; // +Asset Dr _shortfallAmount
// Implied: currentAssets -= _shortfallAmount -Asset Cr _shortfallAmount
}
s_atomicAssets.distributedAmount += netAmount.toUint128();
}
/// @notice Handles accounting for user deposits
/// @param assets The deposit amount
function _accountForDeposit(uint256 assets) internal virtual override {
// Queue up the necessary staking cranks with the debit entry
globalCashFlowsPtr_N(0).queueToStake += assets.toUint120();
// Implied: currentAssets += assets; // +Asset Dr assets
// Implied: equity += assets; // +Equity Cr assets
}
/// @notice Handles accounting after unstake request is made
/// @param amount The unstake request amount
function _afterRequestUnstake(uint256 amount) internal virtual override {
// Queue up the recording unstaking activity, if necessary
uint120 _amount = amount.toUint120();
s_globalLiabilities.redemptionsPayable += _amount; // +Liability Cr amount
// Implied: equity -= amount; // -Equity Dr amount
// In extreme drawdown scenarios, clamp the allocated amount at remaining equity (excluding recent revenue)
AtomicCapital memory _atomicAssets = s_atomicAssets;
uint256 _allocatedAmount = _atomicAssets.allocatedAmount;
uint256 _remainingEquity = s_globalCapital.totalEquity(s_globalLiabilities, s_admin, address(this).balance);
uint256 _recentRevenue = _recentRevenueOffset();
// NOTE: The atomic unstaking pool is vulnerable to "sandwich" attacks if shMonad has a single large depositor
// who times their unstakes. To counter this, we optimistically reduce utilized and allocated values and at the
// cost of receiving reduced atomic unstaking fees for that epoch.
if (_allocatedAmount + _recentRevenue + amount > _remainingEquity) {
_atomicAssets.allocatedAmount -= _atomicAssets.distributedAmount; // -Asset Cr distributedAmount
_atomicAssets.distributedAmount = 0; // -ContraAsset Dr distributedAmount
s_atomicAssets = _atomicAssets;
}
globalCashFlowsPtr_N(0).queueForUnstake += amount.toUint120();
}
/// @notice Handles accounting of completion of unstake request
/// @param amount The unstake completion amount
function _beforeCompleteUnstake(uint128 amount) internal virtual override {
uint128 reservedAmount = s_globalCapital.reservedAmount;
if (reservedAmount < amount) {
// CASE: The reserved amount alone is not enough to meet the redemptions
// To get the missing amount, we remove it from the atomic liquidity pool.
uint128 _amountNeededFromAtomicLiquidity = amount - reservedAmount;
AtomicCapital memory _atomicAssets = s_atomicAssets;
uint128 _atomicAllocatedAmount = _atomicAssets.allocatedAmount;
uint128 _atomicUtilizedAmount = _atomicAssets.distributedAmount;
// The unutilized liquidity in the atomic unstaking pool must be enough to cover the required amount
require(
_atomicAllocatedAmount - Math.min(_atomicUtilizedAmount, _atomicAllocatedAmount)
>= _amountNeededFromAtomicLiquidity,
InsufficientReservedLiquidity(amount, reservedAmount)
);
// Take the last bit of the withdrawal from the atomic liquidity pool by crediting the allocated asset,
// offset by debiting the reserved amount.
s_atomicAssets.allocatedAmount -= _amountNeededFromAtomicLiquidity; // -Asset Cr
// _amountNeededFromAtomicLiquidity
s_globalCapital.reservedAmount += _amountNeededFromAtomicLiquidity; // +Asset Dr
// _amountNeededFromAtomicLiquidity;
}
// Reduce the reserved amount and the liability by the amount withdrawn
s_globalCapital.reservedAmount -= amount; // -Asset Cr amount
s_globalLiabilities.redemptionsPayable -= amount; // -Liability Dr amount
}
// ================================================== //
// Math //
// ================================================== //
/// @notice Returns atomic pool utilization/allocation adjusted for pending revenue settlement.
/// @dev Offsets `distributedAmount` by min(currentRevenue, distributed) so fee math doesn't jump at crank.
/// @return utilizedAmount Adjusted utilized (distributed) amount.
/// @return allocatedAmount Current allocated amount (unchanged).
function _getAdjustedAmountsForAtomicUnstaking()
internal
view
returns (uint128 utilizedAmount, uint128 allocatedAmount)
{
// Get the initial total amount
AtomicCapital memory _atomicAssets = s_atomicAssets;
allocatedAmount = _atomicAssets.allocatedAmount;
utilizedAmount = _atomicAssets.distributedAmount;
// If this occurs during the global crank, globalRevenuePtr_N(0) is the epoch that just ended.
// Otherwise, globalRevenuePtr_N(0) is the ongoing epoch.
Revenue memory _globalRevenue = globalRevenuePtr_N(0);
// We must subtracted any already-allocated revenue from the earned revenue to get the amount still
// available for use by the atomic unstaking pool.
uint256 _availableRevenue = uint256(_globalRevenue.earnedRevenue - _globalRevenue.allocatedRevenue);
// The _carryOverAtomicUnstakeIntoQueue() method will only settle a max amount of
// globalRevenuePtr_N(0).earnedRevenue during the global crank. This means that we can offset that
// future-settled amount here and avoid any sharp adjustments to the fee whenever we crank
utilizedAmount -= Math.min(_availableRevenue, utilizedAmount).toUint128();
return (utilizedAmount, allocatedAmount);
}
/// @notice Returns available liquidity and total allocation for atomic unstaking pool.
/// @dev Mirrors `_getAdjustedAmountsForAtomicUnstaking` adjustment to avoid fee discontinuity in previews.
/// @return currentAvailableAmount Currently withdrawable amount (allocated - adjusted utilized).
/// @return totalAllocatedAmount Total allocated (float target) for atomic pool.
function _getLiquidityForAtomicUnstaking()
internal
view
returns (uint256 currentAvailableAmount, uint256 totalAllocatedAmount)
{
// Get the initial total amount
AtomicCapital memory _atomicAssets = s_atomicAssets;
totalAllocatedAmount = uint256(_atomicAssets.allocatedAmount);
uint256 _utilizedAmount = uint256(_atomicAssets.distributedAmount);
Revenue memory _globalRevenue = globalRevenuePtr_N(0);
// We must subtracted any already-allocated revenue from the earned revenue to get the amount still
// available for use by the atomic unstaking pool.
uint256 _availableRevenue = uint256(_globalRevenue.earnedRevenue - _globalRevenue.allocatedRevenue);
// The _carryOverAtomicUnstakeIntoQueue() method will only settle a max amount of
// globalRevenuePtr_N(0).earnedRevenue during the global crank, which also resets
// globalRevenuePtr_N(0).earnedRevenue to zero. This means that we can offset that
// future-settled amount here and avoid any sharp adjustments to the fee whenever we crank
_utilizedAmount -= Math.min(_availableRevenue, _utilizedAmount).toUint128();
currentAvailableAmount = totalAllocatedAmount - _utilizedAmount;
return (currentAvailableAmount, totalAllocatedAmount);
}
// ================================================== //
// Percent Math //
// ================================================== //
/// @notice Gets target liquidity percentage scaled to `SCALE` (1e18).
/// @dev Converts `s_admin.targetLiquidityPercentage` (BPS) → scaled (1e18).
/// @return Scaled target percentage in 1e18 units.
function _scaledTargetLiquidityPercentage() internal view returns (uint256) {
return s_admin.targetLiquidityPercentage * SCALE / BPS_SCALE;
}
/// @notice Converts scaled (1e18) target liquidity percentage to unscaled BPS.
/// @param scaledTargetLiquidityPercentage Target liquidity percentage in 1e18 units.
/// @return Unscaled percentage in BPS.
function _unscaledTargetLiquidityPercentage(uint256 scaledTargetLiquidityPercentage)
internal
pure
returns (uint16)
{
return (scaledTargetLiquidityPercentage * BPS_SCALE / SCALE).toUint16();
}
/// @notice Computes a scaled percentage from two unscaled amounts.
/// @dev Returns `numerator * SCALE / denominator`. Caller must ensure `denominator > 0`.
/// @param unscaledNumeratorAmount Numerator amount (unscaled).
/// @param unscaledDenominatorAmount Denominator amount (unscaled, must be > 0).
/// @return Scaled percentage in 1e18 units.
function _scaledPercentFromAmounts(
uint256 unscaledNumeratorAmount,
uint256 unscaledDenominatorAmount
)
internal
pure
returns (uint256)
{
return unscaledNumeratorAmount * SCALE / unscaledDenominatorAmount;
}
/// @notice Applies a scaled percentage to a gross amount.
/// @dev Returns `grossAmount * scaledPercent / SCALE`.
/// @param grossAmount Gross (unscaled) amount.
/// @param scaledPercent Percentage in 1e18 units.
/// @return Resulting unscaled amount after applying percentage.
function _amountFromScaledPercent(uint256 grossAmount, uint256 scaledPercent) internal pure returns (uint256) {
return grossAmount * scaledPercent / SCALE;
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/// @notice Returns true if global crank can run based on basic readiness checks.
/// @dev Ready when: contract not frozen, all validators cranked, and new epoch available. This is essentially a
/// view function but cannot be declared as such because the Monad staking precompile absolutely hates when we call
/// its function calls view or staticcall.
function isGlobalCrankAvailable() external returns (bool) {
if (globalEpochPtr_N(0).frozen) return false;
return s_nextValidatorToCrank == LAST_VAL_ID && globalEpochPtr_N(0).epoch < _getEpoch();
}
/// @notice Returns true if a specific validator can be cranked based on basic checks.
/// @dev Ready when: contract not frozen, validatorId is valid and last epoch not cranked.
function isValidatorCrankAvailable(uint64 validatorId) external view returns (bool) {
if (globalEpochPtr_N(0).frozen) return false;
if (validatorId == 0 || validatorId == UNKNOWN_VAL_ID) return false;
address _coinbase = _validatorCoinbase(validatorId);
if (_coinbase == address(0)) return false;
return !validatorEpochPtr_N(-1, validatorId).wasCranked;
}
/// @notice Returns current working capital snapshot (no structs).
/// @return stakedAmount Total staked amount
/// @return reservedAmount Total reserved amount
function getWorkingCapital() external view returns (uint128 stakedAmount, uint128 reservedAmount) {
WorkingCapital memory _workingCapital = s_globalCapital;
return (_workingCapital.stakedAmount, _workingCapital.reservedAmount);
}
/// @notice Returns atomic capital snapshot (no structs).
/// @return allocatedAmount Total allocated amount for atomic pool
/// @return distributedAmount Amount already distributed to atomic unstakers
function getAtomicCapital() external view returns (uint128 allocatedAmount, uint128 distributedAmount) {
AtomicCapital memory _atomicCapital = s_atomicAssets;
return (_atomicCapital.allocatedAmount, _atomicCapital.distributedAmount);
}
/// @notice Returns global pending escrow snapshot (no structs).
/// @return pendingStaking Pending staking amount
/// @return pendingUnstaking Pending unstaking amount
function getGlobalPending() external view returns (uint120 pendingStaking, uint120 pendingUnstaking) {
StakingEscrow memory _stakingEscrow = s_globalPending;
return (_stakingEscrow.pendingStaking, _stakingEscrow.pendingUnstaking);
}
/// @notice Returns selected epoch global cash flows (no structs).
/// @param epochPointer Epoch selector: -2=LastLast, -1=Last, 0=Current, 1=Next (others wrap modulo tracking)
/// @return queueToStake Queue to stake for selected epoch
/// @return queueForUnstake Queue for unstake for selected epoch
function getGlobalCashFlows(int256 epochPointer)
external
view
returns (uint120 queueToStake, uint120 queueForUnstake)
{
CashFlows memory _cashFlows = globalCashFlowsPtr_N(epochPointer);
return (_cashFlows.queueToStake, _cashFlows.queueForUnstake);
}
/// @notice Returns selected epoch global rewards (no structs).
/// @param epochPointer Epoch selector: -2=LastLast, -1=Last, 0=Current, 1=Next (others wrap modulo tracking)
/// @return allocatedRevenue Revenue that has been allocated to the atomic unstaking pool this epoch
/// @return earnedRevenue Earned revenue for selected epoch
function getGlobalRevenue(int256 epochPointer)
external
view
returns (uint120 allocatedRevenue, uint120 earnedRevenue)
{
Revenue memory _revenue = globalRevenuePtr_N(epochPointer);
return (_revenue.allocatedRevenue, _revenue.earnedRevenue);
}
/// @notice Returns selected global epoch data (no structs).
/// @param epochPointer Epoch selector: -2=LastLast, -1=Last, 0=Current, 1=Next (others wrap modulo tracking)
function getGlobalEpoch(int256 epochPointer)
external
view
returns (
uint64 epoch,
uint8 withdrawalId,
bool hasWithdrawal,
bool hasDeposit,
bool crankedInBoundaryPeriod,
bool wasCranked,
bool frozen,
bool closed,
uint128 targetStakeAmount
)
{
Epoch memory _epoch = globalEpochPtr_N(epochPointer);
return (
_epoch.epoch,
_epoch.withdrawalId,
_epoch.hasWithdrawal,
_epoch.hasDeposit,
_epoch.crankedInBoundaryPeriod,
_epoch.wasCranked,
_epoch.frozen,
_epoch.closed,
_epoch.targetStakeAmount
);
}
/// @notice Returns internal epoch counter used by StakeTracker.
function getInternalEpoch() external view returns (uint64) {
return s_admin.internalEpoch;
}
/// @notice Returns selected epoch frozen/closed status convenience flags.
/// @param epochPointer Epoch selector: -2=LastLast, -1=Last, 0=Current, 1=Next (others wrap modulo tracking)
function getGlobalStatus(int256 epochPointer) external view returns (bool frozen, bool closed) {
Epoch memory _epoch = globalEpochPtr_N(epochPointer);
return (_epoch.frozen, _epoch.closed);
}
/// @notice Returns the current target liquidity percentage scaled to 1e18.
function getScaledTargetLiquidityPercentage() external view returns (uint256) {
return _scaledTargetLiquidityPercentage();
}
/// @notice Returns the global amount currently eligible to be unstaked.
function getGlobalAmountAvailableToUnstake() external view returns (uint256 amount) {
return StakeAllocationLib.getGlobalAmountAvailableToUnstake(s_globalCapital, s_globalPending);
}
/// @notice Returns current-assets per AccountingLib.
function getCurrentAssets() external view returns (uint256) {
return s_globalCapital.currentAssets(s_atomicAssets, address(this).balance);
}
// ================================================== //
// Overriding Methods //
// ================================================== //
/// @notice Returns the Monad staking precompile interface
/// @return IMonadStaking The staking precompile interface
function STAKING_PRECOMPILE() public pure override(ValidatorRegistry) returns (IMonadStaking) {
return STAKING;
}
/// @notice Modifier that sets up transient capital for unstaking settlement
modifier expectsUnstakingSettlement() override {
_setTransientCapital(CashFlowType.AllocationReduction, 0);
_;
_clearTransientCapital();
}
/// @notice Modifier that sets up transient capital for rewards settlement
modifier expectsStakingRewards() override {
_setTransientCapital(CashFlowType.Revenue, 0);
_;
_clearTransientCapital();
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { FeeParams } from "../Types.sol";
import { BPS_SCALE, RAY } from "../Constants.sol";
/// @notice Capped-linear utilization fee math.
/// @dev Responsibilities:
/// 1) Price forward (gross -> {fee, net}) and inverse (target net -> {gross, fee})
/// under r(u) = min(c + m*u, c + m) with u in WAD and rates in RAY.
/// 2) Preserve integer rounding parity between forward and inverse without searches.
/// 3) Provide a flat-cap path (L==0) and an optional per-call min-fee floor.
/// Invariants / Intent:
/// - Forward identity: net + fee == gross (always).
/// - Inverse minimality: net(gross-1) < targetNet ≤ net(gross).
/// - Fees never exceed gross; disabled fees (c==0 && m==0) bypass the min-fee.
/// - Units: mRay / cRay in RAY (1e27), utilization in WAD (1e18), assets in raw units.
/// @notice Fee math for capped-linear utilization model:
/// r(u) = min(c + m*u, c + m), with u in WAD and assets in raw units.
/// - Rates m, c are in RAY (1e27).
/// - Utilization u is in WAD (1e18), with u = max(0, 1 - R/L).
library FeeLib {
// Pre-calculated constants
uint256 internal constant WAD = 1e18;
uint256 internal constant RAY_WAD = 1e45; // RAY * WAD
uint256 internal constant RAY_WAD2 = 1e63; // RAY * WAD * WAD
// Used when no minimum fee is specified
uint256 internal constant DEFAULT_MIN_FEE_WEI = 1;
// ================================================================
// Flat-cap helpers (L == 0)
// ================================================================
/// @notice Forward fee with a flat maximum fee rate rMax = c + m (RAY). Ignores liquidity and utilization.
/// @dev Used for preview paths when target liquidity L == 0; treats the pool as fully capped across the interval.
function solveNetGivenGross_FlatMaxFee(
uint256 gross,
FeeParams memory p
)
internal
pure
returns (uint256 fee, uint256 net)
{
if (gross == 0) return (0, 0);
uint256 rMax = uint256(p.cRay) + uint256(p.mRay);
if (rMax >= RAY) {
return (gross, 0); // 100% fee wall, no net delivered
}
// Fully capped regime mirrors tail rounding: slope 1 + rMax applied to gross increment.
uint256 denom = RAY + rMax;
net = Math.mulDiv(gross, RAY, denom); // floor (never over-delivers net)
fee = gross - net;
}
/// @notice Inverse solve with flat maximum fee rate rMax = c + m (RAY). Ignores liquidity and utilization.
/// @dev Used for preview paths when target liquidity L == 0; solves g = ceil(N / (1 - rMax)).
function solveGrossGivenNet_FlatMaxFee(
uint256 targetNet,
FeeParams memory p
)
internal
pure
returns (uint256 gross, uint256 fee)
{
if (targetNet == 0) return (0, 0);
uint256 rMax = uint256(p.cRay) + uint256(p.mRay);
if (rMax >= RAY) {
// No positive net achievable at or above 100% fee.
return (0, 0);
}
uint256 numerator = RAY + rMax; // slope 1 + rMax
gross = Math.mulDivUp(targetNet, numerator, RAY);
fee = gross - targetNet;
}
// ================================================================
// Geometry / integrals
// ================================================================
/// @notice u0 in WAD from current liquidity R0 and target L.
/// @dev u0 = max(0, 1 - R0/L). If L == 0, returns 0 (caller should guard).
function utilFromLiquidity(uint256 R0, uint256 L) internal pure returns (uint256 u0Wad) {
if (L == 0) return 0;
// 1 - R0/L, scaled to WAD: u0 = WAD - (R0 * WAD / L)
uint256 frac = Math.mulDiv(R0, WAD, L);
// Clamp at 0 if R0 > L (over-supplied pool -> treat as u = 0)
u0Wad = frac >= WAD ? 0 : (WAD - frac);
}
/// @notice Integral over [uA,uB] of the *uncapped* linear rate r(u)=c + m*u, scaled to asset fee by multiplying L.
/// @dev Returns fee in asset units. Assumes uB >= uA. Pure helper for the capped integral.
function _feeIntegralLinear(
uint256 uA, // WAD
uint256 uB, // WAD
uint256 L, // assets
uint256 baseRay, // c (RAY)
uint256 slopeRay // m (RAY)
)
private
pure
returns (uint256 fee)
{
if (uB <= uA || L == 0) return 0;
unchecked {
// term1 = c * (uB - uA)
uint256 dU = uB - uA; // Result is WAD
// Use difference-of-squares as Δ(u^2) = (uB - uA) * (uB + uA).
uint256 dU2 = Math.fullMulDiv(dU, uA + uB, 1); // Result is WAD^2
// term1 numerator: baseRay * Δu (RAY * WAD).
// Using fullMulDiv(*, *, 1) gives us an exact 512-bit multiply without overflow.
uint256 term1Numerator = Math.fullMulDiv(baseRay, dU, 1);
// term2 numerator: (slopeRay * Δ(u^2)) / 2 -> (RAY * WAD^2)/2.
// Do the divide-by-2 here (floor) to mirror original semantics.
uint256 term2Numerator = Math.fullMulDiv(slopeRay, dU2, 2);
// fee = L * [ t1Num/(RAY*WAD) + t2Num/(RAY*WAD^2) ].
// Each fullMulDiv performs a 512-bit (L * numerator) / denominator with floor rounding.
uint256 term1 = Math.fullMulDiv(L, term1Numerator, RAY_WAD);
uint256 term2 = Math.fullMulDiv(L, term2Numerator, RAY_WAD2);
fee = term1 + term2;
}
}
/// @dev Enforce a per-call minimum fee floor (applied only when fees are enabled and g>0).
function _enforceMinFee(
uint256 fee,
uint256 g,
uint256 c,
uint256 m,
uint256 minFeeWei
)
private
pure
returns (uint256)
{
// No-op if disabled, zero gross, or no fees configured.
if (minFeeWei == 0 || g == 0) return fee;
if (c == 0 && m == 0) return fee; // no fees configured -> no min-fee
if (fee >= minFeeWei) return fee;
// Enforce floor but never charge more than gross.
return g < minFeeWei ? g : minFeeWei;
}
/// @notice Integral over [u0,u1] for r(u) = min(c + m*u, c + m), scaled to asset fee by L.
function feeIntegralCappedOverUtil(
uint256 u0Wad,
uint256 u1Wad,
uint256 L,
FeeParams memory p
)
internal
pure
returns (uint256 fee)
{
if (u1Wad <= u0Wad || L == 0) return 0;
uint256 m = uint256(p.mRay);
uint256 c = uint256(p.cRay);
// Degenerates to constant if slope == 0.
if (m == 0) {
uint256 dU = u1Wad - u0Wad; // WAD
return Math.mulDiv(L, c * dU, RAY * WAD);
}
// Crossing is fixed at u = WAD (100% util).
if (u1Wad <= WAD) {
return _feeIntegralLinear(u0Wad, u1Wad, L, c, m); // fully linear
}
uint256 rMax = c + m; // r(WAD)
if (u0Wad >= WAD) {
uint256 dU = u1Wad - u0Wad; // fully capped region
return Math.mulDiv(L, rMax * dU, RAY * WAD);
}
// Crossing case: [u0, WAD] linear + [WAD, u1] constant at rMax
unchecked {
uint256 feeLinear = _feeIntegralLinear(u0Wad, WAD, L, c, m);
uint256 dUConst = (u1Wad - WAD);
uint256 feeConst = Math.mulDiv(L, rMax * dUConst, RAY * WAD);
fee = feeLinear + feeConst;
}
}
// ================================================================
// Shared building blocks (ticks & boundary)
// ================================================================
/// @dev Forward-solver tick selection (linear branch) for a given gross.
/// Mirrors the quadratic seed + two-candidate snap used by `solveNetGivenGross`.
/// Returns feeAtTick only.
function _linearFeeAtGross(
uint256 gross,
uint256 u0, // WAD
uint256 dUMax, // WAD
uint256 L,
uint256 c, // RAY
uint256 m, // RAY
uint256 minFeeWei
)
private
pure
returns (uint256 feeAtTick)
{
if (gross == 0 || dUMax == 0) return 0;
// Quadratic seed on the uncapped linear curve. Two-plateau snap:
// - Candidate 0 = lower plateau (d0).
// - Candidate 1 = upper plateau (d1 = d0+1).
// We prefer the LOWER plateau when both are viable to avoid over-delivery.
uint256 A = RAY + c + Math.fullMulDiv(m, u0, WAD);
uint256 twoRayM = m * (2 * RAY);
uint256 D = A * A + Math.fullMulDiv(gross, twoRayM, L);
uint256 sD = Math.sqrt(D);
uint256 net0 = sD > A ? Math.fullMulDiv(sD - A, L, m) : 0;
// Candidate 0
uint256 d0 = Math.mulDiv(net0, WAD, L);
if (d0 > dUMax) d0 = dUMax;
uint256 fee0 = _feeIntegralLinear(u0, u0 + d0, L, c, m);
// If the integral is 0 (tiny gross / huge L), enforce the min-fee floor.
fee0 = _enforceMinFee(fee0, gross, c, m, minFeeWei);
uint256 net0f = gross - fee0;
uint256 imp0 = Math.mulDiv(net0f, WAD, L);
if (imp0 > dUMax) imp0 = dUMax;
if (imp0 == d0) {
return fee0;
}
// Candidate 1
uint256 d1 = d0 < dUMax ? d0 + 1 : dUMax;
if (d1 == d0) {
return fee0;
}
uint256 fee1 = _feeIntegralLinear(u0, u0 + d1, L, c, m);
// If fee1 is 0, it means the integral is 0, which means the utilization is 0.
// In this case, we need to round up to the minimum fee.
fee1 = _enforceMinFee(fee1, gross, c, m, minFeeWei);
uint256 net1f = gross - fee1;
uint256 imp1 = Math.mulDiv(net1f, WAD, L);
if (imp1 > dUMax) imp1 = dUMax;
if (imp1 == d1) {
return fee1;
}
// True 2-cycle -> choose LOWER plateau (fee already min-clamped if needed).
return fee0;
}
/// @dev Solve linear region at gross using the forward tick snap.
function _solveLinearAtGross(
uint256 gross,
uint256 u0,
uint256 dUMax,
uint256 L,
uint256 c,
uint256 m,
uint256 minFeeWei
)
private
pure
returns (uint256 fee, uint256 net)
{
uint256 feeAtTick = _linearFeeAtGross(gross, u0, dUMax, L, c, m, minFeeWei);
fee = feeAtTick;
net = gross - fee;
}
/// @dev Compute boundary tuple once.
/// Returns:
/// - u0 : starting utilization (WAD)
/// - dUMax : WAD - u0
/// - net1 : net to reach u=1 (assets)
/// - gross1 : gross to reach u=1 (net1 + fee(u0 -> 1) under linear part)
/// - rMax : c + m
function _boundaryFor(
uint256 R0,
uint256 L,
uint256 c,
uint256 m
)
private
pure
returns (uint256 u0, uint256 dUMax, uint256 net1, uint256 gross1, uint256 rMax)
{
u0 = utilFromLiquidity(R0, L);
dUMax = WAD - u0;
net1 = Math.mulDiv(dUMax, L, WAD);
uint256 feeToCap = _feeIntegralLinear(u0, WAD, L, c, m);
gross1 = net1 + feeToCap;
rMax = c + m;
}
// ================================================================
// Forward: gross -> (fee, net)
// ================================================================
/// @notice Forward (gross -> (fee, net)) with net-path semantics:
/// gross = net + fee(u0 -> u0 + net/L), r(u) = min(c + m*u, c + m).
/// @dev Linear region uses quadratic seed + two-candidate snap. Tail is piecewise with slope 1+rMax.
function solveNetGivenGross(
uint256 g,
uint256 R0,
uint256 L,
FeeParams memory p
)
internal
pure
returns (uint256 fee, uint256 net)
{
return solveNetGivenGrossWithMinFee(g, R0, L, p, DEFAULT_MIN_FEE_WEI);
}
/// @notice Forward with explicit min fee floor (applied in all branches).
function solveNetGivenGrossWithMinFee(
uint256 gross,
uint256 R0,
uint256 L,
FeeParams memory p,
uint256 minFeeWei
)
internal
pure
returns (uint256 fee, uint256 net)
{
if (gross == 0) return (0, 0);
uint256 c = uint256(p.cRay);
uint256 m = uint256(p.mRay);
// L == 0 uses flat rMax semantics but still must respect the min-fee floor on the total fee.
if (L == 0) {
(uint256 feeFlat,) = solveNetGivenGross_FlatMaxFee(gross, p);
feeFlat = _enforceMinFee(feeFlat, gross, c, m, minFeeWei);
return (feeFlat, gross - feeFlat);
}
// Constant-rate: g = (1 + c) * net (fee charged on net)
if (m == 0) {
uint256 denom = RAY + c;
net = Math.mulDiv(gross, RAY, denom); // floor
fee = gross - net;
fee = _enforceMinFee(fee, gross, c, m, minFeeWei);
net = gross - fee;
return (fee, net);
}
(uint256 u0, uint256 dUMax, uint256 net1, uint256 gross1, uint256 rMax) = _boundaryFor(R0, L, c, m);
if (gross <= gross1) {
// Linear region — single helper mirrors solver tick snap with mandatory min-fee rounding.
return _solveLinearAtGross(gross, u0, dUMax, L, c, m, minFeeWei);
}
// Tail: piecewise linear with slope 1 + rMax
// net2 = floor((gross - gross1) * RAY / (RAY + rMax)); fee2 = (gross - gross1) - net2
uint256 net2 = Math.mulDiv((gross - gross1), RAY, (RAY + rMax));
uint256 netTail = net1 + net2;
uint256 feeTail = gross - netTail; // exact by construction
feeTail = _enforceMinFee(feeTail, gross, c, m, minFeeWei);
return (feeTail, gross - feeTail);
}
// ================================================================
// Inverse: target net -> (gross, fee)
// ================================================================
/// @dev Linear-region inverse that:
/// (1) seeds on the lower plateau,
/// (2) calibrates to the forward tick at that gross,
/// (3) enforces 1‑wei minimality: net(gross - 1) < targetNet.
function _inverseLinearCalibrated(
uint256 targetNet,
uint256 u0,
uint256 dUMax,
uint256 L,
uint256 c,
uint256 m,
uint256 minFeeWei
)
private
pure
returns (uint256 gross, uint256 fee)
{
// Seed gross by pricing the lower implied tick.
uint256 tickImplied = Math.mulDiv(targetNet, WAD, L); // floor implied Δu
if (tickImplied > dUMax) tickImplied = dUMax;
uint256 tickSeed = tickImplied == 0 ? 0 : (tickImplied - 1);
uint256 feeSeed = _feeIntegralLinear(u0, u0 + tickSeed, L, c, m);
uint256 grossSeed = targetNet + feeSeed;
// Align to the tick the forward will actually select at grossSeed.
uint256 feeAligned = _linearFeeAtGross(grossSeed, u0, dUMax, L, c, m, minFeeWei);
gross = targetNet + feeAligned;
fee = feeAligned;
// Enforce minimality envelope: net(gross - 1) < targetNet.
if (gross > 0) {
uint256 feeMinus = _linearFeeAtGross(gross - 1, u0, dUMax, L, c, m, minFeeWei);
// If dropping 1 wei still meets/exceeds target, shift down one plateau.
if ((gross - 1) >= feeMinus && (gross - 1 - feeMinus) >= targetNet) {
gross = targetNet + feeMinus;
fee = feeMinus;
}
}
}
/// @notice Inverse (preview): given target net, return (gross, fee).
/// @dev O(1), no binary search. Matches forward rounding semantics exactly.
function solveGrossGivenNet(
uint256 targetNet,
uint256 R0,
uint256 L,
FeeParams memory p
)
internal
pure
returns (uint256 gross, uint256 fee)
{
return solveGrossGivenNetWithMinFee(targetNet, R0, L, p, DEFAULT_MIN_FEE_WEI);
}
/// @notice Inverse with explicit min fee floor (mirrors forward).
function solveGrossGivenNetWithMinFee(
uint256 targetNet,
uint256 R0,
uint256 L,
FeeParams memory p,
uint256 minFeeWei
)
internal
pure
returns (uint256 gross, uint256 fee)
{
if (targetNet == 0) return (0, 0);
uint256 c = uint256(p.cRay);
uint256 m = uint256(p.mRay);
// L == 0 uses flat rMax semantics (including 100% wall) and applies min-fee on total fee.
if (L == 0) {
(uint256 grossFlat, uint256 feeFlat) = solveGrossGivenNet_FlatMaxFee(targetNet, p);
if (grossFlat == 0 && feeFlat == 0) return (0, 0); // 100% fee wall case
feeFlat = _enforceMinFee(feeFlat, grossFlat, c, m, minFeeWei);
grossFlat = targetNet + feeFlat;
return (grossFlat, feeFlat);
}
// Constant-rate (fee charged on net): gross = net + floor(c * net / RAY)
if (m == 0) {
uint256 feeOnNet = Math.mulDiv(targetNet, c, RAY);
feeOnNet = _enforceMinFee(feeOnNet, targetNet + feeOnNet, c, m, minFeeWei);
return (targetNet + feeOnNet, feeOnNet);
}
(uint256 u0, uint256 dUMax, uint256 net1, uint256 gross1, uint256 rMax) = _boundaryFor(R0, L, c, m);
if (targetNet <= net1) {
return _inverseLinearCalibrated(targetNet, u0, dUMax, L, c, m, minFeeWei);
}
// Tail: exact rounding inverse to match forward
uint256 net2 = targetNet - net1;
uint256 dG2 = Math.mulDivUp(net2, (RAY + rMax), RAY); // minimal gross to deliver net2
gross = gross1 + dG2;
fee = gross - targetNet;
fee = _enforceMinFee(fee, gross, c, m, minFeeWei);
gross = targetNet + fee;
return (gross, fee);
}
// ================================================================
// Other helpers
// ================================================================
/// @notice Fee for delivering exactly `net` units (net-path), with utilization evolving as u1 = u0 + net/L.
/// @dev Handles capping internally via feeIntegralCappedOverUtil; for L==0, applies flat rMax.
function feeGivenNet(uint256 net, uint256 R0, uint256 L, FeeParams memory p) internal pure returns (uint256 fee) {
if (net == 0) return 0;
// Fully capped assumption when L == 0 (same semantics as other L==0 paths).
if (L == 0) {
uint256 rMax = uint256(p.cRay) + uint256(p.mRay);
if (rMax >= RAY) return net; // 100% fee wall
return Math.mulDiv(net, rMax, RAY);
}
uint256 u0 = utilFromLiquidity(R0, L);
// net-path integral with CEIL on Δu = ceil(net/L) to avoid undercharging.
uint256 dU = Math.mulDivUp(net, WAD, L);
uint256 u1 = u0 + dU;
if (uint256(p.mRay) == 0 || u1 <= WAD) {
// Cheaper when fully linear.
return _feeIntegralLinear(u0, u1, L, uint256(p.cRay), uint256(p.mRay));
}
return feeIntegralCappedOverUtil(u0, u1, L, p);
}
/// @notice Same as `feeGivenNet` but enforces a min-fee floor on the total fee.
/// @dev Provided for completeness to mirror the *WithMinFee family; original function kept unchanged.
function feeGivenNetWithMinFee(
uint256 net,
uint256 R0,
uint256 L,
FeeParams memory p,
uint256 minFeeWei
)
internal
pure
returns (uint256 fee)
{
fee = feeGivenNet(net, R0, L, p);
// Apply the min-fee on the total fee; gross = net + fee
fee = _enforceMinFee(fee, net + fee, uint256(p.cRay), uint256(p.mRay), minFeeWei);
}
/// @notice Calculates the pool's target liquidity using a percentage expressed in basis points (1e4 = 100%).
/// @dev Callers working with 1e18-scale percentages should convert via `_unscaledTargetLiquidityPercentage`.
function calcTargetLiquidity(
uint256 totalEquity,
uint256 targetLiquidityPercentage
)
internal
pure
returns (uint256 targetLiquidity)
{
if (targetLiquidityPercentage == 0) return 0; // If targetLiqPercentage is 0, return early
// Calculate target liquidity as a percentage of total assets
targetLiquidity = Math.mulDiv(totalEquity, targetLiquidityPercentage, BPS_SCALE);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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.1.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 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.1.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
// import { TestnetHarness } from "./testnet/TestnetHarness.sol";
import { FastLaneERC4626 } from "./FLERC4626.sol";
import { Coinbase } from "./Coinbase.sol";
import { STAKING_GAS_BUFFER, STAKING_GAS_GET_VALIDATOR } from "./Constants.sol";
import {
Epoch,
PendingBoost,
CashFlows,
ValidatorStats,
StakingEscrow,
ValidatorData,
ValidatorDataStorage
} from "./Types.sol";
import { StorageLib } from "./libraries/StorageLib.sol";
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
import {
SCALE,
STAKING,
SHMONAD_VALIDATOR_DEACTIVATION_PERIOD,
BPS_SCALE,
EPOCHS_TRACKED,
UNKNOWN_VAL_ID,
UNKNOWN_VAL_ADDRESS,
LAST_VAL_ID,
FIRST_VAL_ID,
COINBASE_SALT
} from "./Constants.sol";
/*
WARNING: Validator ID vs. `block.coinbase` Addresses on Monad
- Block Author Address (block.coinbase): On Monad this is NOT a unique identifier
for a validator. Multiple validator IDs can share the same block.coinbase address.
As a result, ShMonad MUST NOT infer validator identity from block.coinbase.
- Registry Mappings in this file:
- s_valCoinbases[valId] -> coinbaseContractAddress
- s_valIdByCoinbase[coinbaseContractAddress] -> valId
These mappings are ONLY for the per‑validator Coinbase contract, NOT the
network’s block.coinbase author address.
- Primary Key is Validator ID: All runtime logic, cranking, accounting, and
precompile calls must key off validator IDs. PrecompileHelpers obtains the
current proposer via STAKING.getProposerValId() and never relies on
block.coinbase. When ShMonad needs a coinbase address (for events or to call
ICoinbase.process), it derives it from the validator ID via _validatorCoinbase.
- Where this matters:
- Events that include a "coinbase" field reference the per‑validator Coinbase
contract address for operator visibility.
- Crank ordering uses a linked list indexed by validator IDs (FIRST_VAL_ID /
LAST_VAL_ID sentinels). No address‑based sentinels remain.
- Do not attempt to map block.coinbase -> validator ID in this contract; use
the precompile (getProposerValId) or the stored valId -> coinbase mapping.
*/
abstract contract ValidatorRegistry is FastLaneERC4626 {
using Math for uint256;
using SafeTransferLib for address;
using SafeCastLib for uint256;
using StorageLib for CashFlows;
using StorageLib for StakingEscrow;
using StorageLib for PendingBoost;
// ================================================== //
// Admin Functions //
// ================================================== //
// Queue up a deactivation
// NOTE: Takes 5 epochs to complete
function deactivateValidator(uint64 validatorId) external virtual onlyOwner {
_beginDeactivatingValidator(validatorId);
}
/// @notice Adds a validator and primes its epoch windows without affecting ordering.
/// @dev Validates existence via precompile (except UNKNOWN placeholder during init).
/// Inserts at tail of the crank linked list; enforces one id ↔ one coinbase mapping.
/// Reverts if attempting to reuse sentinel addresses or if validator not fully removed.
function addValidator(uint64 validatorId, address coinbase) external virtual onlyOwner {
require(validatorId != UNKNOWN_VAL_ID, InvalidValidatorId(validatorId));
_addValidator(validatorId, coinbase);
}
function addValidator(uint64 validatorId) external virtual onlyOwner returns (address coinbase) {
require(validatorId != UNKNOWN_VAL_ID, InvalidValidatorId(validatorId));
coinbase = _deployOrGetCoinbaseContractAddress(validatorId);
_addValidator(validatorId, coinbase);
}
function updateStakingCommission(uint16 feeInBps) external virtual onlyOwner {
require(feeInBps < BPS_SCALE, CommissionMustBeBelow100Percent());
s_admin.stakingCommission = feeInBps;
}
function updateBoostCommission(uint16 feeInBps) external virtual onlyOwner {
require(feeInBps < BPS_SCALE, CommissionMustBeBelow100Percent());
s_admin.boostCommissionRate = feeInBps;
}
function updateIncentiveAlignmentPercentage(uint16 percentageInBps) external virtual onlyOwner {
require(percentageInBps < BPS_SCALE, PercentageMustBeBelow100Percent());
s_admin.incentiveAlignmentPercentage = percentageInBps;
}
function setFrozenStatus(bool isFrozen) external virtual onlyOwner {
globalEpochPtr_N(0).frozen = isFrozen;
}
function setClosedStatus(bool isClosed) external virtual onlyOwner {
globalEpochPtr_N(0).closed = isClosed;
}
function _addValidator(uint64 validatorId, address coinbase) internal {
require(validatorId != 0, InvalidValidatorId(validatorId));
require(coinbase != address(0), ZeroAddress());
require(
!s_validatorIsActive[UNKNOWN_VAL_ID] || coinbase != UNKNOWN_VAL_ADDRESS, InvalidValidatorAddress(coinbase)
);
// Verify validator exists in precompile (unless it's the UNKNOWN_VAL_ID placeholder used during init)
// Public entry points explicitly reject UNKNOWN_VAL_ID, so it can only reach here during initialization
if (validatorId != UNKNOWN_VAL_ID) {
// Note: Real precompile returns zeros for missing, mock reverts with UnknownValidator()
try STAKING.getValidator{ gas: STAKING_GAS_GET_VALIDATOR + STAKING_GAS_BUFFER }(validatorId) returns (
address authAddress,
uint64,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256,
bytes memory,
bytes memory
) {
require(authAddress != address(0), ValidatorNotFoundInPrecompile(validatorId));
} catch {
revert ValidatorNotFoundInPrecompile(validatorId);
}
}
// Disallow re-adding an active validator
if (s_validatorIsActive[validatorId]) revert ValidatorAlreadyAdded();
// If the coinbase is already linked:
// - to a different validatorId: treat as already added
// - to the same validatorId: treat as not fully removed
uint64 _existingForCoinbase = s_valIdByCoinbase[coinbase];
if (_existingForCoinbase != 0) {
if (_existingForCoinbase == validatorId) revert ValidatorNotFullyRemoved();
revert ValidatorAlreadyAdded();
}
++s_activeValidatorCount;
// Validator must be fully removed (which takes a min of SHMONAD_VALIDATOR_DEACTIVATION_PERIOD from when
// deactivation is initiated) before they can be added again.
for (uint256 i; i < EPOCHS_TRACKED; i++) {
if (s_validatorEpoch[validatorId][i].epoch != 0) revert ValidatorNotFullyRemoved();
}
s_validatorIsActive[validatorId] = true;
s_validatorData[validatorId].isActive = true;
// Initialize the in-active-set flag based on the precompile's current view
s_validatorData[validatorId].inActiveSet_Current = _isValidatorInActiveSet(validatorId);
_linkValidatorCoinbase(validatorId, coinbase);
uint64 _currentEpoch = s_admin.internalEpoch;
// Initialize s_validatorEpoch for the new validator
_setEpochStorage(
validatorEpochPtr_N(1, validatorId),
Epoch({
epoch: _currentEpoch + 1,
withdrawalId: 1,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: false,
frozen: false,
closed: false,
targetStakeAmount: 0
})
);
_setEpochStorage(
validatorEpochPtr_N(0, validatorId),
Epoch({
epoch: _currentEpoch,
withdrawalId: 1,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: true,
frozen: false,
closed: false,
targetStakeAmount: 0
})
);
if (_currentEpoch > 0) --_currentEpoch;
_setEpochStorage(
validatorEpochPtr_N(-1, validatorId),
Epoch({
epoch: _currentEpoch,
withdrawalId: 1,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: true,
frozen: false,
closed: false,
targetStakeAmount: 0
})
);
if (_currentEpoch > 0) --_currentEpoch;
_setEpochStorage(
validatorEpochPtr_N(-2, validatorId),
Epoch({
epoch: _currentEpoch,
withdrawalId: 1,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: true,
frozen: false,
closed: false,
targetStakeAmount: 0
})
);
if (_currentEpoch > 0) --_currentEpoch;
_setEpochStorage(
validatorEpochPtr_N(-3, validatorId),
Epoch({
epoch: _currentEpoch,
withdrawalId: 1,
hasWithdrawal: false,
hasDeposit: false,
crankedInBoundaryPeriod: false,
wasCranked: true,
frozen: false,
closed: false,
targetStakeAmount: 0
})
);
validatorRewardsPtr_N(0, validatorId).clear();
validatorRewardsPtr_N(1, validatorId).clear();
validatorPendingPtr_N(0, validatorId).clear();
validatorPendingPtr_N(1, validatorId).clear();
// Update the link pointers
_addValidatorToCrankSequence(validatorId);
emit ValidatorAdded(validatorId, coinbase);
}
/// @notice Checks if a validator is in the active set and caches the result in transient storage.
function _isValidatorInActiveSetTransient(uint64 valId) internal returns (bool) {
if (valId == UNKNOWN_VAL_ID) {
// Placeholder validator represents unregistered-flow accounting and must always stay "active".
return true;
}
if (t_validatorActiveSetCheckValId != valId) {
bool _isActive = _isValidatorInActiveSet(valId);
t_validatorActiveSetCheckValId = valId;
t_validatorActiveSetCheckValIdState = _isActive;
return _isActive;
}
return t_validatorActiveSetCheckValIdState;
}
/// @notice Marks a validator as not in the active set and clears the transient cache.
function _markValidatorNotInActiveSet(uint64 valId, uint256 detectionIndex) internal {
bool _stillActive = s_validatorData[valId].inActiveSet_Current && _isValidatorInActiveSetTransient(valId);
if (_stillActive) return;
if (s_validatorData[valId].inActiveSet_Current) s_validatorData[valId].inActiveSet_Current = false;
emit ValidatorNotFoundInActiveSet(valId, s_valCoinbases[valId], globalEpochPtr_N(0).epoch, detectionIndex);
}
function _beginDeactivatingValidator(uint64 validatorId) internal {
address _coinbase = s_valCoinbases[validatorId];
require(s_validatorData[validatorId].isActive, ValidatorAlreadyDeactivated());
--s_activeValidatorCount;
s_validatorData[validatorId].isActive = false;
s_validatorData[validatorId].epoch = s_admin.internalEpoch;
emit ValidatorMarkedInactive(validatorId, _coinbase, s_admin.internalEpoch);
}
function _completeDeactivatingValidator(uint64 validatorId) internal virtual {
require(s_validatorIsActive[validatorId], ValidatorAlreadyDeactivated());
address _coinbase = s_valCoinbases[validatorId];
// validator deactivation queue takes 7 epochs
require(!s_validatorData[validatorId].isActive, ValidatorDeactivationNotQueued());
require(
s_admin.internalEpoch >= s_validatorData[validatorId].epoch + SHMONAD_VALIDATOR_DEACTIVATION_PERIOD,
ValidatorDeactivationQueuedIncomplete()
);
// Setting this enables future reactivation
validatorEpochPtr_N(0, validatorId).epoch = 0;
delete s_validatorIsActive[validatorId];
_unlinkValidatorCoinbase(validatorId);
delete s_validatorData[validatorId];
// Remove this validator from the link and connect together the validators on either end
_removeValidatorFromCrankSequence(validatorId);
for (uint256 i; i < EPOCHS_TRACKED; i++) {
delete s_validatorEpoch[validatorId][i];
delete s_validatorRewards[validatorId][i];
delete s_validatorPending[validatorId][i];
}
emit ValidatorDeactivated(validatorId);
}
function _removeValidatorFromCrankSequence(uint64 validatorId) internal {
uint64 _nextValidator = s_valLinkNext[validatorId];
uint64 _previousValidator = s_valLinkPrevious[validatorId];
s_valLinkNext[_previousValidator] = _nextValidator;
s_valLinkPrevious[_nextValidator] = _previousValidator;
}
function _addValidatorToCrankSequence(uint64 validatorId) internal {
uint64 _previousTailValidator = s_valLinkPrevious[LAST_VAL_ID];
s_valLinkNext[_previousTailValidator] = validatorId;
s_valLinkPrevious[validatorId] = _previousTailValidator;
s_valLinkNext[validatorId] = LAST_VAL_ID;
s_valLinkPrevious[LAST_VAL_ID] = validatorId;
}
// ================================================== //
// validatorId <-> block.coinbase map //
// ================================================== //
/// @dev Establishes 1:1 link between `valId` and `coinbase`. Reverts if either already linked.
/// Invariant after success: `s_valCoinbases[valId] == coinbase` and `s_validatorData[coinbase].id == valId`.
function _linkValidatorCoinbase(uint64 valId, address coinbase) internal {
if (coinbase == address(0)) revert ZeroAddress();
if (s_valCoinbases[valId] != address(0) || s_valIdByCoinbase[coinbase] > 0) revert ValidatorAlreadyAdded();
s_valCoinbases[valId] = coinbase;
s_valIdByCoinbase[coinbase] = valId;
}
/// @dev Clears 1:1 link between `valId` and its existing `coinbase`, if any.
/// Invariant after success: `s_valCoinbases[valId] == address(0)` and `s_validatorData[coinbase].id == 0`.
function _unlinkValidatorCoinbase(uint64 valId) internal {
address _coinbase = s_valCoinbases[valId];
if (_coinbase != address(0)) {
delete s_valIdByCoinbase[_coinbase];
delete s_valCoinbases[valId];
}
}
function _validatorCoinbase(uint64 valId) internal view returns (address) {
return s_valCoinbases[valId];
}
function _getValidatorData(uint64 valId) internal view returns (ValidatorData memory) {
ValidatorDataStorage memory _validatorData = s_validatorData[valId];
address coinbase = s_valCoinbases[valId];
return ValidatorData({
epoch: _validatorData.epoch,
id: valId,
isPlaceholder: valId == UNKNOWN_VAL_ID,
isActive: _validatorData.isActive,
inActiveSet_Current: _validatorData.inActiveSet_Current,
inActiveSet_Last: _validatorData.inActiveSet_Last,
coinbase: coinbase
});
}
// ================================================== //
// Coinbase Deployment Helpers //
// ================================================== //
function _coinbaseSalt(uint64 validatorId) internal pure returns (bytes32) {
// Domain-separated salt for safety across potential future CREATE2 usages.
return keccak256(abi.encodePacked(COINBASE_SALT, validatorId));
}
function _predictCreate2Address(bytes32 salt, bytes32 initCodeHash) internal view returns (address predicted) {
// address = keccak256(0xff ++ deployer ++ salt ++ keccak256(init_code))[12:]
predicted =
address(uint160(uint256(keccak256(abi.encodePacked(bytes1(0xff), address(this), salt, initCodeHash)))));
}
function _coinbaseInitCode(uint64 validatorId) internal pure returns (bytes memory) {
return abi.encodePacked(type(Coinbase).creationCode, abi.encode(validatorId));
}
function _coinbaseInitCodeHash(uint64 validatorId) internal pure returns (bytes32) {
return keccak256(_coinbaseInitCode(validatorId));
}
function _predictCoinbaseAddress(uint64 validatorId) internal view returns (address) {
return _predictCreate2Address(_coinbaseSalt(validatorId), _coinbaseInitCodeHash(validatorId));
}
function _deployOrGetCoinbaseContractAddress(uint64 validatorId) internal returns (address coinbase) {
bytes32 salt = _coinbaseSalt(validatorId);
bytes memory creationCode = _coinbaseInitCode(validatorId);
address predicted = _predictCoinbaseAddress(validatorId);
if (predicted.code.length == 0) {
address deployed;
assembly ("memory-safe") {
deployed := create2(0, add(creationCode, 0x20), mload(creationCode), salt)
}
coinbase = deployed;
require(coinbase != address(0), Create2Failed());
} else {
coinbase = predicted;
}
}
// ================================================== //
// View Functions //
// ================================================== //
/// @notice Returns the deterministic Coinbase address for a validator without deploying it.
/// @dev Reverts for invalid placeholders to mirror addValidator checks.
function previewCoinbaseAddress(uint64 validatorId) external view returns (address predicted) {
require(validatorId != 0 && validatorId != UNKNOWN_VAL_ID, InvalidValidatorId(validatorId));
predicted = _predictCoinbaseAddress(validatorId);
}
function getValidatorStats(uint64 validatorId) external view returns (ValidatorStats memory stats) {
address coinbase = s_valCoinbases[validatorId];
stats.isActive = s_validatorData[validatorId].isActive;
require(stats.isActive || coinbase != address(0), InvalidValidatorId(validatorId));
Epoch memory _validatorEpoch = validatorEpochPtr_N(-1, validatorId);
PendingBoost memory _rewardsLast = validatorRewardsPtr_N(-1, validatorId);
PendingBoost memory _rewardsCurrent = validatorRewardsPtr_N(0, validatorId);
stats.coinbase = coinbase;
stats.lastEpoch = _validatorEpoch.epoch;
stats.targetStakeAmount = _validatorEpoch.targetStakeAmount;
stats.rewardsPayableLast = _rewardsLast.rewardsPayable;
stats.earnedRevenueLast = _rewardsLast.earnedRevenue;
stats.rewardsPayableCurrent = _rewardsCurrent.rewardsPayable;
stats.earnedRevenueCurrent = _rewardsCurrent.earnedRevenue;
}
function isValidatorActive(uint64 validatorId) external view returns (bool) {
return s_validatorIsActive[validatorId];
}
/// @notice Mirrors precompile epoch; startBlock not provided by precompile → returns 0.
function getEpochInfo() external returns (uint256 epochNumber, uint256 epochStartBlock) {
(uint64 e,) = STAKING.getEpoch();
return (uint256(e), 0);
}
function getValidatorCoinbase(uint256 validatorId) external view returns (address) {
return _validatorCoinbase(validatorId.toUint64());
}
function getValidatorIdForCoinbase(address coinbase) external view returns (uint256) {
return s_valIdByCoinbase[coinbase];
}
function _validatorIdForCoinbase(address coinbase) internal view override returns (uint64) {
return s_valIdByCoinbase[coinbase];
}
/// @notice Returns detailed validator data (no structs) for a validatorId.
function getValidatorData(uint64 validatorId)
external
view
returns (
uint64 epoch,
uint64 id,
bool isPlaceholder,
bool isActive,
bool inActiveSet_Current,
bool inActiveSet_Last,
address coinbase
)
{
ValidatorData memory _validatorData = _getValidatorData(validatorId);
return (
_validatorData.epoch,
_validatorData.id,
_validatorData.isPlaceholder,
_validatorData.isActive,
_validatorData.inActiveSet_Current,
_validatorData.inActiveSet_Last,
_validatorData.coinbase
);
}
/// @notice Returns the active validator set as parallel arrays of ids and coinbases.
function listActiveValidators() external view returns (uint64[] memory validatorIds, address[] memory coinbases) {
uint256 count = s_activeValidatorCount;
validatorIds = new uint64[](count);
coinbases = new address[](count);
uint64 cursorId = s_valLinkNext[FIRST_VAL_ID];
uint256 i;
while (cursorId != LAST_VAL_ID && i < count) {
if (cursorId != UNKNOWN_VAL_ID) {
uint64 valId = cursorId;
if (valId != 0 && s_validatorData[valId].isActive) {
validatorIds[i] = valId;
coinbases[i] = s_valCoinbases[valId];
unchecked {
++i;
}
}
}
cursorId = s_valLinkNext[cursorId];
}
}
/// @notice Returns last and current epoch values for a validator.
function getValidatorEpochs(uint64 validatorId)
external
view
returns (uint64 lastEpoch, uint128 lastTargetStakeAmount, uint64 currentEpoch, uint128 currentTargetStakeAmount)
{
Epoch memory _last = validatorEpochPtr_N(-1, validatorId);
Epoch memory _current = validatorEpochPtr_N(0, validatorId);
return (_last.epoch, _last.targetStakeAmount, _current.epoch, _current.targetStakeAmount);
}
/// @notice Returns last and current pending escrow values for a validator.
function getValidatorPendingEscrow(uint64 validatorId)
external
view
returns (
uint120 lastPendingStaking,
uint120 lastPendingUnstaking,
uint120 currentPendingStaking,
uint120 currentPendingUnstaking
)
{
StakingEscrow memory _last = validatorPendingPtr_N(-1, validatorId);
StakingEscrow memory _current = validatorPendingPtr_N(0, validatorId);
return (_last.pendingStaking, _last.pendingUnstaking, _current.pendingStaking, _current.pendingUnstaking);
}
/// @notice Returns last and current rewards tracking for a validator.
function getValidatorRewards(uint64 validatorId)
external
view
returns (
uint120 lastRewardsPayable,
uint120 lastEarnedRevenue,
uint120 currentRewardsPayable,
uint120 currentEarnedRevenue
)
{
PendingBoost memory _last = validatorRewardsPtr_N(-1, validatorId);
PendingBoost memory _current = validatorRewardsPtr_N(0, validatorId);
return (_last.rewardsPayable, _last.earnedRevenue, _current.rewardsPayable, _current.earnedRevenue);
}
/// @notice Returns crank linked-list neighbors for a validator (previous, next).
function getValidatorNeighbors(uint64 validatorId) external view returns (address previous, address next) {
uint64 prevId = s_valLinkPrevious[validatorId];
uint64 nextId = s_valLinkNext[validatorId];
previous = (prevId == FIRST_VAL_ID || prevId == LAST_VAL_ID) ? address(0) : s_valCoinbases[prevId];
next = (nextId == FIRST_VAL_ID || nextId == LAST_VAL_ID) ? address(0) : s_valCoinbases[nextId];
}
/// @notice Returns active validator count.
function getActiveValidatorCount() external view returns (uint256) {
return s_activeValidatorCount;
}
/// @notice Returns next validator scheduled to crank.
function getNextValidatorToCrank() external view returns (address) {
// Start from the current cursor. If we're at the FIRST sentinel,
// peek the first node after it (which may be UNKNOWN_VAL_ID).
uint64 id = s_nextValidatorToCrank;
if (id == FIRST_VAL_ID) id = s_valLinkNext[FIRST_VAL_ID];
// By construction, UNKNOWN_VAL_ID is always immediately after FIRST_VAL_ID
// and never appears elsewhere in the list. Skip it if encountered.
if (id == UNKNOWN_VAL_ID) id = s_valLinkNext[UNKNOWN_VAL_ID];
if (id == LAST_VAL_ID) return address(0);
return s_valCoinbases[id];
}
function STAKING_PRECOMPILE() public pure virtual override(FastLaneERC4626) returns (IMonadStaking);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { CashFlows, PendingBoost, Epoch, StakingEscrow, WorkingCapital, ValidatorData, Revenue } from "../Types.sol";
import { MIN_VALIDATOR_DEPOSIT, DUST_THRESHOLD } from "../Constants.sol";
library StakeAllocationLib {
using Math for uint256;
/// @dev Average of two unsigned integers.
function _avg(uint256 a, uint256 b) private pure returns (uint256) {
return (a + b) / 2;
}
/// @dev Saturating subtraction: returns a - b if a > b, else 0.
function _saturatingSub(uint256 a, uint256 b) private pure returns (uint256) {
return a > b ? a - b : 0;
}
/// @notice Computes a validator's stake delta for the current epoch.
/// @dev Combines:
/// (1) cash-flow driven increases proportional to smoothed earned revenue share,
/// (2) cash-flow driven decreases proportional to available-to-unstake capacity,
/// (3) withdrawal dust/rounding protections.
/// Global has been cranked already when this runs; use Last/LastLast epochs accordingly.
/// @param globalCashFlows_Last Global cash flows for last epoch.
/// @param globalRevenue_LastLast Global revenue from two epochs ago (for smoothing).
/// @param globalRevenue_Last Global revenue from last epoch (for smoothing).
/// @param validatorRewards_LastLast Validator rewards from two epochs ago (for smoothing).
/// @param validatorRewards_Last Validator rewards from last epoch (for smoothing).
/// @param validatorEpoch_Last Validator's last completed epoch view (target stake reference).
/// @param validatorAmountAvailableToUnstake Per-validator liquid amount available to unstake now.
/// @param globalAmountAvailableToUnstake Global liquid amount available to unstake now.
/// @return targetValidatorStake New validator target stake for current epoch window.
/// @return netAmount Absolute delta magnitude (increase or decrease).
/// @return isWithdrawal True when delta is a decrease (unstake), false when increase (stake).
/// @return stakeAllocationIncrease The gross unstakeed to queue to stake before netting against
/// stakeAllocationDecrease
/// @return stakeAllocationDecrease The gross staked assets to queue for unstake before netting against
/// stakeAllocationIncrease
function calculateValidatorEpochStakeDelta(
CashFlows memory globalCashFlows_Last,
Revenue memory globalRevenue_LastLast,
Revenue memory globalRevenue_Last,
PendingBoost memory validatorRewards_LastLast,
PendingBoost memory validatorRewards_Last,
Epoch memory validatorEpoch_Last,
uint256 validatorAmountAvailableToUnstake,
uint256 globalAmountAvailableToUnstake
)
internal
pure
returns (
uint128 targetValidatorStake,
uint128 netAmount,
bool isWithdrawal,
uint256 stakeAllocationIncrease,
uint256 stakeAllocationDecrease
)
{
// NOTE: Global has been cranked already. Validator is in the process of being cranked
// but the validator storage has not yet been shifted forwards. Therefore,
// Global_LastLast corresponds with Validator_Last
// CASH FLOW HANDLING PORTION OF DELTA STAKE
{
uint256 _smoothedValidatorRevenue =
_avg(validatorRewards_Last.earnedRevenue, validatorRewards_LastLast.earnedRevenue);
uint256 _smoothedGlobalRevenue =
_avg(globalRevenue_Last.earnedRevenue, globalRevenue_LastLast.earnedRevenue);
if (
_smoothedValidatorRevenue > DUST_THRESHOLD && globalCashFlows_Last.queueToStake > DUST_THRESHOLD
&& _smoothedGlobalRevenue > 0
) {
// Rounds down to avoid over-staking beyond available queueToStake
stakeAllocationIncrease =
globalCashFlows_Last.queueToStake * _smoothedValidatorRevenue / _smoothedGlobalRevenue;
}
if (
globalCashFlows_Last.queueForUnstake > DUST_THRESHOLD && globalAmountAvailableToUnstake > 0
&& validatorAmountAvailableToUnstake > 0
) {
// Rounds up to avoid any shortfall in meeting total unstake requests
stakeAllocationDecrease = uint256(globalCashFlows_Last.queueForUnstake).mulDivUp(
validatorAmountAvailableToUnstake, globalAmountAvailableToUnstake
);
// NOTE: If the calculated decrease would leave less than the min deposit, we'll unstake
// the entire amount, but we detect this later on so that we can re-queue to stake any
// adjusted amounts.
}
}
// Calculate the maximum available to be unstaked
if (stakeAllocationIncrease > stakeAllocationDecrease) {
netAmount = uint128(stakeAllocationIncrease - stakeAllocationDecrease);
targetValidatorStake = validatorEpoch_Last.targetStakeAmount + netAmount;
isWithdrawal = false;
} else {
netAmount = uint128(stakeAllocationDecrease - stakeAllocationIncrease);
targetValidatorStake = validatorEpoch_Last.targetStakeAmount - netAmount;
isWithdrawal = true;
}
return (targetValidatorStake, netAmount, isWithdrawal, stakeAllocationIncrease, stakeAllocationDecrease);
}
/// @notice Computes full withdrawal delta for a deactivated validator.
/// @dev Returns a decrease equal to `amountAvailableToUnstake` and new target stake reduced by that amount.
/// @param validatorEpoch_Last Validator's last completed epoch view (current target reference).
/// @param amountAvailableToUnstake Liquid amount available to withdraw for the validator.
/// @return targetValidatorStake New target stake after decrease.
/// @return netAmount Absolute withdrawal amount.
/// @return isWithdrawal Always true for deactivated validators.
function calculateDeactivatedValidatorEpochStakeDelta(
Epoch memory validatorEpoch_Last,
uint256 amountAvailableToUnstake
)
internal
pure
returns (uint128 targetValidatorStake, uint128 netAmount, bool isWithdrawal)
{
netAmount = uint128(amountAvailableToUnstake);
targetValidatorStake = validatorEpoch_Last.targetStakeAmount - netAmount;
isWithdrawal = true;
return (targetValidatorStake, netAmount, isWithdrawal);
}
/// @notice Returns per-validator amount that is currently eligible to unstake.
/// @dev Excludes pending staking from last and (optionally) last-last epochs when relevant.
/// @param validatorEpoch_LastLast Validator epoch at n-1.
/// @param validatorEpoch_Last Validator epoch at n.
/// @param validatorPendingEscrow_Last Pending escrow at n.
/// @param validatorPendingEscrow_LastLast Pending escrow at n-1.
/// @return amount Eligible amount to unstake.
function getValidatorAmountAvailableToUnstake(
Epoch memory validatorEpoch_LastLast,
Epoch memory validatorEpoch_Last,
StakingEscrow memory validatorPendingEscrow_Last,
StakingEscrow memory validatorPendingEscrow_LastLast
)
internal
pure
returns (uint256 amount)
{
amount = validatorEpoch_Last.targetStakeAmount;
if (validatorEpoch_Last.hasDeposit) {
uint256 _unavailable_Last = validatorPendingEscrow_Last.pendingStaking;
amount = _saturatingSub(amount, _unavailable_Last);
}
if (validatorEpoch_LastLast.hasDeposit && validatorEpoch_LastLast.crankedInBoundaryPeriod) {
uint256 _unavailable_LastLast = validatorPendingEscrow_LastLast.pendingStaking;
amount = _saturatingSub(amount, _unavailable_LastLast);
}
}
/// @notice Returns global amount currently eligible to unstake (excludes pending staking/unstaking).
/// @dev total = staked; unavailable = pendingStaking + pendingUnstaking; amount = total - unavailable (saturating).
/// @param globalCapital_Rolling Working capital snapshot.
/// @param globalPending_Rolling Global pending escrow snapshot.
/// @return amount Eligible global amount to unstake.
function getGlobalAmountAvailableToUnstake(
WorkingCapital memory globalCapital_Rolling,
StakingEscrow memory globalPending_Rolling
)
internal
pure
returns (uint256 amount)
{
// MON can have four states:
// 1. Floating, regular MON (address(this).balance))
// 2. Pending Staking MON
// 3. Pending Unstaking MON
// 4. Staked, Productive MON
// All staked, productive MON is eligible to be unstaked, thus:
uint256 _total = globalCapital_Rolling.stakedAmount;
uint256 _unavailable = globalPending_Rolling.pendingStaking + globalPending_Rolling.pendingUnstaking;
// NOTE: pendingStaking and pendingUnstaking are both considered a part of the total stakedAmount.
amount = _saturatingSub(_total, _unavailable);
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { CashFlows, StakingEscrow, PendingBoost, Revenue } from "../Types.sol";
/// @title StorageLib
/// @notice Library to ensure we never unnecessarily store zero values in storage, as it then costs 125 000 gas on zero
/// to non-zero writes.
library StorageLib {
function clear(CashFlows storage ptr) internal {
ptr.queueForUnstake = 0;
ptr.queueToStake = 0;
ptr.alwaysTrue = true; // Avoids storing a zero slot to save gas on future writes
}
function clear(StakingEscrow storage ptr) internal {
ptr.pendingStaking = 0;
ptr.pendingUnstaking = 0;
ptr.alwaysTrue = true; // Avoids storing a zero slot to save gas on future writes
}
function clear(PendingBoost storage ptr) internal {
ptr.rewardsPayable = 0;
ptr.earnedRevenue = 0;
ptr.alwaysTrue = true; // Avoids storing a zero slot to save gas on future writes
}
function clear(Revenue storage ptr) internal {
ptr.allocatedRevenue = 0;
ptr.earnedRevenue = 0;
ptr.alwaysTrue = true; // Avoids storing a zero slot to save gas on future writes
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
interface ICoinbase {
// ================================ //
// Constants //
// ================================ //
// Public immutables surfaced via autogenerated getters
function VAL_ID() external view returns (uint64);
function SHMONAD() external view returns (address);
function AUTH_ADDRESS() external view returns (address);
// ================================ //
// Core Function //
// ================================ //
function process() external returns (bool success);
// ================================ //
// onlyAuth Setters //
// ================================ //
function updateCommissionRate(uint256 newCommissionRate) external;
function updateCommissionRateFromStakingConfig() external;
function updateCommissionRecipient(address newRecipient) external;
// ================================ //
// Views //
// ================================ //
function getCommissionRate() external view returns (uint256);
function getCommissionRecipient() external view returns (address);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { ReentrancyGuardTransientUpgradeable } from
"@openzeppelin-upgradeable/contracts/utils/ReentrancyGuardTransientUpgradeable.sol";
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
import { FastLaneERC20 } from "./FLERC20.sol";
import { IERC4626Custom } from "./interfaces/IERC4626Custom.sol";
import { IShMonad } from "./interfaces/IShMonad.sol";
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
import {
Epoch,
CashFlows,
AtomicCapital,
StakingEscrow,
PendingBoost,
WorkingCapital,
UserUnstakeRequest,
CurrentLiabilities,
RevenueSmoother
} from "./Types.sol";
import { NATIVE_TOKEN, SCALE, MONAD_EPOCH_LENGTH } from "./Constants.sol";
import { AccountingLib } from "./libraries/AccountingLib.sol";
import { PrecompileHelpers } from "./PrecompileHelpers.sol";
/// @author FastLane Labs
/// @dev Based on OpenZeppelin's ERC4626 implementation, with modifications to support ShMonad's storage structure.
abstract contract FastLaneERC4626 is FastLaneERC20, PrecompileHelpers, ReentrancyGuardTransientUpgradeable {
using Math for uint256;
using SafeCastLib for uint256;
using SafeTransferLib for address;
using AccountingLib for WorkingCapital;
using AccountingLib for AtomicCapital;
using AccountingLib for CurrentLiabilities;
// --------------------------------------------- //
// ERC4626 Custom Functions //
// --------------------------------------------- //
/**
* @notice Boosts yield by donating native MON directly to ShMonad's unstake pool.
* @dev Uses `msg.value` as the donation amount and leaves the assets inside the contract as surplus yield.
* @param yieldOriginator Address credited in events/analytics as the source of the yield boost.
*/
function boostYield(address yieldOriginator) external payable nonReentrant {
_handleBoostYield(msg.value.toUint128());
emit BoostYield(_msgSender(), yieldOriginator, 0, msg.value, false);
}
/**
* @notice Boosts yield by burning a specific address's shMON shares and donating the underlying value.
* @dev Converts `shares` to MON using the current exchange rate, spending allowance if `msg.sender != from`.
* The MON remains in the contract so the shares:assets ratio improves for all remaining holders.
* @param shares Amount of shMON to burn for the yield boost.
* @param from Address providing the shares that will be burned.
* @param yieldOriginator Address attributed as the source of the boost in emitted events.
*/
function boostYield(uint256 shares, address from, address yieldOriginator) external nonReentrant {
uint256 _assets = _convertToAssets(shares, Math.Rounding.Floor, false, false);
if (from != _msgSender()) {
_spendAllowance(from, _msgSender(), shares);
}
_burn(from, shares);
_handleBoostYieldFromShares(_assets.toUint128());
// emit event for extra yield
emit BoostYield(from, yieldOriginator, 0, _assets, true);
// Native tokens intentionally not sent - remains in ShMonad as yield
}
/**
* @notice Credits validator rewards (e.g., MEV) to StakeTracker, splitting protocol fee vs validator payout.
* @dev Caller must pass the validator ID for attribution; the fee portion is derived from `feeRate` (1e18 = 100%).
* @param validatorId The ID of the validator receiving attribution for the reward.
* @param feeRate The fee rate applied to the reward (scaled by 1e18).
*/
function sendValidatorRewards(uint64 validatorId, uint256 feeRate) external payable nonReentrant {
require(feeRate <= SCALE, InvalidFeeRate(feeRate));
(uint120 _validatorPayout, uint120 _feeTaken) = _handleValidatorRewards(validatorId, msg.value, feeRate);
emit SendValidatorRewards(_msgSender(), validatorId, _validatorPayout, _feeTaken);
}
// --------------------------------------------- //
// ERC4626 Standard Functions //
// --------------------------------------------- //
/**
* @dev See {IERC4626-deposit}.
*/
function deposit(
uint256 assets,
address receiver
)
public
payable
virtual
notWhenClosed
nonReentrant
returns (uint256)
{
uint256 maxAssets = maxDeposit(receiver);
require(assets <= maxAssets, ERC4626ExceededMaxDeposit(receiver, assets, maxAssets));
uint256 shares = _previewDeposit(assets, true);
_deposit(_msgSender(), receiver, assets, shares);
return shares;
}
/**
* @dev See {IERC4626-mint}.
*/
function mint(
uint256 shares,
address receiver
)
public
payable
virtual
notWhenClosed
nonReentrant
returns (uint256)
{
uint256 maxShares = maxMint(receiver);
require(shares <= maxShares, ERC4626ExceededMaxMint(receiver, shares, maxShares));
uint256 assets = _previewMint(shares, true);
_deposit(_msgSender(), receiver, assets, shares);
return assets;
}
// --------------------------------------------- //
// Atomic Unstake Functions //
// --------------------------------------------- //
/**
* @dev See {IERC4626-withdraw}.
*
* NOTE: The `withdraw()` function charges a fee as it uses the AtomicUnstakePool to convert shMON to MON.
* The fee is calculated based on the pool's utilization rate and the configured fee curve.
* The fee is deducted from the assets before they are sent to the receiver.
* To estimate the fee, use the `previewWithdraw()` function.
*/
function withdraw(uint256 assets, address receiver, address owner) public virtual nonReentrant returns (uint256) {
require(receiver != address(0), ZeroAddress());
uint256 maxAssets = maxWithdraw(owner);
require(assets <= maxAssets, ERC4626ExceededMaxWithdraw(owner, assets, maxAssets));
(uint256 shares, uint256 feeAssets) = _previewWithdraw(assets);
_withdraw(_msgSender(), receiver, owner, assets, shares, feeAssets);
receiver.safeTransferETH(assets);
return shares;
}
/**
* @dev Withdraws assets from the contract with slippage protection.
* @param assets The amount of assets to withdraw.
* @param receiver The address to receive the assets.
* @param owner The address of the owner of the shares.
* @param maxBurntShares The maximum amount of shares that can be burnt.
* @return The amount of shares withdrawn.
*/
function withdrawWithSlippageProtection(
uint256 assets,
address receiver,
address owner,
uint256 maxBurntShares
)
public
virtual
returns (uint256)
{
uint256 shares = withdraw(assets, receiver, owner);
require(shares <= maxBurntShares, ERC4626WithdrawSlippageExceeded(owner, shares, maxBurntShares));
return shares;
}
/**
* @dev See {IERC4626-redeem}.
*
* NOTE: The `redeem()` function charges a fee as it uses the AtomicUnstakePool to convert shMON to MON.
* The fee is calculated based on the pool's utilization rate and the configured fee curve.
* The fee is deducted from the assets before they are sent to the receiver.
* To estimate the fee, use the `previewRedeem()` function.
*/
function redeem(uint256 shares, address receiver, address owner) public virtual nonReentrant returns (uint256) {
require(receiver != address(0), ZeroAddress());
uint256 maxShares = maxRedeem(owner);
require(shares <= maxShares, ERC4626ExceededMaxRedeem(owner, shares, maxShares));
(uint256 netAssets, uint256 feeAssets) = _previewRedeem(shares);
_withdraw(_msgSender(), receiver, owner, netAssets, shares, feeAssets);
receiver.safeTransferETH(netAssets);
return netAssets;
}
/**
* @dev Redeems shares from the contract with slippage protection.
* @param shares The amount of shares to redeem.
* @param receiver The address to receive the assets.
* @param owner The address of the owner of the shares.
* @param minAssetsOut The minimum amount of assets that must be received.
* @return The amount of assets redeemed.
*/
function redeemWithSlippageProtection(
uint256 shares,
address receiver,
address owner,
uint256 minAssetsOut
)
public
virtual
returns (uint256)
{
uint256 netAssets = redeem(shares, receiver, owner);
require(netAssets >= minAssetsOut, ERC4626RedeemSlippageExceeded(owner, netAssets, minAssetsOut));
return netAssets;
}
// --------------------------------------------- //
// Internal Functions //
// --------------------------------------------- //
/**
* @dev Internal conversion function (from assets to shares) with support for rounding direction.
*/
function _convertToShares(
uint256 assets,
Math.Rounding rounding,
bool deductRecentRevenue,
bool deductMsgValue
)
internal
view
virtual
override
returns (uint256)
{
uint256 _equity = deductMsgValue
? _totalEquity({ deductRecentRevenue: deductRecentRevenue }) - msg.value
: _totalEquity({ deductRecentRevenue: deductRecentRevenue });
return assets.mulDiv(_realTotalSupply() + 10 ** _decimalsOffset(), _equity + 1, rounding);
}
/**
* @dev Internal conversion function (from shares to assets) with support for rounding direction.
*/
function _convertToAssets(
uint256 shares,
Math.Rounding rounding,
bool deductRecentRevenue,
bool deductMsgValue
)
internal
view
virtual
returns (uint256)
{
uint256 _equity = deductMsgValue
? _totalEquity({ deductRecentRevenue: deductRecentRevenue }) - msg.value
: _totalEquity({ deductRecentRevenue: deductRecentRevenue });
return shares.mulDiv(_equity + 1, _realTotalSupply() + 10 ** _decimalsOffset(), rounding);
}
/**
* @dev Deposit/mint common workflow.
*/
function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {
require(assets == msg.value, IncorrectNativeTokenAmountSent());
_mint(receiver, shares);
// Call StakeTracker hook to account for newly deposited assets
_accountForDeposit(assets);
emit Deposit(caller, receiver, assets, shares);
}
/**
* @dev Withdraw/redeem common workflow.
*/
function _withdraw(
address caller,
address receiver,
address owner,
uint256 netAssets,
uint256 shares,
uint256 feeAssets
)
internal
virtual
{
if (caller != owner) {
_spendAllowance(owner, caller, shares);
}
_burn(owner, shares);
// Tracker bookkeeping: record net assets delivered and fee charged
_accountForWithdraw(netAssets.toUint128(), feeAssets.toUint128());
// ERC-4626 semantics: emit event with actual assets delivered to receiver
emit Withdraw(caller, receiver, owner, netAssets, shares);
}
function _previewDeposit(uint256 assets, bool deductMsgValue) internal view virtual returns (uint256) {
bool _deductRecentRevenue = false;
return _convertToShares(assets, Math.Rounding.Floor, _deductRecentRevenue, deductMsgValue);
}
function _previewMint(uint256 shares, bool deductMsgValue) internal view virtual returns (uint256) {
bool _deductRecentRevenue = false;
return _convertToAssets(shares, Math.Rounding.Ceil, _deductRecentRevenue, deductMsgValue);
}
function _decimalsOffset() internal view virtual returns (uint8) {
return 0;
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/**
* @dev See {IERC4626-asset}.
*/
function asset() public view virtual returns (address) {
return NATIVE_TOKEN;
}
/**
* @dev Returns the real total assets attributed to real, minted shMON.
* NOTE: The asset balance attributed to shMON holders and excludes debts / creditor balances is called EQUITY.
*/
function totalAssets() public view virtual returns (uint256) {
// NOTE: Does not include MON earmarked for traditional unstaking (tracked in reservedAmount). Those funds have
// already been deducted from total balances, so they can be excluded from ShMonad's liquid MON balance.
return _totalEquity({ deductRecentRevenue: false });
}
/**
* @dev Returns the total assets attributed to real, minted shMON. AKA equity.
*/
function _totalEquity(bool deductRecentRevenue) internal view virtual override returns (uint256) {
WorkingCapital memory _globalCapital = s_globalCapital;
uint256 _equity = _globalCapital.totalEquity(s_globalLiabilities, s_admin, address(this).balance);
if (deductRecentRevenue) {
uint256 _recentRevenue = _recentRevenueOffset();
return _equity > _recentRevenue ? _equity - _recentRevenue : 0;
}
return _equity;
}
/**
* @dev Returns any recently-earned revenue that should not be included in totalAssets in order to mitigate the
* dilutive impact of JIT LPing on unusually large revenue.
*/
function _recentRevenueOffset() internal view virtual returns (uint256) {
RevenueSmoother memory _revenueSmoother = s_revenueSmoother;
uint256 _blocksSinceEpochChange = block.number - uint256(_revenueSmoother.epochChangeBlockNumber);
uint256 _lastRevenue = _revenueSmoother.earnedRevenueLast;
if (_blocksSinceEpochChange > MONAD_EPOCH_LENGTH || _lastRevenue == 0) {
return uint256(globalRevenuePtr_N(0).earnedRevenue);
}
uint256 _unearnedBlocks = MONAD_EPOCH_LENGTH - _blocksSinceEpochChange;
// Round up in the unearnedRevenue calculation to avoid overstating equity
uint256 _unearnedRevenue = _lastRevenue.mulDiv(_unearnedBlocks, MONAD_EPOCH_LENGTH, Math.Rounding.Ceil);
return uint256(globalRevenuePtr_N(0).earnedRevenue) + _unearnedRevenue;
}
/**
* @dev See {IERC4626-convertToShares}.
*/
function convertToShares(uint256 assets) public view virtual returns (uint256) {
bool _deductRecentRevenue = true;
return _convertToShares(assets, Math.Rounding.Floor, _deductRecentRevenue, false);
}
/**
* @dev See {IERC4626-convertToAssets}.
*/
function convertToAssets(uint256 shares) public view virtual returns (uint256) {
bool _deductRecentRevenue = true;
return _convertToAssets(shares, Math.Rounding.Floor, _deductRecentRevenue, false);
}
/**
* @dev See {IERC4626-maxDeposit}.
*/
function maxDeposit(address) public view virtual returns (uint256) {
return type(uint128).max;
}
/**
* @dev See {IERC4626-maxMint}.
*/
function maxMint(address) public view virtual returns (uint256) {
return type(uint128).max;
}
/**
* @dev See {IERC4626-maxWithdraw}.
*/
function maxWithdraw(address owner) public view virtual returns (uint256) {
uint256 _shares = balanceOf(owner);
// Convert shares to assets
bool _deductRecentRevenue = true;
uint256 _assets = _convertToAssets(_shares, Math.Rounding.Floor, _deductRecentRevenue, false);
// Apply AtomicUnstakePool fee to assets, based on pool utilization
(uint256 _grossAssetsCapped, uint256 _feeAssets) = _getGrossCappedAndFeeFromGrossAssets(_assets);
return _grossAssetsCapped - _feeAssets;
}
/**
* @dev See {IERC4626-maxRedeem}.
*/
function maxRedeem(address owner) public view virtual returns (uint256) {
// `maxWithdraw()` factors in fee and liquidity limits
uint256 maxWithdrawAssetsAfterFee = maxWithdraw(owner);
// Then, use `previewWithdraw()` to go from netAssets back to gross shares, as per ERC-4626 semantics.
return previewWithdraw(maxWithdrawAssetsAfterFee);
}
/**
* @dev See {IERC4626-previewDeposit}.
*/
function previewDeposit(uint256 assets) public view virtual returns (uint256) {
bool _deductRecentRevenue = false;
return _convertToShares(assets, Math.Rounding.Floor, _deductRecentRevenue, false);
}
/**
* @dev See {IERC4626-previewMint}.
*/
function previewMint(uint256 shares) public view virtual returns (uint256) {
return _previewMint(shares, false);
}
/**
* @dev See {IERC4626-previewWithdraw}.
*/
function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
(uint256 shares,) = _previewWithdraw(assets);
return shares;
}
function _previewWithdraw(uint256 assets) internal view virtual returns (uint256 shares, uint256 feeAssets) {
// Non-reverting inverse: treats `assets` as post-fee and computes the before-fee amount,
// ignoring current liquidity limits per ERC-4626 preview requirements.
uint256 _beforeFeeAssets;
(_beforeFeeAssets, feeAssets) = _quoteGrossAndFeeFromNetAssetsNoLiquidityLimit(assets);
// Convert before-fee assets to shares
bool _deductRecentRevenue = true;
shares = _convertToShares(_beforeFeeAssets, Math.Rounding.Ceil, _deductRecentRevenue, false);
}
/**
* @dev See {IERC4626-previewRedeem}.
*/
function previewRedeem(uint256 shares) public view virtual returns (uint256) {
(uint256 netAssets,) = _previewRedeem(shares);
return netAssets;
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/// @notice Detailed preview for redeem: splits gross, fee, and net assets.
/// @param shares Amount of shMON to redeem
/// @return grossAssets Gross assets before fee
/// @return feeAssets Fee charged based on atomic pool utilization
/// @return netAssets Net assets received by the receiver
function previewRedeemDetailed(uint256 shares)
external
view
returns (uint256 grossAssets, uint256 feeAssets, uint256 netAssets)
{
bool _deductRecentRevenue = true;
grossAssets = _convertToAssets(shares, Math.Rounding.Floor, _deductRecentRevenue, false);
feeAssets = _quoteFeeFromGrossAssetsNoLiquidityLimit(grossAssets);
netAssets = grossAssets - feeAssets;
}
/// @notice Detailed preview for withdraw-by-assets: splits shares and fee breakdown.
/// @param netAssets Target net assets to withdraw
/// @return shares Shares to burn for the withdrawal
/// @return grossAssets Gross assets before fee corresponding to `netAssets`
/// @return feeAssets Fee charged based on atomic pool utilization
function previewWithdrawDetailed(uint256 netAssets)
external
view
returns (uint256 shares, uint256 grossAssets, uint256 feeAssets)
{
(grossAssets, feeAssets) = _quoteGrossAndFeeFromNetAssetsNoLiquidityLimit(netAssets);
bool _deductRecentRevenue = true;
shares = _convertToShares(grossAssets, Math.Rounding.Ceil, _deductRecentRevenue, false);
}
function _previewRedeem(uint256 shares) internal view virtual returns (uint256 netAssets, uint256 feeAssets) {
// Treat the asset value of `shares` as gross ask and run the limit-aware forward model once; use its clamped
// net for preview.
bool _deductRecentRevenue = true;
uint256 _grossAssets = _convertToAssets(shares, Math.Rounding.Floor, _deductRecentRevenue, false);
feeAssets = _quoteFeeFromGrossAssetsNoLiquidityLimit(_grossAssets);
netAssets = _grossAssets - feeAssets;
}
/**
* @dev Similar to {IERC4626-previewRedeem}.
*/
function previewUnstake(uint256 shares) public view virtual returns (uint256) {
bool _deductRecentRevenue = true;
return _convertToAssets(shares, Math.Rounding.Floor, _deductRecentRevenue, false);
}
// ================================================== //
// AtomicUnstakePool Functions //
// ================================================== //
function _quoteFeeFromGrossAssetsNoLiquidityLimit(uint256 grossRequested)
internal
view
virtual
returns (uint256 feeAssets);
function _getGrossCappedAndFeeFromGrossAssets(uint256 grossRequested)
internal
view
virtual
returns (uint256 grossCapped, uint256 feeAssets);
function _quoteGrossAndFeeFromNetAssetsNoLiquidityLimit(uint256 targetNet)
internal
view
virtual
returns (uint256 gross, uint256 fee);
function _handleBoostYield(uint128 amount) internal virtual;
function _handleBoostYieldFromShares(uint128 amountFromShares) internal virtual;
function _handleValidatorRewards(
uint64 valId,
uint256 amount,
uint256 feeRate
)
internal
virtual
returns (uint120 validatorPayout, uint120 feeTaken);
function _accountForWithdraw(uint256 netAmount, uint256 fee) internal virtual;
function _accountForDeposit(uint256 assets) internal virtual;
function _afterRequestUnstake(uint256 amount) internal virtual;
function _beforeCompleteUnstake(uint128 amount) internal virtual;
function STAKING_PRECOMPILE() public pure virtual override(PrecompileHelpers, IShMonad) returns (IMonadStaking);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { SafeTransferLib } from "@solady/utils/SafeTransferLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
import { ICoinbase } from "./interfaces/ICoinbase.sol";
import {
STAKING,
MIN_VALIDATOR_DEPOSIT,
SCALE,
TRANSFER_GAS_LIMIT,
STAKING_GAS_BUFFER,
STAKING_GAS_EXTERNAL_REWARD,
STAKING_GAS_GET_VALIDATOR
} from "./Constants.sol";
struct CoinbaseConfig {
address commissionRecipient; // receives validator commission sent in `process()`
uint96 commissionRate; // as a fraction of 1e18
}
contract Coinbase is ICoinbase {
using SafeTransferLib for address;
using SafeCastLib for uint256;
uint64 public immutable VAL_ID;
address public immutable SHMONAD;
address public immutable AUTH_ADDRESS;
address public immutable SELF;
CoinbaseConfig internal s_config;
error OnlyShMonadCaller();
error OnlyAuthAddress();
error OnlySelfCaller();
error InvalidCommissionRate();
error CommissionOrRewardFailed();
error RecipientCannotBeZeroAddress();
error ValidatorNotFoundInPrecompile(uint64 validatorId);
event CommissionRateUpdated(uint256 oldCommissionRate, uint256 newCommissionRate);
event CommissionRecipientUpdated(address oldRecipient, address newRecipient);
constructor(uint64 valId) {
VAL_ID = valId;
SHMONAD = msg.sender;
SELF = address(this);
(address _authAddress, uint256 _commissionRate) = _getValidator(valId);
AUTH_ADDRESS = _authAddress;
s_config = CoinbaseConfig({ commissionRecipient: _authAddress, commissionRate: _commissionRate.toUint96() });
emit CommissionRateUpdated(0, _commissionRate);
emit CommissionRecipientUpdated(address(0), _authAddress);
}
receive() external payable { }
modifier onlyAuthAddress() {
require(msg.sender == AUTH_ADDRESS, OnlyAuthAddress());
_;
}
modifier onlyShMonad() {
require(msg.sender == SHMONAD, OnlyShMonadCaller());
_;
}
modifier onlySelf() {
require(msg.sender == SELF, OnlySelfCaller());
_;
}
/// @dev This is called during `_crankValidator()` in ShMonad, so should never revert.
function process() external onlyShMonad returns (bool success) {
CoinbaseConfig memory _config = s_config;
// Assume all balance is accrued priority fees
uint256 _currentBalance = address(this).balance;
// Calculate the commission
uint256 _validatorCommission = _currentBalance * _config.commissionRate / SCALE;
uint256 _rewardPortion = _currentBalance - _validatorCommission;
// Don't pay commission unless the remaining reward is large enough to send via externalReward
if (_rewardPortion < MIN_VALIDATOR_DEPOSIT) return false;
// Both commission and rewards must be sent or both should revert
try this.sendCommissionAndRewards(_config.commissionRecipient, _validatorCommission, _rewardPortion) {
success = true;
} catch {
success = false;
}
}
function sendCommissionAndRewards(
address commissionRecipient,
uint256 validatorCommission,
uint256 rewardPortion
)
external
onlySelf
{
bool _sendCommissionSucceeded = true;
// Send commission to recipient and rewards to staking precompile
if (validatorCommission > 0) {
_sendCommissionSucceeded = commissionRecipient.trySafeTransferETH(validatorCommission, TRANSFER_GAS_LIMIT);
}
bool _sendRewardsSucceeded = _sendRewards(VAL_ID, rewardPortion);
// If either of the above sends fail, revert both
require(_sendCommissionSucceeded && _sendRewardsSucceeded, CommissionOrRewardFailed());
}
function updateCommissionRate(uint256 newCommissionRate) external onlyAuthAddress {
require(newCommissionRate <= SCALE, InvalidCommissionRate());
uint256 _oldCommissionRate = s_config.commissionRate;
s_config.commissionRate = newCommissionRate.toUint96();
emit CommissionRateUpdated(_oldCommissionRate, newCommissionRate);
}
function updateCommissionRateFromStakingConfig() external onlyAuthAddress {
(, uint256 _newCommissionRate) = _getValidator(VAL_ID);
uint256 _oldCommissionRate = s_config.commissionRate;
s_config.commissionRate = _newCommissionRate.toUint96();
emit CommissionRateUpdated(_oldCommissionRate, _newCommissionRate);
}
function updateCommissionRecipient(address newRecipient) external onlyAuthAddress {
require(newRecipient != address(0), RecipientCannotBeZeroAddress());
address _oldRecipient = s_config.commissionRecipient;
s_config.commissionRecipient = newRecipient;
emit CommissionRecipientUpdated(_oldRecipient, newRecipient);
}
function getCommissionRate() external view returns (uint256) {
return s_config.commissionRate;
}
function getCommissionRecipient() external view returns (address) {
return s_config.commissionRecipient;
}
function _inEpochDelayPeriod() internal returns (bool) {
(, bool _isInEpochDelayPeriod) = STAKING.getEpoch();
return _isInEpochDelayPeriod;
}
function _sendRewards(uint64 validatorId, uint256 rewardAmount) internal returns (bool) {
try STAKING.externalReward{ value: rewardAmount, gas: STAKING_GAS_EXTERNAL_REWARD + STAKING_GAS_BUFFER }(
validatorId
) returns (bool _precompileSuccess) {
return _precompileSuccess;
} catch {
return false;
}
}
function _getValidator(uint64 validatorId) internal returns (address authAddress, uint256 commissionRate) {
// Note: Real precompile returns zeros for missing, mock reverts with UnknownValidator()
try STAKING.getValidator{ gas: STAKING_GAS_GET_VALIDATOR + STAKING_GAS_BUFFER }(validatorId) returns (
address _authAddress,
uint64,
uint256,
uint256,
uint256,
uint256,
uint256,
uint256 _consensusCommissionRate,
uint256,
uint256 _snapshotCommissionRate,
bytes memory,
bytes memory
) {
authAddress = _authAddress;
commissionRate = _inEpochDelayPeriod() ? _snapshotCommissionRate : _consensusCommissionRate;
} catch { }
require(authAddress != address(0), ValidatorNotFoundInPrecompile(validatorId));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/ReentrancyGuardTransient.sol)
pragma solidity ^0.8.24;
import {TransientSlot} from "@openzeppelin/contracts/utils/TransientSlot.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Variant of {ReentrancyGuard} that uses transient storage.
*
* NOTE: This variant only works on networks where EIP-1153 is available.
*
* _Available since v5.1._
*/
abstract contract ReentrancyGuardTransientUpgradeable is Initializable {
using TransientSlot for *;
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant REENTRANCY_GUARD_STORAGE =
0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function __ReentrancyGuardTransient_init() internal onlyInitializing {
}
function __ReentrancyGuardTransient_init_unchained() internal onlyInitializing {
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, REENTRANCY_GUARD_STORAGE.asBoolean().tload() will be false
if (_reentrancyGuardEntered()) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
REENTRANCY_GUARD_STORAGE.asBoolean().tstore(true);
}
function _nonReentrantAfter() private {
REENTRANCY_GUARD_STORAGE.asBoolean().tstore(false);
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return REENTRANCY_GUARD_STORAGE.asBoolean().tload();
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { OwnableUpgradeable } from "@openzeppelin-upgradeable/contracts/access/OwnableUpgradeable.sol";
import { EIP712Upgradeable } from "@openzeppelin-upgradeable/contracts/utils/cryptography/EIP712Upgradeable.sol";
import { NoncesUpgradeable } from "@openzeppelin-upgradeable/contracts/utils/NoncesUpgradeable.sol";
import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import { SignatureChecker } from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { IERC20Permit } from "./interfaces/IERC20Full.sol";
import { ShMonadHolds } from "./Holds.sol";
import { Balance, Supply } from "./Types.sol";
import { PERMIT_TYPEHASH } from "./Constants.sol";
/// @author FastLane Labs
/// @dev Based on OpenZeppelin's ERC20 implementation, with modifications to support shMonad's storage structure.
/// Supports EIP-2612 Permit.
abstract contract FastLaneERC20 is ShMonadHolds, EIP712Upgradeable, NoncesUpgradeable, OwnableUpgradeable {
using SafeCast for uint256;
// NOTE: `initialize()` for EIP712 setup defined in ShMonad.sol
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return "ShMonad";
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return "shMON";
}
/**
* @dev Returns the number of decimals used to get its user representation.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev Returns the real total supply of minted shMON.
*/
function totalSupply() public view returns (uint256) {
return _realTotalSupply();
}
/**
* @dev Returns the real total supply of minted shMON.
*/
function realTotalSupply() external view returns (uint256) {
return _realTotalSupply();
}
function committedTotalSupply() external view returns (uint256) {
return uint256(s_supply.committedTotal);
}
/**
* @dev Returns the real total supply of minted shMON.
*/
function _realTotalSupply() internal view returns (uint256) {
return uint256(s_supply.total);
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return s_balances[account].uncommitted;
}
/**
* @notice Gets the total committed balance of an account across all policies.
* @param account The address to check.
* @return The committed balance in shares.
*/
function balanceOfCommitted(address account) external view returns (uint256) {
return s_balances[account].committed;
}
/**
* @notice Gets the committed balance of an account within a specific policy.
* @param policyID The ID of the policy.
* @param account The address to check.
* @return The committed balance in shares.
*/
function balanceOfCommitted(uint64 policyID, address account) external view returns (uint256) {
return s_committedData[policyID][account].committed;
}
/**
* @notice Gets the uncommitting balance of an account within a specific policy.
* @param policyID The ID of the policy.
* @param account The address to check.
* @return The uncommitting balance in shares.
*/
function balanceOfUncommitting(uint64 policyID, address account) external view returns (uint256) {
return s_uncommittingData[policyID][account].uncommitting;
}
/**
* @inheritdoc IERC20Permit
*/
function nonces(address owner) public view virtual override(IERC20Permit, NoncesUpgradeable) returns (uint256) {
return super.nonces(owner);
}
/**
* @inheritdoc IERC20Permit
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
return _domainSeparatorV4();
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return s_allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @inheritdoc IERC20Permit
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
)
public
virtual
{
require(block.timestamp <= deadline, ERC2612ExpiredSignature(deadline));
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
// 1) Try ECDSA first (works for EOAs, including 7702 EOAs with transient code)
address recovered = ECDSA.recover(hash, v, r, s);
if (recovered != owner) {
// 2) If not an ECDSA signer, try ERC-1271 for contract accounts
if (owner.code.length == 0) revert ERC2612InvalidSigner(recovered, owner);
bytes memory sig = abi.encodePacked(r, s, v);
bool ok = SignatureChecker.isValidSignatureNow(owner, hash, sig);
require(ok, ERC2612InvalidSigner(address(0), owner));
}
_approve(owner, spender, value);
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
require(from != address(0), ERC20InvalidSender(address(0)));
require(to != address(0), ERC20InvalidReceiver(address(0)));
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* @dev Modifies the `uncommitted` value of an account's balance, in the s_balances mapping.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
uint128 value128 = value.toUint128();
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
s_supply.total += value128;
} else {
Balance memory fromBalance = s_balances[from];
uint256 fromUncommitted = fromBalance.uncommitted;
require(fromUncommitted >= value, ERC20InsufficientBalance(from, fromUncommitted, value));
unchecked {
// Underflow not possible: value <= fromBalance <= totalSupply.
fromBalance.uncommitted -= value128;
s_balances[from] = fromBalance;
}
}
if (to == address(0)) {
unchecked {
// Underflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
s_supply.total -= value128;
}
} else {
// Overflow IS possible as s_supply.total is not a uint128, but Balance.uncommitted is.
s_balances[to].uncommitted += value128;
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0), ERC20InvalidReceiver(address(0)));
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
require(account != address(0), ERC20InvalidSender(address(0)));
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
require(owner != address(0), ERC20InvalidApprover(address(0)));
require(spender != address(0), ERC20InvalidSpender(address(0)));
s_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
require(currentAllowance >= value, ERC20InsufficientAllowance(spender, currentAllowance, value));
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
function _convertToShares(
uint256 assets,
Math.Rounding rounding,
bool excludeRecentRevenue,
bool deductMsgValue
)
internal
view
virtual
returns (uint256);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { FixedPointMathLib as Math } from "@solady/utils/FixedPointMathLib.sol";
import { SafeCastLib } from "@solady/utils/SafeCastLib.sol";
import { IMonadStaking } from "./interfaces/IMonadStaking.sol";
import {
MIN_VALIDATOR_DEPOSIT,
DUST_THRESHOLD,
UNKNOWN_VAL_ID,
STAKING_GAS_BUFFER,
STAKING_GAS_CLAIM_REWARDS,
STAKING_GAS_EXTERNAL_REWARD,
STAKING_GAS_GET_WITHDRAWAL_REQUEST,
STAKING_GAS_GET_DELEGATOR,
STAKING_GAS_DELEGATE,
STAKING_GAS_UNDELEGATE,
STAKING_GAS_WITHDRAW,
STAKING_GAS_PROPOSER_VAL_ID
} from "./Constants.sol";
abstract contract PrecompileHelpers {
using SafeCastLib for uint256;
using Math for uint256;
// ================================================== //
// Staking Precompile Helpers //
// ================================================== //
// We always pull rewards rather than compound them in a validator
function _claimRewards(uint64 valId) internal expectsStakingRewards returns (uint120 rewardAmount, bool success) {
uint256 _balance = address(this).balance;
try STAKING_PRECOMPILE().claimRewards{ gas: STAKING_GAS_CLAIM_REWARDS + STAKING_GAS_BUFFER }(valId) returns (
bool precompileSuccess
) {
if (!precompileSuccess) {
return (0, false);
}
rewardAmount = uint120(address(this).balance - _balance);
return (rewardAmount, true);
} catch {
// Validator may not have an active delegation yet; skip without reverting
return (0, false);
}
}
function _initiateWithdrawal(
uint64 valId,
uint128 withdrawalAmount,
uint8 withdrawalId
)
internal
returns (bool success, uint128)
{
uint256 _withdrawalAmount = uint256(withdrawalAmount);
try STAKING_PRECOMPILE().undelegate{ gas: STAKING_GAS_UNDELEGATE + STAKING_GAS_BUFFER }(
valId, _withdrawalAmount, withdrawalId
) returns (bool precompileSuccess) {
if (!precompileSuccess) {
return (false, 0);
}
return (true, withdrawalAmount);
} catch {
try STAKING_PRECOMPILE().getDelegator{ gas: STAKING_GAS_GET_DELEGATOR + STAKING_GAS_BUFFER }(
valId, address(this)
) returns (uint256 stake, uint256, uint256, uint256, uint256, uint64, uint64) {
if (stake > 0) {
if (stake < _withdrawalAmount) {
// NOTE: Ideally we would never reach this point, but we should aim to handle it so that we can
// handle emergency Monad hard forks that
// impact staking and that occur faster than our upgrade window will allow us to upgrade ShMonad
// source code. The most likely
// scenario is handling slashing.
_withdrawalAmount = stake;
try STAKING_PRECOMPILE().undelegate{ gas: STAKING_GAS_UNDELEGATE + STAKING_GAS_BUFFER }(
valId, _withdrawalAmount, withdrawalId
) returns (bool retrySuccess) {
if (!retrySuccess) {
return (false, 0);
}
return (true, _withdrawalAmount.toUint128());
} catch {
// Pass - If we cant withdraw our staked amount, consider it a failure.
}
} else {
// Pass - If we cant withdraw our staked amount, consider it a failure.
}
} else {
// Count it as a success if we're seeing a zero balance because hey at least we can see it. Silver
// lining.
return (true, 0);
}
} catch {
// Pass - count it as a faillure because we can't even see our delegation
}
}
return (false, 0);
}
function _initiateStaking(
uint64 valId,
uint128 stakingAmount
)
internal
returns (bool success, uint128 amountStaked)
{
// stakingAmount should never be more than the contract balance.
assert(stakingAmount <= address(this).balance);
if (stakingAmount > DUST_THRESHOLD) {
try STAKING_PRECOMPILE().delegate{ value: stakingAmount, gas: STAKING_GAS_DELEGATE + STAKING_GAS_BUFFER }(
valId
) returns (bool precompileSuccess) {
if (!precompileSuccess) {
return (false, 0);
}
return (true, stakingAmount);
} catch {
return (false, 0);
}
} else {
return (true, 0);
}
}
function _completeWithdrawal(
uint64 valId,
uint8 withdrawalId
)
internal
expectsUnstakingSettlement
returns (uint128 withdrawalAmount, bool success, bool delayed)
{
uint256 _balance = address(this).balance;
try STAKING_PRECOMPILE().withdraw{ gas: STAKING_GAS_WITHDRAW + STAKING_GAS_BUFFER }(valId, withdrawalId)
returns (bool precompileSuccess) {
if (!precompileSuccess) {
// Precompile rejected the withdrawal, check if it's delayed
try STAKING_PRECOMPILE().getWithdrawalRequest{
gas: STAKING_GAS_GET_WITHDRAWAL_REQUEST + STAKING_GAS_BUFFER
}(valId, address(this), withdrawalId) returns (uint256 amountRaw, uint256, uint64) {
if (amountRaw > 0) delayed = true;
withdrawalAmount = amountRaw.toUint128();
} catch {
withdrawalAmount = 0;
}
return (withdrawalAmount, false, delayed);
}
withdrawalAmount = (address(this).balance - _balance).toUint128();
success = true;
} catch {
try STAKING_PRECOMPILE().getWithdrawalRequest{ gas: STAKING_GAS_GET_WITHDRAWAL_REQUEST + STAKING_GAS_BUFFER }(
valId, address(this), withdrawalId
) returns (uint256 amountRaw, uint256, uint64) {
if (amountRaw > 0) delayed = true;
withdrawalAmount = amountRaw.toUint128();
} catch {
// NOTE: In reality we should never reach this point, but we should aim to handle it so that we can
// handle emergency Monad hard forks that
// impact staking and that occur faster than our upgrade window will allow us to upgrade ShMonad source
// code. The most likely
// scenario is handling slashing.
withdrawalAmount = 0;
}
success = false;
}
return (withdrawalAmount, success, delayed);
}
function _sendRewards(uint64 valId, uint128 rewardAmount) internal returns (bool success, uint120 amountSent) {
// This is for debugging
uint256 _amount = uint256(rewardAmount);
if (_amount > address(this).balance) {
_amount = address(this).balance;
}
if (_amount >= MIN_VALIDATOR_DEPOSIT) {
try STAKING_PRECOMPILE().externalReward{
value: _amount,
gas: STAKING_GAS_EXTERNAL_REWARD + STAKING_GAS_BUFFER
}(valId) returns (bool precompileSuccess) {
if (!precompileSuccess) {
return (false, 0);
}
return (true, uint120(_amount));
} catch {
return (false, 0);
}
} else {
return (true, 0);
}
}
function _getStakeInfo(uint64 valId) internal returns (uint256 activeStake, uint256 pendingDeposits) {
try STAKING_PRECOMPILE().getDelegator(valId, address(this)) returns (
uint256 _stake, uint256, uint256, uint256 _deltaStake, uint256 _nextDeltaStake, uint64, uint64
) {
return (_stake, _deltaStake + _nextDeltaStake);
} catch {
return (0, 0);
}
}
function _getWithdrawalAmount(uint64 valId, uint8 withdrawId) internal returns (uint256 withdrawalAmount) {
try STAKING_PRECOMPILE().getWithdrawalRequest(valId, address(this), withdrawId) returns (
uint256 _withdrawalAmount, uint256, uint64
) {
return _withdrawalAmount;
} catch {
return 0;
}
}
function _getEpoch() internal returns (uint64) {
(uint64 _epoch,) = STAKING_PRECOMPILE().getEpoch();
return _epoch;
}
function _getEpochBarrierAdj() internal returns (uint64) {
(uint64 _epoch, bool __inEpochDelayPeriod) = STAKING_PRECOMPILE().getEpoch();
if (__inEpochDelayPeriod) ++_epoch;
return _epoch;
}
function _inEpochDelayPeriod() internal returns (bool) {
(, bool __inEpochDelayPeriod) = STAKING_PRECOMPILE().getEpoch();
return __inEpochDelayPeriod;
}
/// @notice Returns whether a validator is in the active set for the current epoch context
/// @dev Uses snapshot stake during the epoch delay window, otherwise consensus stake
function _isValidatorInActiveSet(uint64 valId) internal returns (bool) {
bool inDelay = _inEpochDelayPeriod();
try STAKING_PRECOMPILE().getValidator(valId) returns (
address,
uint64,
uint256,
uint256,
uint256,
uint256,
uint256 consensusStake,
uint256,
uint256 snapshotStake,
uint256,
bytes memory,
bytes memory
) {
if (inDelay) {
return snapshotStake > 0;
} else {
return consensusStake > 0;
}
} catch {
// If the precompile reverts or is unavailable, treat as not in active set
return false;
}
}
/// @notice Helper to fetch current validator ID from precompile with safe fallback
/// @dev Tries getProposerValId(), and returns UNKNOWN_VAL_ID on failure/zero
function _getCurrentValidatorId() internal returns (uint64 validatorId) {
try STAKING_PRECOMPILE().getProposerValId{ gas: STAKING_GAS_PROPOSER_VAL_ID + STAKING_GAS_BUFFER }() returns (
uint64 _valId
) {
if (_valId != 0) return _valId;
} catch {
return uint64(UNKNOWN_VAL_ID);
}
}
// ================================================== //
// Virtual Methods //
// ================================================== //
function STAKING_PRECOMPILE() public pure virtual returns (IMonadStaking);
modifier expectsUnstakingSettlement() virtual;
modifier expectsStakingRewards() virtual;
function _totalEquity(bool deductRecentRevenue) internal view virtual returns (uint256);
function _validatorIdForCoinbase(address coinbase) internal view virtual returns (uint64);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/TransientSlot.sol)
// This file was procedurally generated from scripts/generate/templates/TransientSlot.js.
pragma solidity ^0.8.24;
/**
* @dev Library for reading and writing value-types to specific transient storage slots.
*
* Transient slots are often used to store temporary values that are removed after the current transaction.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* * Example reading and writing values using transient storage:
* ```solidity
* contract Lock {
* using TransientSlot for *;
*
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _LOCK_SLOT = 0xf4678858b2b588224636b8522b729e7722d32fc491da849ed75b3fdf3c84f542;
*
* modifier locked() {
* require(!_LOCK_SLOT.asBoolean().tload());
*
* _LOCK_SLOT.asBoolean().tstore(true);
* _;
* _LOCK_SLOT.asBoolean().tstore(false);
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library TransientSlot {
/**
* @dev UDVT that represents a slot holding an address.
*/
type AddressSlot is bytes32;
/**
* @dev Cast an arbitrary slot to a AddressSlot.
*/
function asAddress(bytes32 slot) internal pure returns (AddressSlot) {
return AddressSlot.wrap(slot);
}
/**
* @dev UDVT that represents a slot holding a bool.
*/
type BooleanSlot is bytes32;
/**
* @dev Cast an arbitrary slot to a BooleanSlot.
*/
function asBoolean(bytes32 slot) internal pure returns (BooleanSlot) {
return BooleanSlot.wrap(slot);
}
/**
* @dev UDVT that represents a slot holding a bytes32.
*/
type Bytes32Slot is bytes32;
/**
* @dev Cast an arbitrary slot to a Bytes32Slot.
*/
function asBytes32(bytes32 slot) internal pure returns (Bytes32Slot) {
return Bytes32Slot.wrap(slot);
}
/**
* @dev UDVT that represents a slot holding a uint256.
*/
type Uint256Slot is bytes32;
/**
* @dev Cast an arbitrary slot to a Uint256Slot.
*/
function asUint256(bytes32 slot) internal pure returns (Uint256Slot) {
return Uint256Slot.wrap(slot);
}
/**
* @dev UDVT that represents a slot holding a int256.
*/
type Int256Slot is bytes32;
/**
* @dev Cast an arbitrary slot to a Int256Slot.
*/
function asInt256(bytes32 slot) internal pure returns (Int256Slot) {
return Int256Slot.wrap(slot);
}
/**
* @dev Load the value held at location `slot` in transient storage.
*/
function tload(AddressSlot slot) internal view returns (address value) {
assembly ("memory-safe") {
value := tload(slot)
}
}
/**
* @dev Store `value` at location `slot` in transient storage.
*/
function tstore(AddressSlot slot, address value) internal {
assembly ("memory-safe") {
tstore(slot, value)
}
}
/**
* @dev Load the value held at location `slot` in transient storage.
*/
function tload(BooleanSlot slot) internal view returns (bool value) {
assembly ("memory-safe") {
value := tload(slot)
}
}
/**
* @dev Store `value` at location `slot` in transient storage.
*/
function tstore(BooleanSlot slot, bool value) internal {
assembly ("memory-safe") {
tstore(slot, value)
}
}
/**
* @dev Load the value held at location `slot` in transient storage.
*/
function tload(Bytes32Slot slot) internal view returns (bytes32 value) {
assembly ("memory-safe") {
value := tload(slot)
}
}
/**
* @dev Store `value` at location `slot` in transient storage.
*/
function tstore(Bytes32Slot slot, bytes32 value) internal {
assembly ("memory-safe") {
tstore(slot, value)
}
}
/**
* @dev Load the value held at location `slot` in transient storage.
*/
function tload(Uint256Slot slot) internal view returns (uint256 value) {
assembly ("memory-safe") {
value := tload(slot)
}
}
/**
* @dev Store `value` at location `slot` in transient storage.
*/
function tstore(Uint256Slot slot, uint256 value) internal {
assembly ("memory-safe") {
tstore(slot, value)
}
}
/**
* @dev Load the value held at location `slot` in transient storage.
*/
function tload(Int256Slot slot) internal view returns (int256 value) {
assembly ("memory-safe") {
value := tload(slot)
}
}
/**
* @dev Store `value` at location `slot` in transient storage.
*/
function tstore(Int256Slot slot, int256 value) internal {
assembly ("memory-safe") {
tstore(slot, value)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reinitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.
*
* NOTE: Consider following the ERC-7201 formula to derive storage locations.
*/
function _initializableStorageSlot() internal pure virtual returns (bytes32) {
return INITIALIZABLE_STORAGE;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
bytes32 slot = _initializableStorageSlot();
assembly {
$.slot := slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.20;
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import {IERC5267} from "@openzeppelin/contracts/interfaces/IERC5267.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.
*
* The encoding 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.
*/
abstract contract EIP712Upgradeable is Initializable, IERC5267 {
bytes32 private constant TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
/// @custom:storage-location erc7201:openzeppelin.storage.EIP712
struct EIP712Storage {
/// @custom:oz-renamed-from _HASHED_NAME
bytes32 _hashedName;
/// @custom:oz-renamed-from _HASHED_VERSION
bytes32 _hashedVersion;
string _name;
string _version;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.EIP712")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;
function _getEIP712Storage() private pure returns (EIP712Storage storage $) {
assembly {
$.slot := EIP712StorageLocation
}
}
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
__EIP712_init_unchained(name, version);
}
function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
EIP712Storage storage $ = _getEIP712Storage();
$._name = name;
$._version = version;
// Reset prior values in storage if upgrading
$._hashedName = 0;
$._hashedVersion = 0;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
return _buildDomainSeparator();
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), 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);
}
/// @inheritdoc IERC5267
function eip712Domain()
public
view
virtual
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
EIP712Storage storage $ = _getEIP712Storage();
// If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized
// and the EIP712 domain is not reliable, as it will be missing name and version.
require($._hashedName == 0 && $._hashedVersion == 0, "EIP712: Uninitialized");
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712Name() internal view virtual returns (string memory) {
EIP712Storage storage $ = _getEIP712Storage();
return $._name;
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712Version() internal view virtual returns (string memory) {
EIP712Storage storage $ = _getEIP712Storage();
return $._version;
}
/**
* @dev The hash of the name parameter for the EIP712 domain.
*
* NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.
*/
function _EIP712NameHash() internal view returns (bytes32) {
EIP712Storage storage $ = _getEIP712Storage();
string memory name = _EIP712Name();
if (bytes(name).length > 0) {
return keccak256(bytes(name));
} else {
// If the name is empty, the contract may have been upgraded without initializing the new storage.
// We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.
bytes32 hashedName = $._hashedName;
if (hashedName != 0) {
return hashedName;
} else {
return keccak256("");
}
}
}
/**
* @dev The hash of the version parameter for the EIP712 domain.
*
* NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.
*/
function _EIP712VersionHash() internal view returns (bytes32) {
EIP712Storage storage $ = _getEIP712Storage();
string memory version = _EIP712Version();
if (bytes(version).length > 0) {
return keccak256(bytes(version));
} else {
// If the version is empty, the contract may have been upgraded without initializing the new storage.
// We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.
bytes32 hashedVersion = $._hashedVersion;
if (hashedVersion != 0) {
return hashedVersion;
} else {
return keccak256("");
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides tracking nonces for addresses. Nonces will only increment.
*/
abstract contract NoncesUpgradeable is Initializable {
/**
* @dev The nonce used for an `account` is not the expected current nonce.
*/
error InvalidAccountNonce(address account, uint256 currentNonce);
/// @custom:storage-location erc7201:openzeppelin.storage.Nonces
struct NoncesStorage {
mapping(address account => uint256) _nonces;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Nonces")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant NoncesStorageLocation = 0x5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00;
function _getNoncesStorage() private pure returns (NoncesStorage storage $) {
assembly {
$.slot := NoncesStorageLocation
}
}
function __Nonces_init() internal onlyInitializing {
}
function __Nonces_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the next unused nonce for an address.
*/
function nonces(address owner) public view virtual returns (uint256) {
NoncesStorage storage $ = _getNoncesStorage();
return $._nonces[owner];
}
/**
* @dev Consumes a nonce.
*
* Returns the current value and increments nonce.
*/
function _useNonce(address owner) internal virtual returns (uint256) {
NoncesStorage storage $ = _getNoncesStorage();
// 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.1.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 recovered, RecoverError err, bytes32 errArg) {
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.
assembly ("memory-safe") {
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[ERC-2098 short signatures]
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
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 recovered, RecoverError err, bytes32 errArg) {
// 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.1.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 ERC-1271 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 has code, the
* signature is validated against it using ERC-1271, 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) {
if (signer.code.length == 0) {
(address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
return err == ECDSA.RecoverError.NoError && recovered == signer;
} else {
return 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 ERC-1271.
*
* 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: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { ShMonadStorage } from "./Storage.sol";
import { HoldsLib } from "./libraries/HoldsLib.sol";
import { PolicyAccount, CommittedData, Policy } from "./Types.sol";
import { IShMonad } from "./interfaces/IShMonad.sol";
/**
* @title ShMonadHolds
* @author FastLane Labs
* @notice Transient storage-based Holds mechanism to prevent malicious uncommitting during a transaction.
* @dev Key security features:
* - Policy agents can temporarily lock user's committed shares
* - Held shares cannot be uncommitted, preventing front-running attacks
* - Implemented using transient storage for transaction-duration holds
* - Only authorized agents can create/release holds
* - Policies contract respects holds during uncommit operations
*/
abstract contract ShMonadHolds is ShMonadStorage {
using HoldsLib for PolicyAccount;
// --------------------------------------------- //
// onlyPolicyAgent Functions //
// --------------------------------------------- //
/**
* @notice Places a hold on a specific amount of an account's committed shares in a policy.
* @dev If a hold is already active for an account, the new amount is added to the existing hold. Held shares cannot
* be uncommitted until released and the call reverts if the account lacks sufficient committed value.
* @param policyID The ID of the policy.
* @param account The address whose shares will be held.
* @param amount The amount of shares to hold.
*/
function hold(uint64 policyID, address account, uint256 amount) external onlyPolicyAgentAndActive(policyID) {
_hold(policyID, account, amount);
}
/**
* @notice Releases previously held shares for an account in a policy.
* @dev Deducts `amount` from the existing hold; if the release exceeds the hold, it is set to zero.
* @param policyID The ID of the policy.
* @param account The address whose shares will be released.
* @param amount The amount of shares to release.
*/
function release(uint64 policyID, address account, uint256 amount) external onlyPolicyAgentAndActive(policyID) {
_release(policyID, account, amount);
}
/**
* @notice Places holds on multiple accounts' committed shares in a policy.
* @dev Batch version of hold() for gas efficiency; reverts if any account lacks sufficient committed value.
* @param policyID The ID of the policy.
* @param accounts Array of addresses whose shares will be held.
* @param amounts Array of hold amounts for each account.
*/
function batchHold(
uint64 policyID,
address[] calldata accounts,
uint256[] memory amounts
)
external
onlyPolicyAgentAndActive(policyID)
{
require(
accounts.length == amounts.length, BatchHoldAccountAmountLengthMismatch(accounts.length, amounts.length)
);
for (uint256 i = 0; i < accounts.length; ++i) {
_hold(policyID, accounts[i], amounts[i]);
}
}
/**
* @notice Releases previously held shares for multiple accounts in a policy.
* @dev Batch version of release() for gas efficiency when processing multiple accounts.
* @param policyID The ID of the policy.
* @param accounts Array of addresses whose shares will be released.
* @param amounts Array of release amounts for each account.
*/
function batchRelease(
uint64 policyID,
address[] calldata accounts,
uint256[] calldata amounts
)
external
onlyPolicyAgentAndActive(policyID)
{
require(
accounts.length == amounts.length, BatchReleaseAccountAmountLengthMismatch(accounts.length, amounts.length)
);
for (uint256 i = 0; i < accounts.length; ++i) {
_release(policyID, accounts[i], amounts[i]);
}
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/**
* @notice Gets the amount of shares that are held for an account in a policy.
* @dev Uses transient storage through the HoldsLib library to retrieve the current hold amount.
* @param policyID The ID of the policy.
* @param account The address to check.
* @return The amount of shares held.
*/
function getHoldAmount(uint64 policyID, address account) external view returns (uint256) {
return _getHoldAmount(policyID, account);
}
// --------------------------------------------- //
// Internal Functions //
// --------------------------------------------- //
/**
* @notice Internal implementation of the hold functionality
* @dev Uses the HoldsLib to place a hold on the account's shares
* @dev Accesses the policy's committed data from storage before placing the hold
* @param policyID The ID of the policy
* @param account The address whose shares will be held
* @param amount The amount of shares to place on hold
*/
function _hold(uint64 policyID, address account, uint256 amount) internal {
CommittedData storage committedData = s_committedData[policyID][account];
PolicyAccount(policyID, account).hold(committedData, amount);
}
/**
* @notice Internal implementation of the release functionality
* @dev Uses the HoldsLib to release a hold on the account's shares
* @param policyID The ID of the policy
* @param account The address whose shares will be released
* @param amount The amount of shares to release from hold
*/
function _release(uint64 policyID, address account, uint256 amount) internal {
PolicyAccount(policyID, account).release(amount);
}
/**
* @notice Internal implementation to get the amount of shares on hold
* @dev Uses the HoldsLib to access the transient storage value of hold amount
* @param policyID The ID of the policy
* @param account The address to check the hold amount for
* @return The amount of shares currently on hold
*/
function _getHoldAmount(uint64 policyID, address account) internal view returns (uint256) {
return PolicyAccount(policyID, account).getHoldAmount();
}
// --------------------------------------------- //
// Modifiers //
// --------------------------------------------- //
/**
* @notice Restricts function access to policy agents only
* @dev Checks if the msg.sender is an agent for the specified policy
* @param policyID The ID of the policy to check agent status for
*/
modifier onlyPolicyAgentAndActive(uint64 policyID) {
Policy memory _policy = s_policies[policyID];
require(_policy.active, PolicyInactive(policyID));
if (msg.sender != _policy.primaryAgent) {
require(_isPolicyAgent(policyID, msg.sender), NotPolicyAgent(policyID, msg.sender));
}
_;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.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[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an ERC-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://ethereum.org/en/developers/docs/apis/json-rpc/#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) {
assembly ("memory-safe") {
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 ERC-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://ethereum.org/en/developers/docs/apis/json-rpc/#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 ERC-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 Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.
*/
function toDataWithIntendedValidatorHash(
address validator,
bytes32 messageHash
) internal pure returns (bytes32 digest) {
assembly ("memory-safe") {
mstore(0x00, hex"19_00")
mstore(0x02, shl(96, validator))
mstore(0x16, messageHash)
digest := keccak256(0x00, 0x36)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-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) {
assembly ("memory-safe") {
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) (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.3.0) (interfaces/IERC1271.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-1271 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 `hash`
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { ShMonadErrors } from "./Errors.sol";
import { ShMonadEvents } from "./Events.sol";
import {
Balance,
Policy,
CommittedData,
UncommittingData,
TopUpData,
TopUpSettings,
Supply,
UserUnstakeRequest,
UncommitApproval,
Epoch,
PendingBoost,
CashFlows,
StakingEscrow,
AtomicCapital,
AdminValues,
ValidatorData,
ValidatorDataStorage,
FeeParams,
WorkingCapital,
CurrentLiabilities,
RevenueSmoother,
Revenue
} from "./Types.sol";
import { IShMonad } from "./interfaces/IShMonad.sol";
import { STAKING, EPOCHS_TRACKED, WITHDRAWAL_DELAY } from "./Constants.sol";
abstract contract ShMonadStorage is ShMonadErrors, ShMonadEvents, IShMonad {
uint40 internal immutable STAKING_WITHDRAWAL_DELAY; // Measured in Monad staking epochs
uint64 internal s_policyCount = 0; // Incremented to create ID for each new policy.
// ERC20 data
uint256 internal s_totalSupply; // UNUSED - maintained for storage layout compatibility
uint256 internal s_committedTotalSupply; // UNUSED - maintained for storage layout compatibility
mapping(address account => Balance balance) internal s_balances; // Tracks all types and committed balances
mapping(address account => mapping(address spender => uint256)) internal s_allowances;
// Policy-Account Committed, Uncommitting, and Top-Up data
mapping(uint64 policyID => mapping(address account => CommittedData committedData)) internal s_committedData;
mapping(uint64 policyID => mapping(address account => UncommittingData uncommittingData)) internal
s_uncommittingData;
mapping(uint64 policyID => mapping(address account => TopUpData topUpData)) internal s_topUpData;
mapping(uint64 policyID => mapping(address account => TopUpSettings topUpSettings)) internal s_topUpSettings;
// Policy data
mapping(uint64 policyID => Policy policy) internal s_policies;
mapping(uint64 policyID => mapping(address agent => bool)) internal s_isPolicyAgent;
mapping(uint64 policyID => address[] policyAgents) internal s_policyAgents;
// NOTE: `initialize()` for Ownable setup defined in ShMonad.sol
// Added in 1.2
// Unused - replaced by s_uncommitApprovals
mapping(address task => bytes32 policyIdUserHash) internal s_userTaskUncommits;
// Added in 1.3
// NOTE: Move this to replace s_totalSupply / committed in prod, but keep as separate storage
// on testnet to prevent disrupting balances.
Supply internal s_supply;
// Added in 2.0
// Pending validator unstake requests
mapping(address requestor => UserUnstakeRequest) internal s_unstakeRequests;
// Validator Management
mapping(uint64 validatorId => bool) internal s_validatorIsActive;
// Policies
mapping(uint64 policyID => mapping(address account => UncommitApproval uncommitApproval)) internal
s_uncommitApprovals;
// StakeTracker State
FeeParams internal s_feeParams;
AdminValues internal s_admin;
WorkingCapital internal s_globalCapital;
StakingEscrow internal s_globalPending;
CurrentLiabilities internal s_globalLiabilities;
AtomicCapital internal s_atomicAssets;
RevenueSmoother internal s_revenueSmoother;
CashFlows[EPOCHS_TRACKED] internal s_globalCashFlows;
Epoch[EPOCHS_TRACKED] internal s_globalEpoch;
Revenue[EPOCHS_TRACKED] internal s_globalRevenue;
mapping(uint64 valId => Epoch[EPOCHS_TRACKED]) internal s_validatorEpoch;
mapping(uint64 valId => PendingBoost[EPOCHS_TRACKED]) internal s_validatorRewards;
mapping(uint64 valId => StakingEscrow[EPOCHS_TRACKED]) internal s_validatorPending;
mapping(uint64 valId => ValidatorDataStorage validatorData) internal s_validatorData;
mapping(uint64 valId => address coinbase) internal s_valCoinbases;
mapping(address coinbase => uint64 valId) internal s_valIdByCoinbase;
// Linked list for cranking order using validator IDs
mapping(uint64 thisValId => uint64 nextValId) internal s_valLinkNext;
mapping(uint64 thisValId => uint64 prevValId) internal s_valLinkPrevious;
mapping(address account => uint256 balance) internal s_zeroYieldBalances;
uint256 internal s_activeValidatorCount;
uint256 internal s_pendingTargetAtomicLiquidityPercent;
uint64 internal s_nextValidatorToCrank;
uint256 internal transient t_cashFlowClassifier;
uint64 internal transient t_validatorActiveSetCheckValId;
bool internal transient t_validatorActiveSetCheckValIdState;
constructor() {
STAKING_WITHDRAWAL_DELAY = uint40(WITHDRAWAL_DELAY);
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/**
* @notice Gets the total number of policies that have been created.
* @return The current policy count.
*/
function policyCount() external view returns (uint64) {
return s_policyCount;
}
/**
* @notice Gets information about a specific policy.
* @param policyID The ID of the policy to query.
* @return The policy information (escrow duration, active flag, and primary agent).
*/
function getPolicy(uint64 policyID) external view returns (Policy memory) {
return s_policies[policyID];
}
/**
* @notice Checks if an address is an agent for a specific policy.
* @param policyID The ID of the policy.
* @param agent The address to check.
* @return Whether the address is a policy agent.
*/
function isPolicyAgent(uint64 policyID, address agent) external view returns (bool) {
return _isPolicyAgent(policyID, agent);
}
/**
* @notice Gets all agent addresses for a specific policy.
* @param policyID The ID of the policy.
* @return Array of agent addresses.
*/
function getPolicyAgents(uint64 policyID) external view returns (address[] memory) {
return s_policyAgents[policyID];
}
/**
* @notice Retrieves the rolling global liabilities tracked by StakeTracker.
* @return rewardsPayable The MON amount reserved for rewards payouts.
* @return redemptionsPayable The MON amount pending redemption settlement.
* @return totalZeroYieldPayable The MON amount earmarked for zero-yield obligations (e.g., commission accruals).
*/
function globalLiabilities()
external
view
returns (uint128 rewardsPayable, uint128 redemptionsPayable, uint128 totalZeroYieldPayable)
{
CurrentLiabilities memory _liabilities = s_globalLiabilities;
AdminValues memory _admin = s_admin;
rewardsPayable = _liabilities.rewardsPayable;
redemptionsPayable = _liabilities.redemptionsPayable;
totalZeroYieldPayable = _admin.totalZeroYieldPayable;
}
// --------------------------------------------- //
// View Functions //
// --------------------------------------------- //
/// @notice Returns a user's pending unstake request data (no structs).
function getUnstakeRequest(address account) external view returns (uint128 amountMon, uint64 completionEpoch) {
UserUnstakeRequest memory _userUnstakeReq = s_unstakeRequests[account];
return (_userUnstakeReq.amountMon, _userUnstakeReq.completionEpoch);
}
/// @notice Returns admin values (no structs).
function getAdminValues()
external
view
returns (
uint64 internalEpoch,
uint16 targetLiquidityPercentage,
uint16 incentiveAlignmentPercentage,
uint16 stakingCommission,
uint16 boostCommissionRate,
uint128 totalZeroYieldPayable
)
{
AdminValues memory _admin = s_admin;
return (
_admin.internalEpoch,
_admin.targetLiquidityPercentage,
_admin.incentiveAlignmentPercentage,
_admin.stakingCommission,
_admin.boostCommissionRate,
_admin.totalZeroYieldPayable
);
}
// ================================================== //
// Epoch Alignment //
// ================================================== //
function N(int256 nDelta) internal view returns (uint256 index) {
int256 _internalEpoch = int256(uint256(s_admin.internalEpoch));
unchecked {
// Allow underflow
index = uint256(_internalEpoch + nDelta) % EPOCHS_TRACKED;
}
}
function globalCashFlowsPtr_N(int256 nDelta) internal view returns (CashFlows storage ptr) {
ptr = s_globalCashFlows[N(nDelta)];
}
function globalEpochPtr_N(int256 nDelta) internal view returns (Epoch storage ptr) {
ptr = s_globalEpoch[N(nDelta)];
}
function globalRevenuePtr_N(int256 nDelta) internal view returns (Revenue storage ptr) {
ptr = s_globalRevenue[N(nDelta)];
}
function validatorEpochPtr_N(int256 nDelta, uint64 valId) internal view returns (Epoch storage ptr) {
ptr = s_validatorEpoch[valId][N(nDelta)];
}
function validatorRewardsPtr_N(int256 nDelta, uint64 valId) internal view returns (PendingBoost storage ptr) {
ptr = s_validatorRewards[valId][N(nDelta)];
}
function validatorPendingPtr_N(int256 nDelta, uint64 valId) internal view returns (StakingEscrow storage ptr) {
ptr = s_validatorPending[valId][N(nDelta)];
}
// ================================================== //
// Avoiding SSTORE over Null Values //
// ================================================== //
function _setEpochStorage(Epoch storage ptr, Epoch memory values) internal {
ptr.epoch = values.epoch;
ptr.withdrawalId = values.withdrawalId;
ptr.hasWithdrawal = values.hasWithdrawal;
ptr.hasDeposit = values.hasDeposit;
ptr.crankedInBoundaryPeriod = values.crankedInBoundaryPeriod;
ptr.wasCranked = values.wasCranked;
ptr.frozen = values.frozen;
ptr.closed = values.closed;
ptr.targetStakeAmount = values.targetStakeAmount;
}
function _setStakingQueueStorage(CashFlows storage ptr, CashFlows memory values) internal {
ptr.queueForUnstake = values.queueForUnstake;
ptr.queueToStake = values.queueToStake;
}
function _setRevenueStorage(Revenue storage ptr, Revenue memory values) internal {
ptr.allocatedRevenue = values.allocatedRevenue;
ptr.earnedRevenue = values.earnedRevenue;
}
function _setRewardsStorage(PendingBoost storage ptr, PendingBoost memory values) internal {
ptr.rewardsPayable = values.rewardsPayable;
ptr.earnedRevenue = values.earnedRevenue;
}
function _setPendingStakeStorage(StakingEscrow storage ptr, StakingEscrow memory values) internal {
ptr.pendingStaking = values.pendingStaking;
ptr.pendingUnstaking = values.pendingUnstaking;
}
// --------------------------------------------- //
// Internal Functions //
// --------------------------------------------- //
function _isPolicyAgent(uint64 policyID, address agent) internal view returns (bool) {
return s_isPolicyAgent[policyID][agent];
}
// --------------------------------------------- //
// Modifiers //
// --------------------------------------------- //
modifier notWhenFrozen() {
if (globalEpochPtr_N(0).frozen) {
revert NotWhenFrozen();
}
_;
}
modifier notWhenClosed() {
if (globalEpochPtr_N(0).closed) {
revert NotWhenClosed();
}
_;
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
import { PolicyAccount, CommittedData } from "../Types.sol";
import { ZERO } from "../Constants.sol";
/// @title HoldsLib
/// @notice Library for shMONAD's Holds functionality implemented using transient storage
library HoldsLib {
error InsufficientCommittedForHold(uint256 committed, uint256 holdRequested);
function hold(PolicyAccount memory pAcc, CommittedData storage committedData, uint256 amount) internal {
bytes32 slot = _holdKey(pAcc);
amount += _getHoldAmount(slot);
uint256 committed = committedData.committed;
require(committed >= amount, InsufficientCommittedForHold(committed, amount));
_setHoldAmount(slot, amount);
}
// Use amount = type(uint256).max to skip the slot read, and release hold entirely.
function release(PolicyAccount memory pAcc, uint256 amount) internal {
bytes32 slot = _holdKey(pAcc);
if (amount == type(uint256).max) {
// Set hold to 0
_setHoldAmount(slot, ZERO);
} else {
// Decrease hold by amount (floor is 0)
uint256 currentHold = _getHoldAmount(slot);
currentHold = currentHold > amount ? currentHold - amount : ZERO;
_setHoldAmount(slot, currentHold);
}
}
function getHoldAmount(PolicyAccount memory pAcc) internal view returns (uint256 amount) {
bytes32 slot = _holdKey(pAcc);
return _getHoldAmount(slot);
}
function _holdKey(PolicyAccount memory pAcc) internal pure returns (bytes32) {
return bytes32((uint256(uint160(pAcc.account)) << 64) | uint256(pAcc.policyID));
}
function _getHoldAmount(bytes32 slot) internal view returns (uint256 amount) {
assembly {
amount := tload(slot)
}
}
function _setHoldAmount(bytes32 slot, uint256 amount) internal {
assembly {
tstore(slot, amount)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SafeCast} from "./math/SafeCast.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
uint256 private constant SPECIAL_CHARS_LOOKUP =
(1 << 0x08) | // backspace
(1 << 0x09) | // tab
(1 << 0x0a) | // newline
(1 << 0x0c) | // form feed
(1 << 0x0d) | // carriage return
(1 << 0x22) | // double quote
(1 << 0x5c); // backslash
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @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;
assembly ("memory-safe") {
ptr := add(add(buffer, 0x20), length)
}
while (true) {
ptr--;
assembly ("memory-safe") {
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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @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));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress-string} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress-string-uint256-uint256} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.
*
* WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.
*
* NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of
* RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode
* characters that are not in this range, but other tooling may provide different results.
*/
function escapeJSON(string memory input) internal pure returns (string memory) {
bytes memory buffer = bytes(input);
bytes memory output = new bytes(2 * buffer.length); // worst case scenario
uint256 outputLength = 0;
for (uint256 i; i < buffer.length; ++i) {
bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));
if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {
output[outputLength++] = "\\";
if (char == 0x08) output[outputLength++] = "b";
else if (char == 0x09) output[outputLength++] = "t";
else if (char == 0x0a) output[outputLength++] = "n";
else if (char == 0x0c) output[outputLength++] = "f";
else if (char == 0x0d) output[outputLength++] = "r";
else if (char == 0x5c) output[outputLength++] = "\\";
else if (char == 0x22) {
// solhint-disable-next-line quotes
output[outputLength++] = '"';
}
} else {
output[outputLength++] = char;
}
}
// write the actual length and deallocate unused memory
assembly ("memory-safe") {
mstore(output, outputLength)
mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))
}
return string(output);
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(add(buffer, 0x20), offset))
}
}
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
abstract contract ShMonadErrors {
// Holds
error NotPolicyAgent(uint64 policyID, address caller);
error BatchHoldAccountAmountLengthMismatch(uint256 accountsLength, uint256 amountsLength);
error BatchReleaseAccountAmountLengthMismatch(uint256 accountsLength, uint256 amountsLength);
// CapitalAllocator
error ZeroAddress();
// ValidatorRegistry
error ValidatorAlreadyAdded();
error ValidatorAlreadyDeactivated();
error ValidatorDeactivationNotQueued();
error ValidatorDeactivationQueuedIncomplete();
error ValidatorNotFullyRemoved();
error InvalidValidatorId(uint256 validatorId);
error InvalidValidatorAddress(address coinbase);
error ValidatorNotFoundInPrecompile(uint64 validatorId);
error InsufficientAccumulatedCommission(uint256 requested, uint256 available);
error CannotUnstakeZeroShares();
error InsufficientBalanceForUnstake();
error NoUnstakeRequestFound();
error CompletionEpochNotReached(uint256 currentEpoch, uint256 completionEpoch);
error InsufficientBalanceAtomicUnstakingPool(uint256 requestedAmount, uint256 availableAmount);
error InsufficientReservedLiquidity(uint256 requestedAmount, uint256 availableReserved);
// ValidatorRegistry
error CommissionMustBeBelow100Percent();
error PercentageMustBeBelow100Percent();
error Create2Failed();
// Policies
error CommitRecipientCannotBeZeroAddress();
error InsufficientUncommittedBalance(uint256 available, uint256 requested);
error InsufficientUnheldCommittedBalance(uint128 committed, uint128 held, uint128 requested);
error InsufficientFunds(uint128 committed, uint128 uncommitting, uint128 held, uint128 requested);
error InsufficientUncommittingBalance(uint256 available, uint256 requested);
error UncommittingPeriodIncomplete(uint256 uncommittingCompleteBlock);
error PolicyInactive(uint64 policyID);
error PolicyAgentAlreadyExists(uint64 policyID, address agent);
error PolicyAgentNotFound(uint64 policyID, address agent);
error PolicyNeedsAtLeastOneAgent(uint64 policyID);
error TopUpPeriodDurationTooShort(uint32 requestedPeriodDuration, uint32 minPeriodDuration);
error AgentInstantUncommittingDisallowed(uint64 policyID, address agent);
error InvalidUncommitCompletor();
error InsufficientUncommitApproval(uint256 approved, uint256 requested);
// Zero-Yield Tranche
error InsufficientZeroYieldBalance(uint256 available, uint256 requested);
// ERC4626
error IncorrectNativeTokenAmountSent();
error InvalidFeeRate(uint256 feeRate);
// Safety
error NotWhenFrozen();
error NotWhenClosed();
// Initialization
error UnauthorizedInitializer();
// AtomicUnstakePool
error InsufficientPoolLiquidity(uint256 requested, uint256 available);
error TargetLiquidityCannotExceed100Percent();
error YInterceptExceedsRay();
error SlopeRateExceedsRay();
error FeeCurveFullUtilizationExceedsRay();
// StakeTracker
error WillOverflowOnBitshift();
error ValidatorAvailableExceedsTargetStake(uint256 availableMON, uint256 targetStakeMON);
// Legacy Migration errors
error LegacyStakeDetected();
error LegacyLiabilitiesDetected();
error LegacyAtomicStateDetected();
error LegacyDelegationsDetected();
error LegacyDelegationsPaginationIncomplete();
}//SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.28 <0.9.0;
abstract contract ShMonadEvents {
event Commit(uint64 indexed policyID, address indexed account, uint256 amount);
event RequestUncommit(
uint64 indexed policyID, address indexed account, uint256 amount, uint256 expectedUncommitCompleteBlock
);
event CompleteUncommit(uint64 indexed policyID, address indexed account, uint256 amount);
event UncommitApprovalUpdated(
uint64 indexed policyID, address indexed account, address indexed completor, uint96 shares
);
event AgentTransferFromCommitted(uint64 indexed policyID, address indexed from, address indexed to, uint256 amount);
event AgentTransferToUncommitted(uint64 indexed policyID, address indexed from, address indexed to, uint256 amount);
event AgentWithdrawFromCommitted(uint64 indexed policyID, address indexed from, address indexed to, uint256 amount);
event AgentExecuteWithSponsor(
uint64 indexed policyID,
address indexed payor,
address indexed agent,
address recipient,
uint256 msgValue,
uint256 gasLimit,
uint256 actualPayorCost
);
event SetTopUp(
uint64 indexed policyID,
address indexed account,
uint128 minCommitted,
uint128 maxTopUpPerPeriod,
uint32 topUpPeriodDuration
);
event CreatePolicy(uint64 indexed policyID, address indexed creator, uint48 escrowDuration);
event AddPolicyAgent(uint64 indexed policyID, address indexed agent);
event RemovePolicyAgent(uint64 indexed policyID, address indexed agent);
event DisablePolicy(uint64 indexed policyID);
event BoostYield(
address indexed sender,
address indexed yieldOriginator,
uint256 indexed validatorId,
uint256 amount,
bool sharesBurned
);
// Capital Allocator events
event RequestUnstake(address indexed owner, uint256 shares, uint256 amountMon, uint256 completionEpoch);
event CompleteUnstake(address indexed owner, uint256 amountMon);
event NewEpoch(uint256 epochNumber, uint256 requestedUnstakeAmount, uint256 redeemedUnstakeAmount);
event ValidatorAdded(uint256 validatorId, address coinbase);
event ValidatorRegisteredByAuth(uint64 indexed validatorId, address indexed authAddress);
event ValidatorNotFoundInActiveSet(
uint64 validatorId, address coinbase, uint64 internalEpoch, uint256 detectionIndex
);
event ValidatorMarkedInactive(uint64 validatorId, address coinbase, uint64 internalEpoch);
event ValidatorDeactivated(uint256 validatorId);
event ValidatorRemoved(uint256 validatorId);
event ValidatorWeightsUpdated(uint256[] validators, uint16[] targetWeights, uint256 totalWeight);
event ValidatorStakeAdded(uint256 indexed validatorId, uint256 amount);
event ValidatorUnstakeRequested(
uint64 indexed withdrawEpoch, uint64 indexed validatorId, uint8 withdrawId, uint256 amount
);
event ValidatorUnstakeCompleted(uint256 indexed validatorId, uint256 amount, uint256 withdrawId);
event ManualUnstakeRedemption(uint256 redeemedAmount);
event ManualUnstakeInitiation(uint256 amountRequested, uint256 amountUnstaked);
event StakeFromPoolLiquidity(uint256 amountRequested, uint256 amountStaked, uint256 poolLiquidityRemaining);
event LowValidatorStakeDeltaOnDecrease(
address coinbase,
uint64 validatorId,
uint64 globalEpoch,
uint128 targetStakeAmount,
uint128 netAmount,
bool inActiveSetCurrent,
bool inActiveSetLast
);
event LowValidatorStakeDeltaOnIncrease(
address coinbase,
uint64 validatorId,
uint64 globalEpoch,
uint128 targetStakeAmount,
uint128 netAmount,
bool inActiveSetCurrent,
bool inActiveSetLast
);
event LowValidatorStakeDeltaNetZero(
address coinbase,
uint64 validatorId,
uint64 globalEpoch,
uint128 targetStakeAmount,
uint128 netAmount,
bool inActiveSetCurrent,
bool inActiveSetLast
);
event InsufficientLocalBalance(
uint256 expectedAmount, uint256 actualAmount, uint256 balance, uint256 totalSupply, uint256 actionIndex
);
event InsufficientActiveDelegatedBalance(
address coinbase,
uint64 validatorId,
uint64 globalEpoch,
uint256 expectedWithdrawAmount,
uint256 actualWithdrawAmount
);
event WithdrawSettlementDelayed(
address coinbase,
uint64 validatorId,
uint64 globalEpoch,
uint256 expectedWithdrawAmount,
uint256 availableWithdrawAmount,
uint8 withdrawalId
);
event QueuesOffsetViaNet(
uint256 offsetAmount,
uint256 globalUnstakableAmount,
uint256 queueForUnstake,
uint256 globalStakableAmount,
uint256 queueToStake
);
event ReservesIncreasedBySurplusDeposits(uint256 netToReserves);
event ReservesIncreasedByExcessQueueCapacity(uint256 netToReserves);
event UnstakingQueueExceedsUnstakableAmount(uint256 queueForUnstake, uint256 unstakableAmount);
event StakeUnassignableNoGlobalRevenue(uint256 queueToStake);
event StakingQueueExceedsStakableAmount(uint256 queueToStake, uint256 stakableAmount);
event UnregisteredValidatorRevenue(uint64 epoch, uint256 rewardsSentToValidator, uint256 revenueToShMonad);
event CrankSkippedOnValidatorIdZero(address coinbase);
event UnexpectedNoValidators(uint64 epoch, uint256 queueToStakeRolled, uint256 queueForUnstakeRolled);
event UnexpectedGoodwill(uint64 epoch, uint256 goodwillAmount);
event UnexpectedSurplusOnUnstakeSettle(uint256 expectedAmount, uint256 actualAmount, uint256 actionIndex);
event UnexpectedDeficitOnUnstakeSettle(uint256 expectedAmount, uint256 actualAmount, uint256 actionIndex);
event UnexpectedFailureInitiateStake(
address coinbase, uint64 valId, uint128 nextTargetStakeAmount, uint128 netAmount
);
event UnexpectedFailureInitiateUnstake(
address coinbase, uint64 valId, uint128 nextTargetStakeAmount, uint128 netAmount
);
event UnexpectedValidatorRewardsPayError(
address coinbase, uint64 valId, uint128 validatorRewardsPayable, uint256 addressThisBalance, uint256 actionIndex
);
event UnexpectedYieldSettlementError(
address coinbase, uint64 valId, uint128 amountRewarded, uint256 addressThisBalance, uint256 actionIndex
);
event UnexpectedStakeSettlementError(address coinbase, uint64 valId, uint128 amountReceived, uint256 actionIndex);
event UnexpectedPendingStakeExceedsExpectedActive(
uint64 valId, uint64 shMonEpoch, uint256 pendingStake, uint256 expectedTotalStake
);
event UnexpectedPendingStakeExpectedIsNotActual(
uint64 valId, uint64 shMonEpoch, uint256 pendingExpected, uint256 pendingActual
);
event UnexpectedActiveStakeExpectedIsNotActual(
uint64 valId, uint64 shMonEpoch, uint256 activeExpected, uint256 activeActual
);
event UnexpectedTotalStakeExpectedIsNotActual(
uint64 valId,
uint64 shMonEpoch,
uint256 totalExpected,
uint256 totalActual,
uint256 withdrawalsExpected,
uint256 withdrawalsActual,
uint256 depositsExpected,
uint256 depositsActual
);
event UnexpectedStakeWithdrawalsExpectedIsNotActual(
uint64 valId, uint64 shMonEpoch, uint256 withdrawalsExpected, uint256 withdrawalsActual
);
event UnexpectedAtomicSettlementUnavailableAssets(
uint64 shMonEpoch,
uint256 netUnavailable,
uint256 stakeIn,
uint256 unstakeOut,
uint256 queueToStake,
uint256 queueForUnstake,
uint256 distributedAmount,
uint256 oldAllocatedAmount,
uint256 newAllocatedAmount
);
// DirectDelegation events
event Delegate(uint256 indexed validatorId, address indexed account, uint256 assets, uint256 vShares);
event Undelegate(
uint256 indexed validatorId, address indexed account, uint256 vShares, uint256 assets, uint256 shares
);
event SendValidatorRewards(address sender, uint64 valId, uint256 validatorPayout, uint256 feeTaken);
// AtomicUnstakePool events
event PoolTargetLiquidityPercentageSet(uint256 oldPercentage, uint256 newPercentage);
event PoolLiquidityUpdated(uint256 currentLiquidity, uint256 targetLiquidity);
event UnstakeFeeEnabledSet(bool enabled);
event FeeCurveUpdated(
uint256 oldSlopeRateRay, uint256 oldYInterceptRay, uint256 newSlopeRateRay, uint256 newYInterceptRay
);
// ValidatorRegistry events
event AdminCommissionClaimedAsShares(address indexed recipient, uint256 assets, uint256 shares);
// Zero-Yield Tranche events
event DepositToZeroYieldTranche(address indexed sender, address indexed receiver, uint256 assets);
event ZeroYieldBalanceConvertedToShares(address indexed from, address indexed to, uint256 assets, uint256 shares);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
}
}
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return ternary(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 {
// Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin-upgradeable/contracts/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@solady/=lib/solady/src/",
"forge-std/=lib/forge-std/src/",
"account-abstraction-v7/=lib/account-abstraction-v7/",
"account-abstraction-v8/=lib/account-abstraction-v8/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solady/=lib/solady/src/"
],
"optimizer": {
"enabled": true,
"runs": 50
},
"metadata": {
"useLiteralContent": true,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"AgentInstantUncommittingDisallowed","type":"error"},{"inputs":[{"internalType":"uint256","name":"accountsLength","type":"uint256"},{"internalType":"uint256","name":"amountsLength","type":"uint256"}],"name":"BatchHoldAccountAmountLengthMismatch","type":"error"},{"inputs":[{"internalType":"uint256","name":"accountsLength","type":"uint256"},{"internalType":"uint256","name":"amountsLength","type":"uint256"}],"name":"BatchReleaseAccountAmountLengthMismatch","type":"error"},{"inputs":[],"name":"CannotUnstakeZeroShares","type":"error"},{"inputs":[],"name":"CommissionMustBeBelow100Percent","type":"error"},{"inputs":[],"name":"CommitRecipientCannotBeZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"currentEpoch","type":"uint256"},{"internalType":"uint256","name":"completionEpoch","type":"uint256"}],"name":"CompletionEpochNotReached","type":"error"},{"inputs":[],"name":"Create2Failed","type":"error"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"ERC2612ExpiredSignature","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC2612InvalidSigner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxDeposit","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxMint","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxRedeem","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ERC4626ExceededMaxWithdraw","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"netAssets","type":"uint256"},{"internalType":"uint256","name":"minNetAssets","type":"uint256"}],"name":"ERC4626RedeemSlippageExceeded","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"sharesRequired","type":"uint256"},{"internalType":"uint256","name":"maxBurntShares","type":"uint256"}],"name":"ERC4626WithdrawSlippageExceeded","type":"error"},{"inputs":[],"name":"FeeCurveFullUtilizationExceedsRay","type":"error"},{"inputs":[],"name":"IncorrectNativeTokenAmountSent","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"name":"InsufficientAccumulatedCommission","type":"error"},{"inputs":[{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"uint256","name":"availableAmount","type":"uint256"}],"name":"InsufficientBalanceAtomicUnstakingPool","type":"error"},{"inputs":[],"name":"InsufficientBalanceForUnstake","type":"error"},{"inputs":[{"internalType":"uint256","name":"committed","type":"uint256"},{"internalType":"uint256","name":"holdRequested","type":"uint256"}],"name":"InsufficientCommittedForHold","type":"error"},{"inputs":[{"internalType":"uint128","name":"committed","type":"uint128"},{"internalType":"uint128","name":"uncommitting","type":"uint128"},{"internalType":"uint128","name":"held","type":"uint128"},{"internalType":"uint128","name":"requested","type":"uint128"}],"name":"InsufficientFunds","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"}],"name":"InsufficientPoolLiquidity","type":"error"},{"inputs":[{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"uint256","name":"availableReserved","type":"uint256"}],"name":"InsufficientReservedLiquidity","type":"error"},{"inputs":[{"internalType":"uint256","name":"approved","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientUncommitApproval","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientUncommittedBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientUncommittingBalance","type":"error"},{"inputs":[{"internalType":"uint128","name":"committed","type":"uint128"},{"internalType":"uint128","name":"held","type":"uint128"},{"internalType":"uint128","name":"requested","type":"uint128"}],"name":"InsufficientUnheldCommittedBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"InsufficientZeroYieldBalance","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[{"internalType":"uint256","name":"feeRate","type":"uint256"}],"name":"InvalidFeeRate","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidUncommitCompletor","type":"error"},{"inputs":[{"internalType":"address","name":"coinbase","type":"address"}],"name":"InvalidValidatorAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"validatorId","type":"uint256"}],"name":"InvalidValidatorId","type":"error"},{"inputs":[],"name":"LegacyAtomicStateDetected","type":"error"},{"inputs":[],"name":"LegacyDelegationsDetected","type":"error"},{"inputs":[],"name":"LegacyDelegationsPaginationIncomplete","type":"error"},{"inputs":[],"name":"LegacyLiabilitiesDetected","type":"error"},{"inputs":[],"name":"LegacyStakeDetected","type":"error"},{"inputs":[],"name":"NoUnstakeRequestFound","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"caller","type":"address"}],"name":"NotPolicyAgent","type":"error"},{"inputs":[],"name":"NotWhenClosed","type":"error"},{"inputs":[],"name":"NotWhenFrozen","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PercentageMustBeBelow100Percent","type":"error"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"PolicyAgentAlreadyExists","type":"error"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"PolicyAgentNotFound","type":"error"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"PolicyInactive","type":"error"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"PolicyNeedsAtLeastOneAgent","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint8","name":"bits","type":"uint8"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"SafeCastOverflowedUintDowncast","type":"error"},{"inputs":[],"name":"SlopeRateExceedsRay","type":"error"},{"inputs":[],"name":"TargetLiquidityCannotExceed100Percent","type":"error"},{"inputs":[{"internalType":"uint32","name":"requestedPeriodDuration","type":"uint32"},{"internalType":"uint32","name":"minPeriodDuration","type":"uint32"}],"name":"TopUpPeriodDurationTooShort","type":"error"},{"inputs":[],"name":"UnauthorizedInitializer","type":"error"},{"inputs":[{"internalType":"uint256","name":"uncommittingCompleteBlock","type":"uint256"}],"name":"UncommittingPeriodIncomplete","type":"error"},{"inputs":[],"name":"ValidatorAlreadyAdded","type":"error"},{"inputs":[],"name":"ValidatorAlreadyDeactivated","type":"error"},{"inputs":[{"internalType":"uint256","name":"availableMON","type":"uint256"},{"internalType":"uint256","name":"targetStakeMON","type":"uint256"}],"name":"ValidatorAvailableExceedsTargetStake","type":"error"},{"inputs":[],"name":"ValidatorDeactivationNotQueued","type":"error"},{"inputs":[],"name":"ValidatorDeactivationQueuedIncomplete","type":"error"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"ValidatorNotFoundInPrecompile","type":"error"},{"inputs":[],"name":"ValidatorNotFullyRemoved","type":"error"},{"inputs":[],"name":"WillOverflowOnBitshift","type":"error"},{"inputs":[],"name":"YInterceptExceedsRay","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"agent","type":"address"}],"name":"AddPolicyAgent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"AdminCommissionClaimedAsShares","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"payor","type":"address"},{"indexed":true,"internalType":"address","name":"agent","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"msgValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualPayorCost","type":"uint256"}],"name":"AgentExecuteWithSponsor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AgentTransferFromCommitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AgentTransferToUncommitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AgentWithdrawFromCommitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"yieldOriginator","type":"address"},{"indexed":true,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"sharesBurned","type":"bool"}],"name":"BoostYield","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Commit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CompleteUncommit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountMon","type":"uint256"}],"name":"CompleteUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"}],"name":"CrankSkippedOnValidatorIdZero","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint48","name":"escrowDuration","type":"uint48"}],"name":"CreatePolicy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vShares","type":"uint256"}],"name":"Delegate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"DepositToZeroYieldTranche","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"DisablePolicy","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldSlopeRateRay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldYInterceptRay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newSlopeRateRay","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newYInterceptRay","type":"uint256"}],"name":"FeeCurveUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"globalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"expectedWithdrawAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualWithdrawAmount","type":"uint256"}],"name":"InsufficientActiveDelegatedBalance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"InsufficientLocalBalance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"globalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"targetStakeAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"netAmount","type":"uint128"},{"indexed":false,"internalType":"bool","name":"inActiveSetCurrent","type":"bool"},{"indexed":false,"internalType":"bool","name":"inActiveSetLast","type":"bool"}],"name":"LowValidatorStakeDeltaNetZero","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"globalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"targetStakeAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"netAmount","type":"uint128"},{"indexed":false,"internalType":"bool","name":"inActiveSetCurrent","type":"bool"},{"indexed":false,"internalType":"bool","name":"inActiveSetLast","type":"bool"}],"name":"LowValidatorStakeDeltaOnDecrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"globalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"targetStakeAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"netAmount","type":"uint128"},{"indexed":false,"internalType":"bool","name":"inActiveSetCurrent","type":"bool"},{"indexed":false,"internalType":"bool","name":"inActiveSetLast","type":"bool"}],"name":"LowValidatorStakeDeltaOnIncrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountRequested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountUnstaked","type":"uint256"}],"name":"ManualUnstakeInitiation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"redeemedAmount","type":"uint256"}],"name":"ManualUnstakeRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epochNumber","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"requestedUnstakeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemedUnstakeAmount","type":"uint256"}],"name":"NewEpoch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentLiquidity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"targetLiquidity","type":"uint256"}],"name":"PoolLiquidityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"PoolTargetLiquidityPercentageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"offsetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"globalUnstakableAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"queueForUnstake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"globalStakableAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"queueToStake","type":"uint256"}],"name":"QueuesOffsetViaNet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"agent","type":"address"}],"name":"RemovePolicyAgent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expectedUncommitCompleteBlock","type":"uint256"}],"name":"RequestUncommit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountMon","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"completionEpoch","type":"uint256"}],"name":"RequestUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"netToReserves","type":"uint256"}],"name":"ReservesIncreasedByExcessQueueCapacity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"netToReserves","type":"uint256"}],"name":"ReservesIncreasedBySurplusDeposits","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"validatorPayout","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeTaken","type":"uint256"}],"name":"SendValidatorRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint128","name":"minCommitted","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"maxTopUpPerPeriod","type":"uint128"},{"indexed":false,"internalType":"uint32","name":"topUpPeriodDuration","type":"uint32"}],"name":"SetTopUp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountRequested","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountStaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"poolLiquidityRemaining","type":"uint256"}],"name":"StakeFromPoolLiquidity","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"queueToStake","type":"uint256"}],"name":"StakeUnassignableNoGlobalRevenue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"queueToStake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakableAmount","type":"uint256"}],"name":"StakingQueueExceedsStakableAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"policyID","type":"uint64"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"completor","type":"address"},{"indexed":false,"internalType":"uint96","name":"shares","type":"uint96"}],"name":"UncommitApprovalUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"vShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Undelegate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"activeExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"activeActual","type":"uint256"}],"name":"UnexpectedActiveStakeExpectedIsNotActual","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"netUnavailable","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakeIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unstakeOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"queueToStake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"queueForUnstake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"distributedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"oldAllocatedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAllocatedAmount","type":"uint256"}],"name":"UnexpectedAtomicSettlementUnavailableAssets","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"UnexpectedDeficitOnUnstakeSettle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"nextTargetStakeAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"netAmount","type":"uint128"}],"name":"UnexpectedFailureInitiateStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"nextTargetStakeAmount","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"netAmount","type":"uint128"}],"name":"UnexpectedFailureInitiateUnstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"epoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"goodwillAmount","type":"uint256"}],"name":"UnexpectedGoodwill","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"epoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"queueToStakeRolled","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"queueForUnstakeRolled","type":"uint256"}],"name":"UnexpectedNoValidators","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"pendingStake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expectedTotalStake","type":"uint256"}],"name":"UnexpectedPendingStakeExceedsExpectedActive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"pendingExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pendingActual","type":"uint256"}],"name":"UnexpectedPendingStakeExpectedIsNotActual","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"amountReceived","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"UnexpectedStakeSettlementError","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"withdrawalsExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawalsActual","type":"uint256"}],"name":"UnexpectedStakeWithdrawalsExpectedIsNotActual","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"expectedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"UnexpectedSurplusOnUnstakeSettle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"shMonEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"totalExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalActual","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawalsExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawalsActual","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositsExpected","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositsActual","type":"uint256"}],"name":"UnexpectedTotalStakeExpectedIsNotActual","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"validatorRewardsPayable","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"addressThisBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"UnexpectedValidatorRewardsPayError","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"valId","type":"uint64"},{"indexed":false,"internalType":"uint128","name":"amountRewarded","type":"uint128"},{"indexed":false,"internalType":"uint256","name":"addressThisBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actionIndex","type":"uint256"}],"name":"UnexpectedYieldSettlementError","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"epoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"rewardsSentToValidator","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"revenueToShMonad","type":"uint256"}],"name":"UnregisteredValidatorRevenue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"UnstakeFeeEnabledSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"queueForUnstake","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unstakableAmount","type":"uint256"}],"name":"UnstakingQueueExceedsUnstakableAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":false,"internalType":"address","name":"coinbase","type":"address"}],"name":"ValidatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"validatorId","type":"uint256"}],"name":"ValidatorDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"internalEpoch","type":"uint64"}],"name":"ValidatorMarkedInactive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"internalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"detectionIndex","type":"uint256"}],"name":"ValidatorNotFoundInActiveSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":true,"internalType":"address","name":"authAddress","type":"address"}],"name":"ValidatorRegisteredByAuth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"validatorId","type":"uint256"}],"name":"ValidatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ValidatorStakeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"validatorId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawId","type":"uint256"}],"name":"ValidatorUnstakeCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"withdrawEpoch","type":"uint64"},{"indexed":true,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint8","name":"withdrawId","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ValidatorUnstakeRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"validators","type":"uint256[]"},{"indexed":false,"internalType":"uint16[]","name":"targetWeights","type":"uint16[]"},{"indexed":false,"internalType":"uint256","name":"totalWeight","type":"uint256"}],"name":"ValidatorWeightsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"coinbase","type":"address"},{"indexed":false,"internalType":"uint64","name":"validatorId","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"globalEpoch","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"expectedWithdrawAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"availableWithdrawAmount","type":"uint256"},{"indexed":false,"internalType":"uint8","name":"withdrawalId","type":"uint8"}],"name":"WithdrawSettlementDelayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"ZeroYieldBalanceConvertedToShares","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_PRECOMPILE","outputs":[{"internalType":"contract IMonadStaking","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"addPolicyAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"addValidator","outputs":[{"internalType":"address","name":"coinbase","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"},{"internalType":"address","name":"coinbase","type":"address"}],"name":"addValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fromReleaseAmount","type":"uint256"},{"internalType":"bool","name":"inUnderlying","type":"bool"}],"name":"agentTransferFromCommitted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fromReleaseAmount","type":"uint256"},{"internalType":"bool","name":"inUnderlying","type":"bool"}],"name":"agentTransferToUncommitted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fromReleaseAmount","type":"uint256"},{"internalType":"bool","name":"amountSpecifiedInUnderlying","type":"bool"}],"name":"agentWithdrawFromCommitted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfCommitted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfCommitted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfUncommitting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfZeroYieldTranche","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"batchHold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"batchRelease","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"yieldOriginator","type":"address"}],"name":"boostYield","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"yieldOriginator","type":"address"}],"name":"boostYield","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"claimOwnerCommissionAsShares","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"commitRecipient","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"commit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"committedTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"completeUncommit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"fromPolicyID","type":"uint64"},{"internalType":"uint64","name":"toPolicyID","type":"uint64"},{"internalType":"address","name":"sharesRecipient","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"completeUncommitAndRecommit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"completeUncommitAndRedeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"account","type":"address"}],"name":"completeUncommitWithApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"completeUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"convertZeroYieldTrancheToShares","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"crank","outputs":[{"internalType":"bool","name":"complete","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"escrowDuration","type":"uint48"}],"name":"createPolicy","outputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"deactivateValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"sharesRecipient","type":"address"},{"internalType":"uint256","name":"sharesToCommit","type":"uint256"}],"name":"depositAndCommit","outputs":[{"internalType":"uint256","name":"sharesMinted","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"depositToZeroYieldTranche","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"disablePolicy","outputs":[],"stateMutability":"nonpayable","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":"getActiveValidatorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAdminValues","outputs":[{"internalType":"uint64","name":"internalEpoch","type":"uint64"},{"internalType":"uint16","name":"targetLiquidityPercentage","type":"uint16"},{"internalType":"uint16","name":"incentiveAlignmentPercentage","type":"uint16"},{"internalType":"uint16","name":"stakingCommission","type":"uint16"},{"internalType":"uint16","name":"boostCommissionRate","type":"uint16"},{"internalType":"uint128","name":"totalZeroYieldPayable","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAtomicCapital","outputs":[{"internalType":"uint128","name":"allocatedAmount","type":"uint128"},{"internalType":"uint128","name":"distributedAmount","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAtomicPoolUtilization","outputs":[{"internalType":"uint256","name":"utilized","type":"uint256"},{"internalType":"uint256","name":"allocated","type":"uint256"},{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"utilizationWad","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAtomicUtilizationWad","outputs":[{"internalType":"uint256","name":"utilizationWad","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"getCommittedData","outputs":[{"internalType":"uint128","name":"committed","type":"uint128"},{"internalType":"uint128","name":"minCommitted","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentUnstakeFeeRateRay","outputs":[{"internalType":"uint256","name":"feeRateRay","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEpochInfo","outputs":[{"internalType":"uint256","name":"epochNumber","type":"uint256"},{"internalType":"uint256","name":"epochStartBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFeeCurveParams","outputs":[{"internalType":"uint256","name":"slopeRateRayOut","type":"uint256"},{"internalType":"uint256","name":"yInterceptRayOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalAmountAvailableToUnstake","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"epochPointer","type":"int256"}],"name":"getGlobalCashFlows","outputs":[{"internalType":"uint120","name":"queueToStake","type":"uint120"},{"internalType":"uint120","name":"queueForUnstake","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"epochPointer","type":"int256"}],"name":"getGlobalEpoch","outputs":[{"internalType":"uint64","name":"epoch","type":"uint64"},{"internalType":"uint8","name":"withdrawalId","type":"uint8"},{"internalType":"bool","name":"hasWithdrawal","type":"bool"},{"internalType":"bool","name":"hasDeposit","type":"bool"},{"internalType":"bool","name":"crankedInBoundaryPeriod","type":"bool"},{"internalType":"bool","name":"wasCranked","type":"bool"},{"internalType":"bool","name":"frozen","type":"bool"},{"internalType":"bool","name":"closed","type":"bool"},{"internalType":"uint128","name":"targetStakeAmount","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGlobalPending","outputs":[{"internalType":"uint120","name":"pendingStaking","type":"uint120"},{"internalType":"uint120","name":"pendingUnstaking","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"epochPointer","type":"int256"}],"name":"getGlobalRevenue","outputs":[{"internalType":"uint120","name":"allocatedRevenue","type":"uint120"},{"internalType":"uint120","name":"earnedRevenue","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"epochPointer","type":"int256"}],"name":"getGlobalStatus","outputs":[{"internalType":"bool","name":"frozen","type":"bool"},{"internalType":"bool","name":"closed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"getHoldAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInternalEpoch","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextValidatorToCrank","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPendingTargetLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"getPolicy","outputs":[{"components":[{"internalType":"uint48","name":"escrowDuration","type":"uint48"},{"internalType":"bool","name":"active","type":"bool"},{"internalType":"address","name":"primaryAgent","type":"address"}],"internalType":"struct Policy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"}],"name":"getPolicyAgents","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getScaledTargetLiquidityPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTargetLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"getTopUpSettings","outputs":[{"internalType":"uint128","name":"maxTopUpPerPeriod","type":"uint128"},{"internalType":"uint32","name":"topUpPeriodDuration","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"getUncommitApproval","outputs":[{"components":[{"internalType":"address","name":"completor","type":"address"},{"internalType":"uint96","name":"shares","type":"uint96"}],"internalType":"struct UncommitApproval","name":"approval","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"getUncommittingData","outputs":[{"internalType":"uint128","name":"uncommitting","type":"uint128"},{"internalType":"uint48","name":"uncommitStartBlock","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getUnstakeRequest","outputs":[{"internalType":"uint128","name":"amountMon","type":"uint128"},{"internalType":"uint64","name":"completionEpoch","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"validatorId","type":"uint256"}],"name":"getValidatorCoinbase","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorData","outputs":[{"internalType":"uint64","name":"epoch","type":"uint64"},{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"bool","name":"isPlaceholder","type":"bool"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"bool","name":"inActiveSet_Current","type":"bool"},{"internalType":"bool","name":"inActiveSet_Last","type":"bool"},{"internalType":"address","name":"coinbase","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorEpochs","outputs":[{"internalType":"uint64","name":"lastEpoch","type":"uint64"},{"internalType":"uint128","name":"lastTargetStakeAmount","type":"uint128"},{"internalType":"uint64","name":"currentEpoch","type":"uint64"},{"internalType":"uint128","name":"currentTargetStakeAmount","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"coinbase","type":"address"}],"name":"getValidatorIdForCoinbase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorNeighbors","outputs":[{"internalType":"address","name":"previous","type":"address"},{"internalType":"address","name":"next","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorPendingEscrow","outputs":[{"internalType":"uint120","name":"lastPendingStaking","type":"uint120"},{"internalType":"uint120","name":"lastPendingUnstaking","type":"uint120"},{"internalType":"uint120","name":"currentPendingStaking","type":"uint120"},{"internalType":"uint120","name":"currentPendingUnstaking","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorRewards","outputs":[{"internalType":"uint120","name":"lastRewardsPayable","type":"uint120"},{"internalType":"uint120","name":"lastEarnedRevenue","type":"uint120"},{"internalType":"uint120","name":"currentRewardsPayable","type":"uint120"},{"internalType":"uint120","name":"currentEarnedRevenue","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"getValidatorStats","outputs":[{"components":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"address","name":"coinbase","type":"address"},{"internalType":"uint64","name":"lastEpoch","type":"uint64"},{"internalType":"uint128","name":"targetStakeAmount","type":"uint128"},{"internalType":"uint128","name":"rewardsPayableLast","type":"uint128"},{"internalType":"uint128","name":"earnedRevenueLast","type":"uint128"},{"internalType":"uint128","name":"rewardsPayableCurrent","type":"uint128"},{"internalType":"uint128","name":"earnedRevenueCurrent","type":"uint128"}],"internalType":"struct ValidatorStats","name":"stats","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWorkingCapital","outputs":[{"internalType":"uint128","name":"stakedAmount","type":"uint128"},{"internalType":"uint128","name":"reservedAmount","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalLiabilities","outputs":[{"internalType":"uint128","name":"rewardsPayable","type":"uint128"},{"internalType":"uint128","name":"redemptionsPayable","type":"uint128"},{"internalType":"uint128","name":"totalZeroYieldPayable","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"hold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"deployer","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isGlobalCrankAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"isPolicyAgent","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"isValidatorActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"isValidatorCrankAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"listActiveValidators","outputs":[{"internalType":"uint64[]","name":"validatorIds","type":"uint64[]"},{"internalType":"address[]","name":"coinbases","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"inUnderlying","type":"bool"}],"name":"policyBalanceAvailable","outputs":[{"internalType":"uint256","name":"balanceAvailable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"policyCount","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"}],"name":"previewCoinbaseAddress","outputs":[{"internalType":"address","name":"predicted","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeemDetailed","outputs":[{"internalType":"uint256","name":"grossAssets","type":"uint256"},{"internalType":"uint256","name":"feeAssets","type":"uint256"},{"internalType":"uint256","name":"netAssets","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewUnstake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"netAssets","type":"uint256"}],"name":"previewWithdrawDetailed","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"grossAssets","type":"uint256"},{"internalType":"uint256","name":"feeAssets","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"realTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"minAssetsOut","type":"uint256"}],"name":"redeemWithSlippageProtection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"agent","type":"address"}],"name":"removePolicyAgent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"newMinBalance","type":"uint256"}],"name":"requestUncommit","outputs":[{"internalType":"uint256","name":"uncommitCompleteBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"uint256","name":"newMinBalance","type":"uint256"},{"internalType":"address","name":"completor","type":"address"}],"name":"requestUncommitWithApprovedCompletor","outputs":[{"internalType":"uint256","name":"uncommitCompleteBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"requestUnstake","outputs":[{"internalType":"uint64","name":"completionEpoch","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"validatorId","type":"uint64"},{"internalType":"uint256","name":"feeRate","type":"uint256"}],"name":"sendValidatorRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"isClosed","type":"bool"}],"name":"setClosedStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isFrozen","type":"bool"}],"name":"setFrozenStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"uint128","name":"minCommitted","type":"uint128"},{"internalType":"uint128","name":"maxTopUpPerPeriod","type":"uint128"},{"internalType":"uint32","name":"topUpPeriodDuration","type":"uint32"}],"name":"setMinCommittedBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPercentageScaled","type":"uint256"}],"name":"setPoolTargetLiquidityPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"completor","type":"address"},{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"setUncommitApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSlopeRateRay","type":"uint256"},{"internalType":"uint256","name":"newYInterceptRay","type":"uint256"}],"name":"setUnstakeFeeCurve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slopeRateRay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"inUnderlying","type":"bool"}],"name":"topUpAvailable","outputs":[{"internalType":"uint256","name":"amountAvailable","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unclaimedOwnerCommission","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"policyID","type":"uint64"},{"internalType":"address","name":"account","type":"address"}],"name":"uncommittingCompleteBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"feeInBps","type":"uint16"}],"name":"updateBoostCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"percentageInBps","type":"uint16"}],"name":"updateIncentiveAlignmentPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"feeInBps","type":"uint16"}],"name":"updateStakingCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"maxBurntShares","type":"uint256"}],"name":"withdrawWithSlippageProtection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"yInterceptRay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60a080604052346100d0575f80546001600160401b031916905560016080525f51602062010a905f395f51905f5254604081901c60ff166100c1576002600160401b03196001600160401b0382160161006d575b604051620109bb9081620000d58239608051816150260152f35b6001600160401b0319166001600160401b039081175f51602062010a905f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f80610053565b63f92ee8a960e01b5f5260045ffd5b5f80fdfe60806040526004361015610106575b3615610018575f80fd5b5f5c60ff81169061002882616a19565b61003182616a19565b8115610083575b61004f90349060081c6001600160781b031661609b565b6001600160781b038111610074574760801b9061006b83616a19565b60081b17175f5d005b63daccb93d60e01b5f5260045ffd5b47610091348360801c61609b565b116100385761009f3461aa69565b9060085f6001600160401b0360125416089160088310156100f2576018909201805461004f936001600160781b03916100da91908316616a37565b82546001600160781b03191691161790559050610038565b634e487b7160e01b5f52603260045260245ffd5b5f3560e01c8062601aaf1461577357806301b3bfa41461572057806301e1d1141461570357806306fdde03146156d4578063071c36261461567257806307a2d13a14612a8657806308cd7fad14615653578063095ea7b31461562d5780630a28a4771461560c5780630b4c71411461555b5780630cb9f3ad1461553f5780630e1e8f7d146155025780630fb6215a146154ea57806313788fe51461527957806318160ddd146107905780631884fbda146152555780631d07c5cf1461521d5780632309572114614ecc57806323b872dd14614e9457806329067fef14614d9f57806329bb317c14614d795780632a743e0a14614d595780632c45d5dc14614cdd5780632d6d6b9714614c39578063313ce56714614c1e578063321677f214614b205780633644e51514614b06578063365520db14614adb5780633664f7af14614aa557806337deea7014614a8857806338d52e0f14614a5a5780633bbc81d114614a06578063402d267d1461141f578063402f1cd4146147d8578063417b7e51146147ab57806341faf0a71461476b578063421c885d1461471e578063424567eb146146de57806344390e2f146146c4578063462fff96146146585780634cac8783146145bb5780634cdad5061461459a5780634d28a646146144dc5780634dc4993a146142ca5780634e4ed7fc1461413d5780634f8da2a7146140215780635357a13614613d1e57806355e6912414613c5c578063584e378514613c0c578063602f41d114613be457806363803b23146139cb578063647a47721461399057806364a6c194146139245780636653bd411461389557806367070c951461377957806367f6007c146137055780636a610788146136de5780636c91b1011461364e5780636d20d833146135f65780636d738773146135525780636e553f65146135315780636ec52fed1461351757806370a08231146134d7578063715018a61461346f57806373e45bae146132b657806374662009146130915780637710d4ff1461307757806379251e7e146130225780637bca512614612f9b5780637d05b18e14612ecc5780637ecebe0014612e765780637fbee51514612e30578063822c6d6d14612db957806384aae4c914612d5c57806384b0196e14612c365780638b5f6d5214612c1c5780638d01c5c814612ae95780638da5cb5b14612ab45780638f28954414612a8b5780639176755214612a865780639292430b1461296b578063934c85d71461292d57806394bf804d1461283f57806395d89b41146127f857806397c76115146127c45780639a292225146127aa5780639a7a039b1461276b5780639b5e7cf2146125c45780639c16a9e8146125505780639e1844c6146125135780639e6cb0bf146124b15780639eaeb31a1461245f5780639fc758e1146123bc578063a250f8251461238f578063a60232ad1461232a578063a9059cbb146122f9578063a9fd1a8f14612270578063aba9598b146121ee578063aeefe59d1461212e578063aff94332146120d2578063b3d7f6b914612085578063b460af941461206c578063b59654701461201d578063ba08765214612004578063ba749daf14611fc6578063ba7c0e4014611e53578063bc3ec4c214611c41578063be1d8e1c14611bf4578063bf39ed9314611b98578063bfece887146119be578063c2006eaa14611961578063c4d66de814611424578063c63d75b61461141f578063c6e6f592146113bd578063c84fef9f1461137c578063c8a505f014611362578063cbd2d52214611312578063cc34b8f6146112f2578063cc56a82a1461123c578063ce96cb771461121e578063d3b9fd7214611041578063d505accf14610e6f578063d5dc7f7514610cd6578063d813f07414610cbc578063d905777e14610c88578063da92ea0d14610c5c578063db8a582b14610c2b578063dd62ed3e14610bdb578063de54d42914610bb6578063df19afcf14610b8e578063e5cdc7c7146107c7578063e65f808714610795578063ef356a7914610790578063ef8b30f71461076a578063f062f3861461073d578063f08814421461071b5763f2fde38b0361000e57346107175760203660031901126107175761071561070861583e565b610710616a5f565b6169a7565b005b5f80fd5b346107175761071561072c366159c9565b916107368161862f565b339061993f565b3461071757602036600319011261071757602061076061075b6157e6565b61690d565b6040519015158152f35b34610717576020366003190112610717576020610788600435617157565b604051908152f35b615880565b34610717575f3660031901126107175760806107af6168ba565b91604051938452602084015260408301526060820152f35b6040366003190112610717576107db6157e6565b6024356107e661707d565b670de0b6b3a76400008111610b7c57670de0b6b3a764000061080b61081192346161db565b0461aa69565b61083c61083561271061080b61ffff60125460701c1660018060781b0386166161db565b80926180ae565b916108538261084e8561084e3461aa69565b6180ae565b61085c82617e53565b6040810151159081610b6e575b5015610ab5576001600160401b0382165f5260316020526108e86108a060405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b03906108b99085908316616a37565b82546001600160781b0319169116178082556108e290879060781c6001600160781b0316616a37565b90617cbc565b60085f6001600160401b03601254160860088110156100f257602801805461092291906108e290879060781c6001600160781b0316616a37565b6015546001600160781b038216906001600160801b0361094483828416615f93565b166001600160801b031991821617601555601254906109706001600160781b038716608084901c615f93565b6001600160801b03909216608092831b9190911617601255601354916001600160801b0319916109a3919084901c615f93565b60801b169060018060801b0316176013555b5f516020620108665f395f51905f525f5260386020525f516020620109265f395f51905f5280546109f0906001600160781b0386169061609b565b90556109fc8385616a37565b9260085f6001600160401b0360125416089060088210156100f257601890910180547fa00ba9b9fddae2429c7131955af6dd8add3137d90ca8d1145d773f79cb484dd296608096610a74949391926001600160781b0391610a5e918316616a37565b82546001600160781b0319169116179055616a37565b604080513381526001600160401b039490941660208501526001600160781b0392831690840152166060820152a15f5f516020620108c65f395f51905f525d005b610b3091936002600160401b035f526031602052610b2b610ae960405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b0390610b029086908316616a37565b82546001600160781b0319169116178082556108e290849060781c6001600160781b0316616a37565b616a37565b6012549092905f906001600160801b0319610b586001600160781b038616608084901c615f93565b60801b169060018060801b0316176012556109b5565b608091500151151585610869565b6336e6824b60e21b5f5260045260245ffd5b34610717575f366003190112610717576011546040516001600160801b039091168152602090f35b34610717575f3660031901126107175760206001600160401b035f5416604051908152f35b3461071757604036600319011261071757610bf461583e565b610bfc615854565b6001600160a01b039182165f908152600460209081526040808320949093168252928352819020549051908152f35b34610717575f36600319011261071757601154604080516001600160801b038316815260809290921c602083015290f35b34610717576040366003190112610717576020610788610c7a6157e6565b610c82615854565b90618311565b34610717576020366003190112610717576020610788610cb6610cb1610cac61583e565b616879565b61832e565b50617114565b34610717575f3660031901126107175760206107886168aa565b34610717575f36600319011261071757603954610cf281615afd565b610cff6040519182615adc565b818152610d0b82615afd565b6020820190601f1901368237610d2083615afd565b610d2d6040519182615adc565b838152601f19610d3c85615afd565b01366020830137670f6b75ab2bc471c75f5260366020526001600160401b0360405f205416916001600160401b035f935b16678ac7230489e7ffff81141580610e66575b15610e0c576002600160401b038103610daf575b5f5260366020526001600160401b038060405f205416610d6d565b80151580610df3575b15610d9457928084610dcc60019388616825565b52845f526034602052818060a01b0360405f205416610deb8286616825565b520192610d94565b50805f52603360205260ff60405f205460801c16610db8565b50838260405191604083019060408452518091526060830193905f5b818110610e47578480610e4388878382036020850152615a03565b0390f35b82516001600160401b0316865260209586019590920191600101610e28565b50858410610d80565b346107175760e036600319011261071757610e8861583e565b610e90615854565b604435906064359260843560ff811681036107175760a43560c4359186421161102e57604260018060a01b03851697885f527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb0060205260405f20908154916001830190556040519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c984528b604084015260018060a01b038a1660608401528a608084015260a083015260c082015260c08152610f5360e082615adc565b519020610f5e61ac6f565b906040519161190160f01b8352600283015260228201522090610f8f610f868585848661d02f565b9092919261d0a7565b6001600160a01b031693888503610fac575b61071588888861ac0c565b85949796953b1561101757610ff19495969750604051936020850152604084015260ff60f81b9060f81b16606083015260418252610feb606183615adc565b8361a97b565b15611000578380808080610fa1565b836325c0072360e11b5f525f60045260245260445ffd5b88886325c0072360e11b5f5260045260245260445ffd5b8663313c898160e11b5f5260045260245ffd5b346107175760203660031901126107175761105a6157e6565b6040516101008101918183106001600160401b0384111761120a57610100926040525f8252602082015f8152604083015f8152606084015f815260808501905f82526001600160401b0360a08701935f855260c08801955f875260e08901975f8952838116805f5260346020526110fc60018060a01b0360405f20541692825f52603360205260ff60405f205460801c16158d811580915290611201576166a5565b805f52603060205261112461111e60405f2060085f1989601254160890616a50565b50615d30565b815f52603160205261114c61114660405f2060085f198a601254160890616a50565b50615b4b565b915f52603160205261116d61114660405f2060085f8a601254160890616a50565b9284528051861685528c01516001600160801b03908116875281516001600160781b03908116895260209283015181168a52835181168b52928201519092168a52604080519b5115158c5292516001600160a01b0316908b01529151909216918801919091529051811660608701529051811660808601529051811660a08501529051811660c084015290511660e0820152f35b508315156166a5565b634e487b7160e01b5f52604160045260245ffd5b34610717576020366003190112610717576020610788610cac61583e565b346107175761071561124d366159c9565b916001600160401b038116805f52600960205260405f206112a9836040519261127584615a6f565b549265ffffffffffff84168152604060ff8560301c16151591826020820152019360018060a01b039060381c168452615e22565b516001600160a01b031633036112c0575b506170b4565b5f52600a60205260405f2060018060a01b0333165f526020526112ec60405f208260ff33925416615e69565b846112ba565b34610717575f366003190112610717576020600d5460801c604051908152f35b346107175760203660031901126107175761132e600435616aca565b6113378161a95a565b90610e4361134583836161aa565b604051938493846040919493926060820195825260208201520152565b34610717575f366003190112610717576020610788616839565b34610717576020366003190112610717576001600160a01b0361139d61583e565b165f52603560205260206001600160401b0360405f205416604051908152f35b34610717576020366003190112610717576113d86001616ab7565b600d546001600160801b0316600181019190821061140b576001810180911161140b575f6107889160209360043561abc3565b634e487b7160e01b5f52601160045260245ffd5b6158a8565b346107175760203660031901126107175761143d61583e565b5f516020620109065f395f51905f525460ff8160401c1690811561194c575b5061193d575f516020620109065f395f51905f52805468ffffffffffffffffff19166801000000000000000a1790557fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316330361192e576114c4615b9c565b9060409081516114d48382615adc565b60018152603360f81b60208201526114ea61cfdb565b6114f261cfdb565b83516001600160401b03811161120a5761151a5f516020620107865f395f51905f5254618350565b601f81116118be575b50602094601f8211600114611841579481929394955f92611836575b50508160011b915f199060031b1c1916175f516020620107865f395f51905f52555b8051906001600160401b03821161120a5761158a5f516020620107c65f395f51905f5254618350565b601f81116117c6575b50602090601f831160011461171f5792827fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29593611629936020965f92611714575b50508160011b915f199060031b1c1916175f516020620107c65f395f51905f52555b5f5f516020620107e65f395f51905f52555f5f516020620109465f395f51905f525561162161cfdb565b61071061cfdb565b611631615c54565b80516001600160801b03161590816116ff575b5061167c575b61165261cfdb565b61165a61a460565b5f516020620109065f395f51905f52805460ff60401b1916905551600a8152a1005b6116ac815161168a81615a8a565b6a084595161401484a0000008152690a968163f0a57b40000084820152615f14565b7f17295cc579d48cf6a42ae45a4e3c7791f30633c7d1defa248133a238f41b580e608082515f81525f858201526a084595161401484a00000084820152690a968163f0a57b4000006060820152a161164a565b8301516001600160801b031615905084611644565b0151905087806115d5565b90601f198316915f516020620107c65f395f51905f525f52815f20925f5b8181106117ae5750936116299360209693600193837fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29a9810611796575b505050811b015f516020620107c65f395f51905f52556115f7565b01515f1960f88460031b161c1916905587808061177b565b9293602060018192878601518155019501930161173d565b5f516020620107c65f395f51905f525f527f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75601f840160051c8101916020851061182c575b601f0160051c01905b8181106118215750611593565b5f8155600101611814565b909150819061180b565b01519050858061153f565b601f198216955f516020620107865f395f51905f525f52805f20915f5b8881106118a65750836001959697981061188e575b505050811b015f516020620107865f395f51905f5255611561565b01515f1960f88460031b161c19169055858080611873565b9192602060018192868501518155019401920161185e565b5f516020620107865f395f51905f525f527f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d601f830160051c81019160208410611924575b601f0160051c01905b8181106119195750611523565b5f815560010161190c565b9091508190611903565b630d622feb60e01b5f5260045ffd5b63f92ee8a960e01b5f5260045ffd5b600a91506001600160401b031610158261145c565b346107175760203660031901126107175761197a6158e3565b611982616a5f565b60085f6001600160401b0360125416089060088210156100f2576020909101805460ff60701b191691151560701b60ff60701b16919091179055005b34610717576119cc366158f2565b929093916001600160401b03861693845f52600960205260405f206119f8886040519261127584615a6f565b516001600160a01b03163303611b66575b8195855f52600a60205260405f2060018060a01b0386165f52602052611a38858960ff60405f20541615615e99565b80611b55575b50611b1c575b507fa7c991dcadb18e7fc11637631b396a1a09f4a4230e968e6db43176dbdadae7e991602091611ac9611a768761718f565b97865f526005855260405f2060018060a01b0385165f528552611aa78985611aa060405f20615ca0565b93846177e5565b5f8781526005865260408082206001600160a01b038716835287529020615f64565b6001600160a01b03165f81815260038452604090208054919790916001600160801b0391611af8918316615f93565b82546001600160801b03191691161790556040519485526001600160a01b031693a4005b602091945091611b4c7fa7c991dcadb18e7fc11637631b396a1a09f4a4230e968e6db43176dbdadae7e99361714e565b94915091611a44565b611b609085896170b4565b87611a3e565b845f52600a60205260405f2060018060a01b0333165f52602052611b9360405f208860ff33925416615e69565b611a09565b3461071757604036600319011261071757611bb16157e6565b6001600160401b03611bc1615854565b91165f52600660205260405f209060018060a01b03165f52602052602060405f2060018060801b03905416604051908152f35b3461071757611c0e611c0536615951565b9391819361670b565b90828211611c2157602082604051908152f35b63118beac360e31b5f5260018060a01b031660045260245260445260645ffd5b3461071757604036600319011261071757600435611c5d615854565b60085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457611c8c61707d565b611c94615cc5565b335f90815260386020526040902054909190838110611e2d575060a0820180516020949291611dba916001600160801b0390611cd590828716908316616396565b168152335f526038865260405f20611cee8582546161aa565b9055611d8b61ffff6080611d0187617157565b97611d0c898861af60565b611d1f6001600160401b03825116615ddd565b611d2d838b83015116617fea565b611d3c83604083015116615bc1565b611d67836060830151166012805461ffff60601b191660609290921b61ffff60601b16919091179055565b0151166012805461ffff60701b191660709290921b61ffff60701b16919091179055565b516001600160801b0316601280546001600160801b031660809290921b6001600160801b031916919091179055565b60018060a01b0316908160405182815284868201527f2189dd61ba10a76e3348bbca899b71e3e23de0828ef127051ae8c506eda66f3360403392a360405190815282848201525f516020620109665f395f51905f5260403392a35f5f516020620108c65f395f51905f525d604051908152f35b839063117190a960e31b5f5260045260245260445ffd5b631199412360e11b5f5260045ffd5b3461071757606036600319011261071757611e6c6157e6565b6024356001600160401b03811161071757611e8b903690600401615a3f565b604492919235916001600160401b038311610717573660238401121561071757826004013592611eba84615afd565b93611ec86040519586615adc565b8085526024602086019160051b8301019136831161071757602401905b828210611fb6575050506001600160401b038116805f52600960205260405f20611f16836040519261127584615a6f565b516001600160a01b03163303611f84575b508251808303611f6e57505f5b828110611f3d57005b80611f68611f56611f51600194878a616372565b616382565b611f608388616825565b51908561a33e565b01611f34565b8263ab2552b360e01b5f5260045260245260445ffd5b5f52600a60205260405f2060018060a01b0333165f52602052611fb060405f208260ff33925416615e69565b84611f27565b8135815260209182019101611ee5565b34610717575f36600319011261071757611fde615b14565b8051602091820151604080516001600160781b0393841681529290911692820192909252f35b346107175760206107886120173661598f565b916167a4565b34610717576040366003190112610717576107156120396157e6565b612041615854565b9061204a616a5f565b612067816002600160401b036001600160401b03821614156166a5565b619c20565b3461071757602061078861207f3661598f565b9161670b565b346107175760203660031901126107175761209f5f616ab7565b6001810180911161140b57600d546001600160801b03166001810190811061140b5760016107889160209360043561abc3565b34610717576040366003190112610717576120eb6157e6565b6001600160401b036120fb615854565b91165f52600560205260405f209060018060a01b03165f52602052602060405f2060018060801b03905416604051908152f35b346107175760203660031901126107175760806001600160401b036121516157e6565b16805f52603060205261217b61111e60405f2060085f196001600160401b03601254160890616a50565b905f5260306020526121a361111e60405f2060085f6001600160401b03601254160890616a50565b6001600160401b0382511691610100600180861b0391015116906001600160401b0381511690610100600180871b039101511691604051938452602084015260408301526060820152f35b34610717576107156121ff366159c9565b916001600160401b038116805f52600960205260405f20612227836040519261127584615a6f565b516001600160a01b0316330361223e575b5061a33e565b5f52600a60205260405f2060018060a01b0333165f5260205261226a60405f208260ff33925416615e69565b84612238565b34610717575f3660031901126107175760408051630eaf323560e31b815290816004815f6110005af180156122ee576040915f916122c0575b506001600160401b038251911681525f6020820152f35b6122e09150823d84116122e7575b6122d88183615adc565b8101906166ea565b50826122a9565b503d6122ce565b6040513d5f823e3d90fd5b346107175760403660031901126107175761231f61231561583e565b6024359033616c71565b602060405160018152f35b3461071757602036600319011261071757602061236b6123486157e6565b612366816001600160401b038116801515908161237d575b506166a5565b61a2e2565b6040516001600160a01b039091168152f35b90506002600160401b03141586612360565b34610717575f3660031901126107175760206107886123ac615c08565b47906123b6615be2565b9061a29a565b34610717576020366003190112610717576123d56157e6565b6123dd616a5f565b6123fa816002600160401b036001600160401b03821614156166a5565b6124038161cd78565b61240c8261cdc4565b6124158361a2e2565b803b61244e57506020815191015ff56001600160a01b0381161561243f5761236b81602093619c20565b630252d9f760e11b5f5260045ffd5b602093925061236b91508092619c20565b34610717576080366003190112610717576124786157e6565b602435906001600160401b0382168203610717576107159161249861586a565b9061073660643580946124aa8461862f565b3390616f08565b346107175760203660031901126107175760043561ffff811680820361071757612710906124dd616a5f565b1015612504576012805461ffff60601b191660609290921b61ffff60601b16919091179055005b63026d491d60e51b5f5260045ffd5b6020610788612521366159c9565b92919061252d8261862f565b839161253933346160df565b945f191461254857339061993f565b849250610736565b34610717575f3660031901126107175760085f6001600160401b03601254160860088110156100f2576020015460681c60ff166125b55761258f618654565b80156125a3575b6020906040519015158152f35b5060206125ae619887565b9050612596565b6324b7349560e21b5f5260045ffd5b34610717576080366003190112610717576125dd6157e6565b6024356001600160801b03811691828203610717576044356001600160801b03811690819003610717576064359163ffffffff8316809303610717578061262b6001600160401b039261862f565b1692835f52600860205260405f2060018060a01b0333165f5260205260405f20906040519161265983615a6f565b549060018060801b0382168352602083019063ffffffff8360801c168252604084019260a01c835285612746575b8484528582525f878152600560209081526040808320338452909152902061270e949392916126b591615ec9565b5f87815260086020908152604080832033845290915290209251835491516001600160a01b03199092166001600160801b03919091161760809190911b63ffffffff60801b16178255516001600160601b031690616078565b604051938452602084015260408301527fcbb3320930c2934da510e3107d0acc2f5494678603ee08c1e646ccf545f9b10e60603393a3005b62034bc0861015612687578563cfcc315960e01b5f5260045262034bc060245260445ffd5b3461071757602036600319011261071757600435612787616a5f565b670de0b6b3a7640000811161279b57603a55005b63791449d360e11b5f5260045ffd5b34610717575f36600319011261071757602061076061661f565b346107175760603660031901126107175760206107886127e26157e6565b6127ea615854565b6127f26158d4565b916164ed565b34610717575f36600319011261071757610e43604051612819604082615adc565b600581526439b426a7a760d91b60208201526040519182916020835260208301906157fc565b604036600319011261071757600435612856615854565b60085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e445761288561707d565b6001600160801b0382116128fc576128a661289f5f616ab7565b34906161aa565b6001810180911161140b57600d546001600160801b0316600181019390841061140b576128db60016020956128e3948461abc3565b809333617f6e565b5f5f516020620108c65f395f51905f525d604051908152f35b63284ff66760e01b5f9081526001600160a01b03919091166004526024919091526001600160801b03604452606490fd5b34610717575f36600319011261071757612945615c08565b8051602091820151604080516001600160801b0393841681529290911692820192909252f35b34610717576060366003190112610717576129846157e6565b6024356001600160401b038111610717576129a3903690600401615a3f565b916044356001600160401b038111610717576129c3903690600401615a3f565b91906001600160401b038216805f52600960205260405f206129ec846040519261127584615a6f565b516001600160a01b03163303612a54575b50828503612a3d575f5b858110612a1057005b80612a37612a24611f516001948a8a616372565b612a2f838887616372565b3590866170b4565b01612a07565b8285635633168160e11b5f5260045260245260445ffd5b5f52600a60205260405f2060018060a01b0333165f52602052612a8060405f208360ff33925416615e69565b856129fd565b615820565b3461071757602036600319011261071757610715612aa76157e6565b612aaf616a5f565b618512565b34610717575f366003190112610717575f516020620107a65f395f51905f52546040516001600160a01b039091168152602090f35b604036600319011261071757600435612b00615854565b9060085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457612b3061707d565b612b38615cc5565b91813403612c0d57612bce9060018060a01b031692835f52603860205260405f20612b6484825461609b565b905560a0810180519091611d8b9161ffff916080916001600160801b0390612b9190898316908316615f93565b168552612bac600180841b03612ba68961718f565b1661b018565b612bbf6001600160401b03825116615ddd565b611d2d83602083015116617fea565b6040519081527f74fa4be68bbca443c265c9cbcea4341640d9c00fb07d700fb8c7ab34e666fc2b60203392a35f5f516020620108c65f395f51905f525d005b630c269ad560e21b5f5260045ffd5b34610717575f366003190112610717576020610788616304565b34610717575f366003190112610717575f516020620107e65f395f51905f52541580612d45575b15612d0857612cac612c6d618388565b612c75618457565b6020612cba60405192612c888385615adc565b5f84525f368137604051958695600f60f81b875260e08588015260e08701906157fc565b9085820360408701526157fc565b4660608501523060808501525f60a085015283810360c08501528180845192838152019301915f5b828110612cf157505050500390f35b835185528695509381019392810192600101612ce2565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b505f516020620109465f395f51905f525415612c5d565b3461071757602036600319011261071757612d756158e3565b612d7d616a5f565b60085f6001600160401b0360125416089060088210156100f2576020909101805460ff60681b191691151560681b60ff60681b16919091179055005b3461071757604036600319011261071757602065ffffffffffff612e27612dde6157e6565b6001600160401b03612dee615854565b911690815f526006855260405f209060018060a01b03165f5284528260405f205460801c16905f52600984528260405f205416906162e6565b16604051908152f35b3461071757602036600319011261071757612e4c60043561832e565b610e43612e5883617114565b91604051938493846040919493926060820195825260208201520152565b3461071757602036600319011261071757612e8f61583e565b60018060a01b03165f527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00602052602060405f2054604051908152f35b34610717576060366003190112610717576020612ee76157e6565b612f74612ef2615854565b91612f6e612efe6158d4565b6001600160401b0383165f8181526005885260408082206001600160a01b038916808452908a528183205493835260068a528183209083528952902054919591612f6891612f58916001600160801b03908116911661609b565b612f6283866163af565b9061609b565b92618311565b906161aa565b90612f8157604051908152f35b612f8d612f9691616aca565b612f6e8161a95a565b610788565b3461071757604036600319011261071757612fb46157e6565b6001600160401b03612fc4615854565b91165f52600860205260405f209060018060a01b03165f526020526040805f20815190612ff082615a6f565b5460018060801b038116918281528363ffffffff8360801c169283602084015260a01c91015282519182526020820152f35b34610717575f36600319011261071757606061303c615c2e565b613044615cc5565b815160209283015160a090920151604080516001600160801b039384168152938316948401949094521691810191909152f35b34610717575f36600319011261071757602061078861620c565b34610717577f63bd79ea2105529df962cd4e4eca497e42e0e052fda7f3a147b7e71fcd411fb161321760206130c5366158f2565b6130d698959196949897929761707d565b6001600160401b03821696875f526009865260405f2061313084604051926130fd84615a6f565b549265ffffffffffff84168152604060ff8560301c16151591828c820152019360018060a01b039060381c168452615e22565b516001600160a01b0316330361328b575b875f52600a865260405f2060018060a01b038b165f52865261316c8a8460ff60405f20541615615e99565b8061327a575b5015613249576131eb613195916131c961319a61318e8b618062565b9590617114565b61718f565b5f8a81526005895260408082206001600160a01b038f1683528a5290208c906131c290615ca0565b93846174ce565b5f8881526005875260408082206001600160a01b038d16835288529020615f64565b6131f48761718f565b906001600160801b03906132079061718f565b16906001600160801b03166180c7565b613221858261825e565b6040519485526001600160a01b03908116951693a45f5f516020620108c65f395f51905f525d005b6131eb61326f916131c96132756132676132628c616aca565b61800b565b8096916161aa565b9a61718f565b61319a565b613285908a846170b4565b89613172565b5f888152600a87526040808220338084529089529120546132b19190859060ff16615e69565b613141565b34610717576040366003190112610717576004356132d2615854565b6132da616a5f565b6132e261707d565b6132ea615cc5565b5f516020620108665f395f51905f525f5260386020525f516020620109265f395f51905f5254909190838110611e2d575060a082018051602094927fc5fe86e4a889ff51f25c62464405915efbd7bea3de7baf44aad651ba2a75891d926040926133da91906001600160801b039061336790828916908316616396565b1681525f516020620108665f395f51905f525f5260388852835f2061338d8782546161aa565b9055611d8b61ffff60806133a089617157565b996133ab8b8861af60565b6133be6001600160401b03825116615ddd565b6133cc838d83015116617fea565b611d3c838983015116615bc1565b60018060a01b031692835f516020620108665f395f51905f527f2189dd61ba10a76e3348bbca899b71e3e23de0828ef127051ae8c506eda66f33848051858152898b820152a3835f516020620108665f395f51905f525f516020620109665f395f51905f52848051858152898b820152a381519081528486820152a25f5f516020620108c65f395f51905f525d604051908152f35b34610717575f36600319011261071757613487616a5f565b5f516020620107a65f395f51905f5280546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610717576020366003190112610717576001600160a01b036134f861583e565b165f526003602052602060018060801b0360405f205416604051908152f35b34610717575f366003190112610717576020610788617fb7565b604036600319011261071757602061078861354a615854565b6004356160df565b34610717576020366003190112610717576001600160401b036135736157e6565b5f6040805161358181615a6f565b8281528260208201520152165f526009602052606060405f20604051906135a782615a6f565b5465ffffffffffff8116918281526040602082019160ff8460301c1615158352019160018060a01b039060381c168252604051928352511515602083015260018060a01b039051166040820152f35b346107175760403660031901126107175761360f6157e6565b6001600160401b0361361f615854565b91165f52600a60205260405f209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b346107175760203660031901126107175760e061367161366c6157e6565b617e53565b6001600160401b03815116906001600160401b03602082015116906040810151151560608201511515608083015115159160a084015115159360c060018060a01b039101511694604051968752602087015260408601526060850152608084015260a083015260c0820152f35b34610717576040366003190112610717576107156136fa6157e6565b602435903390616f08565b346107175760403660031901126107175761371e6157e6565b6001600160401b0361372e615854565b91165f52600660205260405f209060018060a01b03165f526020526040613756815f206160a8565b65ffffffffffff602060018060801b038351169201511682519182526020820152f35b34610717576080366003190112610717576137926157e6565b602435906064356001600160a01b03811690819003610717576001600160401b036137c1604435853386617aa0565b921692835f52601060205260405f2060018060a01b0333165f5260205261380660405f2091604051926137f384615a8a565b5460a01c93602084019485528352617ce5565b82516001600160601b03918216908216019490851161140b576001600160601b0394851683525f8181526010602090815260408083203384528252909120925183546001600160a01b0319166001600160a01b03919091169081178455935190951691613874908390616078565b6040519182525f516020620108065f395f51905f52853393a4604051908152f35b34610717576020366003190112610717576001600160401b036138b66157e6565b165f52600b60205260405f206040519081602082549182815201915f5260205f20905f5b81811061390557610e43856138f181870382615adc565b604051918291602083526020830190615a03565b82546001600160a01b03168452602090930192600192830192016138da565b34610717576020366003190112610717576001600160a01b0361394561583e565b165f52600e6020526040805f20602082519161396083615a8a565b546001600160801b03811680845260809190911c6001600160401b03169190920181905282519182526020820152f35b34610717576020366003190112610717576001600160a01b036139b161583e565b165f526003602052602060405f205460801c604051908152f35b34610717575f3660031901126107175760085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e44576001600160401b0360125416335f52600e60205260405f209060405191613a2883615a8a565b5460018060801b0381168084526001600160401b03602085019260801c16825215613bd557516001600160401b031690818110613bc0578260018060801b03905116335f52600e6020525f60408120556013548060801c828110613b15575b60135483906001600160801b0319613aa383608084901c616396565b60801b169060018060801b03161760135560155460018060801b0319613acc838360801c616396565b60801b169060018060801b031617601555613ae7813361825e565b6040519081527fba4e3b2e3d25b351a2ef49820f9e22076b004067197d85fcaee4dca2201ce17960203392a2005b613b1f8184616396565b613b4f613b2a615be2565b80516020909101516001600160801b03908116911681811882821002909118906161aa565b6001600160801b03821611613ba957601654613b9191906001600160801b03613b7a83828416616396565b166001600160801b03199182161760165592615f93565b60801b169060018060801b0316176013558180613a87565b5082631d5c251f60e11b5f5260045260245260445ffd5b63afc6452960e01b5f5260045260245260445ffd5b636a2c35e960e01b5f5260045ffd5b34610717575f366003190112610717576016546040516001600160801b039091168152602090f35b3461071757604036600319011261071757613c256157e6565b6001600160401b03613c35615854565b91165f52600560205260405f209060018060a01b03165f5260205261294560405f20615ca0565b3461071757613cf5613c6d366159c9565b613cf0613c7d8295939495617ce5565b936001600160401b0360405191613c9383615a8a565b6001600160a01b039081168084526001600160601b039788166020808601918252939099165f81815260108552604080822033835290955293909320935184546001600160a01b0319169216919091178355965190951690616078565b617ce5565b6040516001600160601b0390911681523391905f516020620108065f395f51905f5290602090a4005b3461071757613d2c3661598f565b9190613d3661707d565b613d3f5f616ab7565b6001810180911161140b57600d546001600160801b03166001810190811061140b575f613d7091613d88938661abc3565b926001600160a01b0383169233840361401157617d16565b613d9182617c88565b601254612710613da861ffff8360701c1684617ca0565b6001600160801b0390811691909104919082169081613faf575b505050613dcd61aed7565b90613dd782617e53565b6040810151159081613fa1575b5015613f2b57613e696001600160401b0391613dfe615be2565b805160208201805190939291613e20916001600160801b039081169116616396565b6001600160801b0383811690821610613f21575b5082519192613e5b926001600160801b0390613e539086908316615f93565b169052615eec565b6001600160801b031661aa69565b91165f526031602052613eac613e9260405f2060085f6001600160401b03601254160890616a50565b5080546108e290849060781c6001600160781b0316616a37565b60085f6001600160401b0360125416089060088210156100f2575f94613ef76040926108e25f516020620108465f395f51905f52956028019160018060781b03835460781c16616a37565b8151948552600160208601526001600160a01b031693a45f5f516020620108c65f395f51905f525d005b9150613e5b613e34565b5f945f516020620108465f395f51905f529250604091613f9c90613f57906001600160801b031661aa69565b6002600160401b03885260316020526108e2613f85858a2060088b6001600160401b03601254160890616a50565b50805490929060781c6001600160781b0316616a37565b613ef7565b608091500151151586613de4565b6140099391906001600160801b0319613fcc85608084901c615f93565b60801b169060018060801b0316176012555f516020620108665f395f51905f525f52603860205261400260405f2091825461609b565b9055616396565b848080613dc2565b61401c823383616b74565b617d16565b3461071757604036600319011261071757602435600435614040616a5f565b676765c793fa10079d601b1b821161412e57676765c793fa10079d601b1b811161411f57676765c793fa10079d601b1b61407a828461609b565b11614110577f17295cc579d48cf6a42ae45a4e3c7791f30633c7d1defa248133a238f41b580e916140d46080926140af615c54565b92604051916140bd83615a8a565b5f196001871b019081168352166020820152615f14565b600180831b03815116906020600180851b0391015116601154906040519283526020830152600180841b0381166040830152821c6060820152a1005b63d3fe07e760e01b5f5260045ffd5b6359e7a56d60e11b5f5260045ffd5b6344ba813360e01b5f5260045ffd5b34610717576060366003190112610717576141566157e6565b60243561416161586a565b6001600160401b03831692835f52601060205260405f2060018060a01b0383165f5260205260405f206040519061419782615a8a565b549060018060a01b038216808252602082019260a01c8352806142af575b5081516001600160601b03166002600160601b0319016141dc575b50506107159350616f08565b6141e585617ce5565b82516001600160601b039182169116818110614298575082516001600160601b03908116919091039690871161140b576001600160601b0396871683525f8181526010602090815260408083206001600160a01b0389811685529252909120925183546001600160a01b03191691169081178355925161071597169161426c908390616078565b6040519182526001600160a01b038516915f516020620108065f395f51905f5290602090a484806141d0565b8690632a15c69b60e21b5f5260045260245260445ffd5b33036142bb57866141b5565b630c253c2360e11b5f5260045ffd5b6020366003190112610717576142de61583e565b6142e661707d565b6142ef34617c88565b6012549061271061430761ffff8460701c1683617ca0565b6001600160801b0390811691909104928391821690816144b7575b50505061432d61aed7565b61433681617e53565b906143496001600160801b03841661aa69565b9160408101511590816144a9575b5015614469576001600160401b03165f52603160205261438d613e9260405f2060085f6001600160401b03601254160890616a50565b60085f6001600160401b0360125416089260088410156100f2576143cb6143d9926108e26143df966028019160018060781b03835460781c16616a37565b6001600160801b0392615f93565b1661aa69565b9060085f6001600160401b0360125416089160088310156100f257601890920180545f936001600160781b039161441891908316616a37565b82546001600160781b031916911617905560408051348152602081018490526001600160a01b039092169133915f516020620108465f395f51905f5291a45f5f516020620108c65f395f51905f525d005b506143df926144a46143d9926002600160401b035f5260316020526108e2613f8560405f2060085f6001600160401b03601254160890616a50565b6143cb565b608091500151151586614357565b6144d49391906001600160801b0319613fcc85608084901c615f93565b818480614322565b34610717576020366003190112610717576144f56157e6565b6001600160401b03811690815f52600960205260405f2061451d826040519261127584615a6f565b516001600160a01b0316330361456d575b505f818152600960205260408120805460ff60301b191690557f724f90fbdf12cba6f20f1055f6d0bd3cdb9d3b5b8a1f4c758b92b18ee9f30fc89080a2005b5f828152600a6020908152604080832033808552925290912054614594929060ff16615e69565b8161452e565b34610717576020366003190112610717576020610788612f8d600435616aca565b34610717576040366003190112610717576145d46157e6565b6001600160401b036145e4615854565b915f60206040516145f481615a8a565b8281520152165f52601060205260405f209060018060a01b03165f526020526040805f2081519061462482615a8a565b546001600160a01b03811680835260a09190911c60209283019081528351918252516001600160601b031691810191909152f35b34610717576040366003190112610717576146716157e6565b6001600160401b03614681615854565b614689616a5f565b6146938184616de3565b6001600160a01b031691167f536699e73f1d293b0cdae5c5bd2880028ce7a620ca9d2d7fd725b99bcca4e93e5f80a3005b34610717575f36600319011261071757602061236b615fac565b346107175760203660031901126107175760406147046146ff600435616b55565b615d30565b60e060c08201511515910151151582519182526020820152f35b346107175761473861472f36615951565b939181936167a4565b9082821061474b57602082604051908152f35b632fcb36ed60e11b5f5260018060a01b031660045260245260445260645ffd5b34610717575f366003190112610717575f516020620108665f395f51905f525f52603860209081525f516020620109265f395f51905f5254604051908152f35b346107175760603660031901126107175760206107886147c96157e6565b60443590602435903390617aa0565b34610717576147e6366158f2565b929093916147f261707d565b6001600160401b03861693845f52600960205260405f2061481a886040519261127584615a6f565b516001600160a01b031633036149d4575b8195855f52600a60205260405f2060018060a01b0386165f5260205261485a858960ff60405f20541615615e99565b806149c3575b50614986575b507f1fdbc0b3ef381796abe43f320e1aa2752d6be33924a9802ad2c24df2bee860a9916149626020926148ee61489b8861718f565b98875f526005865260405f2060018060a01b0386165f5286526148cc8a866148c560405f20615ca0565b93846171c0565b5f8881526005875260408082206001600160a01b038816835288529020615f64565b5f8681526005855260408082206001600160a01b03841683528652902080546001600160801b0390614923908b908316615f93565b82546001600160801b03191691161790556001600160a01b03165f818152600385526040902080549198909161495c919060801c615f93565b90615ec9565b6040519485526001600160a01b031693a45f5f516020620108c65f395f51905f525d005b6020919450916149626149b97f1fdbc0b3ef381796abe43f320e1aa2752d6be33924a9802ad2c24df2bee860a99461714e565b9592505091614866565b6149ce9085896170b4565b87614860565b845f52600a60205260405f2060018060a01b0333165f52602052614a0160405f208860ff33925416615e69565b61482b565b3461071757602036600319011261071757600435600160401b811015614a4d576001600160401b03165f526034602052602060018060a01b0360405f205416604051908152f35b6335278d125f526004601cfd5b34610717575f36600319011261071757602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610717575f366003190112610717576020603954604051908152f35b34610717576040366003190112610717576020610788614ac36157e6565b614ad260243580923390616f08565b339033906167a4565b34610717575f366003190112610717576020610788614af8615c08565b614b00615b14565b90616e86565b34610717575f36600319011261071757602061078861ac6f565b346107175760203660031901126107175760043565ffffffffffff8116809103610717575f54602091614bea614b5e6001600160401b038416615dc0565b6001600160401b03811680946001600160401b031916175f55614be3604051614b8681615a6f565b84815260018782019081523360408084019182525f89815260098b522092518354925166ffffffffffffff1990931665ffffffffffff919091161791151560301b60ff60301b16919091178255516001600160a01b031690615df9565b3390616de3565b604051908152817f369b9ef7936f8128d1eff4409b83d784498ec057c569447a736deab847ed7de9843393a3604051908152f35b34610717575f36600319011261071757602060405160128152f35b3461071757602036600319011261071757610120614c5b6146ff600435616b55565b6001600160401b038151169060ff6020820151169060408101511515606082015115156080830151151560a084015115159160c085015115159360e086015115159561010060018060801b039101511696604051988952602089015260408801526060870152608086015260a085015260c084015260e0830152610100820152f35b34610717575f3660031901126107175760c0614cf7615cc5565b6001600160401b038151169061ffff6020820151169061ffff60408201511661ffff6060830151169061ffff6080840151169260a060018060801b039101511693604051958652602086015260408501526060840152608083015260a0820152f35b34610717575f36600319011261071757602060115460801c604051908152f35b34610717575f3660031901126107175760206001600160401b0360125416604051908152f35b346107175760203660031901126107175760406001600160401b03614dc26157e6565b16805f5260376020526001600160401b03825f205416905f5260366020526001600160401b03825f20541690670f6b75ab2bc471c781148015614e83575b15614e6757505f905b670f6b75ab2bc471c781148015614e56575b15614e3b57505f5b82516001600160a01b03928316815291166020820152f35b5f9081526034602052829020546001600160a01b0316614e23565b50678ac7230489e7ffff8114614e1b565b5f9081526034602052829020546001600160a01b031690614e09565b50678ac7230489e7ffff8114614e00565b346107175760603660031901126107175761231f614eb061583e565b614eb8615854565b60443591614ec7833383616b74565b616c71565b346107175760203660031901126107175760043560085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457801561520e57335f908152600360205260409020546001600160801b031681116151ff57614f3481616aca565b614f3e8233617d16565b6001600160781b03614f4f8261aa69565b601554916001600160801b031991614f6c9116608084901c615f93565b60801b169060018060801b031617601555614f85615be2565b80516001600160801b0316614fc883614fc3614fba614fa2615c08565b4790614fac615c2e565b614fb4615cc5565b9161aa81565b93612f6261aad6565b61609b565b116151c7575b50614fd88161aa69565b60085f6001600160401b0360125416089060088210156100f25760189091018054615012926108e29160781c6001600160781b0316616a37565b6001600160401b036012541664ffffffffff7f000000000000000000000000000000000000000000000000000000000000000016016001600160401b03811161140b576001600160401b036004911601916001600160401b03831161140b5782476150a861507e615c08565b91615087615c2e565b61508f615cc5565b906001600160781b036150a0615b14565b51169461aa81565b90808211156151bf576150ba916161aa565b83116151a1575b60209350335f52600e84526001600160401b038060405f205460801c169116908181119082180218916001600160401b038316926150fe8261718f565b335f908152600e875260409020805490916001600160801b039161512491908316615f93565b1660018060801b0319825416179055335f52600e855260405f20908154906001600160401b0360801b9060801b16906001600160401b0360801b1916179055604051918252838201528160408201527fe8f686fe2fc956d5686150d8823d8e6fd95f18f808c76fea4efa50957df2c55560603392a2604051908152f35b506001600160401b0392831660020192831161140b576020926150c1565b50505f6150ba565b60208101805182516151f993925f9290916001600160801b03916151f091908316908316616396565b16835252615eec565b82614fce565b630330438b60e41b5f5260045ffd5b637989413f60e01b5f5260045ffd5b34610717576020366003190112610717576001600160a01b0361523e61583e565b165f526038602052602060405f2054604051908152f35b3461071757602036600319011261071757611fde615274600435616b36565b615b4b565b34610717576040366003190112610717576152926157e6565b6001600160401b036152a2615854565b916152ab616a5f565b1690815f52600b60205260405f20549160018311156154d857805f52600a60205260405f2060018060a01b0383165f5260205260ff60405f205416156154bb575f818152600a602090815260408083206001600160a01b0395909516808452949091528120805460ff191690558391905b8281106153c6575b505f8181526009602052604090205490915060381c6001600160a01b03168214806153b1575b615375575b7fd1dd9f27582bbce7226a4f323da8f0e775e31a715f1779e55da4e895c027f83a5f80a3005b805f52600b60205260405f208054156100f2575f526153ac60205f2060018060a01b03905416825f52600960205260405f20615df9565b61534f565b50805f52600b60205260405f2054151561534a565b815f52600b602052836153dc8260405f20616b21565b905460039190911b1c6001600160a01b0316146153fb5760010161531c565b5f828152600b6020526040902091925f19810190811161140b576154256154469161546a94616b21565b60018060a01b0391549060031b1c1691845f52600b60205260405f20616b21565b9080546001600160a01b0360039390931b83811b199091169290931690921b179055565b805f52600b60205260405f20805480156154a7575f19019061548c8282616b21565b81549060018060a01b039060031b1b19169055558083615324565b634e487b7160e01b5f52603160045260245ffd5b6339a907cb60e01b5f5260045260018060a01b031660245260445ffd5b6356ff10fb60e11b5f5260045260245ffd5b34610717575f36600319011261071757612945615be2565b34610717576020366003190112610717576001600160401b036155236157e6565b165f52600f602052602060ff60405f2054166040519015158152f35b34610717575f3660031901126107175760206040516110008152f35b34610717576020366003190112610717576001600160401b0361557c6157e6565b16805f5260316020526155a661114660405f2060085f196001600160401b03601254160890616a50565b905f5260316020526155ce61114660405f2060085f6001600160401b03601254160890616a50565b8151602092830151825192840151604080516001600160781b0394851681529284169583019590955292821693810193909352166060820152608090f35b34610717576020366003190112610717576020610788610cb660043561832e565b346107175760403660031901126107175761231f61564961583e565b602435903361ac0c565b3461071757602036600319011261071757611fde615274600435616b02565b346107175760203660031901126107175760043561ffff8116808203610717576127109061569e616a5f565b10156156c5576012805461ffff60501b191660509290921b61ffff60501b16919091179055005b63b9b751ff60e01b5f5260045ffd5b34610717575f36600319011261071757610e436156ef615b9c565b6040519182916020835260208301906157fc565b34610717575f366003190112610717576020610788614fa2615c08565b346107175760203660031901126107175760043561ffff8116808203610717576127109061574c616a5f565b1015612504576012805461ffff60701b191660709290921b61ffff60701b16919091179055005b34610717576020366003190112610717576001600160401b036157946157e6565b16805f5260326020526157be61114660405f2060085f196001600160401b03601254160890616a50565b905f5260326020526155ce61114660405f2060085f6001600160401b03601254160890616a50565b600435906001600160401b038216820361071757565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b34610717576020366003190112610717576020610788600435616aca565b600435906001600160a01b038216820361071757565b602435906001600160a01b038216820361071757565b604435906001600160a01b038216820361071757565b34610717575f36600319011261071757600d546040516001600160801b039091168152602090f35b34610717576020366003190112610717576158c161583e565b506040516001600160801b038152602090f35b60443590811515820361071757565b60043590811515820361071757565b60c0906003190112610717576004356001600160401b038116810361071757906024356001600160a01b038116810361071757906044356001600160a01b03811681036107175790606435906084359060a43580151581036107175790565b608090600319011261071757600435906024356001600160a01b038116810361071757906044356001600160a01b0381168103610717579060643590565b606090600319011261071757600435906024356001600160a01b038116810361071757906044356001600160a01b03811681036107175790565b6060906003190112610717576004356001600160401b038116810361071757906024356001600160a01b0381168103610717579060443590565b90602080835192838152019201905f5b818110615a205750505090565b82516001600160a01b0316845260209384019390920191600101615a13565b9181601f84011215610717578235916001600160401b038311610717576020808501948460051b01011161071757565b606081019081106001600160401b0382111761120a57604052565b604081019081106001600160401b0382111761120a57604052565b61012081019081106001600160401b0382111761120a57604052565b60e081019081106001600160401b0382111761120a57604052565b90601f801991011681019081106001600160401b0382111761120a57604052565b6001600160401b03811161120a5760051b60200190565b60405190615b2182615a6f565b6014546001600160781b038082168452607882901c16602084015260f01c60ff1615156040830152565b90604051615b5881615a6f565b91546001600160781b038082168452607882901c16602084015260f01c60ff1615156040830152565b6001600160401b03811161120a57601f01601f191660200190565b60405190615bab604083615adc565b600782526614da135bdb985960ca1b6020830152565b6012805461ffff60501b191660509290921b61ffff60501b16919091179055565b60405190615bef82615a8a565b6016546001600160801b038116835260801c6020830152565b60405190615c1582615a8a565b6013546001600160801b038116835260801c6020830152565b60405190615c3b82615a8a565b6015546001600160801b038116835260801c6020830152565b60405190615c6182615a8a565b6011546001600160801b038116835260801c6020830152565b60405190615c8782615a8a565b600d546001600160801b038116835260801c6020830152565b90604051615cad81615a8a565b91546001600160801b038116835260801c6020830152565b6040519060c082018281106001600160401b0382111761120a576040528160a06012546001600160401b038116835261ffff8160401c16602084015261ffff8160501c16604084015261ffff8160601c16606084015261ffff8160701c16608084015260801c910152565b90604051615d3d81615aa5565b6101008193546001600160401b038116835260ff8160401c16602084015260ff8160481c161515604084015260ff8160501c161515606084015260ff8160581c161515608084015260ff8160601c16151560a084015260ff8160681c16151560c084015260ff8160701c16151560e084015260018060801b039060781c16910152565b6001600160401b03166001600160401b03811461140b5760010190565b6001600160401b03166001600160401b03196012541617601255565b8054600160381b600160d81b03191660389290921b600160381b600160d81b0316919091179055565b15615e2a5750565b6001600160401b039063472dabaf60e01b5f521660045260245ffd5b6001600160401b0390911681526001600160a01b03909116602082015260400190565b15615e72575050565b6001600160401b039063649a1d8560e11b5f521660045260018060a01b031660245260445ffd5b15615ea2575050565b6001600160401b03906344fefb8160e01b5f521660045260018060a01b031660245260445ffd5b80546001600160801b031660809290921b6001600160801b031916919091179055565b80516020919091015160801b6001600160801b0319166001600160801b039190911617601655565b80516020919091015160801b6001600160801b0319166001600160801b039190911617601155565b80516020919091015160801b6001600160801b0319166001600160801b039190911617600d55565b815181546001600160801b0319166001600160801b03918216178255602090920151615f91921690615ec9565b565b6001600160801b03918216908216019190821161140b57565b6001600160401b03603b5416670f6b75ab2bc471c78114616037575b6002600160401b0390816001600160401b0382161461601b575b6001600160401b03915016678ac7230489e7ffff8114616016575f908152603460205260409020546001600160a01b031690565b505f90565b505f5260366020526001600160401b038060405f205416615fe2565b50670f6b75ab2bc471c75f5260366020527f1b555aca7137ecab873ff5825c4daff389c38ba0c5fd4f3ed4741665aea9c126546001600160401b0316615fc8565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b9190820180921161140b57565b906040516160b581615a6f565b91546001600160801b0381168352608081901c65ffffffffffff16602084015260b01c6040830152565b9060085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e445761610f61707d565b6001600160801b0382116161795761612961289f5f616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b575f61615c91616165948661abc3565b92839133617f6e565b5f5f516020620108c65f395f51905f525d90565b633c8097d960e11b5f9081526001600160a01b03919091166004526024919091526001600160801b03604452606490fd5b9190820391821161140b57565b90670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b57565b8181029291811591840414171561140b57565b81156161f8570490565b634e487b7160e01b5f52601260045260245ffd5b61621461827a565b80156162c757670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b57616244916161ee565b670de0b6b3a7640000811061629957505f5b61628d60115491616287670de0b6b3a76400006162808560801c9560018060801b031693846161db565b048461609b565b9261609b565b90818110908218021890565b670de0b6b3a764000003670de0b6b3a764000081111561625657634e487b7160e01b5f52601160045260245ffd5b50506011546162e3906001600160801b0381169060801c61609b565b90565b9065ffffffffffff8091169116019065ffffffffffff821161140b57565b61630c61827a565b801561636c57670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b5761633c916161ee565b670de0b6b3a7640000811061635057505f90565b670de0b6b3a764000003670de0b6b3a7640000811161140b5790565b50505f90565b91908110156100f25760051b0190565b356001600160a01b03811681036107175790565b6001600160801b03918216908216039190821161140b57565b6001600160401b031690815f52600860205260405f2060018060a01b0382165f5260205260405f2090604051916163e583615a6f565b549060018060801b038216808452602084019263ffffffff8160801c16845260a01c6040850152156164e5576001600160a01b0381165f908152600360205260409020546001600160801b03169384156164dc575f52600760205260405f209060018060a01b03165f5260205265ffffffffffff61647e61646860405f206160a8565b9263ffffffff83602086015116915116906162e6565b164311156164a35750516001600160801b03165b8082101561649e575090565b905090565b905190516001600160801b039182169116808211156164d5576001600160801b03916164cf9190616396565b16616492565b5050505f90565b50505050505f90565b505050505f90565b6001600160401b031690815f52600860205260405f2060018060a01b0382165f5260205260405f20906040519161652383615a6f565b549060018060801b038216808452602084019263ffffffff8160801c16845260a01c6040850152156164dc576001600160a01b0381165f908152600360205260409020546001600160801b0316938415616615575f52600760205260405f209060018060a01b03165f5260205265ffffffffffff6165a661646860405f206160a8565b164311156165e35750516001600160801b03165b808210156165dc57505b80916165ce575090565b6162e39150612f8d90616aca565b90506165c4565b905190516001600160801b039182169116808211156164e5576001600160801b039161660f9190616396565b166165ba565b5050505050505f90565b60085f6001600160401b03601254160860088110156100f2576020015460681c60ff166166a157678ac7230489e7ffff6001600160401b03603b541614806166645790565b5060085f6001600160401b03601254160860088110156100f2576001600160401b039060200154166001600160401b0361669c6185e8565b161190565b5f90565b156166ad5750565b6001600160401b03906305d9424760e21b5f521660045260245ffd5b51906001600160401b038216820361071757565b5190811515820361071757565b9190826040910312610717576162e36020616704846166c9565b93016166dd565b9161671461707d565b6001600160a01b038216156167955761672c81616879565b808411616773575061675f9161675a61675085936167498561832e565b9290617114565b968791853361a3c8565b61825e565b905f5f516020620108c65f395f51905f525d565b8382633fa733bb60e21b5f5260018060a01b031660045260245260445260645ffd5b63d92e233d60e01b5f5260045ffd5b91906167ae61707d565b6001600160a01b03811615616795576167cc610cb6610cb184616879565b80841161680357509061675f9161675a6167e585616aca565b6167f86167f18261a95a565b80926161aa565b95868095853361a3c8565b8383632e52afbb60e21b5f5260018060a01b031660045260245260445260645ffd5b80518210156100f25760209160051b010190565b601654603a546001600160801b03909116905f198101616857575090565b90616860617fb7565b9081156164d5576162e392616874916161db565b6161ee565b6001600160a01b03165f908152600360205260409020546162e390612f6e90613262906001600160801b0316616aca565b6168b261827a565b156160165790565b6168c261827a565b919082916168d082856161aa565b931561690057670de0b6b3a76400008202828104670de0b6b3a7640000148315171561140b578361633c916161ee565b5f93508392508291508190565b60085f6001600160401b03601254160860088110156100f2576020015460681c60ff16616016576001600160401b031680158015616997575b616016575f818152603460205260409020546001600160a01b031615616016575f52603060205260ff61698d60405f2060085f196001600160401b03601254160890616a50565b505460601c161590565b506002600160401b038114616946565b6001600160a01b03168015616a06575f516020620107a65f395f51905f5280546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b631e4fbdf760e01b5f525f60045260245ffd5b60041115616a2357565b634e487b7160e01b5f52602160045260245ffd5b6001600160781b03918216908216019190821161140b57565b60088210156100f25701905f90565b5f516020620107a65f395f51905f52546001600160a01b03163303616a8057565b63118cdaa760e01b5f523360045260245ffd5b616a9e614fa2615c08565b616aa661aad6565b8082111561636c576162e3916161aa565b616ac2614fa2615c08565b90616a9e5790565b616ad46001616ab7565b906001820180921161140b57600d546001600160801b03166001810190811061140b576162e3925f9261abc3565b6008906001600160401b03601254160860088110156100f25760280190565b80548210156100f2575f5260205f2001905f90565b6008906001600160401b03601254160860088110156100f25760180190565b6008906001600160401b03601254160860088110156100f25760200190565b6001600160a01b039081165f818152600460209081526040808320948616835293905291909120549291905f198410616bae575b50505050565b828410616c1a578015616c07576001600160a01b03821615616bf4575f52600460205260405f209060018060a01b03165f5260205260405f20910390555f808080616ba8565b634a1406b160e11b5f525f60045260245ffd5b63e602df0560e01b5f525f60045260245ffd5b508290637dc7a0d960e11b5f5260018060a01b031660045260245260445260645ffd5b15616c4457565b634b637e8f60e11b5f525f60045260245ffd5b15616c5e57565b63ec442f0560e01b5f525f60045260245ffd5b6001600160a01b03168015929091616c898415616c3d565b6001600160a01b0316928315616c9f8115616c57565b616ca88361718f565b9115616d5e57600d545f516020620108865f395f51905f5293602093909290916001600160801b03616cdc84828416615f93565b6001600160801b0319909216911617600d555b15616d2357600d80546001600160801b031981166001600160801b0391821693909303169190911790555b604051908152a3565b5f8681526003845260409020805490916001600160801b0391616d4891908316615f93565b82546001600160801b0319169116179055616d1a565b835f526003602052616d7260405f20615ca0565b80516001600160801b0316848110616dc85750915f516020620108865f395f51905f529391616dc360209460018060801b038460018060801b0383511603168152875f526003865260405f20615f64565b616cef565b84908663391434e360e21b5f5260045260245260445260645ffd5b6001600160401b0316805f52600a60205260405f2060018060a01b0383165f5260205260ff60405f205416616e69575f818152600a602090815260408083206001600160a01b03861684528252808320805460ff19166001179055928252600b90522080549190600160401b83101561120a5782615446916001615f9195018155616b21565b6304cf17f560e41b5f5260045260018060a01b031660245260445ffd5b5181516020909201516001600160801b03909116916001600160781b0391616eb391908316908316616a37565b168082111561636c576162e3916161aa565b8151602083015160409093015160809390931b65ffffffffffff60801b166001600160801b03919091161760b09290921b6001600160b01b031916919091179055565b6001600160401b03909291921691825f52600660205260405f2060018060a01b0382165f52602052616f3c60405f206160a8565b92805f52600960205265ffffffffffff60405f20541691616f5c8461718f565b92616f83602087019165ffffffffffff616f79828286511661609b565b431193511661609b565b901561706b575084516001600160801b039081169084168110617054575084516001600160801b03908116849003811686526001600160a01b039091165f81815260036020908152604080832080546001600160801b0319811690871690980190951696909617909355838152600683528481208282529092529290209193849261700e9190616ec5565b7f14ee26c6951fd3ff70df03bd811dac39ac5a71dc85dbb469db6bf46114e5dcff6020604051858152a36040519081525f516020620108865f395f51905f5260203092a3565b84906373658c6f60e11b5f5260045260245260445ffd5b636b72660560e11b5f5260045260245ffd5b5f516020620108c65f395f51905f525c6170a55760015f516020620108c65f395f51905f525d565b633ee5aeb560e01b5f5260045ffd5b6170e3916001600160401b03604051926170cd84615a8a565b1682526001600160a01b0316602082015261d286565b905f1981036170f257505f905d565b815c908082111561710b57617106916161aa565b905b5d565b50505f90617108565b61711e6001616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b576162e39260019261abc3565b61711e5f616ab7565b6171605f616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b576162e3925f9261abc3565b6001600160801b0381116171a9576001600160801b031690565b6306dfcc6560e41b5f52608060045260245260445ffd5b6001600160a01b0383165f818152600360205260408120939690959094936171e790615ca0565b926171f5613195868a618311565b976172098960018060801b03845116616396565b985f966020840160018060801b0361722a60018060801b0383511688615f93565b166001600160801b038d16106173ea575b80516001600160801b039061725290821688615f93565b166001600160801b038d1610617398575b505082516001600160401b03929092165f9081526006602090815260408083208884529091529020546001600160801b039081169a92811692858216929116821161736357505081516001600160801b03908116849003811690925250602084810180518316939093039091169091525f9182526003905260409020939450919290916172ef91615f64565b6001600160801b0381161580617358575b61735357829061730e615c7a565b9161733f57602082018051939450615f919390916001600160801b039161733791908316615f93565b169052615f3c565b634e487b7160e01b84526021600452602484fd5b509050565b505f92506001617300565b6040516304a613a560e11b81526004810193909352602483018b90526001600160801b03166044830152606482015260849150fd5b906173bf6173ce9499939c6173ba6173c89460018060801b0390511689615f93565b616396565b9089868a61acd6565b90615f93565b946173e28960018060801b03845116616396565b985f80617263565b9a97506174b28b6174316001600160401b0386169a8b5f52600660205260405f208a5f526020526173ba61742060405f206160a8565b93516001600160801b03168a615f93565b81516001600160801b03918216908216818118828210029091188216919061745a908390616396565b16825286516001600160801b03906174759083908316615f93565b16875260208a0180516001600160801b03906174949084908316615f93565b169052995f52600660205260405f20885f5260205260405f20616ec5565b83516174c89083906001600160801b0316616396565b9a61723b565b6001600160a01b0383165f818152600360205260408120909695949392906174f590615ca0565b926175036131958683618311565b82516175199082906001600160801b0316616396565b6020840180515f9892939291906001600160801b039061753b9082168c615f93565b166001600160801b0385161061771c575b80516001600160801b03906175639082168c615f93565b166001600160801b038516106176d2575b505083516001600160401b03939093165f9081526006602090815260408083208884529091529020546001600160801b0393841693898116939181169116831161769f57505082516001600160801b03908116889003811690935250506020808401805183168790039092169091525f91825260039052604090206175f99190615f64565b6001600160801b0381161580617695575b61768f57908391617619615c7a565b9261767b57602083018051949550615f919490916001600160801b039161764291908316615f93565b168082526001600160801b039061765a908490616396565b16905281516001600160801b0391617673918316616396565b168152615f3c565b634e487b7160e01b85526021600452602485fd5b50509050565b505f93508361760a565b6040516304a613a560e11b8152600481019490945260248401526001600160801b03166044830152606482015260849150fd5b5191976177009390926173c892916176f7916173ba906001600160801b03168d615f93565b9085878a61acd6565b946177148160018060801b03855116616396565b905f80617574565b9297506177c96001600160401b03851698895f52600660205260405f20885f5260205261776661774e60405f206160a8565b86519092906173ba906001600160801b03168e615f93565b81516001600160801b03918216908216818118828210029091188216919061778f908390616396565b16825287516001600160801b03906177aa9083908316615f93565b16885260208a0180516001600160801b03906174949084908316615f93565b84516177df9083906001600160801b0316616396565b9261754c565b6001600160a01b0383165f81815260036020526040812090969593929061780b90615ca0565b926178196131958783618311565b825161782f9082906001600160801b0316616396565b6020840180515f9992939291906001600160801b03906178519082168b615f93565b166001600160801b038516106179b9575b80516001600160801b03906178799082168b615f93565b166001600160801b03851610617978575b505083516001600160401b03939093165f9081526006602090815260408083208884529091529020546001600160801b0393841693888116939181169116831161769f57505082516001600160801b03908116879003811690935250506020808401805183168690039092169091525f918252600390526040902061790f9190615f64565b6001600160801b038216158061796e575b61768f5790839161792f615c7a565b9261767b57602083018051949550615f91949092617337916001600160801b039161795b918316615f93565b168084526001600160801b039290616396565b505f935083617920565b51919861799d9390926173c892916176f7916173ba906001600160801b03168c615f93565b956179b18160018060801b03855116616396565b905f8061788a565b929850617a846001600160401b038516998a5f52600660205260405f20885f52602052617a036179eb60405f206160a8565b86519092906173ba906001600160801b03168d615f93565b81516001600160801b039182169082168181188282100290911882169190617a2c908390616396565b16825287516001600160801b0390617a479083908316615f93565b16885260208a0180516001600160801b0390617a669084908316615f93565b1690529a5f52600660205260405f20885f5260205260405f20616ec5565b8451617a9a9083906001600160801b0316616396565b92617862565b919392906001600160401b03831691825f52600560205260405f2060018060a01b0383165f52602052617ad560405f20615ca0565b90835f52600660205260405f2060018060a01b0384165f52602052617afc60405f206160a8565b92617b1361319582617b0d8b61718f565b98618311565b8351617b299082906001600160801b0316616396565b84516001600160801b03898116939291811691168311617c685750505091617bfe91617c19949360018060801b038860018060801b038551160316835260018060a01b031696875f526003602052617b9360405f2060018060801b0383825460801c031690615ec9565b600d80546001600160801b0319608082811c859003901b166001600160801b0391821617909155855181169091018116855265ffffffffffff4316602086015290617bdd9061718f565b166020820152845f52600560205260405f20865f5260205260405f20615f64565b825f52600660205260405f20845f5260205260405f20616ec5565b805f5260096020527fc2004f6d2f2084f6055f049ffa20c75bebde1fe59acfae5ebbdbb3f3446bc0196040617c5965ffffffffffff825f2054164361609b565b958151908152866020820152a3565b636840e90f60e11b5f5260045260018060801b031660245260445260645ffd5b600160801b811015614a4d576001600160801b031690565b6001600160801b03918216908216029081169190820361140b57565b8054600160781b600160f01b03191660789290921b600160781b600160f01b0316919091179055565b6001600160601b038111617cff576001600160601b031690565b6306dfcc6560e41b5f52606060045260245260445ffd5b9091906001600160a01b03168015617d2e8115616c3d565b617d378461718f565b9015617dad57600d5492935f935f516020620108865f395f51905f5292602092916001600160801b03617d6c83828416615f93565b6001600160801b0319909216911617600d555b600d80546001600160801b031981166001600160801b039182169390930316919091179055604051908152a3565b815f526003602052617dc160405f20615ca0565b80516001600160801b0316858110617e1a575080516001600160801b039081168390031681525f8381526003602090815260408220959691955f516020620108865f395f51905f52949193617e1591615f64565b617d7f565b9350505063391434e360e21b5f5260045260245260445260645ffd5b90617e40575f9055565b634e487b7160e01b5f525f60045260245ffd5b6001600160401b03905f60c0604051617e6b81615ac1565b8281528260208201528260408201528260608201528260808201528260a0820152015216805f52603360205260405f206040519060a082018281106001600160401b0382111761120a5760405254916001600160401b03831682526001600160401b038360401c166020830152604082019260ff8160801c16151584526060830160ff8260881c161515815260ff608085019260901c1615158252825f5260346020526001600160401b0360018060a01b0360405f205416945116946002600160401b039051151591511515925115159360405196617f4988615ac1565b87528060208801521460408601526060850152608084015260a083015260c082015290565b92348303612c0d578181617f936040935f516020620109665f395f51905f529561af60565b617f9c8561b018565b825194855260208501526001600160a01b03908116941692a3565b61ffff60125460401c16670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561140b57612710900490565b6012805461ffff60401b191660409290921b61ffff60401b16919091179055565b90811561805b5761801a61827a565b90809391618031618029615c54565b82848661b069565b9590951161803f5750509190565b909150618057929350618050615c54565b918061b1ee565b9091565b5f91508190565b9061806b61827a565b839193156180a45783821161808d576180579293618087615c54565b9261b1ee565b83826303eb0d9b60e51b5f5260045260245260445ffd5b505090505f905f90565b6001600160781b03918216908216039190821161140b57565b6016546001600160801b0381169060801c816180e3848361609b565b11618124575b50506180f59150617c88565b601654906001600160801b03199061811190608084901c615f93565b60801b169060018060801b031617601655565b60085f6001600160401b03601254160860088110156100f25760280180549094906001600160781b0390618160908281169060781c83166180ae565b1661817561816e868561609b565b918561609b565b1061823457506181969161818c846181919361609b565b6161aa565b61aa69565b60085f6001600160401b0360125416089260088410156100f2576181d06180f5946018016108e28460018060781b03835460781c16616a37565b80546001600160781b03906181e89084908316616a37565b82546001600160781b0319169116179055601654906001600160801b039061821b906001600160781b0316828416615f93565b6001600160801b03199092169116176016555f806180e9565b61824290618248939461609b565b926161aa565b906342f215e360e01b5f5260045260245260445ffd5b5f80809338935af11561826d57565b63b12d13eb5f526004601cfd5b618282615be2565b9060018060801b0382511691602060018060801b039101511660085f6001600160401b03601254160860088110156100f25761830d916182c761830792602801615b4b565b602081015190516001600160781b03916182e59183169083166180ae565b6001600160801b039161830091168381188185100218617c88565b16906161aa565b836161aa565b9190565b61832a916001600160401b03604051926170cd84615a8a565b5c90565b8015618349576180579061834061827a565b90618087615c54565b505f905f90565b90600182811c9216801561837e575b602083101461836a57565b634e487b7160e01b5f52602260045260245ffd5b91607f169161835f565b604051905f825f516020620107865f395f51905f5254916183a883618350565b808352926001811690811561843857506001146183cc575b615f9192500383615adc565b505f516020620107865f395f51905f525f90815290917f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d5b81831061841c575050906020615f91928201016183c0565b6020919350806001915483858901015201910190918492618404565b60209250615f9194915060ff191682840152151560051b8201016183c0565b604051905f825f516020620107c65f395f51905f52549161847783618350565b8083529260018116908115618438575060011461849a57615f9192500383615adc565b505f516020620107c65f395f51905f525f90815290917f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b755b8183106184ea575050906020615f91928201016183c0565b60209193508060019154838589010152019101909184926184d2565b801561140b575f190190565b6001600160401b0316805f52603460205260018060a01b0360405f205416815f52603360205260ff60405f205460801c16156185d9577fddb6b82eeddfdb3c8f55159b7a63f993fd885d75c47e84d968c1efed15bd4b4791606091618578603954618506565b6039555f82815260336020908152604091829020805460ff60801b19811682556012805470ff0000000000000000ffffffffffffffff199092166001600160401b0392831617909255905483519586529185019390935290911690820152a1565b63fb1ba7c360e01b5f5260045ffd5b60408051630eaf323560e31b815290816004815f6110005af19081156122ee575f91618612575090565b61862b915060403d6040116122e7576122d88183615adc565b5090565b615f91906001600160401b0381165f52600960205260ff60405f205460301c16615e22565b61865c6185e8565b678ac7230489e7ffff6001600160401b03603b5416036160165760085f6001600160401b03601254160860088110156100f2576001600160401b0380916020015416911611156198825760085f6001600160401b03601254160860088110156100f2576186cb90602001615d30565b600860016001600160401b0360125416089060088210156100f25760408051630eaf323560e31b81529290836004815f6110005af19182156122ee57618785935f905f9461985e575b50809361984c575b5061872561d4ad565b9060e060c082015115159101511515916001600160401b036040519561874a87615aa5565b1685525f60208601525f60408601525f6060860152151560808501525f60a085015260c084015260e08301525f61010083015260200161cf06565b600860026001600160401b03601254160860088110156100f2576187ab9060280161b438565b600860026001600160401b03601254160860088110156100f2576187d19060180161b438565b60085f6001600160401b03601254160860088110156100f25760018060781b0390601801541660085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b031661883061882b615c2e565b61d4f0565b601354601454608082901c94929060781c6001600160781b0316618854818761609b565b8211619718575b50505050505060085f6001600160401b03601254160860088110156100f2576188a3904790618888615c08565b9061889d618894615be2565b91601801615b4b565b9161d007565b80619685575b506188b2615be2565b60018060801b0381511690602060018060801b039101511660085f6001600160401b0360125416089060088210156100f2576189226188f661892893602801615b4b565b602081015190516001600160781b03916189149183169083166180ae565b168083108382180218617c88565b90616396565b90618933818361d512565b919050801561966f57618979670de0b6b3a7640000618973618961846168746001600160801b0389166161b7565b945b6001600160801b031694856161db565b04617c88565b61898c838311838503815f03180161aa69565b6001600160801b039182169491909116906189b18583115f819003848803180161aa69565b935f938491111561962c57506001600160781b039081169490851161140b576016546001600160801b036189e787828416615f93565b6001600160801b03199092169116176016555b11156195e45781618a0a91616a37565b60165490916001600160801b031990618a30906001600160781b0316608084901c615f93565b60801b169060018060801b0316176016555b60085f6001600160401b03601254160860088110156100f257618a6790601801615b4b565b916001600160781b0382811692908216808411156194925750618a8a92506180ae565b6020820180516001600160781b0390811691908316821015619476578051618ae992618ad99290916001600160781b0390618ac890849083166180ae565b1690526001600160781b03936180ae565b83516001600160781b0316616a37565b1681525b60085f6001600160401b03601254160860088110156100f25760180190618b2060018060781b0360208301511683617cbc565b5181546001600160781b0319166001600160781b03919091161790556012546008905f906001600160401b03160860088110156100f257618b7e9060018060781b03906028015460781c1660165460801c818110908218021861aa69565b60085f6001600160401b03601254160860088110156100f25760280180546001600160781b03191690556016546001600160801b0319618bcb6001600160781b038416608084901c616396565b60801b169060018060801b03161760165560085f6001600160401b0360125416089060088210156100f25760189091018054618c16926108e29160781c6001600160781b0316616a37565b618c21614af8615c08565b60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b0316618c556123ac615c08565b9160085f6001600160401b0360125416089260088410156100f257601890930154618d20936001600160781b039190911690818411156194705781935b8381111561946957618ca484826161aa565b945b8583851161944f575b50808611619427575b50917fec02843180b54309d8a147dbf4e1752769231591a33bd1200f8c8ed16d5b761b939160a093618ceb61882b615c2e565b601354908160801c908181116193a2575b505050604051938785526020850152604084015260608301526080820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546001600160781b0390618d5490849083166180ae565b82546001600160781b03191691161790556012546008905f906001600160401b0316089060088210156100f25760189091018054618da1926108e29160781c6001600160781b03166180ae565b603954151580619366575b61929e575b6039541561913957618dc4614af8615c08565b60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b031681811161907b575b5060085f6001600160401b03601254160860088110156100f257601801546001600160781b0316618e276123ac615c08565b808211618fa4575b505060016039541180618f9b575b618f08575b505b60085f6001600160401b03601254160860088110156100f2576028015460405160789190911c6001600160781b031690618e7d81615a8a565b81815260206001600160401b03431691015260018060781b031960175416176017556017546001600160401b0360781b4360781b16906001600160401b0360781b1916176017556012546001600160401b03618eda818316615dc0565b16906001600160401b03191617601255670f6b75ab2bc471c76001600160401b0319603b541617603b555f90565b61ffff60125460501c169081618f1f575b50618e42565b61271091618f2c916161db565b0460021c60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b03168111618f66575b80618f19565b618f6f9061aa69565b60085f6001600160401b0360125416089060088210156100f257618f9591601801617cbc565b5f618f60565b50801515618e3d565b7f6b2dd4fda632ddc7bb2fbc3eaaed4976d90adadf4ae3ed9c8b7c7d8d7da4ed5d604083618fd584618fe6966161aa565b9382519182526020820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546001600160781b039061901a90849083166180ae565b82546001600160781b03191691161790556012546008906001906001600160401b03160860088110156100f257601801805490916001600160781b039161906391908316616a37565b82546001600160781b03191691161790555f80618e2f565b807f46360e9dac0d2811c43387b45e04c168b83a52b6a1cdd0c430f7bfb872999c1d60406190ac856190be956161aa565b928151908152856020820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546190f891906108e290849060781c6001600160781b03166180ae565b600860016001600160401b0360125416089060088210156100f25760189091018054619133926108e29160781c6001600160781b0316616a37565b5f618df5565b60085f6001600160401b03601254160860088110156100f25760018060781b0390601801541660085f6001600160401b03601254160860088110156100f25760018060781b03906018015460781c16907f45ef01ba9c1df082e9efff8583fa67a93e191d572f3bd66b4e43c799b77a5d32816001600160401b03601254166191c7856040519384938461b44e565b0390a181811115619251576191df91618191916161aa565b600860016001600160401b03601254160860088110156100f257601801805490916001600160781b039161921591908316616a37565b82546001600160781b03191691161790555b60085f6001600160401b03601254160860088110156100f25761924c9060180161b438565b618e44565b6181919061925e926161aa565b600860016001600160401b0360125416089060088210156100f25760189091018054619299926108e29160781c6001600160781b0316616a37565b619227565b60085f6001600160401b03601254160860088110156100f25760018060781b039060180154167f775610ca80dfabec6d8007dfdfa10f08fba6848e6aeec65036dd88bce0ffade76020604051838152a160085f6001600160401b03601254160860088110156100f25760180180546001600160781b03191690556012546008906001906001600160401b03160860088110156100f257601801805490916001600160781b039161935091908316616a37565b82546001600160781b0319169116179055618db1565b5060085f6001600160401b03601254160860088110156100f25760280154670de0b6b3a764000060789190911c6001600160781b031610618dac565b816193ac916161aa565b9084821161941f575b898211619417575b6193fe907f1f7b809c624385126cf2584bb2e558256de4a545b59e843e80beb6b3a04a113f6020604051858152a16001600160801b0319926173c890617c88565b60801b169060018060801b0316176013555f8080618cfc565b8991506193bd565b8491506193b5565b94507fec02843180b54309d8a147dbf4e1752769231591a33bd1200f8c8ed16d5b761b618cb8565b61945984866161aa565b90811115618caf5795505f618caf565b5f94618ca6565b83618c92565b916001600160781b039161948a91906180ae565b169052618aed565b919061949d916180ae565b83516001600160781b03908116919081168210156195c757906194c3816195b0936180ae565b855190916001600160781b03916194dc919083166180ae565b16855260208501805190947fb5ca5bab0e3b64ed0f778724d9e9821b9d907fa9086b6e0ea92014fe1ab3dcba9161012091906001600160781b03906195249086908316616a37565b16968790526012548851601654986001600160781b03968716986001600160801b038b16976001600160401b039490941694939192909116906195678a896161aa565b936040519586528a602087015260408601526060850152608084015260a08301528760801c60c08301528460e0830152610100820152a16001600160801b039261892290617c88565b6001600160801b0319909216911617601655618aed565b6001600160781b0393506195dc9250906180ae565b168152618aed565b9091826195f091616a37565b60165490926001600160801b031990619616906001600160781b0316608084901c616396565b60801b169060018060801b031617601655618a42565b946001600160781b03918216935090831161140b576016546001600160801b0361965885828416616396565b6001600160801b03199092169116176016556189fa565b618979670de0b6b3a76400006189735f94618963565b61968e8161aa69565b9060085f6001600160401b0360125416089060088210156100f257601890910180547f8bd0ad85443d99cb34374c3bba38adb467cccb02feb4cbc0b16d18c4b4f452c29360409392916001600160781b03916196eb918316616a37565b1660018060781b03198254161790556001600160401b03601254169082519182526020820152a15f6188a9565b61818c86619725936161aa565b93838511619843575b82851161983a575b6197416123ac615c08565b808611619832575b5084619756575b8061885b565b6197b7926181919286926001600160801b031990619777906173c886617c88565b60801b169060018060801b0316176013557fd9da440b9eabce7720ccaa3811405047f2972588a1b1ee1d9ed5e18dbe5db4b56020604051848152a16161aa565b9160085f6001600160401b0360125416089160088310156100f257601890920180546001600160781b0319166001600160781b039094169390931790925561980291618191916161aa565b60085f6001600160401b0360125416089060088210156100f25761982891601801617cbc565b5f80808080619750565b94505f619749565b93508193619736565b9350829361972e565b619857919350615dc0565b915f61871c565b905061987a91935060403d6040116122e7576122d88183615adc565b92905f618714565b600190565b6001600160401b03603b54165b620f42405a1115619928576001600160401b03811690678ac7230489e7ffff82146198fc576198d2906001600160401b031960015c1660015d61b46d565b6001600160401b031960015c1660015d5f5260366020526001600160401b0360405f205416619894565b678ac7230489e7ffff91506001600160401b03905b16806001600160401b0319603b541617603b551490565b6001600160401b03678ac7230489e7ffff91619911565b9060018060a01b031691825f52600360205261995d60405f20615ca0565b6199668561718f565b6001600160a01b03909216928315619afb5781516001600160801b039081169084168110619ae45750619a7a91906001600160401b0390858714619ac057855f5260036020526199eb6199bb60405f20615ca0565b6020810180516001600160801b03906199d7908a908316615f93565b169052875f52600360205260405f20615f64565b85875f516020620108865f395f51905f5260206040518c8152a35b82516001600160801b039081168690038116845291165f818152600560209081526040808320898452825280832080546001600160801b03198082169188168b01881691909117909155600d8054968716608097881c909a0190961b16979097179093558781526003909252939020615f64565b7f45d67bb4735e13f58323fb3dca98d7e59f5ecd6194ea476d0c62a032eb6b99f76020604051868152a36040519182525f516020620108865f395f51905f5260203093a3565b6020830180516001600160801b0390619adc9088908316615f93565b169052619a06565b869063067f31a160e51b5f5260045260245260445ffd5b631b31744560e11b5f5260045ffd5b81601f8201121561071757805190619b2182615b81565b92619b2f6040519485615adc565b8284526020838301011161071757815f9260208093018386015e8301015290565b91610180838303126107175782516001600160a01b03811681036107175792619b7b602082016166c9565b9260408201519260608301519260808101519260a08201519260c08301519260e08101519261010082015192610120830151926101408101516001600160401b0381116107175783619bce918301619b0a565b926101608201516001600160401b038111610717576162e39201619b0a565b6001600160401b036001911601906001600160401b03821161140b57565b6001600160401b0316801561140b575f190190565b6001600160401b03811691619c37828415156166a5565b6001600160a01b0316908115616795576002600160401b035f819052600f6020527fec7d38684056dd22d1781636ecf6a1ccfc211d4bfe5176bdec4c27c7346e61fb5460ff1615801561a289575b1561a27657830361a1e5575b825f52600f60205260ff60405f20541661a16857815f5260356020526001600160401b0360405f2054168061a1d057506039545f19811461140b576001016039555f5b6008811061a19557505f838152600f60209081526040808320805460ff1916600117905560339091529020805460ff60801b1916600160801b179055619d199061ce39565b5f838152603360209081526040808320805460ff60881b191694151560881b60ff60881b16949094179093556034905220546001600160a01b03161580159061a177575b61a16857816040917f7429a06e9412e469f0d64f9d222640b0af359f556b709e2913588c227851b88d935f526034602052825f208160018060a01b0319825416179055805f526035602052825f20826001600160401b0319825416179055619feb6001600160401b0360125416835f526030602052619e4a619df2865f20600860016001600160401b03601254160890616a50565b50619dfc83619bed565b906001600160401b03885192619e1184615aa5565b168252600160208301525f888301525f60608301525f60808301525f60a08301525f60c08301525f60e08301525f61010083015261cf06565b835f526030602052619eb8619e71865f2060085f6001600160401b03601254160890616a50565b50865190619e7e82615aa5565b838252600160208301525f888301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b8061a15a575b835f526030602052619ee3855f2060085f196001600160401b03601254160890616a50565b50619f378651619ef281615aa5565b6001600160401b03841692838252600160208301525f898301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b61a14c575b835f526030602052619f62855f2060086001196001600160401b03601254160890616a50565b50619f718651619ef281615aa5565b61a13e575b835f526030602052619f9c855f2060086002196001600160401b03601254160890616a50565b506001600160401b03865192619fb184615aa5565b168252600160208301525f868301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b815f52603160205261a01861a012845f2060085f6001600160401b03601254160890616a50565b5061b438565b815f52603160205261a04061a012845f20600860016001600160401b03601254160890616a50565b815f52603260205261a06761a012845f2060085f6001600160401b03601254160890616a50565b815f52603260205261a08f61a012845f20600860016001600160401b03601254160890616a50565b678ac7230489e7ffff5f5260376020526001600160401b03835f205416805f526036602052835f20836001600160401b0319825416179055825f5260376020526001600160401b03845f2091166001600160401b0319825416179055815f526036602052825f20678ac7230489e7ffff6001600160401b0319825416179055678ac7230489e7ffff5f526037602052825f20826001600160401b031982541617905582519182526020820152a1565b61a14790619c0b565b619f76565b61a15590619c0b565b619f3c565b61a16390619c0b565b619ebe565b6306abec9560e11b5f5260045ffd5b50805f5260356020526001600160401b0360405f2054161515619d5d565b835f5260306020526001600160401b0361a1b28260405f20616a50565b50541661a1c157600101619cd4565b63035d00bf60e11b5f5260045ffd5b831461a1c1576306abec9560e11b5f5260045ffd5b6040516315b6b1cd60e11b8152600481018490525f81602481836110006201a2c0f15f918161a247575b5061a22757836319708e7160e01b5f5260045260245ffd5b6001600160a01b0316619c9157826319708e7160e01b5f5260045260245ffd5b61a2649192503d805f833e61a25c8183615adc565b810190619b50565b5050505050505050505050905f61a20f565b826359bff38760e01b5f5260045260245ffd5b506002600160a01b03831415619c85565b8151602090920151616aa6926001600160801b0390811691168082111561a2d95761a2c4916161aa565b905b602001516001600160801b03169061609b565b50505f9061a2c6565b61a2f461a2ee8261cd78565b9161cdc4565b602081519101209060405191602083019160ff60f81b83523060601b6021850152603584015260558301526055825261a32e607583615adc565b905190206001600160a01b031690565b61a3926001600160401b0361a39b9294939416805f52600560205260405f2060018060a01b0386165f5260205260405f20946040519161a37d83615a8a565b82526001600160a01b0316602082015261d286565b91825c9061609b565b91546001600160801b031682811061a3b157505d565b9050636f6700d160e01b5f5260045260245260445ffd5b6001600160a01b03808416969495908216947ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db946040949361a438929161a41c91859190828d8c0361a44f575b5050617d16565b61a42588617c88565b906001600160801b039061320790617c88565b825195865260208601526001600160a01b031693a4565b61a4599183616b74565b5f8261a415565b60085f6001600160401b03601254160860088110156100f257602001546001600160401b0316615f91576001600160401b03601254161561a49d57565b7f1b555aca7137ecab873ff5825c4daff389c38ba0c5fd4f3ed4741665aea9c12680546001600160401b0319908116678ac7230489e7ffff9081179092555f9190915260376020527f2e5537df34089dba0cf2fa8ffc5e5669698de0ece308945b7dc8e76dc0fb21fb8054909116670f6b75ab2bc471c71790556002600160401b0361a5306002600160a01b0382619c20565b806001600160401b0319603b541617603b5561a54d603954618506565b6039555f908152603360205260409020805461ffff60881b191661010160881b17905560128054600a6001600160401b03199091168117909155600890600119900860088110156100f25760200180546001600160401b03191660071790556012546008908190600119906001600160401b031608818110156100f2576020016001600160401b0382166001600160401b0319825416179055805f196001600160401b036012541608818110156100f25760200180546001600160401b031916600917905560125481905f906001600160401b031608818110156100f257602001600a6001600160401b03198254161790558060016001600160401b036012541608818110156100f25760200180546001600160401b031916600b17905560125481906002906001600160401b031608818110156100f25760200180546001600160401b031916600c17905566470de4df820000603a555f5b81811261a91d575061a6b6615c08565b815f6001600160401b036012541608828110156100f25761a6de91479161889d618894615be2565b8061a6fa575b505061a6ee618654565b5061a6f7619887565b50565b6040516304fd660560e41b81523060048201525f6024820181905281604481836110005af19081156122ee575f905f9261a86a575b501561a85b575161a84c576013546001600160801b038116158015919061a83f575b5061a830576015546001600160801b038116158015919061a823575b50801561a815575b61a806576016546001600160801b038116158015919061a7f9575b5061a7ea5761a79e9061aa69565b90805f6001600160401b036012541608908110156100f257601801805490916001600160781b039161a7d291908316616a37565b82546001600160781b03191691161790555f8061a6e4565b63192c1f5b60e31b5f5260045ffd5b905060801c15155f61a790565b63ed9fd63760e01b5f5260045ffd5b5060125460801c151561a775565b905060801c15155f61a76d565b632235bb3560e01b5f5260045ffd5b905060801c15155f61a751565b6365c269bd60e11b5f5260045ffd5b63476954c760e11b5f5260045ffd5b9150503d805f833e61a87c8183615adc565b8101906060818303126107175761a892816166dd565b9061a89f602082016166c9565b506040810151906001600160401b03821161071757019180601f8401121561071757825161a8cc81615afd565b9361a8da6040519586615adc565b81855260208086019260051b82010192831161071757602001905b82821061a905575050505f61a72f565b6020809161a912846166c9565b81520191019061a8f5565b8061a929600192616b02565b805460ff60f01b191660f084901b17905561a94381616b36565b805460ff60f01b191660f084901b1790550161a6a6565b80156160165761862b9061a96c61827a565b9061a975615c54565b9261b069565b9190823b61a9b6579061a98d9161d123565b5061a99781616a19565b15918261a9a357505090565b6001600160a01b03918216911614919050565b915f9261a9ec61a9fa85946040519283916020830195630b135d3f60e11b875260248401526040604484015260648301906157fc565b03601f198101835282615adc565b51915afa3d1561aa62573d61aa0e81615b81565b9061aa1c6040519283615adc565b81523d5f602083013e5b8161aa54575b8161aa35575090565b90506020818051810103126107175760200151630b135d3f60e11b1490565b90506020815110159061aa2c565b606061aa26565b600160781b811015614a4d576001600160781b031690565b516162e3939192916183009161aabe9161aaa3916001600160801b031661609b565b6020850151945190946001600160801b039182169116615f93565b60a0909201516001600160801b039290831690615f93565b60405161aae281615a8a565b6017546001600160781b038116825260781c6001600160401b03166020820181905261ab0e90436161aa565b90516001600160781b03169061c3508111801561abbb575b61ab8d5761c350039061c350821161140b5761ab4561c350838361d15d565b9061ab579261c350910915159061609b565b60085f6001600160401b0360125416089060088210156100f2576028909101546162e3919060781c6001600160781b031661609b565b505060085f6001600160401b03601254160860088110156100f2576028015460781c6001600160781b031690565b50811561ab26565b929160018061abd383858861d15d565b9461abdd81616a19565b1614918261abf5575b50506162e3925015159061609b565b90809250156161f8576162e3930915155f8061abe6565b6001600160a01b0316908115616c07576001600160a01b0316918215616bf45760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591835f526004825260405f20855f5282528060405f2055604051908152a3565b61ac7761d1fb565b61ac7f61d253565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815261acd060c082615adc565b51902090565b92916001600160401b03909491941692835f52600760205260405f2060018060a01b0384165f5260205261ad0c60405f206160a8565b90845f52600860205260405f2060018060a01b0385165f5260205260405f206040519061ad3882615a6f565b5460018060801b038116825263ffffffff8160801c169081602084015260a01c604083015265ffffffffffff61ad756020860192828451166162e6565b16431161aec3575b505182516001600160801b0391821691168082111561aeb75761ad9f91616396565b81516001600160801b039161adc491908316908316818118918111919091021861718f565b1690811561aeac5761adec60209261ae499560018060801b031690818110908218021861718f565b87516001600160801b039081168201811690985283518816810188168452815188168190038816825291018051871682019096169095525f8481526007602090815260408083206001600160a01b03871684529091529020616ec5565b6040516001600160801b038416808252926001600160a01b03929092169182917f45d67bb4735e13f58323fb3dca98d7e59f5ecd6194ea476d0c62a032eb6b99f790602090a36040519182525f516020620108865f395f51905f5260203093a390565b505050505050505f90565b50505050505050505f90565b5f845265ffffffffffff431690525f61ad7d565b604051637dd6585f60e11b81525f919060208160048186611000612774f15f918161af24575b5061af0f57506002600160401b039150565b6001600160401b03811661af205750565b9150565b9091506020813d60201161af58575b8161af4060209383615adc565b810103126107175761af51906166c9565b905f61aefd565b3d915061af33565b6001600160a01b0316905f905f516020620108865f395f51905f5290602090841561af8b8115616c57565b61af948261718f565b600d549091906001600160801b0361afae84828416615f93565b6001600160801b0319909216911617600d55851461aff457600d80546001600160801b031981166001600160801b039182169390930316919091179055604051908152a3565b8585526003835260408520805490916001600160801b0391616d4891908316615f93565b61b0219061aa69565b60085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161b05691908316616a37565b82546001600160781b0319169116179055565b9392841561b1e357602081015181516001600160801b03918216939116918690851561b1c1575050811561b15d5781838561b0a39361d398565b9493818a989398949294111561b1455750505061b0c090876161aa565b91676765c793fa10079d601b1b019283676765c793fa10079d601b1b1161140b5783676765c793fa10079d601b1b840293676765c793fa10079d601b1b81860414901517021561b138578661b12c61b1266162e39761b13197633b9aca0097049061609b565b826161aa565b61d345565b80936161aa565b63ad251c275f526004601cfd5b6162e39750633b9aca00955061b1319693508961e24b565b5090809250676765c793fa10079d601b1b019081676765c793fa10079d601b1b1161140b57676765c793fa10079d601b1b85029082676765c793fa10079d601b1b87840414021561b138576162e3938661b12c61b13195633b9aca009504826161aa565b6162e39550633b9aca009392509061b1dd61b13195928261d2ac565b5061d345565b50505090505f905f90565b9392919091841561b1e357602081015181516001600160801b0391821694911691831561b3f55750811561b3ac5781848461b2289361d398565b9493828a9793949297111561b28f5750505061b24490876161aa565b91676765c793fa10079d601b1b019384676765c793fa10079d601b1b1161140b5761b27e61b28894612f6261830d97633b9aca009661d479565b61b12c88826161aa565b809361609b565b925092959793509350670de0b6b3a7640000830284670de0b6b3a764000085830414021561b1385784900482811161b3a5575b8061b37b575061b2fa633b9aca00868987868661b2f561b2ef86868661b2e95f5b8761609b565b8661e214565b8b61609b565b61e24b565b9461b305868561609b565b95978661b317575b5050505050509190565b5f1987019587871161140b5761b33394633b9aca00948861e24b565b91818380831015928361b366575b50505061b352575b8080808061b30d565b81945061b35f925061609b565b5f8061b349565b61b3719293506161aa565b101581835f61b341565b5f19810190811161140b57633b9aca00868987868661b2f561b2ef86868661b2e961b2fa9c61b2e3565b508161b2c2565b50918091508402676765c793fa10079d601b1b8286830414021561b1385761830d9261b28892676765c793fa10079d601b1b633b9aca00930461b3ef818961609b565b9061d345565b905061b404919392508561d406565b81158061b430575b61b424579261b28892633b9aca009261830d9561d345565b5050505090505f905f90565b50801561b40c565b80546001600160f81b031916600160f01b179055565b6040919493926001600160401b03606083019616825260208201520152565b6001600160401b03811690670f6b75ab2bc471c7821461cd74576002600160401b03820361b49f575050615f9161d6d9565b811561cd4657815f52603060205261b4cb60405f2060085f196001600160401b03601254160890616a50565b50805460ff8160601c16616ba85760ff60601b1916600160601b1790555f8281526033602052604090205460801c60ff1661cd0c575b4760801b6002175f5d8061b5148161e540565b5f809392935d1561ccb2579061b5299161ea20565b815f52603060205261b55060405f2060086002196001600160401b03601254160890616a50565b50805460ff8160581c1661cc70575b5050815f52603060205261b58860405f2060086001196001600160401b03601254160890616a50565b50805460ff8160581c16155f1461cc2e575060ff815460481c1661cbf5575b505b815f52603060205261b5cf60405f2060085f196001600160401b03601254160890616a50565b50805460ff8160581c161561cbad575b5050815f52603160205261b60760405f2060085f196001600160401b03601254160890616a50565b50546001600160781b0316670de0b6b3a7640000811061cb4c5761b62b818361f02e565b901561ca66576001600160781b038116908282101561ca565761b6db61b6e19161b6e6947f2ca8882a937b22102ae3d32cab93eb7601862f926bab6ebce8ebb7b52ca5a01560a04761b67e614fa2615c08565b604051918583528960208401526040830152606082015260026080820152a1875f5260346020525f516020620108a65f395f51905f528760018060a01b0360405f20541661b6d347856040519485948561db92565b0390a16180ae565b8461ef94565b61f0f3565b815f52603060205261b71661b70f60405f2060085f196001600160401b03601254160890616a50565b508261dbfc565b815f52603060205261b7dc61b74060405f2060086001196001600160401b03601254160890616a50565b50835f52603060205261b76760405f2060085f196001600160401b03601254160890616a50565b5090845f52603260205261b78f60405f2060085f196001600160401b03601254160890616a50565b50855f52603260205261b7d661b7d061b7d061b7ca61b7c360405f2060086001196001600160401b03601254160890616a50565b5095615d30565b95615d30565b92615b4b565b9261e0e8565b825f52603060205261b80260405f2060085f196001600160401b03601254160890616a50565b506001600160801b03906101009061b81990615d30565b01511680821161ca40575061b82f614af8615c08565b60085f196001600160401b03601254160860088110156100f25760086001196001600160401b0360125416089260088410156100f25760085f196001600160401b0360125416089260088410156100f257865f52603160205261b8a760405f2060086001196001600160401b03601254160890616a50565b5094875f52603160205261b8cf60405f2060085f196001600160401b03601254160890616a50565b5095885f52603060205261b98661b93a61b93461b92e61b92861b91f61b91661b90c60405f2060085f196001600160401b03601254160890616a50565b509b601801615b4b565b97602801615b4b565b9a602801615b4b565b94615b4b565b99615b4b565b96615d30565b60209687015196909801515f98978997909161b962916001600160781b03918216911661609b565b602093840151919093015160019390931c926001600160781b03908116911661609b565b60011c90633b9aca0081118061ca27575b8061ca1e575b61c9fa575b5050602001516001600160781b0316633b9aca0081118061c9f1575b8061c9e8575b61c9c3575b5050508083111561c9895761ba05906001600160801b039061b9eb90856161aa565b6101009093015192169182906001600160801b0316615f93565b915f5b8391838295885f52603360205260ff60405f205460801c161590811561c96b575b5061c7b6575b50919291508190506001600160801b03811683633b9aca0082101561c1ea575061ba65926001600160801b0316915061aa699050565b916001600160781b0383169082908261c0045750505090835f52603460205260018060a01b0360405f20541660085f196001600160401b03601254160860088110156100f2576020908101545f878152603383526040908190205481519485529284018890526001600160401b03909116908301526001600160801b03841660608301526001600160781b038316608083015260ff608882901c8116151560a084015260909190911c16151560c08201527f7a444ffda68842e454edcf5ad9e286d7a90d72b731bc5cd982e8ece0cbc955059060e090a15b505b825f52603060205261bc9a61bb6a61111e60405f2060085f6001600160401b03601254160890616a50565b6001600160401b03601254169260ff60208301511690604083015161bfed575b61bbb990875f52603060205261bbb360405f2060085f6001600160401b03601254160890616a50565b5061cedd565b855f52603160205261bbe261a01260405f20600860026001600160401b03601254160890616a50565b855f52603260205261bc0b61a01260405f20600860026001600160401b03601254160890616a50565b855f52603060205261bc3160405f20600860016001600160401b03601254160890616a50565b509061bc3c85619bed565b9260ff60e060c083015115159201511515926001600160401b036040519661bc6388615aa5565b1686521660208501525f60408501525f60608501525f60808501525f60a085015260c084015260e08301525f61010083015261cf06565b825f52603360205260ff60405f205460801c165f1461bd92575f83815260336020526040902080546001600160401b0319166001600160401b0392909216919091179081905560901c60ff16158061bd78575b61bd69575b505b5f908152603460205260409020546001600160a01b0316803b61bd145750565b60205f9160046040518094819363c33fb87760e01b8352620186a0f161bd375750565b6020813d60201161bd61575b8161bd5060209383615adc565b810103126107175761a6f7906166dd565b3d915061bd43565b61bd7290618512565b5f61bcf2565b50815f52603360205260ff60405f205460881c161561bced565b9050815f5260336020526001600160401b0360405f205416906007820180921161140b571061bcf457805f52600f60205260ff60405f205416156185d9575f8181526033602052604090205460801c60ff1661bfde576001600160401b0360125416815f5260336020526001600160401b0360405f205416906007820180921161140b571061bfcf57805f52603060205261be4060405f2060085f6001600160401b03601254160890616a50565b5080546001600160401b03191690555f818152600f60209081526040808320805460ff1916905560349091529020546001600160a01b03168061bf94575b50805f5260336020525f6040812055805f5260366020526001600160401b0360405f205416815f5260376020526001600160401b0360405f20541690815f52603660205260405f206001600160401b0382166001600160401b03198254161790555f5260376020526001600160401b0360405f2091166001600160401b03198254161790555f5b6008811061bf3d57507f12048e179cb277774d73abb2f522205e0fcd471ab52fa6feb7b5b5508dd26a216020604051838152a161bcf4565b600190825f52603060205261bf5e61bf588260405f20616a50565b90617e36565b825f52603160205261bf7661bf588260405f20616a50565b825f52603260205261bf8e61bf588260405f20616a50565b0161bf05565b5f90815260356020908152604080832080546001600160401b03191690558383526034909152812080546001600160a01b031916905561be7e565b63f80f20c760e01b5f5260045ffd5b63786b336560e01b5f5260045ffd5b90600160ff910116908161bb8a576001915061bb8a565b1561c0fa575061c01f916001600160781b0384169150615f93565b9060085f6001600160401b0360125416089060088210156100f2576018909101805461c05a926108e29160781c6001600160781b0316616a37565b5f835f52603460205260018060a01b0360405f20541660085f196001600160401b03601254160860088110156100f2577fd1f415bb27cdd1ef9c25bec81d99ceb87ce8e6ed1bcb9647d44634c6b636dff69161c0f26001600160401b0387936020015416885f52603360205260ff60405f205460881c16895f5260336020528760ff60405f205460901c16926040519687968761f308565b0390a161bb3d565b61c1049250616396565b9060085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c13a91908316616a37565b82546001600160781b03191691161790555f838152603460205260408120546012546001600160a01b0391909116906008905f19906001600160401b03160860088110156100f2577fe2aa2cd3812cdb201e7ac23eb41f936733caf10d3e6007b97cb59acb9a3b80fb9161c0f26001600160401b0387936020015416885f52603360205260ff60405f205460881c16895f5260336020528760ff60405f205460901c16926040519687968761f308565b909192945f1461c4f957505050818192855f52603060205261c23160ff61c22460405f2060085f6001600160401b03601254160890616a50565b505460401c16828761f8d3565b93901561c4455750506001600160801b038281169290821680841061c36b575b50509061c25d9061aa69565b845f52603060205261c28260405f2060085f6001600160401b03601254160890616a50565b50805460ff60481b1916600160481b1790555f85815260306020526040812060125461c2bb926008916001600160401b03160890616a50565b50805460ff60501b1916905561c2fd61c2d261d4ad565b865f52603060205261c2f760405f2060085f6001600160401b03601254160890616a50565b5061cec0565b845f52603260205261c325613e9260405f2060085f6001600160401b03601254160890616a50565b60145490600160781b600160f01b039061c34c90607884901c6001600160781b0316616a37565b60781b16600160781b600160f01b031991909116176014555b5061bb3f565b907f6d990c2ca2b7a15bfa6b29d936448959e8cf45e8a4680d60ebd958235626d8d360a061c3e993895f526034602052600180831b0360405f205416906001600160401b0361c3b86185e8565b6040519384528c60208501521660408301526060820152866080820152a16001600160801b03906143d99084616396565b6001600160781b0381169361c3ff908590615f93565b9360085f6001600160401b0360125416089260088410156100f2576173ba61c43e936108e261c25d966018019160018060781b03835460781c16616a37565b905f61c251565b81945061c46f935061c460925061c45b8661e86c565b615f93565b916001600160801b031661aa69565b60085f6001600160401b0360125416089060088210156100f2576018909101805461c4a9926108e29160781c6001600160781b0316616a37565b5f835f5260346020527f3f91c9d606a05e746839cb2153ee473c26bc1d7c2493559494a27a5e823989b98360018060a01b0360405f20541661c4f1856040519384938461f2ce565b0390a161c365565b935090915082908261c50b818761f7e6565b93901561c707575050506001600160801b0382811690821681811061c63c575b5061c5419150506001600160801b03821661aa69565b845f52603060205261c58a61c56960405f2060085f6001600160401b03601254160890616a50565b50805461ffff60481b1916600160501b17815561c58461d4ad565b9061cec0565b845f52603260205261c5af60405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b039061c5c89084908316616a37565b82546001600160781b03191691161790556014546001600160781b0361c5f083838316616a37565b6001600160781b0319909216911617601455601354906001600160801b039061c624906001600160781b0316828416615f93565b6001600160801b03199092169116176013555061bb3f565b927f2ca8882a937b22102ae3d32cab93eb7601862f926bab6ebce8ebb7b52ca5a01560a061c6a79361c6b895964761c675614fa2615c08565b9160405193845260208401526040830152606082015260016080820152a16001600160801b03906143d9908590616396565b926001600160781b03841690616396565b9160085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c6ee91908316616a37565b82546001600160781b03191691161790555f808061c52b565b9091945061c724935061c71e92506173ba8661e792565b9161aa69565b60085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c75991908316616a37565b82546001600160781b03191691161790555f838152603460205260408082205490517f5dc5856f210c6db0655896374b2cac8ad9266793361aed17faae007aa663ed6491819061c4f190869088906001600160a01b03168461f2ce565b925092509250845f52603060205261c86961c7e660405f2060086001196001600160401b03601254160890616a50565b50865f52603060205261c80d60405f2060085f196001600160401b03601254160890616a50565b5090875f52603260205261c83560405f2060085f196001600160401b03601254160890616a50565b50885f52603260205261b7d661b7d061b7d061b7ca61b7c360405f2060086001196001600160401b03601254160890616a50565b928261c8c5575b50505061c87c90617c88565b825f52603060205261c8b98161c8a660405f2060085f196001600160401b03601254160890616a50565b505460781c6001600160801b0316616396565b906001915f808061ba2f565b1561c9525761c8dd906001600160801b0316836161aa565b905b818110908218029081810361c8f5575b8061c870565b61c8ff911861aa69565b9060085f6001600160401b0360125416089160088310156100f2576018909201805461c87c936001600160781b039161c93a91908316616a37565b82546001600160781b0319169116179055905f61c8ef565b61c965906001600160801b03168361609b565b9061c8df565b670de0b6b3a76400006001600160801b03919091161090505f61ba29565b61c9bb906001600160801b039061c9a19085906161aa565b6101009093015192169182906001600160801b0316616396565b91600161ba08565b819293508381029381850414901517021561b1385780820491061515015f808061b9c9565b5082151561b9c4565b5081151561b9be565b825192975061ca169261687491906001600160781b03166161db565b945f8061b9a2565b5081151561b99d565b508251633b9aca006001600160781b039091161161b997565b906304cce29f60e41b5f5260045260245260445ffd5b505061ca619061f0f3565b61b6e6565b50825f5260346020525f516020620108a65f395f51905f5260a0600180821b0360405f20541647604051918252866020830152846040830152606082015260026080820152a16013546001600160801b031961cac683608084901c616396565b60801b166001600160801b03918216176013556015549061cae983838316616396565b6001600160801b03199092169116176015556012546008905f906001600160401b03160860088110156100f257601801805490916001600160781b039161cb3291908316616a37565b82546001600160781b031916911617905561ca618161e6b8565b8061cb58575b5061b6e6565b61cba790835f5260346020525f516020620108a65f395f51905f5260a0600180821b0360405f20541647604051918252876020830152846040830152606082015260036080820152a18261ef94565b5f61cb52565b60501c60ff1661cbbe575b8061b5df565b61cbef90835f52603260205261cbe860405f2060085f196001600160401b03601254160890616a50565b509061ef59565b5f61cbb8565b61cc2890835f52603260205261cc2060405f2060086001196001600160401b03601254160890616a50565b50908361eb4d565b5f61b5a7565b60501c60ff1661cc3f575b5061b5a9565b61cc6a90835f52603260205261cbe860405f2060086001196001600160401b03601254160890616a50565b5f61cc39565b60481c60ff1661cc81575b8061b55f565b61ccac90835f52603260205261cc2060405f2060086002196001600160401b03601254160890616a50565b5f61cc7b565b7f59fb2c26df726f79f2e83d990dca2ab84a57a26d37a6d1f4199adc3d44e65ba29161ccdd8261e5de565b845f52603460205261cd0460018060a01b0360405f2054169147906040519485948561db92565b0390a161b529565b5f828152603360205260409020805461ffff60881b19811660889190911c60ff16151560901b60ff60901b1617600160881b17905561b501565b50507fa618939919fa454c33a38ff371f9a892aa25aedcc6553602e1bb242a0699a2b66020604051418152a1565b5050565b60405160208101917f613d7e18a976d3e4e2209750b65b9bfe5777159616fa13d0e2a8ecfdf54a1071835260018060c01b03199060c01b1660408201526028815261acd0604882615adc565b6162e3610cff9160206040519161cddd82860184615adc565b848352818301946200fa8786396040516001600160401b038382019216825282815261ce0a604082615adc565b6040519586945180918587015e840190838201905f8252519283915e01015f815203601f198101835282615adc565b61ce4161d4ad565b6040516315b6b1cd60e11b81526001600160401b039092166004830152905f81602481836110005af191825f925f9461ce93575b5061ce81575050505f90565b1561ce8c5750151590565b9050151590565b90935061ceab9192503d805f833e61a25c8183615adc565b5050509897505094505050505091925f61ce75565b805460ff60581b191691151560581b60ff60581b16919091179055565b8054600160781b600160f81b03191660789290921b600160781b600160f81b0316919091179055565b81518154602084015160408086015160608701516001600160581b03199094166001600160401b03959095169490941791901b60ff60401b161791151560481b60ff60481b169190911790151560501b60ff60501b161781556080820151615f91929061cf759015158361cec0565b60a0810151825460c083015161ffff60601b1990911691151560601b60ff60601b169190911790151560681b60ff60681b1617825560e0810151825460ff60701b191690151560701b60ff60701b1617825561010001516001600160801b03169061cedd565b60ff5f516020620109065f395f51905f525460401c161561cff857565b631afcd79f60e31b5f5260045ffd5b9061d01392939161a29a565b90516001600160781b03168082111561636c576162e3916161aa565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841161d09c579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa156122ee575f516001600160a01b0381161561d09257905f905f90565b505f906001905f90565b5050505f9160039190565b61d0b081616a19565b8061d0b9575050565b61d0c281616a19565b6001810361d0d95763f645eedf60e01b5f5260045ffd5b61d0e281616a19565b6002810361d0fd575063fce698f760e01b5f5260045260245ffd5b60039061d10981616a19565b1461d1115750565b6335e2f38360e21b5f5260045260245ffd5b815191906041830361d1535761d14c9250602082015190606060408401519301515f1a9061d02f565b9192909190565b50505f9160029190565b90915f19838309928083029283808610950394808603951461d1ee578483111561d1d65790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906162e392506161ee565b61d203618388565b805190811561d213576020012090565b50505f516020620107e65f395f51905f5254801561d22e5790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61d25b618457565b805190811561d26b576020012090565b50505f516020620109465f395f51905f5254801561d22e5790565b602081015190516001600160401b031660409190911b600160401b600160e01b03161790565b90811561d33d576020810151905161d2d0916001600160801b03918216911661609b565b676765c793fa10079d601b1b81101561d33757676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b57676765c793fa10079d601b1b82029080676765c793fa10079d601b1b84840414021561b1385761d334910480926161aa565b91565b50905f90565b50505f905f90565b91939290938315801561d390575b61d3885715908161d37f575b5061d379578181101561d37957508082101561649e575090565b91505090565b9050155f61d35f565b505091505090565b50841561d353565b8161d3a59193929361e171565b9384670de0b6b3a764000003670de0b6b3a7640000811161140b578094670de0b6b3a7640000858084029384041488821417021561b1385761d40061d3fa8286670de0b6b3a76400006162e39604988b61e1af565b8661609b565b9361609b565b9190821561d471576020810151905161d42b916001600160801b03918216911661609b565b676765c793fa10079d601b1b81101561d47157676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b5761d46a6162e3918461d479565b92836161aa565b505f91508190565b8181029181159183041417676765c793fa10079d601b1b021561b13857676765c793fa10079d601b1b808204910615150190565b60408051630eaf323560e31b815290816004815f6110005af19081156122ee575f9161d4d7575090565b61649e915060403d6040116122e7576122d88183615adc565b602081015190516001600160801b039161d50e918316908316615f93565b1690565b9190603a549061d520615c08565b9361d54a61d53f4761d530615c2e565b61d538615cc5565b908961aa81565b9547906123b6615be2565b6001841461d670575b61d569670de0b6b3a764000061897386896161db565b916001600160801b038084169190851682111561d64357505061d58b90617c88565b9261d5968484615f93565b6001600160801b038381169116101561d63457505061d5cb9161d5b891615f93565b926168746001600160801b0385166161b7565b80670de0b6b3a764000010670de0b6b3a764000082180280821890612710820291820461271014908314171561140b57670de0b6b3a7640000900462010000811015614a4d576012805461ffff60401b191660409290921b61ffff60401b169190911790559190565b92509350506001603a5561d5cb565b6001600160801b0381169795909450915086111561d6345750509061687461d66b92946161b7565b61d5cb565b925061d67a617fb7565b9261d691866168746001600160801b0386166161b7565b655af3107a4000810180821161140b5785111561d6b2575083603a5561d553565b655af3107a4000850180861161140b57101561d6d15783603a5561d553565b505092509190565b60085f196001600160401b03601254160860088110156100f2576020015460601c60ff16615f915760085f196001600160401b03601254160860088110156100f2576001600160401b039060200154167f41c24504ba2202296404fa24c296cf07c5e04142af4b7f225cd1d38e50bcded16002600160401b0391825f52603160205261d77860405f2060085f6001600160401b03601254160890616a50565b5060018060781b0390541690835f52603160205261d7ca61d7ac60405f2060085f6001600160401b03601254160890616a50565b505460405193849360789290921c6001600160781b0316918461b44e565b0390a1805f52603060205261d7f561111e60405f2060085f6001600160401b03601254160890616a50565b61d8cb6001600160401b03601254169160ff602082015116604082015161db7f575b845f52603060205261d83c60405f2060085f6001600160401b03601254160890616a50565b508054600160781b600160f81b03191690555f85815260316020526040902060125461d87c9161a012916008906002906001600160401b03160890616a50565b845f52603260205261d8a561a01260405f20600860026001600160401b03601254160890616a50565b845f52603060205261bc3160405f20600860016001600160401b03601254160890616a50565b815f52603360205260ff60405f205460801c165f1461d948575f82815260336020526040902080546001600160401b0319166001600160401b0392909216919091179081905560901c60ff16158061d92e575b61d9255750565b615f9190618512565b50805f52603360205260ff60405f205460881c161561d91e565b815f5260336020526001600160401b0360405f205416906007820180921161140b57101561d9735750565b805f52600f60205260ff60405f205416156185d9575f8181526033602052604090205460801c60ff1661bfde576001600160401b0360125416815f5260336020526001600160401b0360405f205416906007820180921161140b571061bfcf57805f52603060205261d9f860405f2060085f6001600160401b03601254160890616a50565b5080546001600160401b03191690555f818152600f60209081526040808320805460ff1916905560349091529020546001600160a01b03168061db44575b50805f5260336020525f6040812055805f5260366020526001600160401b0360405f205416815f5260376020526001600160401b0360405f20541690815f52603660205260405f206001600160401b0382166001600160401b03198254161790555f5260376020526001600160401b0360405f2091166001600160401b03198254161790555f5b6008811061daf3575060207f12048e179cb277774d73abb2f522205e0fcd471ab52fa6feb7b5b5508dd26a2191604051908152a1565b600190825f52603060205261db0e61bf588260405f20616a50565b825f52603160205261db2661bf588260405f20616a50565b825f52603260205261db3e61bf588260405f20616a50565b0161dabd565b5f90815260356020908152604080832080546001600160401b03191690558383526034909152812080546001600160a01b031916905561da36565b60010160ff168061d8175750600161d817565b6001600160a01b0390911681526001600160401b039190911660208201526001600160781b03909116604082015260608101919091526001608082015260a00190565b909493926001600160401b0360609381608085019816845216602083015260408201520152565b61dc058161f182565b835460781c6001600160801b031692909161dc20838261609b565b935f945f5f916003195b5f811261e016575083810361dfa5575b5081810361df5c575b505083850361df15575b80841161decb5761dc5e84826161aa565b9282840361dc70575b50505050505050565b7f2471537e67bdd740cfb2bcc98c6c751404193debd0d9bbbcc1fc13f759fb2885906001600160401b03601254169061dcb085876040519485948561dbd5565b0390a18282111561dd6857509061dcc6916161aa565b9181811161dd32575b505061dcdd61dcfa91617c88565b9161dcf48360018060801b03835460781c16615f93565b9061cedd565b601354906001600160801b039061dd1390828416615f93565b6001600160801b03199092169116176013555b5f80808080808061dc67565b9061dd3c916161aa565b8082111561dd5a5761dd5461dcdd9161dcfa936161aa565b9161dccf565b505061dcfa61dcdd5f61dd54565b93919061dd74916161aa565b9181811161dea1575b505090670de0b6b3a76400008202828104670de0b6b3a7640000148315171561140b5761dda8616a93565b9066f8b0a10e47000082029180830466f8b0a10e470000149015171561140b571161de40575b8082111561de325761dde661ddeb9161de02936161aa565b617c88565b9161dcf48360018060801b03835460781c16616396565b601354906001600160801b039061de1b90828416616396565b6001600160801b031990921691161760135561dd26565b505061de0261ddeb5f617c88565b60085f6001600160401b03601254160860088110156100f257602001805460ff60681b1916600160681b1790556012546008905f906001600160401b03160860088110156100f257602001805460ff60701b1916600160701b17905561ddce565b9061deab916161aa565b8082111561dec35761debc916161aa565b5f8061dd7d565b50505f61debc565b90507ff8d9ad0cb8736113b136bbb4ef5911eada2ff3b9ce6571ef950261d2a31c817c945061df10919293506001600160401b0360125416936040519485948561dbd5565b0390a1565b7f58ae497b74652562674e50a5d0e1c848c89ac2eb353cf6d77a04aa109f0f5b0c856001600160401b036012541661df5487604051938493898561dbd5565b0390a161dc4d565b7f7b176f9ffcd617c7f68039e7926487ef362dd8a890f9a0f772aa1cba1f6100909161df9b6001600160401b036012541691604051938493898561dbd5565b0390a15f8061dc43565b6101007f42dcd2f1dad9ae3656703a35f73b789a9023e7da8ffdc147fa0778eedd524dac916001600160401b036012541690604051916001600160401b038a168352602083015286604083015260608201528360808201528460a08201528960c08201528860e0820152a15f61dc3a565b6001600160401b038716805f52603060205261e04560405f206008846001600160401b03601254160890616a50565b50905f52603260205261e06b60405f206008846001600160401b03601254160890616a50565b5090805460ff8160481c1661e0b3575b505460501c60ff1661e091575b5060010161dc2a565b54909860019161e0ac916001600160781b039091169061609b565b989061e088565b9460ff9196612f628361e0d661e0e19460018060781b03885460781c169061609b565b9860401c168c61f25c565b959061e07b565b909291606060018060801b036101008601511694015161e144575b5060608101511515908161e136575b5061e11b575090565b516001600160781b03168082111561636c576162e3916161aa565b60809150015115155f61e112565b519092906001600160781b03168082111561e1695761e162916161aa565b915f61e103565b50505f61e162565b811561636c5781670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b1385704670de0b6b3a7640000811061635057505f90565b9192909282670de0b6b3a76400001180159061e20c575b6164e55761e1fb61e2029161e1f58561e1ef670de0b6b3a764000061e20898810392018261f358565b9261f358565b9361f38b565b918461f3d3565b9261f47f565b0190565b50831561e1c6565b93919380821180159061e243575b6164dc5761e2089361e1f58261e1ef8561e1fb9561e202970392018261f358565b50841561e222565b949593909291928515801561e538575b61aeac5781676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b57818802881591670de0b6b3a7640000848b8404148417021561e4c857670de0b6b3a764000061e2af92049061609b565b90676765c793fa10079d601c1b890290898204676765c793fa10079d601c1b14171561140b578461e2f08a92612f628361e2e987806161db565b928d61f53f565b8060018060881b031060071b81811c68ffffffffffffffffff1060061b1781811c64ffffffffff1060051b1781811c62ffffff1060041b1760b56201000083831c019160011c1b0260121c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c808092041090038381115f1461e4be5761e38e9361e389916161aa565b61f53f565b83670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b1385783900494878786881161e4b4575b8185849261b12c61e3dc95838b61e3d68f8c61609b565b8b61e214565b9761e3e789896161aa565b85670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b138578588910487811161e4ad575b1461e49b578587101561e4a6576001870180881161140b57965b871461e49b57838861b12c8361e45c97898861e44f8e61e4559b61609b565b9061e214565b80956161aa565b81670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b13857049080821161e493575b501461649e575090565b90505f61e489565b505050505050505090565b859661e430565b508661e416565b959650869561e3bf565b505050505f61e38e565b5f19848b098281108301900391670de0b6b3a7640000858c0983670de0b6b3a7640000111561e52b5761e2af93828211900360ee1b910360121c177faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669029061609b565b63ae47f7025f526004601cfd5b50831561e25b565b60405163a76e2ca560e01b81526001600160401b03909116600482015247906020816024815f611000620285fff15f918161e5a2575b5061e5835750505f905f90565b15618349576001600160781b039061e59b90476161aa565b1690600190565b9091506020813d60201161e5d6575b8161e5be60209383615adc565b810103126107175761e5cf906166dd565b905f61e576565b3d915061e5b1565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e6a8575b5061a6f757805f52603360205260ff60405f205460881c1661e68b575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260016060820152a1565b5f818152603360205260409020805460ff60881b1916905561e620565b61e6b2915061f5c5565b5f61e603565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e782575b5061a6f757805f52603360205260ff60405f205460881c1661e765575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260036060820152a1565b5f818152603360205260409020805460ff60881b1916905561e6fa565b61e78c915061f5c5565b5f61e6dd565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e85c575b5061a6f757805f52603360205260ff60405f205460881c1661e83f575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260056060820152a1565b5f818152603360205260409020805460ff60881b1916905561e7d4565b61e866915061f5c5565b5f61e7b7565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e936575b5061a6f757805f52603360205260ff60405f205460881c1661e919575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260046060820152a1565b5f818152603360205260409020805460ff60881b1916905561e8ae565b61e940915061f5c5565b5f61e891565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161ea10575b5061a6f757805f52603360205260ff60405f205460881c1661e9f3575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260026060820152a1565b5f818152603360205260409020805460ff60881b1916905561e988565b61ea1a915061f5c5565b5f61e96b565b6012549061ffff8260601c16915f928061eabb575b50506001600160401b03165f52603160205261ea8161ea6760405f2060085f6001600160401b03601254160890616a50565b5080546108e290859060781c6001600160781b0316616a37565b60085f6001600160401b0360125416089160088310156100f257610b2b61b021936028016108e28360018060781b03835460781c16616a37565b6001600160401b03929493509061eae361271061080b61eb459460018060781b0388166161db565b9384916001600160781b038316906001600160801b031961eb0883608084901c615f93565b60801b169060018060801b0316176012555f516020620108665f395f51905f525f52603860205261eb3e60405f2091825461609b565b90556180ae565b92905f61ea35565b6001600160401b0381165f818152603460205260409081902054845493956001600160a01b039190911694929390914760801b91901c60ff16600361eb9592175f5d8661f640565b5f809893985d1561ec2f575050815460ff60581b1916600160581b1782557fb14d34e3f01e35c636d112b22d3e449b260a635d2f19065f7a70b35408cfec419460c094939290916001600160401b039060ff61ebef6185e8565b9160018060781b03905460781c16935460401c16946040519687526020870152166040850152606084015260018060801b0316608083015260a0820152a1565b919590911561ef18576001600160801b03169461ec4b8661aa69565b81546014546001600160781b0380841696607893841c82169493909291600160781b600160f01b039161ec8391879185901c166180ae565b60781b16600160781b600160f01b031991909116176014556013546001600160801b0361ecb285828416616396565b6001600160801b0319909216911617601355805460ff60481b191690555f8286111561eea157509261eceb61ed09939261ed04956180ae565b9384926108e28460018060781b03835460781c16616a37565b61ea20565b61ed2460135460801c9161ed1e61882b615c2e565b936180ae565b918181111561ee4f579061ed37916161aa565b6001600160781b03909116908181111561eda857506013545f516020620108265f395f51905f52946080949390929091906001600160801b03199061ed7e9083881c615f93565b861b1690600180871b0316176013555b6040519283526020830152604082015260016060820152a1565b8061edee9261edbc61819193969596617c88565b601354906001600160801b03199061edd890608084901c615f93565b60801b169060018060801b0316176013556161aa565b9260085f6001600160401b0360125416089260088410156100f257601890930180545f516020620108265f395f51905f529560809592916001600160781b039161ee39918316616a37565b82546001600160781b031916911617905561ed8e565b5050925f9291925060085f6001600160401b0360125416089260088410156100f257601890930180545f516020620108265f395f51905f529560809592916001600160781b039161ee39918316616a37565b9350919080851061eeb5575b50505061ed09565b61eefc6060926108e261eee97f10b27955d681bde31e3b4e54b99801ec698755593c816338ff939b226543996196856180ae565b825460781c6001600160781b03166180ae565b60405190815284602082015260016040820152a15f808061eead565b91505f516020620108265f395f51905f5294509161ef386080949361e946565b6040519283526020830152600180841b0316604082015260026060820152a1565b805460ff60501b1916905554601454906001600160781b039061ef809082168383166180ae565b6001600160781b0319909216911617601455565b6001600160401b0316805f52603160205261efc360405f2060085f196001600160401b03601254160890616a50565b5080546001600160781b039061efdc90859083166180ae565b82546001600160781b03191691161790555f90815260316020526040812060125461f014926008916001600160401b03160890616a50565b50805490916001600160781b039161b05691908316616a37565b6001600160801b03909116919047831161f0eb575b670de0b6b3a7640000831061f0e2576001600160401b036040519163e4b3303b60e01b83521660048201526020816024818661100062011a6cf15f918161f0a6575b5061f09257505f91508190565b1561805b576001916001600160781b031690565b9091506020813d60201161f0da575b8161f0c260209383615adc565b810103126107175761f0d3906166dd565b905f61f085565b3d915061f0b5565b50600191505f90565b47925061f043565b6013546001600160801b031961f10d83608084901c616396565b60801b166001600160801b03918216176013556015549161f13090838316616396565b6001600160801b0319909216911617601555565b908160e0910312610717578051916020820151916040810151916060820151916080810151916162e360c061f17b60a085016166c9565b93016166c9565b9060e061f1a592604051809481926302b9e0e760e51b8352309060048401615e46565b03815f6110005af15f92815f915f9361f1d2575b5061f1c857505090505f905f90565b906162e39161609b565b9150935061f1f8915060e03d60e01161f209575b61f1f08183615adc565b81019061f144565b50509250949290509390915f61f1b9565b503d61f1e6565b90816060910312610717578051916162e36040602084015193016166c9565b6001600160401b0390911681526001600160a01b03909116602082015260ff909116604082015260600190565b6040516356fa204560e01b8152916060918391829161f281919030906004850161f22f565b03815f6110005af15f918161f29b575b506162e357505f90565b61f2be91925060603d60601161f2c7575b61f2b68183615adc565b81019061f210565b5050905f61f291565b503d61f2ac565b6001600160a01b0390911681526001600160401b039190911660208201526001600160801b0390911660408201525f606082015260800190565b6001600160a01b0390911681526001600160401b039182166020820152911660408201526001600160801b0390911660608201525f608082015290151560a082015290151560c082015260e00190565b8181029180828404148215171561f36e57505090565b5f19818309838110840190036001111561e52b5760019109900390565b81810291808284041482151760011b1561f3a757505060011c90565b6002905f1981840984811085019003920991816002111561e52b5782810360011c9211900360ff1b1790565b818102919080158184048314176d0166bb7f0435c9e717bb45005915602d1b021561f4115750506d0166bb7f0435c9e717bb45005915602d1b900490565b5f1982820983811084019003916d0166bb7f0435c9e717bb45005915602d1b9109906d0166bb7f0435c9e717bb45005915602d1b81101561e52b57828211900360d31b9103602d1c177f2317a2bfdeca19a88834dd8480ca8e949e91c793146c3f24abeded8b1b852e3d0290565b818102919080158184048314177204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b021561f4c75750507204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b900490565b5f1982820983811084019003917204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b9109907204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b81101561e52b57828211900360c11b9103603f1c177f66c69bc441c22d29d78d9308a8d629e0f05f1077752054f6ca59becfd6b265050290565b8181029291811582850482141783021561f55a575050900490565b82905f1981840985811086019003920990825f038316928181111561e52b5783900480600302600218808202600203028082026002030280820260020302808202600203028082026002030280910260020302936001848483030494805f0304019211900302170290565b6001600160401b038116906002600160401b03821461f63957816001600160401b0360015c160361f5fe57505060ff60015c60401c1690565b61f6079061ce39565b906001600160401b031960015c161760015d60ff60401b196001805c9190911682151560401b60ff60401b1617905d90565b5050600190565b5f91479160405163aed2ee7360e01b81526001600160401b038216600482015260ff831660248201526020816044815f61100062013353f15f918161f7aa575b5061f70b57506040516356fa204560e01b815292506060918391829161f6ab9130906004850161f22f565b03815f6110006185fcf15f918161f6e8575b5061f6ca57505f915f9190565b8061f6df575b61f6d990617c88565b915f9190565b6001915061f6d0565b61f70291925060603d60601161f2c75761f2b68183615adc565b5050905f61f6bd565b1561f72657505061dde661f71f91476161aa565b9160019190565b6040516356fa204560e01b815292506060918391829161f74b9130906004850161f22f565b03815f6110006185fcf15f918161f787575b5061f76a57505f915f9190565b8061f77e575b61f77990617c88565b61f6d9565b6001915061f770565b61f7a191925060603d60601161f2c75761f2b68183615adc565b5050905f61f75d565b9091506020813d60201161f7de575b8161f7c660209383615adc565b810103126107175761f7d7906166dd565b905f61f680565b3d915061f7b9565b9091906001600160801b0383169047821161f89b57633b9aca0082111561f890576001600160401b036024602092604051948593849263212653fb60e21b845216600483015261100062042202f15f918161f854575b5061f84957505f91508190565b1561805b5760019190565b9091506020813d60201161f888575b8161f87060209383615adc565b810103126107175761f881906166dd565b905f61f83c565b3d915061f863565b505090506001905f90565b634e487b7160e01b5f52600160045260245ffd5b91604091949360ff916001600160401b036060860197168552602085015216910152565b60405163173d054560e21b81526001600160801b0383169392906020818061f9008789886004850161f8af565b03815f61100062026836f15f918161fa4a575b5061fa395750506040516302b9e0e760e51b81529260e0848061f93a308660048401615e46565b03815f6110006202f954f15f948161fa12575b5061f95d575b505050505f905f90565b831561fa075783101561f9ff578260209161f98c604051948593849363173d054560e21b85526004850161f8af565b03815f61100062026836f15f918161f9c3575b5061f9b05750505b5f80808061f953565b156183495761f9be90617c88565b600191565b9091506020813d60201161f9f7575b8161f9df60209383615adc565b810103126107175761f9f0906166dd565b905f61f99f565b3d915061f9d2565b50505061f9a7565b505050506001905f90565b61fa2c91955060e03d60e01161f2095761f1f08183615adc565b505050505050935f61f94d565b9250939250501561805b5760019190565b9091506020813d60201161fa7e575b8161fa6660209383615adc565b810103126107175761fa77906166dd565b905f61f913565b3d915061fa5956fe610100806040523461027457602081610cff80380380916100208285610321565b8339810103126102745761003390610344565b60808190523360a0523060e0526040516315b6b1cd60e11b81526001600160401b0390911660048201819052905f9081908181602481836110006201a2c0f15f815f935f9361028b575b506101ee575b5050506001600160a01b0381169283156101dc575060c0526c010000000000000000000000008110156101cf576040805190810192906001600160401b038411818510176101bb5760409384528181526001600160601b03831660209182015260a083901b6001600160a01b03191682175f9081558451908152908101929092527f2c40de6ec45500fc9fc0e3b8f163c1cacefcd0e5744039e3ed1259551fb98e5b92917fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d908390a18151905f82526020820152a160405161095190816103ae82396080518181816101870152818161024f0152610309015260a05181818160a80152610112015260c0518181816101c0015281816102cc015281816105300152610647015260e05181818161020e01526106020152f35b634e487b7160e01b5f52604160045260245ffd5b6335278d125f526004601cfd5b6319708e7160e01b5f5260045260245ffd5b60408051630eaf323560e31b815291955091935090816004815f6110005af1908115610280575f91610233575b501561022c57505b905f8080610083565b9050610223565b90506040813d604011610278575b8161024e60409383610321565b810103126102745780610262602092610344565b5001518015158103610274575f61021b565b5f80fd5b3d9150610241565b6040513d5f823e3d90fd5b93509150503d805f843e61029f8184610321565b820191610180818403126102745780516001600160a01b0381168103610274576102cb60208301610344565b5060e0820151916101208101519461014082015160018060401b03811161027457816102f8918401610358565b506101608201516001600160401b038111610274576103179201610358565b509092915f61007d565b601f909101601f19168101906001600160401b038211908210176101bb57604052565b51906001600160401b038216820361027457565b81601f82011215610274578051906001600160401b0382116101bb576040519261038c601f8401601f191660200185610321565b8284526020838301011161027457815f9260208093018386015e830101529056fe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c8062fa3d501461063157806326bd0c4e146105ed5780633e4eb36c146105ce5780633f3b061a146105155780636f7cbce4146102ba57806379e164ab146101ef5780637c359fe0146101ab5780637f4e7d7b146101685780639b29673414610141578063ae61ebe9146100fd5763c33fb8770361000e57346100f9575f3660031901126100f9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036100ea5760206100e0610718565b6040519015158152f35b63688065ed60e01b5f5260045ffd5b5f80fd5b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f9575f3660031901126100f9575f546040516001600160a01b039091168152602090f35b346100f9575f3660031901126100f95760206040516001600160401b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f95760603660031901126100f9576102086106cd565b602435907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102ab5760019180610298575b50506102736044357f000000000000000000000000000000000000000000000000000000000000000061089d565b81610290575b501561028157005b633c3b699360e01b5f5260045ffd5b905081610279565b5f8093508091389361c350f18180610245565b632388e24d60e21b5f5260045ffd5b346100f9575f3660031901126100f9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610506576040516315b6b1cd60e11b81527f00000000000000000000000000000000000000000000000000000000000000006001600160401b0316600482018190525f9182908181602481836110006201a2c0f15f815f935f9361046f575b506103d8575b5050506001600160a01b0316156103c6575f547fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d90604090846001600160a01b03196103a682610802565b60a01b1660018060a01b038316175f5582519160a01c82526020820152a1005b6319708e7160e01b5f5260045260245ffd5b60408051630eaf323560e31b815291965091935090816004815f6110005af1908115610464575f9161041d575b501561041657505b9183808061035b565b905061040d565b90506040813d60401161045c575b81610438604093836106e3565b810103126100f95760208161044f61045693610827565b5001610890565b85610405565b3d915061042b565b6040513d5f823e3d90fd5b93509150503d805f843e61048381846106e3565b820191610180818403126100f95780516001600160a01b03811681036100f9576104af60208301610827565b5060e082015191610120810151946101408201516001600160401b0381116100f957816104dd91840161083b565b506101608201516001600160401b0381116100f9576104fc920161083b565b5090929187610355565b639bfdc6ff60e01b5f5260045ffd5b346100f95760203660031901126100f95761052e6106cd565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610506576001600160a01b031680156105bf575f80546001600160a01b031981168317909155604080516001600160a01b03909216825260208201929092527f2c40de6ec45500fc9fc0e3b8f163c1cacefcd0e5744039e3ed1259551fb98e5b9190a1005b636c38382960e11b5f5260045ffd5b346100f9575f3660031901126100f95760205f5460a01c604051908152f35b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f95760203660031901126100f9576004357f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361050657670de0b6b3a764000081116106be575f547fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d91604091906001600160a01b03196103a682610802565b63047f2a9760e51b5f5260045ffd5b600435906001600160a01b03821682036100f957565b90601f801991011681019081106001600160401b0382111761070457604052565b634e487b7160e01b5f52604160045260245ffd5b5f604051604081018181106001600160401b03821117610704576040525f546001600160a01b038116825260a01c6020820181905247908181029082820414821517156107ee57670de0b6b3a76400009004918282039182116107ee57670de0b6b3a764000082106107e657516001600160a01b031691303b156100f957604051926379e164ab60e01b84526004840152602483015260448201525f8160648183305af190816107d1575b506107cb5790565b50600190565b6107de9192505f906106e3565b5f905f6107c3565b505050505f90565b634e487b7160e01b5f52601160045260245ffd5b600160601b81101561081a576001600160601b031690565b6335278d125f526004601cfd5b51906001600160401b03821682036100f957565b81601f820112156100f9578051906001600160401b038211610704576040519261086f601f8401601f1916602001856106e3565b828452602083830101116100f957815f9260208093018386015e8301015290565b519081151582036100f957565b6001600160401b036024602092604051948593849263e4b3303b60e01b845216600483015261100062011a6cf15f91816108df575b506108dc57505f90565b90565b9091506020813d602011610913575b816108fb602093836106e3565b810103126100f95761090c90610890565b905f6108d2565b3d91506108ee56fea26469706673582212205d20ca8657067f4f35639a44f2725d7f5b6b63c601ce6d3f8654f7806f7019d364736f6c634300081e0033a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1029016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10089114bbe8661c66ec567dd1105361c83d5d102e74f6b3bb3e115dd39b99f71d2138acd4a6f6a69f593727b355a4a6d444f7c335d73a842bb4db80a9c92500df26c93063a8ffa43126e459aec3984dbaab55ba679b920f6a0bfeedd6e39d046c90000000000000000000000001111111111111111111111111111111111111111ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6a4eb97f843610559cec0ec79705b42ba8a897218d27d661a1fd4dfc41b289449b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00c62b7381c171b44f590d8492ab66f5b7e15a2bd57657d9afef29a6a0021dd898f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00d9f18d9a4aeabe46c8d05191d465049ab6fd5191958d9d36d92e1950de7f141da16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101dcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7a2646970667358221220f5bee3fdc0395cd6ac4998db7de5cbae77c2dbb40f518c13469fc2ea8ee2e27064736f6c634300081e0033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00
Deployed Bytecode
0x60806040526004361015610106575b3615610018575f80fd5b5f5c60ff81169061002882616a19565b61003182616a19565b8115610083575b61004f90349060081c6001600160781b031661609b565b6001600160781b038111610074574760801b9061006b83616a19565b60081b17175f5d005b63daccb93d60e01b5f5260045ffd5b47610091348360801c61609b565b116100385761009f3461aa69565b9060085f6001600160401b0360125416089160088310156100f2576018909201805461004f936001600160781b03916100da91908316616a37565b82546001600160781b03191691161790559050610038565b634e487b7160e01b5f52603260045260245ffd5b5f3560e01c8062601aaf1461577357806301b3bfa41461572057806301e1d1141461570357806306fdde03146156d4578063071c36261461567257806307a2d13a14612a8657806308cd7fad14615653578063095ea7b31461562d5780630a28a4771461560c5780630b4c71411461555b5780630cb9f3ad1461553f5780630e1e8f7d146155025780630fb6215a146154ea57806313788fe51461527957806318160ddd146107905780631884fbda146152555780631d07c5cf1461521d5780632309572114614ecc57806323b872dd14614e9457806329067fef14614d9f57806329bb317c14614d795780632a743e0a14614d595780632c45d5dc14614cdd5780632d6d6b9714614c39578063313ce56714614c1e578063321677f214614b205780633644e51514614b06578063365520db14614adb5780633664f7af14614aa557806337deea7014614a8857806338d52e0f14614a5a5780633bbc81d114614a06578063402d267d1461141f578063402f1cd4146147d8578063417b7e51146147ab57806341faf0a71461476b578063421c885d1461471e578063424567eb146146de57806344390e2f146146c4578063462fff96146146585780634cac8783146145bb5780634cdad5061461459a5780634d28a646146144dc5780634dc4993a146142ca5780634e4ed7fc1461413d5780634f8da2a7146140215780635357a13614613d1e57806355e6912414613c5c578063584e378514613c0c578063602f41d114613be457806363803b23146139cb578063647a47721461399057806364a6c194146139245780636653bd411461389557806367070c951461377957806367f6007c146137055780636a610788146136de5780636c91b1011461364e5780636d20d833146135f65780636d738773146135525780636e553f65146135315780636ec52fed1461351757806370a08231146134d7578063715018a61461346f57806373e45bae146132b657806374662009146130915780637710d4ff1461307757806379251e7e146130225780637bca512614612f9b5780637d05b18e14612ecc5780637ecebe0014612e765780637fbee51514612e30578063822c6d6d14612db957806384aae4c914612d5c57806384b0196e14612c365780638b5f6d5214612c1c5780638d01c5c814612ae95780638da5cb5b14612ab45780638f28954414612a8b5780639176755214612a865780639292430b1461296b578063934c85d71461292d57806394bf804d1461283f57806395d89b41146127f857806397c76115146127c45780639a292225146127aa5780639a7a039b1461276b5780639b5e7cf2146125c45780639c16a9e8146125505780639e1844c6146125135780639e6cb0bf146124b15780639eaeb31a1461245f5780639fc758e1146123bc578063a250f8251461238f578063a60232ad1461232a578063a9059cbb146122f9578063a9fd1a8f14612270578063aba9598b146121ee578063aeefe59d1461212e578063aff94332146120d2578063b3d7f6b914612085578063b460af941461206c578063b59654701461201d578063ba08765214612004578063ba749daf14611fc6578063ba7c0e4014611e53578063bc3ec4c214611c41578063be1d8e1c14611bf4578063bf39ed9314611b98578063bfece887146119be578063c2006eaa14611961578063c4d66de814611424578063c63d75b61461141f578063c6e6f592146113bd578063c84fef9f1461137c578063c8a505f014611362578063cbd2d52214611312578063cc34b8f6146112f2578063cc56a82a1461123c578063ce96cb771461121e578063d3b9fd7214611041578063d505accf14610e6f578063d5dc7f7514610cd6578063d813f07414610cbc578063d905777e14610c88578063da92ea0d14610c5c578063db8a582b14610c2b578063dd62ed3e14610bdb578063de54d42914610bb6578063df19afcf14610b8e578063e5cdc7c7146107c7578063e65f808714610795578063ef356a7914610790578063ef8b30f71461076a578063f062f3861461073d578063f08814421461071b5763f2fde38b0361000e57346107175760203660031901126107175761071561070861583e565b610710616a5f565b6169a7565b005b5f80fd5b346107175761071561072c366159c9565b916107368161862f565b339061993f565b3461071757602036600319011261071757602061076061075b6157e6565b61690d565b6040519015158152f35b34610717576020366003190112610717576020610788600435617157565b604051908152f35b615880565b34610717575f3660031901126107175760806107af6168ba565b91604051938452602084015260408301526060820152f35b6040366003190112610717576107db6157e6565b6024356107e661707d565b670de0b6b3a76400008111610b7c57670de0b6b3a764000061080b61081192346161db565b0461aa69565b61083c61083561271061080b61ffff60125460701c1660018060781b0386166161db565b80926180ae565b916108538261084e8561084e3461aa69565b6180ae565b61085c82617e53565b6040810151159081610b6e575b5015610ab5576001600160401b0382165f5260316020526108e86108a060405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b03906108b99085908316616a37565b82546001600160781b0319169116178082556108e290879060781c6001600160781b0316616a37565b90617cbc565b60085f6001600160401b03601254160860088110156100f257602801805461092291906108e290879060781c6001600160781b0316616a37565b6015546001600160781b038216906001600160801b0361094483828416615f93565b166001600160801b031991821617601555601254906109706001600160781b038716608084901c615f93565b6001600160801b03909216608092831b9190911617601255601354916001600160801b0319916109a3919084901c615f93565b60801b169060018060801b0316176013555b5f516020620108665f395f51905f525f5260386020525f516020620109265f395f51905f5280546109f0906001600160781b0386169061609b565b90556109fc8385616a37565b9260085f6001600160401b0360125416089060088210156100f257601890910180547fa00ba9b9fddae2429c7131955af6dd8add3137d90ca8d1145d773f79cb484dd296608096610a74949391926001600160781b0391610a5e918316616a37565b82546001600160781b0319169116179055616a37565b604080513381526001600160401b039490941660208501526001600160781b0392831690840152166060820152a15f5f516020620108c65f395f51905f525d005b610b3091936002600160401b035f526031602052610b2b610ae960405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b0390610b029086908316616a37565b82546001600160781b0319169116178082556108e290849060781c6001600160781b0316616a37565b616a37565b6012549092905f906001600160801b0319610b586001600160781b038616608084901c615f93565b60801b169060018060801b0316176012556109b5565b608091500151151585610869565b6336e6824b60e21b5f5260045260245ffd5b34610717575f366003190112610717576011546040516001600160801b039091168152602090f35b34610717575f3660031901126107175760206001600160401b035f5416604051908152f35b3461071757604036600319011261071757610bf461583e565b610bfc615854565b6001600160a01b039182165f908152600460209081526040808320949093168252928352819020549051908152f35b34610717575f36600319011261071757601154604080516001600160801b038316815260809290921c602083015290f35b34610717576040366003190112610717576020610788610c7a6157e6565b610c82615854565b90618311565b34610717576020366003190112610717576020610788610cb6610cb1610cac61583e565b616879565b61832e565b50617114565b34610717575f3660031901126107175760206107886168aa565b34610717575f36600319011261071757603954610cf281615afd565b610cff6040519182615adc565b818152610d0b82615afd565b6020820190601f1901368237610d2083615afd565b610d2d6040519182615adc565b838152601f19610d3c85615afd565b01366020830137670f6b75ab2bc471c75f5260366020526001600160401b0360405f205416916001600160401b035f935b16678ac7230489e7ffff81141580610e66575b15610e0c576002600160401b038103610daf575b5f5260366020526001600160401b038060405f205416610d6d565b80151580610df3575b15610d9457928084610dcc60019388616825565b52845f526034602052818060a01b0360405f205416610deb8286616825565b520192610d94565b50805f52603360205260ff60405f205460801c16610db8565b50838260405191604083019060408452518091526060830193905f5b818110610e47578480610e4388878382036020850152615a03565b0390f35b82516001600160401b0316865260209586019590920191600101610e28565b50858410610d80565b346107175760e036600319011261071757610e8861583e565b610e90615854565b604435906064359260843560ff811681036107175760a43560c4359186421161102e57604260018060a01b03851697885f527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb0060205260405f20908154916001830190556040519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c984528b604084015260018060a01b038a1660608401528a608084015260a083015260c082015260c08152610f5360e082615adc565b519020610f5e61ac6f565b906040519161190160f01b8352600283015260228201522090610f8f610f868585848661d02f565b9092919261d0a7565b6001600160a01b031693888503610fac575b61071588888861ac0c565b85949796953b1561101757610ff19495969750604051936020850152604084015260ff60f81b9060f81b16606083015260418252610feb606183615adc565b8361a97b565b15611000578380808080610fa1565b836325c0072360e11b5f525f60045260245260445ffd5b88886325c0072360e11b5f5260045260245260445ffd5b8663313c898160e11b5f5260045260245ffd5b346107175760203660031901126107175761105a6157e6565b6040516101008101918183106001600160401b0384111761120a57610100926040525f8252602082015f8152604083015f8152606084015f815260808501905f82526001600160401b0360a08701935f855260c08801955f875260e08901975f8952838116805f5260346020526110fc60018060a01b0360405f20541692825f52603360205260ff60405f205460801c16158d811580915290611201576166a5565b805f52603060205261112461111e60405f2060085f1989601254160890616a50565b50615d30565b815f52603160205261114c61114660405f2060085f198a601254160890616a50565b50615b4b565b915f52603160205261116d61114660405f2060085f8a601254160890616a50565b9284528051861685528c01516001600160801b03908116875281516001600160781b03908116895260209283015181168a52835181168b52928201519092168a52604080519b5115158c5292516001600160a01b0316908b01529151909216918801919091529051811660608701529051811660808601529051811660a08501529051811660c084015290511660e0820152f35b508315156166a5565b634e487b7160e01b5f52604160045260245ffd5b34610717576020366003190112610717576020610788610cac61583e565b346107175761071561124d366159c9565b916001600160401b038116805f52600960205260405f206112a9836040519261127584615a6f565b549265ffffffffffff84168152604060ff8560301c16151591826020820152019360018060a01b039060381c168452615e22565b516001600160a01b031633036112c0575b506170b4565b5f52600a60205260405f2060018060a01b0333165f526020526112ec60405f208260ff33925416615e69565b846112ba565b34610717575f366003190112610717576020600d5460801c604051908152f35b346107175760203660031901126107175761132e600435616aca565b6113378161a95a565b90610e4361134583836161aa565b604051938493846040919493926060820195825260208201520152565b34610717575f366003190112610717576020610788616839565b34610717576020366003190112610717576001600160a01b0361139d61583e565b165f52603560205260206001600160401b0360405f205416604051908152f35b34610717576020366003190112610717576113d86001616ab7565b600d546001600160801b0316600181019190821061140b576001810180911161140b575f6107889160209360043561abc3565b634e487b7160e01b5f52601160045260245ffd5b6158a8565b346107175760203660031901126107175761143d61583e565b5f516020620109065f395f51905f525460ff8160401c1690811561194c575b5061193d575f516020620109065f395f51905f52805468ffffffffffffffffff19166801000000000000000a1790557fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0316330361192e576114c4615b9c565b9060409081516114d48382615adc565b60018152603360f81b60208201526114ea61cfdb565b6114f261cfdb565b83516001600160401b03811161120a5761151a5f516020620107865f395f51905f5254618350565b601f81116118be575b50602094601f8211600114611841579481929394955f92611836575b50508160011b915f199060031b1c1916175f516020620107865f395f51905f52555b8051906001600160401b03821161120a5761158a5f516020620107c65f395f51905f5254618350565b601f81116117c6575b50602090601f831160011461171f5792827fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29593611629936020965f92611714575b50508160011b915f199060031b1c1916175f516020620107c65f395f51905f52555b5f5f516020620107e65f395f51905f52555f5f516020620109465f395f51905f525561162161cfdb565b61071061cfdb565b611631615c54565b80516001600160801b03161590816116ff575b5061167c575b61165261cfdb565b61165a61a460565b5f516020620109065f395f51905f52805460ff60401b1916905551600a8152a1005b6116ac815161168a81615a8a565b6a084595161401484a0000008152690a968163f0a57b40000084820152615f14565b7f17295cc579d48cf6a42ae45a4e3c7791f30633c7d1defa248133a238f41b580e608082515f81525f858201526a084595161401484a00000084820152690a968163f0a57b4000006060820152a161164a565b8301516001600160801b031615905084611644565b0151905087806115d5565b90601f198316915f516020620107c65f395f51905f525f52815f20925f5b8181106117ae5750936116299360209693600193837fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29a9810611796575b505050811b015f516020620107c65f395f51905f52556115f7565b01515f1960f88460031b161c1916905587808061177b565b9293602060018192878601518155019501930161173d565b5f516020620107c65f395f51905f525f527f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75601f840160051c8101916020851061182c575b601f0160051c01905b8181106118215750611593565b5f8155600101611814565b909150819061180b565b01519050858061153f565b601f198216955f516020620107865f395f51905f525f52805f20915f5b8881106118a65750836001959697981061188e575b505050811b015f516020620107865f395f51905f5255611561565b01515f1960f88460031b161c19169055858080611873565b9192602060018192868501518155019401920161185e565b5f516020620107865f395f51905f525f527f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d601f830160051c81019160208410611924575b601f0160051c01905b8181106119195750611523565b5f815560010161190c565b9091508190611903565b630d622feb60e01b5f5260045ffd5b63f92ee8a960e01b5f5260045ffd5b600a91506001600160401b031610158261145c565b346107175760203660031901126107175761197a6158e3565b611982616a5f565b60085f6001600160401b0360125416089060088210156100f2576020909101805460ff60701b191691151560701b60ff60701b16919091179055005b34610717576119cc366158f2565b929093916001600160401b03861693845f52600960205260405f206119f8886040519261127584615a6f565b516001600160a01b03163303611b66575b8195855f52600a60205260405f2060018060a01b0386165f52602052611a38858960ff60405f20541615615e99565b80611b55575b50611b1c575b507fa7c991dcadb18e7fc11637631b396a1a09f4a4230e968e6db43176dbdadae7e991602091611ac9611a768761718f565b97865f526005855260405f2060018060a01b0385165f528552611aa78985611aa060405f20615ca0565b93846177e5565b5f8781526005865260408082206001600160a01b038716835287529020615f64565b6001600160a01b03165f81815260038452604090208054919790916001600160801b0391611af8918316615f93565b82546001600160801b03191691161790556040519485526001600160a01b031693a4005b602091945091611b4c7fa7c991dcadb18e7fc11637631b396a1a09f4a4230e968e6db43176dbdadae7e99361714e565b94915091611a44565b611b609085896170b4565b87611a3e565b845f52600a60205260405f2060018060a01b0333165f52602052611b9360405f208860ff33925416615e69565b611a09565b3461071757604036600319011261071757611bb16157e6565b6001600160401b03611bc1615854565b91165f52600660205260405f209060018060a01b03165f52602052602060405f2060018060801b03905416604051908152f35b3461071757611c0e611c0536615951565b9391819361670b565b90828211611c2157602082604051908152f35b63118beac360e31b5f5260018060a01b031660045260245260445260645ffd5b3461071757604036600319011261071757600435611c5d615854565b60085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457611c8c61707d565b611c94615cc5565b335f90815260386020526040902054909190838110611e2d575060a0820180516020949291611dba916001600160801b0390611cd590828716908316616396565b168152335f526038865260405f20611cee8582546161aa565b9055611d8b61ffff6080611d0187617157565b97611d0c898861af60565b611d1f6001600160401b03825116615ddd565b611d2d838b83015116617fea565b611d3c83604083015116615bc1565b611d67836060830151166012805461ffff60601b191660609290921b61ffff60601b16919091179055565b0151166012805461ffff60701b191660709290921b61ffff60701b16919091179055565b516001600160801b0316601280546001600160801b031660809290921b6001600160801b031916919091179055565b60018060a01b0316908160405182815284868201527f2189dd61ba10a76e3348bbca899b71e3e23de0828ef127051ae8c506eda66f3360403392a360405190815282848201525f516020620109665f395f51905f5260403392a35f5f516020620108c65f395f51905f525d604051908152f35b839063117190a960e31b5f5260045260245260445ffd5b631199412360e11b5f5260045ffd5b3461071757606036600319011261071757611e6c6157e6565b6024356001600160401b03811161071757611e8b903690600401615a3f565b604492919235916001600160401b038311610717573660238401121561071757826004013592611eba84615afd565b93611ec86040519586615adc565b8085526024602086019160051b8301019136831161071757602401905b828210611fb6575050506001600160401b038116805f52600960205260405f20611f16836040519261127584615a6f565b516001600160a01b03163303611f84575b508251808303611f6e57505f5b828110611f3d57005b80611f68611f56611f51600194878a616372565b616382565b611f608388616825565b51908561a33e565b01611f34565b8263ab2552b360e01b5f5260045260245260445ffd5b5f52600a60205260405f2060018060a01b0333165f52602052611fb060405f208260ff33925416615e69565b84611f27565b8135815260209182019101611ee5565b34610717575f36600319011261071757611fde615b14565b8051602091820151604080516001600160781b0393841681529290911692820192909252f35b346107175760206107886120173661598f565b916167a4565b34610717576040366003190112610717576107156120396157e6565b612041615854565b9061204a616a5f565b612067816002600160401b036001600160401b03821614156166a5565b619c20565b3461071757602061078861207f3661598f565b9161670b565b346107175760203660031901126107175761209f5f616ab7565b6001810180911161140b57600d546001600160801b03166001810190811061140b5760016107889160209360043561abc3565b34610717576040366003190112610717576120eb6157e6565b6001600160401b036120fb615854565b91165f52600560205260405f209060018060a01b03165f52602052602060405f2060018060801b03905416604051908152f35b346107175760203660031901126107175760806001600160401b036121516157e6565b16805f52603060205261217b61111e60405f2060085f196001600160401b03601254160890616a50565b905f5260306020526121a361111e60405f2060085f6001600160401b03601254160890616a50565b6001600160401b0382511691610100600180861b0391015116906001600160401b0381511690610100600180871b039101511691604051938452602084015260408301526060820152f35b34610717576107156121ff366159c9565b916001600160401b038116805f52600960205260405f20612227836040519261127584615a6f565b516001600160a01b0316330361223e575b5061a33e565b5f52600a60205260405f2060018060a01b0333165f5260205261226a60405f208260ff33925416615e69565b84612238565b34610717575f3660031901126107175760408051630eaf323560e31b815290816004815f6110005af180156122ee576040915f916122c0575b506001600160401b038251911681525f6020820152f35b6122e09150823d84116122e7575b6122d88183615adc565b8101906166ea565b50826122a9565b503d6122ce565b6040513d5f823e3d90fd5b346107175760403660031901126107175761231f61231561583e565b6024359033616c71565b602060405160018152f35b3461071757602036600319011261071757602061236b6123486157e6565b612366816001600160401b038116801515908161237d575b506166a5565b61a2e2565b6040516001600160a01b039091168152f35b90506002600160401b03141586612360565b34610717575f3660031901126107175760206107886123ac615c08565b47906123b6615be2565b9061a29a565b34610717576020366003190112610717576123d56157e6565b6123dd616a5f565b6123fa816002600160401b036001600160401b03821614156166a5565b6124038161cd78565b61240c8261cdc4565b6124158361a2e2565b803b61244e57506020815191015ff56001600160a01b0381161561243f5761236b81602093619c20565b630252d9f760e11b5f5260045ffd5b602093925061236b91508092619c20565b34610717576080366003190112610717576124786157e6565b602435906001600160401b0382168203610717576107159161249861586a565b9061073660643580946124aa8461862f565b3390616f08565b346107175760203660031901126107175760043561ffff811680820361071757612710906124dd616a5f565b1015612504576012805461ffff60601b191660609290921b61ffff60601b16919091179055005b63026d491d60e51b5f5260045ffd5b6020610788612521366159c9565b92919061252d8261862f565b839161253933346160df565b945f191461254857339061993f565b849250610736565b34610717575f3660031901126107175760085f6001600160401b03601254160860088110156100f2576020015460681c60ff166125b55761258f618654565b80156125a3575b6020906040519015158152f35b5060206125ae619887565b9050612596565b6324b7349560e21b5f5260045ffd5b34610717576080366003190112610717576125dd6157e6565b6024356001600160801b03811691828203610717576044356001600160801b03811690819003610717576064359163ffffffff8316809303610717578061262b6001600160401b039261862f565b1692835f52600860205260405f2060018060a01b0333165f5260205260405f20906040519161265983615a6f565b549060018060801b0382168352602083019063ffffffff8360801c168252604084019260a01c835285612746575b8484528582525f878152600560209081526040808320338452909152902061270e949392916126b591615ec9565b5f87815260086020908152604080832033845290915290209251835491516001600160a01b03199092166001600160801b03919091161760809190911b63ffffffff60801b16178255516001600160601b031690616078565b604051938452602084015260408301527fcbb3320930c2934da510e3107d0acc2f5494678603ee08c1e646ccf545f9b10e60603393a3005b62034bc0861015612687578563cfcc315960e01b5f5260045262034bc060245260445ffd5b3461071757602036600319011261071757600435612787616a5f565b670de0b6b3a7640000811161279b57603a55005b63791449d360e11b5f5260045ffd5b34610717575f36600319011261071757602061076061661f565b346107175760603660031901126107175760206107886127e26157e6565b6127ea615854565b6127f26158d4565b916164ed565b34610717575f36600319011261071757610e43604051612819604082615adc565b600581526439b426a7a760d91b60208201526040519182916020835260208301906157fc565b604036600319011261071757600435612856615854565b60085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e445761288561707d565b6001600160801b0382116128fc576128a661289f5f616ab7565b34906161aa565b6001810180911161140b57600d546001600160801b0316600181019390841061140b576128db60016020956128e3948461abc3565b809333617f6e565b5f5f516020620108c65f395f51905f525d604051908152f35b63284ff66760e01b5f9081526001600160a01b03919091166004526024919091526001600160801b03604452606490fd5b34610717575f36600319011261071757612945615c08565b8051602091820151604080516001600160801b0393841681529290911692820192909252f35b34610717576060366003190112610717576129846157e6565b6024356001600160401b038111610717576129a3903690600401615a3f565b916044356001600160401b038111610717576129c3903690600401615a3f565b91906001600160401b038216805f52600960205260405f206129ec846040519261127584615a6f565b516001600160a01b03163303612a54575b50828503612a3d575f5b858110612a1057005b80612a37612a24611f516001948a8a616372565b612a2f838887616372565b3590866170b4565b01612a07565b8285635633168160e11b5f5260045260245260445ffd5b5f52600a60205260405f2060018060a01b0333165f52602052612a8060405f208360ff33925416615e69565b856129fd565b615820565b3461071757602036600319011261071757610715612aa76157e6565b612aaf616a5f565b618512565b34610717575f366003190112610717575f516020620107a65f395f51905f52546040516001600160a01b039091168152602090f35b604036600319011261071757600435612b00615854565b9060085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457612b3061707d565b612b38615cc5565b91813403612c0d57612bce9060018060a01b031692835f52603860205260405f20612b6484825461609b565b905560a0810180519091611d8b9161ffff916080916001600160801b0390612b9190898316908316615f93565b168552612bac600180841b03612ba68961718f565b1661b018565b612bbf6001600160401b03825116615ddd565b611d2d83602083015116617fea565b6040519081527f74fa4be68bbca443c265c9cbcea4341640d9c00fb07d700fb8c7ab34e666fc2b60203392a35f5f516020620108c65f395f51905f525d005b630c269ad560e21b5f5260045ffd5b34610717575f366003190112610717576020610788616304565b34610717575f366003190112610717575f516020620107e65f395f51905f52541580612d45575b15612d0857612cac612c6d618388565b612c75618457565b6020612cba60405192612c888385615adc565b5f84525f368137604051958695600f60f81b875260e08588015260e08701906157fc565b9085820360408701526157fc565b4660608501523060808501525f60a085015283810360c08501528180845192838152019301915f5b828110612cf157505050500390f35b835185528695509381019392810192600101612ce2565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b505f516020620109465f395f51905f525415612c5d565b3461071757602036600319011261071757612d756158e3565b612d7d616a5f565b60085f6001600160401b0360125416089060088210156100f2576020909101805460ff60681b191691151560681b60ff60681b16919091179055005b3461071757604036600319011261071757602065ffffffffffff612e27612dde6157e6565b6001600160401b03612dee615854565b911690815f526006855260405f209060018060a01b03165f5284528260405f205460801c16905f52600984528260405f205416906162e6565b16604051908152f35b3461071757602036600319011261071757612e4c60043561832e565b610e43612e5883617114565b91604051938493846040919493926060820195825260208201520152565b3461071757602036600319011261071757612e8f61583e565b60018060a01b03165f527f5ab42ced628888259c08ac98db1eb0cf702fc1501344311d8b100cd1bfe4bb00602052602060405f2054604051908152f35b34610717576060366003190112610717576020612ee76157e6565b612f74612ef2615854565b91612f6e612efe6158d4565b6001600160401b0383165f8181526005885260408082206001600160a01b038916808452908a528183205493835260068a528183209083528952902054919591612f6891612f58916001600160801b03908116911661609b565b612f6283866163af565b9061609b565b92618311565b906161aa565b90612f8157604051908152f35b612f8d612f9691616aca565b612f6e8161a95a565b610788565b3461071757604036600319011261071757612fb46157e6565b6001600160401b03612fc4615854565b91165f52600860205260405f209060018060a01b03165f526020526040805f20815190612ff082615a6f565b5460018060801b038116918281528363ffffffff8360801c169283602084015260a01c91015282519182526020820152f35b34610717575f36600319011261071757606061303c615c2e565b613044615cc5565b815160209283015160a090920151604080516001600160801b039384168152938316948401949094521691810191909152f35b34610717575f36600319011261071757602061078861620c565b34610717577f63bd79ea2105529df962cd4e4eca497e42e0e052fda7f3a147b7e71fcd411fb161321760206130c5366158f2565b6130d698959196949897929761707d565b6001600160401b03821696875f526009865260405f2061313084604051926130fd84615a6f565b549265ffffffffffff84168152604060ff8560301c16151591828c820152019360018060a01b039060381c168452615e22565b516001600160a01b0316330361328b575b875f52600a865260405f2060018060a01b038b165f52865261316c8a8460ff60405f20541615615e99565b8061327a575b5015613249576131eb613195916131c961319a61318e8b618062565b9590617114565b61718f565b5f8a81526005895260408082206001600160a01b038f1683528a5290208c906131c290615ca0565b93846174ce565b5f8881526005875260408082206001600160a01b038d16835288529020615f64565b6131f48761718f565b906001600160801b03906132079061718f565b16906001600160801b03166180c7565b613221858261825e565b6040519485526001600160a01b03908116951693a45f5f516020620108c65f395f51905f525d005b6131eb61326f916131c96132756132676132628c616aca565b61800b565b8096916161aa565b9a61718f565b61319a565b613285908a846170b4565b89613172565b5f888152600a87526040808220338084529089529120546132b19190859060ff16615e69565b613141565b34610717576040366003190112610717576004356132d2615854565b6132da616a5f565b6132e261707d565b6132ea615cc5565b5f516020620108665f395f51905f525f5260386020525f516020620109265f395f51905f5254909190838110611e2d575060a082018051602094927fc5fe86e4a889ff51f25c62464405915efbd7bea3de7baf44aad651ba2a75891d926040926133da91906001600160801b039061336790828916908316616396565b1681525f516020620108665f395f51905f525f5260388852835f2061338d8782546161aa565b9055611d8b61ffff60806133a089617157565b996133ab8b8861af60565b6133be6001600160401b03825116615ddd565b6133cc838d83015116617fea565b611d3c838983015116615bc1565b60018060a01b031692835f516020620108665f395f51905f527f2189dd61ba10a76e3348bbca899b71e3e23de0828ef127051ae8c506eda66f33848051858152898b820152a3835f516020620108665f395f51905f525f516020620109665f395f51905f52848051858152898b820152a381519081528486820152a25f5f516020620108c65f395f51905f525d604051908152f35b34610717575f36600319011261071757613487616a5f565b5f516020620107a65f395f51905f5280546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610717576020366003190112610717576001600160a01b036134f861583e565b165f526003602052602060018060801b0360405f205416604051908152f35b34610717575f366003190112610717576020610788617fb7565b604036600319011261071757602061078861354a615854565b6004356160df565b34610717576020366003190112610717576001600160401b036135736157e6565b5f6040805161358181615a6f565b8281528260208201520152165f526009602052606060405f20604051906135a782615a6f565b5465ffffffffffff8116918281526040602082019160ff8460301c1615158352019160018060a01b039060381c168252604051928352511515602083015260018060a01b039051166040820152f35b346107175760403660031901126107175761360f6157e6565b6001600160401b0361361f615854565b91165f52600a60205260405f209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b346107175760203660031901126107175760e061367161366c6157e6565b617e53565b6001600160401b03815116906001600160401b03602082015116906040810151151560608201511515608083015115159160a084015115159360c060018060a01b039101511694604051968752602087015260408601526060850152608084015260a083015260c0820152f35b34610717576040366003190112610717576107156136fa6157e6565b602435903390616f08565b346107175760403660031901126107175761371e6157e6565b6001600160401b0361372e615854565b91165f52600660205260405f209060018060a01b03165f526020526040613756815f206160a8565b65ffffffffffff602060018060801b038351169201511682519182526020820152f35b34610717576080366003190112610717576137926157e6565b602435906064356001600160a01b03811690819003610717576001600160401b036137c1604435853386617aa0565b921692835f52601060205260405f2060018060a01b0333165f5260205261380660405f2091604051926137f384615a8a565b5460a01c93602084019485528352617ce5565b82516001600160601b03918216908216019490851161140b576001600160601b0394851683525f8181526010602090815260408083203384528252909120925183546001600160a01b0319166001600160a01b03919091169081178455935190951691613874908390616078565b6040519182525f516020620108065f395f51905f52853393a4604051908152f35b34610717576020366003190112610717576001600160401b036138b66157e6565b165f52600b60205260405f206040519081602082549182815201915f5260205f20905f5b81811061390557610e43856138f181870382615adc565b604051918291602083526020830190615a03565b82546001600160a01b03168452602090930192600192830192016138da565b34610717576020366003190112610717576001600160a01b0361394561583e565b165f52600e6020526040805f20602082519161396083615a8a565b546001600160801b03811680845260809190911c6001600160401b03169190920181905282519182526020820152f35b34610717576020366003190112610717576001600160a01b036139b161583e565b165f526003602052602060405f205460801c604051908152f35b34610717575f3660031901126107175760085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e44576001600160401b0360125416335f52600e60205260405f209060405191613a2883615a8a565b5460018060801b0381168084526001600160401b03602085019260801c16825215613bd557516001600160401b031690818110613bc0578260018060801b03905116335f52600e6020525f60408120556013548060801c828110613b15575b60135483906001600160801b0319613aa383608084901c616396565b60801b169060018060801b03161760135560155460018060801b0319613acc838360801c616396565b60801b169060018060801b031617601555613ae7813361825e565b6040519081527fba4e3b2e3d25b351a2ef49820f9e22076b004067197d85fcaee4dca2201ce17960203392a2005b613b1f8184616396565b613b4f613b2a615be2565b80516020909101516001600160801b03908116911681811882821002909118906161aa565b6001600160801b03821611613ba957601654613b9191906001600160801b03613b7a83828416616396565b166001600160801b03199182161760165592615f93565b60801b169060018060801b0316176013558180613a87565b5082631d5c251f60e11b5f5260045260245260445ffd5b63afc6452960e01b5f5260045260245260445ffd5b636a2c35e960e01b5f5260045ffd5b34610717575f366003190112610717576016546040516001600160801b039091168152602090f35b3461071757604036600319011261071757613c256157e6565b6001600160401b03613c35615854565b91165f52600560205260405f209060018060a01b03165f5260205261294560405f20615ca0565b3461071757613cf5613c6d366159c9565b613cf0613c7d8295939495617ce5565b936001600160401b0360405191613c9383615a8a565b6001600160a01b039081168084526001600160601b039788166020808601918252939099165f81815260108552604080822033835290955293909320935184546001600160a01b0319169216919091178355965190951690616078565b617ce5565b6040516001600160601b0390911681523391905f516020620108065f395f51905f5290602090a4005b3461071757613d2c3661598f565b9190613d3661707d565b613d3f5f616ab7565b6001810180911161140b57600d546001600160801b03166001810190811061140b575f613d7091613d88938661abc3565b926001600160a01b0383169233840361401157617d16565b613d9182617c88565b601254612710613da861ffff8360701c1684617ca0565b6001600160801b0390811691909104919082169081613faf575b505050613dcd61aed7565b90613dd782617e53565b6040810151159081613fa1575b5015613f2b57613e696001600160401b0391613dfe615be2565b805160208201805190939291613e20916001600160801b039081169116616396565b6001600160801b0383811690821610613f21575b5082519192613e5b926001600160801b0390613e539086908316615f93565b169052615eec565b6001600160801b031661aa69565b91165f526031602052613eac613e9260405f2060085f6001600160401b03601254160890616a50565b5080546108e290849060781c6001600160781b0316616a37565b60085f6001600160401b0360125416089060088210156100f2575f94613ef76040926108e25f516020620108465f395f51905f52956028019160018060781b03835460781c16616a37565b8151948552600160208601526001600160a01b031693a45f5f516020620108c65f395f51905f525d005b9150613e5b613e34565b5f945f516020620108465f395f51905f529250604091613f9c90613f57906001600160801b031661aa69565b6002600160401b03885260316020526108e2613f85858a2060088b6001600160401b03601254160890616a50565b50805490929060781c6001600160781b0316616a37565b613ef7565b608091500151151586613de4565b6140099391906001600160801b0319613fcc85608084901c615f93565b60801b169060018060801b0316176012555f516020620108665f395f51905f525f52603860205261400260405f2091825461609b565b9055616396565b848080613dc2565b61401c823383616b74565b617d16565b3461071757604036600319011261071757602435600435614040616a5f565b676765c793fa10079d601b1b821161412e57676765c793fa10079d601b1b811161411f57676765c793fa10079d601b1b61407a828461609b565b11614110577f17295cc579d48cf6a42ae45a4e3c7791f30633c7d1defa248133a238f41b580e916140d46080926140af615c54565b92604051916140bd83615a8a565b5f196001871b019081168352166020820152615f14565b600180831b03815116906020600180851b0391015116601154906040519283526020830152600180841b0381166040830152821c6060820152a1005b63d3fe07e760e01b5f5260045ffd5b6359e7a56d60e11b5f5260045ffd5b6344ba813360e01b5f5260045ffd5b34610717576060366003190112610717576141566157e6565b60243561416161586a565b6001600160401b03831692835f52601060205260405f2060018060a01b0383165f5260205260405f206040519061419782615a8a565b549060018060a01b038216808252602082019260a01c8352806142af575b5081516001600160601b03166002600160601b0319016141dc575b50506107159350616f08565b6141e585617ce5565b82516001600160601b039182169116818110614298575082516001600160601b03908116919091039690871161140b576001600160601b0396871683525f8181526010602090815260408083206001600160a01b0389811685529252909120925183546001600160a01b03191691169081178355925161071597169161426c908390616078565b6040519182526001600160a01b038516915f516020620108065f395f51905f5290602090a484806141d0565b8690632a15c69b60e21b5f5260045260245260445ffd5b33036142bb57866141b5565b630c253c2360e11b5f5260045ffd5b6020366003190112610717576142de61583e565b6142e661707d565b6142ef34617c88565b6012549061271061430761ffff8460701c1683617ca0565b6001600160801b0390811691909104928391821690816144b7575b50505061432d61aed7565b61433681617e53565b906143496001600160801b03841661aa69565b9160408101511590816144a9575b5015614469576001600160401b03165f52603160205261438d613e9260405f2060085f6001600160401b03601254160890616a50565b60085f6001600160401b0360125416089260088410156100f2576143cb6143d9926108e26143df966028019160018060781b03835460781c16616a37565b6001600160801b0392615f93565b1661aa69565b9060085f6001600160401b0360125416089160088310156100f257601890920180545f936001600160781b039161441891908316616a37565b82546001600160781b031916911617905560408051348152602081018490526001600160a01b039092169133915f516020620108465f395f51905f5291a45f5f516020620108c65f395f51905f525d005b506143df926144a46143d9926002600160401b035f5260316020526108e2613f8560405f2060085f6001600160401b03601254160890616a50565b6143cb565b608091500151151586614357565b6144d49391906001600160801b0319613fcc85608084901c615f93565b818480614322565b34610717576020366003190112610717576144f56157e6565b6001600160401b03811690815f52600960205260405f2061451d826040519261127584615a6f565b516001600160a01b0316330361456d575b505f818152600960205260408120805460ff60301b191690557f724f90fbdf12cba6f20f1055f6d0bd3cdb9d3b5b8a1f4c758b92b18ee9f30fc89080a2005b5f828152600a6020908152604080832033808552925290912054614594929060ff16615e69565b8161452e565b34610717576020366003190112610717576020610788612f8d600435616aca565b34610717576040366003190112610717576145d46157e6565b6001600160401b036145e4615854565b915f60206040516145f481615a8a565b8281520152165f52601060205260405f209060018060a01b03165f526020526040805f2081519061462482615a8a565b546001600160a01b03811680835260a09190911c60209283019081528351918252516001600160601b031691810191909152f35b34610717576040366003190112610717576146716157e6565b6001600160401b03614681615854565b614689616a5f565b6146938184616de3565b6001600160a01b031691167f536699e73f1d293b0cdae5c5bd2880028ce7a620ca9d2d7fd725b99bcca4e93e5f80a3005b34610717575f36600319011261071757602061236b615fac565b346107175760203660031901126107175760406147046146ff600435616b55565b615d30565b60e060c08201511515910151151582519182526020820152f35b346107175761473861472f36615951565b939181936167a4565b9082821061474b57602082604051908152f35b632fcb36ed60e11b5f5260018060a01b031660045260245260445260645ffd5b34610717575f366003190112610717575f516020620108665f395f51905f525f52603860209081525f516020620109265f395f51905f5254604051908152f35b346107175760603660031901126107175760206107886147c96157e6565b60443590602435903390617aa0565b34610717576147e6366158f2565b929093916147f261707d565b6001600160401b03861693845f52600960205260405f2061481a886040519261127584615a6f565b516001600160a01b031633036149d4575b8195855f52600a60205260405f2060018060a01b0386165f5260205261485a858960ff60405f20541615615e99565b806149c3575b50614986575b507f1fdbc0b3ef381796abe43f320e1aa2752d6be33924a9802ad2c24df2bee860a9916149626020926148ee61489b8861718f565b98875f526005865260405f2060018060a01b0386165f5286526148cc8a866148c560405f20615ca0565b93846171c0565b5f8881526005875260408082206001600160a01b038816835288529020615f64565b5f8681526005855260408082206001600160a01b03841683528652902080546001600160801b0390614923908b908316615f93565b82546001600160801b03191691161790556001600160a01b03165f818152600385526040902080549198909161495c919060801c615f93565b90615ec9565b6040519485526001600160a01b031693a45f5f516020620108c65f395f51905f525d005b6020919450916149626149b97f1fdbc0b3ef381796abe43f320e1aa2752d6be33924a9802ad2c24df2bee860a99461714e565b9592505091614866565b6149ce9085896170b4565b87614860565b845f52600a60205260405f2060018060a01b0333165f52602052614a0160405f208860ff33925416615e69565b61482b565b3461071757602036600319011261071757600435600160401b811015614a4d576001600160401b03165f526034602052602060018060a01b0360405f205416604051908152f35b6335278d125f526004601cfd5b34610717575f36600319011261071757602060405173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8152f35b34610717575f366003190112610717576020603954604051908152f35b34610717576040366003190112610717576020610788614ac36157e6565b614ad260243580923390616f08565b339033906167a4565b34610717575f366003190112610717576020610788614af8615c08565b614b00615b14565b90616e86565b34610717575f36600319011261071757602061078861ac6f565b346107175760203660031901126107175760043565ffffffffffff8116809103610717575f54602091614bea614b5e6001600160401b038416615dc0565b6001600160401b03811680946001600160401b031916175f55614be3604051614b8681615a6f565b84815260018782019081523360408084019182525f89815260098b522092518354925166ffffffffffffff1990931665ffffffffffff919091161791151560301b60ff60301b16919091178255516001600160a01b031690615df9565b3390616de3565b604051908152817f369b9ef7936f8128d1eff4409b83d784498ec057c569447a736deab847ed7de9843393a3604051908152f35b34610717575f36600319011261071757602060405160128152f35b3461071757602036600319011261071757610120614c5b6146ff600435616b55565b6001600160401b038151169060ff6020820151169060408101511515606082015115156080830151151560a084015115159160c085015115159360e086015115159561010060018060801b039101511696604051988952602089015260408801526060870152608086015260a085015260c084015260e0830152610100820152f35b34610717575f3660031901126107175760c0614cf7615cc5565b6001600160401b038151169061ffff6020820151169061ffff60408201511661ffff6060830151169061ffff6080840151169260a060018060801b039101511693604051958652602086015260408501526060840152608083015260a0820152f35b34610717575f36600319011261071757602060115460801c604051908152f35b34610717575f3660031901126107175760206001600160401b0360125416604051908152f35b346107175760203660031901126107175760406001600160401b03614dc26157e6565b16805f5260376020526001600160401b03825f205416905f5260366020526001600160401b03825f20541690670f6b75ab2bc471c781148015614e83575b15614e6757505f905b670f6b75ab2bc471c781148015614e56575b15614e3b57505f5b82516001600160a01b03928316815291166020820152f35b5f9081526034602052829020546001600160a01b0316614e23565b50678ac7230489e7ffff8114614e1b565b5f9081526034602052829020546001600160a01b031690614e09565b50678ac7230489e7ffff8114614e00565b346107175760603660031901126107175761231f614eb061583e565b614eb8615854565b60443591614ec7833383616b74565b616c71565b346107175760203660031901126107175760043560085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e4457801561520e57335f908152600360205260409020546001600160801b031681116151ff57614f3481616aca565b614f3e8233617d16565b6001600160781b03614f4f8261aa69565b601554916001600160801b031991614f6c9116608084901c615f93565b60801b169060018060801b031617601555614f85615be2565b80516001600160801b0316614fc883614fc3614fba614fa2615c08565b4790614fac615c2e565b614fb4615cc5565b9161aa81565b93612f6261aad6565b61609b565b116151c7575b50614fd88161aa69565b60085f6001600160401b0360125416089060088210156100f25760189091018054615012926108e29160781c6001600160781b0316616a37565b6001600160401b036012541664ffffffffff7f000000000000000000000000000000000000000000000000000000000000000116016001600160401b03811161140b576001600160401b036004911601916001600160401b03831161140b5782476150a861507e615c08565b91615087615c2e565b61508f615cc5565b906001600160781b036150a0615b14565b51169461aa81565b90808211156151bf576150ba916161aa565b83116151a1575b60209350335f52600e84526001600160401b038060405f205460801c169116908181119082180218916001600160401b038316926150fe8261718f565b335f908152600e875260409020805490916001600160801b039161512491908316615f93565b1660018060801b0319825416179055335f52600e855260405f20908154906001600160401b0360801b9060801b16906001600160401b0360801b1916179055604051918252838201528160408201527fe8f686fe2fc956d5686150d8823d8e6fd95f18f808c76fea4efa50957df2c55560603392a2604051908152f35b506001600160401b0392831660020192831161140b576020926150c1565b50505f6150ba565b60208101805182516151f993925f9290916001600160801b03916151f091908316908316616396565b16835252615eec565b82614fce565b630330438b60e41b5f5260045ffd5b637989413f60e01b5f5260045ffd5b34610717576020366003190112610717576001600160a01b0361523e61583e565b165f526038602052602060405f2054604051908152f35b3461071757602036600319011261071757611fde615274600435616b36565b615b4b565b34610717576040366003190112610717576152926157e6565b6001600160401b036152a2615854565b916152ab616a5f565b1690815f52600b60205260405f20549160018311156154d857805f52600a60205260405f2060018060a01b0383165f5260205260ff60405f205416156154bb575f818152600a602090815260408083206001600160a01b0395909516808452949091528120805460ff191690558391905b8281106153c6575b505f8181526009602052604090205490915060381c6001600160a01b03168214806153b1575b615375575b7fd1dd9f27582bbce7226a4f323da8f0e775e31a715f1779e55da4e895c027f83a5f80a3005b805f52600b60205260405f208054156100f2575f526153ac60205f2060018060a01b03905416825f52600960205260405f20615df9565b61534f565b50805f52600b60205260405f2054151561534a565b815f52600b602052836153dc8260405f20616b21565b905460039190911b1c6001600160a01b0316146153fb5760010161531c565b5f828152600b6020526040902091925f19810190811161140b576154256154469161546a94616b21565b60018060a01b0391549060031b1c1691845f52600b60205260405f20616b21565b9080546001600160a01b0360039390931b83811b199091169290931690921b179055565b805f52600b60205260405f20805480156154a7575f19019061548c8282616b21565b81549060018060a01b039060031b1b19169055558083615324565b634e487b7160e01b5f52603160045260245ffd5b6339a907cb60e01b5f5260045260018060a01b031660245260445ffd5b6356ff10fb60e11b5f5260045260245ffd5b34610717575f36600319011261071757612945615be2565b34610717576020366003190112610717576001600160401b036155236157e6565b165f52600f602052602060ff60405f2054166040519015158152f35b34610717575f3660031901126107175760206040516110008152f35b34610717576020366003190112610717576001600160401b0361557c6157e6565b16805f5260316020526155a661114660405f2060085f196001600160401b03601254160890616a50565b905f5260316020526155ce61114660405f2060085f6001600160401b03601254160890616a50565b8151602092830151825192840151604080516001600160781b0394851681529284169583019590955292821693810193909352166060820152608090f35b34610717576020366003190112610717576020610788610cb660043561832e565b346107175760403660031901126107175761231f61564961583e565b602435903361ac0c565b3461071757602036600319011261071757611fde615274600435616b02565b346107175760203660031901126107175760043561ffff8116808203610717576127109061569e616a5f565b10156156c5576012805461ffff60501b191660509290921b61ffff60501b16919091179055005b63b9b751ff60e01b5f5260045ffd5b34610717575f36600319011261071757610e436156ef615b9c565b6040519182916020835260208301906157fc565b34610717575f366003190112610717576020610788614fa2615c08565b346107175760203660031901126107175760043561ffff8116808203610717576127109061574c616a5f565b1015612504576012805461ffff60701b191660709290921b61ffff60701b16919091179055005b34610717576020366003190112610717576001600160401b036157946157e6565b16805f5260326020526157be61114660405f2060085f196001600160401b03601254160890616a50565b905f5260326020526155ce61114660405f2060085f6001600160401b03601254160890616a50565b600435906001600160401b038216820361071757565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b34610717576020366003190112610717576020610788600435616aca565b600435906001600160a01b038216820361071757565b602435906001600160a01b038216820361071757565b604435906001600160a01b038216820361071757565b34610717575f36600319011261071757600d546040516001600160801b039091168152602090f35b34610717576020366003190112610717576158c161583e565b506040516001600160801b038152602090f35b60443590811515820361071757565b60043590811515820361071757565b60c0906003190112610717576004356001600160401b038116810361071757906024356001600160a01b038116810361071757906044356001600160a01b03811681036107175790606435906084359060a43580151581036107175790565b608090600319011261071757600435906024356001600160a01b038116810361071757906044356001600160a01b0381168103610717579060643590565b606090600319011261071757600435906024356001600160a01b038116810361071757906044356001600160a01b03811681036107175790565b6060906003190112610717576004356001600160401b038116810361071757906024356001600160a01b0381168103610717579060443590565b90602080835192838152019201905f5b818110615a205750505090565b82516001600160a01b0316845260209384019390920191600101615a13565b9181601f84011215610717578235916001600160401b038311610717576020808501948460051b01011161071757565b606081019081106001600160401b0382111761120a57604052565b604081019081106001600160401b0382111761120a57604052565b61012081019081106001600160401b0382111761120a57604052565b60e081019081106001600160401b0382111761120a57604052565b90601f801991011681019081106001600160401b0382111761120a57604052565b6001600160401b03811161120a5760051b60200190565b60405190615b2182615a6f565b6014546001600160781b038082168452607882901c16602084015260f01c60ff1615156040830152565b90604051615b5881615a6f565b91546001600160781b038082168452607882901c16602084015260f01c60ff1615156040830152565b6001600160401b03811161120a57601f01601f191660200190565b60405190615bab604083615adc565b600782526614da135bdb985960ca1b6020830152565b6012805461ffff60501b191660509290921b61ffff60501b16919091179055565b60405190615bef82615a8a565b6016546001600160801b038116835260801c6020830152565b60405190615c1582615a8a565b6013546001600160801b038116835260801c6020830152565b60405190615c3b82615a8a565b6015546001600160801b038116835260801c6020830152565b60405190615c6182615a8a565b6011546001600160801b038116835260801c6020830152565b60405190615c8782615a8a565b600d546001600160801b038116835260801c6020830152565b90604051615cad81615a8a565b91546001600160801b038116835260801c6020830152565b6040519060c082018281106001600160401b0382111761120a576040528160a06012546001600160401b038116835261ffff8160401c16602084015261ffff8160501c16604084015261ffff8160601c16606084015261ffff8160701c16608084015260801c910152565b90604051615d3d81615aa5565b6101008193546001600160401b038116835260ff8160401c16602084015260ff8160481c161515604084015260ff8160501c161515606084015260ff8160581c161515608084015260ff8160601c16151560a084015260ff8160681c16151560c084015260ff8160701c16151560e084015260018060801b039060781c16910152565b6001600160401b03166001600160401b03811461140b5760010190565b6001600160401b03166001600160401b03196012541617601255565b8054600160381b600160d81b03191660389290921b600160381b600160d81b0316919091179055565b15615e2a5750565b6001600160401b039063472dabaf60e01b5f521660045260245ffd5b6001600160401b0390911681526001600160a01b03909116602082015260400190565b15615e72575050565b6001600160401b039063649a1d8560e11b5f521660045260018060a01b031660245260445ffd5b15615ea2575050565b6001600160401b03906344fefb8160e01b5f521660045260018060a01b031660245260445ffd5b80546001600160801b031660809290921b6001600160801b031916919091179055565b80516020919091015160801b6001600160801b0319166001600160801b039190911617601655565b80516020919091015160801b6001600160801b0319166001600160801b039190911617601155565b80516020919091015160801b6001600160801b0319166001600160801b039190911617600d55565b815181546001600160801b0319166001600160801b03918216178255602090920151615f91921690615ec9565b565b6001600160801b03918216908216019190821161140b57565b6001600160401b03603b5416670f6b75ab2bc471c78114616037575b6002600160401b0390816001600160401b0382161461601b575b6001600160401b03915016678ac7230489e7ffff8114616016575f908152603460205260409020546001600160a01b031690565b505f90565b505f5260366020526001600160401b038060405f205416615fe2565b50670f6b75ab2bc471c75f5260366020527f1b555aca7137ecab873ff5825c4daff389c38ba0c5fd4f3ed4741665aea9c126546001600160401b0316615fc8565b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b9190820180921161140b57565b906040516160b581615a6f565b91546001600160801b0381168352608081901c65ffffffffffff16602084015260b01c6040830152565b9060085f6001600160401b03601254160860088110156100f2576020015460701c60ff16611e445761610f61707d565b6001600160801b0382116161795761612961289f5f616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b575f61615c91616165948661abc3565b92839133617f6e565b5f5f516020620108c65f395f51905f525d90565b633c8097d960e11b5f9081526001600160a01b03919091166004526024919091526001600160801b03604452606490fd5b9190820391821161140b57565b90670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b57565b8181029291811591840414171561140b57565b81156161f8570490565b634e487b7160e01b5f52601260045260245ffd5b61621461827a565b80156162c757670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b57616244916161ee565b670de0b6b3a7640000811061629957505f5b61628d60115491616287670de0b6b3a76400006162808560801c9560018060801b031693846161db565b048461609b565b9261609b565b90818110908218021890565b670de0b6b3a764000003670de0b6b3a764000081111561625657634e487b7160e01b5f52601160045260245ffd5b50506011546162e3906001600160801b0381169060801c61609b565b90565b9065ffffffffffff8091169116019065ffffffffffff821161140b57565b61630c61827a565b801561636c57670de0b6b3a7640000820291808304670de0b6b3a7640000149015171561140b5761633c916161ee565b670de0b6b3a7640000811061635057505f90565b670de0b6b3a764000003670de0b6b3a7640000811161140b5790565b50505f90565b91908110156100f25760051b0190565b356001600160a01b03811681036107175790565b6001600160801b03918216908216039190821161140b57565b6001600160401b031690815f52600860205260405f2060018060a01b0382165f5260205260405f2090604051916163e583615a6f565b549060018060801b038216808452602084019263ffffffff8160801c16845260a01c6040850152156164e5576001600160a01b0381165f908152600360205260409020546001600160801b03169384156164dc575f52600760205260405f209060018060a01b03165f5260205265ffffffffffff61647e61646860405f206160a8565b9263ffffffff83602086015116915116906162e6565b164311156164a35750516001600160801b03165b8082101561649e575090565b905090565b905190516001600160801b039182169116808211156164d5576001600160801b03916164cf9190616396565b16616492565b5050505f90565b50505050505f90565b505050505f90565b6001600160401b031690815f52600860205260405f2060018060a01b0382165f5260205260405f20906040519161652383615a6f565b549060018060801b038216808452602084019263ffffffff8160801c16845260a01c6040850152156164dc576001600160a01b0381165f908152600360205260409020546001600160801b0316938415616615575f52600760205260405f209060018060a01b03165f5260205265ffffffffffff6165a661646860405f206160a8565b164311156165e35750516001600160801b03165b808210156165dc57505b80916165ce575090565b6162e39150612f8d90616aca565b90506165c4565b905190516001600160801b039182169116808211156164e5576001600160801b039161660f9190616396565b166165ba565b5050505050505f90565b60085f6001600160401b03601254160860088110156100f2576020015460681c60ff166166a157678ac7230489e7ffff6001600160401b03603b541614806166645790565b5060085f6001600160401b03601254160860088110156100f2576001600160401b039060200154166001600160401b0361669c6185e8565b161190565b5f90565b156166ad5750565b6001600160401b03906305d9424760e21b5f521660045260245ffd5b51906001600160401b038216820361071757565b5190811515820361071757565b9190826040910312610717576162e36020616704846166c9565b93016166dd565b9161671461707d565b6001600160a01b038216156167955761672c81616879565b808411616773575061675f9161675a61675085936167498561832e565b9290617114565b968791853361a3c8565b61825e565b905f5f516020620108c65f395f51905f525d565b8382633fa733bb60e21b5f5260018060a01b031660045260245260445260645ffd5b63d92e233d60e01b5f5260045ffd5b91906167ae61707d565b6001600160a01b03811615616795576167cc610cb6610cb184616879565b80841161680357509061675f9161675a6167e585616aca565b6167f86167f18261a95a565b80926161aa565b95868095853361a3c8565b8383632e52afbb60e21b5f5260018060a01b031660045260245260445260645ffd5b80518210156100f25760209160051b010190565b601654603a546001600160801b03909116905f198101616857575090565b90616860617fb7565b9081156164d5576162e392616874916161db565b6161ee565b6001600160a01b03165f908152600360205260409020546162e390612f6e90613262906001600160801b0316616aca565b6168b261827a565b156160165790565b6168c261827a565b919082916168d082856161aa565b931561690057670de0b6b3a76400008202828104670de0b6b3a7640000148315171561140b578361633c916161ee565b5f93508392508291508190565b60085f6001600160401b03601254160860088110156100f2576020015460681c60ff16616016576001600160401b031680158015616997575b616016575f818152603460205260409020546001600160a01b031615616016575f52603060205260ff61698d60405f2060085f196001600160401b03601254160890616a50565b505460601c161590565b506002600160401b038114616946565b6001600160a01b03168015616a06575f516020620107a65f395f51905f5280546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b631e4fbdf760e01b5f525f60045260245ffd5b60041115616a2357565b634e487b7160e01b5f52602160045260245ffd5b6001600160781b03918216908216019190821161140b57565b60088210156100f25701905f90565b5f516020620107a65f395f51905f52546001600160a01b03163303616a8057565b63118cdaa760e01b5f523360045260245ffd5b616a9e614fa2615c08565b616aa661aad6565b8082111561636c576162e3916161aa565b616ac2614fa2615c08565b90616a9e5790565b616ad46001616ab7565b906001820180921161140b57600d546001600160801b03166001810190811061140b576162e3925f9261abc3565b6008906001600160401b03601254160860088110156100f25760280190565b80548210156100f2575f5260205f2001905f90565b6008906001600160401b03601254160860088110156100f25760180190565b6008906001600160401b03601254160860088110156100f25760200190565b6001600160a01b039081165f818152600460209081526040808320948616835293905291909120549291905f198410616bae575b50505050565b828410616c1a578015616c07576001600160a01b03821615616bf4575f52600460205260405f209060018060a01b03165f5260205260405f20910390555f808080616ba8565b634a1406b160e11b5f525f60045260245ffd5b63e602df0560e01b5f525f60045260245ffd5b508290637dc7a0d960e11b5f5260018060a01b031660045260245260445260645ffd5b15616c4457565b634b637e8f60e11b5f525f60045260245ffd5b15616c5e57565b63ec442f0560e01b5f525f60045260245ffd5b6001600160a01b03168015929091616c898415616c3d565b6001600160a01b0316928315616c9f8115616c57565b616ca88361718f565b9115616d5e57600d545f516020620108865f395f51905f5293602093909290916001600160801b03616cdc84828416615f93565b6001600160801b0319909216911617600d555b15616d2357600d80546001600160801b031981166001600160801b0391821693909303169190911790555b604051908152a3565b5f8681526003845260409020805490916001600160801b0391616d4891908316615f93565b82546001600160801b0319169116179055616d1a565b835f526003602052616d7260405f20615ca0565b80516001600160801b0316848110616dc85750915f516020620108865f395f51905f529391616dc360209460018060801b038460018060801b0383511603168152875f526003865260405f20615f64565b616cef565b84908663391434e360e21b5f5260045260245260445260645ffd5b6001600160401b0316805f52600a60205260405f2060018060a01b0383165f5260205260ff60405f205416616e69575f818152600a602090815260408083206001600160a01b03861684528252808320805460ff19166001179055928252600b90522080549190600160401b83101561120a5782615446916001615f9195018155616b21565b6304cf17f560e41b5f5260045260018060a01b031660245260445ffd5b5181516020909201516001600160801b03909116916001600160781b0391616eb391908316908316616a37565b168082111561636c576162e3916161aa565b8151602083015160409093015160809390931b65ffffffffffff60801b166001600160801b03919091161760b09290921b6001600160b01b031916919091179055565b6001600160401b03909291921691825f52600660205260405f2060018060a01b0382165f52602052616f3c60405f206160a8565b92805f52600960205265ffffffffffff60405f20541691616f5c8461718f565b92616f83602087019165ffffffffffff616f79828286511661609b565b431193511661609b565b901561706b575084516001600160801b039081169084168110617054575084516001600160801b03908116849003811686526001600160a01b039091165f81815260036020908152604080832080546001600160801b0319811690871690980190951696909617909355838152600683528481208282529092529290209193849261700e9190616ec5565b7f14ee26c6951fd3ff70df03bd811dac39ac5a71dc85dbb469db6bf46114e5dcff6020604051858152a36040519081525f516020620108865f395f51905f5260203092a3565b84906373658c6f60e11b5f5260045260245260445ffd5b636b72660560e11b5f5260045260245ffd5b5f516020620108c65f395f51905f525c6170a55760015f516020620108c65f395f51905f525d565b633ee5aeb560e01b5f5260045ffd5b6170e3916001600160401b03604051926170cd84615a8a565b1682526001600160a01b0316602082015261d286565b905f1981036170f257505f905d565b815c908082111561710b57617106916161aa565b905b5d565b50505f90617108565b61711e6001616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b576162e39260019261abc3565b61711e5f616ab7565b6171605f616ab7565b600d546001600160801b031660018101929190831061140b576001810180911161140b576162e3925f9261abc3565b6001600160801b0381116171a9576001600160801b031690565b6306dfcc6560e41b5f52608060045260245260445ffd5b6001600160a01b0383165f818152600360205260408120939690959094936171e790615ca0565b926171f5613195868a618311565b976172098960018060801b03845116616396565b985f966020840160018060801b0361722a60018060801b0383511688615f93565b166001600160801b038d16106173ea575b80516001600160801b039061725290821688615f93565b166001600160801b038d1610617398575b505082516001600160401b03929092165f9081526006602090815260408083208884529091529020546001600160801b039081169a92811692858216929116821161736357505081516001600160801b03908116849003811690925250602084810180518316939093039091169091525f9182526003905260409020939450919290916172ef91615f64565b6001600160801b0381161580617358575b61735357829061730e615c7a565b9161733f57602082018051939450615f919390916001600160801b039161733791908316615f93565b169052615f3c565b634e487b7160e01b84526021600452602484fd5b509050565b505f92506001617300565b6040516304a613a560e11b81526004810193909352602483018b90526001600160801b03166044830152606482015260849150fd5b906173bf6173ce9499939c6173ba6173c89460018060801b0390511689615f93565b616396565b9089868a61acd6565b90615f93565b946173e28960018060801b03845116616396565b985f80617263565b9a97506174b28b6174316001600160401b0386169a8b5f52600660205260405f208a5f526020526173ba61742060405f206160a8565b93516001600160801b03168a615f93565b81516001600160801b03918216908216818118828210029091188216919061745a908390616396565b16825286516001600160801b03906174759083908316615f93565b16875260208a0180516001600160801b03906174949084908316615f93565b169052995f52600660205260405f20885f5260205260405f20616ec5565b83516174c89083906001600160801b0316616396565b9a61723b565b6001600160a01b0383165f818152600360205260408120909695949392906174f590615ca0565b926175036131958683618311565b82516175199082906001600160801b0316616396565b6020840180515f9892939291906001600160801b039061753b9082168c615f93565b166001600160801b0385161061771c575b80516001600160801b03906175639082168c615f93565b166001600160801b038516106176d2575b505083516001600160401b03939093165f9081526006602090815260408083208884529091529020546001600160801b0393841693898116939181169116831161769f57505082516001600160801b03908116889003811690935250506020808401805183168790039092169091525f91825260039052604090206175f99190615f64565b6001600160801b0381161580617695575b61768f57908391617619615c7a565b9261767b57602083018051949550615f919490916001600160801b039161764291908316615f93565b168082526001600160801b039061765a908490616396565b16905281516001600160801b0391617673918316616396565b168152615f3c565b634e487b7160e01b85526021600452602485fd5b50509050565b505f93508361760a565b6040516304a613a560e11b8152600481019490945260248401526001600160801b03166044830152606482015260849150fd5b5191976177009390926173c892916176f7916173ba906001600160801b03168d615f93565b9085878a61acd6565b946177148160018060801b03855116616396565b905f80617574565b9297506177c96001600160401b03851698895f52600660205260405f20885f5260205261776661774e60405f206160a8565b86519092906173ba906001600160801b03168e615f93565b81516001600160801b03918216908216818118828210029091188216919061778f908390616396565b16825287516001600160801b03906177aa9083908316615f93565b16885260208a0180516001600160801b03906174949084908316615f93565b84516177df9083906001600160801b0316616396565b9261754c565b6001600160a01b0383165f81815260036020526040812090969593929061780b90615ca0565b926178196131958783618311565b825161782f9082906001600160801b0316616396565b6020840180515f9992939291906001600160801b03906178519082168b615f93565b166001600160801b038516106179b9575b80516001600160801b03906178799082168b615f93565b166001600160801b03851610617978575b505083516001600160401b03939093165f9081526006602090815260408083208884529091529020546001600160801b0393841693888116939181169116831161769f57505082516001600160801b03908116879003811690935250506020808401805183168690039092169091525f918252600390526040902061790f9190615f64565b6001600160801b038216158061796e575b61768f5790839161792f615c7a565b9261767b57602083018051949550615f91949092617337916001600160801b039161795b918316615f93565b168084526001600160801b039290616396565b505f935083617920565b51919861799d9390926173c892916176f7916173ba906001600160801b03168c615f93565b956179b18160018060801b03855116616396565b905f8061788a565b929850617a846001600160401b038516998a5f52600660205260405f20885f52602052617a036179eb60405f206160a8565b86519092906173ba906001600160801b03168d615f93565b81516001600160801b039182169082168181188282100290911882169190617a2c908390616396565b16825287516001600160801b0390617a479083908316615f93565b16885260208a0180516001600160801b0390617a669084908316615f93565b1690529a5f52600660205260405f20885f5260205260405f20616ec5565b8451617a9a9083906001600160801b0316616396565b92617862565b919392906001600160401b03831691825f52600560205260405f2060018060a01b0383165f52602052617ad560405f20615ca0565b90835f52600660205260405f2060018060a01b0384165f52602052617afc60405f206160a8565b92617b1361319582617b0d8b61718f565b98618311565b8351617b299082906001600160801b0316616396565b84516001600160801b03898116939291811691168311617c685750505091617bfe91617c19949360018060801b038860018060801b038551160316835260018060a01b031696875f526003602052617b9360405f2060018060801b0383825460801c031690615ec9565b600d80546001600160801b0319608082811c859003901b166001600160801b0391821617909155855181169091018116855265ffffffffffff4316602086015290617bdd9061718f565b166020820152845f52600560205260405f20865f5260205260405f20615f64565b825f52600660205260405f20845f5260205260405f20616ec5565b805f5260096020527fc2004f6d2f2084f6055f049ffa20c75bebde1fe59acfae5ebbdbb3f3446bc0196040617c5965ffffffffffff825f2054164361609b565b958151908152866020820152a3565b636840e90f60e11b5f5260045260018060801b031660245260445260645ffd5b600160801b811015614a4d576001600160801b031690565b6001600160801b03918216908216029081169190820361140b57565b8054600160781b600160f01b03191660789290921b600160781b600160f01b0316919091179055565b6001600160601b038111617cff576001600160601b031690565b6306dfcc6560e41b5f52606060045260245260445ffd5b9091906001600160a01b03168015617d2e8115616c3d565b617d378461718f565b9015617dad57600d5492935f935f516020620108865f395f51905f5292602092916001600160801b03617d6c83828416615f93565b6001600160801b0319909216911617600d555b600d80546001600160801b031981166001600160801b039182169390930316919091179055604051908152a3565b815f526003602052617dc160405f20615ca0565b80516001600160801b0316858110617e1a575080516001600160801b039081168390031681525f8381526003602090815260408220959691955f516020620108865f395f51905f52949193617e1591615f64565b617d7f565b9350505063391434e360e21b5f5260045260245260445260645ffd5b90617e40575f9055565b634e487b7160e01b5f525f60045260245ffd5b6001600160401b03905f60c0604051617e6b81615ac1565b8281528260208201528260408201528260608201528260808201528260a0820152015216805f52603360205260405f206040519060a082018281106001600160401b0382111761120a5760405254916001600160401b03831682526001600160401b038360401c166020830152604082019260ff8160801c16151584526060830160ff8260881c161515815260ff608085019260901c1615158252825f5260346020526001600160401b0360018060a01b0360405f205416945116946002600160401b039051151591511515925115159360405196617f4988615ac1565b87528060208801521460408601526060850152608084015260a083015260c082015290565b92348303612c0d578181617f936040935f516020620109665f395f51905f529561af60565b617f9c8561b018565b825194855260208501526001600160a01b03908116941692a3565b61ffff60125460401c16670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561140b57612710900490565b6012805461ffff60401b191660409290921b61ffff60401b16919091179055565b90811561805b5761801a61827a565b90809391618031618029615c54565b82848661b069565b9590951161803f5750509190565b909150618057929350618050615c54565b918061b1ee565b9091565b5f91508190565b9061806b61827a565b839193156180a45783821161808d576180579293618087615c54565b9261b1ee565b83826303eb0d9b60e51b5f5260045260245260445ffd5b505090505f905f90565b6001600160781b03918216908216039190821161140b57565b6016546001600160801b0381169060801c816180e3848361609b565b11618124575b50506180f59150617c88565b601654906001600160801b03199061811190608084901c615f93565b60801b169060018060801b031617601655565b60085f6001600160401b03601254160860088110156100f25760280180549094906001600160781b0390618160908281169060781c83166180ae565b1661817561816e868561609b565b918561609b565b1061823457506181969161818c846181919361609b565b6161aa565b61aa69565b60085f6001600160401b0360125416089260088410156100f2576181d06180f5946018016108e28460018060781b03835460781c16616a37565b80546001600160781b03906181e89084908316616a37565b82546001600160781b0319169116179055601654906001600160801b039061821b906001600160781b0316828416615f93565b6001600160801b03199092169116176016555f806180e9565b61824290618248939461609b565b926161aa565b906342f215e360e01b5f5260045260245260445ffd5b5f80809338935af11561826d57565b63b12d13eb5f526004601cfd5b618282615be2565b9060018060801b0382511691602060018060801b039101511660085f6001600160401b03601254160860088110156100f25761830d916182c761830792602801615b4b565b602081015190516001600160781b03916182e59183169083166180ae565b6001600160801b039161830091168381188185100218617c88565b16906161aa565b836161aa565b9190565b61832a916001600160401b03604051926170cd84615a8a565b5c90565b8015618349576180579061834061827a565b90618087615c54565b505f905f90565b90600182811c9216801561837e575b602083101461836a57565b634e487b7160e01b5f52602260045260245ffd5b91607f169161835f565b604051905f825f516020620107865f395f51905f5254916183a883618350565b808352926001811690811561843857506001146183cc575b615f9192500383615adc565b505f516020620107865f395f51905f525f90815290917f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d5b81831061841c575050906020615f91928201016183c0565b6020919350806001915483858901015201910190918492618404565b60209250615f9194915060ff191682840152151560051b8201016183c0565b604051905f825f516020620107c65f395f51905f52549161847783618350565b8083529260018116908115618438575060011461849a57615f9192500383615adc565b505f516020620107c65f395f51905f525f90815290917f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b755b8183106184ea575050906020615f91928201016183c0565b60209193508060019154838589010152019101909184926184d2565b801561140b575f190190565b6001600160401b0316805f52603460205260018060a01b0360405f205416815f52603360205260ff60405f205460801c16156185d9577fddb6b82eeddfdb3c8f55159b7a63f993fd885d75c47e84d968c1efed15bd4b4791606091618578603954618506565b6039555f82815260336020908152604091829020805460ff60801b19811682556012805470ff0000000000000000ffffffffffffffff199092166001600160401b0392831617909255905483519586529185019390935290911690820152a1565b63fb1ba7c360e01b5f5260045ffd5b60408051630eaf323560e31b815290816004815f6110005af19081156122ee575f91618612575090565b61862b915060403d6040116122e7576122d88183615adc565b5090565b615f91906001600160401b0381165f52600960205260ff60405f205460301c16615e22565b61865c6185e8565b678ac7230489e7ffff6001600160401b03603b5416036160165760085f6001600160401b03601254160860088110156100f2576001600160401b0380916020015416911611156198825760085f6001600160401b03601254160860088110156100f2576186cb90602001615d30565b600860016001600160401b0360125416089060088210156100f25760408051630eaf323560e31b81529290836004815f6110005af19182156122ee57618785935f905f9461985e575b50809361984c575b5061872561d4ad565b9060e060c082015115159101511515916001600160401b036040519561874a87615aa5565b1685525f60208601525f60408601525f6060860152151560808501525f60a085015260c084015260e08301525f61010083015260200161cf06565b600860026001600160401b03601254160860088110156100f2576187ab9060280161b438565b600860026001600160401b03601254160860088110156100f2576187d19060180161b438565b60085f6001600160401b03601254160860088110156100f25760018060781b0390601801541660085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b031661883061882b615c2e565b61d4f0565b601354601454608082901c94929060781c6001600160781b0316618854818761609b565b8211619718575b50505050505060085f6001600160401b03601254160860088110156100f2576188a3904790618888615c08565b9061889d618894615be2565b91601801615b4b565b9161d007565b80619685575b506188b2615be2565b60018060801b0381511690602060018060801b039101511660085f6001600160401b0360125416089060088210156100f2576189226188f661892893602801615b4b565b602081015190516001600160781b03916189149183169083166180ae565b168083108382180218617c88565b90616396565b90618933818361d512565b919050801561966f57618979670de0b6b3a7640000618973618961846168746001600160801b0389166161b7565b945b6001600160801b031694856161db565b04617c88565b61898c838311838503815f03180161aa69565b6001600160801b039182169491909116906189b18583115f819003848803180161aa69565b935f938491111561962c57506001600160781b039081169490851161140b576016546001600160801b036189e787828416615f93565b6001600160801b03199092169116176016555b11156195e45781618a0a91616a37565b60165490916001600160801b031990618a30906001600160781b0316608084901c615f93565b60801b169060018060801b0316176016555b60085f6001600160401b03601254160860088110156100f257618a6790601801615b4b565b916001600160781b0382811692908216808411156194925750618a8a92506180ae565b6020820180516001600160781b0390811691908316821015619476578051618ae992618ad99290916001600160781b0390618ac890849083166180ae565b1690526001600160781b03936180ae565b83516001600160781b0316616a37565b1681525b60085f6001600160401b03601254160860088110156100f25760180190618b2060018060781b0360208301511683617cbc565b5181546001600160781b0319166001600160781b03919091161790556012546008905f906001600160401b03160860088110156100f257618b7e9060018060781b03906028015460781c1660165460801c818110908218021861aa69565b60085f6001600160401b03601254160860088110156100f25760280180546001600160781b03191690556016546001600160801b0319618bcb6001600160781b038416608084901c616396565b60801b169060018060801b03161760165560085f6001600160401b0360125416089060088210156100f25760189091018054618c16926108e29160781c6001600160781b0316616a37565b618c21614af8615c08565b60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b0316618c556123ac615c08565b9160085f6001600160401b0360125416089260088410156100f257601890930154618d20936001600160781b039190911690818411156194705781935b8381111561946957618ca484826161aa565b945b8583851161944f575b50808611619427575b50917fec02843180b54309d8a147dbf4e1752769231591a33bd1200f8c8ed16d5b761b939160a093618ceb61882b615c2e565b601354908160801c908181116193a2575b505050604051938785526020850152604084015260608301526080820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546001600160781b0390618d5490849083166180ae565b82546001600160781b03191691161790556012546008905f906001600160401b0316089060088210156100f25760189091018054618da1926108e29160781c6001600160781b03166180ae565b603954151580619366575b61929e575b6039541561913957618dc4614af8615c08565b60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b031681811161907b575b5060085f6001600160401b03601254160860088110156100f257601801546001600160781b0316618e276123ac615c08565b808211618fa4575b505060016039541180618f9b575b618f08575b505b60085f6001600160401b03601254160860088110156100f2576028015460405160789190911c6001600160781b031690618e7d81615a8a565b81815260206001600160401b03431691015260018060781b031960175416176017556017546001600160401b0360781b4360781b16906001600160401b0360781b1916176017556012546001600160401b03618eda818316615dc0565b16906001600160401b03191617601255670f6b75ab2bc471c76001600160401b0319603b541617603b555f90565b61ffff60125460501c169081618f1f575b50618e42565b61271091618f2c916161db565b0460021c60085f6001600160401b03601254160860088110156100f2576018015460781c6001600160781b03168111618f66575b80618f19565b618f6f9061aa69565b60085f6001600160401b0360125416089060088210156100f257618f9591601801617cbc565b5f618f60565b50801515618e3d565b7f6b2dd4fda632ddc7bb2fbc3eaaed4976d90adadf4ae3ed9c8b7c7d8d7da4ed5d604083618fd584618fe6966161aa565b9382519182526020820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546001600160781b039061901a90849083166180ae565b82546001600160781b03191691161790556012546008906001906001600160401b03160860088110156100f257601801805490916001600160781b039161906391908316616a37565b82546001600160781b03191691161790555f80618e2f565b807f46360e9dac0d2811c43387b45e04c168b83a52b6a1cdd0c430f7bfb872999c1d60406190ac856190be956161aa565b928151908152856020820152a161aa69565b60085f6001600160401b03601254160860088110156100f25760180180546190f891906108e290849060781c6001600160781b03166180ae565b600860016001600160401b0360125416089060088210156100f25760189091018054619133926108e29160781c6001600160781b0316616a37565b5f618df5565b60085f6001600160401b03601254160860088110156100f25760018060781b0390601801541660085f6001600160401b03601254160860088110156100f25760018060781b03906018015460781c16907f45ef01ba9c1df082e9efff8583fa67a93e191d572f3bd66b4e43c799b77a5d32816001600160401b03601254166191c7856040519384938461b44e565b0390a181811115619251576191df91618191916161aa565b600860016001600160401b03601254160860088110156100f257601801805490916001600160781b039161921591908316616a37565b82546001600160781b03191691161790555b60085f6001600160401b03601254160860088110156100f25761924c9060180161b438565b618e44565b6181919061925e926161aa565b600860016001600160401b0360125416089060088210156100f25760189091018054619299926108e29160781c6001600160781b0316616a37565b619227565b60085f6001600160401b03601254160860088110156100f25760018060781b039060180154167f775610ca80dfabec6d8007dfdfa10f08fba6848e6aeec65036dd88bce0ffade76020604051838152a160085f6001600160401b03601254160860088110156100f25760180180546001600160781b03191690556012546008906001906001600160401b03160860088110156100f257601801805490916001600160781b039161935091908316616a37565b82546001600160781b0319169116179055618db1565b5060085f6001600160401b03601254160860088110156100f25760280154670de0b6b3a764000060789190911c6001600160781b031610618dac565b816193ac916161aa565b9084821161941f575b898211619417575b6193fe907f1f7b809c624385126cf2584bb2e558256de4a545b59e843e80beb6b3a04a113f6020604051858152a16001600160801b0319926173c890617c88565b60801b169060018060801b0316176013555f8080618cfc565b8991506193bd565b8491506193b5565b94507fec02843180b54309d8a147dbf4e1752769231591a33bd1200f8c8ed16d5b761b618cb8565b61945984866161aa565b90811115618caf5795505f618caf565b5f94618ca6565b83618c92565b916001600160781b039161948a91906180ae565b169052618aed565b919061949d916180ae565b83516001600160781b03908116919081168210156195c757906194c3816195b0936180ae565b855190916001600160781b03916194dc919083166180ae565b16855260208501805190947fb5ca5bab0e3b64ed0f778724d9e9821b9d907fa9086b6e0ea92014fe1ab3dcba9161012091906001600160781b03906195249086908316616a37565b16968790526012548851601654986001600160781b03968716986001600160801b038b16976001600160401b039490941694939192909116906195678a896161aa565b936040519586528a602087015260408601526060850152608084015260a08301528760801c60c08301528460e0830152610100820152a16001600160801b039261892290617c88565b6001600160801b0319909216911617601655618aed565b6001600160781b0393506195dc9250906180ae565b168152618aed565b9091826195f091616a37565b60165490926001600160801b031990619616906001600160781b0316608084901c616396565b60801b169060018060801b031617601655618a42565b946001600160781b03918216935090831161140b576016546001600160801b0361965885828416616396565b6001600160801b03199092169116176016556189fa565b618979670de0b6b3a76400006189735f94618963565b61968e8161aa69565b9060085f6001600160401b0360125416089060088210156100f257601890910180547f8bd0ad85443d99cb34374c3bba38adb467cccb02feb4cbc0b16d18c4b4f452c29360409392916001600160781b03916196eb918316616a37565b1660018060781b03198254161790556001600160401b03601254169082519182526020820152a15f6188a9565b61818c86619725936161aa565b93838511619843575b82851161983a575b6197416123ac615c08565b808611619832575b5084619756575b8061885b565b6197b7926181919286926001600160801b031990619777906173c886617c88565b60801b169060018060801b0316176013557fd9da440b9eabce7720ccaa3811405047f2972588a1b1ee1d9ed5e18dbe5db4b56020604051848152a16161aa565b9160085f6001600160401b0360125416089160088310156100f257601890920180546001600160781b0319166001600160781b039094169390931790925561980291618191916161aa565b60085f6001600160401b0360125416089060088210156100f25761982891601801617cbc565b5f80808080619750565b94505f619749565b93508193619736565b9350829361972e565b619857919350615dc0565b915f61871c565b905061987a91935060403d6040116122e7576122d88183615adc565b92905f618714565b600190565b6001600160401b03603b54165b620f42405a1115619928576001600160401b03811690678ac7230489e7ffff82146198fc576198d2906001600160401b031960015c1660015d61b46d565b6001600160401b031960015c1660015d5f5260366020526001600160401b0360405f205416619894565b678ac7230489e7ffff91506001600160401b03905b16806001600160401b0319603b541617603b551490565b6001600160401b03678ac7230489e7ffff91619911565b9060018060a01b031691825f52600360205261995d60405f20615ca0565b6199668561718f565b6001600160a01b03909216928315619afb5781516001600160801b039081169084168110619ae45750619a7a91906001600160401b0390858714619ac057855f5260036020526199eb6199bb60405f20615ca0565b6020810180516001600160801b03906199d7908a908316615f93565b169052875f52600360205260405f20615f64565b85875f516020620108865f395f51905f5260206040518c8152a35b82516001600160801b039081168690038116845291165f818152600560209081526040808320898452825280832080546001600160801b03198082169188168b01881691909117909155600d8054968716608097881c909a0190961b16979097179093558781526003909252939020615f64565b7f45d67bb4735e13f58323fb3dca98d7e59f5ecd6194ea476d0c62a032eb6b99f76020604051868152a36040519182525f516020620108865f395f51905f5260203093a3565b6020830180516001600160801b0390619adc9088908316615f93565b169052619a06565b869063067f31a160e51b5f5260045260245260445ffd5b631b31744560e11b5f5260045ffd5b81601f8201121561071757805190619b2182615b81565b92619b2f6040519485615adc565b8284526020838301011161071757815f9260208093018386015e8301015290565b91610180838303126107175782516001600160a01b03811681036107175792619b7b602082016166c9565b9260408201519260608301519260808101519260a08201519260c08301519260e08101519261010082015192610120830151926101408101516001600160401b0381116107175783619bce918301619b0a565b926101608201516001600160401b038111610717576162e39201619b0a565b6001600160401b036001911601906001600160401b03821161140b57565b6001600160401b0316801561140b575f190190565b6001600160401b03811691619c37828415156166a5565b6001600160a01b0316908115616795576002600160401b035f819052600f6020527fec7d38684056dd22d1781636ecf6a1ccfc211d4bfe5176bdec4c27c7346e61fb5460ff1615801561a289575b1561a27657830361a1e5575b825f52600f60205260ff60405f20541661a16857815f5260356020526001600160401b0360405f2054168061a1d057506039545f19811461140b576001016039555f5b6008811061a19557505f838152600f60209081526040808320805460ff1916600117905560339091529020805460ff60801b1916600160801b179055619d199061ce39565b5f838152603360209081526040808320805460ff60881b191694151560881b60ff60881b16949094179093556034905220546001600160a01b03161580159061a177575b61a16857816040917f7429a06e9412e469f0d64f9d222640b0af359f556b709e2913588c227851b88d935f526034602052825f208160018060a01b0319825416179055805f526035602052825f20826001600160401b0319825416179055619feb6001600160401b0360125416835f526030602052619e4a619df2865f20600860016001600160401b03601254160890616a50565b50619dfc83619bed565b906001600160401b03885192619e1184615aa5565b168252600160208301525f888301525f60608301525f60808301525f60a08301525f60c08301525f60e08301525f61010083015261cf06565b835f526030602052619eb8619e71865f2060085f6001600160401b03601254160890616a50565b50865190619e7e82615aa5565b838252600160208301525f888301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b8061a15a575b835f526030602052619ee3855f2060085f196001600160401b03601254160890616a50565b50619f378651619ef281615aa5565b6001600160401b03841692838252600160208301525f898301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b61a14c575b835f526030602052619f62855f2060086001196001600160401b03601254160890616a50565b50619f718651619ef281615aa5565b61a13e575b835f526030602052619f9c855f2060086002196001600160401b03601254160890616a50565b506001600160401b03865192619fb184615aa5565b168252600160208301525f868301525f60608301525f6080830152600160a08301525f60c08301525f60e08301525f61010083015261cf06565b815f52603160205261a01861a012845f2060085f6001600160401b03601254160890616a50565b5061b438565b815f52603160205261a04061a012845f20600860016001600160401b03601254160890616a50565b815f52603260205261a06761a012845f2060085f6001600160401b03601254160890616a50565b815f52603260205261a08f61a012845f20600860016001600160401b03601254160890616a50565b678ac7230489e7ffff5f5260376020526001600160401b03835f205416805f526036602052835f20836001600160401b0319825416179055825f5260376020526001600160401b03845f2091166001600160401b0319825416179055815f526036602052825f20678ac7230489e7ffff6001600160401b0319825416179055678ac7230489e7ffff5f526037602052825f20826001600160401b031982541617905582519182526020820152a1565b61a14790619c0b565b619f76565b61a15590619c0b565b619f3c565b61a16390619c0b565b619ebe565b6306abec9560e11b5f5260045ffd5b50805f5260356020526001600160401b0360405f2054161515619d5d565b835f5260306020526001600160401b0361a1b28260405f20616a50565b50541661a1c157600101619cd4565b63035d00bf60e11b5f5260045ffd5b831461a1c1576306abec9560e11b5f5260045ffd5b6040516315b6b1cd60e11b8152600481018490525f81602481836110006201a2c0f15f918161a247575b5061a22757836319708e7160e01b5f5260045260245ffd5b6001600160a01b0316619c9157826319708e7160e01b5f5260045260245ffd5b61a2649192503d805f833e61a25c8183615adc565b810190619b50565b5050505050505050505050905f61a20f565b826359bff38760e01b5f5260045260245ffd5b506002600160a01b03831415619c85565b8151602090920151616aa6926001600160801b0390811691168082111561a2d95761a2c4916161aa565b905b602001516001600160801b03169061609b565b50505f9061a2c6565b61a2f461a2ee8261cd78565b9161cdc4565b602081519101209060405191602083019160ff60f81b83523060601b6021850152603584015260558301526055825261a32e607583615adc565b905190206001600160a01b031690565b61a3926001600160401b0361a39b9294939416805f52600560205260405f2060018060a01b0386165f5260205260405f20946040519161a37d83615a8a565b82526001600160a01b0316602082015261d286565b91825c9061609b565b91546001600160801b031682811061a3b157505d565b9050636f6700d160e01b5f5260045260245260445ffd5b6001600160a01b03808416969495908216947ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db946040949361a438929161a41c91859190828d8c0361a44f575b5050617d16565b61a42588617c88565b906001600160801b039061320790617c88565b825195865260208601526001600160a01b031693a4565b61a4599183616b74565b5f8261a415565b60085f6001600160401b03601254160860088110156100f257602001546001600160401b0316615f91576001600160401b03601254161561a49d57565b7f1b555aca7137ecab873ff5825c4daff389c38ba0c5fd4f3ed4741665aea9c12680546001600160401b0319908116678ac7230489e7ffff9081179092555f9190915260376020527f2e5537df34089dba0cf2fa8ffc5e5669698de0ece308945b7dc8e76dc0fb21fb8054909116670f6b75ab2bc471c71790556002600160401b0361a5306002600160a01b0382619c20565b806001600160401b0319603b541617603b5561a54d603954618506565b6039555f908152603360205260409020805461ffff60881b191661010160881b17905560128054600a6001600160401b03199091168117909155600890600119900860088110156100f25760200180546001600160401b03191660071790556012546008908190600119906001600160401b031608818110156100f2576020016001600160401b0382166001600160401b0319825416179055805f196001600160401b036012541608818110156100f25760200180546001600160401b031916600917905560125481905f906001600160401b031608818110156100f257602001600a6001600160401b03198254161790558060016001600160401b036012541608818110156100f25760200180546001600160401b031916600b17905560125481906002906001600160401b031608818110156100f25760200180546001600160401b031916600c17905566470de4df820000603a555f5b81811261a91d575061a6b6615c08565b815f6001600160401b036012541608828110156100f25761a6de91479161889d618894615be2565b8061a6fa575b505061a6ee618654565b5061a6f7619887565b50565b6040516304fd660560e41b81523060048201525f6024820181905281604481836110005af19081156122ee575f905f9261a86a575b501561a85b575161a84c576013546001600160801b038116158015919061a83f575b5061a830576015546001600160801b038116158015919061a823575b50801561a815575b61a806576016546001600160801b038116158015919061a7f9575b5061a7ea5761a79e9061aa69565b90805f6001600160401b036012541608908110156100f257601801805490916001600160781b039161a7d291908316616a37565b82546001600160781b03191691161790555f8061a6e4565b63192c1f5b60e31b5f5260045ffd5b905060801c15155f61a790565b63ed9fd63760e01b5f5260045ffd5b5060125460801c151561a775565b905060801c15155f61a76d565b632235bb3560e01b5f5260045ffd5b905060801c15155f61a751565b6365c269bd60e11b5f5260045ffd5b63476954c760e11b5f5260045ffd5b9150503d805f833e61a87c8183615adc565b8101906060818303126107175761a892816166dd565b9061a89f602082016166c9565b506040810151906001600160401b03821161071757019180601f8401121561071757825161a8cc81615afd565b9361a8da6040519586615adc565b81855260208086019260051b82010192831161071757602001905b82821061a905575050505f61a72f565b6020809161a912846166c9565b81520191019061a8f5565b8061a929600192616b02565b805460ff60f01b191660f084901b17905561a94381616b36565b805460ff60f01b191660f084901b1790550161a6a6565b80156160165761862b9061a96c61827a565b9061a975615c54565b9261b069565b9190823b61a9b6579061a98d9161d123565b5061a99781616a19565b15918261a9a357505090565b6001600160a01b03918216911614919050565b915f9261a9ec61a9fa85946040519283916020830195630b135d3f60e11b875260248401526040604484015260648301906157fc565b03601f198101835282615adc565b51915afa3d1561aa62573d61aa0e81615b81565b9061aa1c6040519283615adc565b81523d5f602083013e5b8161aa54575b8161aa35575090565b90506020818051810103126107175760200151630b135d3f60e11b1490565b90506020815110159061aa2c565b606061aa26565b600160781b811015614a4d576001600160781b031690565b516162e3939192916183009161aabe9161aaa3916001600160801b031661609b565b6020850151945190946001600160801b039182169116615f93565b60a0909201516001600160801b039290831690615f93565b60405161aae281615a8a565b6017546001600160781b038116825260781c6001600160401b03166020820181905261ab0e90436161aa565b90516001600160781b03169061c3508111801561abbb575b61ab8d5761c350039061c350821161140b5761ab4561c350838361d15d565b9061ab579261c350910915159061609b565b60085f6001600160401b0360125416089060088210156100f2576028909101546162e3919060781c6001600160781b031661609b565b505060085f6001600160401b03601254160860088110156100f2576028015460781c6001600160781b031690565b50811561ab26565b929160018061abd383858861d15d565b9461abdd81616a19565b1614918261abf5575b50506162e3925015159061609b565b90809250156161f8576162e3930915155f8061abe6565b6001600160a01b0316908115616c07576001600160a01b0316918215616bf45760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591835f526004825260405f20855f5282528060405f2055604051908152a3565b61ac7761d1fb565b61ac7f61d253565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a0815261acd060c082615adc565b51902090565b92916001600160401b03909491941692835f52600760205260405f2060018060a01b0384165f5260205261ad0c60405f206160a8565b90845f52600860205260405f2060018060a01b0385165f5260205260405f206040519061ad3882615a6f565b5460018060801b038116825263ffffffff8160801c169081602084015260a01c604083015265ffffffffffff61ad756020860192828451166162e6565b16431161aec3575b505182516001600160801b0391821691168082111561aeb75761ad9f91616396565b81516001600160801b039161adc491908316908316818118918111919091021861718f565b1690811561aeac5761adec60209261ae499560018060801b031690818110908218021861718f565b87516001600160801b039081168201811690985283518816810188168452815188168190038816825291018051871682019096169095525f8481526007602090815260408083206001600160a01b03871684529091529020616ec5565b6040516001600160801b038416808252926001600160a01b03929092169182917f45d67bb4735e13f58323fb3dca98d7e59f5ecd6194ea476d0c62a032eb6b99f790602090a36040519182525f516020620108865f395f51905f5260203093a390565b505050505050505f90565b50505050505050505f90565b5f845265ffffffffffff431690525f61ad7d565b604051637dd6585f60e11b81525f919060208160048186611000612774f15f918161af24575b5061af0f57506002600160401b039150565b6001600160401b03811661af205750565b9150565b9091506020813d60201161af58575b8161af4060209383615adc565b810103126107175761af51906166c9565b905f61aefd565b3d915061af33565b6001600160a01b0316905f905f516020620108865f395f51905f5290602090841561af8b8115616c57565b61af948261718f565b600d549091906001600160801b0361afae84828416615f93565b6001600160801b0319909216911617600d55851461aff457600d80546001600160801b031981166001600160801b039182169390930316919091179055604051908152a3565b8585526003835260408520805490916001600160801b0391616d4891908316615f93565b61b0219061aa69565b60085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161b05691908316616a37565b82546001600160781b0319169116179055565b9392841561b1e357602081015181516001600160801b03918216939116918690851561b1c1575050811561b15d5781838561b0a39361d398565b9493818a989398949294111561b1455750505061b0c090876161aa565b91676765c793fa10079d601b1b019283676765c793fa10079d601b1b1161140b5783676765c793fa10079d601b1b840293676765c793fa10079d601b1b81860414901517021561b138578661b12c61b1266162e39761b13197633b9aca0097049061609b565b826161aa565b61d345565b80936161aa565b63ad251c275f526004601cfd5b6162e39750633b9aca00955061b1319693508961e24b565b5090809250676765c793fa10079d601b1b019081676765c793fa10079d601b1b1161140b57676765c793fa10079d601b1b85029082676765c793fa10079d601b1b87840414021561b138576162e3938661b12c61b13195633b9aca009504826161aa565b6162e39550633b9aca009392509061b1dd61b13195928261d2ac565b5061d345565b50505090505f905f90565b9392919091841561b1e357602081015181516001600160801b0391821694911691831561b3f55750811561b3ac5781848461b2289361d398565b9493828a9793949297111561b28f5750505061b24490876161aa565b91676765c793fa10079d601b1b019384676765c793fa10079d601b1b1161140b5761b27e61b28894612f6261830d97633b9aca009661d479565b61b12c88826161aa565b809361609b565b925092959793509350670de0b6b3a7640000830284670de0b6b3a764000085830414021561b1385784900482811161b3a5575b8061b37b575061b2fa633b9aca00868987868661b2f561b2ef86868661b2e95f5b8761609b565b8661e214565b8b61609b565b61e24b565b9461b305868561609b565b95978661b317575b5050505050509190565b5f1987019587871161140b5761b33394633b9aca00948861e24b565b91818380831015928361b366575b50505061b352575b8080808061b30d565b81945061b35f925061609b565b5f8061b349565b61b3719293506161aa565b101581835f61b341565b5f19810190811161140b57633b9aca00868987868661b2f561b2ef86868661b2e961b2fa9c61b2e3565b508161b2c2565b50918091508402676765c793fa10079d601b1b8286830414021561b1385761830d9261b28892676765c793fa10079d601b1b633b9aca00930461b3ef818961609b565b9061d345565b905061b404919392508561d406565b81158061b430575b61b424579261b28892633b9aca009261830d9561d345565b5050505090505f905f90565b50801561b40c565b80546001600160f81b031916600160f01b179055565b6040919493926001600160401b03606083019616825260208201520152565b6001600160401b03811690670f6b75ab2bc471c7821461cd74576002600160401b03820361b49f575050615f9161d6d9565b811561cd4657815f52603060205261b4cb60405f2060085f196001600160401b03601254160890616a50565b50805460ff8160601c16616ba85760ff60601b1916600160601b1790555f8281526033602052604090205460801c60ff1661cd0c575b4760801b6002175f5d8061b5148161e540565b5f809392935d1561ccb2579061b5299161ea20565b815f52603060205261b55060405f2060086002196001600160401b03601254160890616a50565b50805460ff8160581c1661cc70575b5050815f52603060205261b58860405f2060086001196001600160401b03601254160890616a50565b50805460ff8160581c16155f1461cc2e575060ff815460481c1661cbf5575b505b815f52603060205261b5cf60405f2060085f196001600160401b03601254160890616a50565b50805460ff8160581c161561cbad575b5050815f52603160205261b60760405f2060085f196001600160401b03601254160890616a50565b50546001600160781b0316670de0b6b3a7640000811061cb4c5761b62b818361f02e565b901561ca66576001600160781b038116908282101561ca565761b6db61b6e19161b6e6947f2ca8882a937b22102ae3d32cab93eb7601862f926bab6ebce8ebb7b52ca5a01560a04761b67e614fa2615c08565b604051918583528960208401526040830152606082015260026080820152a1875f5260346020525f516020620108a65f395f51905f528760018060a01b0360405f20541661b6d347856040519485948561db92565b0390a16180ae565b8461ef94565b61f0f3565b815f52603060205261b71661b70f60405f2060085f196001600160401b03601254160890616a50565b508261dbfc565b815f52603060205261b7dc61b74060405f2060086001196001600160401b03601254160890616a50565b50835f52603060205261b76760405f2060085f196001600160401b03601254160890616a50565b5090845f52603260205261b78f60405f2060085f196001600160401b03601254160890616a50565b50855f52603260205261b7d661b7d061b7d061b7ca61b7c360405f2060086001196001600160401b03601254160890616a50565b5095615d30565b95615d30565b92615b4b565b9261e0e8565b825f52603060205261b80260405f2060085f196001600160401b03601254160890616a50565b506001600160801b03906101009061b81990615d30565b01511680821161ca40575061b82f614af8615c08565b60085f196001600160401b03601254160860088110156100f25760086001196001600160401b0360125416089260088410156100f25760085f196001600160401b0360125416089260088410156100f257865f52603160205261b8a760405f2060086001196001600160401b03601254160890616a50565b5094875f52603160205261b8cf60405f2060085f196001600160401b03601254160890616a50565b5095885f52603060205261b98661b93a61b93461b92e61b92861b91f61b91661b90c60405f2060085f196001600160401b03601254160890616a50565b509b601801615b4b565b97602801615b4b565b9a602801615b4b565b94615b4b565b99615b4b565b96615d30565b60209687015196909801515f98978997909161b962916001600160781b03918216911661609b565b602093840151919093015160019390931c926001600160781b03908116911661609b565b60011c90633b9aca0081118061ca27575b8061ca1e575b61c9fa575b5050602001516001600160781b0316633b9aca0081118061c9f1575b8061c9e8575b61c9c3575b5050508083111561c9895761ba05906001600160801b039061b9eb90856161aa565b6101009093015192169182906001600160801b0316615f93565b915f5b8391838295885f52603360205260ff60405f205460801c161590811561c96b575b5061c7b6575b50919291508190506001600160801b03811683633b9aca0082101561c1ea575061ba65926001600160801b0316915061aa699050565b916001600160781b0383169082908261c0045750505090835f52603460205260018060a01b0360405f20541660085f196001600160401b03601254160860088110156100f2576020908101545f878152603383526040908190205481519485529284018890526001600160401b03909116908301526001600160801b03841660608301526001600160781b038316608083015260ff608882901c8116151560a084015260909190911c16151560c08201527f7a444ffda68842e454edcf5ad9e286d7a90d72b731bc5cd982e8ece0cbc955059060e090a15b505b825f52603060205261bc9a61bb6a61111e60405f2060085f6001600160401b03601254160890616a50565b6001600160401b03601254169260ff60208301511690604083015161bfed575b61bbb990875f52603060205261bbb360405f2060085f6001600160401b03601254160890616a50565b5061cedd565b855f52603160205261bbe261a01260405f20600860026001600160401b03601254160890616a50565b855f52603260205261bc0b61a01260405f20600860026001600160401b03601254160890616a50565b855f52603060205261bc3160405f20600860016001600160401b03601254160890616a50565b509061bc3c85619bed565b9260ff60e060c083015115159201511515926001600160401b036040519661bc6388615aa5565b1686521660208501525f60408501525f60608501525f60808501525f60a085015260c084015260e08301525f61010083015261cf06565b825f52603360205260ff60405f205460801c165f1461bd92575f83815260336020526040902080546001600160401b0319166001600160401b0392909216919091179081905560901c60ff16158061bd78575b61bd69575b505b5f908152603460205260409020546001600160a01b0316803b61bd145750565b60205f9160046040518094819363c33fb87760e01b8352620186a0f161bd375750565b6020813d60201161bd61575b8161bd5060209383615adc565b810103126107175761a6f7906166dd565b3d915061bd43565b61bd7290618512565b5f61bcf2565b50815f52603360205260ff60405f205460881c161561bced565b9050815f5260336020526001600160401b0360405f205416906007820180921161140b571061bcf457805f52600f60205260ff60405f205416156185d9575f8181526033602052604090205460801c60ff1661bfde576001600160401b0360125416815f5260336020526001600160401b0360405f205416906007820180921161140b571061bfcf57805f52603060205261be4060405f2060085f6001600160401b03601254160890616a50565b5080546001600160401b03191690555f818152600f60209081526040808320805460ff1916905560349091529020546001600160a01b03168061bf94575b50805f5260336020525f6040812055805f5260366020526001600160401b0360405f205416815f5260376020526001600160401b0360405f20541690815f52603660205260405f206001600160401b0382166001600160401b03198254161790555f5260376020526001600160401b0360405f2091166001600160401b03198254161790555f5b6008811061bf3d57507f12048e179cb277774d73abb2f522205e0fcd471ab52fa6feb7b5b5508dd26a216020604051838152a161bcf4565b600190825f52603060205261bf5e61bf588260405f20616a50565b90617e36565b825f52603160205261bf7661bf588260405f20616a50565b825f52603260205261bf8e61bf588260405f20616a50565b0161bf05565b5f90815260356020908152604080832080546001600160401b03191690558383526034909152812080546001600160a01b031916905561be7e565b63f80f20c760e01b5f5260045ffd5b63786b336560e01b5f5260045ffd5b90600160ff910116908161bb8a576001915061bb8a565b1561c0fa575061c01f916001600160781b0384169150615f93565b9060085f6001600160401b0360125416089060088210156100f2576018909101805461c05a926108e29160781c6001600160781b0316616a37565b5f835f52603460205260018060a01b0360405f20541660085f196001600160401b03601254160860088110156100f2577fd1f415bb27cdd1ef9c25bec81d99ceb87ce8e6ed1bcb9647d44634c6b636dff69161c0f26001600160401b0387936020015416885f52603360205260ff60405f205460881c16895f5260336020528760ff60405f205460901c16926040519687968761f308565b0390a161bb3d565b61c1049250616396565b9060085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c13a91908316616a37565b82546001600160781b03191691161790555f838152603460205260408120546012546001600160a01b0391909116906008905f19906001600160401b03160860088110156100f2577fe2aa2cd3812cdb201e7ac23eb41f936733caf10d3e6007b97cb59acb9a3b80fb9161c0f26001600160401b0387936020015416885f52603360205260ff60405f205460881c16895f5260336020528760ff60405f205460901c16926040519687968761f308565b909192945f1461c4f957505050818192855f52603060205261c23160ff61c22460405f2060085f6001600160401b03601254160890616a50565b505460401c16828761f8d3565b93901561c4455750506001600160801b038281169290821680841061c36b575b50509061c25d9061aa69565b845f52603060205261c28260405f2060085f6001600160401b03601254160890616a50565b50805460ff60481b1916600160481b1790555f85815260306020526040812060125461c2bb926008916001600160401b03160890616a50565b50805460ff60501b1916905561c2fd61c2d261d4ad565b865f52603060205261c2f760405f2060085f6001600160401b03601254160890616a50565b5061cec0565b845f52603260205261c325613e9260405f2060085f6001600160401b03601254160890616a50565b60145490600160781b600160f01b039061c34c90607884901c6001600160781b0316616a37565b60781b16600160781b600160f01b031991909116176014555b5061bb3f565b907f6d990c2ca2b7a15bfa6b29d936448959e8cf45e8a4680d60ebd958235626d8d360a061c3e993895f526034602052600180831b0360405f205416906001600160401b0361c3b86185e8565b6040519384528c60208501521660408301526060820152866080820152a16001600160801b03906143d99084616396565b6001600160781b0381169361c3ff908590615f93565b9360085f6001600160401b0360125416089260088410156100f2576173ba61c43e936108e261c25d966018019160018060781b03835460781c16616a37565b905f61c251565b81945061c46f935061c460925061c45b8661e86c565b615f93565b916001600160801b031661aa69565b60085f6001600160401b0360125416089060088210156100f2576018909101805461c4a9926108e29160781c6001600160781b0316616a37565b5f835f5260346020527f3f91c9d606a05e746839cb2153ee473c26bc1d7c2493559494a27a5e823989b98360018060a01b0360405f20541661c4f1856040519384938461f2ce565b0390a161c365565b935090915082908261c50b818761f7e6565b93901561c707575050506001600160801b0382811690821681811061c63c575b5061c5419150506001600160801b03821661aa69565b845f52603060205261c58a61c56960405f2060085f6001600160401b03601254160890616a50565b50805461ffff60481b1916600160501b17815561c58461d4ad565b9061cec0565b845f52603260205261c5af60405f2060085f6001600160401b03601254160890616a50565b5080546001600160781b039061c5c89084908316616a37565b82546001600160781b03191691161790556014546001600160781b0361c5f083838316616a37565b6001600160781b0319909216911617601455601354906001600160801b039061c624906001600160781b0316828416615f93565b6001600160801b03199092169116176013555061bb3f565b927f2ca8882a937b22102ae3d32cab93eb7601862f926bab6ebce8ebb7b52ca5a01560a061c6a79361c6b895964761c675614fa2615c08565b9160405193845260208401526040830152606082015260016080820152a16001600160801b03906143d9908590616396565b926001600160781b03841690616396565b9160085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c6ee91908316616a37565b82546001600160781b03191691161790555f808061c52b565b9091945061c724935061c71e92506173ba8661e792565b9161aa69565b60085f6001600160401b03601254160860088110156100f257601801805490916001600160781b039161c75991908316616a37565b82546001600160781b03191691161790555f838152603460205260408082205490517f5dc5856f210c6db0655896374b2cac8ad9266793361aed17faae007aa663ed6491819061c4f190869088906001600160a01b03168461f2ce565b925092509250845f52603060205261c86961c7e660405f2060086001196001600160401b03601254160890616a50565b50865f52603060205261c80d60405f2060085f196001600160401b03601254160890616a50565b5090875f52603260205261c83560405f2060085f196001600160401b03601254160890616a50565b50885f52603260205261b7d661b7d061b7d061b7ca61b7c360405f2060086001196001600160401b03601254160890616a50565b928261c8c5575b50505061c87c90617c88565b825f52603060205261c8b98161c8a660405f2060085f196001600160401b03601254160890616a50565b505460781c6001600160801b0316616396565b906001915f808061ba2f565b1561c9525761c8dd906001600160801b0316836161aa565b905b818110908218029081810361c8f5575b8061c870565b61c8ff911861aa69565b9060085f6001600160401b0360125416089160088310156100f2576018909201805461c87c936001600160781b039161c93a91908316616a37565b82546001600160781b0319169116179055905f61c8ef565b61c965906001600160801b03168361609b565b9061c8df565b670de0b6b3a76400006001600160801b03919091161090505f61ba29565b61c9bb906001600160801b039061c9a19085906161aa565b6101009093015192169182906001600160801b0316616396565b91600161ba08565b819293508381029381850414901517021561b1385780820491061515015f808061b9c9565b5082151561b9c4565b5081151561b9be565b825192975061ca169261687491906001600160781b03166161db565b945f8061b9a2565b5081151561b99d565b508251633b9aca006001600160781b039091161161b997565b906304cce29f60e41b5f5260045260245260445ffd5b505061ca619061f0f3565b61b6e6565b50825f5260346020525f516020620108a65f395f51905f5260a0600180821b0360405f20541647604051918252866020830152846040830152606082015260026080820152a16013546001600160801b031961cac683608084901c616396565b60801b166001600160801b03918216176013556015549061cae983838316616396565b6001600160801b03199092169116176015556012546008905f906001600160401b03160860088110156100f257601801805490916001600160781b039161cb3291908316616a37565b82546001600160781b031916911617905561ca618161e6b8565b8061cb58575b5061b6e6565b61cba790835f5260346020525f516020620108a65f395f51905f5260a0600180821b0360405f20541647604051918252876020830152846040830152606082015260036080820152a18261ef94565b5f61cb52565b60501c60ff1661cbbe575b8061b5df565b61cbef90835f52603260205261cbe860405f2060085f196001600160401b03601254160890616a50565b509061ef59565b5f61cbb8565b61cc2890835f52603260205261cc2060405f2060086001196001600160401b03601254160890616a50565b50908361eb4d565b5f61b5a7565b60501c60ff1661cc3f575b5061b5a9565b61cc6a90835f52603260205261cbe860405f2060086001196001600160401b03601254160890616a50565b5f61cc39565b60481c60ff1661cc81575b8061b55f565b61ccac90835f52603260205261cc2060405f2060086002196001600160401b03601254160890616a50565b5f61cc7b565b7f59fb2c26df726f79f2e83d990dca2ab84a57a26d37a6d1f4199adc3d44e65ba29161ccdd8261e5de565b845f52603460205261cd0460018060a01b0360405f2054169147906040519485948561db92565b0390a161b529565b5f828152603360205260409020805461ffff60881b19811660889190911c60ff16151560901b60ff60901b1617600160881b17905561b501565b50507fa618939919fa454c33a38ff371f9a892aa25aedcc6553602e1bb242a0699a2b66020604051418152a1565b5050565b60405160208101917f613d7e18a976d3e4e2209750b65b9bfe5777159616fa13d0e2a8ecfdf54a1071835260018060c01b03199060c01b1660408201526028815261acd0604882615adc565b6162e3610cff9160206040519161cddd82860184615adc565b848352818301946200fa8786396040516001600160401b038382019216825282815261ce0a604082615adc565b6040519586945180918587015e840190838201905f8252519283915e01015f815203601f198101835282615adc565b61ce4161d4ad565b6040516315b6b1cd60e11b81526001600160401b039092166004830152905f81602481836110005af191825f925f9461ce93575b5061ce81575050505f90565b1561ce8c5750151590565b9050151590565b90935061ceab9192503d805f833e61a25c8183615adc565b5050509897505094505050505091925f61ce75565b805460ff60581b191691151560581b60ff60581b16919091179055565b8054600160781b600160f81b03191660789290921b600160781b600160f81b0316919091179055565b81518154602084015160408086015160608701516001600160581b03199094166001600160401b03959095169490941791901b60ff60401b161791151560481b60ff60481b169190911790151560501b60ff60501b161781556080820151615f91929061cf759015158361cec0565b60a0810151825460c083015161ffff60601b1990911691151560601b60ff60601b169190911790151560681b60ff60681b1617825560e0810151825460ff60701b191690151560701b60ff60701b1617825561010001516001600160801b03169061cedd565b60ff5f516020620109065f395f51905f525460401c161561cff857565b631afcd79f60e31b5f5260045ffd5b9061d01392939161a29a565b90516001600160781b03168082111561636c576162e3916161aa565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b03841161d09c579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa156122ee575f516001600160a01b0381161561d09257905f905f90565b505f906001905f90565b5050505f9160039190565b61d0b081616a19565b8061d0b9575050565b61d0c281616a19565b6001810361d0d95763f645eedf60e01b5f5260045ffd5b61d0e281616a19565b6002810361d0fd575063fce698f760e01b5f5260045260245ffd5b60039061d10981616a19565b1461d1115750565b6335e2f38360e21b5f5260045260245ffd5b815191906041830361d1535761d14c9250602082015190606060408401519301515f1a9061d02f565b9192909190565b50505f9160029190565b90915f19838309928083029283808610950394808603951461d1ee578483111561d1d65790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906162e392506161ee565b61d203618388565b805190811561d213576020012090565b50505f516020620107e65f395f51905f5254801561d22e5790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61d25b618457565b805190811561d26b576020012090565b50505f516020620109465f395f51905f5254801561d22e5790565b602081015190516001600160401b031660409190911b600160401b600160e01b03161790565b90811561d33d576020810151905161d2d0916001600160801b03918216911661609b565b676765c793fa10079d601b1b81101561d33757676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b57676765c793fa10079d601b1b82029080676765c793fa10079d601b1b84840414021561b1385761d334910480926161aa565b91565b50905f90565b50505f905f90565b91939290938315801561d390575b61d3885715908161d37f575b5061d379578181101561d37957508082101561649e575090565b91505090565b9050155f61d35f565b505091505090565b50841561d353565b8161d3a59193929361e171565b9384670de0b6b3a764000003670de0b6b3a7640000811161140b578094670de0b6b3a7640000858084029384041488821417021561b1385761d40061d3fa8286670de0b6b3a76400006162e39604988b61e1af565b8661609b565b9361609b565b9190821561d471576020810151905161d42b916001600160801b03918216911661609b565b676765c793fa10079d601b1b81101561d47157676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b5761d46a6162e3918461d479565b92836161aa565b505f91508190565b8181029181159183041417676765c793fa10079d601b1b021561b13857676765c793fa10079d601b1b808204910615150190565b60408051630eaf323560e31b815290816004815f6110005af19081156122ee575f9161d4d7575090565b61649e915060403d6040116122e7576122d88183615adc565b602081015190516001600160801b039161d50e918316908316615f93565b1690565b9190603a549061d520615c08565b9361d54a61d53f4761d530615c2e565b61d538615cc5565b908961aa81565b9547906123b6615be2565b6001841461d670575b61d569670de0b6b3a764000061897386896161db565b916001600160801b038084169190851682111561d64357505061d58b90617c88565b9261d5968484615f93565b6001600160801b038381169116101561d63457505061d5cb9161d5b891615f93565b926168746001600160801b0385166161b7565b80670de0b6b3a764000010670de0b6b3a764000082180280821890612710820291820461271014908314171561140b57670de0b6b3a7640000900462010000811015614a4d576012805461ffff60401b191660409290921b61ffff60401b169190911790559190565b92509350506001603a5561d5cb565b6001600160801b0381169795909450915086111561d6345750509061687461d66b92946161b7565b61d5cb565b925061d67a617fb7565b9261d691866168746001600160801b0386166161b7565b655af3107a4000810180821161140b5785111561d6b2575083603a5561d553565b655af3107a4000850180861161140b57101561d6d15783603a5561d553565b505092509190565b60085f196001600160401b03601254160860088110156100f2576020015460601c60ff16615f915760085f196001600160401b03601254160860088110156100f2576001600160401b039060200154167f41c24504ba2202296404fa24c296cf07c5e04142af4b7f225cd1d38e50bcded16002600160401b0391825f52603160205261d77860405f2060085f6001600160401b03601254160890616a50565b5060018060781b0390541690835f52603160205261d7ca61d7ac60405f2060085f6001600160401b03601254160890616a50565b505460405193849360789290921c6001600160781b0316918461b44e565b0390a1805f52603060205261d7f561111e60405f2060085f6001600160401b03601254160890616a50565b61d8cb6001600160401b03601254169160ff602082015116604082015161db7f575b845f52603060205261d83c60405f2060085f6001600160401b03601254160890616a50565b508054600160781b600160f81b03191690555f85815260316020526040902060125461d87c9161a012916008906002906001600160401b03160890616a50565b845f52603260205261d8a561a01260405f20600860026001600160401b03601254160890616a50565b845f52603060205261bc3160405f20600860016001600160401b03601254160890616a50565b815f52603360205260ff60405f205460801c165f1461d948575f82815260336020526040902080546001600160401b0319166001600160401b0392909216919091179081905560901c60ff16158061d92e575b61d9255750565b615f9190618512565b50805f52603360205260ff60405f205460881c161561d91e565b815f5260336020526001600160401b0360405f205416906007820180921161140b57101561d9735750565b805f52600f60205260ff60405f205416156185d9575f8181526033602052604090205460801c60ff1661bfde576001600160401b0360125416815f5260336020526001600160401b0360405f205416906007820180921161140b571061bfcf57805f52603060205261d9f860405f2060085f6001600160401b03601254160890616a50565b5080546001600160401b03191690555f818152600f60209081526040808320805460ff1916905560349091529020546001600160a01b03168061db44575b50805f5260336020525f6040812055805f5260366020526001600160401b0360405f205416815f5260376020526001600160401b0360405f20541690815f52603660205260405f206001600160401b0382166001600160401b03198254161790555f5260376020526001600160401b0360405f2091166001600160401b03198254161790555f5b6008811061daf3575060207f12048e179cb277774d73abb2f522205e0fcd471ab52fa6feb7b5b5508dd26a2191604051908152a1565b600190825f52603060205261db0e61bf588260405f20616a50565b825f52603160205261db2661bf588260405f20616a50565b825f52603260205261db3e61bf588260405f20616a50565b0161dabd565b5f90815260356020908152604080832080546001600160401b03191690558383526034909152812080546001600160a01b031916905561da36565b60010160ff168061d8175750600161d817565b6001600160a01b0390911681526001600160401b039190911660208201526001600160781b03909116604082015260608101919091526001608082015260a00190565b909493926001600160401b0360609381608085019816845216602083015260408201520152565b61dc058161f182565b835460781c6001600160801b031692909161dc20838261609b565b935f945f5f916003195b5f811261e016575083810361dfa5575b5081810361df5c575b505083850361df15575b80841161decb5761dc5e84826161aa565b9282840361dc70575b50505050505050565b7f2471537e67bdd740cfb2bcc98c6c751404193debd0d9bbbcc1fc13f759fb2885906001600160401b03601254169061dcb085876040519485948561dbd5565b0390a18282111561dd6857509061dcc6916161aa565b9181811161dd32575b505061dcdd61dcfa91617c88565b9161dcf48360018060801b03835460781c16615f93565b9061cedd565b601354906001600160801b039061dd1390828416615f93565b6001600160801b03199092169116176013555b5f80808080808061dc67565b9061dd3c916161aa565b8082111561dd5a5761dd5461dcdd9161dcfa936161aa565b9161dccf565b505061dcfa61dcdd5f61dd54565b93919061dd74916161aa565b9181811161dea1575b505090670de0b6b3a76400008202828104670de0b6b3a7640000148315171561140b5761dda8616a93565b9066f8b0a10e47000082029180830466f8b0a10e470000149015171561140b571161de40575b8082111561de325761dde661ddeb9161de02936161aa565b617c88565b9161dcf48360018060801b03835460781c16616396565b601354906001600160801b039061de1b90828416616396565b6001600160801b031990921691161760135561dd26565b505061de0261ddeb5f617c88565b60085f6001600160401b03601254160860088110156100f257602001805460ff60681b1916600160681b1790556012546008905f906001600160401b03160860088110156100f257602001805460ff60701b1916600160701b17905561ddce565b9061deab916161aa565b8082111561dec35761debc916161aa565b5f8061dd7d565b50505f61debc565b90507ff8d9ad0cb8736113b136bbb4ef5911eada2ff3b9ce6571ef950261d2a31c817c945061df10919293506001600160401b0360125416936040519485948561dbd5565b0390a1565b7f58ae497b74652562674e50a5d0e1c848c89ac2eb353cf6d77a04aa109f0f5b0c856001600160401b036012541661df5487604051938493898561dbd5565b0390a161dc4d565b7f7b176f9ffcd617c7f68039e7926487ef362dd8a890f9a0f772aa1cba1f6100909161df9b6001600160401b036012541691604051938493898561dbd5565b0390a15f8061dc43565b6101007f42dcd2f1dad9ae3656703a35f73b789a9023e7da8ffdc147fa0778eedd524dac916001600160401b036012541690604051916001600160401b038a168352602083015286604083015260608201528360808201528460a08201528960c08201528860e0820152a15f61dc3a565b6001600160401b038716805f52603060205261e04560405f206008846001600160401b03601254160890616a50565b50905f52603260205261e06b60405f206008846001600160401b03601254160890616a50565b5090805460ff8160481c1661e0b3575b505460501c60ff1661e091575b5060010161dc2a565b54909860019161e0ac916001600160781b039091169061609b565b989061e088565b9460ff9196612f628361e0d661e0e19460018060781b03885460781c169061609b565b9860401c168c61f25c565b959061e07b565b909291606060018060801b036101008601511694015161e144575b5060608101511515908161e136575b5061e11b575090565b516001600160781b03168082111561636c576162e3916161aa565b60809150015115155f61e112565b519092906001600160781b03168082111561e1695761e162916161aa565b915f61e103565b50505f61e162565b811561636c5781670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b1385704670de0b6b3a7640000811061635057505f90565b9192909282670de0b6b3a76400001180159061e20c575b6164e55761e1fb61e2029161e1f58561e1ef670de0b6b3a764000061e20898810392018261f358565b9261f358565b9361f38b565b918461f3d3565b9261f47f565b0190565b50831561e1c6565b93919380821180159061e243575b6164dc5761e2089361e1f58261e1ef8561e1fb9561e202970392018261f358565b50841561e222565b949593909291928515801561e538575b61aeac5781676765c793fa10079d601b1b0180676765c793fa10079d601b1b1161140b57818802881591670de0b6b3a7640000848b8404148417021561e4c857670de0b6b3a764000061e2af92049061609b565b90676765c793fa10079d601c1b890290898204676765c793fa10079d601c1b14171561140b578461e2f08a92612f628361e2e987806161db565b928d61f53f565b8060018060881b031060071b81811c68ffffffffffffffffff1060061b1781811c64ffffffffff1060051b1781811c62ffffff1060041b1760b56201000083831c019160011c1b0260121c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c8082040160011c808092041090038381115f1461e4be5761e38e9361e389916161aa565b61f53f565b83670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b1385783900494878786881161e4b4575b8185849261b12c61e3dc95838b61e3d68f8c61609b565b8b61e214565b9761e3e789896161aa565b85670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b138578588910487811161e4ad575b1461e49b578587101561e4a6576001870180881161140b57965b871461e49b57838861b12c8361e45c97898861e44f8e61e4559b61609b565b9061e214565b80956161aa565b81670de0b6b3a7640000820291670de0b6b3a764000081840414901517021561b13857049080821161e493575b501461649e575090565b90505f61e489565b505050505050505090565b859661e430565b508661e416565b959650869561e3bf565b505050505f61e38e565b5f19848b098281108301900391670de0b6b3a7640000858c0983670de0b6b3a7640000111561e52b5761e2af93828211900360ee1b910360121c177faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669029061609b565b63ae47f7025f526004601cfd5b50831561e25b565b60405163a76e2ca560e01b81526001600160401b03909116600482015247906020816024815f611000620285fff15f918161e5a2575b5061e5835750505f905f90565b15618349576001600160781b039061e59b90476161aa565b1690600190565b9091506020813d60201161e5d6575b8161e5be60209383615adc565b810103126107175761e5cf906166dd565b905f61e576565b3d915061e5b1565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e6a8575b5061a6f757805f52603360205260ff60405f205460881c1661e68b575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260016060820152a1565b5f818152603360205260409020805460ff60881b1916905561e620565b61e6b2915061f5c5565b5f61e603565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e782575b5061a6f757805f52603360205260ff60405f205460881c1661e765575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260036060820152a1565b5f818152603360205260409020805460ff60881b1916905561e6fa565b61e78c915061f5c5565b5f61e6dd565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e85c575b5061a6f757805f52603360205260ff60405f205460881c1661e83f575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260056060820152a1565b5f818152603360205260409020805460ff60881b1916905561e7d4565b61e866915061f5c5565b5f61e7b7565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161e936575b5061a6f757805f52603360205260ff60405f205460881c1661e919575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260046060820152a1565b5f818152603360205260409020805460ff60881b1916905561e8ae565b61e940915061f5c5565b5f61e891565b6001600160401b03811690815f52603360205260ff60405f205460881c16908161ea10575b5061a6f757805f52603360205260ff60405f205460881c1661e9f3575b805f52603460205260018060a01b0360405f2054169060085f6001600160401b0360125416089060088210156100f2575f516020620108e65f395f51905f52926001600160401b036080936020015416906040519283526020830152604082015260026060820152a1565b5f818152603360205260409020805460ff60881b1916905561e988565b61ea1a915061f5c5565b5f61e96b565b6012549061ffff8260601c16915f928061eabb575b50506001600160401b03165f52603160205261ea8161ea6760405f2060085f6001600160401b03601254160890616a50565b5080546108e290859060781c6001600160781b0316616a37565b60085f6001600160401b0360125416089160088310156100f257610b2b61b021936028016108e28360018060781b03835460781c16616a37565b6001600160401b03929493509061eae361271061080b61eb459460018060781b0388166161db565b9384916001600160781b038316906001600160801b031961eb0883608084901c615f93565b60801b169060018060801b0316176012555f516020620108665f395f51905f525f52603860205261eb3e60405f2091825461609b565b90556180ae565b92905f61ea35565b6001600160401b0381165f818152603460205260409081902054845493956001600160a01b039190911694929390914760801b91901c60ff16600361eb9592175f5d8661f640565b5f809893985d1561ec2f575050815460ff60581b1916600160581b1782557fb14d34e3f01e35c636d112b22d3e449b260a635d2f19065f7a70b35408cfec419460c094939290916001600160401b039060ff61ebef6185e8565b9160018060781b03905460781c16935460401c16946040519687526020870152166040850152606084015260018060801b0316608083015260a0820152a1565b919590911561ef18576001600160801b03169461ec4b8661aa69565b81546014546001600160781b0380841696607893841c82169493909291600160781b600160f01b039161ec8391879185901c166180ae565b60781b16600160781b600160f01b031991909116176014556013546001600160801b0361ecb285828416616396565b6001600160801b0319909216911617601355805460ff60481b191690555f8286111561eea157509261eceb61ed09939261ed04956180ae565b9384926108e28460018060781b03835460781c16616a37565b61ea20565b61ed2460135460801c9161ed1e61882b615c2e565b936180ae565b918181111561ee4f579061ed37916161aa565b6001600160781b03909116908181111561eda857506013545f516020620108265f395f51905f52946080949390929091906001600160801b03199061ed7e9083881c615f93565b861b1690600180871b0316176013555b6040519283526020830152604082015260016060820152a1565b8061edee9261edbc61819193969596617c88565b601354906001600160801b03199061edd890608084901c615f93565b60801b169060018060801b0316176013556161aa565b9260085f6001600160401b0360125416089260088410156100f257601890930180545f516020620108265f395f51905f529560809592916001600160781b039161ee39918316616a37565b82546001600160781b031916911617905561ed8e565b5050925f9291925060085f6001600160401b0360125416089260088410156100f257601890930180545f516020620108265f395f51905f529560809592916001600160781b039161ee39918316616a37565b9350919080851061eeb5575b50505061ed09565b61eefc6060926108e261eee97f10b27955d681bde31e3b4e54b99801ec698755593c816338ff939b226543996196856180ae565b825460781c6001600160781b03166180ae565b60405190815284602082015260016040820152a15f808061eead565b91505f516020620108265f395f51905f5294509161ef386080949361e946565b6040519283526020830152600180841b0316604082015260026060820152a1565b805460ff60501b1916905554601454906001600160781b039061ef809082168383166180ae565b6001600160781b0319909216911617601455565b6001600160401b0316805f52603160205261efc360405f2060085f196001600160401b03601254160890616a50565b5080546001600160781b039061efdc90859083166180ae565b82546001600160781b03191691161790555f90815260316020526040812060125461f014926008916001600160401b03160890616a50565b50805490916001600160781b039161b05691908316616a37565b6001600160801b03909116919047831161f0eb575b670de0b6b3a7640000831061f0e2576001600160401b036040519163e4b3303b60e01b83521660048201526020816024818661100062011a6cf15f918161f0a6575b5061f09257505f91508190565b1561805b576001916001600160781b031690565b9091506020813d60201161f0da575b8161f0c260209383615adc565b810103126107175761f0d3906166dd565b905f61f085565b3d915061f0b5565b50600191505f90565b47925061f043565b6013546001600160801b031961f10d83608084901c616396565b60801b166001600160801b03918216176013556015549161f13090838316616396565b6001600160801b0319909216911617601555565b908160e0910312610717578051916020820151916040810151916060820151916080810151916162e360c061f17b60a085016166c9565b93016166c9565b9060e061f1a592604051809481926302b9e0e760e51b8352309060048401615e46565b03815f6110005af15f92815f915f9361f1d2575b5061f1c857505090505f905f90565b906162e39161609b565b9150935061f1f8915060e03d60e01161f209575b61f1f08183615adc565b81019061f144565b50509250949290509390915f61f1b9565b503d61f1e6565b90816060910312610717578051916162e36040602084015193016166c9565b6001600160401b0390911681526001600160a01b03909116602082015260ff909116604082015260600190565b6040516356fa204560e01b8152916060918391829161f281919030906004850161f22f565b03815f6110005af15f918161f29b575b506162e357505f90565b61f2be91925060603d60601161f2c7575b61f2b68183615adc565b81019061f210565b5050905f61f291565b503d61f2ac565b6001600160a01b0390911681526001600160401b039190911660208201526001600160801b0390911660408201525f606082015260800190565b6001600160a01b0390911681526001600160401b039182166020820152911660408201526001600160801b0390911660608201525f608082015290151560a082015290151560c082015260e00190565b8181029180828404148215171561f36e57505090565b5f19818309838110840190036001111561e52b5760019109900390565b81810291808284041482151760011b1561f3a757505060011c90565b6002905f1981840984811085019003920991816002111561e52b5782810360011c9211900360ff1b1790565b818102919080158184048314176d0166bb7f0435c9e717bb45005915602d1b021561f4115750506d0166bb7f0435c9e717bb45005915602d1b900490565b5f1982820983811084019003916d0166bb7f0435c9e717bb45005915602d1b9109906d0166bb7f0435c9e717bb45005915602d1b81101561e52b57828211900360d31b9103602d1c177f2317a2bfdeca19a88834dd8480ca8e949e91c793146c3f24abeded8b1b852e3d0290565b818102919080158184048314177204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b021561f4c75750507204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b900490565b5f1982820983811084019003917204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b9109907204dc9a61d998642bbb1e62afa4fc47597b9fcd603f1b81101561e52b57828211900360c11b9103603f1c177f66c69bc441c22d29d78d9308a8d629e0f05f1077752054f6ca59becfd6b265050290565b8181029291811582850482141783021561f55a575050900490565b82905f1981840985811086019003920990825f038316928181111561e52b5783900480600302600218808202600203028082026002030280820260020302808202600203028082026002030280910260020302936001848483030494805f0304019211900302170290565b6001600160401b038116906002600160401b03821461f63957816001600160401b0360015c160361f5fe57505060ff60015c60401c1690565b61f6079061ce39565b906001600160401b031960015c161760015d60ff60401b196001805c9190911682151560401b60ff60401b1617905d90565b5050600190565b5f91479160405163aed2ee7360e01b81526001600160401b038216600482015260ff831660248201526020816044815f61100062013353f15f918161f7aa575b5061f70b57506040516356fa204560e01b815292506060918391829161f6ab9130906004850161f22f565b03815f6110006185fcf15f918161f6e8575b5061f6ca57505f915f9190565b8061f6df575b61f6d990617c88565b915f9190565b6001915061f6d0565b61f70291925060603d60601161f2c75761f2b68183615adc565b5050905f61f6bd565b1561f72657505061dde661f71f91476161aa565b9160019190565b6040516356fa204560e01b815292506060918391829161f74b9130906004850161f22f565b03815f6110006185fcf15f918161f787575b5061f76a57505f915f9190565b8061f77e575b61f77990617c88565b61f6d9565b6001915061f770565b61f7a191925060603d60601161f2c75761f2b68183615adc565b5050905f61f75d565b9091506020813d60201161f7de575b8161f7c660209383615adc565b810103126107175761f7d7906166dd565b905f61f680565b3d915061f7b9565b9091906001600160801b0383169047821161f89b57633b9aca0082111561f890576001600160401b036024602092604051948593849263212653fb60e21b845216600483015261100062042202f15f918161f854575b5061f84957505f91508190565b1561805b5760019190565b9091506020813d60201161f888575b8161f87060209383615adc565b810103126107175761f881906166dd565b905f61f83c565b3d915061f863565b505090506001905f90565b634e487b7160e01b5f52600160045260245ffd5b91604091949360ff916001600160401b036060860197168552602085015216910152565b60405163173d054560e21b81526001600160801b0383169392906020818061f9008789886004850161f8af565b03815f61100062026836f15f918161fa4a575b5061fa395750506040516302b9e0e760e51b81529260e0848061f93a308660048401615e46565b03815f6110006202f954f15f948161fa12575b5061f95d575b505050505f905f90565b831561fa075783101561f9ff578260209161f98c604051948593849363173d054560e21b85526004850161f8af565b03815f61100062026836f15f918161f9c3575b5061f9b05750505b5f80808061f953565b156183495761f9be90617c88565b600191565b9091506020813d60201161f9f7575b8161f9df60209383615adc565b810103126107175761f9f0906166dd565b905f61f99f565b3d915061f9d2565b50505061f9a7565b505050506001905f90565b61fa2c91955060e03d60e01161f2095761f1f08183615adc565b505050505050935f61f94d565b9250939250501561805b5760019190565b9091506020813d60201161fa7e575b8161fa6660209383615adc565b810103126107175761fa77906166dd565b905f61f913565b3d915061fa5956fe610100806040523461027457602081610cff80380380916100208285610321565b8339810103126102745761003390610344565b60808190523360a0523060e0526040516315b6b1cd60e11b81526001600160401b0390911660048201819052905f9081908181602481836110006201a2c0f15f815f935f9361028b575b506101ee575b5050506001600160a01b0381169283156101dc575060c0526c010000000000000000000000008110156101cf576040805190810192906001600160401b038411818510176101bb5760409384528181526001600160601b03831660209182015260a083901b6001600160a01b03191682175f9081558451908152908101929092527f2c40de6ec45500fc9fc0e3b8f163c1cacefcd0e5744039e3ed1259551fb98e5b92917fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d908390a18151905f82526020820152a160405161095190816103ae82396080518181816101870152818161024f0152610309015260a05181818160a80152610112015260c0518181816101c0015281816102cc015281816105300152610647015260e05181818161020e01526106020152f35b634e487b7160e01b5f52604160045260245ffd5b6335278d125f526004601cfd5b6319708e7160e01b5f5260045260245ffd5b60408051630eaf323560e31b815291955091935090816004815f6110005af1908115610280575f91610233575b501561022c57505b905f8080610083565b9050610223565b90506040813d604011610278575b8161024e60409383610321565b810103126102745780610262602092610344565b5001518015158103610274575f61021b565b5f80fd5b3d9150610241565b6040513d5f823e3d90fd5b93509150503d805f843e61029f8184610321565b820191610180818403126102745780516001600160a01b0381168103610274576102cb60208301610344565b5060e0820151916101208101519461014082015160018060401b03811161027457816102f8918401610358565b506101608201516001600160401b038111610274576103179201610358565b509092915f61007d565b601f909101601f19168101906001600160401b038211908210176101bb57604052565b51906001600160401b038216820361027457565b81601f82011215610274578051906001600160401b0382116101bb576040519261038c601f8401601f191660200185610321565b8284526020838301011161027457815f9260208093018386015e830101529056fe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c8062fa3d501461063157806326bd0c4e146105ed5780633e4eb36c146105ce5780633f3b061a146105155780636f7cbce4146102ba57806379e164ab146101ef5780637c359fe0146101ab5780637f4e7d7b146101685780639b29673414610141578063ae61ebe9146100fd5763c33fb8770361000e57346100f9575f3660031901126100f9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036100ea5760206100e0610718565b6040519015158152f35b63688065ed60e01b5f5260045ffd5b5f80fd5b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f9575f3660031901126100f9575f546040516001600160a01b039091168152602090f35b346100f9575f3660031901126100f95760206040516001600160401b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f95760603660031901126100f9576102086106cd565b602435907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036102ab5760019180610298575b50506102736044357f000000000000000000000000000000000000000000000000000000000000000061089d565b81610290575b501561028157005b633c3b699360e01b5f5260045ffd5b905081610279565b5f8093508091389361c350f18180610245565b632388e24d60e21b5f5260045ffd5b346100f9575f3660031901126100f9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610506576040516315b6b1cd60e11b81527f00000000000000000000000000000000000000000000000000000000000000006001600160401b0316600482018190525f9182908181602481836110006201a2c0f15f815f935f9361046f575b506103d8575b5050506001600160a01b0316156103c6575f547fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d90604090846001600160a01b03196103a682610802565b60a01b1660018060a01b038316175f5582519160a01c82526020820152a1005b6319708e7160e01b5f5260045260245ffd5b60408051630eaf323560e31b815291965091935090816004815f6110005af1908115610464575f9161041d575b501561041657505b9183808061035b565b905061040d565b90506040813d60401161045c575b81610438604093836106e3565b810103126100f95760208161044f61045693610827565b5001610890565b85610405565b3d915061042b565b6040513d5f823e3d90fd5b93509150503d805f843e61048381846106e3565b820191610180818403126100f95780516001600160a01b03811681036100f9576104af60208301610827565b5060e082015191610120810151946101408201516001600160401b0381116100f957816104dd91840161083b565b506101608201516001600160401b0381116100f9576104fc920161083b565b5090929187610355565b639bfdc6ff60e01b5f5260045ffd5b346100f95760203660031901126100f95761052e6106cd565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163303610506576001600160a01b031680156105bf575f80546001600160a01b031981168317909155604080516001600160a01b03909216825260208201929092527f2c40de6ec45500fc9fc0e3b8f163c1cacefcd0e5744039e3ed1259551fb98e5b9190a1005b636c38382960e11b5f5260045ffd5b346100f9575f3660031901126100f95760205f5460a01c604051908152f35b346100f9575f3660031901126100f9576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346100f95760203660031901126100f9576004357f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361050657670de0b6b3a764000081116106be575f547fd5b010b75d0703745f3c15954fbe4ac8aebb10e4c4aa09de04b1e1e195a67b9d91604091906001600160a01b03196103a682610802565b63047f2a9760e51b5f5260045ffd5b600435906001600160a01b03821682036100f957565b90601f801991011681019081106001600160401b0382111761070457604052565b634e487b7160e01b5f52604160045260245ffd5b5f604051604081018181106001600160401b03821117610704576040525f546001600160a01b038116825260a01c6020820181905247908181029082820414821517156107ee57670de0b6b3a76400009004918282039182116107ee57670de0b6b3a764000082106107e657516001600160a01b031691303b156100f957604051926379e164ab60e01b84526004840152602483015260448201525f8160648183305af190816107d1575b506107cb5790565b50600190565b6107de9192505f906106e3565b5f905f6107c3565b505050505f90565b634e487b7160e01b5f52601160045260245ffd5b600160601b81101561081a576001600160601b031690565b6335278d125f526004601cfd5b51906001600160401b03821682036100f957565b81601f820112156100f9578051906001600160401b038211610704576040519261086f601f8401601f1916602001856106e3565b828452602083830101116100f957815f9260208093018386015e8301015290565b519081151582036100f957565b6001600160401b036024602092604051948593849263e4b3303b60e01b845216600483015261100062011a6cf15f91816108df575b506108dc57505f90565b90565b9091506020813d602011610913575b816108fb602093836106e3565b810103126100f95761090c90610890565b905f6108d2565b3d91506108ee56fea26469706673582212205d20ca8657067f4f35639a44f2725d7f5b6b63c601ce6d3f8654f7806f7019d364736f6c634300081e0033a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1029016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d10089114bbe8661c66ec567dd1105361c83d5d102e74f6b3bb3e115dd39b99f71d2138acd4a6f6a69f593727b355a4a6d444f7c335d73a842bb4db80a9c92500df26c93063a8ffa43126e459aec3984dbaab55ba679b920f6a0bfeedd6e39d046c90000000000000000000000001111111111111111111111111111111111111111ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6a4eb97f843610559cec0ec79705b42ba8a897218d27d661a1fd4dfc41b289449b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00c62b7381c171b44f590d8492ab66f5b7e15a2bd57657d9afef29a6a0021dd898f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00d9f18d9a4aeabe46c8d05191d465049ab6fd5191958d9d36d92e1950de7f141da16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101dcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7a2646970667358221220f5bee3fdc0395cd6ac4998db7de5cbae77c2dbb40f518c13469fc2ea8ee2e27064736f6c634300081e0033
Deployed Bytecode Sourcemap
975:20552:34:-:0;;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;;;;:::i;:::-;6236:33:35;;6232:299;;975:20552:34;6571:28:35;;6590:9;;7413:1;975:20552:34;-1:-1:-1;;;;;7397:33:35;6571:28;:::i;:::-;-1:-1:-1;;;;;7803:35:35;;975:20552:34;;7896:21:35;7474:3;975:20552:34;;;;;:::i;:::-;7413:1:35;975:20552:34;7895:52:35;:79;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;6232:299:35;6372:21;6397:28;6416:9;975:20552:34;7474:3:35;975:20552:34;6397:28:35;:::i;:::-;-1:-1:-1;6232:299:35;6368:153;6485:21;6416:9;6485:21;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7413:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;6571:28:35;;-1:-1:-1;;;;;975:20552:34;6445:61:35;;975:20552:34;;;6445:61:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;6368:153:35;-1:-1:-1;6232:299:35;;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8893:13:36;975:20552:34;8893:13:36;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;2357:1:0;975:20552:34;;:::i;:::-;2303:62:0;;:::i;:::-;2357:1;:::i;:::-;975:20552:34;;;;;;;;;2337:6:32;975:20552:34;;;:::i;:::-;44493:8:32;;;;:::i;:::-;2308:10;2337:6;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;17041:74:30;975:20552:34;;17041:74:30;:::i;:::-;975:20552:34;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;1301:103:4;;:::i;:::-;3227:4:26;3911:16:30;;975:20552:34;;3227:4:26;102908:27:35;57881:53;4011:56:30;4048:9;102908:27:35;:::i;:::-;3227:4:26;57881:53:35;:::i;:::-;58124:33;58040:63;975:20552:34;58041:37:35;975:20552:34;57975:7:35;975:20552:34;;;;;;;;;;;58041:37:35;:::i;58040:63::-;58124:33;;;:::i;:::-;4048:9:30;58185:48:35;4048:9:30;58185:29:35;4048:9:30;58185:18:35;4048:9:30;58185:18:35;:::i;:::-;:29;:::i;:48::-;58311:24;;;:::i;:::-;975:20552:34;58351:20:35;;975:20552:34;;58350:51:35;;;;975:20552:34;-1:-1:-1;58346:1954:35;;;-1:-1:-1;;;;;975:20552:34;;;;9360:18:36;975:20552:34;;58741:45:35;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;58674:53:35;;975:20552:34;;;;58674:53:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;;58741:45:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;58741:45:35;:::i;:::-;;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;;58801:47:35;;975:20552:34;58801:47:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;58801:47:35;:::i;:::-;58863:19;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;;;;;58863:53:35;975:20552:34;;;;58863:53:35;:::i;:::-;975:20552:34;-1:-1:-1;;;;;;975:20552:34;;;;58863:19:35;975:20552:34;57975:7:35;975:20552:34;;58963:49:35;-1:-1:-1;;;;;975:20552:34;;2275:6:26;975:20552:34;;;58963:49:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;57975:7:35;975:20552:34;59060:15:35;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;59060:49:35;;2275:6:26;975:20552:34;;;59060:49:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;59060:15:35;975:20552:34;58346:1954:35;-1:-1:-1;;;;;;;;;;;975:20552:34;;60395:19:35;975:20552:34;;-1:-1:-1;;;;;;;;;;;975:20552:34;;60395:65:35;;-1:-1:-1;;;;;975:20552:34;;;60395:65:35;:::i;:::-;975:20552:34;;60570:27:35;;;;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;4083:76:30;;975:20552:34;;60740:27:35;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;60529:69:35;;975:20552:34;;60529:69:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;60740:27:35;:::i;:::-;975:20552:34;;;966:10:2;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;4083:76:30;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;58346:1954:35;59894:27;59622:14;;-1:-1:-1;;;;;975:20552:34;;9360:18:36;975:20552:34;;59718:45:35;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;59651:53:35;;975:20552:34;;;;59651:53:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;;59718:45:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;59718:45:35;:::i;:::-;59894:27;:::i;:::-;57975:7;975:20552:34;59935:19:35;;;975:20552:34;;-1:-1:-1;;;;;;59968:49:35;-1:-1:-1;;;;;975:20552:34;;2275:6:26;975:20552:34;;;59968:49:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;57975:7:35;975:20552:34;58346:1954:35;;58350:51;58375:26;;;;975:20552:34;;;58350:51:35;;;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;3359:11:24;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;4571:11:24;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;4584:33:31;975:20552:34;;:::i;:::-;;;:::i;:::-;4584:33:31;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;18071:83:30;17908:54;16642:18;975:20552:34;;:::i;:::-;16642:18:30;:::i;:::-;17908:54;:::i;:::-;18071:83;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;21565:22:38;975:20552:34;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;-1:-1:-1;;975:20552:34;;;:::i;:::-;;;;;;;3606:25:26;975:20552:34;;21701:13:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;21738:9:38;-1:-1:-1;;;;;975:20552:34;21757:478:38;;975:20552:34;3701:25:26;21764:23:38;;;:36;;;21757:478;21764:36;;;-1:-1:-1;;;;;21820:26:38;;21816:361;;21757:478;975:20552:34;;21701:13:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;21757:478:38;;21816:361;21911:10;;;:45;;;21816:361;21907:256;21816:361;21907:256;21980:23;;;;975:20552:34;21980:23:38;;;:::i;:::-;975:20552:34;;;;22040:14:38;975:20552:34;;;;;;;;;;3701:25:26;975:20552:34;22025:36:38;;;;:::i;:::-;975:20552:34;;21907:256:38;21816:361;;21911:45;975:20552:34;;;;21925:15:38;975:20552:34;;;;;;;;;;21911:45:38;;21764:36;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;21764:36:38;21791:9;;;;21764:36;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;5621:15:29;;;:27;975:20552:34;;3993:249:16;975:20552:34;;;;;;;;;;;972:64:3;975:20552:34;;;;;;;;;;;;;;;;5726:78:29;975:20552:34;5726:78:29;;975:20552:34;2122:95:26;975:20552:34;;2122:95:26;975:20552:34;2122:95:26;;975:20552:34;;;;;;;;;2122:95:26;;975:20552:34;2122:95:26;975:20552:34;2122:95:26;;975:20552:34;;2122:95:26;;975:20552:34;;2122:95:26;;975:20552:34;;5726:78:29;;;975:20552:34;5726:78:29;;:::i;:::-;975:20552:34;5716:89:29;;4094:23:5;;:::i;:::-;3993:249:16;975:20552:34;3993:249:16;;-1:-1:-1;;;3993:249:16;;;;;;;;;;;7051:25:15;7105:8;7051:25;;;;;;:::i;:::-;7105:8;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;6019:18:29;;;6015:401;;975:20552:34;11229:4:29;;;;;:::i;6015:401::-;6134:17;;;;;;:22;6130:73;;6285:54;975:20552:34;;;;;;;6236:25:29;975:20552:34;6236:25:29;;975:20552:34;;2122:95:26;;975:20552:34;;2122:95:26;;;;;;975:20552:34;2122:95:26;;;6236:25:29;;;;;;;:::i;:::-;6285:54;;:::i;:::-;2122:95:26;;;6015:401:29;;;;;;;2122:95:26;6165:38:29;;;;975:20552:34;2122:95:26;975:20552:34;;;;;;;2122:95:26;6130:73:29;6165:38;;;;;975:20552:34;6165:38:29;975:20552:34;;;;;;6165:38:29;975:20552:34;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;18833:14:38;975:20552:34;;18934:82:38;975:20552:34;;;;;;;;3701:25:26;975:20552:34;;;;;18887:15:38;975:20552:34;;;;;;;;;;;;;;;;;18942:40:38;;;18934:82;:::i;:::-;975:20552:34;;;9188:16:36;975:20552:34;;;9188:34:36;975:20552:34;;;2817:1:26;23196:2:38;;975:20552:34;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;:::i;:::-;;;;9360:18:36;975:20552:34;;;9360:36:36;975:20552:34;;;2817:1:26;23196:2:38;;975:20552:34;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;975:20552:34;;:::i;:::-;;;;9360:18:36;975:20552:34;;;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;975:20552:34;8478:7:36;975:20552:34;;;9360:36:36;;:::i;975:20552:34:-;;;;;;;;;;19383:33:38;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;19516:26:38;;;975:20552:34;;;;;;;;;;;19651:29:38;;;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2275:6:26;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;18942:40:38;18960:22;;;;18934:82;:::i;975:20552:34:-;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;;;;2262:6:31;975:20552:34;;;:::i;:::-;;-1:-1:-1;;;;;975:20552:34;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6923:49:31;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;2262:6:31;;:::i;6982:148::-;975:20552:34;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;2294:8:29;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;19101:74:30;975:20552:34;;19101:74:30;:::i;:::-;19197:53;;;:::i;:::-;19272:23;975:20552:34;19272:23:30;;;;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;20358:17:38;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;9793:58:30;15081:4;9793:58;:::i;:::-;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;9903:23:30;3861:4:26;-1:-1:-1;3861:4:26;;15081::30;3861::26;;;;;;;975:20552:34;9868:82:30;975:20552:34;;;;;9868:82:30;:::i;3861:4:26:-;975:20552:34;;;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;6429:44:1;;;;;975:20552:34;6425:105:1;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;-1:-1:-1;;975:20552:34;;;;;2451:89;;-1:-1:-1;;;;;975:20552:34;1874:10;:25;975:20552;;;;:::i;:::-;;;;;;;;;;:::i;:::-;6591:4:1;975:20552:34;;-1:-1:-1;;;975:20552:34;;;;6891:76:1;;:::i;:::-;;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6591:4:1;975:20552:34;23196:2:38;;;975:20552:34;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;:::i;:::-;;;;;;;;;;;;;;;;;;;6654:20:1;975:20552:34;;6959:1:1;975:20552:34;;;;;;;;;;;6591:4:1;975:20552:34;23196:2:38;;;975:20552:34;3790:10:5;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;-1:-1:-1;;;;;;;;;;;975:20552:34;6891:76:1;;:::i;:::-;;;:::i;6959:1::-;3861:4:26;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;996:20:24;;;:44;;975:20552:34;992:341:24;;;975:20552:34;6891:76:1;;:::i;:::-;1992:8:34;;:::i;:::-;-1:-1:-1;;;;;;;;;;;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;;1677:2;975:20552;;6654:20:1;975:20552:34;992:341:24;975:20552:34;;;;;;:::i;:::-;3227:4:26;975:20552:34;;3227:4:26;1135:74:24;;;975:20552:34;;:::i;:::-;1267:55:24;4208:21:26;975:20552:34;;;;;;4208:21:26;;;975:20552:34;3227:4:26;4208:21;;;975:20552:34;3227:4:26;4208:21;;;975:20552:34;1267:55:24;992:341;;996:44;1020:15;;975:20552:34;-1:-1:-1;;;;;975:20552:34;1020:20:24;;-1:-1:-1;996:44:24;;;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;6959:1:1;975:20552:34;;;;6591:4:1;975:20552:34;;6654:20:1;975:20552:34;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;23196:2:38;;975:20552:34;;3790:10:5;975:20552:34;;;;;;;;;;;;;;;;6591:4:1;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6591:4:1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;6591:4:1;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;23196:2:38;;975:20552:34;;;;;;;;;;;;;;;;;;;6591:4:1;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6591:4:1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;;6425:105:1;6496:23;;;975:20552:34;6496:23:1;975:20552:34;;6496:23:1;6429:44;1677:2:34;975:20552;;-1:-1:-1;;;;;975:20552:34;6448:25:1;;6429:44;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;2303:62:0;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;;;975:20552:34;;;;;2275:6:26;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;7139:1:31;975:20552:34;;;;11377:15:36;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;7162:92;975:20552;;;;-1:-1:-1;975:20552:34;;;7170:31;7162:92;:::i;:::-;7324:21;7320:70;;975:20552;7494:87;;;975:20552;7617:18;8243:54;7617:18;975:20552;7617:18;975:20552;7617:18;;;:::i;:::-;975:20552;;;;7938:15;975:20552;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;8050:20;975:20552;;;;-1:-1:-1;975:20552:34;;:::i;:::-;8050:20;;;:::i;:::-;975:20552;;;;7938:15;975:20552;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;8183:10;975:20552;;;;;;;;;;;-1:-1:-1;;;;;2275:6:26;8183:44:34;;975:20552;;8183:44;:::i;:::-;975:20552;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;8243:54;975:20552;7494:87;975:20552;7521:60;;;;;8243:54;7521:60;;:::i;:::-;7494:87;;;;;;7320:70;7372:17;;;;;:::i;:::-;7320:70;;;6982:148:31;975:20552:34;;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;3791:18:29;975:20552:34;;;;;3791:37:29;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;6113:7:30;975:20552:34;;;:::i;:::-;6113:7:30;;;;;:::i;:::-;7225:24;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;11762:79:36;;1301:103:4;;:::i;:::-;975:20552:34;;:::i;:::-;18660:10;975:20552;;;;19638:19;975:20552;;;;;;18660:10;;;19638:35;;;975:20552;;-1:-1:-1;20023:28:34;;;975:20552;;;;20023:28;;975:20552;;-1:-1:-1;;;;;2275:6:26;20023:47:34;;975:20552;;;;;;20023:47;:::i;:::-;975:20552;;;18660:10;975:20552;;19638:19;975:20552;;;;;20141:35;975:20552;;;20141:35;:::i;:::-;975:20552;;;;;11940:83:30;;;:::i;:::-;20542:6:34;;;;;:::i;:::-;975:20552;-1:-1:-1;;;;;975:20552:34;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;17516:7;975:20552;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;17516:7;2275:6:26;;-1:-1:-1;;;;2275:6:26;;;;;;-1:-1:-1;;;2275:6:26;;;;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;17516:7;975:20552;;-1:-1:-1;;;;;975:20552:34;2275:6:26;975:20552:34;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;20817:59;975:20552;18660:10;20817:59;;975:20552;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;18660:10;20891:33;;975:20552;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;;;;;;;;;;;;;;;;;;;;;11762:79:36;11815:15;;;975:20552:34;11815:15:36;975:20552:34;;11815:15:36;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;:::i;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;;;;2883:33:31;;;975:20552:34;;3012:13:31;975:20552:34;3027:19:31;;;;;;975:20552:34;3048:3:31;3083:11;3096:10;3083:11;;975:20552:34;3083:11:31;;;;:::i;:::-;;:::i;:::-;3096:10;;;;:::i;:::-;975:20552:34;3096:10:31;;;:::i;:::-;975:20552:34;3012:13:31;;975:20552:34;;;;;;;;;;;;;;6982:148:31;975:20552:34;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;;975:20552:34;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;105606:31:35;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;7879:7:30;975:20552:34;;;:::i;:::-;7879:7:30;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;3700:8:38;975:20552:34;;:::i;:::-;;;:::i;:::-;2303:62:0;;;:::i;:::-;3592:71:38;3419:20:26;-1:-1:-1;;;;;;;;;;975:20552:34;;3600:29:38;;3592:71;:::i;:::-;3700:8;:::i;975:20552:34:-;;;;;6113:7:30;975:20552:34;;;:::i;:::-;6113:7:30;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;10450:58:30;975:20552:34;10450:58:30;:::i;:::-;12220:18;3861:4:26;;;;;;;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;;-1:-1:-1;3861:4:26;;12220:18:30;10525:82;975:20552:34;;;;;10525:82:30;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;3379:15:29;975:20552:34;;;;;3379:34:29;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;9188:16:36;975:20552:34;;;9188:34:36;975:20552:34;;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;975:20552:34:-;;;;9188:16:36;975:20552:34;;;9188:34:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;975:20552:34:-;-1:-1:-1;;;;;975:20552:34;;;2275:6:26;22688:23:38;975:20552:34;2275:6:26;;;;22688:23:38;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;2275:6:26;22688:23:38;975:20552:34;2275:6:26;;;;22729:26:38;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;1733:6:31;975:20552:34;;;:::i;:::-;;-1:-1:-1;;;;;975:20552:34;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;1733:6:31;;:::i;6982:148::-;975:20552:34;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;;-1:-1:-1;;;20038:18:38;;975:20552:34;;;;;182:42:26;20038:18:38;;;;;;975:20552:34;20038:18:38;975:20552:34;20038:18:38;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;20038:18:38;;;;;;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;4614:5:29;975:20552:34;;:::i;:::-;;;966:10:2;;4614:5:29;:::i;:::-;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;18656:36:38;975:20552:34;;:::i;:::-;18543:91:38;975:20552:34;-1:-1:-1;;;;;975:20552:34;;18551:16:38;;;:49;;;;975:20552:34;18543:91:38;;:::i;:::-;18656:36;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;18551:49:38;18586:14;;-1:-1:-1;;;;;18571:29:38;;18551:49;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;109099:68:35;975:20552:34;;:::i;:::-;109145:21:35;975:20552:34;;;:::i;:::-;109099:68:35;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;2303:62:0;;:::i;:::-;3828:71:38;3419:20:26;-1:-1:-1;;;;;;;;;;975:20552:34;;3836:29:38;;3828:71;:::i;:::-;17536:26;;;:::i;:::-;17600:30;;;:::i;:::-;17660:36;;;:::i;:::-;17710:21;;;;17782:131;975:20552:34;17782:131:38;;;;975:20552:34;17782:131:38;-1:-1:-1;;;;;975:20552:34;;17967:22:38;975:20552:34;;4005:8:38;17706:363;975:20552:34;17706:363:38;4005:8;:::i;975:20552:34:-;;;;;;;;;17706:363:38;975:20552:34;18038:20:38;;;4005:8;18038:20;;17706:363;;4005:8;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;10933:6:32;975:20552:34;;;:::i;:::-;;10859:6:32;975:20552:34;;44493:8:32;;;;;:::i;:::-;10847:10;10859:6;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;;;;2275:6:26;2303:62:0;;;:::i;:::-;4122:20:38;2275:6:26;;;4188:7:38;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;2275:6:26;;;;975:20552:34;2275:6:26;975:20552:34;;2275:6:26;975:20552:34;;3794:14:32;975:20552:34;;;:::i;:::-;44493:8:32;;;;;;:::i;:::-;3057:759;3469:10;4573:7:30;3469:10:32;3458:9;4573:7:30;:::i;:::-;23196:2:38;-1:-1:-1;;3495:35:32;3491:70;;3469:10;3794:14;;:::i;3491:70::-;3532:29;;-1:-1:-1;3491:70:32;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;11625:79:36;;8842:14:35;;:::i;:::-;8870:9;;8866:69;;975:20552:34;8893:13:36;975:20552:34;;;;;;;;;8866:69:35;8906:18;8893:13:36;8906:18:35;;:::i;:::-;8866:69;;;;11625:79:36;11678:15;;;975:20552:34;11678:15:36;975:20552:34;;11678:15:36;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;44493:8:32;;-1:-1:-1;;;;;44493:8:32;;:::i;:::-;975:20552:34;;;;;14321:15:32;975:20552:34;;;;;;;;;;14347:10:32;975:20552:34;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;14529:23:32;14525:232;;975:20552:34;;;;;;;;;;;14894:15:32;975:20552:34;;;;;;;;14347:10:32;975:20552:34;;;;;;;2074:7:26;;975:20552:34;;;14894:65:32;;;:::i;:::-;975:20552:34;;;;14321:15:32;975:20552:34;;;;;;;;14347:10:32;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;;2074:7:26;;;-1:-1:-1;;;;;975:20552:34;;;;2074:7:26;2275:6;975:20552:34;;;;-1:-1:-1;;;975:20552:34;2074:7:26;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;2074:7:26;:::i;:::-;975:20552:34;;;;;;2074:7:26;;975:20552:34;;2074:7:26;;975:20552:34;15083:84:32;975:20552:34;14347:10:32;15083:84;;975:20552:34;14525:232:32;2074:7:26;14593:47:32;;2074:7:26;14525:232:32;2074:7:26;;;;;975:20552:34;2074:7:26;975:20552:34;;2074:7:26;975:20552:34;;;;2074:7:26;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;2303:62:0;;:::i;:::-;3227:4:26;1760:28:24;;975:20552:34;;1923:59:24;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;11762:79:36;;1301:103:4;;:::i;:::-;-1:-1:-1;;;;;5186:19:30;;975:20552:34;;10365:70:30;:58;975:20552:34;10365:58:30;:::i;:::-;10426:9;10365:70;;:::i;:::-;5308:4;3861::26;;;;;;;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;10573:23:30;3861:4:26;-1:-1:-1;3861:4:26;;10525:82:30;5308:4;975:20552:34;10525:82:30;5364:6;10525:82;;;:::i;:::-;966:10:2;;;5364:6:30;:::i;:::-;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;;;;;;;-1:-1:-1;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;104693:30:35;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;3725:33:31;;;;975:20552:34;;;3872:19:31;;;;;;975:20552:34;3893:3:31;3931:11;3944:10;3931:11;;975:20552:34;3931:11:31;;;;:::i;:::-;3944:10;;;;;:::i;:::-;975:20552:34;3944:10:31;;;:::i;:::-;975:20552:34;3857:13:31;;975:20552:34;;;;;;;;;;;;;;;6982:148:31;975:20552:34;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;;975:20552:34;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;3105:11:38;975:20552:34;;:::i;:::-;2303:62:0;;:::i;:::-;3105:11:38;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;;;;;;;3701:25:26;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;11762:79:36;;1301:103:4;;:::i;:::-;975:20552:34;;:::i;:::-;17542:9;;;:19;975:20552;;;;;;;;;;;;;;17654:19;975:20552;;;;;17654:33;975:20552;;;17654:33;:::i;:::-;975:20552;;17793:28;;;975:20552;;17793:28;;975:20552;;;;;;-1:-1:-1;;;;;2275:6:26;17793:47:34;;975:20552;;;;;;17793:47;:::i;:::-;975:20552;;;17898:38;975:20552;2275:6:26;;;;17917:18:34;;;:::i;:::-;975:20552;17898:38;:::i;:::-;975:20552;-1:-1:-1;;;;;975:20552:34;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;18029:43;975:20552;17357:10;18029:43;;975:20552;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;5761:18:5;:43;;;975:20552:34;;;;;;;:::i;:::-;;;:::i;:::-;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;:::i;:::-;5949:13:5;975:20552:34;;;;5984:4:5;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;5761:43:5;975:20552:34;-1:-1:-1;;;;;;;;;;;975:20552:34;5783:21:5;5761:43;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;2303:62:0;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;18327:94:32;975:20552:34;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;;;18327:18:32;975:20552:34;;;;;18327:37:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;;18386:10:32;975:20552:34;;;;;;;;18327:94:32;;:::i;:::-;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;19858:57:30;975:20552:34;;19858:57:30;:::i;:::-;975:20552:34;19976:78:30;;;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;;;;;972:64:3;975:20552:34;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;19542:53:32;975:20552:34;;:::i;:::-;;19562:33:32;975:20552:34;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;19174:15:32;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;19294:18:32;975:20552:34;;;;;;;;;;;;;;;;19407:60:32;;19274:70;;-1:-1:-1;;;;;975:20552:34;;;;;19274:70:32;:::i;:::-;19427:40;;;;:::i;:::-;19407:60;;:::i;:::-;19562:33;;:::i;:::-;19542:53;;:::i;:::-;19655:68;;;975:20552:34;;;;;;19655:68:32;20397:74:30;20569:24;20397:74;;:::i;:::-;20493:54;;;:::i;20569:24::-;19655:68:32;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;22287:15:32;975:20552:34;;;;;22287:34:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;:::i;:::-;;;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;:::i;:::-;;;6828:31:36;;;;975:20552:34;6893:28:36;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;12053:64;11871:72;975:20552;;;;:::i;:::-;1301:103:4;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6923:49:31;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;;;;11377:15:36;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;10054:92;975:20552;;;;-1:-1:-1;975:20552:34;;;10062:31;10054:92;:::i;:::-;10216:21;10212:70;;975:20552;-1:-1:-1;10388:899:34;;;975:20552;10760:65;10493:25;11695:19;10760:77;10594:46;10493:25;10594:46;:::i;:::-;10566:74;;10760:65;:::i;:::-;:77;:::i;:::-;975:20552;;;;11582:15;975:20552;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;:::i;:::-;11695:19;;;:::i;:::-;975:20552;;;;11582:15;975:20552;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;:::i;:::-;11891:28;;;:::i;:::-;2275:6:26;-1:-1:-1;;;;;2275:6:26;11921:21:34;;;:::i;:::-;975:20552;;-1:-1:-1;;;;;975:20552:34;11871:72;:::i;:::-;12020:16;;;;:::i;:::-;975:20552;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;12053:64;975:20552;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;10388:899;975:20552;11196:30;10959:60;11695:19;11258:18;11107:56;10959:60;;;:::i;:::-;11107:56;:::i;:::-;11073:90;;;11196:30;:::i;:::-;11258:18;;:::i;:::-;10388:899;;10212:70;10264:17;;;;;:::i;:::-;10212:70;;;6982:148:31;975:20552:34;;;;11377:15:36;975:20552:34;;;;;;6986:10:31;975:20552:34;;;;;;;;;7036:83:31;;6986:10;;;975:20552:34;;7036:83:31;:::i;:::-;6982:148;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;:::i;:::-;2303:62:0;;:::i;:::-;1301:103:4;;:::i;:::-;975:20552:34;;:::i;:::-;-1:-1:-1;;;;;;;;;;;975:20552:34;;19638:19;975:20552;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;19638:35;;;975:20552;;-1:-1:-1;20023:28:34;;;975:20552;;;;20023:28;19337:56;;975:20552;;;;20023:28;-1:-1:-1;;;;;2275:6:26;20023:47:34;;975:20552;;;;;;20023:47;:::i;:::-;975:20552;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;19638:19;975:20552;;;;;20141:35;975:20552;;;20141:35;:::i;:::-;975:20552;;;;;11940:83:30;;;:::i;:::-;20542:6:34;;;;;:::i;:::-;975:20552;-1:-1:-1;;;;;975:20552:34;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;;;;;;;20817:59:34;975:20552;;;;;;;;;;;20817:59;975:20552;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;975:20552:34;;;;;;;;;;;20891:33;975:20552;;;;;;;;;;19337:56;975:20552;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;2303:62:0;;:::i;:::-;-1:-1:-1;;;;;;;;;;;3701:25:26;;-1:-1:-1;;;;;;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;3975:40:0;975:20552:34;;3975:40:0;975:20552:34;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;2662:10:29;975:20552:34;;;;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;108640:34:35;;:::i;975:20552:34:-;;;-1:-1:-1;;975:20552:34;;;;;4573:7:30;975:20552:34;;:::i;:::-;;;4573:7:30;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;5387:10:36;975:20552:34;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;11377:15:36;975:20552:34;;;;;11377:32:36;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;20992:30:38;975:20552:34;;:::i;:::-;20992:30:38;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;21087:17:38;-1:-1:-1;;;;;975:20552:34;21087:17:38;;975:20552:34;;21118:28:38;975:20552:34;21118:28:38;;975:20552:34;;;21160:23:38;;;975:20552:34;;;21197:34:38;;;975:20552:34;;;21245:31:38;;;;975:20552:34;;;;21290:23:38;975:20552:34;;;;;21290:23:38;;975:20552:34;;;;;;;;;;;;;;;;21160:23:38;975:20552:34;;;21197:34:38;975:20552:34;;;21245:31:38;975:20552:34;;;21290:23:38;975:20552:34;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;9231:6:32;975:20552:34;;:::i;:::-;;;9219:10:32;;9231:6;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;23168:18:32;975:20552:34;;;;;23168:37:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;;2275:6:26;;;;975:20552:34;;;23255:36:32;;975:20552:34;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;-1:-1:-1;;;;;5906:71:32;975:20552:34;;5943:10:32;;5906:71;;:::i;:::-;975:20552:34;;;;;;6032:19:32;975:20552:34;;;;;;;;;;5943:10:32;975:20552:34;-1:-1:-1;975:20552:34;;;6455:17:32;975:20552:34;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;3701:25:26;975:20552:34;;;;;;;;;;;6455:17:32;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;6032:19:32;975:20552:34;;;;;;;;5943:10:32;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;;;;;;;5943:10:32;;6659:100;;975:20552:34;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;6058:14:36;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;3701:25:26;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;7343:17:36;975:20552:34;;;;;;;;;;;;;:::i;:::-;;-1:-1:-1;;;;;975:20552:34;;;;;2275:6:26;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;2991:10:29;975:20552:34;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;11762:79:36;;-1:-1:-1;;;;;13926:7:34;975:20552;;13785:10;975:20552;;14001:17;8893:13:36;975:20552:34;;;;;;;;;;;:::i;:::-;;;2275:6:26;;;;975:20552:34;;;;;-1:-1:-1;;;;;8893:13:36;975:20552:34;;;;;;;;14045:30;975:20552;;;-1:-1:-1;;;;;975:20552:34;;14132:56;;;975:20552;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;13785:10;975:20552;;14001:17;8893:13:36;975:20552:34;;;;;;95598:15:35;975:20552:34;;;;95642:23:35;;;95638:1348;;975:20552:34;95598:15:35;975:20552:34;;;-1:-1:-1;;;;;;97076:40:35;975:20552:34;2275:6:26;975:20552:34;;;97076:40:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;95598:15:35;975:20552:34;97146:19:35;975:20552:34;;2275:6:26;;;;975:20552:34;97146:48:35;975:20552:34;;;;97146:48:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;97146:19:35;975:20552:34;14443:32;13785:10;;14443:32;:::i;:::-;975:20552;;;;;14491:33;8893:13:36;13785:10:34;14491:33;;975:20552;95638:1348:35;95896:23;;;;:::i;:::-;96291:80;975:20552:34;;:::i;:::-;;;8893:13:36;96107:31:35;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;49025:70:21;;;;;;;;;;;96291:80:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;;95971:14:35;975:20552:34;96843:66:35;;975:20552:34;-1:-1:-1;;;;;96698:66:35;975:20552:34;;;;96698:66:35;:::i;:::-;975:20552:34;-1:-1:-1;;;;;;975:20552:34;;;;95971:14:35;975:20552:34;;96843:66:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;95598:15:35;975:20552:34;95638:1348:35;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;10274:14:24;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;22729:15:32;975:20552:34;;;;;22729:34:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;;11949:17:32;975:20552:34;;;:::i;:::-;;11856:17:32;;;;;;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;;11807:69:32;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;;;11751:19:32;975:20552:34;;;;;;11781:10:32;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;;;;;;;:::i;:::-;11949:17:32;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;11781:10:32;;975:20552:34;-1:-1:-1;;;;;;;;;;;11892:75:32;11807:69;;11892:75;975:20552:34;;;;;;;;:::i;:::-;1301:103:4;;;;:::i;:::-;10450:58:30;975:20552:34;10450:58:30;:::i;:::-;10549:1;3861:4:26;;;;;;;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;;-1:-1:-1;3861:4:26;;975:20552:34;10525:82:30;;3122:6;10525:82;;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;966:10:2;3011:20:30;;3007:94;;3122:6;:::i;:::-;3168:19;;;:::i;:::-;63510:7:35;975:20552:34;;63489:48:35;975:20552:34;;;;;63489:48:35;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;63560:480:35;;975:20552:34;64217:24:35;;;;;:::i;:::-;64281:32;;;;:::i;:::-;975:20552:34;64509:20:35;;975:20552:34;;64508:51:35;;;;975:20552:34;-1:-1:-1;64504:1956:35;;;65916:30;-1:-1:-1;;;;;975:20552:34;;;:::i;:::-;;;64940:32:35;;;975:20552:34;;64940:32:35;;2275:6:26;;64907:65:35;;-1:-1:-1;;;;;975:20552:34;;;;;64907:65:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;64990:46:35;64986:303;;64504:1956;-1:-1:-1;975:20552:34;;2275:6:26;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;65594:54:35;;2275:6:26;;975:20552:34;;65594:54:35;:::i;:::-;975:20552:34;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;65916:30:35;:::i;:::-;975:20552:34;;;;9360:18:36;64940:32:35;975:20552:34;65960:67:35;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;65960:67:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;65960:67:35;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;66041:49:35;975:20552:34;;66041:49:35;-1:-1:-1;;;;;;;;;;;975:20552:34;9033:15:36;975:20552:34;;;;;;;;;;;;66041:49:35;:::i;:::-;975:20552:34;;;;;10549:1:30;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;3241:51:30;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;64986:303:35;;-1:-1:-1;975:20552:34;64986:303:35;;64504:1956;975:20552:34;;-1:-1:-1;;;;;;;;;;;3241:51:30;-1:-1:-1;975:20552:34;;66381:68:35;;66337:30;;-1:-1:-1;;;;;975:20552:34;66337:30:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;9360:18:36;975:20552:34;;66381:68:35;9360:36:36;975:20552:34;;;2817:1:26;975:20552:34;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;66381:68:35;:::i;:::-;64504:1956;;64508:51;64533:26;;;;975:20552:34;;;64508:51:35;;;63560:480;63986:43;;2275:6:26;;-1:-1:-1;;;;;;63605:54:35;975:20552:34;2275:6:26;975:20552:34;;;63605:54:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;63510:7:35;975:20552:34;-1:-1:-1;;;;;;;;;;;975:20552:34;;63901:19:35;975:20552:34;;63901:70:35;975:20552:34;;;;;;63901:70:35;:::i;:::-;975:20552:34;;63986:43:35;:::i;:::-;63560:480;;;;;3007:94:30;3083:6;966:10:2;;3083:6:30;;:::i;:::-;3122;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;2303:62:0;;:::i;:::-;-1:-1:-1;;;2509:23:24;;3861:4:26;;-1:-1:-1;;;2575:22:24;;3861:4:26;;-1:-1:-1;;;2639:34:24;;;;:::i;:::-;:41;3861:4:26;;2888:85:24;3861:4:26;975:20552:34;;3861:4:26;;;:::i;:::-;975:20552:34;;;;;;;:::i;:::-;-1:-1:-1;;975:20552:34;2275:6:26;;;975:20552:34;;;;;;;2794:78:24;;975:20552:34;;:::i;:::-;;2275:6:26;;;;975:20552:34;;;2275:6:26;975:20552:34;;2275:6:26;;;;2921:15:24;;975:20552:34;;2759:11:24;975:20552:34;;;;;;;;3861:4:26;;975:20552:34;;2275:6:26;;;;975:20552:34;;;3861:4:26;;975:20552:34;;;3861:4:26;;;975:20552:34;2888:85:24;975:20552:34;3861:4:26;;;;975:20552:34;3861:4:26;975:20552:34;;3861:4:26;;;;;975:20552:34;3861:4:26;975:20552:34;;3861:4:26;;;;;975:20552:34;3861:4:26;975:20552:34;;3861:4:26;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;7610:19:32;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;:::i;:::-;3701:25:26;975:20552:34;;;;;;;;;;;;;;;;;;;7799:41:32;7795:150;;975:20552:34;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;;;;;;8067:44:32;8063:616;;975:20552:34;8736:6:32;;;;;;:::i;8063:616::-;8146:17;;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;8202:37:32;;;975:20552:34;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;7610:19:32;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;8736:6:32;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;;;;;;;;;;;8571:97:32;975:20552:34;;8571:97:32;8063:616;;;;975:20552:34;;;;;;;;;;;;;;;7795:150:32;7895:10;7864:41;975:20552:34;;7795:150:32;;;975:20552:34;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;1301:103:4;;:::i;:::-;2125:21:30;:9;:21;:::i;:::-;61133:7:35;975:20552:34;;;61124:36:35;975:20552:34;;;;;61124:36:35;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;61183:468:35;;975:20552:34;61844:24:35;;;;;:::i;:::-;61908:32;;;:::i;:::-;2275:6:26;61971:18:35;-1:-1:-1;;;;;975:20552:34;;61971:18:35;:::i;:::-;62185:20;975:20552:34;62185:20:35;;975:20552:34;;62184:51:35;;;;975:20552:34;-1:-1:-1;62180:411:35;;;-1:-1:-1;;;;;975:20552:34;;;9360:18:36;975:20552:34;;62296:67:35;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;62296:67:35:-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;62377:49:35;62641:30;975:20552:34;62377:49:35;62640:44;975:20552:34;9033:15:36;975:20552:34;;;;;;;;;;;;62377:49:35;:::i;:::-;-1:-1:-1;;;;;2275:6:26;62641:30:35;:::i;:::-;975:20552:34;62640:44:35;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;62600:84:35;;975:20552:34;;;62600:84:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;2125:9:30;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;966:10:2;;-1:-1:-1;;;;;;;;;;;2162:62:30;;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;62180:411:35;62537:14;62640:44;62537:14;62512:68;62641:30;62537:14;-1:-1:-1;;;;;975:20552:34;;9360:18:36;975:20552:34;;62512:68:35;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;62512:68:35:-;62180:411;;62184:51;62209:26;;;;975:20552:34;;;62184:51:35;;;61183:468;61609:31;;2275:6:26;;-1:-1:-1;;;;;;61228:54:35;975:20552:34;2275:6:26;975:20552:34;;;61228:54:35;:::i;61609:31::-;61183:468;;;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;-1:-1:-1;975:20552:34;;;;6893:10:31;975:20552:34;;;;;;;-1:-1:-1;;;;975:20552:34;;;17684:23:32;;975:20552:34;17684:23:32;975:20552:34;6982:148:31;975:20552:34;;;;11377:15:36;975:20552:34;;;;;;;;6986:10:31;975:20552:34;;;;;;;;;7036:83:31;;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;20569:24:30;20397:74;975:20552:34;;20397:74:30;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;;;;;:::i;:::-;;;;;;;;;23755:19:32;975:20552:34;;;;;23755:38:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;:::i;:::-;3701:25:26;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;2303:62:0;;:::i;:::-;16731:5:32;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;16753:31:32;975:20552:34;;16753:31:32;975:20552:34;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;108375:30:35;975:20552:34;;108375:30:35;:::i;:::-;975:20552:34;:::i;:::-;;108423:13:35;;;975:20552:34;;;108438:13:35;;975:20552:34;;;;;;;;;;;;;;;;;7879:7:30;975:20552:34;;;:::i;:::-;7879:7:30;;;;;:::i;:::-;8991:25;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;21473:19;975:20552;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;4608:71:32;975:20552:34;;:::i;:::-;;;;;;4645:10:32;;4608:71;;:::i;975:20552:34:-;;;;;;;:::i;:::-;1301:103:4;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;6893:10:31;975:20552:34;;;;;6923:49:31;975:20552:34;;;;;;;:::i;6923:49:31:-;975:20552:34;-1:-1:-1;;;;;975:20552:34;6986:10:31;:34;6982:148;;975:20552:34;7139:1:31;975:20552:34;;;;11377:15:36;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;4372:92;975:20552;;;;-1:-1:-1;975:20552:34;;;4380:31;4372:92;:::i;:::-;4534:21;4530:70;;975:20552;4704:87;;;975:20552;4827:18;5621:54;4827:18;5563:42;975:20552;4827:18;975:20552;4827:18;;;:::i;:::-;975:20552;;;;5149:15;975:20552;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;5261:18;975:20552;;;;-1:-1:-1;975:20552:34;;:::i;:::-;5261:18;;;:::i;:::-;975:20552;;;;5149:15;975:20552;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;:::i;:::-;;;;;5149:15;975:20552;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;2275:6:26;5496:57:34;;2275:6:26;;975:20552:34;;5496:57;:::i;:::-;975:20552;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;5563:10;975:20552;;;;;;;;;;;5563:42;;975:20552;2275:6:26;975:20552:34;5563:42;:::i;:::-;;;:::i;:::-;975:20552;;;;;-1:-1:-1;;;;;975:20552:34;;5621:54;975:20552;-1:-1:-1;;;;;;;;;;;3556:68:14;975:20552:34;4704:87;975:20552;4731:60;;;;5563:42;4731:60;5621:54;4731:60;;:::i;:::-;4704:87;;;;;;;4530:70;4582:17;;;;;:::i;:::-;4530:70;;;6982:148:31;975:20552:34;;;11377:15:36;975:20552:34;;;;;;;;;;6986:10:31;975:20552:34;-1:-1:-1;975:20552:34;;;7036:83:31;975:20552:34;-1:-1:-1;975:20552:34;6986:10:31;975:20552:34;6986:10:31;975:20552:34;;;7036:83:31;:::i;:::-;6982:148;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;-1:-1:-1;;;2665:12:22;;;2661:35;;-1:-1:-1;;;;;975:20552:34;;;15468:14:38;975:20552:34;;;;;;;;;;;3701:25:26;975:20552:34;;;;;;;2661:35:22;23595:191;975:20552:34;23595:191:22;975:20552:34;23595:191:22;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;;;;607:42:26;975:20552:34;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;24701:22:38;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;7879:7:30;975:20552:34;;:::i;:::-;9792:6:32;975:20552:34;;9780:10:32;;;9792:6;;:::i;:::-;9780:10;;;7879:7:30;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;108865:86:35;975:20552:34;;:::i;:::-;;;:::i;:::-;108865:86:35;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;4094:23:5;;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;;;;;;;;16214:10:32;16067:15;-1:-1:-1;;;;;975:20552:34;;16067:15:32;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;:::i;:::-;;;;16161:4:32;16138:40;;;975:20552:34;;;16167:10:32;975:20552:34;16138:40:32;;;975:20552:34;;;;;;;16115:10:32;975:20552:34;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;:::i;:::-;16167:10:32;16214;;:::i;:::-;975:20552:34;;;;;16167:10:32;16284:50;16167:10;;16284:50;;975:20552:34;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;1832:2:29;975:20552:34;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;107515:30:35;975:20552:34;;107515:30:35;:::i;975:20552:34:-;-1:-1:-1;;;;;975:20552:34;;;107602:19:35;975:20552:34;;107602:19:35;;975:20552:34;;107635:20:35;975:20552:34;107635:20:35;;975:20552:34;;;107669:17:35;;;975:20552:34;;;107700:30:35;;;975:20552:34;;;107744:17:35;;;975:20552:34;;;107775:13:35;;;;975:20552:34;;;107802:13:35;975:20552:34;107802:13:35;;975:20552:34;;;2275:6:26;107829:24:35;975:20552:34;2275:6:26;;;;107829:24:35;;975:20552:34;;;;;;;;;;;;;;;;107669:17:35;975:20552:34;;;107700:30:35;975:20552:34;;;107744:17:35;975:20552:34;;;107775:13:35;975:20552:34;;;;;;;107829:24:35;975:20552:34;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;7957:32:36;975:20552:34;7957:32:36;;;975:20552:34;;8003:35:36;975:20552:34;;8003:35:36;;975:20552:34;;;8052:24:36;;;975:20552:34;;8090:26:36;975:20552:34;8090:26:36;;;975:20552:34;;2275:6:26;8130:28:36;975:20552:34;2275:6:26;;;;8130:28:36;;975:20552:34;;;;;;;;7957:32:36;975:20552:34;;;;;;;8052:24:36;975:20552:34;;;8090:26:36;975:20552:34;;;8130:28:36;975:20552:34;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;3250:11:24;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;-1:-1:-1;;;;;108021:7:35;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;24262:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;24318:13:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;24366:22:38;3606:25:26;24366:22:38;;:47;;;;975:20552:34;24365:87:38;;;;975:20552:34;24365:87:38;;3606:25:26;24470:22:38;;:47;;;;24365:87;24469;;;;975:20552:34;24469:87:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;24469:87:38;975:20552:34;;;;24534:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;24469:87:38;;24470:47;24496:21;3701:25:26;24496:21:38;;24470:47;;24365:87;975:20552:34;;;;24430:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;;24365:87:38;;24366:47;24392:21;3701:25:26;24392:21:38;;24366:47;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;7266:5:29;975:20552:34;;:::i;:::-;;;:::i;:::-;;;966:10:2;7230:5:29;966:10:2;;7230:5:29;;:::i;:::-;7266;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;;11762:79:36;;12560:11:34;;975:20552;;12637:10;975:20552;;;;2662:10:29;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;12617:31;;975:20552;;15387:74:30;;;:::i;:::-;12823:6:34;12637:10;;12823:6;:::i;:::-;-1:-1:-1;;;;;94061:18:35;;;:::i;:::-;94089:19;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;94089:49:35;;975:20552:34;2275:6:26;975:20552:34;;;94089:49:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;94089:19:35;975:20552:34;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;94972:42:35;975:20552:34;94972:33:35;94506:80;975:20552:34;;:::i;:::-;94564:21:35;975:20552:34;;;:::i;:::-;;;:::i;:::-;94506:80:35;;:::i;:::-;94621:22;;;:::i;94972:33::-;:42;:::i;:::-;:61;94968:317;;975:20552:34;95338:18:35;;;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;95295:61:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;95295:61:35;:::i;:::-;-1:-1:-1;;;;;94555:7:35;975:20552:34;;;14954:24;975:20552;2817:1:26;-1:-1:-1;;;;;2817:1:26;;;;-1:-1:-1;;;;;975:20552:34;14930:52;975:20552;2817:1:26;;-1:-1:-1;;;;;2817:1:26;;;;14912:70:34;15508:21;13057:66:44;975:20552:34;;:::i;:::-;;;;:::i;:::-;;;:::i;:::-;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;13057:66:44;;:::i;:::-;725:17:47;:5;;;;;;733;;;:::i;:::-;15751:36:34;;15747:731;;725:17:47;975:20552:34;12637:10;;;975:20552;;13153:17;975:20552;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;49529:70:21;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;13521:18;;;;:::i;:::-;12637:10;975:20552;;;;13153:17;975:20552;;;;;;;;;-1:-1:-1;;;;;2275:6:26;13478:61:34;;2275:6:26;975:20552:34;;13478:61;:::i;:::-;975:20552;;2275:6:26;;;;975:20552:34;;;;;;;12637:10;975:20552;;13153:17;975:20552;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;13628:59;975:20552;12637:10;13628:59;;975:20552;;;;;;15747:731;-1:-1:-1;;;;;;975:20552:34;;;;2817:1:26;;;;;;975:20552:34;16447:20;15747:731;;725:17:47;;;975:20552:34;725:17:47;;94968:317:35;975:20552:34;95082:31:35;;975:20552:34;;;;;;95082:31:35;975:20552:34;;95082:31:35;;-1:-1:-1;;;;;2275:6:26;95049:64:35;;975:20552:34;;;;;;95049:64:35;:::i;:::-;975:20552:34;;;;;:::i;:::-;94968:317:35;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;21221:19;975:20552;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;106155:34:35;975:20552:34;;106155:34:35;:::i;:::-;975:20552:34;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;2303:62:0;;;:::i;:::-;975:20552:34;;;;;42987:14:32;975:20552:34;;;;;;43037:14:32;43050:1;43037:14;;975:20552:34;;;;;;11377:15:36;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;11377:15:36;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;43363:14:32;;;;;;43343:281;-1:-1:-1;975:20552:34;;;;43691:10:32;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;43682:42:32;;;:82;;43343:281;43678:176;;43343:281;17220:34;975:20552:34;17220:34:32;;975:20552:34;43678:176:32;975:20552:34;;;42987:14:32;975:20552:34;;;;;;;;;;;;43780:63:32;975:20552:34;;;;;;;;;;;;;;43691:10:32;975:20552:34;;;;;43780:63:32;:::i;:::-;43678:176;;43682:82;975:20552:34;;;;42987:14:32;975:20552:34;;;;;;43728:36:32;;43682:82;;43379:3;975:20552:34;;;42987:14:32;975:20552:34;;;43402:27:32;975:20552:34;;;;43402:27:32;:::i;:::-;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;43402:36:32;43398:216;;43050:1;975:20552:34;43348:13:32;;43398:216;975:20552:34;;;;42987:14:32;975:20552:34;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;43488:40:32;43458:27;43488:40;43458:70;43488:40;;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;;42987:14:32;975:20552:34;;;;;43458:27:32;:::i;:::-;:70;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;43458:70:32;975:20552:34;;;42987:14:32;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;43594:5:32;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;19786:19:38;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;182:42:26;975:20552:34;;;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;9360:18:36;975:20552:34;;;9360:36:36;975:20552:34;;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;975:20552:34:-;;;;9360:18:36;975:20552:34;;;9360:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;975:20552:34:-;;;;23962:19:38;;;975:20552:34;;;24008:22:38;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;18071:83:30;17908:54;975:20552:34;;17908:54:30;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;11229:4:29;975:20552:34;;:::i;:::-;;;966:10:2;;11229:4:29;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;106806:32:35;975:20552:34;;106806:32:35;:::i;975:20552:34:-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;;;;2275:6:26;2303:62:0;;;:::i;:::-;4560:27:38;975:20552:34;;;4633:7:38;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;13566:79:30;975:20552:34;;:::i;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;;;;;;;2275:6:26;2303:62:0;;;:::i;:::-;4330:20:38;2275:6:26;;;4396:7:38;2275:6:26;;-1:-1:-1;;;;2275:6:26;;;;;;-1:-1:-1;;;2275:6:26;;;;;;;975:20552:34;;;;;;;-1:-1:-1;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;:::i;:::-;;;;;9535:18:36;975:20552:34;;;9535:36:36;975:20552:34;;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;975:20552:34:-;;;;9535:18:36;975:20552:34;;;9535:36:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;975:20552:34:-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;;975:20552:34;;;;:::o;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;;15387:74:30;975:20552:34;;15387:74:30;:::i;975:20552:34:-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::o;:::-;;;;;;-1:-1:-1;;975:20552:34;;;;2491:8:29;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;:::o;:::-;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;:::o;:::-;;;;;;;:::i;:::-;15491:15;975:20552;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;975:20552:34;;;;:::o;:::-;;;;;;;;:::i;:::-;;;;-1:-1:-1;;;975:20552:34;;;;:::o;:::-;17516:7;975:20552;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;:::i;:::-;105102:14:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;:::i;:::-;94506:15:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;:::i;:::-;94089:19:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;:::i;:::-;2759:11:24;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;:::i;:::-;36560:8:32;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;:::o;:::-;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;94555:7:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;:::i;:::-;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2275:6:26;;;;975:20552:34;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;17516:7;975:20552;;;17516:7;975:20552;:::o;:::-;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;:::o;:::-;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;2275:6:26;975:20552:34;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;:::o;:::-;;;;;;;;;2275:6:26;975:20552:34;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;94389:14:35;975:20552:34;:::o;:::-;;;;;;;;;2275:6:26;975:20552:34;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;2759:11:24;975:20552:34;:::o;:::-;;;;;;;;;2275:6:26;975:20552:34;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;36560:8:32;975:20552:34;:::o;:::-;;;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;:::i;:::-;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;:::o;24795:646:38:-;-1:-1:-1;;;;;25029:22:38;975:20552:34;;3606:25:26;25065:18:38;;25061:56;;24795:646;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;25292:20:38;25288:60;;24795:646;-1:-1:-1;;;;;975:20552:34;;;3701:25:26;25363:17:38;;25359:40;;975:20552:34;;;;25416:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;;24795:646:38:o;25359:40::-;25382:17;975:20552:34;25382:17:38;:::o;25288:60::-;975:20552:34;;;25319:13:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;25288:60:38;;25061:56;-1:-1:-1;3606:25:26;975:20552:34;;25090:13:38;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;25061:56:38;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;:::o;3861:4:26:-;;;;;;;;;;:::o;975:20552:34:-;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;;;;;;;;;;;:::o;11727:131:36:-;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;11762:79:36;;1301:103:4;;:::i;:::-;-1:-1:-1;;;;;4654:19:30;;975:20552:34;;9708:70:30;:58;-1:-1:-1;9708:58:30;:::i;:70::-;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;2275:6;;3861:4;-1:-1:-1;3861:4:26;;4782::30;3861::26;;;;;;;-1:-1:-1;9868:82:30;;4838:6;9868:82;;;:::i;:::-;966:10:2;;;;4838:6:30;:::i;:::-;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;11727:131:36;:::o;975:20552:34:-;-1:-1:-1;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;:::o;3227:4:26:-;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;:::o;:::-;975:20552:34;;;3227:4:26;;;;;;;;5280:628:24;5413:33;;:::i;:::-;5460:14;;5456:80;;3227:4:26;;;;;;;;;;;;;;;5588:29:24;;;:::i;:::-;3227:4:26;5639:13:24;;3227:4:26;;5639:34:24;975:20552:34;5639:34:24;5856:5;5726:11;975:20552:34;;5812:19:24;3227:4:26;5817:5:24;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;5817:5:24;;;:::i;:::-;3227:4:26;5812:19:24;;:::i;:::-;5856:5;;:::i;:::-;49025:70:21;;;;;;;;;5280:628:24;:::o;5639:34::-;3227:4:26;975:20552:34;3227:4:26;975:20552:34;;;5639:34:24;975:20552:34;;;;;;;;;;;;5456:80:24;-1:-1:-1;;5491:11:24;975:20552:34;5483:53:24;;-1:-1:-1;;;;;975:20552:34;;;2275:6:26;975:20552:34;5483:53:24;:::i;:::-;5476:60;:::o;975:20552:34:-;;;;;;;;;;;;;;;:::o;4778:359:24:-;4911:33;;:::i;:::-;4958:14;;4954:28;;3227:4:26;;;;;;;;;;;;;;;5007:29:24;;;:::i;:::-;3227:4:26;5096:13:24;;3227:4:26;;5096:34:24;975:20552:34;4778:359:24;:::o;5096:34::-;3227:4:26;975:20552:34;3227:4:26;975:20552:34;;;;4778:359:24;:::o;4954:28::-;4974:8;;975:20552:34;4974:8:24;:::o;975:20552:34:-;;;;;;;;;;;;:::o;:::-;;-1:-1:-1;;;;;975:20552:34;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;2275:6:26;975:20552:34;;;;:::o;20162:1513:32:-;-1:-1:-1;;;;;975:20552:34;;;;;20390:15:32;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;20482:36:32;20478:50;;-1:-1:-1;;;;;975:20552:34;;;;;;20568:10:32;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;20613:23:32;;20609:37;;975:20552:34;;20686:11:32;975:20552:34;;;;;20686:30:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;20781:67:32;975:20552:34;;-1:-1:-1;975:20552:34;;:::i;:::-;20726:25:32;975:20552:34;20781:31:32;975:20552:34;20781:31:32;;975:20552:34;;;;;20781:67:32;;:::i;:::-;975:20552:34;20766:12:32;:82;975:20552:34;;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;20762:559:32;21431:38;;;;;;:79;20162:1513;:::o;21431:79::-;;;20162:1513;:::o;20762:559::-;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;21087:61:32;;;;;;-1:-1:-1;;;;;2275:6:26;21188:61:32;;2275:6:26;21188:61:32;:::i;:::-;975:20552:34;20762:559:32;;21083:228;21288:8;;;975:20552:34;21288:8:32;:::o;20609:37::-;20638:8;;;;;975:20552:34;20638:8:32;:::o;20478:50::-;20520:8;;;;975:20552:34;20520:8:32;:::o;20162:1513::-;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;20390:15:32;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;20482:36:32;20478:50;;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;;;20568:10:32;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;20613:23:32;;20609:37;;-1:-1:-1;975:20552:34;20686:11:32;975:20552:34;;;-1:-1:-1;975:20552:34;20686:30:32;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;20781:67:32;975:20552:34;;-1:-1:-1;975:20552:34;;:::i;20781:67:32:-;975:20552:34;20766:12:32;:82;975:20552:34;;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;20762:559:32;21431:38;;;;;;:79;;21413:97;21570:66;;;21646:22;20162:1513;:::o;21570:66::-;20569:24:30;20397:74;;;;;:::i;21431:79:32:-;;;;;20762:559;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;21087:61:32;;;;;;-1:-1:-1;;;;;2275:6:26;21188:61:32;;2275:6:26;21188:61:32;:::i;:::-;975:20552:34;20762:559:32;;20609:37;20638:8;;;;;;-1:-1:-1;20638:8:32;:::o;103495:217:35:-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;103563:44:35;;3701:25:26;-1:-1:-1;;;;;103625:22:35;975:20552:34;;103625:37:35;:80;;;103495:217;:::o;103625:80::-;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;8893:13:36;975:20552:34;;;-1:-1:-1;;;;;103694:11:35;;:::i;:::-;975:20552:34;-1:-1:-1;103495:217:35;:::o;103563:44::-;975:20552:34;103595:12:35;:::o;975:20552:34:-;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::i;:::-;;;;:::i;1301:103:4:-;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;6140:22:30;975:20552:34;;6208:18:30;;;:::i;:::-;6244:19;;;975:20552:34;;17908:54:30;6505:6;17908:54;6459:9;18071:83;17908:54;;;;;:::i;:::-;18071:83;;;:::i;:::-;966:10:2;;;;;6459:9:30;:::i;:::-;6505:6;:::i;:::-;3556:68:14;975:20552:34;-1:-1:-1;;;;;;;;;;;3556:68:14;1301:103:4:o;975:20552:34:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1301:103:4;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;7906:22:30;975:20552:34;;18071:83:30;17908:54;16642:18;;;:::i;18071:83::-;8008:19;;;975:20552:34;;20397:74:30;;8271:9;20397:74;8225:9;20397:74;;;:::i;:::-;20569:24;20493:54;;;:::i;:::-;20569:24;;;:::i;:::-;966:10:2;;;;;;8225:9:30;:::i;975:20552:34:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;3867:567:24:-;10274:14;975:20552:34;4038:37:24;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;4090:44:24;;3382:1:26;;4150:23:24;;:::o;4086:342::-;4238:34;;;:::i;:::-;4290:28;;;4286:42;;4349:68;:42;;;;:::i;:::-;:68;:::i;15862:539:30:-;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;2662:10:29;975:20552:34;;;;;;16363:31:30;;16300:45;;16087:75;;-1:-1:-1;;;;;975:20552:34;16087:75:30;:::i;3389:359:24:-;3529:33;;:::i;:::-;3664:26;3660:40;;3389:359;:::o;6245:448::-;6447:33;;:::i;:::-;6422:58;;;;6501:21;6422:58;6501:21;;:::i;:::-;6536:14;;6532:39;;3227:4:26;;;;;;;;;;;;;;6596:29:24;;;;:::i;6532:39::-;975:20552:34;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;6552:19:24:o;103904:399:35:-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;103998:44:35;;-1:-1:-1;;;;;975:20552:34;104056:16:35;;:49;;;;103904:399;104052:67;;975:20552:34;;;;15468:14:38;8893:13:36;975:20552:34;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;104194:23:35;104190:41;;975:20552:34;;9188:16:36;8893:13;975:20552:34;;9188:34:36;975:20552:34;;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;104248:48:35;103904:399;:::o;104056:49::-;104091:14;-1:-1:-1;;;;;104076:29:35;;104056:49;;3405:215:0;-1:-1:-1;;;;;975:20552:34;3489:22:0;;3485:91;;-1:-1:-1;;;;;;;;;;;3701:25:26;;-1:-1:-1;;;;;;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;3975:40:0;-1:-1:-1;;3975:40:0;3405:215::o;3485:91::-;3534:31;;;3509:1;3534:31;3509:1;3534:31;975:20552:34;;3509:1:0;3534:31;975:20552:34;;-1:-1:-1;975:20552:34;;;:::o;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;:::o;2658:162:0:-;-1:-1:-1;;;;;;;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;966:10:2;2717:23:0;2713:101;;2658:162::o;2713:101::-;2763:40;;;-1:-1:-1;2763:40:0;966:10:2;2763:40:0;975:20552:34;;-1:-1:-1;2763:40:0;13377:481:30;13566:79;975:20552:34;;:::i;13566:79:30:-;13719:22;;:::i;:::-;13762:24;;;;;;13789;;;:::i;13377:481::-;13566:79;975:20552:34;;:::i;13566:79:30:-;13655:173;;;13377:481;:::o;10081:533::-;10450:58;15366:4;10450:58;:::i;:::-;3861:4:26;15366::30;3861::26;;;;;;;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;;-1:-1:-1;3861:4:26;;10525:82:30;;975:20552:34;10525:82:30;;:::i;8930:136:36:-;2817:1:26;8930:136:36;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;8930:136:36;:::o;975:20552:34:-;;;;;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;-1:-1:-1;975:20552:34;:::o;8646:142:36:-;2817:1:26;8646:142:36;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;8646:142:36;:::o;8794:130::-;2817:1:26;8794:130:36;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;8794:130:36;:::o;12751:443:29:-;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;4812:12:29;975:20552:34;;;;;;;;;;;;;;;;;;;;;;12751:443:29;;-1:-1:-1;;12916:36:29;;12912:276;;12751:443;;;;;:::o;12912:276::-;12976:25;;;975:20552:34;;12204:19:29;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;12276:21:29;975:20552:34;;-1:-1:-1;975:20552:34;4812:12:29;975:20552:34;;;-1:-1:-1;975:20552:34;12341:28:29;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;12912:276:29;;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;-1:-1:-1;4812:12:29;975:20552:34;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;-1:-1:-1;4812:12:29;975:20552:34;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;4812:12:29;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;:::o;:::-;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;7673:248:29;-1:-1:-1;;;;;975:20552:34;7760:18:29;;;975:20552:34;;7752:59:29;7760:18;;7752:59;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;7829:16:29;;7821:59;7829:16;;7821:59;:::i;:::-;8444:17;;;:::i;:::-;8471:638;8475:18;;;8611:8;975:20552:34;-1:-1:-1;;;;;;;;;;;9522:25:29;975:20552:34;;;;;;-1:-1:-1;;;;;8611:26:29;975:20552:34;;;;8611:26:29;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;8611:8:29;975:20552:34;8471:638:29;9123:16;;;9287:8;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;9119:388:29;975:20552:34;;;;;9522:25:29;7673:248::o;9119:388::-;8491:1;975:20552:34;;;9458:10:29;975:20552:34;;;;;;;;;-1:-1:-1;;;;;2275:6:26;9458:38:29;;2275:6:26;975:20552:34;;9458:38:29;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;9119:388:29;;8471:638;975:20552:34;8491:1:29;975:20552:34;8697:10:29;975:20552:34;;;;8491:1:29;975:20552:34;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;8798:24:29;;;975:20552:34;;2275:6:26;;-1:-1:-1;;;;;;;;;;;2275:6:26;;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;;975:20552:34;2275:6:26;;;;975:20552:34;;;;;;;;8491:1:29;975:20552:34;8697:10:29;975:20552:34;;;8491:1:29;975:20552:34;;:::i;:::-;8471:638:29;;975:20552:34;;;;;;;8491:1:29;975:20552:34;;;;;;;;8491:1:29;975:20552:34;42037:343:32;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;11377:15:36;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;11377:15:36;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;;;;;;;;42302:14:32;975:20552:34;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;42242:4:32;975:20552:34;;;;;;:::i;:::-;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;8455:838:47;975:20552:34;;;9086:38:47;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;9047:77:47;;975:20552:34;;;;;;9047:77:47;:::i;:::-;975:20552:34;725:5:47;;;;;;733;;;:::i;975:20552:34:-;;;;;;;;;;;;2275:6:26;975:20552:34;;;;-1:-1:-1;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;:::o;30024:1353:32:-;-1:-1:-1;;;;;30024:1353:32;;;;975:20552:34;;;-1:-1:-1;975:20552:34;30173:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;-1:-1:-1;975:20552:34;30251:10:32;975:20552:34;;;;-1:-1:-1;975:20552:34;;;30316:18:32;;;;:::i;:::-;30381:35;30482:58;975:20552:34;30381:35:32;;975:20552:34;;30381:58:32;975:20552:34;;;;;30381:58:32;:::i;:::-;30366:12;:73;975:20552:34;;;30482:58:32;:::i;:::-;975:20552:34;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;30646:42:32;;975:20552:34;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;30983:10:32;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;30173:18:32;975:20552:34;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;31175:43:32;975:20552:34;;;;;;31175:43:32;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;31347:4:32;31330:40;;30024:1353::o;975:20552:34:-;;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;1583:377:4;-1:-1:-1;;;;;;;;;;;3327:69:14;1737:93:4;;1948:4;-1:-1:-1;;;;;;;;;;;3556:68:14;1583:377:4:o;1737:93::-;1789:30;;;-1:-1:-1;1789:30:4;;-1:-1:-1;1789:30:4;5765:142:31;946:14:46;5765:142:31;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;975:20552:34;5852:32:31;;;975:20552:34;946:14:46;:::i;:::-;23196:2:38;-1:-1:-1;;975:27:46;;23196:2:38;;3556:68:14;-1:-1:-1;3556:68:14;;5765:142:31:o;971:363:46:-;1790:54;;;1226:20;;;;;;1249;;;:::i;:::-;1226:50;;3556:68:14;5765:142:31:o;1226:50:46:-;;;-1:-1:-1;1226:50:46;;;9407:550:30;9793:58;18048:4;9793:58;:::i;:::-;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;2275:6;;3861:4;-1:-1:-1;3861:4:26;;18048::30;3861::26;;;;;;;9868:82:30;;18048:4;9868:82;;:::i;9407:550::-;9793:58;9679:172;9793:58;:::i;9407:550::-;9793:58;9679:172;9793:58;:::i;:::-;2491:8:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;3861:4:26;;;2275:6;;3861:4;-1:-1:-1;3861:4:26;;975:20552:34;3861:4:26;;;;;;;9868:82:30;;9679:172;9868:82;;:::i;9264:218:19:-;-1:-1:-1;;;;;9344:25:19;;9340:105;;-1:-1:-1;;;;;975:20552:34;;9264:218:19:o;9340:105::-;9392:42;;;;;9423:3;9392:42;975:20552:34;;;;9392:42:19;;32491:6449:32;-1:-1:-1;;;;;975:20552:34;;;;;;32722:10:32;975:20552:34;;;;;32491:6449:32;;975:20552:34;;32491:6449:32;;;975:20552:34;;;:::i;:::-;32769:33:32;:45;:33;;;;:::i;:45::-;2275:6:26;32849:33:32;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;32849:33:32;:::i;:::-;32935:26;975:20552:34;33339:26:32;975:20552:34;33339:26:32;;975:20552:34;2275:6:26;;;;33330:35:32;975:20552:34;2275:6:26;;;;975:20552:34;;;33330:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;33313:52:32;33309:1382;;32491:6449;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34818:35:32;;975:20552:34;;34818:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;34801:52:32;34797:618;;32491:6449;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;35713:18:32;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;2275:6:26;975:20552:34;35615:24:32;-1:-1:-1;975:20552:34;;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;975:20552:34;36069:17:32;;;975:20552:34;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;32722:10:32;975:20552:34;;;;;2275:6:26;;-1:-1:-1;2275:6:26;;;;975:20552:34;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;36385:23:32;;:52;;32491:6449;36381:65;;975:20552:34;;;;:::i;:::-;;;;;36953:21:32;;975:20552:34;;36953:21:32;;-1:-1:-1;975:20552:34;;36953:21:32;;-1:-1:-1;;;;;2275:6:26;36953:43:32;;2275:6:26;975:20552:34;;36953:43:32;:::i;:::-;975:20552:34;;;;:::i;:::-;-1:-1:-1;;;975:20552:34;;;;;;;;36381:65:32;36439:7;;;:::o;36385:52::-;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;36385:52:32;;975:20552:34;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;975:20552:34;34797:618:32;2275:6:26;34898:52:32;35074:94;2275:6:26;;;;34898:35:32;35096:72;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;34898:35:32;;:::i;:::-;:52;:::i;:::-;35096:72;;;;;:::i;:::-;35074:94;;:::i;:::-;2275:6:26;35256:33:32;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;35256:33:32;:::i;:::-;34797:618;;;;;33309:1382;975:20552:34;;;;;33698:52:32;-1:-1:-1;;;;;975:20552:34;;;;;;33472:18:32;975:20552:34;;;;;;;;;;33698:35:32;975:20552:34;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;33698:35:32;;:::i;:52::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;49025:70:21;;;;;;;;;;975:20552:34;;;2275:6:26;33853:54:32;;975:20552:34;;33853:54:32;:::i;:::-;975:20552:34;;;;;-1:-1:-1;;;;;2275:6:26;33989:48:32;;2275:6:26;;975:20552:34;;33989:48:32;:::i;:::-;975:20552:34;;;;34109:17:32;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34109:42:32;;2275:6:26;;975:20552:34;;34109:42:32;:::i;:::-;975:20552:34;;;;;;33472:18:32;975:20552:34;;;;;;;;;;;;;;:::i;:::-;;;34545:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;34545:33:32;:::i;:::-;33309:1382;;;32491:6449;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;;;32722:10:32;975:20552:34;;;;;-1:-1:-1;;32491:6449:32;;;;;975:20552:34;;;:::i;:::-;32769:33:32;:45;:33;;;;:::i;:45::-;975:20552:34;;32849:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;32849:33:32;:::i;:::-;975:20552:34;33339:26:32;;975:20552:34;;-1:-1:-1;;32935:26:32;;;33339;;-1:-1:-1;;;;;2275:6:26;33330:35:32;;975:20552:34;;33330:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;33313:52:32;33309:1382;;32491:6449;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34818:35:32;;975:20552:34;;34818:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;34801:52:32;34797:618;;32491:6449;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;;;35713:18:32;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;35615:24:32;-1:-1:-1;975:20552:34;;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;36069:17:32;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;32722:10:32;975:20552:34;;;;;;;2275:6:26;975:20552:34;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;36385:23:32;;:52;;32491:6449;36381:65;;975:20552:34;;;;;:::i;:::-;;;;;38349:21:32;;975:20552:34;;36579:2201:32;;-1:-1:-1;975:20552:34;;38349:21:32;;-1:-1:-1;;;;;2275:6:26;38349:43:32;;2275:6:26;975:20552:34;;38349:43:32;:::i;:::-;975:20552:34;;;;-1:-1:-1;;;;;2275:6:26;38483:31:32;;2275:6:26;;38483:31:32;:::i;:::-;975:20552:34;;;;;-1:-1:-1;;;;;2275:6:26;38633:22:32;;975:20552:34;;38633:22:32;:::i;:::-;975:20552:34;;;;:::i;:::-;-1:-1:-1;;;975:20552:34;;;;;;;;36381:65:32;36439:7;;;;:::o;36385:52::-;-1:-1:-1;;;;;36385:52:32;;975:20552:34;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;975:20552:34;34797:618:32;975:20552:34;2275:6:26;;35074:94:32;;2275:6:26;;35096:72:32;;2275:6:26;34898:52:32;;:35;;-1:-1:-1;;;;;975:20552:34;34898:35:32;;:::i;:52::-;35096:72;;;;;:::i;35074:94::-;2275:6:26;35256:33:32;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;35256:33:32;:::i;:::-;34797:618;;;;;33309:1382;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;33472:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;33698:52:32;975:20552:34;;-1:-1:-1;975:20552:34;;:::i;:::-;;;2275:6:26;;;33698:35:32;;-1:-1:-1;;;;;975:20552:34;2275:6:26;33698:35:32;:::i;:52::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;49025:70:21;;;;;;;;;;975:20552:34;;;2275:6:26;33853:54:32;;975:20552:34;;33853:54:32;:::i;:::-;975:20552:34;;;;;-1:-1:-1;;;;;2275:6:26;33989:48:32;;2275:6:26;;975:20552:34;;33989:48:32;:::i;:::-;975:20552:34;;;;34109:17:32;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34109:42:32;;2275:6:26;;975:20552:34;;34109:42:32;:::i;975:20552:34:-;;;34545:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;34545:33:32;:::i;:::-;33309:1382;;;32491:6449;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;;;32722:10:32;975:20552:34;;;;;-1:-1:-1;;32491:6449:32;;;;975:20552:34;;;:::i;:::-;32769:33:32;:45;:33;;;;:::i;:45::-;975:20552:34;;32849:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;32849:33:32;:::i;:::-;975:20552:34;33339:26:32;;975:20552:34;;-1:-1:-1;;32935:26:32;;;33339;;-1:-1:-1;;;;;2275:6:26;33330:35:32;;975:20552:34;;33330:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;33313:52:32;33309:1382;;32491:6449;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34818:35:32;;975:20552:34;;34818:35:32;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;34801:52:32;34797:618;;32491:6449;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;;;35713:18:32;975:20552:34;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;35615:24:32;-1:-1:-1;975:20552:34;;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;975:20552:34;36069:17:32;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;32722:10:32;975:20552:34;;;;;;;2275:6:26;975:20552:34;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;36385:23:32;;:52;;32491:6449;36381:65;;975:20552:34;;;;;:::i;:::-;;;;;37575:21:32;;975:20552:34;;36579:2201:32;;-1:-1:-1;975:20552:34;;37575:21:32;;37709:31;;-1:-1:-1;;;;;2275:6:26;37575:43:32;;975:20552:34;;37575:43:32;:::i;:::-;975:20552:34;;;;-1:-1:-1;;;;;2275:6:26;975:20552:34;37709:31:32;:::i;36385:52::-;-1:-1:-1;;;;;36385:52:32;;34797:618;975:20552:34;2275:6:26;;35074:94:32;;2275:6:26;;35096:72:32;;2275:6:26;34898:52:32;;:35;;-1:-1:-1;;;;;975:20552:34;34898:35:32;;:::i;35074:94::-;2275:6:26;35256:33:32;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;35256:33:32;:::i;:::-;34797:618;;;;;33309:1382;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;33472:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;33698:52:32;975:20552:34;;-1:-1:-1;975:20552:34;;:::i;:::-;;;2275:6:26;;;33698:35:32;;-1:-1:-1;;;;;975:20552:34;33698:35:32;;:::i;:52::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;49025:70:21;;;;;;;;;;975:20552:34;;;2275:6:26;33853:54:32;;975:20552:34;;33853:54:32;:::i;:::-;975:20552:34;;;;;-1:-1:-1;;;;;2275:6:26;33989:48:32;;2275:6:26;;975:20552:34;;33989:48:32;:::i;:::-;975:20552:34;;;;34109:17:32;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;34109:42:32;;2275:6:26;;975:20552:34;;34109:42:32;:::i;:::-;975:20552:34;;;;-1:-1:-1;975:20552:34;33472:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;34545:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;34545:33:32;:::i;:::-;33309:1382;;;27596:1915;;;;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;27859:15:32;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;-1:-1:-1;975:20552:34;27946:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;28014:18:32;28060:45;:33;28014:18;;;;:::i;:::-;28060:33;;:::i;:45::-;975:20552:34;;28137:33:32;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;28137:33:32;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;;;;28137:46:32;-1:-1:-1;975:20552:34;;2275:6:26;;;;975:20552:34;2275:6:26;975:20552:34;2275:6:26;;975:20552:34;2275:6:26;;;;;975:20552:34;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;28513:10:32;975:20552:34;;28513:42:32;975:20552:34;-1:-1:-1;975:20552:34;;2275:6:26;;;;975:20552:34;;;;;;;28513:42:32;;:::i;:::-;28657:8;975:20552:34;;-1:-1:-1;;;;;;2275:6:26;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;28894:12:32;975:20552:34;;28849:35:32;;975:20552:34;2275:6:26;29029:25:32;;;:::i;:::-;975:20552:34;;29000:26:32;;975:20552:34;;-1:-1:-1;975:20552:34;27859:15:32;975:20552:34;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;-1:-1:-1;975:20552:34;27946:18:32;975:20552:34;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;-1:-1:-1;975:20552:34;29388:10:32;975:20552:34;;29439:65:32;975:20552:34;29373:50:32;975:20552:34;;-1:-1:-1;975:20552:34;;;28894:12:32;29373:50;:::i;:::-;975:20552:34;;;;;;;;;;;29439:65:32;27596:1915::o;975:20552:34:-;;;;-1:-1:-1;975:20552:34;;;;2275:6:26;;;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;4215:142:22;-1:-1:-1;;;4291:13:22;;;4287:36;;-1:-1:-1;;;;;975:20552:34;;4215:142:22:o;975:20552:34:-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;:::o;:::-;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;:::o;11296:213:19:-;-1:-1:-1;;;;;11374:24:19;;11370:103;;-1:-1:-1;;;;;975:20552:34;;11296:213:19:o;11370:103::-;9392:42;;;11421:41;;11452:2;11421:41;975:20552:34;;;;11421:41:19;;10397:180:29;;;;-1:-1:-1;;;;;975:20552:34;10471:21:29;;10463:62;10471:21;;10463:62;:::i;:::-;8444:17;;;:::i;:::-;8471:638;8475:18;;;8611:8;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;9522:25:29;975:20552:34;;;-1:-1:-1;;;;;8611:26:29;975:20552:34;;;;8611:26:29;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;8611:8:29;975:20552:34;8471:638:29;9287:8;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;9522:25:29;10397:180::o;8471:638::-;975:20552:34;;;8697:10:29;975:20552:34;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;8798:24:29;;;975:20552:34;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;8697:10:29;975:20552:34;;;;;;;2275:6:26;;975:20552:34;;-1:-1:-1;;;;;;;;;;;9522:25:29;975:20552:34;;;;;:::i;:::-;8471:638:29;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;15502:589:38;-1:-1:-1;;;;;15502:589:38;-1:-1:-1;975:20552:34;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;15643:15:38;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;15694:14:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;;;;15848:14:38;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;:::i;:::-;;;15732:352:38;975:20552:34;15732:352:38;;975:20552:34;15839:23:38;975:20552:34;15732:352:38;;975:20552:34;;15732:352:38;;975:20552:34;;15732:352:38;;975:20552:34;;15732:352:38;;975:20552:34;;15732:352:38;;975:20552:34;15502:589:38;:::o;10678:380:30:-;;10807:9;10797:19;;975:20552:34;;10878:6:30;;;975:20552:34;10878:6:30;-1:-1:-1;;;;;;;;;;;10878:6:30;;:::i;:::-;10987;;;:::i;:::-;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;11010:41:30;10678:380::o;101225:153:35:-;975:20552:34;101318:7:35;975:20552:34;;;;3227:4:26;;;;;;;;;;;;;;;975:20552:34;101318:53:35;3227:4:26;101225:153:35;:::o;975:20552:34:-;17516:7;975:20552;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;:::o;7054:1006:24:-;;7246:19;;7242:38;;7316:33;;:::i;:::-;3861:4:26;;;;7497:91:24;3861:4:26;;:::i;:::-;7497:91:24;;;;:::i;:::-;7463:125;;7703:11;;7699:251;;8019:34;;;7054:1006;:::o;7699:251::-;3861:4:26;;;7757:79:24;3861:4:26;;;;;:::i;:::-;7757:79:24;;;:::i;:::-;7850:31;;:::o;7242:38::-;7264:1;;-1:-1:-1;7264:1:24;;7267:13::o;8725:683::-;;8909:33;;:::i;:::-;8956:14;;;;8952:33;;9207:15;;;975:20552:34;;9315:86:24;3861:4:26;;;;:::i;:::-;9315:86:24;;:::i;975:20552:34:-;;;;;;8969:1:24;975:20552:34;;;;;;8969:1:24;975:20552:34;8952:33:24;8972:13;;;;8969:1;8972:13;8969:1;8972:13;:::o;975:20552:34:-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;:::o;91789:1545:35:-;91905:14;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;2275:6:26;975:20552:34;;92226:30:35;;975:20552:34;92226:30:35;:::i;:::-;:49;92222:1038;;91789:1545;93306:21;;;;;;:::i;:::-;91905:14;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;93270:57:35;;2275:6:26;975:20552:34;;;93270:57:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;91905:14:35;975:20552:34;91789:1545:35:o;92222:1038::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;92396:68:35;;975:20552:34;;;;;;;;92396:68:35;:::i;:::-;975:20552:34;92516:42:35;92483:30;;;;:::i;:::-;92516:42;;;:::i;:::-;-1:-1:-1;92479:215:35;;92821:30;92820:63;92821:30;;;:49;:30;;:::i;:::-;:49;:::i;:::-;92820:63;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;92897:59:35;93306:21;975:20552:34;8753:17:36;975:20552:34;92897:59:35;975:20552:34;;;;;;;;;;;92897:59:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;92970:54:35;;975:20552:34;;;;92970:54:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;91905:14:35;975:20552:34;;-1:-1:-1;;;;;2275:6:26;93080:50:35;;-1:-1:-1;;;;;975:20552:34;;;;93080:50:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;91905:14:35;975:20552:34;92222:1038:35;;;;92479:215;92624:15;;92641:37;92624:15;;;:::i;:::-;92641:37;;:::i;:::-;92585:94;;;;-1:-1:-1;92585:94:35;;975:20552:34;;;;-1:-1:-1;92585:94:35;4505:342:23;4620:221;4505:342;;;4620:221;;;;;;;4505:342::o;4620:221::-;;;;;;;99477:1345:35;975:20552:34;;:::i;:::-;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;2275:6:26;99849:31:35;975:20552:34;2275:6:26;;;;99849:31:35;;975:20552:34;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;100713:38:35;975:20552:34;;100602:75:35;975:20552:34;9033:15:36;975:20552:34;;:::i;:::-;99849:31:35;100158:28;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;100158:62:35;;975:20552:34;;;;;100158:62:35;:::i;:::-;-1:-1:-1;;;;;2275:6:26;100621:56:35;;975:20552:34;49025:70:21;;;;;;;;100621:56:35;:::i;:::-;975:20552:34;100602:75:35;;:::i;:::-;100713:38;;:::i;:::-;100762:53;99477:1345;:::o;6248:162:31:-;1460:14:46;6248:162:31;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;1460:14:46:-;3327:69:14;6248:162:31;:::o;9506:401:24:-;9691:14;;9687:33;;9814:86;9756:33;;;:::i;:::-;3861:4:26;;;:::i;9687:33:24:-;9707:13;9704:1;9707:13;9704:1;9707:13;:::o;975:20552:34:-;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;;;;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;975:20552:34;;:::o;11742:460:38:-;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;11838:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;;-1:-1:-1;975:20552:34;11883:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;12125:70:38;975:20552:34;;;11963:24:38;;975:20552:34;11963:24:38;:::i;:::-;;975:20552:34;-1:-1:-1;975:20552:34;;;11883:15:38;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;975:20552:34;;;;12089:7:38;975:20552:34;;-1:-1:-1;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;12125:70:38;11742:460::o;975:20552:34:-;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;8769:137:33;975:20552:34;;;-1:-1:-1;;;8845:31:33;;975:20552:34;;8845:31:33;975:20552:34;8845:31:33;182:42:26;8845:31:33;;;;;;;;;;;8886:13;8769:137;:::o;8845:31::-;;;;975:20552:34;8845:31:33;975:20552:34;8845:31:33;;;;;;;:::i;:::-;;8769:137;:::o;43979::32:-;44047:62;43979:137;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;44055:10:32;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;44047:62:32;:::i;10967:1724:35:-;11055:11;;:::i;:::-;3701:25:26;-1:-1:-1;;;;;11157:22:35;975:20552:34;;11157:37:35;11153:55;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;8893:13:36;975:20552:34;;;;;-1:-1:-1;11266:40:35;11262:57;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;8893:13:36;975:20552:34;;:::i;:::-;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;9024:31:33;;975:20552:34;;;9024:31:33;975:20552:34;;182:42:26;9024:31:33;;;;;;;18217:718:35;9024:31:33;975:20552:34;;;9024:31:33;;;10967:1724:35;8979:76:33;;9065:34;;;10967:1724:35;18562:21;;;:::i;:::-;18733:25;975:20552:34;18733:25:35;;;975:20552:34;;;18784:25:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;;;;;8893:13:36;18217:718:35;;975:20552:34;;;18217:718:35;;975:20552:34;;18217:718:35;;;975:20552:34;;;18217:718:35;;;975:20552:34;;18217:718:35;;;975:20552:34;18733:25:35;18217:718;;975:20552:34;;18217:718:35;;975:20552:34;;18217:718:35;;;975:20552:34;8893:13:36;975:20552:34;18217:718:35;:::i;:::-;2817:1:26;11671::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;11652:27:35;975:20552:34;9033:15:36;975:20552:34;11652:27:35;:::i;:::-;2817:1:26;11671::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;11691:29:35;975:20552:34;8753:17:36;975:20552:34;11691:29:35;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;8753:17:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;13285:40:35;975:20552:34;;:::i;:::-;13285:40:35;:::i;:::-;13355:15;975:20552:34;13423:15:35;975:20552:34;18217:718:35;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;13492:29:35;975:20552:34;;13492:29:35;:::i;:::-;13470:51;;13466:1955;;10967:1724;8771:9:36;;;;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;16468:103:35;16549:21;;975:20552:34;;;:::i;:::-;;;;;:::i;:::-;;8753:17:36;975:20552:34;;:::i;:::-;16468:103:35;;:::i;:::-;16585:13;16581:176;;10967:1724;975:20552:34;;;:::i;:::-;;2275:6:26;;;;975:20552:34;;;2275:6:26;8893:13:36;975:20552:34;2275:6:26;;;;98102:31:35;;975:20552:34;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;98967:55:35;975:20552:34;98949:73:35;975:20552:34;9033:15:36;975:20552:34;;:::i;:::-;8893:13:36;98579:28:35;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;98579:62:35;;975:20552:34;;;;;98579:62:35;:::i;:::-;975:20552:34;49025:70:21;;;;;;;;98967:55:35;:::i;:::-;98949:73;;:::i;:::-;85544:74;;;;;:::i;:::-;85802:96;;-1:-1:-1;85802:23:35;;;;85937:76;3227:4:26;102908:27:35;102410:59;2275:6:26;102410:31:35;-1:-1:-1;;;;;975:20552:34;;102410:31:35;:::i;:59::-;85802:96;;-1:-1:-1;;;;;975:20552:34;;;102908:27:35;:::i;:::-;3227:4:26;85937:76:35;:::i;:::-;86088:63;48473:85:21;;;;;;;975:20552:34;48473:85:21;;;86088:63:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;;;;86192:61:35;48473:85:21;;;975:20552:34;48473:85:21;;;;;;;;86192:61:35;:::i;:::-;86473:16;975:20552:34;;;;86533:41:35;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;16508:14:35;975:20552:34;-1:-1:-1;;;;;86800:55:35;86750:36;975:20552:34;;;86800:55:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;16508:14:35;975:20552:34;86529:832:35;87525:39;975:20552:34;;;87741:32:35;;;;:::i;:::-;16508:14;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;87787:56:35;;-1:-1:-1;;;;;975:20552:34;2275:6:26;975:20552:34;;;87787:56:35;:::i;:::-;18217:718;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;16508:14:35;975:20552:34;87521:914:35;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;8753:17:36;975:20552:34;;:::i;:::-;;-1:-1:-1;;;;;975:20552:34;;;;;;;88867:22:35;;;975:20552:34;;;88927:22:35;;;;;:::i;:::-;8893:13:36;88997:32:35;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;88997:32:35;975:20552:34;;89125:46:35;-1:-1:-1;89125:46:35;;;975:20552:34;;89275:72:35;;89309:37;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;89191:59:35;;975:20552:34;;;;89191:59:35;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;89309:37:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;89275:72:35;:::i;:::-;975:20552:34;;;89121:327:35;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;10376:44:36;975:20552:34;;;;;8893:13:36;10398:22;;975:20552:34;;10376:44:36;;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;8478:7:36;975:20552:34;2817:1:26;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;;15775:91:35;975:20552:34;;;;;;;9033:15:36;975:20552:34;;;;;16508:14:35;975:20552:34;18217:718:35;975:20552:34;49025:70:21;;;;;;;;15775:91:35;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;;;16508:14:35;975:20552:34;-1:-1:-1;;;;;;16021:51:35;-1:-1:-1;;;;;975:20552:34;;2275:6:26;975:20552:34;;;16021:51:35;:::i;:::-;18217:718;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;16508:14:35;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;16202:58:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;16202:58:35;:::i;:::-;24544:86;975:20552:34;;:::i;24544:86:35:-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;24756:68:35;975:20552:34;;:::i;24756:68:35:-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;27437:31:35;;-1:-1:-1;;;;;975:20552:34;;;;;25022:46:35;;;;;;:95;;;25277:49;;;;;;25329;;;;:::i;:::-;25277:105;;25235:147;25397:44;;;25393:298;;25277:105;25939:38;;;;25935:107;;25277:105;975:20552:34;;27143:204:35;975:20552:34;;18217:718:35;975:20552:34;26136:40:35;975:20552:34;;:::i;26136:40:35:-;13355:15;975:20552:34;;;18217:718:35;975:20552:34;26263:46:35;;;;26259:869;;25277:105;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;;18217:718:35;975:20552:34;;;18217:718:35;975:20552:34;;;27143:204:35;27437:31;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;27478:62:35;;975:20552:34;;;;27478:62:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;8478:7:36;975:20552:34;2817:1:26;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;;27550:65:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;27550:65:35;:::i;:::-;28021:22;975:20552:34;28021:26:35;;:89;;;25277:105;28017:363;;25277:105;28021:22;975:20552:34;28879:26:35;28021:22;;29238:86;975:20552:34;;:::i;29238:86:35:-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;29429:49:35;;;29425:532;;28875:4321;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;-1:-1:-1;;;;;975:20552:34;30083:68:35;975:20552:34;;:::i;30083:68:35:-;30169:44;;;30165:497;;28875:4321;975:20552:34;;18201:1:35;28021:22;975:20552:34;31144:26:35;:57;;;28875:4321;31140:965;;28875:4321;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;:::i;:::-;;;;8893:13:36;-1:-1:-1;;;;;17268:12:35;975:20552:34;17139:153:35;;975:20552:34;;;;;;;17119:173:35;975:20552:34;;;17119:173:35;975:20552:34;17119:173:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;17268:12:35;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;17119:173:35;975:20552:34;17749:7:35;975:20552:34;-1:-1:-1;;;;;17747:23:35;975:20552:34;;;17747:23:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;17749:7:35;975:20552:34;3606:25:26;-1:-1:-1;;;;;975:20552:34;11157:22:35;975:20552:34;;;11157:22:35;975:20552:34;;10967:1724:35;:::o;31140:965::-;975:20552:34;31261:7:35;975:20552:34;;;;31319:33:35;;31315:776;;31140:965;;;;31315:776;975:20552:34;31547:55:35;;;;:::i;:::-;3227:4:26;11671:1:35;3227:4:26;2817:1;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;31898:47:35;-1:-1:-1;31894:179:35;;31315:776;;;;31894:179;32015:35;;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;31973:77:35;975:20552:34;8753:17:36;975:20552:34;31973:77:35;:::i;:::-;31894:179;;;31144:57;31174:27;;;;31144:57;;30165:497;30330:78;975:20552:34;30262:44:35;;;30459:30;30262:44;;:::i;:::-;975:20552:34;;;;;;8893:13:36;975:20552:34;;;30330:78:35;30459:30;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;30507:61:35;;975:20552:34;;;;30507:61:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;8478:7:36;975:20552:34;2817:1:26;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;30586:61:35;;975:20552:34;;;30586:61:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;;30165:497:35;;29425:532;29529:49;29602:87;975:20552:34;29529:49:35;;29742:32;29529:49;;:::i;:::-;975:20552:34;;;;;;;8893:13:36;975:20552:34;;;29602:87:35;29742:32;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;29792:66:35;;975:20552:34;29792:66:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;29792:66:35;:::i;:::-;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;29876:66:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;29876:66:35;:::i;:::-;29425:532;;;28875:4321;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;8753:17:36;975:20552:34;;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;8753:17:36;975:20552:34;;;;;;32496:78:35;975:20552:34;-1:-1:-1;;;;;32519:7:35;975:20552:34;;32496:78:35;975:20552:34;;;32496:78:35;;;;;:::i;:::-;;;;32593:32;;;;;;32762:28;32672:32;;;;:::i;32762:28::-;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;32722:68:35;;975:20552:34;;;32722:68:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;32589:552:35;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;33154:29:35;975:20552:34;8753:17:36;975:20552:34;33154:29:35;:::i;:::-;28875:4321;;32589:552;32932:32;;33025:31;32932:32;;:::i;33025:31::-;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;32982:74:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;32982:74:35;:::i;:::-;32589:552;;28017:363;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;;;8753:17:36;975:20552:34;;;28204:45:35;8893:13:36;975:20552:34;;;;;28204:45:35;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;;;8478:7:36;975:20552:34;2817:1:26;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;28318:51:35;;975:20552:34;;;28318:51:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;28017:363:35;;28021:89;9049:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;3227:4:26;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;28051:59:35;28021:89;;26259:869;26356:46;;;;:::i;:::-;26520:44;;;;26516:127;;26259:869;26660:42;;;26656:123;;26259:869;26917:66;975:20552:34;26798:60:35;8893:13:36;975:20552:34;;;;;26798:60:35;-1:-1:-1;;;;;;975:20552:34;26951:32:35;;;:::i;26917:66::-;18217:718;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;13355:15:35;975:20552:34;26259:869:35;;;;;26656:123;26722:42;;-1:-1:-1;26656:123:35;;26516:127;26584:44;;-1:-1:-1;26516:127:35;;25935:107;25993:38;-1:-1:-1;27143:204:35;25935:107;;25393:298;25492:44;;;;:::i;:::-;25554:46;;;25550:131;25393:298;25550:131;25620:46;-1:-1:-1;25550:131:35;25393:298;;25277:105;975:20552:34;25277:105:35;;;25022:95;;;;89121:327;975:20552:34;-1:-1:-1;;;;;975:20552:34;89386:47:35;;975:20552:34;89386:47:35;:::i;:::-;975:20552:34;;;89121:327:35;;88863:2476;89590:22;;;;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;89782:37:35;-1:-1:-1;975:20552:34;;;89871:37:35;;;91152:76;89871:37;;:::i;:::-;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;89927:53:35;;975:20552:34;;;89927:53:35;:::i;:::-;975:20552:34;;;8893:13:36;90005:32:35;;975:20552:34;;90005:32:35;;90086:515;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;90005:57:35;;975:20552:34;;;;90005:57:35;:::i;:::-;975:20552:34;;;;;90151:7:35;975:20552:34;;;16508:14:35;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;90511:72:35;975:20552:34;;90511:72:35;:::i;:::-;975:20552:34;;;;;;;8893:13:36;975:20552:34;;;;;;;18217:718:35;975:20552:34;;;18217:718:35;975:20552:34;;;18217:718:35;975:20552:34;;;;18217:718:35;975:20552:34;18733:25:35;975:20552:34;;;;;;;;18217:718:35;975:20552:34;;;90086:515:35;-1:-1:-1;;;;;2275:6:26;91186:42:35;;;:::i;91152:76::-;-1:-1:-1;;;;;;975:20552:34;;;;;;16508:14:35;975:20552:34;88863:2476:35;;89778:1551;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;91267:47:35;;-1:-1:-1;975:20552:34;91267:47:35;:::i;:::-;975:20552:34;;;88863:2476:35;;87521:914;88177:35;;;;;;:::i;:::-;16508:14;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;88226:56:35;;-1:-1:-1;;;;;975:20552:34;2275:6:26;975:20552:34;;;88226:56:35;:::i;:::-;18217:718;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;16508:14:35;975:20552:34;87521:914:35;;86529:832;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;16508:14:35;975:20552:34;-1:-1:-1;;;;;87157:55:35;87110:33;975:20552:34;;;87157:55:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;16508:14:35;975:20552:34;86529:832:35;;85802:96;85937:76;3227:4:26;102908:27:35;975:20552:34;85802:96:35;;;16581:176;16654:21;;;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;16694:52:35;;975:20552:34;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;16614:61:35;;975:20552:34;;16614:61:35;:::i;:::-;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;16713:7:35;975:20552:34;;;;;;;;8893:13:36;975:20552:34;;;16694:52:35;16581:176;;;13466:1955;13649:31;;:51;:31;;:::i;:51::-;13804;;;;13800:141;;13466:1955;14053:48;;;14049:135;;13466:1955;14329:68;975:20552:34;;:::i;14329:68:35:-;14415:49;;;14411:137;;13466:1955;14635:36;;14631:780;;13466:1955;;;;14631:780;15189:62;;15190:48;;2275:6:26;;-1:-1:-1;;;;;;975:20552:34;14739:78:35;;14773:44;2275:6:26;14773:44:35;:::i;14739:78::-;18217:718;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;13355:15:35;975:20552:34;14919:68:35;8893:13:36;975:20552:34;;;;;14919:68:35;15190:48;:::i;15189:62::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;15331:65:35;;15332:51;;;:::i;15331:65::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;15269:127:35;975:20552:34;8753:17:36;975:20552:34;15269:127:35;:::i;:::-;14631:780;;;;;;;14411:137;14484:49;-1:-1:-1;14411:137:35;;;14049:135;14121:48;;;14049:135;;;13800:141;13875:51;;;13800:141;;;9065:34:33;9091:8;;;;;:::i;:::-;9065:34;;;;9024:31;;;;;;;975:20552:34;9024:31:33;975:20552:34;9024:31:33;;;;;;;:::i;:::-;;;;;;11262:57:35;11315:4;11308:11;:::o;9187:656::-;-1:-1:-1;;;;;9301:22:35;975:20552:34;;9403:324:35;9422:9;9410;:21;;;;-1:-1:-1;;;;;975:20552:34;;9451:36:35;3701:25:26;9451:36:35;;9447:47;;9572:21;975:20552:34;-1:-1:-1;;;;;975:20552:34;9508:34:35;975:20552:34;;9508:34:35;975:20552:34;9572:21:35;:::i;:::-;-1:-1:-1;;;;;975:20552:34;9508:34:35;975:20552:34;;9508:34:35;975:20552:34;-1:-1:-1;975:20552:34;9680:13:35;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;9403:324:35;;9447:47;3701:25:26;9489:5:35;;-1:-1:-1;;;;;9489:5:35;9403:324;975:20552:34;;-1:-1:-1;;;;;975:20552:34;9301:22:35;975:20552:34;;;9301:22:35;975:20552:34;9800:36:35;9187:656;:::o;9410:21::-;-1:-1:-1;;;;;3701:25:26;9410:21:35;;;24726:2005:32;;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;24878:10:32;975:20552:34;;;;-1:-1:-1;975:20552:34;;:::i;:::-;24931:18:32;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;24968:29:32;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;25054:36:32;;975:20552:34;;-1:-1:-1;975:20552:34;;25171:30:32;-1:-1:-1;;;;;975:20552:34;25171:30:32;;;975:20552:34;;;-1:-1:-1;975:20552:34;24878:10:32;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;25466:26:32;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;25466:39:32;;2275:6:26;;975:20552:34;;25466:39:32;:::i;:::-;975:20552:34;;;;-1:-1:-1;975:20552:34;24878:10:32;975:20552:34;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;25639:46:32;25167:722;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;26236:15:32;975:20552:34;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;;;;;;;;26361:8:32;975:20552:34;;;;;2275:6:26;975:20552:34;;;;;;;;;;;;;;;;;;;;24878:10:32;975:20552:34;;;;;;;:::i;:::-;26527:41:32;975:20552:34;;;;;;26527:41:32;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;26710:4:32;26680:44;;24726:2005::o;25167:722::-;975:20552:34;25802:21:32;;975:20552:34;;-1:-1:-1;;;;;2275:6:26;25802:34:32;;2275:6:26;;975:20552:34;;25802:34:32;:::i;:::-;975:20552:34;;;25167:722:32;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;1175:6:26;;;;;;;;;;;;;;;:::i;:::-;975:20552:34;;;;;;;:::i;:::-;1175:6:26;;;;;;;;;;;;-1:-1:-1;1175:6:26;;;;;;;;975:20552:34;;;;;1175:6:26;:::o;:::-;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;1175:6:26;975:20552:34;1175:6:26;;;975:20552:34;:::i;:::-;1175:6:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1175:6:26;;;;;;;;;;:::i;:::-;;;;;;-1:-1:-1;;;;;1175:6:26;;;;;;;;:::i;2817:1::-;-1:-1:-1;;;;;975:20552:34;2817:1:26;975:20552:34;2817:1:26;;-1:-1:-1;;;;;2817:1:26;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;2817:1:26;;;;-1:-1:-1;;2817:1:26;;:::o;4954:5519:38:-;-1:-1:-1;;;;;975:20552:34;;5042:16:38;5034:58;5042:16;;;;5034:58;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;5110:22:38;;975:20552:34;;-1:-1:-1;;;;;5057:1:38;975:20552:34;;;5180:19:38;975:20552:34;;;;;;5179:36:38;975:20552:34;;5179:71:38;;4954:5519;3480:39:26;;;5534:29:38;;5530:797;;4954:5519;975:20552:34;5057:1:38;975:20552:34;5180:19:38;975:20552:34;;;;5057:1:38;975:20552:34;;;6387:68:38;;975:20552:34;5057:1:38;975:20552:34;6671:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;5057:1:38;975:20552:34;;;6712:25:38;6708:174;;-1:-1:-1;6892:24:38;975:20552:34;-1:-1:-1;;1175:6:26;;;;;;6892:24:38;975:20552:34;5057:1:38;7126:18;2817:1:26;7126:18:38;;;;-1:-1:-1;5057:1:38;975:20552:34;;;5180:19:38;975:20552:34;;;;;;;;;;-1:-1:-1;;975:20552:34;1175:6:26;975:20552:34;;;7317:15:38;975:20552:34;;;;;;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;7506:36:38;;;:::i;:::-;5057:1;975:20552:34;;;7317:15:38;975:20552:34;;;;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;975:20552:34;;;2817:1:26;;-1:-1:-1;;;2817:1:26;;;;;;;;14719:14:38;975:20552:34;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;14719:35:38;;;;:70;;7110:148;14715:106;;975:20552:34;;;10429:37:38;975:20552:34;5057:1:38;975:20552:34;14719:14:38;975:20552:34;;;5057:1:38;975:20552:34;;;;;;;;;;;;;;;5057:1:38;975:20552:34;6671:17:38;975:20552:34;;;5057:1:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;9746:347:38;-1:-1:-1;;;;;7631:7:38;975:20552:34;;;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;7803:352:38;9188:34:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;7834:17:38;;;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;;;;1175:6:26;975:20552:34;7803:352:38;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;5057:1:38;975:20552:34;7803:352:38;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;5057:1:38;7803:352;;;975:20552:34;7803:352:38;:::i;:::-;975:20552:34;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;8255:347:38;9188:34:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;5057::38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;;;:::i;:::-;;;;1175:6:26;975:20552:34;8255:347:38;;975:20552:34;5057:1:38;8255:347;;;975:20552:34;5057:1:38;7803:352;8255:347;;975:20552:34;5057:1:38;975:20552:34;8255:347:38;;975:20552:34;1175:6:26;7803:352:38;8255:347;;975:20552:34;5057:1:38;7803:352;8255:347;;975:20552:34;5057:1:38;7803:352;8255:347;;975:20552:34;5057:1:38;7803:352;8255:347;;975:20552:34;8255:347:38;:::i;:::-;8627:17;8623:38;;7110:148;975:20552:34;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;9188:34:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;8752:347:38;975:20552:34;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;;1175:6:26;975:20552:34;8752:347:38;;975:20552:34;5057:1:38;8752:347;;;975:20552:34;5057:1:38;7803:352;8752:347;;975:20552:34;5057:1:38;975:20552:34;8752:347:38;;975:20552:34;1175:6:26;7803:352:38;8752:347;;975:20552:34;5057:1:38;7803:352;8752:347;;975:20552:34;5057:1:38;7803:352;8752:347;;975:20552:34;5057:1:38;7803:352;8752:347;;975:20552:34;8752:347:38;:::i;:::-;9120:38;;7110:148;975:20552:34;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;9188:34:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;9249:347:38;975:20552:34;;;;;:::i;9249:347:38:-;9617:38;;7110:148;975:20552:34;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;9188:34:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;975:20552:34;9716:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;;;;1175:6:26;975:20552:34;9746:347:38;;975:20552:34;5057:1:38;9746:347;;;975:20552:34;5057:1:38;7803:352;9746:347;;975:20552:34;5057:1:38;975:20552:34;9746:347:38;;975:20552:34;1175:6:26;7803:352:38;9746:347;;975:20552:34;5057:1:38;7803:352;9746:347;;975:20552:34;5057:1:38;7803:352;9746:347;;975:20552:34;5057:1:38;7803:352;9746:347;;975:20552:34;9746:347:38;:::i;:::-;975:20552:34;5057:1:38;975:20552:34;9360:18:36;975:20552:34;;10114:43:38;9360:36:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;5057::38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;10114:43:38;;:::i;:::-;975:20552:34;5057:1:38;975:20552:34;9360:18:36;975:20552:34;;10169:43:38;9360:36:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;10169:43:38:-;975:20552:34;5057:1:38;975:20552:34;9535:18:36;975:20552:34;;10225:43:38;9535:36:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;5057::38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;10225:43:38:-;975:20552:34;5057:1:38;975:20552:34;9535:18:36;975:20552:34;;10280:43:38;9535:36:36;975:20552:34;5057:1:38;975:20552:34;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;10280:43:38:-;3701:25:26;5057:1:38;975:20552:34;13903:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;5057:1:38;975:20552:34;;;;5057:1:38;975:20552:34;13943:13:38;975:20552:34;;;5057:1:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;5057:1:38;975:20552:34;13903:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;5057:1:38;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;5057:1:38;975:20552:34;13943:13:38;975:20552:34;;;5057:1:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;3701:25:26;5057:1:38;975:20552:34;13903:17:38;975:20552:34;;;5057:1:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;2817:1:26;;975:20552:34;10429:37:38;4954:5519::o;9617:38::-;9640:15;;;:::i;:::-;9617:38;;9120;9143:15;;;:::i;:::-;9120:38;;8623;8646:15;;;:::i;:::-;8623:38;;14715:106;6432:23;;;5057:1;14798:23;;5057:1;14798:23;14719:70;975:20552:34;;5057:1:38;975:20552:34;6671:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;5057:1:38;975:20552:34;;;14758:31:38;;14719:70;;7146:3;975:20552:34;5057:1:38;975:20552:34;7169:16:38;975:20552:34;;-1:-1:-1;;;;;7169:32:38;975:20552:34;;5057:1:38;975:20552:34;7169:32:38;:::i;:::-;975:20552:34;;;7165:82:38;;1175:6:26;975:20552:34;7115:9:38;;7165:82;6801:26;;;5057:1;7221:26;;5057:1;7221:26;6708:174;6757:35;;6753:74;;6432:23;;;5057:1;6848:23;;5057:1;6848:23;5530:797;975:20552:34;;-1:-1:-1;;;5684:88:38;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;5684:88:38;975:20552:34;-1:-1:-1;182:42:26;3861:4;5684:88:38;5057:1;;5684:88;;;5530:797;-1:-1:-1;5680:637:38;;1175:6:26;;;;5057:1:38;6260:42;5684:88;975:20552:34;5684:88:38;5057:1;6260:42;5680:637;-1:-1:-1;;;;;975:20552:34;5530:797:38;1175:6:26;;;;;5057:1:38;1175:6:26;5684:88:38;975:20552:34;5684:88:38;5057:1;1175:6:26;5684:88:38;;;;;;;5057:1;5684:88;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;;;;;;3480:39:26;;;;;5057:1:38;3480:39:26;;975:20552:34;;5057:1:38;3480:39:26;5179:71:38;-1:-1:-1;;;;;;5219:31:38;;;5179:71;;8173:432:44;975:20552:34;;9003:31:44;;;;975:20552:34;8566:31:44;;-1:-1:-1;;;;;975:20552:34;;;;;725:5:47;;;;;;733;;;:::i;:::-;725:17;;9003:31:44;8485:29;975:20552:34;-1:-1:-1;;;;;975:20552:34;;8566:31:44;:::i;725:17:47:-;;;-1:-1:-1;725:17:47;;;17209:195:38;17165:30;17334:26;;;:::i;:::-;17165:30;;:::i;:::-;975:20552:34;;;;;17155:41:38;975:20552:34;;;16789:65:38;975:20552:34;16789:65:38;;2122:95:26;975:20552:34;2122:95:26;;975:20552:34;;16828:4:38;975:20552:34;;;;;;;;;;;;;;;16789:65:38;;;;;;:::i;:::-;975:20552:34;;16779:76:38;;-1:-1:-1;;;;;975:20552:34;;17209:195:38:o;5199:233:31:-;517:14:46;-1:-1:-1;;;;;541:30:46;5199:233:31;;;;975:20552:34;;-1:-1:-1;975:20552:34;5321:15:31;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;5365:32:31;;975:20552:34;517:14:46;:::i;:::-;1790:54;;;541:30;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;643:19:46;;;975:20552:34;;3556:68:14;;5199:233:31:o;975:20552:34:-;;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;11125:647:30;-1:-1:-1;;;;;975:20552:34;;;;11125:647:30;;975:20552:34;;;;11713:52:30;;975:20552:34;;11125:647:30;11549:65;;11125:647;11455:6;;11125:647;;;;11352:15;;;11348:84;;11125:647;11455:6;;;:::i;:::-;11569:21;;;:::i;:::-;2275:6:26;-1:-1:-1;;;;;2275:6:26;11592:21:30;;;:::i;11549:65::-;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;11713:52:30;11125:647::o;11348:84::-;11414:6;;;;:::i;:::-;11348:84;;;;2414:3241:35;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;-1:-1:-1;;;;;975:20552:34;2464:43:35;;-1:-1:-1;;;;;2521:7:35;975:20552:34;;2521:26:35;2517:3132;;2414:3241::o;2517:3132::-;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;;;;;;;;;;2485:1:35;975:20552:34;;;;2683:17:35;8893:13:36;975:20552:34;;;;;;;3606:25:26;975:20552:34;;;-1:-1:-1;;;;;2772:19:35;-1:-1:-1;;;;;975:20552:34;2772:19:35;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;2806:39:35;975:20552:34;;;2806:39:35;975:20552:34;3006:24:35;;975:20552:34;3006:24:35;:::i;:::-;;975:20552:34;2485:1:35;975:20552:34;;;3045:15:35;8893:13:36;975:20552:34;;;;;;-1:-1:-1;;;;2817:1:26;-1:-1:-1;;;2817:1:26;;;2521:7:35;975:20552:34;;3379:2:35;-1:-1:-1;;;;;;975:20552:34;;;;;;;;2817:1:26;;-1:-1:-1;;9219:2:38;975:20552:34;;;;;;;8893:13:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;;;;;8478:7:36;975:20552:34;;;;;-1:-1:-1;;9219:2:38;-1:-1:-1;;;;;975:20552:34;;;;;;;;8893:13:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;23196:2:38;;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;;;;;8478:7:36;975:20552:34;;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;;8893:13:36;975:20552:34;3379:2:35;-1:-1:-1;;;;;975:20552:34;;;;;;;;18201:1:35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;2817:1:26;975:20552:34;;;8478:7:36;975:20552:34;;;11671:1:35;;-1:-1:-1;;;;;975:20552:34;;;;;;;;8893:13:36;975:20552:34;;;-1:-1:-1;;;;;;975:20552:34;2817:1:26;975:20552:34;;;3273:4:26;3984:52:35;975:20552:34;-1:-1:-1;4066:26:35;;;;;;975:20552:34;;;:::i;:::-;;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;4264:88:35;4330:21;;975:20552:34;;;;:::i;4264:88:35:-;4526:13;4522:1056;;4051:179;5592:14;;;;:::i;:::-;;5620:18;;:::i;:::-;;2414:3241::o;4522:1056::-;975:20552:34;;-1:-1:-1;;;4644:40:35;;4338:4;4644:40;;;975:20552:34;-1:-1:-1;3273:4:26;;;975:20552:34;;;;4644:40:35;975:20552:34;-1:-1:-1;182:42:26;4644:40:35;;;;;;;2485:1;;;4644:40;;;4522:1056;4706:17;;4702:69;;975:20552:34;4789:72:35;;4264:15;975:20552:34;-1:-1:-1;;;;;975:20552:34;;4884:33:35;;;;975:20552:34;4884:72:35;;4522:1056;4880:147;;;5069:19;975:20552:34;-1:-1:-1;;;;;975:20552:34;;5069:39:35;;;;975:20552:34;5069:86:35;;4522:1056;5069:148;;;;;4522:1056;5044:267;;4289:14;975:20552:34;-1:-1:-1;;;;;975:20552:34;;5332:35:35;;;;975:20552:34;5332:76:35;;4522:1056;5328:157;;;5542:21;;;:::i;:::-;8771:9:36;975:20552:34;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;5502:61:35;;975:20552:34;;;5502:61:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;;4522:1056:35;;5328:157;5439:27;;;2485:1;5439:27;4644:40;2485:1;5439:27;5332:76;975:20552:34;;;;5371:37:35;;5332:76;;;5044:267;5265:27;;;2485:1;5265:27;4644:40;2485:1;5265:27;5069:148;975:20552:34;2521:7:35;975:20552:34;;;5183:34:35;;5069:148;;:86;975:20552:34;;;;5112:43:35;;5069:86;;;4880:147;4987:21;;;2485:1;4987:21;4644:40;2485:1;4987:21;4884:72;975:20552:34;;;;4921:35:35;;4884:72;;;4789;4834:27;;;2485:1;4834:27;4644:40;2485:1;4834:27;4702:69;4732:39;;;2485:1;4732:39;4644:40;2485:1;4732:39;4644:40;;;;;;2485:1;4644:40;;;;;;:::i;:::-;;;3273:4:26;;;;;;;;975:20552:34;;;:::i;:::-;3273:4:26;975:20552:34;8893:13:36;3273:4:26;;975:20552:34;:::i;:::-;;;3273:4:26;;;;-1:-1:-1;;;;;3273:4:26;;;;;;;;;;;;;;;;;;;:::i;:::-;975:20552:34;;;;;;;:::i;:::-;3273:4:26;;;8893:13:36;3273:4:26;;;;;;;;;;;;;;8893:13:36;3273:4:26;;;;;;;;4644:40:35;;;;;;3273:4:26;8893:13:36;975:20552:34;;;;;:::i;:::-;3273:4:26;;;;;;;;4094:3:35;4117:21;;3096:4;4117:21;;:::i;:::-;3273:4:26;;-1:-1:-1;;;;3273:4:26;;;;;;;;4174:23:35;;;:::i;:::-;3273:4:26;;-1:-1:-1;;;;3273:4:26;;;;;;;;;4056:8:35;;8213:396:24;8388:19;;8384:33;;8511:91;8453:33;;;:::i;:::-;3861:4:26;;;:::i;:::-;8511:91:24;;:::i;1013:429:17:-;;;1139:18;;;;1226:33;;;;:::i;:::-;975:20552:34;;;;:::i;:::-;1280:33:17;:56;;;;1273:63;;;:::o;1280:56::-;-1:-1:-1;;;;;975:20552:34;;;;;1317:19:17;;1273:63;-1:-1:-1;1273:63:17:o;1135:301::-;975:20552:34;;;;2077:60:17;975:20552:34;;;;2077:60:17;;;;;;;;;;;;;;;975:20552:34;;;;;;;;;;;:::i;:::-;2077:60:17;975:20552:34;;2077:60:17;;;;;;:::i;:::-;2046:101;;;;975:20552:34;;;;;;;;:::i;:::-;;;;;;;;:::i;:::-;;;;;2077:60:17;975:20552:34;;;;2165:42:17;;;975:20552:34;2165:134:17;;;1367:58;;:::o;2165:134::-;975:20552:34;;2077:60:17;975:20552:34;;;2223:29:17;;975:20552:34;;;;2077:60:17;2223:29;975:20552:34;-1:-1:-1;;;2223:76:17;;1367:58::o;2165:42::-;975:20552:34;;2077:60:17;975:20552:34;;2188:19:17;;2165:42;;;975:20552:34;;;;4009:142:22;-1:-1:-1;;;4085:13:22;;;4081:36;;-1:-1:-1;;;;;975:20552:34;;4009:142:22:o;11799:413:44:-;975:20552:34;12133:72:44;;11799:413;;;7940:89;;:59;;12133:33;;-1:-1:-1;;;;;975:20552:34;12133:33:44;:::i;:::-;7940:30;;;975:20552:34;;;2275:6:26;;-1:-1:-1;;;;;975:20552:34;;;;;7940:59:44;:::i;:::-;8002:27;;;;975:20552:34;-1:-1:-1;;;;;2275:6:26;975:20552:34;;;;7940:89:44;:::i;14064:834:30:-;975:20552:34;;;;;:::i;:::-;14188:17:30;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;14249:63:30;;:12;:63;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;2882:6:26;14393:44:30;;:65;;;;14064:834;14389:147;;2882:6:26;975:20552:34;;2882:6:26;975:20552:34;;;;11181:25:18;2882:6:26;11181:25:18;;;:::i;:::-;11225:26;11181:104;11225:59;2882:6:26;11225:59:18;11255:25;:29;;11181:104;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;9033:15:36;975:20552:34;;;;14828:63:30;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;14828:63:30;:::i;14389:147::-;9049:9:36;;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;9033:15:36;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;14474:51:30:o;14393:65::-;14441:17;;;14393:65;;11054:238:18;;;32134:1;11181:25;;;;;;:::i;:::-;975:20552:34;;;;:::i;:::-;;32111:24:18;11225:59;;;;11054:238;34863:71:19;;11181:104:18;34863:71:19;;;;11181:104:18;;:::i;11225:59::-;11255:25;;;;;;;11181:104;11255:25;;:29;;11225:59;;;;12088:381:29;-1:-1:-1;;;;;975:20552:34;;12204:19:29;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;12276:21:29;;975:20552:34;;;12421:31:29;975:20552:34;;12221:1:29;975:20552:34;12341:12:29;975:20552:34;;;12221:1:29;975:20552:34;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;12421:31:29;12088:381::o;4130:191:5:-;4243:17;;:::i;:::-;4262:20;;:::i;:::-;975:20552:34;;4221:92:5;;;;975:20552:34;2073:95:5;975:20552:34;;;2073:95:5;;975:20552:34;2073:95:5;;;975:20552:34;4284:13:5;2073:95;;;975:20552:34;4307:4:5;2073:95;;;975:20552:34;2073:95:5;4221:92;;;;;;:::i;:::-;975:20552:34;4211:103:5;;4130:191;:::o;39156:2537:32:-;;;-1:-1:-1;;;;;39156:2537:32;;;;975:20552:34;;;;;39426:11:32;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;:::i;:::-;;;;;39503:15:32;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;;:::i;:::-;;;2275:6:26;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;39739:67:32;975:20552:34;39739:31:32;;975:20552:34;;;;;39739:67:32;:::i;:::-;975:20552:34;39724:12:32;:82;39720:212;;39156:2537;-1:-1:-1;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;40063:61:32;;;;;;40166;;;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;2275:6:26;40402:66:32;;975:20552:34;;;;;;49025:70:21;;;;;-1:-1:-1;49025:70:21;;;;;40402:66:32;:::i;:::-;975:20552:34;40482:13:32;;;40478:27;;40606:47;975:20552:34;2275:6:26;975:20552:34;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;49025:70:21;;;;;;;;;40606:47:32;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41022:17:32;;975:20552:34;;;;;;;;;;;;-1:-1:-1;975:20552:34;;;39426:11:32;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;41279:42:32;;975:20552:34;;41279:42:32;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;41459:4:32;41433:49;;39156:2537;:::o;40478:27::-;40497:8;;;;;;;975:20552:34;40497:8:32;:::o;40059:218::-;40258:8;;;;;;;;975:20552:34;40258:8:32;:::o;39720:212::-;975:20552:34;;;;39724:12:32;975:20552:34;;;39720:212:32;;;10450:351:33;975:20552:34;;-1:-1:-1;;;10536:96:33;;975:20552:34;;;10536:96:33;975:20552:34;10536:96:33;975:20552:34;;182:42:26;3861:4;10536:96:33;975:20552:34;;10536:96:33;;;10450:351;-1:-1:-1;10532:263:33;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;10755:29:33:o;10532:263::-;-1:-1:-1;;;;;975:20552:34;;10693:30:33;;10532:263;10450:351::o;10693:30::-;10710:13;-1:-1:-1;10710:13:33:o;10536:96::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;1656:3:26;;;;975:20552:34;;;:::i;:::-;10536:96:33;;;;;;;-1:-1:-1;10536:96:33;;9897:182:29;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;;;;;;;;;;;9522:25:29;975:20552:34;;9971:21:29;;9963:64;9971:21;;9963:64;:::i;:::-;8444:17;;;:::i;:::-;8611:8;975:20552:34;;;;-1:-1:-1;;;;;8611:26:29;975:20552:34;;;;8611:26:29;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;8611:8:29;975:20552:34;9123:16:29;;;;8611:8;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;9522:25:29;9897:182::o;9119:388::-;975:20552:34;;;9458:10:29;975:20552:34;;;;;;;;;-1:-1:-1;;;;;2275:6:26;9458:38:29;;2275:6:26;975:20552:34;;9458:38:29;:::i;93434:340:35:-;93624:18;93434:340;93624:18;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;93584:58:35;;975:20552:34;;;93584:58:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;93434:340:35:o;12141:1812:45:-;;;12393:10;;12389:29;;12449:6;;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;2275:6:26;;12610::45;;12606:215;;12901:6;;;;12897:275;;13256:25;;;;;;:::i;:::-;13296:15;;;;;;;;;;;;13292:215;;13694:14;;;;;;;:::i;:::-;3861:4:26;-1:-1:-1;;;3861:4:26;;;-1:-1:-1;;;3861:4:26;;;27805:340:21;-1:-1:-1;;;27805:340:21;;;-1:-1:-1;;;27805:340:21;;;;;;;;;;;;13796:15:45;13757:11;13930:15;27805:340:21;13856:47:45;27805:340:21;2744:3:26;27805:340:21;;13757:11:45;;:::i;:::-;13796:15;;:::i;:::-;13856:47;:::i;:::-;13930:15;;;:::i;27805:340:21:-;;12402:1:45;27805:340:21;;;;13292:215:45;10546:11;10450:55;;2744:3:26;10450:55:45;;;;;;;;:::i;12897:275::-;3861:4:26;;;;;-1:-1:-1;;;3861:4:26;;;-1:-1:-1;;;3861:4:26;;;-1:-1:-1;;;27805:340:21;;;;-1:-1:-1;;;27805:340:21;;;;;;;;13119:11:45;27805:340:21;;13025:11:45;13056:43;27805:340:21;2744:3:26;27805:340:21;;13025:11:45;;:::i;12606:215::-;12794:15;12653:39;;2744:3:26;12653:39:45;;;;;12716:47;12653:39;;;;:::i;:::-;12716:47;;:::i;12389:29::-;12405:13;;;;;12402:1;12405:13;12402:1;12405:13;:::o;16253:1781::-;;;;;;16511:14;;16507:33;;16571:6;;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;16729:6:45;;16725:365;;17186:6;;;17182:227;;17493:25;;;;;;:::i;:::-;17533:17;;;;;;;;;;;17529:121;;17732:16;;;;;;;:::i;:::-;3861:4:26;-1:-1:-1;;;3861:4:26;;;-1:-1:-1;;;3861:4:26;;;17861:12:45;17922:43;17772:38;;17983:15;17772:38;2744:3:26;17772:38:45;;:::i;17861:12::-;17889:17;;;;:::i;17922:43::-;17983:15;;;:::i;17529:121::-;17573:66;;;;;;;;;3227:4:26;27805:340:21;;;3227:4:26;27805:340:21;;;;;;;;;;;14787:19:45;;;14783:44;;17529:121;14856:16;;;:40;15127:59;2744:3:26;14856:40:45;;;;;15000:19;14924:46;14856:40;;;14947:13;16524:1;14856:40;14947:13;;:::i;:::-;14924:46;;:::i;:::-;15000:19;;:::i;:::-;15127:59;:::i;:::-;15204:22;;;;;:::i;:::-;15236:16;15335:9;;15331:377;;14856:40;17566:73;;;;;;;;:::o;15331:377::-;-1:-1:-1;;975:20552:34;;;;;;;;15379:59:45;;2744:3:26;15379:59:45;;;:::i;:::-;975:20552:34;15541:23:45;;;;;;:62;;;;15331:377;15537:161;;;;;15331:377;;;;;;;15537:161;15631:20;;;;;;;:::i;:::-;15537:161;;;;15541:62;15569:20;975:20552:34;;;15569:20:45;:::i;:::-;15568:35;;15541:62;;;;;14856:40;-1:-1:-1;;975:20552:34;;;;;;;2744:3:26;14856:40:45;;;;;15000:19;14924:46;14856:40;;;14947:13;15127:59;14856:40;;;14783:44;14808:19;;14783:44;;17182:227;27805:340:21;;;;;;;-1:-1:-1;;;27805:340:21;;;;;;;;;17367:20:45;27805:340:21;17282:63:45;27805:340:21;-1:-1:-1;;;2744:3:26;27805:340:21;;17307:20:45;;;;:::i;:::-;17282:63;;:::i;16725:365::-;16790:43;;;;;;;;;:::i;:::-;16851:14;;:30;;;16725:365;16847:49;;16942:51;;;2744:3:26;16942:51:45;17019:19;16942:51;;:::i;16847:49::-;16883:13;;;;;;16524:1;16883:13;16524:1;16883:13;:::o;16851:30::-;16869:12;;;16851:30;;991:207:48;975:20552:34;;-1:-1:-1;;;;;;3273:4:26;-1:-1:-1;;;3273:4:26;;;991:207:48:o;975:20552:34:-;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;:::o;33986:3942:35:-;-1:-1:-1;;;;;975:20552:34;;34138:21:35;3606:25:26;34138:21:35;;34134:34;;-1:-1:-1;;;;;34275:24:35;;975:20552:34;;34271:304:35;;;;:::i;:::-;34384:11;;34380:195;;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;;;;34746:34:35;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;19121:15:35;975:20552:34;;;;;;;;;;19117:274:35;;34271:304;7896:21;975:20552:34;;110025:20:35;7895:79;-1:-1:-1;975:20552:34;1012:679:33;;;;:::i;:::-;-1:-1:-1;975:20552:34;;;;;47544:325:35;;;47605:15;;;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9716:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;;;;19729:364:35;;47544:325;975:20552:34;;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;;;;20168:43:35;20164:656;975:20552:34;;;;;;;;;;20343:171:35;;20164:656;;;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;;;;20895:43:35;20891:349;;20164:656;975:20552:34;;;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;3227:4:26;48171:49:35;;3227:4:26;;48395:45:35;;;;:::i;:::-;48454:1285;;;;-1:-1:-1;;;;;975:20552:34;;;48490:44:35;;;975:20552:34;;;49128:44:35;;48766:21;49195:44;48766:21;48671:162;975:20552:34;48766:21:35;13566:79:30;975:20552:34;;:::i;13566:79:30:-;975:20552:34;;;;;;;;;;;;;;;;;;;110025:20:35;975:20552:34;;;;48671:162:35;975:20552:34;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;48926:149:35;49029:21;975:20552:34;;;48926:149:35;;;;;:::i;:::-;;;;49128:44;:::i;:::-;;;:::i;:::-;49195;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;35443:31:35;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;35443:31:35;;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;21690:269:35;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;;;;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;975:20552:34;;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;21690:269:35;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;;;;;;2275:6:26;22111:37:35;;975:20552:34;;;:::i;:::-;22111:37:35;975:20552:34;;22073:76:35;;;975:20552:34;;;22333:86:35;975:20552:34;;:::i;22333:86:35:-;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;975:20552:34;;;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;975:20552:34;;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;539:5:47;975:20552:34;;;;;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;8753:17:36;975:20552:34;;:::i;:::-;;9033:15:36;975:20552:34;;:::i;:::-;;9033:15:36;975:20552:34;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;;;:::i;:::-;;3489:35:47;;;975:20552:34;3526:39:47;;;;975:20552:34;-1:-1:-1;;22632:416:35;-1:-1:-1;;22632:416:35;;539:5:47;;-1:-1:-1;;;;;975:20552:34;;;;;539:5:47;:::i;:::-;975:20552:34;3634:32:47;;;975:20552:34;3668:36:47;;;;975:20552:34;34813:4:35;3227::26;;;;;-1:-1:-1;;;;;975:20552:34;;;;;539:5:47;:::i;:::-;34813:4:35;3227::26;3741:42:47;2744:3:26;3741:42:47;;:96;;;48167:1882:35;3741:146:47;;;48167:1882:35;3720:430:47;;48167:1882:35;-1:-1:-1;;975:20552:34;4185:36:47;975:20552:34;-1:-1:-1;;;;;975:20552:34;2744:3:26;4185:53:47;;;:91;;48167:1882:35;4185:152:47;;;48167:1882:35;4164:738:47;;48167:1882:35;-1:-1:-1;;;4984:49:47;;;;;;5156;;-1:-1:-1;;;;;2275:6:26;5069:49:47;;;;:::i;:::-;22111:37:35;5156::47;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;5156:49:47;:::i;:::-;5219:20;-1:-1:-1;4980:490:47;35551:148:35;;;;975:20552:34;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;35787:33:35;975:20552:34;;;35787:83:35;;4980:490:47;35783:1612:35;;;4980:490:47;-1:-1:-1;23402:26:35;;23438:24;-1:-1:-1;23438:24:35;;-1:-1:-1;;;;;;975:20552:34;;23402:26:35;2744:3:26;23477:29:35;;2744:3:26;;;-1:-1:-1;23694:24:35;;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;23694:24:35;;-1:-1:-1;23694:24:35:i;:::-;23643:90;-1:-1:-1;;;;;975:20552:34;;;23643:90:35;;50657:14;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;;;;;;-1:-1:-1;975:20552:34;;;19121:15:35;975:20552:34;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;2275:6:26;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;50770:319:35;;975:20552:34;;50770:319:35;50653:1744;975:20552:34;23473:659:35;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;39790:413:35;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;975:20552:34:-;-1:-1:-1;;;;;39073:7:35;975:20552:34;;39235:35:35;975:20552:34;;39235:35:35;;975:20552:34;;39284:36:35;975:20552:34;39284:36:35;;975:20552:34;39280:152:35;;23473:659;39481:70;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;39481:70:35;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;39619:37:35;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;11671::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;39619:37:35:-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;39668:37:35;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;11671::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;39668:37:35:-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;39821:18:35;;;;;:::i;:::-;40066:29;975:20552:34;40121:29:35;40066;;;975:20552:34;;;40121:29:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;;;;;:::i;:::-;;;;;;39790:413:35;;975:20552:34;-1:-1:-1;975:20552:34;39790:413:35;;975:20552:34;-1:-1:-1;975:20552:34;39790:413:35;;975:20552:34;-1:-1:-1;975:20552:34;39790:413:35;;975:20552:34;-1:-1:-1;39790:413:35;;;975:20552:34;40066:29:35;39790:413;;975:20552:34;40121:29:35;39790:413;;975:20552:34;-1:-1:-1;22111:37:35;39790:413;;975:20552:34;39790:413:35;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;40256:989:35;975:20552:34;;;-1:-1:-1;975:20552:34;;;19121:15:35;975:20552:34;;;;;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;40577:40:35;;:87;;40256:989;40573:160;;40256:989;;;-1:-1:-1;975:20552:34;;;15468:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;37790:20:35;;37786:136;;33986:3942;:::o;37786:136::-;975:20552:34;-1:-1:-1;975:20552:34;37834:64:35;975:20552:34;;;;;;;;;37834:64:35;;862:7:26;37834:64:35;;;33986:3942;:::o;37834:64::-;975:20552:34;37834:64:35;;975:20552:34;37834:64:35;;;;;;975:20552:34;37834:64:35;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;37834:64:35:-;;;-1:-1:-1;37834:64:35;;40573:160;40712:5;;;:::i;:::-;40573:160;;;40577:87;975:20552:34;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;40621:43:35;40577:87;;40256:989;975:20552:34;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;3861:4:26;3142:1;3861:4;;;;;;;41077:86:35;40256:989;41073:162;975:20552:34;-1:-1:-1;975:20552:34;12303:19:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;19121:15:35;975:20552:34;;;;;;;;;;;;-1:-1:-1;;;;;39073:7:35;975:20552:34;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;3861:4:26;3142:1;3861:4;;;;;;;12603:99:38;975:20552:34;;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;12303:19:38;975:20552:34;;;;;;;;;;-1:-1:-1;;975:20552:34;;;12398:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;;15234:131:38;;41073:162:35;975:20552:34;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;13562:13:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;13626:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;13562:13:38;975:20552:34;;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;13626:17:38;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;13196:18:38;7946:1:35;13196:18:38;;;;975:20552:34;13410:33:38;975:20552:34;;;;;;13410:33:38;40256:989:35;;13216:3:38;34813:4:35;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;13235:39:38;13242:32;975:20552:34;;-1:-1:-1;975:20552:34;13242:32:38;:::i;:::-;13235:39;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;13288:41:38;13295:34;975:20552:34;;-1:-1:-1;975:20552:34;13295:34:38;:::i;13288:41::-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;13343:41:38;13350:34;975:20552:34;;-1:-1:-1;975:20552:34;13350:34:38;:::i;13343:41::-;975:20552:34;13185:9:38;;15234:131;-1:-1:-1;975:20552:34;;;15284:17:38;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;12398:14:38;975:20552:34;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;15234:131:38;;975:20552:34;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;;-1:-1:-1;975:20552:34;39280:152:35;975:20552:34;34813:4:35;975:20552:34;;;;39368:20:35;;39280:152;39364:43;34813:4;;-1:-1:-1;39280:152:35;;50653:1744;51106:1291;;;-1:-1:-1;51222:34:35;;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;51222:34:35;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;51270:52:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;51270:52:35;:::i;:::-;-1:-1:-1;975:20552:34;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;51427:322:35;975:20552:34;51427:322:35;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;;51427:322:35;;;;;:::i;:::-;;;;50653:1744;;51106:1291;51862:34;;;;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;51910:49:35;;975:20552:34;;;51910:49:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;15468:14:38;975:20552:34;;;;;3701:25:26;8478:7:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;23196:2:38;-1:-1:-1;;;;;975:20552:34;;7946:1:35;975:20552:34;;;;;52064:322:35;975:20552:34;52064:322:35;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;19121:15:35;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;;;52064:322:35;;;;;:::i;23473:659::-;23750:382;;;;;;;;23868:68;;;;;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;53051:81:35;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;;;53051:81:35;;;:::i;:::-;53143:1413;;;;;-1:-1:-1;;;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;53229:30:35;;;53225:689;;53143:1413;53969:30;;;;;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;9188:16:36;975:20552:34;;;;;8478:7:36;975:20552:34;9188:34:36;;2817:1:26;;-1:-1:-1;;;;;975:20552:34;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;77047:77:35;77103:21;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;77047:77:35;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;77180:58:35;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;77180:58:35:-;22403:15;975:20552:34;;-1:-1:-1;;;;;;;975:20552:34;77248:42:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;77248:42:35;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;22403:15:35;975:20552:34;53143:1413:35;23836:100;23473:659;;53225:689;975:20552:34;53447:95:35;975:20552:34;53696:44:35;975:20552:34;;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;53499:11:35;-1:-1:-1;;;;;53499:11:35;;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;53447:95:35;-1:-1:-1;;;;;2275:6:26;53697:30:35;;;;:::i;53696:44::-;-1:-1:-1;;;;;975:20552:34;;;53758:33:35;;975:20552:34;;53758:33:35;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;53809:51:35;53878:21;975:20552:34;53809:51:35;53969:30;975:20552:34;8753:17:36;975:20552:34;;;;;;;;;;;;53809:51:35;:::i;53878:21::-;53225:689;;;;53143:1413;54081:38;;;54336:21;54081:38;;54245:34;54081:38;;;;;:::i;:::-;54245:34;:::i;:::-;2275:6:26;-1:-1:-1;;;;;975:20552:34;54336:21:35;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;54293:64:35;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;54293:64:35;:::i;:::-;-1:-1:-1;975:20552:34;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;54462:83:35;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;54462:83:35;975:20552:34;;;54462:83:35;;;;;:::i;:::-;;;;53143:1413;;23750:382;24053:68;-1:-1:-1;24053:68:35;;-1:-1:-1;24053:68:35;;;55201:34;24053:68;55201:34;;:::i;:::-;55246:1488;;;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;;55330:25:35;;;55326:772;;55246:1488;-1:-1:-1;56153:21:35;;-1:-1:-1;;;;;;;975:20552:34;;56153:21:35;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;75466:65:35;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;75510:21:35;;:::i;:::-;75466:65;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;75587:56:35;;975:20552:34;;;;75587:56:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;22403:15:35;975:20552:34;-1:-1:-1;;;;;75653:40:35;975:20552:34;;;;75653:40:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;22403:15:35;975:20552:34;22386:15:35;975:20552:34;;-1:-1:-1;;;;;2275:6:26;75703:38:35;;-1:-1:-1;;;;;975:20552:34;;;;75703:38:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;22386:15:35;975:20552:34;24021:100:35;23473:659;;55326:772;55634:21;55583:97;975:20552:34;55884:39:35;55634:21;55941:33;55634:21;;;13566:79:30;975:20552:34;;:::i;13566:79:30:-;13655:173;975:20552:34;;;;;;;;;;;;;;;;;34813:4:35;975:20552:34;;;;55583:97:35;-1:-1:-1;;;;;2275:6:26;55885:25:35;;2275:6:26;;55885:25:35;:::i;55884:39::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;55941:33:35;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;55992:48:35;;975:20552:34;;;55992:48:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;;;55326:772:35;;55246:1488;56254:38;;;;56516:21;56254:38;;56428:34;56254:38;;;;;:::i;56428:34::-;56516:21;;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;56476:61:35;;975:20552:34;;;56476:61:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;15468:14:38;975:20552:34;;;;;;3701:25:26;975:20552:34;;56642:81:35;;975:20552:34;;56642:81:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;56642:81:35;:::i;35783:1612::-;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;35923:269:35;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;975:20552:34;;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;;;;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;35923:269:35:-;36374:28;;36370:814;;35783:1612;37211:38;;;;;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;37288:62:35;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;37288:62:35;:::i;:::-;37364:20;34813:4;35783:1612;;;;;;36370:814;36759:155;;;36795:48;;-1:-1:-1;;;;;975:20552:34;36795:48:35;;:::i;:::-;36759:155;;49025:70:21;;;;;;;37023:17:35;;;;37019:88;;36759:155;36370:814;;;37019:88;37082:25;;49025:70:21;37082:25:35;:::i;:::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;37211:38:35;;-1:-1:-1;;;;;975:20552:34;37042:65:35;;975:20552:34;;;37042:65:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;37019:88:35;-1:-1:-1;37019:88:35;;36759:155;36866:48;;-1:-1:-1;;;;;975:20552:34;36866:48:35;;:::i;:::-;36759:155;;;35787:83;3227:4:26;-1:-1:-1;;;;;975:20552:34;;;;35824:46:35;;-1:-1:-1;35787:83:35;;;4980:490:47;5377:49;;-1:-1:-1;;;;;2275:6:26;5290:49:47;;2275:6:26;;5290:49:47;:::i;:::-;22111:37:35;5377::47;;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;5377:49:47;:::i;:::-;5440:19;34813:4:35;4980:490:47;;4164:738;4482:159;;;;28389:372:21;;;;;;;;;;;;;;;;;;;;;;;4164:738:47;;;;;4185:152;4300:37;;;;4185:152;;:91;4242:34;;;;4185:91;;3720:430;975:20552:34;;;;-1:-1:-1;4049:86:47;;:61;;975:20552:34;-1:-1:-1;;;;;975:20552:34;4049:61:47;:::i;:86::-;3720:430;;;;;3741:146;3861:26;;;;3741:146;;:96;-1:-1:-1;975:20552:34;;2744:3:26;-1:-1:-1;;;;;975:20552:34;;;3787:50:47;3741:96;;975:20552:34;;;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;48486:870:35;49286:51;;;;;:::i;:::-;48486:870;;48454:1285;975:20552:34;;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;49560:21:35;975:20552:34;;;;;;;;;;;;;;;;;;;110025:20:35;975:20552:34;;;;49461:141:35;84400:15;975:20552:34;-1:-1:-1;;;;;;84400:40:35;975:20552:34;2275:6:26;975:20552:34;;;84400:40:35;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;84400:15:35;975:20552:34;84470:19:35;975:20552:34;;84470:44:35;2275:6:26;975:20552:34;;;84470:44:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;84470:19:35;975:20552:34;8478:7:36;975:20552:34;2817:1:26;;-1:-1:-1;;;;;;;975:20552:34;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;84549:46:35;;975:20552:34;;;84549:46:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;49686:38:35;;;:::i;48167:1882::-;49759:28;49755:294;;48167:1882;;;;49755:294;50013:24;975:20552:34;;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;49944:21:35;975:20552:34;;;;;;;;;;;;;;;;;;;49967:1:35;975:20552:34;;;;49866:103:35;50013:24;;:::i;:::-;49755:294;;;20891:349;975:20552:34;;;;21074:156:35;;20891:349;;;;21074:156;21182:32;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;21182:32:35;;;:::i;:::-;21074:156;;;20343:171;20466:32;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;20466:32:35;;;;:::i;:::-;20343:171;;;20164:656;975:20552:34;;;;20654:156:35;;20164:656;;;;20654:156;20762:32;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9219:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;20762:32:35:-;20654:156;;;19729:364;975:20552:34;;;;19912:171:35;;19729:364;;;;19912:171;20035:32;975:20552:34;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;9716:2:38;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;20035:32:35:-;19912:171;;;47544:325;47768:90;47652:38;;;;:::i;:::-;975:20552:34;-1:-1:-1;975:20552:34;15468:14:38;975:20552:34;;47768:90:35;975:20552:34;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;47833:21:35;;975:20552:34;;;47768:90:35;;;;;:::i;:::-;;;;47544:325;;19117:274;-1:-1:-1;975:20552:34;;;19121:15:35;975:20552:34;;;;;;;-1:-1:-1;;;;2817:1:26;;975:20552:34;;;;;;;;;;;-1:-1:-1;;;975:20552:34;2817:1:26;-1:-1:-1;;;2817:1:26;;;19117:274:35;;34380:195;975:20552:34;;34499:45:35;975:20552:34;;;34529:14:35;975:20552:34;;34499:45:35;34558:7::o;34134:34::-;34161:7;;:::o;16281:238:38:-;975:20552:34;;16467:44:38;;;975:20552:34;904:29:26;975:20552:34;;;;;;;904:29:26;;;;;975:20552:34;904:29:26;;;16467:44:38;;;;;;;:::i;16871:178::-;16972:70;16989:27;975:20552:34;16989:27:38;975:20552:34;;16989:27:38;975:20552:34;16989:27:38;;;975:20552:34;;:::i;:::-;16989:27:38;;;;;;;;;;975:20552:34;;-1:-1:-1;;;;;17018:23:38;;;975:20552:34;;;;17018:23:38;;;;975:20552:34;17018:23:38;;:::i;:::-;975:20552:34;;;;;;16972:70:38;;;;;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;-1:-1:-1;975:20552:34;;16972:70:38;975:20552:34;;16972:70:38;;;;;;:::i;9498:776:33:-;9594:21;;:::i;:::-;975:20552:34;;-1:-1:-1;;;9629:40:33;;-1:-1:-1;;;;;975:20552:34;;;9629:40:33;;;975:20552:34;;-1:-1:-1;975:20552:34;9629:40:33;975:20552:34;-1:-1:-1;182:42:26;9629:40:33;;975:20552:34;;;;;9629:40:33;;;9498:776;-1:-1:-1;9625:643:33;;10245:12;;;975:20552:34;10245:12:33;:::o;9625:643::-;9993:134;;;10031:17;;;10024:24;:::o;9993:134::-;10094:18;;;;10087:25;:::o;9629:40::-;;;;;;;;;;975:20552:34;9629:40:33;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;975:20552:34;;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;:::o;:::-;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;:::o;9768:502:36:-;975:20552:34;;;;9906:19:36;;;975:20552:34;;9955:20:36;;;975:20552:34;10002:17:36;;;975:20552:34;-1:-1:-1;;;;;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;10059:30:36;;;975:20552:34;10215:48:36;;9768:502;10029:60;;975:20552:34;;;10029:60:36;:::i;:::-;10116:17;;;975:20552:34;;;10156:13:36;;;975:20552:34;-1:-1:-1;;;;975:20552:34;;;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;10192:13:36;;;975:20552:34;;;-1:-1:-1;;;;975:20552:34;;;;;2275:6:26;-1:-1:-1;;;975:20552:34;;;;10239:24:36;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;10215:48:36;:::i;7082:141:1:-;975:20552:34;-1:-1:-1;;;;;;;;;;;975:20552:34;;;;7148:18:1;7144:73;;7082:141::o;7144:73::-;7189:17;;;-1:-1:-1;7189:17:1;;-1:-1:-1;7189:17:1;13233:502:44;;13523:64;13233:502;;;13523:64;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;975:20552:34;725:5:47;;;;;;733;;;:::i;5203:1551:15:-;;;-1:-1:-1;;;;;6270:79:15;;6266:164;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;;;;;;;;;;;;;;;;;6541:24:15;;;;;;;;;-1:-1:-1;6541:24:15;-1:-1:-1;;;;;975:20552:34;;6579:20:15;6575:113;;6698:49;-1:-1:-1;6698:49:15;-1:-1:-1;5203:1551:15;:::o;6575:113::-;6615:62;-1:-1:-1;6615:62:15;6541:24;6615:62;-1:-1:-1;6615:62:15;:::o;6266:164::-;6365:54;;;6381:1;6365:54;6385:30;6365:54;;:::o;7280:532::-;975:20552:34;;;:::i;:::-;7366:29:15;;;7411:7;;:::o;7362:444::-;975:20552:34;;;:::i;:::-;;7462:38:15;;975:20552:34;;7523:23:15;;;7375:20;7523:23;975:20552:34;7375:20:15;7523:23;7458:348;975:20552:34;;;:::i;:::-;7576:35:15;7567:44;;7576:35;;7634:46;;;;7375:20;7634:46;975:20552:34;;;7375:20:15;7634:46;7563:243;7710:30;975:20552:34;;;;:::i;:::-;7701:39:15;7697:109;;7563:243;7280:532::o;7697:109::-;7763:32;;;7375:20;7763:32;975:20552:34;;;7375:20:15;7763:32;2129:778;975:20552:34;;;2129:778:15;2319:2;2299:22;;2319:2;;2751:25;2535:196;;;;;;;;;;;;;;;-1:-1:-1;2535:196:15;2751:25;;:::i;:::-;2744:32;;;;;:::o;2295:606::-;2807:83;;2823:1;2807:83;2827:35;2807:83;;:::o;7242:3683:18:-;;;-1:-1:-1;;7242:3683:18;;1412:159;;;;;;;;;;;;;;;;7498:9;;7494:365;;7969:19;;;;7965:142;;8390:308;;;;975:20552:34;;;8917:31:18;;8962:384;;;9800:1;940:4:12;9781:1:18;940:4:12;9780:21:18;940:4:12;;;9800:1:18;975:20552:34;940:4:12;;;;9800:1:18;975:20552:34;940:4:12;;;;9800:1:18;975:20552:34;940:4:12;;;;9800:1:18;975:20552:34;940:4:12;;;;9800:1:18;975:20552:34;940:4:12;;;;9800:1:18;975:20552:34;940:4:12;8962:384:18;;;;975:20552:34;8962:384:18;;;8390:308;;;;;;940:4:12;8390:308:18;;8962:384;9409:18;940:4:12;7242:3683:18;:::o;7965:142::-;1829:135:12;;975:20552:34;1829:135:12;8028:16:18;5312:5;940:4:12;;5306:42:18;1829:135:12;;;;;7494:365:18;7827:17;;;;;;;:::i;7042:687:5:-;975:20552:34;;:::i;:::-;;;;7214:22:5;;;;975:20552:34;;7259:22:5;7252:29;:::o;7210:513::-;-1:-1:-1;;;;;;;;;;;;;975:20552:34;7587:15:5;;;;7622:17;:::o;7583:130::-;7678:20;7685:13;7678:20;:::o;7950:723::-;975:20552:34;;:::i;:::-;;;;8131:25:5;;;;975:20552:34;;8179:25:5;8172:32;:::o;8127:540::-;-1:-1:-1;;;;;;;;;;;;;975:20552:34;8525:18:5;;;;8563:20;:::o;1524:173:46:-;1643:12;;;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;2670:7:22;975:20552:34;;;;-1:-1:-1;;;;;;;975:20552:34;1626:63:46;;1524:173::o;1962:621:45:-;;2149:10;;2145:29;;2207:6;;;975:20552:34;;;2199:33:45;;-1:-1:-1;;;;;975:20552:34;;;;;2199:33:45;:::i;:::-;-1:-1:-1;;;2246:11:45;;;2242:94;;-1:-1:-1;;;3861:4:26;;-1:-1:-1;;;3861:4:26;;;-1:-1:-1;;;27805:340:21;;;;-1:-1:-1;;;27805:340:21;;;;;;;;2565:11:45;27805:340:21;;2565:11:45;;;:::i;:::-;1962:621;:::o;2242:94::-;2273:17;;2158:1;2273:17;:::o;2145:29::-;2161:13;;2158:1;2161:13;2158:1;2161:13;:::o;5747:541::-;;;;;;6020:14;;:24;;;;5747:541;6016:40;;6070:6;:16;;;;5747:541;6066:32;;;6148:16;;;;6144:32;;-1:-1:-1;6252:13:45;;;;;;:29;5747:541;:::o;6144:32::-;6166:10;;;;:::o;6070:16::-;6080:6;;;6070:16;;;6016:40;6046:10;;;;;;:::o;6020:24::-;6038:6;;;6020:24;;10866:462;;11107:24;10866:462;;;;11107:24;:::i;:::-;975:20552:34;;3227:4:26;975:20552:34;3227:4:26;975:20552:34;;;;11141:16:45;27805:340:21;3227:4:26;27805:340:21;;;;;;;;;;;;;;;;11284:15:45;11229:36;27805:340:21;;3227:4:26;11316:5:45;27805:340:21;;11229:36:45;;;:::i;:::-;11284:15;;:::i;:::-;11316:5;;:::i;2800:566::-;;;2993:14;;2989:33;;3056:6;;;975:20552:34;;;3048:33:45;;-1:-1:-1;;;;;975:20552:34;;;;;3048:33:45;:::i;:::-;-1:-1:-1;;;3095:11:45;;;3091:119;;-1:-1:-1;;;3861:4:26;;-1:-1:-1;;;3861:4:26;;;3286:40:45;3342:17;3286:40;;;:::i;:::-;3342:17;;;:::i;3091:119::-;-1:-1:-1;3006:1:45;;-1:-1:-1;3006:1:45;;3186:13::o;28251:516:21:-;28389:372;;;;;;;;;;;-1:-1:-1;;;28389:372:21;;;;-1:-1:-1;;;28389:372:21;;;;;;;;28251:516;:::o;9135:172:33:-;975:20552:34;;;-1:-1:-1;;;9232:31:33;;975:20552:34;;9232:31:33;975:20552:34;9232:31:33;182:42:26;9232:31:33;;;;;;;;;;;9273:27;9135:172;:::o;9232:31::-;;;;975:20552:34;9232:31:33;975:20552:34;9232:31:33;;;;;;;:::i;7562:182:44:-;7678:30;;;975:20552:34;;;-1:-1:-1;;;;;2275:6:26;7678:59:44;;975:20552:34;;;;;7678:59:44;:::i;:::-;975:20552:34;7562:182:44;:::o;41574:4025:35:-;;;41889:37;975:20552:34;;;;:::i;:::-;42113:21:35;42170:67;42056:79;42113:21;975:20552:34;;:::i;:::-;;;:::i;:::-;42056:79:35;;;:::i;:::-;42215:21;;975:20552:34;;;:::i;42170:67:35:-;3382:1:26;42368:44:35;;42364:1267;;41574:4025;43742:75;3227:4:26;102908:27:35;;;;:::i;43742:75::-;2275:6:26;-1:-1:-1;;;;;975:20552:34;;;;2275:6:26;975:20552:34;;43832:39:35;;975:20552:34;;;43964:26:35;;;;;:::i;:::-;44009:34;;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;44009:55:35;975:20552:34;;;44214:34:35;;102410:59;44214:34;;;;:::i;:::-;2275:6:26;102410:31:35;-1:-1:-1;;;;;975:20552:34;;102410:31:35;:::i;:59::-;49025:70:21;3227:4:26;49025:70:21;3227:4:26;49025:70:21;;;;;;101764:43:35;975:20552:34;3227:4:26;;;;;975:20552:34;3227:4:26;;;;;;;;;;;1464:7:22;1459:12;;;1455:35;;42104:7:35;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;;;;-1:-1:-1;;;975:20552:34;;;;;;;45540:52:35;;41574:4025::o;44005:704::-;975:20552:34;;;;;3382:1:26;41889:37:35;975:20552:34;44005:704:35;;43828:1546;-1:-1:-1;;;;;975:20552:34;;;2275:6:26;;;-1:-1:-1;2275:6:26;-1:-1:-1;44743:38:35;-1:-1:-1;975:20552:34;;;45037:38:35;;;102410:31;:59;45037:38;102410:31;;:::i;:59::-;43828:1546;;42364:1267;42607:34;;;;:::i;:::-;2275:6:26;102410:59:35;2275:6:26;102410:31:35;-1:-1:-1;;;;;975:20552:34;;102410:31:35;:::i;:59::-;3332:4:26;3861;;;;;;;42777:98:35;;;;;42941:58;;41889:37;975:20552:34;42364:1267:35;;42773:848;3332:4:26;3861;;;;;;;43171:98:35;;;;43302:58;41889:37;975:20552:34;42364:1267:35;;43110:511;43545:61;;;;;;:::o;38094:498::-;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;8893:13:36;975:20552:34;;;;;;38151:44:35;;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;;;;;;;-1:-1:-1;;;;;975:20552:34;8893:13:36;975:20552:34;;;38210:233:35;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;9360:18:36;8893:13;975:20552:34;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;975:20552:34;;;;;;;;;;;-1:-1:-1;975:20552:34;9360:18:36;8893:13;975:20552:34;38210:233:35;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;38210:233:35;:::i;:::-;;;;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;8893:13;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;975:20552:34:-;39790:413:35;-1:-1:-1;;;;;39073:7:35;975:20552:34;;39235:35:35;975:20552:34;8893:13:36;39235:35:35;;975:20552:34;;;39284:36:35;;975:20552:34;39280:152:35;;38094:498;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;8893:13;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;9360:18:36;8893:13;975:20552:34;;;;8478:7:36;975:20552:34;39619:37:35;;9360:36:36;;2817:1:26;;11671::35;;-1:-1:-1;;;;;975:20552:34;;9360:36:36;;:::i;39619:37:35:-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;8893:13;975:20552:34;39668:37:35;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;11671::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;39668:37:35:-;975:20552:34;-1:-1:-1;975:20552:34;9188:16:36;8893:13;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;18201::35;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;39790:413:35:-;975:20552:34;-1:-1:-1;975:20552:34;40260:15:35;8893:13:36;975:20552:34;;;-1:-1:-1;975:20552:34;;39790:413:35;975:20552:34;;40256:989:35;975:20552:34;;;-1:-1:-1;975:20552:34;;;40260:15:35;8893:13:36;975:20552:34;;;;;;-1:-1:-1;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;40577:40:35;;:87;;40256:989;40573:160;;40256:989;38094:498::o;40573:160::-;40712:5;;;:::i;40577:87::-;975:20552:34;;-1:-1:-1;975:20552:34;40260:15:35;8893:13:36;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;40621:43:35;40577:87;;40256:989;975:20552:34;-1:-1:-1;975:20552:34;40260:15:35;8893:13:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;3861:4:26;3142:1;3861:4;;;;;;;41077:86:35;;41073:162;;40256:989;38094:498::o;41073:162::-;975:20552:34;-1:-1:-1;975:20552:34;12303:19:38;8893:13:36;975:20552:34;;;-1:-1:-1;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;40260:15:35;8893:13:36;975:20552:34;;;;;39790:413:35;975:20552:34;;;;;-1:-1:-1;;;;;39073:7:35;975:20552:34;;;-1:-1:-1;975:20552:34;40260:15:35;8893:13:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;3861:4:26;3142:1;3861:4;;;;;;;12603:99:38;975:20552:34;;;-1:-1:-1;975:20552:34;9188:16:36;8893:13;975:20552:34;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;;;12303:19:38;8893:13:36;975:20552:34;;;;;;;;;-1:-1:-1;;975:20552:34;;;12398:14:38;975:20552:34;;;;;3701:25:26;-1:-1:-1;;;;;975:20552:34;;15234:131:38;;41073:162:35;975:20552:34;;-1:-1:-1;975:20552:34;40260:15:35;8893:13:36;975:20552:34;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;13562:13:38;8893::36;975:20552:34;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;;-1:-1:-1;975:20552:34;13626:17:38;8893:13:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;13562:13:38;8893::36;975:20552:34;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;975:20552:34;13626:17:38;8893:13:36;975:20552:34;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;13196:18:38;975:20552:34;13196:18:38;;;;975:20552:34;8893:13:36;13410:33:38;975:20552:34;;;;;;13410:33:38;2414:3241:35:o;13216:3:38:-;39767:1:35;975:20552:34;;-1:-1:-1;975:20552:34;9188:16:36;8893:13;975:20552:34;13235:39:38;13242:32;975:20552:34;;-1:-1:-1;975:20552:34;13242:32:38;:::i;13235:39::-;975:20552:34;-1:-1:-1;975:20552:34;9360:18:36;8893:13;975:20552:34;13288:41:38;13295:34;975:20552:34;;-1:-1:-1;975:20552:34;13295:34:38;:::i;13288:41::-;975:20552:34;-1:-1:-1;975:20552:34;9535:18:36;8893:13;975:20552:34;13343:41:38;13350:34;975:20552:34;;-1:-1:-1;975:20552:34;13350:34:38;:::i;13343:41::-;975:20552:34;13185:9:38;;15234:131;-1:-1:-1;975:20552:34;;;15284:17:38;8893:13:36;975:20552:34;;;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;;;;12398:14:38;975:20552:34;;;;;;;-1:-1:-1;;;;;;975:20552:34;;;15234:131:38;;39280:152:35;975:20552:34;;;;;39280:152:35;39364:43;39390:17;975:20552:34;39280:152:35;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;34813:4:35;975:20552:34;;;;;;;:::o;:::-;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;:::o;66931:7861:35:-;67205:20;;;:::i;:::-;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;;2275:6:26;;67402:43:35;2275:6:26;;67402:43:35;:::i;:::-;67456:32;-1:-1:-1;67498:35:35;-1:-1:-1;;975:20552:34;;;67832:5:35;-1:-1:-1;67832:5:35;;;;68531:40;;;;68527:433;;67812:616;69128:56;;;;69124:253;;67812:616;69560:50;;;;;69556:761;;67812:616;70435:44;;;70431:248;;70972:44;;;;:::i;:::-;71030:42;;;;71026:3760;;67812:616;66931:7861;;;;;;;:::o;71026:3760::-;71093:142;975:20552:34;-1:-1:-1;;;;;71158:7:35;975:20552:34;;;71093:142:35;975:20552:34;;;;71093:142:35;;;;;:::i;:::-;;;;72046:41;;;;;;72163;;;;;:::i;:::-;72329:49;;;;72325:272;;72042:2734;72635:18;;;72672:52;72635:18;;:::i;:::-;2275:6:26;72672:52:35;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;;;72672:52:35;:::i;:::-;;;:::i;:::-;72743:15;975:20552:34;;-1:-1:-1;;;;;2275:6:26;72743:41:35;;975:20552:34;;;72743:41:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;72743:15:35;975:20552:34;72042:2734:35;71026:3760;;;;;;;;;72325:272;72433:49;;;;:::i;:::-;72513:29;;;;;;72545;72635:18;72545:29;72672:52;72545:29;;:::i;:::-;72325:272;;;72513:65;;;72672:52;72635:18;-1:-1:-1;72513:65:35;;72042:2734;72990:41;;;;;;:::i;:::-;73155:49;;;;73151:272;;72042:2734;3227:4:26;;;;;;;;;;;;;;;;;73554:18:35;;:::i;:::-;3227:4:26;2664;3227;;;;;;2664;3227;;;;;;;73537:63:35;73533:822;;72042:2734;74461:28;;;;;;74492;74460:77;74492:28;74556:52;74492:28;;:::i;:::-;74460:77;:::i;:::-;2275:6:26;74556:52:35;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;;;;74556:52:35;:::i;:::-;74627:15;975:20552:34;;-1:-1:-1;;;;;2275:6:26;74627:41:35;;975:20552:34;;;74627:41:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;74627:15:35;975:20552:34;72042:2734:35;;74461:63;;;74556:52;74460:77;-1:-1:-1;74460:77:35;:::i;73533:822::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;8478:7:36;975:20552:34;2817:1:26;;-1:-1:-1;;;;;;;975:20552:34;;;;;;;;;;;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;73533:822:35;;73151:272;73259:49;;;;:::i;:::-;73339:29;;;;;;73371;;;:::i;:::-;73151:272;;;;73339:65;;;-1:-1:-1;73339:65:35;;70431:248;975:20552:34;;70500:148:35;975:20552:34;;70500:148:35;975:20552:34;;;;-1:-1:-1;;;;;70568:7:35;975:20552:34;;;;;70500:148:35;;;;;:::i;:::-;;;;70662:7::o;69556:761::-;69631:151;975:20552:34;-1:-1:-1;;;;;69697:7:35;975:20552:34;;69631:151:35;975:20552:34;;;69631:151:35;;;;;;:::i;:::-;;;;69556:761;;69124:253;69205:161;975:20552:34;69205:161:35;-1:-1:-1;;;;;69275:7:35;975:20552:34;;;;;69205:161:35;;;;;;:::i;:::-;;;;69124:253;;;;68527:433;975:20552:34;68592:357:35;975:20552:34;-1:-1:-1;;;;;68672:7:35;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;68592:357:35;68527:433;;;67839:3;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;975:20552:34;9188:16:36;975:20552:34;;9188:34:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9188:34:36;;:::i;:::-;9182:40;;-1:-1:-1;975:20552:34;9535:18:36;975:20552:34;;9535:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;975:20552:34;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9535:36:36;;:::i;:::-;9529:42;;975:20552:34;;;;;;;68027:246:35;;67839:3;-1:-1:-1;975:20552:34;;;;;68287:131:35;;67839:3;;3273:4:26;;67817:13:35;;68287:131;975:20552:34;;;3273:4:26;;68340:63:35;;-1:-1:-1;;;;;975:20552:34;;;;68340:63:35;:::i;:::-;68287:131;;;;68027:246;975:20552:34;;;;68198:60:35;975:20552:34;68083:68:35;68169:89;975:20552:34;;;;;;;;;;;68083:68:35;;:::i;:::-;975:20552:34;;;;68198:60:35;;:::i;68169:89::-;68027:246;;;;7167:865:47;;;;7564:30;975:20552:34;2275:6:26;;;;7513:37:47;;;975:20552:34;;7564:30:47;;975:20552:34;7560:195:47;;7167:865;7768:34;7564:30;7768:34;;975:20552:34;;;7768:85:47;;;;7167:865;7764:262;;;7167:865;;:::o;7764:262::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;725:5:47;;;;;;733;;;:::i;7768:85::-;7806:47;;;;975:20552:34;;;7768:85:47;;;7560:195;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;725:5:47;;;;;;733;;;:::i;:::-;7560:195;;;;725:17;;;-1:-1:-1;725:17:47;;3691:354:45;3793:6;;3789:20;;27805:340:21;3227:4:26;27805:340:21;;;3227:4:26;27805:340:21;;;;;;;;;;;;3227:4:26;4008:11:45;;3227:4:26;;4008:30:45;975:20552:34;3691:354:45;:::o;4267:1378::-;;;;;4534:8;3227:4:26;4534:8:45;;;:18;;;4267:1378;4530:32;;5246:33;5477:43;975:20552:34;5020:31:45;975:20552:34;4776:31:45;3227:4:26;5550:44:45;975:20552:34;;;;;4776:31:45;;:::i;:::-;5020;;:::i;:::-;5246:33;;:::i;:::-;5477:43;;;:::i;:::-;5550:44;;:::i;:::-;975:20552:34;4267:1378:45;:::o;4534:18::-;4546:6;;;4534:18;;4267:1378;;;;4534:8;;;;;:18;;;4267:1378;4530:32;;5550:44;975:20552:34;5020:31:45;975:20552:34;4776:31:45;975:20552:34;5246:33:45;975:20552:34;5477:43:45;975:20552:34;;;;4776:31:45;;:::i;4534:18::-;4546:6;;;4534:18;;8003:2079;;;;;;;;8297:10;;:24;;;;8003:2079;8293:38;;3861:4:26;-1:-1:-1;;;3861:4:26;;-1:-1:-1;;;3861:4:26;;;21083:3141:21;;;;;;3227:4:26;21083:3141:21;;;;;;;;;;;3227:4:26;8613:37:45;21083:3141:21;;;8613:37:45;:::i;:::-;8678:13;-1:-1:-1;;;3227:4:26;;;;;;-1:-1:-1;;;3227:4:26;;;;;8713:5:45;:42;:5;;8721:34;8713:5;;;;;:::i;:::-;8721:34;;;:::i;8713:42::-;975:20552:34;;;;;;34709:2941:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3227:4:26;34709:2941:21;;;;;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;3227:4:26;34709:2941:21;;;;;;;;8815:6:45;;;:42;:6;;;8824:29;8840:6;;;;:::i;:::-;8824:29;:::i;:::-;27805:340:21;3227:4:26;27805:340:21;;;3227:4:26;27805:340:21;;;;;;;;;;;;;;8943:10:45;;;;;;8939:26;;8815:42;9014:7;;;;8991:40;9130:44;9014:7;;;;;;;:::i;:::-;8991:40;;:::i;9130:44::-;9201:12;;;;;:::i;:::-;27805:340:21;3227:4:26;27805:340:21;;;3227:4:26;27805:340:21;;;;;;;;;;;;;;;9278:12:45;;;9274:30;;8815:42;9318:10;9314:52;;9412:10;;;;;;3227:4:26;3861;;;;;;;9412:27:45;;9453:8;;9449:50;;9547:7;;9524:40;9547:7;9804:12;9547:7;;;;;9733:44;9547:7;;:::i;:::-;9524:40;;:::i;9733:44::-;9804:12;;;:::i;:::-;27805:340:21;3227:4:26;27805:340:21;;;3227:4:26;27805:340:21;;;;;;;;;;;;9881:12:45;;;;9877:30;;9412:27;9921:10;;9917:52;;10064:11;8003:2079;:::o;9877:30::-;9895:12;;9877:30;;;9449:50;9477:11;;;;;;;;;:::o;9412:27::-;;;;;9274:30;9292:12;;9274:30;;8939:26;8955:10;;-1:-1:-1;8955:10:45;;8939:26;;8815:42;;;;;975:20552:34;8815:42:45;;21083:3141:21;-1:-1:-1;;21083:3141:21;;;;;;;;;;;3227:4:26;21083:3141:21;;;;3227:4:26;21083:3141:21;;;;8613:37:45;;21083:3141:21;;;;;;;;;;;;;;;8613:37:45;:::i;21083:3141:21:-;;975:20552:34;21083:3141:21;;;;8297:24:45;8311:10;;;8297:24;;1012:679:33;975:20552:34;;-1:-1:-1;;;1189:95:33;;-1:-1:-1;;;;;975:20552:34;;;1189:95:33;;;975:20552:34;1154:21:33;;975:20552:34;;1189:95:33;975:20552:34;-1:-1:-1;182:42:26;3861:4;1189:95:33;-1:-1:-1;;1189:95:33;;;1012:679;-1:-1:-1;1185:500:33;;1657:17;;-1:-1:-1;1657:17:33;-1:-1:-1;1657:17:33;:::o;1185:500::-;1358:18;1354:74;;-1:-1:-1;;;;;975:20552:34;1464:32:33;;:21;:32;:::i;:::-;975:20552:34;1511:27:33;1533:4;1511:27;:::o;1189:95::-;;;;975:20552:34;1189:95:33;;975:20552:34;1189:95:33;;;;;;975:20552:34;1189:95:33;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;1189:95:33;;;;;;;-1:-1:-1;1189:95:33;;11269:467:38;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11384:85:38;;;;11269:467;11479:25;;;975:20552:34;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11514:98:38;;11269:467;975:20552:34;-1:-1:-1;975:20552:34;11664:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;34813:4:35;975:20552:34;;;;11628:101:38;11269:467::o;11514:98::-;-1:-1:-1;975:20552:34;;;11384:15:38;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;;;11514:98:38;;11384:85;11430:39;;;;:::i;:::-;11384:85;;;11269:467;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11384:85:38;;;;11269:467;11479:25;;;975:20552:34;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11514:98:38;;11269:467;975:20552:34;-1:-1:-1;975:20552:34;11664:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;49722:1:35;975:20552:34;;;;11628:101:38;11269:467::o;11514:98::-;-1:-1:-1;975:20552:34;;;11384:15:38;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;;;11514:98:38;;11384:85;11430:39;;;;:::i;:::-;11384:85;;;11269:467;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11384:85:38;;;;11269:467;11479:25;;;975:20552:34;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11514:98:38;;11269:467;975:20552:34;-1:-1:-1;975:20552:34;11664:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;56290:1:35;975:20552:34;;;;11628:101:38;11269:467::o;11514:98::-;-1:-1:-1;975:20552:34;;;11384:15:38;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;;;11514:98:38;;11384:85;11430:39;;;;:::i;:::-;11384:85;;;11269:467;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11384:85:38;;;;11269:467;11479:25;;;975:20552:34;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11514:98:38;;11269:467;975:20552:34;-1:-1:-1;975:20552:34;11664:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;54117:1:35;975:20552:34;;;;11628:101:38;11269:467::o;11514:98::-;-1:-1:-1;975:20552:34;;;11384:15:38;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;;;11514:98:38;;11384:85;11430:39;;;;:::i;:::-;11384:85;;;11269:467;-1:-1:-1;;;;;975:20552:34;;;;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11384:85:38;;;;11269:467;11479:25;;;975:20552:34;-1:-1:-1;975:20552:34;11384:15:38;975:20552:34;;;;-1:-1:-1;975:20552:34;;;;;11514:98:38;;11269:467;975:20552:34;-1:-1:-1;975:20552:34;11664:14:38;975:20552:34;;;;;;;;-1:-1:-1;975:20552:34;3701:25:26;975:20552:34;8907:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;-1:-1:-1;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;;;47180:1:35;975:20552:34;;;;11628:101:38;11269:467::o;11514:98::-;-1:-1:-1;975:20552:34;;;11384:15:38;975:20552:34;;;;;2817:1:26;;-1:-1:-1;;;;2817:1:26;;;11514:98:38;;11384:85;11430:39;;;;:::i;:::-;11384:85;;;81929:1224:35;82172:7;975:20552:34;;;;;;;82207:31:35;-1:-1:-1;82252:26:35;;82248:576;;81929:1224;975:20552:34;;-1:-1:-1;;;;;975:20552:34;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;82869:55:35;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;82869:55:35;;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;82869:55:35;:::i;:::-;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;;;;;;;82974:45:35;83113:32;975:20552:34;9033:15:36;975:20552:34;82974:45:35;975:20552:34;;;;;;;;;;;82974:45:35;:::i;82248:576::-;-1:-1:-1;;;;;975:20552:34;;;;;82320:57:35;975:20552:34;82321:31:35;82780:33;975:20552:34;;;;;;;;82321:31:35;:::i;82320:57::-;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;;;;;;82391:56:35;975:20552:34;2275:6:26;975:20552:34;;;82391:56:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;82172:7:35;975:20552:34;-1:-1:-1;;;;;;;;;;;;975:20552:34;82693:19:35;975:20552:34;;82693:72:35;975:20552:34;-1:-1:-1;975:20552:34;;;;82693:72:35;:::i;:::-;975:20552:34;;82780:33:35;:::i;:::-;82248:576;;;;;45888:1398;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;;;15468:14:38;975:20552:34;;;;;;;3701:25:26;975:20552:34;;45888:1398:35;;-1:-1:-1;;;;;975:20552:34;;;;;;;45888:1398:35;;7896:21;7921:3;975:20552:34;;;;;;109779:32:35;5041:2081:33;7895:79:35;;-1:-1:-1;975:20552:34;5041:2081:33;;:::i;:::-;-1:-1:-1;975:20552:34;;;;;46280:1000:35;;;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;;975:20552:34;-1:-1:-1;;;975:20552:34;;;46589:252:35;;975:20552:34;;;;;;-1:-1:-1;;;;;975:20552:34;;46681:11:35;;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2275:6:26;;;;975:20552:34;7921:3:35;975:20552:34;;;;;;;46589:252:35;45888:1398::o;46280:1000::-;46858:422;;;;;;;-1:-1:-1;;;;;975:20552:34;;46985:27:35;975:20552:34;46985:27:35;:::i;:::-;975:20552:34;;78322:15:35;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;975:20552:34;78322:51:35;;975:20552:34;;;;;;78322:51:35;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;;;;975:20552:34;;;;;78322:15:35;975:20552:34;78466:15:35;975:20552:34;-1:-1:-1;;;;;78466:47:35;2275:6:26;975:20552:34;;;78466:47:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;78466:15:35;975:20552:34;;;-1:-1:-1;;;;975:20552:34;;;-1:-1:-1;78754:24:35;;;;;;78854;;;79293:8;78854:24;;79122:48;78854:24;;:::i;:::-;975:20552:34;;;79122:48:35;975:20552:34;;;;;;;;;;;79122:48:35;:::i;:::-;79293:8;:::i;:::-;80572:27;78466:15;975:20552:34;7921:3:35;975:20552:34;;80318:40:35;975:20552:34;;:::i;80318:40:35:-;80572:27;;:::i;:::-;80614:37;;;;;;;80837;;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;80892:28:35;;;;;;-1:-1:-1;78466:15:35;975:20552:34;-1:-1:-1;;;;;;;;;;;47046:67:35;7921:3;;975:20552:34;;;;;;-1:-1:-1;;;;;;975:20552:34;80940:49:35;;975:20552:34;;;80940:49:35;:::i;:::-;975:20552:34;;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;78466:15:35;975:20552:34;80888:596:35;975:20552:34;;;;;;;;;;;;;;;;;;47046:67:35;45888:1398::o;80888:596::-;81186:22;81427:42;81186:22;;81428:28;81186:22;;;;;:::i;:::-;78466:15;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;81152:56:35;;2275:6:26;975:20552:34;;;81152:56:35;:::i;:::-;7921:3;975:20552:34;;2275:6:26;975:20552:34;2275:6:26;;;;975:20552:34;;78466:15:35;975:20552:34;81428:28:35;:::i;81427:42::-;8771:9:36;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;47046:67:35;7921:3;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;81387:82:35;;975:20552:34;;81387:82:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;80888:596:35;;80610:1122;8771:9:36;;;-1:-1:-1;8771:9:36;;;975:20552:34;2817:1:26;-1:-1:-1;;;;;;8478:7:36;975:20552:34;;;;7946:1:35;975:20552:34;;;;;8753:17:36;975:20552:34;;;;;-1:-1:-1;;;;;;;;;;;47046:67:35;7921:3;;-1:-1:-1;975:20552:34;-1:-1:-1;;;;;975:20552:34;81666:55:35;;975:20552:34;;81666:55:35;:::i;78750:1319::-;79510:24;;;;;;;79506:563;;78750:1319;;;;;;79506:563;79749:48;975:20552:34;79618:24:35;79749:48;79618:24;79997:61;79618:24;;;:::i;:::-;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;79749:48:35;:::i;:::-;975:20552:34;;;;;;;;;;;;;;;79997:61:35;79506:563;;;;;46858:422;47144:38;;-1:-1:-1;;;;;;;;;;;47144:38:35;;;;7921:3;47144:38;;;:::i;:::-;975:20552:34;;;;;;;;;;2275:6:26;;;;975:20552:34;;;;;47180:1:35;975:20552:34;;;;47202:67:35;975:20552:34:o;76092:447:35:-;975:20552:34;;-1:-1:-1;;;;975:20552:34;;;;76491:15:35;975:20552:34;;-1:-1:-1;;;;;975:20552:34;76491:41:35;;975:20552:34;;;;;76491:41:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;76491:15:35;975:20552:34;76092:447:35:o;83773:291::-;-1:-1:-1;;;;;975:20552:34;;-1:-1:-1;975:20552:34;9360:18:36;975:20552:34;;9360:36:36;975:20552:34;-1:-1:-1;975:20552:34;2817:1:26;23196:2:38;;-1:-1:-1;;;;;8478:7:36;975:20552:34;;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;-1:-1:-1;;;;;975:20552:34;83934:57:35;;975:20552:34;;;;83934:57:35;:::i;:::-;975:20552:34;;-1:-1:-1;;;;;;975:20552:34;;;;;;-1:-1:-1;975:20552:34;;;9360:18:36;975:20552:34;;;;;8478:7:36;975:20552:34;9360:36:36;;2817:1:26;;-1:-1:-1;;;;;975:20552:34;;9360:36:36;;:::i;:::-;-1:-1:-1;975:20552:34;;;;-1:-1:-1;;;;;975:20552:34;84001:56:35;;975:20552:34;;;84001:56:35;:::i;7128:837:33:-;-1:-1:-1;;;;;975:20552:34;;;;7128:837:33;7344:21;7334:31;;7330:93;;7128:837;3227:4:26;7437:32:33;;3227:4:26;;-1:-1:-1;;;;;975:20552:34;;;;;;7489:159:33;;975:20552:34;7489:159:33;;;975:20552:34;;7489:159:33;;;;182:42:26;3861:4;7489:159:33;-1:-1:-1;;7489:159:33;;;7433:526;-1:-1:-1;7485:417:33;;-1:-1:-1;;;;;;7870:17:33:o;7485:417::-;7704:18;7700:82;;7807:4;;-1:-1:-1;;;;;975:20552:34;;7799:31:33:o;7489:159::-;;;;975:20552:34;7489:159:33;;975:20552:34;7489:159:33;;;;;;975:20552:34;7489:159:33;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;7489:159:33;;;;;;;-1:-1:-1;7489:159:33;;7433:526;-1:-1:-1;7940:4:33;;-1:-1:-1;;;7932:16:33:o;7330:93::-;7391:21;;-1:-1:-1;7330:93:33;;83317:251:35;83423:15;975:20552:34;-1:-1:-1;;;;;;83423:40:35;975:20552:34;2275:6:26;975:20552:34;;;83423:40:35;:::i;:::-;975:20552:34;;;-1:-1:-1;;;;;975:20552:34;;;;83423:15:35;975:20552:34;83493:19:35;975:20552:34;;83493:44:35;;975:20552:34;;;83493:44:35;:::i;:::-;-1:-1:-1;;;;;;975:20552:34;;;;;;83493:19:35;975:20552:34;83317:251:35:o;975:20552:34:-;;;;;;;;;1175:6:26;;975:20552:34;;;;1175:6:26;975:20552:34;;;;1175:6:26;975:20552:34;;;;1175:6:26;975:20552:34;;;;1175:6:26;975:20552:34;;;;;;;;:::i;:::-;;;;:::i;7971:420:33:-;;975:20552:34;8086:55:33;7971:420;975:20552:34;;;;;;;;;8086:55:33;;8135:4;8086:55;;;;;:::i;:::-;;;;182:42:26;8086:55:33;;;;;;;;;;;7971:420;-1:-1:-1;8082:303:33;;8361:13;;;;8086:55;8361:13;8086:55;8361:13;:::o;8082:303::-;8299:29;;;;:::i;8086:55::-;;;;;;;;975:20552:34;8086:55:33;975:20552:34;8086:55:33;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;975:20552:34;;;;;;;;;1175:6:26;;975:20552:34;;;;;;1175:6:26;975:20552:34;;;:::i;:::-;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;;;;:::o;8397:366:33:-;975:20552:34;;-1:-1:-1;;;8517:75:33;;975:20552:34;8517:75:33;;975:20552:34;;;;8517:75:33;;8397:366;8574:4;;8517:75;;;;:::i;:::-;;;975:20552:34;182:42:26;8517:75:33;;975:20552:34;;8517:75:33;;;8397:366;-1:-1:-1;8513:244:33;;8738:8;975:20552:34;8738:8:33;:::o;8517:75::-;;;;;;;;;;;;;;;;:::i;:::-;;;;;:::i;:::-;;;;;;;;;;;;975:20552:34;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;;;:::o;:::-;-1:-1:-1;;;;;975:20552:34;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;;;;;;;-1:-1:-1;;;;;975:20552:34;;;;;;;-1:-1:-1;2275:6:26;975:20552:34;;;;;;;;;;;;;;;;;;;;:::o;20943:3287:21:-;21083:3141;;;;;;;;;;;;;;;;;;20943:3287::o;21083:3141::-;-1:-1:-1;;21083:3141:21;;;;;;;;;;4805:1:45;21083:3141:21;;;;4805:1:45;21083:3141:21;;;;;20943:3287::o;:::-;21083:3141;;;;;;;;;;;;;;;;;;;;;;20943:3287::o;21083:3141::-;5277:1:45;;-1:-1:-1;;23196:2:38;21083:3141:21;;;;;;;;;;;;;5277:1:45;21083:3141:21;;;;;;;;;;;;;;;;;20943:3287::o;:::-;21083:3141;;;;20943:3287;21083:3141;;;;;;;;-1:-1:-1;;;21083:3141:21;;;;-1:-1:-1;;;;;21083:3141:21;;;20943:3287::o;21083:3141::-;-1:-1:-1;;21083:3141:21;;;;;;;;;;;-1:-1:-1;;;1362:4:45;21083:3141:21;1362:4:45;-1:-1:-1;;;21083:3141:21;-1:-1:-1;21083:3141:21;;;;;;;;;;;;;;;;;;20943:3287::o;:::-;21083:3141;;;;20943:3287;21083:3141;;;;;;;;-1:-1:-1;;;21083:3141:21;;;;-1:-1:-1;;;;;21083:3141:21;;;20943:3287::o;21083:3141::-;-1:-1:-1;;21083:3141:21;;;;;;;;;;;-1:-1:-1;;;1422:4:45;21083:3141:21;1422:4:45;-1:-1:-1;;;21083:3141:21;-1:-1:-1;21083:3141:21;;;;;;;;;;;;;;;;;;20943:3287::o;:::-;21083:3141;;;;20943:3287;21083:3141;;;;;;;;;;;;;;;;;;20943:3287::o;21083:3141::-;23196:2:38;;-1:-1:-1;;23196:2:38;21083:3141:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20943:3287::o;10582:590:38:-;-1:-1:-1;;;;;975:20552:34;;;-1:-1:-1;;;;;10676:23:38;;10672:173;;975:20552:34;-1:-1:-1;;;;;10858:30:38;975:20552:34;;10858:39:38;10854:260;;975:20552:34;;;10858:30:38;975:20552:34;;;;10582:590:38;:::o;10854:260::-;10930:30;;;:::i;:::-;975:20552:34;-1:-1:-1;;;;;975:20552:34;10858:30:38;975:20552:34;;;10858:30:38;975:20552:34;-1:-1:-1;;;;10858:30:38;975:20552:34;;;;;;;;;;;-1:-1:-1;;;975:20552:34;;;;11087:16:38;:::o;10672:173::-;10823:11;;10830:4;10823:11;:::o;5041:2081:33:-;-1:-1:-1;5282:21:33;;975:20552:34;;;;;;5317:100:33;;-1:-1:-1;;;;;975:20552:34;;5317:100:33;;;975:20552:34;;;;1432:6:26;;;975:20552:34;1432:6:26;5317:100:33;;;-1:-1:-1;182:42:26;3861:4;5317:100:33;-1:-1:-1;;5317:100:33;;;5041:2081;-1:-1:-1;5313:1750:33;;-1:-1:-1;975:20552:34;;-1:-1:-1;;;6238:171:33;;975:20552:34;-1:-1:-1;6238:171:33;;975:20552:34;;;;6238:171:33;;5290:4;;5317:100;6238:171;;;:::i;:::-;;;-1:-1:-1;182:42:26;3861:4;6238:171:33;-1:-1:-1;;6238:171:33;;;5313:1750;-1:-1:-1;6234:790:33;;6989:20;-1:-1:-1;6234:790:33;-1:-1:-1;7072:43:33;5041:2081;:::o;6234:790::-;6477:13;6473:33;;6234:790;6543:21;;;:::i;:::-;6234:790;-1:-1:-1;7072:43:33;5041:2081;:::o;6473:33::-;5313:1750;;-1:-1:-1;6473:33:33;;6238:171;;;;;;;;;;;;;;;:::i;:::-;;;;;;;5313:1750;5477:18;5473:623;;6129:21;;:32;6128:46;6129:21;;:32;:::i;6128:46::-;6188:14;6198:4;7072:43;5041:2081;:::o;5473:623::-;975:20552:34;;-1:-1:-1;;;5596:177:33;;975:20552:34;-1:-1:-1;5596:177:33;;975:20552:34;;;;5596:177:33;;5290:4;;5317:100;5596:177;;;:::i;:::-;;;-1:-1:-1;182:42:26;3861:4;5596:177:33;-1:-1:-1;;5596:177:33;;;5473:623;-1:-1:-1;5592:431:33;;5984:20;-1:-1:-1;6040:41:33;-1:-1:-1;6040:41:33;;:::o;5592:431::-;5845:13;5841:33;;5592:431;5915:21;;;:::i;:::-;5592:431;;5841:33;5870:4;;-1:-1:-1;5841:33:33;;5596:177;;;;;;;;;;;;;;;:::i;:::-;;;;;;;5317:100;;;;1432:6:26;5317:100:33;;1432:6:26;5317:100:33;;;;;;1432:6:26;5317:100:33;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;5317:100:33;;;;;;;-1:-1:-1;5317:100:33;;4230:805;;;;-1:-1:-1;;;;;975:20552:34;;;4496:21:33;4479:38;;975:20552:34;;2744:3:26;4533:30:33;;2744:3:26;;;-1:-1:-1;;;;;4583:138:33;975:20552:34;;;;;;;;;;;;4583:138:33;;975:20552:34;4583:138:33;;;975:20552:34;182:42:26;3861:4;4583:138:33;-1:-1:-1;;4583:138:33;;;4529:500;-1:-1:-1;4579:393:33;;-1:-1:-1;;;;;;4940:17:33:o;4579:393::-;4777:18;4773:82;;4880:4;4872:28;;:::o;4583:138::-;;;;975:20552:34;4583:138:33;;975:20552:34;4583:138:33;;;;;;975:20552:34;4583:138:33;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;4583:138:33;;;;;;;-1:-1:-1;4583:138:33;;4529:500;5002:16;;;;5010:4;5002:16;-1:-1:-1;5002:16:33;:::o;975:20552:34:-;;;;-1:-1:-1;975:20552:34;;;;;-1:-1:-1;975:20552:34;1383:7:26;;;;;;975:20552:34;1383:7:26;-1:-1:-1;;;;;1383:7:26;;;975:20552:34;;;;1383:7:26;;;975:20552:34;;1383:7:26;;975:20552:34;1383:7:26:o;1697:2527:33:-;975:20552:34;;-1:-1:-1;;;1954:145:33;;-1:-1:-1;;;;;975:20552:34;;;1697:2527:33;;1954:145;975:20552:34;;1954:145:33;1697:2527;975:20552:34;1697:2527:33;1954:145;;;;:::i;:::-;;;-1:-1:-1;182:42:26;3861:4;1954:145:33;-1:-1:-1;;1954:145:33;;;1697:2527;-1:-1:-1;1950:2241:33;;-1:-1:-1;;975:20552:34;;-1:-1:-1;;;2301:140:33;;975:20552:34;;;;2301:140:33;2422:4;2301:140;1954:145;2301:140;;;:::i;:::-;;;-1:-1:-1;182:42:26;3861:4;2301:140:33;-1:-1:-1;;2301:140:33;;;1950:2241;2297:1884;;;1950:2241;;;;;-1:-1:-1;4200:17:33;-1:-1:-1;1697:2527:33;:::o;2297:1884::-;2540:9;;;;2577:25;;;;;975:20552:34;1954:145:33;975:20552:34;3106:177:33;975:20552:34;;;;;;;;;;3106:177:33;;1954:145;3106:177;;;:::i;:::-;;;-1:-1:-1;182:42:26;3861:4;3106:177:33;-1:-1:-1;;3106:177:33;;;2573:1251;3102:575;;;2573:1251;;;2297:1884;;;;;;3102:575;3346:13;3342:101;;3486:29;;;:::i;:::-;1950:2241;;3472:44::o;3106:177::-;;;;1954:145;3106:177;;1954:145;3106:177;;;;;;1954:145;3106:177;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;3106:177:33;;;;;;;-1:-1:-1;3106:177:33;;2573:1251;;;;;;2536:1519;4020:16;;;;1950:2241;4020:16;-1:-1:-1;4020:16:33;:::o;2301:140::-;;;;;975:20552:34;2301:140:33;975:20552:34;2301:140:33;;;;;;;:::i;:::-;;;;;;;;;;;1950:2241;2151:18;;;;;;;2147:74;;2242:4;2234:31;;:::o;1954:145::-;;;;;;;;;;;;;;;;;;:::i;:::-;;;862:7:26;;;;975:20552:34;;;:::i;:::-;1954:145:33;;;;;;;-1:-1:-1;1954:145:33;
Swarm Source
ipfs://f5bee3fdc0395cd6ac4998db7de5cbae77c2dbb40f518c13469fc2ea8ee2e270
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in MON
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.