Overview
Max Total Supply
1,367.428186386824704574 atvUSDC
Holders
54 (0.00%)
Transfers
-
1
Market
Price
$103.61 @ 0.053085 ETH (+0.01%)
Onchain Market Cap
-
Circulating Supply Market Cap
$162,395.00
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
| # | Exchange | Pair | Price | 24H Volume | % Volume |
|---|
Contract Name:
AtvWrappedBoosterTL
Compiler Version
v0.8.30+commit.73712a01
Contract Source Code (Solidity Multiple files format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.20;
import {ERC4626, SafeERC20, OwnableDelayModuleV2} from "./OwnableDelayModuleV2.sol";
import {Pausable} from "./Pausable.sol";
import "./ERC20.sol";
import {Math} from "./Math.sol";
import "./ArrayUtils.sol";
interface IAFi {
function deposit(uint amount, address iToken) external;
function getInputToken() external view returns (address[] memory, address[] memory);
function withdraw(
uint _shares,
address oToken,
uint deadline,
uint[] memory minimumReturnAmount,
uint swapMethod,
uint minAmountOut
) external;
function getUTokens() external view returns (address[] memory uTokensArray);
function pauseUnpauseDeposit(bool status) external;
function totalSupply() external view returns (uint256);
function totalAssets() external view returns (uint256);
function getcSwapCounter() external view returns(uint256);
function aFiStorage() external view returns (address);
function exchangeToken() external;
function PARENT_VAULT() external view returns (address);
}
interface IAFiStorage{
function calculatePoolInUsd(address afiContract) external view returns (uint);
}
interface IAFiOracle {
function getPriceInUSD(address tok) external view returns (uint256, uint256);
}
contract AtvWrappedBoosterTL is ERC4626, OwnableDelayModuleV2, Pausable{
using SafeERC20 for IERC20;
using ArrayUtils for address[];
using Math for uint256;
uint256 public platformFee;
uint256 maxChkpts = 100000;
uint256 public currentEpochId;
uint256 public constant MAX_PLATFORM_FEE = 200;
uint256 private constant UNIT_NAV = 1e27;
uint256 private constant FEE_DIV = 10000;
address public platformWallet;
address public controller;
address public atvStorage;
address public atvOracle;
address private immutable UNDERLYING;
uint256 public deadlineDelay = 1 hours;
bool public pauseDeposit;
mapping(address => uint256) public latestEpoch;
struct TWABCheckpoint {
uint256 timestamp;
uint256 balance;
uint256 accBal;
}
struct UserTWAB {
TWABCheckpoint[] checkpoints;
uint256 lastUpdateTime;
}
struct Epoch {
uint256 startTime;
uint256 endTime;
uint256 startNAV;
uint256 endNAV;
bool finalized;
}
Epoch[] public epochs;
IAFi public ATV_VAULT;
uint256 public totalVaultTokenRec; // Indicates total ATV_VAULT tokens through the flow
mapping(address => uint256[]) public userEpochIDs;
mapping(address => mapping( uint256 => bool)) public presentInEpoch;
mapping(address => mapping(uint256 => UserTWAB)) public userTWAB;
event MigrateVault(address _oldVault, address _newVault);
event CalledExchange(address _oldVault, address _newVault, uint256 exchangedBalance);
event WithdrawStrayToken(address token, uint256 amount);
event PauseUnpauseDeposit(bool _pauseDeposit);
event UpdatePlatformWallet(address _platformWallet);
event UpdatePlatformFee(uint256 _platformFee);
event AdjustExtraAsset(address to, uint256 extra);
event EpochStarted(uint256 indexed epochId, uint256 startTime, uint256 startNAV);
event EpochFinalized(uint256 indexed epochId, uint256 endTime, uint256 endNAV);
event TWABUpdated(address indexed user, uint256 indexed epochId, uint256 newBalance, uint256 timestamp, uint256 checkpointCount);
event ThresholdExceeded(address indexed user, uint256 indexed epochId, uint256 checkpointCount);
event SetController(address _controller);
event MaxCheckpointsSet(uint256 newLimit);
// Custom errors
error E01(); // Zero address
error E02(); // Zero value
error E03(); // Invalid epoch
error E04(); // Not controller
error E05(); // Deposit paused
error E06(); // Fee exceeds max
error E07(); // Invalid range
error E08(); // Not parent vault
error E09(); // Transfer to self
error E10(); // Cannot withdraw asset
error E11(); // Insufficient extra asset
error E12(); // Invalid withdraw
error E13(); // Insufficient received
error E14(); // Disabled function
error E15(); // Already finalized
error E16(); // No active epoch
error E17(); // Not finalized
error E18(); // Invalid condition
constructor(ERC20 _underlyingToken, address _atvVault, address _atvStorage, address _atvOracle)
ERC20("aarna atv USDC", "atvUSDC")
ERC4626(_underlyingToken)
{
_chkAddr(address(_underlyingToken));
_chkAddr(_atvOracle);
UNDERLYING = address(_underlyingToken);
atvStorage = _atvStorage;
atvOracle = _atvOracle;
ATV_VAULT = IAFi(_atvVault);
_startNewEpoch();
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
// Validation functions
function _chkAddr(address a) private pure {
if(a == address(0)) revert E01();
}
function _chkGt0(uint256 v) private pure {
if(v == 0) revert E02();
}
function _chkCond(bool cond) private pure {
if(!cond) revert E18();
}
function _chkLte(uint256 a, uint256 b) private pure {
if(a > b) revert E06();
}
function _chkRange(uint256 v, uint256 min, uint256 max) private pure {
if(v < min || v > max) revert E07();
}
function _chkEq(address a, address b) private pure {
if(a != b) revert E04();
}
function _chkNeq(address a, address b) private pure {
if(a == b) revert E09();
}
function pauseUnpauseDeposit(bool status) external onlyOwner {
pauseDeposit = status;
emit PauseUnpauseDeposit(pauseDeposit);
}
function updatePlatformWalletAndFee(address _platformWallet, uint256 _fee) external onlyOwner{
platformWallet = _platformWallet;
_chkLte(_fee, MAX_PLATFORM_FEE);
platformFee = _fee;
emit UpdatePlatformWallet(platformWallet);
}
function updateMaxCheckpoints(uint256 newLimit) external onlyOwner {
_chkRange(newLimit, 10, 100000);
maxChkpts = newLimit;
emit MaxCheckpointsSet(newLimit);
}
function migrateVault(address _vault) external onlyOwner whenPaused {
address vault = address(ATV_VAULT);
if(IAFi(_vault).PARENT_VAULT() != vault) revert E08();
address oldVault = vault;
ATV_VAULT = IAFi(_vault);
emit MigrateVault(oldVault, address(ATV_VAULT));
}
function callExchange() external onlyOwner whenPaused{
address oldVault = ATV_VAULT.PARENT_VAULT();
address vault = address(ATV_VAULT);
uint256 bal = _sBal(oldVault);
IERC20(oldVault).approve(vault, bal);
ATV_VAULT.exchangeToken();
emit CalledExchange(oldVault, vault, bal);
}
function updateatvStorageAndOracle(address _atvStorage, address _atvOracle) external onlyOwner {
_chkAddr(_atvStorage);
atvStorage = _atvStorage;
atvOracle = _atvOracle;
}
function setController(address _controller) external onlyOwner {
_chkAddr(_controller);
controller = _controller;
emit SetController(_controller);
}
function calculateNAV() public view returns(uint256 assetNAV) {
address vault = address(ATV_VAULT);
uint256 supply = IERC20(vault).totalSupply();
_chkGt0(supply);
assetNAV = (IAFiStorage(atvStorage).calculatePoolInUsd(vault) * UNIT_NAV) / supply;
}
// Helper functions
function _sBal(address token) private view returns(uint256){
return IERC20(token).balanceOf(address(this));
}
function _getBalDiff(address token, uint256 before) private view returns (uint256) {
uint256 diff = _sBal(token) - before;
_chkGt0(diff);
return diff;
}
function _getPrice() private view returns (uint256, uint256) {
return IAFiOracle(atvOracle).getPriceInUSD(UNDERLYING);
}
function _navMath(uint256 amount, uint256 nav, bool toShares) private pure returns (uint256) {
if (toShares) {
// For converting assets to shares, amount is in USD with 6 decimal precision
// We need to return 18 decimal shares
return (amount * UNIT_NAV * (10**12)) / nav;
}
// For converting shares to assets, amount is in 18 decimals
// We need to return USD with 6 decimal precision
return (amount * nav) / (UNIT_NAV * (10**12));
}
function _processDeposit(uint256 atvShares, uint256 assets, address receiver) private {
totalVaultTokenRec += atvShares;
_mint(receiver, atvShares);
_addCheckpoint(receiver, balanceOf(receiver));
emit Deposit(_msgSender(), receiver, assets, atvShares);
}
function _addCheckpoint(address user, uint256 newBalance) internal {
UserTWAB storage twab = userTWAB[user][currentEpochId];
uint256 currentTime = block.timestamp;
uint256 timeDelta;
if (twab.checkpoints.length > 0) {
TWABCheckpoint storage lastCheckpoint = _lastCheckpoint(twab);
timeDelta = currentTime - lastCheckpoint.timestamp;
if(timeDelta > 0) {
twab.checkpoints.push(TWABCheckpoint({
timestamp: currentTime,
balance: newBalance,
accBal: (lastCheckpoint.accBal + (lastCheckpoint.balance * timeDelta))
}));
}else {
lastCheckpoint.balance = newBalance;
}
} else {
if(latestEpoch[user] > 0){
UserTWAB storage lastTwab = userTWAB[user][latestEpoch[user]];
TWABCheckpoint storage lastCheckpoint = lastTwab.checkpoints[lastTwab.checkpoints.length - 1];
Epoch memory epoch = epochs[currentEpochId - 1];
timeDelta = currentTime - epoch.startTime;
twab.checkpoints.push(TWABCheckpoint({
timestamp: currentTime,
balance: newBalance,
accBal: (lastCheckpoint.balance * timeDelta)
}));
} else {
twab.checkpoints.push(TWABCheckpoint({
timestamp: currentTime,
balance: newBalance,
accBal: 0
}));
}
}
twab.lastUpdateTime = currentTime;
latestEpoch[user] = currentEpochId;
if(!presentInEpoch[user][currentEpochId]){
presentInEpoch[user][currentEpochId] = true;
userEpochIDs[user].push(currentEpochId);
}
if (twab.checkpoints.length >= maxChkpts) {
emit ThresholdExceeded(user, currentEpochId, twab.checkpoints.length);
}
emit TWABUpdated(user, currentEpochId, newBalance, currentTime, twab.checkpoints.length);
}
function _getTWABBetween(address user, uint256 epochId) internal view returns (uint256) {
UserTWAB memory twab = userTWAB[user][epochId];
if (twab.checkpoints.length == 0) return 0;
Epoch memory epoch = epochs[epochId - 1];
TWABCheckpoint memory lastCheckpoint = twab.checkpoints[twab.checkpoints.length - 1];
uint256 totalWeighted = lastCheckpoint.accBal;
uint256 extraTime = epoch.endTime - lastCheckpoint.timestamp;
totalWeighted += lastCheckpoint.balance * extraTime;
uint256 timeDelta = epoch.endTime - epoch.startTime;
if (timeDelta == 0) return 0;
return totalWeighted / timeDelta;
}
function _startNewEpoch() internal {
uint256 currentNAV = calculateNAV();
epochs.push(Epoch({
startTime: block.timestamp,
endTime: 0,
startNAV: currentNAV,
endNAV: 0,
finalized: false
}));
currentEpochId = epochs.length;
emit EpochStarted(currentEpochId, block.timestamp, currentNAV);
}
function finalizeEpoch() external {
_chkEq(msg.sender, controller);
Epoch storage epoch = _ensureActiveEpoch();
if(epoch.finalized) revert E15();
epoch.endTime = block.timestamp;
epoch.endNAV = calculateNAV();
epoch.finalized = true;
emit EpochFinalized(currentEpochId, epoch.endTime, epoch.endNAV);
_startNewEpoch();
}
function _ensureActiveEpoch() internal view returns (Epoch storage epoch) {
if(currentEpochId >= epochs.length + 1) revert E16();
return epochs[currentEpochId - 1];
}
function calculateEpochReward(address user, uint256 epochId) public view returns (uint256) {
if(epochId == 0 || epochId > epochs.length) revert E03();
Epoch memory epoch = epochs[epochId - 1];
if(!epoch.finalized) revert E17();
if (epoch.endNAV <= epoch.startNAV) return 0;
uint256 uTWAB = _getTWABBetween(user, epochId);
if (uTWAB == 0) {
uTWAB = calculateLastCheckpointBalance(user, epochId);
if(uTWAB == 0) return 0;
}
uint256 navIncrease = epoch.endNAV - epoch.startNAV;
return (uTWAB * navIncrease) / UNIT_NAV;
}
function getLastEpochBeforeCurrent(address user, uint256 currentEpoch) public view returns (uint256) {
uint256[] memory epochsForUser = userEpochIDs[user];
uint256 len = epochsForUser.length;
if (len == 0) return 0;
uint256 left = 0;
uint256 right = len;
while (left < right) {
uint256 mid = (left + right) / 2;
if (epochsForUser[mid] < currentEpoch) {
left = mid + 1;
} else {
right = mid;
}
}
if (left == 0) return 0;
return epochsForUser[left - 1];
}
function calculateLastCheckpointBalance(address user, uint256 currentEpoch) internal view returns (uint256) {
uint256 lastEpochId = getLastEpochBeforeCurrent(user, currentEpoch);
if (lastEpochId == 0) return 0;
UserTWAB storage twab = userTWAB[user][lastEpochId];
uint256 length = twab.checkpoints.length;
if (length == 0) return 0;
return _lastCheckpoint(twab).balance;
}
function _lastCheckpoint(UserTWAB storage twab) internal view returns (TWABCheckpoint storage) {
return twab.checkpoints[twab.checkpoints.length - 1];
}
function totalAssets() public view virtual override returns (uint256) {
return _convertToAssets(_sBal(address(ATV_VAULT)), Math.Rounding.Floor);
}
function decimals() public view virtual override returns (uint8) {
return 18 + _decimalsOffset();
}
function transfer(address to, uint256 shares) public override(ERC20, IERC20) returns (bool) {
address owner = _msgSender();
_transfer(owner, to, shares);
_tHelper(msg.sender, to);
return true;
}
function transferFrom(address from, address to, uint256 value) public virtual override(ERC20, IERC20) returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
_tHelper(from, to);
return true;
}
function _tHelper(address from, address to) internal whenNotPaused {
_chkNeq(from, to);
_addCheckpoint(from, balanceOf(from));
_addCheckpoint(to, balanceOf(to));
}
function withdrawStrayToken(address token) external onlyOwner{
if(token == address(ATV_VAULT)) revert E10();
uint256 bal = _sBal(token);
IERC20(token).safeTransfer(msg.sender, bal);
emit WithdrawStrayToken(token, bal);
}
function redeem(uint256, address, address) public pure virtual override returns (uint256) {
revert E14();
}
function mint(uint256, address) public pure override returns (uint256) {
revert E14();
}
function getUserCheckpoints(address user, uint256 epochId) external view returns (TWABCheckpoint[] memory) {
return userTWAB[user][epochId].checkpoints;
}
function getCurrentEpoch() external view returns (Epoch memory) {
return _ensureActiveEpoch();
}
function adjustExtraVaultTokens(address to) external onlyOwner{
uint256 totalBal = _sBal(address(ATV_VAULT));
if(totalBal <= totalVaultTokenRec) revert E11();
uint256 extra = totalBal - totalVaultTokenRec;
IERC20(address(ATV_VAULT)).safeTransfer(to, extra);
emit AdjustExtraAsset(to, extra);
}
function exchange(uint256 shares, address receiver) public virtual whenNotPaused returns (uint256) {
_chkGt0(shares);
if(pauseDeposit) revert E05();
address vault = address(ATV_VAULT);
uint256 before = _sBal(vault);
SafeERC20.safeTransferFrom(IERC20(vault), msg.sender, address(this), shares); // Always take from msg.sender
uint256 atvShares = _getBalDiff(vault, before);
(uint256 price, uint256 dec) = _getPrice();
atvShares = (atvShares * (10**dec))/ price;
uint256 assets = _navMath(atvShares, calculateNAV(), false);
_processDeposit(atvShares, assets, receiver);
return atvShares;
}
function deposit(uint256 assets, address receiver) public virtual override whenNotPaused returns (uint256) {
_chkGt0(assets);
if(pauseDeposit) revert E05();
address vault = address(ATV_VAULT);
IERC20 token = IERC20(UNDERLYING);
uint256 before = _sBal(vault);
SafeERC20.safeTransferFrom(token, msg.sender, address(this), assets);
token.approve(vault, assets);
ATV_VAULT.deposit(assets, UNDERLYING);
uint256 atvShares = _getBalDiff(vault, before);
_processDeposit(atvShares, assets, receiver);
return atvShares;
}
function _getMinReturnAmounts() internal view returns (uint256[] memory) {
uint256 ulen = ATV_VAULT.getUTokens().length;
return new uint256[](ulen);
}
function withdraw(uint256 shares, address receiver, address owner) public virtual override whenNotPaused returns (uint256) {
_chkGt0(shares);
if (_msgSender() != owner) {
_spendAllowance(owner, _msgSender(), shares);
}
uint256 assets = convertToAssets(shares);
uint256 maxAssets = maxWithdraw(owner);
if (assets > maxAssets) revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);
_burn(owner, shares);
totalVaultTokenRec -= shares;
emit Withdraw(_msgSender(), receiver, owner, assets, shares);
_addCheckpoint(owner, balanceOf(owner));
uint256 before = _sBal(UNDERLYING);
uint deadline = block.timestamp + deadlineDelay;
uint[] memory minimumReturnAmount = _getMinReturnAmounts();
ATV_VAULT.withdraw(
shares,
UNDERLYING,
deadline,
minimumReturnAmount,
3,
assets
);
uint256 vaultTokensReceived = _getBalDiff(UNDERLYING, before);
_chkCond(vaultTokensReceived >= assets);
uint256 pF = (vaultTokensReceived * platformFee) / FEE_DIV;
if(pF > 0 && platformWallet != address(0)){
vaultTokensReceived -= pF;
IERC20(UNDERLYING).safeTransfer(platformWallet, pF);
}
IERC20(UNDERLYING).safeTransfer(receiver, vaultTokensReceived);
return vaultTokensReceived;
}
function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual override returns (uint256) {
(uint256 price, uint256 dec) = _getPrice();
assets = assets - (assets / 100); // 1% fee
uint256 assetInUSD = (assets * price) / (10 ** dec);
return _navMath(assetInUSD, calculateNAV(), true);
}
function _convertToSharesForWithdraw(uint256 assets) internal view virtual returns (uint256) {
(uint256 price, uint256 dec) = _getPrice();
uint256 assetInUSD = (assets * price ) / (10 ** dec);
return _navMath(assetInUSD, calculateNAV(), true);
}
function previewWithdraw(uint256 assets) public view virtual override returns (uint256) {
assets = (assets * 10000) / (10000 - platformFee);
return _convertToSharesForWithdraw(assets);
}
function previewRedeem(uint256 shares) public view virtual override returns (uint256) {
shares = (shares * (10000 - platformFee)) / 10000;
return _convertToAssets(shares, Math.Rounding.Floor);
}
function convertToShares(uint256 assets) public view virtual override returns (uint256) {
return _convertToSharesForWithdraw(assets);
}
function convertToAssets(uint256 shares) public view virtual override returns (uint256) {
return _convertToAssets(shares, Math.Rounding.Floor);
}
function previewMint(uint256 shares) public view virtual override returns (uint256) {
return (_convertToAssets(shares, Math.Rounding.Ceil) * 100 / 99);
}
function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual override returns (uint256) {
(uint256 price, uint256 dec) = _getPrice();
uint256 sharesInUSD = _navMath(shares, calculateNAV(), false);
return (sharesInUSD * (10 ** dec)) / price;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.0;
// Reference: https://github.com/cryptofinlabs/cryptofin-solidity/blob/master/contracts/array-utils/AddressArrayUtils.sol
library ArrayUtils {
/**
* Deletes address at index and fills the spot with the last address.
* Order is preserved.
*/
// solhint-disable-next-line var-name-mixedcase
function sPopAddress(address[] storage A, uint index) internal {
uint length = A.length;
if (index >= length) {
revert("Error: index out of bounds");
}
for (uint i = index; i < length - 1; i++) {
A[i] = A[i + 1];
}
A.pop();
}
// solhint-disable-next-line var-name-mixedcase
function sPopUint256(uint[] storage A, uint index) internal {
uint length = A.length;
if (index >= length) {
revert("Error: index out of bounds");
}
for (uint i = index; i < length - 1; i++) {
A[i] = A[i + 1];
}
A.pop();
}
// solhint-disable-next-line var-name-mixedcase
function sumOfMArrays(
uint[] memory A,
uint[] memory B
) internal pure returns (uint[] memory sum) {
sum = new uint[](A.length);
for (uint i = 0; i < A.length; i++) {
sum[i] = A[i] + B[i];
}
return sum;
}
/**
* Finds the index of the first occurrence of the given element.
* @param A The input array to search
* @param a The value to find
* @return Returns (index and isIn) for the first occurrence starting from index 0
*/
function indexOf(address[] memory A, address a) internal pure returns (uint, bool) {
uint length = A.length;
for (uint i = 0; i < length; i++) {
if (A[i] == a) {
return (i, true);
}
}
return (type(uint).max, false);
}
/**
* Returns true if the value is present in the list. Uses indexOf internally.
* @param A The input array to search
* @param a The value to find
* @return Returns isIn for the first occurrence starting from index 0
*/
function contains(address[] memory A, address a) internal pure returns (bool) {
(, bool isIn) = indexOf(A, a);
return isIn;
}
/**
* Returns true if there are 2 elements that are the same in an array
* @param A The input array to search
* @return Returns boolean for the first occurrence of a duplicate
*/
function hasDuplicate(address[] memory A) internal pure returns (bool) {
require(A.length > 0, "A is empty");
for (uint i = 0; i < A.length - 1; i++) {
address current = A[i];
for (uint j = i + 1; j < A.length; j++) {
if (current == A[j]) {
return true;
}
}
}
return false;
}
/**
* @param A The input array to search
* @param a The address to remove
* @return Returns the array with the object removed.
*/
function remove(
address[] memory A,
address a
) internal pure returns (address[] memory) {
(uint index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
(address[] memory _A, ) = pop(A, index);
return _A;
}
}
/**
* @param A The input array to search
* @param a The address to remove
*/
function removeStorage(address[] storage A, address a) internal {
(uint index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
uint lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
if (index != lastIndex) {
A[index] = A[lastIndex];
}
A.pop();
}
}
/**
* Removes specified index from array
* @param A The input array to search
* @param index The index to remove
* @return Returns the new array and the removed entry
*/
function pop(
address[] memory A,
uint index
) internal pure returns (address[] memory, address) {
uint length = A.length;
require(index < A.length, "Index must be < A length");
address[] memory newAddresses = new address[](length - 1);
for (uint i = 0; i < index; i++) {
newAddresses[i] = A[i];
}
for (uint j = index + 1; j < length; j++) {
newAddresses[j - 1] = A[j];
}
return (newAddresses, A[index]);
}
/**
* Returns the combination of the two arrays
* @param A The first array
* @param B The second array
* @return Returns A extended by B
*/
function extend(
address[] memory A,
address[] memory B
) internal pure returns (address[] memory) {
uint aLength = A.length;
uint bLength = B.length;
address[] memory newAddresses = new address[](aLength + bLength);
for (uint i = 0; i < aLength; i++) {
newAddresses[i] = A[i];
}
for (uint j = 0; j < bLength; j++) {
newAddresses[aLength + j] = B[j];
}
return newAddresses;
}
/**
* Validate that address and uint array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of uint
*/
function validatePairsWithArray(address[] memory A, uint[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bool array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bool
*/
function validatePairsWithArray(address[] memory A, bool[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and string array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of strings
*/
function validatePairsWithArray(address[] memory A, string[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address array lengths match, and calling address array are not empty
* and contain no duplicate elements.
*
* @param A Array of addresses
* @param B Array of addresses
*/
function validatePairsWithArray(
address[] memory A,
address[] memory B
) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bytes array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bytes
*/
function validatePairsWithArray(address[] memory A, bytes[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate address array is not empty and contains no duplicate elements.
*
* @param A Array of addresses
*/
function _validateLengthAndUniqueness(address[] memory A) internal pure {
require(A.length > 0, "Array length must be > 0");
require(!hasDuplicate(A), "Cannot duplicate addresses");
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface 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].
*/
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) (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: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./IERC20Metadata.sol";
import {Context} from "./Context.sol";
import {IERC20Errors} from "./draft-IERC6093.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) internal _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 internal _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* Both values are immutable: they can only be set once during construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/// @inheritdoc IERC20
function totalSupply() public view virtual override(IERC20) returns (uint256) {
return _totalSupply;
}
/// @inheritdoc IERC20
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @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;
}
/// @inheritdoc IERC20
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _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;
}
/**
* @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 {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert 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.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
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 {
if (account == address(0)) {
revert 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 {
if (account == address(0)) {
revert 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 {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_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) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/extensions/ERC4626.sol)
pragma solidity ^0.8.20;
import {IERC20, IERC20Metadata, ERC20} from "./ERC20.sol";
import {SafeERC20} from "./SafeERC20.sol";
import {IERC4626} from "./IERC4626.sol";
import {Math} from "./Math.sol";
/**
* @dev Implementation of the ERC-4626 "Tokenized Vault Standard" as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*
* This extension allows the minting and burning of "shares" (represented using the ERC-20 inheritance) in exchange for
* underlying "assets" through standardized {deposit}, {mint}, {redeem} and {burn} workflows. This contract extends
* the ERC-20 standard. Any additional extensions included along it would affect the "shares" token represented by this
* contract and not the "assets" token which is an independent contract.
*
* [CAUTION]
* ====
* In empty (or nearly empty) ERC-4626 vaults, deposits are at high risk of being stolen through frontrunning
* with a "donation" to the vault that inflates the price of a share. This is variously known as a donation or inflation
* attack and is essentially a problem of slippage. Vault deployers can protect against this attack by making an initial
* deposit of a non-trivial amount of the asset, such that price manipulation becomes infeasible. Withdrawals may
* similarly be affected by slippage. Users can protect against this attack as well as unexpected slippage in general by
* verifying the amount received is as expected, using a wrapper that performs these checks such as
* https://github.com/fei-protocol/ERC4626#erc4626router-and-base[ERC4626Router].
*
* Since v4.9, this implementation introduces configurable virtual assets and shares to help developers mitigate that risk.
* The `_decimalsOffset()` corresponds to an offset in the decimal representation between the underlying asset's decimals
* and the vault decimals. This offset also determines the rate of virtual shares to virtual assets in the vault, which
* itself determines the initial exchange rate. While not fully preventing the attack, analysis shows that the default
* offset (0) makes it non-profitable even if an attacker is able to capture value from multiple user deposits, as a result
* of the value being captured by the virtual shares (out of the attacker's donation) matching the attacker's expected gains.
* With a larger offset, the attack becomes orders of magnitude more expensive than it is profitable. More details about the
* underlying math can be found xref:ROOT:erc4626.adoc#inflation-attack[here].
*
* The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued
* to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets
* will cause the first user to exit to experience reduced losses in detriment to the last users that will experience
* bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the
* `_convertToShares` and `_convertToAssets` functions.
*
* To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide].
* ====
*/
abstract contract ERC4626 is ERC20, IERC4626 {
using Math for uint256;
IERC20 internal _asset;
uint8 internal _underlyingDecimals;
/**
* @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 Set the underlying asset contract. This must be an ERC20-compatible contract (ERC-20 or ERC-777).
*/
constructor(IERC20 asset_) {
(bool success, uint8 assetDecimals) = _tryGetAssetDecimals(asset_);
_underlyingDecimals = success ? assetDecimals : 18;
_asset = asset_;
}
/**
* @dev Attempts to fetch the asset decimals. A return value of false indicates that the attempt failed in some way.
*/
function _tryGetAssetDecimals(IERC20 asset_) internal view returns (bool ok, uint8 assetDecimals) {
(bool success, bytes memory encodedDecimals) = address(asset_).staticcall(
abi.encodeCall(IERC20Metadata.decimals, ())
);
if (success && encodedDecimals.length >= 32) {
uint256 returnedDecimals = abi.decode(encodedDecimals, (uint256));
if (returnedDecimals <= type(uint8).max) {
return (true, uint8(returnedDecimals));
}
}
return (false, 0);
}
/**
* @dev Decimals are computed by adding the decimal offset on top of the underlying asset's decimals. This
* "original" value is cached during construction of the vault contract. If this read operation fails (e.g., the
* asset has not been created yet), a default of 18 is used to represent the underlying asset's decimals.
*
* See {IERC20Metadata-decimals}.
*/
function decimals() public view virtual override(IERC20Metadata, ERC20) returns (uint8) {
return _underlyingDecimals + _decimalsOffset();
}
/// @inheritdoc IERC4626
function asset() public view virtual returns (address) {
return address(_asset);
}
/// @inheritdoc IERC4626
function totalAssets() public view virtual returns (uint256) {
return IERC20(asset()).balanceOf(address(this));
}
/// @inheritdoc IERC4626
function convertToShares(uint256 assets) public view virtual returns (uint256) {
return _convertToShares(assets, Math.Rounding.Floor);
}
/// @inheritdoc IERC4626
function convertToAssets(uint256 shares) public view virtual returns (uint256) {
return _convertToAssets(shares, Math.Rounding.Floor);
}
/// @inheritdoc IERC4626
function maxDeposit(address) public view virtual returns (uint256) {
return type(uint256).max;
}
/// @inheritdoc IERC4626
function maxMint(address) public view virtual returns (uint256) {
return type(uint256).max;
}
/// @inheritdoc IERC4626
function maxWithdraw(address owner) public view virtual returns (uint256) {
return _convertToAssets(balanceOf(owner), Math.Rounding.Floor);
}
/// @inheritdoc IERC4626
function maxRedeem(address owner) public view virtual returns (uint256) {
return balanceOf(owner);
}
/// @inheritdoc IERC4626
function previewDeposit(uint256 assets) public view virtual returns (uint256) {
return _convertToShares(assets, Math.Rounding.Floor);
}
/// @inheritdoc IERC4626
function previewMint(uint256 shares) public view virtual returns (uint256) {
return _convertToAssets(shares, Math.Rounding.Ceil);
}
/// @inheritdoc IERC4626
function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
return _convertToShares(assets, Math.Rounding.Ceil);
}
/// @inheritdoc IERC4626
function previewRedeem(uint256 shares) public view virtual returns (uint256) {
return _convertToAssets(shares, Math.Rounding.Floor);
}
/// @inheritdoc IERC4626
function deposit(uint256 assets, address receiver) public virtual returns (uint256) {
uint256 maxAssets = maxDeposit(receiver);
if (assets > maxAssets) {
revert ERC4626ExceededMaxDeposit(receiver, assets, maxAssets);
}
uint256 shares = previewDeposit(assets);
_deposit(_msgSender(), receiver, assets, shares);
return shares;
}
/// @inheritdoc IERC4626
function mint(uint256 shares, address receiver) public virtual returns (uint256) {
uint256 maxShares = maxMint(receiver);
if (shares > maxShares) {
revert ERC4626ExceededMaxMint(receiver, shares, maxShares);
}
uint256 assets = previewMint(shares);
_deposit(_msgSender(), receiver, assets, shares);
return assets;
}
/// @inheritdoc IERC4626
function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) {
uint256 maxAssets = maxWithdraw(owner);
if (assets > maxAssets) {
revert ERC4626ExceededMaxWithdraw(owner, assets, maxAssets);
}
uint256 shares = previewWithdraw(assets);
_withdraw(_msgSender(), receiver, owner, assets, shares);
return shares;
}
/// @inheritdoc IERC4626
function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) {
uint256 maxShares = maxRedeem(owner);
if (shares > maxShares) {
revert ERC4626ExceededMaxRedeem(owner, shares, maxShares);
}
uint256 assets = previewRedeem(shares);
_withdraw(_msgSender(), receiver, owner, assets, shares);
return assets;
}
/**
* @dev Internal conversion function (from assets to shares) with support for rounding direction.
*/
function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual returns (uint256) {
return assets.mulDiv(totalSupply() + 10 ** _decimalsOffset(), totalAssets() + 1, rounding);
}
/**
* @dev Internal conversion function (from shares to assets) with support for rounding direction.
*/
function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual returns (uint256) {
return shares.mulDiv(totalAssets() + 1, totalSupply() + 10 ** _decimalsOffset(), rounding);
}
/**
* @dev Deposit/mint common workflow.
*/
function _deposit(address caller, address receiver, uint256 assets, uint256 shares) internal virtual {
// If asset() is ERC-777, `transferFrom` can trigger a reentrancy BEFORE the transfer happens through the
// `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,
// calls the vault, which is assumed not malicious.
//
// Conclusion: we need to do the transfer before we mint so that any reentrancy would happen before the
// assets are transferred and before the shares are minted, which is a valid state.
// slither-disable-next-line reentrancy-no-eth
SafeERC20.safeTransferFrom(IERC20(asset()), caller, address(this), assets);
_mint(receiver, shares);
emit Deposit(caller, receiver, assets, shares);
}
/**
* @dev Withdraw/redeem common workflow.
*/
function _withdraw(
address caller,
address receiver,
address owner,
uint256 assets,
uint256 shares
) internal virtual {
if (caller != owner) {
_spendAllowance(owner, caller, shares);
}
// If asset() is ERC-777, `transfer` can trigger a reentrancy AFTER the transfer happens through the
// `tokensReceived` hook. On the other hand, the `tokensToSend` hook, that is triggered before the transfer,
// calls the vault, which is assumed not malicious.
//
// Conclusion: we need to do the transfer after the burn so that any reentrancy would happen after the
// shares are burned and after the assets are transferred, which is a valid state.
_burn(owner, shares);
SafeERC20.safeTransfer(IERC20(asset()), receiver, assets);
emit Withdraw(caller, receiver, owner, assets, shares);
}
function _decimalsOffset() internal view virtual returns (uint8) {
return 0;
}
}// 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/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.3.0) (interfaces/IERC4626.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./IERC20Metadata.sol";
/**
* @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*/
interface IERC4626 is IERC20, IERC20Metadata {
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 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: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function deposit(uint256 assets, address receiver) external 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: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function mint(uint256 shares, address receiver) external 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 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 redemption 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);
}// 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
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import {ERC4626, SafeERC20, OwnableV2} from "./OwnableV2.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2StepV2 is OwnableV2 {
address internal _pendingOwner;
event OwnershipTransferStarted(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
// /**
// * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
// * Can only be called by the current owner.
// */
// function transferOwnership(address newOwner) public virtual override onlyOwner {
// _pendingOwner = newOwner;
// emit OwnershipTransferStarted(owner(), newOwner);
// }
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() external {
address sender = _msgSender();
require(
pendingOwner() == sender,
"Ownable2Step: caller is not the new owner"
);
_transferOwnership(sender);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ERC4626, SafeERC20, Ownable2StepV2} from "./Ownable2StepV2.sol";
contract OwnableDelayModuleV2 is Ownable2StepV2 {
address internal delayModule;
constructor() {
delayModule = msg.sender;
}
function isDelayModule() internal view {
require(msg.sender == delayModule, "NA");
}
function setDelayModule(address _delayModule) external {
isDelayModule();
require(_delayModule != address(0), "ODZ");
delayModule = _delayModule;
}
function getDelayModule() external view returns (address) {
return delayModule;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public override {
isDelayModule();
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./Context.sol";
import {ERC4626, SafeERC20} from "./ERC4626.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableV2 is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @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) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_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 {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// 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: GPL-3.0
pragma solidity ^0.8.0;
import "./Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// 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
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./draft-IERC20Permit.sol";
import "./Address.sol";
library SafeERC20 {
using Address for address;
error E1(); // approve from non-zero to non-zero
error E2(); // decreased allowance below zero
error E3(); // permit did not succeed
error E4(); // low-level call failed
error E5(); // ERC20 operation did not succeed
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_call(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_call(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
if(!((value == 0) || (token.allowance(address(this), spender) == 0))) revert E1();
_call(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_call(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
if(oldAllowance < value) revert E2();
uint256 newAllowance = oldAllowance - value;
_call(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
if(nonceAfter != nonceBefore + 1) revert E3();
}
function _call(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data);
if (returndata.length > 0) {
if(!abi.decode(returndata, (bool))) revert E5();
}
}
}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ERC20","name":"_underlyingToken","type":"address"},{"internalType":"address","name":"_atvVault","type":"address"},{"internalType":"address","name":"_atvStorage","type":"address"},{"internalType":"address","name":"_atvOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"E01","type":"error"},{"inputs":[],"name":"E02","type":"error"},{"inputs":[],"name":"E03","type":"error"},{"inputs":[],"name":"E04","type":"error"},{"inputs":[],"name":"E05","type":"error"},{"inputs":[],"name":"E06","type":"error"},{"inputs":[],"name":"E07","type":"error"},{"inputs":[],"name":"E08","type":"error"},{"inputs":[],"name":"E09","type":"error"},{"inputs":[],"name":"E10","type":"error"},{"inputs":[],"name":"E11","type":"error"},{"inputs":[],"name":"E12","type":"error"},{"inputs":[],"name":"E13","type":"error"},{"inputs":[],"name":"E14","type":"error"},{"inputs":[],"name":"E15","type":"error"},{"inputs":[],"name":"E16","type":"error"},{"inputs":[],"name":"E17","type":"error"},{"inputs":[],"name":"E18","type":"error"},{"inputs":[],"name":"E5","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":"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":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"extra","type":"uint256"}],"name":"AdjustExtraAsset","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":false,"internalType":"address","name":"_oldVault","type":"address"},{"indexed":false,"internalType":"address","name":"_newVault","type":"address"},{"indexed":false,"internalType":"uint256","name":"exchangedBalance","type":"uint256"}],"name":"CalledExchange","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":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endNAV","type":"uint256"}],"name":"EpochFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startNAV","type":"uint256"}],"name":"EpochStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"MaxCheckpointsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_oldVault","type":"address"},{"indexed":false,"internalType":"address","name":"_newVault","type":"address"}],"name":"MigrateVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":"bool","name":"_pauseDeposit","type":"bool"}],"name":"PauseUnpauseDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_controller","type":"address"}],"name":"SetController","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"checkpointCount","type":"uint256"}],"name":"TWABUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"epochId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"checkpointCount","type":"uint256"}],"name":"ThresholdExceeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_platformFee","type":"uint256"}],"name":"UpdatePlatformFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_platformWallet","type":"address"}],"name":"UpdatePlatformWallet","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":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStrayToken","type":"event"},{"inputs":[],"name":"ATV_VAULT","outputs":[{"internalType":"contract IAFi","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PLATFORM_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"adjustExtraVaultTokens","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":[],"name":"atvOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"atvStorage","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":"user","type":"address"},{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"calculateEpochReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"calculateNAV","outputs":[{"internalType":"uint256","name":"assetNAV","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"currentEpochId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadlineDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"epochs","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"startNAV","type":"uint256"},{"internalType":"uint256","name":"endNAV","type":"uint256"},{"internalType":"bool","name":"finalized","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"exchange","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalizeEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentEpoch","outputs":[{"components":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"startNAV","type":"uint256"},{"internalType":"uint256","name":"endNAV","type":"uint256"},{"internalType":"bool","name":"finalized","type":"bool"}],"internalType":"struct AtvWrappedBoosterTL.Epoch","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDelayModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"currentEpoch","type":"uint256"}],"name":"getLastEpochBeforeCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"epochId","type":"uint256"}],"name":"getUserCheckpoints","outputs":[{"components":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"accBal","type":"uint256"}],"internalType":"struct AtvWrappedBoosterTL.TWABCheckpoint[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"latestEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"address","name":"_vault","type":"address"}],"name":"migrateVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseDeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"pauseUnpauseDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"presentInEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delayModule","type":"address"}],"name":"setDelayModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalVaultTokenRec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"shares","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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLimit","type":"uint256"}],"name":"updateMaxCheckpoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformWallet","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"updatePlatformWalletAndFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_atvStorage","type":"address"},{"internalType":"address","name":"_atvOracle","type":"address"}],"name":"updateatvStorageAndOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userEpochIDs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userTWAB","outputs":[{"internalType":"uint256","name":"lastUpdateTime","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":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawStrayToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a0604052620186a0600a55610e1060105534801561001c575f5ffd5b5060405161403738038061403783398101604081905261003b91610595565b836040518060400160405280600e81526020016d6161726e6120617476205553444360901b815250604051806040016040528060078152602001666174765553444360c81b81525081600390816100929190610689565b50600461009f8282610689565b5050505f5f6100b38361019060201b60201c565b91509150816100c35760126100c5565b805b600580546001600160a01b039095166001600160a01b031960ff93909316600160a01b02929092166001600160a81b0319909516949094171790925550610113905061010e3390565b610266565b600880546001600160a81b0319163360ff60a01b191617905561013584610282565b61013e81610282565b6001600160a01b03848116608052600e80546001600160a01b031990811685841617909155600f80548216848416179055601480549091169185169190911790556101876102a9565b505050506107b8565b60408051600481526024810182526020810180516001600160e01b031663313ce56760e01b17905290515f918291829182916001600160a01b038716916101d691610743565b5f60405180830381855afa9150503d805f811461020e576040519150601f19603f3d011682016040523d82523d5f602084013e610213565b606091505b509150915081801561022757506020815110155b1561025a575f818060200190518101906102419190610759565b905060ff8111610258576001969095509350505050565b505b505f9485945092505050565b600780546001600160a01b031916905561027f81610401565b50565b6001600160a01b03811661027f57604051630f968f2560e31b815260040160405180910390fd5b5f6102b2610452565b6040805160a081018252428082525f60208084018281528486018781526060860184815260808701858152601380546001810182559681905297517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09060059097029687015592517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09186015590517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a092850155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a093840155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a094909201805460ff1916921515929092179091559154600b8190558351918252918101849052929350917f29db3deb62ef2036e5eb93aad68d2362aec0711af592cb365566603bd88651d4910160405180910390a250565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b601454604080516318160ddd60e01b815290515f926001600160a01b031691839183916318160ddd9160048083019260209291908290030181865afa15801561049d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104c19190610759565b90506104cc81610562565b600e54604051634aaad50560e11b81526001600160a01b03848116600483015283926b033b2e3c9fd0803ce800000092911690639555aa0a90602401602060405180830381865afa158015610523573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105479190610759565b6105519190610770565b61055b9190610799565b9250505090565b805f0361027f57604051622a0bd760e81b815260040160405180910390fd5b6001600160a01b038116811461027f575f5ffd5b5f5f5f5f608085870312156105a8575f5ffd5b84516105b381610581565b60208601519094506105c481610581565b60408601519093506105d581610581565b60608601519092506105e681610581565b939692955090935050565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061061957607f821691505b60208210810361063757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561068457805f5260205f20601f840160051c810160208510156106625750805b601f840160051c820191505b81811015610681575f815560010161066e565b50505b505050565b81516001600160401b038111156106a2576106a26105f1565b6106b6816106b08454610605565b8461063d565b6020601f8211600181146106e8575f83156106d15750848201515b5f19600385901b1c1916600184901b178455610681565b5f84815260208120601f198516915b8281101561071757878501518255602094850194600190920191016106f7565b508482101561073457868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f82518060208501845e5f920191825250919050565b5f60208284031215610769575f5ffd5b5051919050565b808202811582820484141761079357634e487b7160e01b5f52601160045260245ffd5b92915050565b5f826107b357634e487b7160e01b5f52601260045260245ffd5b500490565b6080516138366108015f395f818161113701528181611200015281816119030152818161196e015281816119d201528181611a5f01528181611a950152611f8401526138365ff3fe608060405234801561000f575f5ffd5b50600436106103e0575f3560e01c806384da34371161020b578063c6e6f5921161011f578063de5ccee8116100b4578063f0c6a61c11610084578063f0c6a61c146108e2578063f2fde38b146108f5578063f559171414610908578063f77c47911461091b578063fa2af9da1461092e575f5ffd5b8063de5ccee8146108a2578063e30c3978146108b5578063eacdc5ff146108c6578063ef8b30f7146108cf575f5ffd5b8063d889959c116100ef578063d889959c14610821578063d905777e1461082a578063db20300c1461083d578063dd62ed3e1461086a575f5ffd5b8063c6e6f592146107e1578063ce96cb77146107f4578063d38db60514610807578063d7f5870314610810575f5ffd5b8063a9059cbb116101a0578063b97dd9e211610170578063b97dd9e214610738578063ba08765214610783578063c4aa09d314610791578063c63d75b614610526578063c6b61e4c146107a4575f5ffd5b8063a9059cbb146106ec578063afb40cba146106ff578063b3d7f6b914610712578063b460af9414610725575f5ffd5b806394bf804d116101db57806394bf804d1461069157806395d89b41146106a45780639f20a4b5146106ac578063a7f52223146106d9575f5ffd5b806384da34371461064757806386a0da731461065a5780638da5cb5b1461066d57806392eefe9b1461067e575f5ffd5b80633f4ba83a1161030257806366dfa7c711610297578063715018a611610267578063715018a61461061f57806379ba50971461062757806382ae9ef71461062f5780638456cb5914610637578063847b23451461063f575f5ffd5b806366dfa7c7146105c457806369026e88146105d75780636e553f65146105e457806370a08231146105f7575f5ffd5b80634cdad506116102d25780634cdad5061461056d578063537390ef14610580578063589e91401461059f5780635c975abb146105b2575f5ffd5b80633f4ba83a1461051e578063402d267d14610526578063444184731461053a5780634ad009ce1461055a575f5ffd5b806323b872dd11610378578063313ce56711610348578063313ce567146104c457806333b39792146104de57806338d52e0f146104f15780633998a68114610516575f5ffd5b806323b872dd1461048057806326232a2e146104935780632712b5391461049c5780632fe2a3a5146104b1575f5ffd5b80630a28a477116103b35780630a28a4771461044a5780630fe2abcf1461045d57806311ebc6191461047057806318160ddd14610478575f5ffd5b806301e1d114146103e457806306fdde03146103ff57806307a2d13a14610414578063095ea7b314610427575b5f5ffd5b6103ec610941565b6040519081526020015b60405180910390f35b610407610967565b6040516103f6919061325a565b6103ec61042236600461328f565b6109f7565b61043a6104353660046132ba565b610a08565b60405190151581526020016103f6565b6103ec61045836600461328f565b610a1f565b6103ec61046b3660046132e4565b610a51565b6103ec610b16565b6002546103ec565b61043a61048e366004613312565b610c26565b6103ec60095481565b6104af6104aa366004613350565b610c55565b005b6104af6104bf36600461336b565b610d60565b6104cc610d9f565b60405160ff90911681526020016103f6565b6104af6104ec366004613350565b610dab565b6005546001600160a01b03165b6040516001600160a01b0390911681526020016103f6565b6103ec60c881565b6104af610e56565b6103ec610534366004613350565b505f1990565b61054d6105483660046132ba565b610e68565b6040516103f69190613397565b600f546104fe906001600160a01b031681565b6103ec61057b36600461328f565b610f00565b6103ec61058e366004613350565b60126020525f908152604090205481565b6104af6105ad3660046132ba565b610f34565b600854600160a01b900460ff1661043a565b6103ec6105d23660046132ba565b610fac565b60115461043a9060ff1681565b6103ec6105f23660046132e4565b6110f3565b6103ec610605366004613350565b6001600160a01b03165f9081526020819052604090205490565b6104af611278565b6104af611289565b6104af611308565b6104af6113ca565b6104af6113da565b600e546104fe906001600160a01b031681565b6104af610668366004613402565b61158e565b6006546001600160a01b03166104fe565b6104af61068c366004613350565b6115e4565b6103ec61069f3660046132e4565b611643565b61040761165d565b61043a6106ba3660046132ba565b601760209081525f928352604080842090915290825290205460ff1681565b6103ec6106e73660046132ba565b61166c565b61043a6106fa3660046132ba565b611787565b6103ec61070d3660046132ba565b61179e565b6103ec61072036600461328f565b6117c9565b6103ec61073336600461341d565b6117ec565b610740611aca565b6040516103f691905f60a0820190508251825260208301516020830152604083015160408301526060830151606083015260808301511515608083015292915050565b6103ec61069f36600461341d565b6104af61079f366004613350565b611b44565b6107b76107b236600461328f565b611baa565b6040805195865260208601949094529284019190915260608301521515608082015260a0016103f6565b6103ec6107ef36600461328f565b611bec565b6103ec610802366004613350565b611bf6565b6103ec60105481565b6008546001600160a01b03166104fe565b6103ec60155481565b6103ec610838366004613350565b611c17565b6103ec61084b3660046132ba565b601860209081525f928352604080842090915290825290206001015481565b6103ec61087836600461336b565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6104af6108b036600461328f565b611c34565b6007546001600160a01b03166104fe565b6103ec600b5481565b6103ec6108dd36600461328f565b611c80565b6014546104fe906001600160a01b031681565b6104af610903366004613350565b611c8b565b6104af610916366004613350565b611cfc565b600d546104fe906001600160a01b031681565b600c546104fe906001600160a01b031681565b6014545f906109629061095c906001600160a01b0316611d92565b5f611dfa565b905090565b6060600380546109769061345c565b80601f01602080910402602001604051908101604052809291908181526020018280546109a29061345c565b80156109ed5780601f106109c4576101008083540402835291602001916109ed565b820191905f5260205f20905b8154815290600101906020018083116109d057829003601f168201915b5050505050905090565b5f610a02825f611dfa565b92915050565b5f33610a15818585611e2e565b5060019392505050565b5f600954612710610a3091906134a8565b610a3c836127106134bb565b610a4691906134d2565b9150610a0282611e40565b5f610a5a611e8e565b610a6383611eb9565b60115460ff1615610a87576040516380c4f80160e01b815260040160405180910390fd5b6014546001600160a01b03165f610a9d82611d92565b9050610aab82333088611ed8565b5f610ab68383611f49565b90505f5f610ac2611f6a565b909250905081610ad382600a6135d4565b610add90856134bb565b610ae791906134d2565b92505f610afc84610af6610b16565b5f612000565b9050610b0984828a612075565b5091979650505050505050565b601454604080516318160ddd60e01b815290515f926001600160a01b031691839183916318160ddd9160048083019260209291908290030181865afa158015610b61573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8591906135df565b9050610b9081611eb9565b600e54604051634aaad50560e11b81526001600160a01b03848116600483015283926b033b2e3c9fd0803ce800000092911690639555aa0a90602401602060405180830381865afa158015610be7573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c0b91906135df565b610c1591906134bb565b610c1f91906134d2565b9250505090565b5f33610c33858285612104565b610c3e85858561217a565b610c4885856121d7565b60019150505b9392505050565b610c5d612231565b610c6561228b565b60145460408051639705f8f960e01b815290516001600160a01b0392831692839290851691639705f8f9916004808201926020929091908290030181865afa158015610cb3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cd79190613606565b6001600160a01b031614610cfd576040516220adef60e41b815260040160405180910390fd5b601480546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915282917f7ed08ba1ddf6d6b5f7ba82d362656040b4e9f5f3e90cf84575be3855b39a18a491015b60405180910390a1505050565b610d68612231565b610d71826122b5565b600e80546001600160a01b039384166001600160a01b031991821617909155600f8054929093169116179055565b5f610962816012613621565b610db3612231565b6014545f90610dca906001600160a01b0316611d92565b90506015548111610dee576040516301899ea960e01b815260040160405180910390fd5b5f60155482610dfd91906134a8565b601454909150610e17906001600160a01b031684836122dc565b604080516001600160a01b0385168152602081018390527fbd6c5c3d9f6256e77a4049dceca2de0c012c29e11877a863fbcc04bc9c966cd89101610d53565b610e5e612231565b610e6661230c565b565b6001600160a01b0382165f9081526018602090815260408083208484528252808320805482518185028101850190935280835260609492939192909184015b82821015610ef4578382905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505081526020019060010190610ea7565b50505050905092915050565b5f612710600954612710610f1491906134a8565b610f1e90846134bb565b610f2891906134d2565b9150610a02825f611dfa565b610f3c612231565b600c80546001600160a01b0319166001600160a01b038416179055610f628160c8612361565b6009819055600c546040516001600160a01b0390911681527f64c7017e0d89b07b60fcd49444429ea86c712427960bc73bd714607eb8a5c592906020015b60405180910390a15050565b5f811580610fbb575060135482115b15610fd9576040516306130d9960e01b815260040160405180910390fd5b5f6013610fe76001856134a8565b81548110610ff757610ff761363a565b5f9182526020918290206040805160a0810182526005909302909101805483526001810154938301939093526002830154908201526003820154606082015260049091015460ff1615156080820181905290915061106857604051635b85f48960e11b815260040160405180910390fd5b8060400151816060015111611080575f915050610a02565b5f61108b8585612382565b9050805f036110b15761109e8585612552565b9050805f036110b1575f92505050610a02565b5f826040015183606001516110c691906134a8565b90506b033b2e3c9fd0803ce80000006110df82846134bb565b6110e991906134d2565b9695505050505050565b5f6110fc611e8e565b61110583611eb9565b60115460ff1615611129576040516380c4f80160e01b815260040160405180910390fd5b6014546001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000005f61116083611d92565b905061116e82333089611ed8565b60405163095ea7b360e01b81526001600160a01b0384811660048301526024820188905283169063095ea7b3906044016020604051808303815f875af11580156111ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111de919061364e565b50601454604051636e553f6560e01b8152600481018890526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116602483015290911690636e553f65906044015f604051808303815f87803b15801561124a575f5ffd5b505af115801561125c573d5f5f3e3d5ffd5b505050505f61126b8483611f49565b90506110e9818888612075565b611280612231565b610e665f6125bf565b60075433906001600160a01b031681146112fc5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b611305816125bf565b50565b600d5461131f9033906001600160a01b03166125d8565b5f61132861260a565b600481015490915060ff1615611351576040516340079e1f60e11b815260040160405180910390fd5b42600182015561135f610b16565b6003820181905560048201805460ff19166001908117909155600b549083015460405191927fb463d19ecf455be65365092cf8e1db6934a0334cf8cd532ddf9964d01f36b5b2926113ba929190918252602082015260400190565b60405180910390a261130561266d565b6113d2612231565b610e666127c5565b6113e2612231565b6113ea61228b565b60145460408051639705f8f960e01b815290515f926001600160a01b031691639705f8f99160048083019260209291908290030181865afa158015611431573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114559190613606565b6014549091506001600160a01b03165f61146e83611d92565b60405163095ea7b360e01b81526001600160a01b038481166004830152602482018390529192509084169063095ea7b3906044016020604051808303815f875af11580156114be573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114e2919061364e565b5060145f9054906101000a90046001600160a01b03166001600160a01b031663a25eb5d96040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561152f575f5ffd5b505af1158015611541573d5f5f3e3d5ffd5b5050604080516001600160a01b038088168252861660208201529081018490527f8f89a6ff2401b99707423810461bb39d138c8e4150f4ddaf934eb3e4895c5bdb92506060019050610d53565b611596612231565b6011805460ff191682151590811790915560405160ff909116151581527f96bbbe0790c74fdc0ee8ce14e7fc21605a5b5588585e1a5ede1848a5f2446c91906020015b60405180910390a150565b6115ec612231565b6115f5816122b5565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70906020016115d9565b5f6040516302b0eba760e21b815260040160405180910390fd5b6060600480546109769061345c565b6001600160a01b0382165f908152601660209081526040808320805482518185028101850190935280835284938301828280156116c657602002820191905f5260205f20905b8154815260200190600101908083116116b2575b505050505090505f81519050805f036116e3575f92505050610a02565b5f815b80821015611744575f60026116fb8385613669565b61170591906134d2565b90508685828151811061171a5761171a61363a565b6020026020010151101561173a57611733816001613669565b925061173e565b8091505b506116e6565b815f03611757575f945050505050610a02565b836117636001846134a8565b815181106117735761177361363a565b602002602001015194505050505092915050565b5f3361179481858561217a565b610a1533856121d7565b6016602052815f5260405f2081815481106117b7575f80fd5b905f5260205f20015f91509150505481565b5f60636117d7836001611dfa565b6117e29060646134bb565b610a0291906134d2565b5f6117f5611e8e565b6117fe84611eb9565b336001600160a01b0383161461181957611819823386612104565b5f611823856109f7565b90505f61182f84611bf6565b90508082111561186b57604051633fa733bb60e21b81526001600160a01b038516600482015260248101839052604481018290526064016112f3565b6118758487612808565b8560155f82825461188691906134a8565b909155505060408051838152602081018890526001600160a01b03868116929088169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46118fd846118f8866001600160a01b03165f9081526020819052604090205490565b61283c565b5f6119277f0000000000000000000000000000000000000000000000000000000000000000611d92565b90505f601054426119389190613669565b90505f611943612be8565b6014546040516353798fa160e11b81529192506001600160a01b03169063a6f31f429061199f908c907f000000000000000000000000000000000000000000000000000000000000000090879087906003908d9060040161367c565b5f604051808303815f87803b1580156119b6575f5ffd5b505af11580156119c8573d5f5f3e3d5ffd5b505050505f6119f77f000000000000000000000000000000000000000000000000000000000000000085611f49565b9050611a0586821015612cad565b5f61271060095483611a1791906134bb565b611a2191906134d2565b90505f81118015611a3c5750600c546001600160a01b031615155b15611a8857611a4b81836134a8565b600c54909250611a88906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169116836122dc565b611abc6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168b846122dc565b509998505050505050505050565b611af96040518060a001604052805f81526020015f81526020015f81526020015f81526020015f151581525090565b611b0161260a565b6040805160a08101825282548152600183015460208201526002830154918101919091526003820154606082015260049091015460ff1615156080820152919050565b611b4c612ccb565b6001600160a01b038116611b885760405162461bcd60e51b815260206004820152600360248201526227a22d60e91b60448201526064016112f3565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60138181548110611bb9575f80fd5b5f918252602090912060059091020180546001820154600283015460038401546004909401549294509092909160ff1685565b5f610a0282611e40565b6001600160a01b0381165f90815260208190526040812054610a029061095c565b6001600160a01b0381165f90815260208190526040812054610a02565b611c3c612231565b611c4b81600a620186a0612d0a565b600a8190556040518181527fd42d864ef8cabceabca3a2e3b88f94701b5030fa577025e56e4701b46ec079d0906020016115d9565b5f610a02825f612d35565b611c93612ccb565b600780546001600160a01b0383166001600160a01b03199091168117909155611cc46006546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611d04612231565b6014546001600160a01b0390811690821603611d335760405163e217c62b60e01b815260040160405180910390fd5b5f611d3d82611d92565b9050611d536001600160a01b03831633836122dc565b604080516001600160a01b0384168152602081018390527f9fb26a02b945f9b4267da962d25482e9880f19d03f92cff89e451fa3d21972409101610fa0565b6040516370a0823160e01b81523060048201525f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611dd6573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0291906135df565b5f5f5f611e05611f6a565b915091505f611e1686610af6610b16565b905082611e2483600a6135d4565b6110df90836134bb565b611e3b8383836001612d8a565b505050565b5f5f5f611e4b611f6a565b90925090505f611e5c82600a6135d4565b611e6684876134bb565b611e7091906134d2565b9050611e8581611e7e610b16565b6001612000565b95945050505050565b600854600160a01b900460ff1615610e665760405163d93c066560e01b815260040160405180910390fd5b805f0361130557604051622a0bd760e81b815260040160405180910390fd5b6040516001600160a01b0380851660248301528316604482015260648101829052611f439085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612e5c565b50505050565b5f5f82611f5585611d92565b611f5f91906134a8565b9050610c4e81611eb9565b600f54604051630226614760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f9283929116906302266147906024016040805180830381865afa158015611fd4573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ff891906136e9565b915091509091565b5f811561203e578261201e6b033b2e3c9fd0803ce8000000866134bb565b61202d9064e8d4a510006134bb565b61203791906134d2565b9050610c4e565b6120596b033b2e3c9fd0803ce800000064e8d4a510006134bb565b61206384866134bb565b61206d91906134d2565b949350505050565b8260155f8282546120869190613669565b9091555061209690508184612eab565b6120b8816118f8836001600160a01b03165f9081526020819052604090205490565b60408051838152602081018590526001600160a01b0383169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791015b60405180910390a3505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811015611f43578181101561216c57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016112f3565b611f4384848484035f612d8a565b6001600160a01b0383166121a357604051634b637e8f60e11b81525f60048201526024016112f3565b6001600160a01b0382166121cc5760405163ec442f0560e01b81525f60048201526024016112f3565b611e3b838383612edb565b6121df611e8e565b6121e98282612ff4565b61220b826118f8846001600160a01b03165f9081526020819052604090205490565b61222d816118f8836001600160a01b03165f9081526020819052604090205490565b5050565b6006546001600160a01b03163314610e665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112f3565b600854600160a01b900460ff16610e6657604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b03811661130557604051630f968f2560e31b815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052611e3b90849063a9059cbb60e01b90606401611f0c565b61231461228b565b6008805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8082111561222d5760405163304ec58360e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602090815260408083208484528252808320815181546060948102820185018452928101838152859491938492849190879085015b82821015612414578382905f5260205f2090600302016040518060600160405290815f820154815260200160018201548152602001600282015481525050815260200190600101906123c7565b5050505081526020016001820154815250509050805f0151515f0361243c575f915050610a02565b5f601361244a6001866134a8565b8154811061245a5761245a61363a565b5f91825260208083206040805160a08101825260059094029091018054845260018082015493850193909352600281015491840191909152600381015460608401526004015460ff161515608083015284518051929450916124bc91906134a8565b815181106124cc576124cc61363a565b602002602001015190505f816040015190505f825f015184602001516124f291906134a8565b905080836020015161250491906134bb565b61250e9083613669565b91505f845f0151856020015161252491906134a8565b9050805f0361253b575f9650505050505050610a02565b61254581846134d2565b9998505050505050505050565b5f5f61255e848461166c565b9050805f03612570575f915050610a02565b6001600160a01b0384165f9081526018602090815260408083208484529091528120805490918190036125a8575f9350505050610a02565b6125b182613026565b600101549695505050505050565b600780546001600160a01b03191690556113058161305b565b806001600160a01b0316826001600160a01b03161461222d57604051634983312960e11b815260040160405180910390fd5b6013545f9061261a906001613669565b600b541061263b57604051633c96bfd560e11b815260040160405180910390fd5b60136001600b5461264c91906134a8565b8154811061265c5761265c61363a565b905f5260205f209060050201905090565b5f612676610b16565b6040805160a081018252428082525f60208084018281528486018781526060860184815260808701858152601380546001810182559681905297517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09060059097029687015592517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09186015590517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a092850155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a093840155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a094909201805460ff1916921515929092179091559154600b8190558351918252918101849052929350917f29db3deb62ef2036e5eb93aad68d2362aec0711af592cb365566603bd88651d4910160405180910390a250565b6127cd611e8e565b6008805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586123443390565b6001600160a01b03821661283157604051634b637e8f60e11b81525f60048201526024016112f3565b61222d825f83612edb565b6001600160a01b0382165f908152601860209081526040808320600b54845290915281208054909142911561290d575f61287584613026565b805490915061288490846134a8565b915081156128ff57835f0160405180606001604052808581526020018781526020018484600101546128b691906134bb565b84600201546128c59190613669565b90528154600181810184555f9384526020938490208351600390930201918255928201519281019290925560400151600290910155612907565b600181018590555b50612ab3565b6001600160a01b0385165f9081526012602052604090205415612a6d576001600160a01b0385165f90815260186020908152604080832060128352818420548452909152812080549091908290612966906001906134a8565b815481106129765761297661363a565b905f5260205f20906003020190505f60136001600b5461299691906134a8565b815481106129a6576129a661363a565b5f9182526020918290206040805160a08101825260059093029091018054808452600182015494840194909452600281015491830191909152600381015460608301526004015460ff16151560808201529150612a0390866134a8565b9350855f016040518060600160405280878152602001898152602001868560010154612a2f91906134bb565b90528154600181810184555f938452602093849020835160039093020191825592820151928101929092556040015160029091015550612ab3915050565b6040805160608101825283815260208082018781525f938301848152875460018181018a5589875293909520935160039095029093019384555190830155516002909101555b60018301829055600b546001600160a01b0386165f90815260126020908152604080832084905560178252808320938352929052205460ff16612b41576001600160a01b0385165f818152601760209081526040808320600b80548552908352818420805460ff19166001908117909155948452601683529083209054815494850182559083529120909101555b600a54835410612b8f57600b5483546040519081526001600160a01b038716907f81fa37560513d551c71bcabf4a2700eb792debb57f4e9879a5dd882040f3431a9060200160405180910390a35b600b5483546040805187815260208101869052908101919091526001600160a01b038716907f64bf20d81818c8d606b5801b3537bbcb1dc4a052a21965e300a7bcbcb37a16e59060600160405180910390a35050505050565b60605f60145f9054906101000a90046001600160a01b03166001600160a01b031663292252886040518163ffffffff1660e01b81526004015f60405180830381865afa158015612c3a573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052612c61919081019061371f565b5190508067ffffffffffffffff811115612c7d57612c7d61370b565b604051908082528060200260200182016040528015612ca6578160200160208202803683370190505b5091505090565b806113055760405163066d598f60e41b815260040160405180910390fd5b6008546001600160a01b03163314610e665760405162461bcd60e51b81526020600482015260026024820152614e4160f01b60448201526064016112f3565b81831080612d1757508083115b15611e3b57604051630a8fcb4f60e21b815260040160405180910390fd5b5f5f5f612d40611f6a565b9092509050612d506064866134d2565b612d5a90866134a8565b94505f612d6882600a6135d4565b612d7284886134bb565b612d7c91906134d2565b90506110e981611e7e610b16565b6001600160a01b038416612db35760405163e602df0560e01b81525f60048201526024016112f3565b6001600160a01b038316612ddc57604051634a1406b160e11b81525f60048201526024016112f3565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611f4357826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051612e4e91815260200190565b60405180910390a350505050565b5f612e706001600160a01b038416836130ac565b805190915015611e3b5780806020019051810190612e8e919061364e565b611e3b576040516388d0662b60e01b815260040160405180910390fd5b6001600160a01b038216612ed45760405163ec442f0560e01b81525f60048201526024016112f3565b61222d5f83835b6001600160a01b038316612f05578060025f828254612efa9190613669565b90915550612f759050565b6001600160a01b0383165f9081526020819052604090205481811015612f575760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016112f3565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216612f9157600280548290039055612faf565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516120f791815260200190565b806001600160a01b0316826001600160a01b03160361222d576040516378f927ad60e11b815260040160405180910390fd5b80545f908290613038906001906134a8565b815481106130485761304861363a565b905f5260205f2090600302019050919050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6060610c4e83835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525060608247101561314b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016112f3565b5f5f866001600160a01b0316858760405161316691906137ea565b5f6040518083038185875af1925050503d805f81146131a0576040519150601f19603f3d011682016040523d82523d5f602084013e6131a5565b606091505b50915091506131b6878383876131c1565b979650505050505050565b6060831561322f5782515f03613228576001600160a01b0385163b6132285760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016112f3565b508161206d565b61206d83838151156132445781518083602001fd5b8060405162461bcd60e51b81526004016112f391905b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f6020828403121561329f575f5ffd5b5035919050565b6001600160a01b0381168114611305575f5ffd5b5f5f604083850312156132cb575f5ffd5b82356132d6816132a6565b946020939093013593505050565b5f5f604083850312156132f5575f5ffd5b823591506020830135613307816132a6565b809150509250929050565b5f5f5f60608486031215613324575f5ffd5b833561332f816132a6565b9250602084013561333f816132a6565b929592945050506040919091013590565b5f60208284031215613360575f5ffd5b8135610c4e816132a6565b5f5f6040838503121561337c575f5ffd5b8235613387816132a6565b91506020830135613307816132a6565b602080825282518282018190525f918401906040840190835b818110156133ea578351805184526020810151602085015260408101516040850152506060830192506020840193506001810190506133b0565b509095945050505050565b8015158114611305575f5ffd5b5f60208284031215613412575f5ffd5b8135610c4e816133f5565b5f5f5f6060848603121561342f575f5ffd5b833592506020840135613441816132a6565b91506040840135613451816132a6565b809150509250925092565b600181811c9082168061347057607f821691505b60208210810361348e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610a0257610a02613494565b8082028115828204841417610a0257610a02613494565b5f826134ec57634e487b7160e01b5f52601260045260245ffd5b500490565b6001815b600184111561352c5780850481111561351057613510613494565b600184161561351e57908102905b60019390931c9280026134f5565b935093915050565b5f8261354257506001610a02565b8161354e57505f610a02565b8160018114613564576002811461356e5761358a565b6001915050610a02565b60ff84111561357f5761357f613494565b50506001821b610a02565b5060208310610133831016604e8410600b84101617156135ad575081810a610a02565b6135b95f1984846134f1565b805f19048211156135cc576135cc613494565b029392505050565b5f610c4e8383613534565b5f602082840312156135ef575f5ffd5b5051919050565b8051613601816132a6565b919050565b5f60208284031215613616575f5ffd5b8151610c4e816132a6565b60ff8181168382160190811115610a0257610a02613494565b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561365e575f5ffd5b8151610c4e816133f5565b80820180821115610a0257610a02613494565b5f60c0820188835260018060a01b038816602084015286604084015260c0606084015280865180835260e0850191506020880192505f5b818110156136d15783518352602093840193909201916001016136b3565b50506080840195909552505060a00152949350505050565b5f5f604083850312156136fa575f5ffd5b505080516020909101519092909150565b634e487b7160e01b5f52604160045260245ffd5b5f6020828403121561372f575f5ffd5b815167ffffffffffffffff811115613745575f5ffd5b8201601f81018413613755575f5ffd5b805167ffffffffffffffff81111561376f5761376f61370b565b8060051b604051601f19603f830116810181811067ffffffffffffffff8211171561379c5761379c61370b565b6040529182526020818401810192908101878411156137b9575f5ffd5b6020850194505b838510156137df576137d1856135f6565b8152602094850194016137c0565b509695505050505050565b5f82518060208501845e5f92019182525091905056fea2646970667358221220eca00774742f699fbaec134dcf523f837276d5bd6c9f710a9237008d5f1ed77b64736f6c634300081e0033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba000000000000000000000000ceb202d3075be4abd24865fd8f307374923948ad0000000000000000000000006936df2d345605b3af42b880660b9717f2ae66dd
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106103e0575f3560e01c806384da34371161020b578063c6e6f5921161011f578063de5ccee8116100b4578063f0c6a61c11610084578063f0c6a61c146108e2578063f2fde38b146108f5578063f559171414610908578063f77c47911461091b578063fa2af9da1461092e575f5ffd5b8063de5ccee8146108a2578063e30c3978146108b5578063eacdc5ff146108c6578063ef8b30f7146108cf575f5ffd5b8063d889959c116100ef578063d889959c14610821578063d905777e1461082a578063db20300c1461083d578063dd62ed3e1461086a575f5ffd5b8063c6e6f592146107e1578063ce96cb77146107f4578063d38db60514610807578063d7f5870314610810575f5ffd5b8063a9059cbb116101a0578063b97dd9e211610170578063b97dd9e214610738578063ba08765214610783578063c4aa09d314610791578063c63d75b614610526578063c6b61e4c146107a4575f5ffd5b8063a9059cbb146106ec578063afb40cba146106ff578063b3d7f6b914610712578063b460af9414610725575f5ffd5b806394bf804d116101db57806394bf804d1461069157806395d89b41146106a45780639f20a4b5146106ac578063a7f52223146106d9575f5ffd5b806384da34371461064757806386a0da731461065a5780638da5cb5b1461066d57806392eefe9b1461067e575f5ffd5b80633f4ba83a1161030257806366dfa7c711610297578063715018a611610267578063715018a61461061f57806379ba50971461062757806382ae9ef71461062f5780638456cb5914610637578063847b23451461063f575f5ffd5b806366dfa7c7146105c457806369026e88146105d75780636e553f65146105e457806370a08231146105f7575f5ffd5b80634cdad506116102d25780634cdad5061461056d578063537390ef14610580578063589e91401461059f5780635c975abb146105b2575f5ffd5b80633f4ba83a1461051e578063402d267d14610526578063444184731461053a5780634ad009ce1461055a575f5ffd5b806323b872dd11610378578063313ce56711610348578063313ce567146104c457806333b39792146104de57806338d52e0f146104f15780633998a68114610516575f5ffd5b806323b872dd1461048057806326232a2e146104935780632712b5391461049c5780632fe2a3a5146104b1575f5ffd5b80630a28a477116103b35780630a28a4771461044a5780630fe2abcf1461045d57806311ebc6191461047057806318160ddd14610478575f5ffd5b806301e1d114146103e457806306fdde03146103ff57806307a2d13a14610414578063095ea7b314610427575b5f5ffd5b6103ec610941565b6040519081526020015b60405180910390f35b610407610967565b6040516103f6919061325a565b6103ec61042236600461328f565b6109f7565b61043a6104353660046132ba565b610a08565b60405190151581526020016103f6565b6103ec61045836600461328f565b610a1f565b6103ec61046b3660046132e4565b610a51565b6103ec610b16565b6002546103ec565b61043a61048e366004613312565b610c26565b6103ec60095481565b6104af6104aa366004613350565b610c55565b005b6104af6104bf36600461336b565b610d60565b6104cc610d9f565b60405160ff90911681526020016103f6565b6104af6104ec366004613350565b610dab565b6005546001600160a01b03165b6040516001600160a01b0390911681526020016103f6565b6103ec60c881565b6104af610e56565b6103ec610534366004613350565b505f1990565b61054d6105483660046132ba565b610e68565b6040516103f69190613397565b600f546104fe906001600160a01b031681565b6103ec61057b36600461328f565b610f00565b6103ec61058e366004613350565b60126020525f908152604090205481565b6104af6105ad3660046132ba565b610f34565b600854600160a01b900460ff1661043a565b6103ec6105d23660046132ba565b610fac565b60115461043a9060ff1681565b6103ec6105f23660046132e4565b6110f3565b6103ec610605366004613350565b6001600160a01b03165f9081526020819052604090205490565b6104af611278565b6104af611289565b6104af611308565b6104af6113ca565b6104af6113da565b600e546104fe906001600160a01b031681565b6104af610668366004613402565b61158e565b6006546001600160a01b03166104fe565b6104af61068c366004613350565b6115e4565b6103ec61069f3660046132e4565b611643565b61040761165d565b61043a6106ba3660046132ba565b601760209081525f928352604080842090915290825290205460ff1681565b6103ec6106e73660046132ba565b61166c565b61043a6106fa3660046132ba565b611787565b6103ec61070d3660046132ba565b61179e565b6103ec61072036600461328f565b6117c9565b6103ec61073336600461341d565b6117ec565b610740611aca565b6040516103f691905f60a0820190508251825260208301516020830152604083015160408301526060830151606083015260808301511515608083015292915050565b6103ec61069f36600461341d565b6104af61079f366004613350565b611b44565b6107b76107b236600461328f565b611baa565b6040805195865260208601949094529284019190915260608301521515608082015260a0016103f6565b6103ec6107ef36600461328f565b611bec565b6103ec610802366004613350565b611bf6565b6103ec60105481565b6008546001600160a01b03166104fe565b6103ec60155481565b6103ec610838366004613350565b611c17565b6103ec61084b3660046132ba565b601860209081525f928352604080842090915290825290206001015481565b6103ec61087836600461336b565b6001600160a01b039182165f90815260016020908152604080832093909416825291909152205490565b6104af6108b036600461328f565b611c34565b6007546001600160a01b03166104fe565b6103ec600b5481565b6103ec6108dd36600461328f565b611c80565b6014546104fe906001600160a01b031681565b6104af610903366004613350565b611c8b565b6104af610916366004613350565b611cfc565b600d546104fe906001600160a01b031681565b600c546104fe906001600160a01b031681565b6014545f906109629061095c906001600160a01b0316611d92565b5f611dfa565b905090565b6060600380546109769061345c565b80601f01602080910402602001604051908101604052809291908181526020018280546109a29061345c565b80156109ed5780601f106109c4576101008083540402835291602001916109ed565b820191905f5260205f20905b8154815290600101906020018083116109d057829003601f168201915b5050505050905090565b5f610a02825f611dfa565b92915050565b5f33610a15818585611e2e565b5060019392505050565b5f600954612710610a3091906134a8565b610a3c836127106134bb565b610a4691906134d2565b9150610a0282611e40565b5f610a5a611e8e565b610a6383611eb9565b60115460ff1615610a87576040516380c4f80160e01b815260040160405180910390fd5b6014546001600160a01b03165f610a9d82611d92565b9050610aab82333088611ed8565b5f610ab68383611f49565b90505f5f610ac2611f6a565b909250905081610ad382600a6135d4565b610add90856134bb565b610ae791906134d2565b92505f610afc84610af6610b16565b5f612000565b9050610b0984828a612075565b5091979650505050505050565b601454604080516318160ddd60e01b815290515f926001600160a01b031691839183916318160ddd9160048083019260209291908290030181865afa158015610b61573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8591906135df565b9050610b9081611eb9565b600e54604051634aaad50560e11b81526001600160a01b03848116600483015283926b033b2e3c9fd0803ce800000092911690639555aa0a90602401602060405180830381865afa158015610be7573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c0b91906135df565b610c1591906134bb565b610c1f91906134d2565b9250505090565b5f33610c33858285612104565b610c3e85858561217a565b610c4885856121d7565b60019150505b9392505050565b610c5d612231565b610c6561228b565b60145460408051639705f8f960e01b815290516001600160a01b0392831692839290851691639705f8f9916004808201926020929091908290030181865afa158015610cb3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cd79190613606565b6001600160a01b031614610cfd576040516220adef60e41b815260040160405180910390fd5b601480546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915282917f7ed08ba1ddf6d6b5f7ba82d362656040b4e9f5f3e90cf84575be3855b39a18a491015b60405180910390a1505050565b610d68612231565b610d71826122b5565b600e80546001600160a01b039384166001600160a01b031991821617909155600f8054929093169116179055565b5f610962816012613621565b610db3612231565b6014545f90610dca906001600160a01b0316611d92565b90506015548111610dee576040516301899ea960e01b815260040160405180910390fd5b5f60155482610dfd91906134a8565b601454909150610e17906001600160a01b031684836122dc565b604080516001600160a01b0385168152602081018390527fbd6c5c3d9f6256e77a4049dceca2de0c012c29e11877a863fbcc04bc9c966cd89101610d53565b610e5e612231565b610e6661230c565b565b6001600160a01b0382165f9081526018602090815260408083208484528252808320805482518185028101850190935280835260609492939192909184015b82821015610ef4578382905f5260205f2090600302016040518060600160405290815f82015481526020016001820154815260200160028201548152505081526020019060010190610ea7565b50505050905092915050565b5f612710600954612710610f1491906134a8565b610f1e90846134bb565b610f2891906134d2565b9150610a02825f611dfa565b610f3c612231565b600c80546001600160a01b0319166001600160a01b038416179055610f628160c8612361565b6009819055600c546040516001600160a01b0390911681527f64c7017e0d89b07b60fcd49444429ea86c712427960bc73bd714607eb8a5c592906020015b60405180910390a15050565b5f811580610fbb575060135482115b15610fd9576040516306130d9960e01b815260040160405180910390fd5b5f6013610fe76001856134a8565b81548110610ff757610ff761363a565b5f9182526020918290206040805160a0810182526005909302909101805483526001810154938301939093526002830154908201526003820154606082015260049091015460ff1615156080820181905290915061106857604051635b85f48960e11b815260040160405180910390fd5b8060400151816060015111611080575f915050610a02565b5f61108b8585612382565b9050805f036110b15761109e8585612552565b9050805f036110b1575f92505050610a02565b5f826040015183606001516110c691906134a8565b90506b033b2e3c9fd0803ce80000006110df82846134bb565b6110e991906134d2565b9695505050505050565b5f6110fc611e8e565b61110583611eb9565b60115460ff1615611129576040516380c4f80160e01b815260040160405180910390fd5b6014546001600160a01b03167f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb485f61116083611d92565b905061116e82333089611ed8565b60405163095ea7b360e01b81526001600160a01b0384811660048301526024820188905283169063095ea7b3906044016020604051808303815f875af11580156111ba573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111de919061364e565b50601454604051636e553f6560e01b8152600481018890526001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488116602483015290911690636e553f65906044015f604051808303815f87803b15801561124a575f5ffd5b505af115801561125c573d5f5f3e3d5ffd5b505050505f61126b8483611f49565b90506110e9818888612075565b611280612231565b610e665f6125bf565b60075433906001600160a01b031681146112fc5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b611305816125bf565b50565b600d5461131f9033906001600160a01b03166125d8565b5f61132861260a565b600481015490915060ff1615611351576040516340079e1f60e11b815260040160405180910390fd5b42600182015561135f610b16565b6003820181905560048201805460ff19166001908117909155600b549083015460405191927fb463d19ecf455be65365092cf8e1db6934a0334cf8cd532ddf9964d01f36b5b2926113ba929190918252602082015260400190565b60405180910390a261130561266d565b6113d2612231565b610e666127c5565b6113e2612231565b6113ea61228b565b60145460408051639705f8f960e01b815290515f926001600160a01b031691639705f8f99160048083019260209291908290030181865afa158015611431573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114559190613606565b6014549091506001600160a01b03165f61146e83611d92565b60405163095ea7b360e01b81526001600160a01b038481166004830152602482018390529192509084169063095ea7b3906044016020604051808303815f875af11580156114be573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114e2919061364e565b5060145f9054906101000a90046001600160a01b03166001600160a01b031663a25eb5d96040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561152f575f5ffd5b505af1158015611541573d5f5f3e3d5ffd5b5050604080516001600160a01b038088168252861660208201529081018490527f8f89a6ff2401b99707423810461bb39d138c8e4150f4ddaf934eb3e4895c5bdb92506060019050610d53565b611596612231565b6011805460ff191682151590811790915560405160ff909116151581527f96bbbe0790c74fdc0ee8ce14e7fc21605a5b5588585e1a5ede1848a5f2446c91906020015b60405180910390a150565b6115ec612231565b6115f5816122b5565b600d80546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f70906020016115d9565b5f6040516302b0eba760e21b815260040160405180910390fd5b6060600480546109769061345c565b6001600160a01b0382165f908152601660209081526040808320805482518185028101850190935280835284938301828280156116c657602002820191905f5260205f20905b8154815260200190600101908083116116b2575b505050505090505f81519050805f036116e3575f92505050610a02565b5f815b80821015611744575f60026116fb8385613669565b61170591906134d2565b90508685828151811061171a5761171a61363a565b6020026020010151101561173a57611733816001613669565b925061173e565b8091505b506116e6565b815f03611757575f945050505050610a02565b836117636001846134a8565b815181106117735761177361363a565b602002602001015194505050505092915050565b5f3361179481858561217a565b610a1533856121d7565b6016602052815f5260405f2081815481106117b7575f80fd5b905f5260205f20015f91509150505481565b5f60636117d7836001611dfa565b6117e29060646134bb565b610a0291906134d2565b5f6117f5611e8e565b6117fe84611eb9565b336001600160a01b0383161461181957611819823386612104565b5f611823856109f7565b90505f61182f84611bf6565b90508082111561186b57604051633fa733bb60e21b81526001600160a01b038516600482015260248101839052604481018290526064016112f3565b6118758487612808565b8560155f82825461188691906134a8565b909155505060408051838152602081018890526001600160a01b03868116929088169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46118fd846118f8866001600160a01b03165f9081526020819052604090205490565b61283c565b5f6119277f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48611d92565b90505f601054426119389190613669565b90505f611943612be8565b6014546040516353798fa160e11b81529192506001600160a01b03169063a6f31f429061199f908c907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890879087906003908d9060040161367c565b5f604051808303815f87803b1580156119b6575f5ffd5b505af11580156119c8573d5f5f3e3d5ffd5b505050505f6119f77f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4885611f49565b9050611a0586821015612cad565b5f61271060095483611a1791906134bb565b611a2191906134d2565b90505f81118015611a3c5750600c546001600160a01b031615155b15611a8857611a4b81836134a8565b600c54909250611a88906001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881169116836122dc565b611abc6001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168b846122dc565b509998505050505050505050565b611af96040518060a001604052805f81526020015f81526020015f81526020015f81526020015f151581525090565b611b0161260a565b6040805160a08101825282548152600183015460208201526002830154918101919091526003820154606082015260049091015460ff1615156080820152919050565b611b4c612ccb565b6001600160a01b038116611b885760405162461bcd60e51b815260206004820152600360248201526227a22d60e91b60448201526064016112f3565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60138181548110611bb9575f80fd5b5f918252602090912060059091020180546001820154600283015460038401546004909401549294509092909160ff1685565b5f610a0282611e40565b6001600160a01b0381165f90815260208190526040812054610a029061095c565b6001600160a01b0381165f90815260208190526040812054610a02565b611c3c612231565b611c4b81600a620186a0612d0a565b600a8190556040518181527fd42d864ef8cabceabca3a2e3b88f94701b5030fa577025e56e4701b46ec079d0906020016115d9565b5f610a02825f612d35565b611c93612ccb565b600780546001600160a01b0383166001600160a01b03199091168117909155611cc46006546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611d04612231565b6014546001600160a01b0390811690821603611d335760405163e217c62b60e01b815260040160405180910390fd5b5f611d3d82611d92565b9050611d536001600160a01b03831633836122dc565b604080516001600160a01b0384168152602081018390527f9fb26a02b945f9b4267da962d25482e9880f19d03f92cff89e451fa3d21972409101610fa0565b6040516370a0823160e01b81523060048201525f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611dd6573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0291906135df565b5f5f5f611e05611f6a565b915091505f611e1686610af6610b16565b905082611e2483600a6135d4565b6110df90836134bb565b611e3b8383836001612d8a565b505050565b5f5f5f611e4b611f6a565b90925090505f611e5c82600a6135d4565b611e6684876134bb565b611e7091906134d2565b9050611e8581611e7e610b16565b6001612000565b95945050505050565b600854600160a01b900460ff1615610e665760405163d93c066560e01b815260040160405180910390fd5b805f0361130557604051622a0bd760e81b815260040160405180910390fd5b6040516001600160a01b0380851660248301528316604482015260648101829052611f439085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612e5c565b50505050565b5f5f82611f5585611d92565b611f5f91906134a8565b9050610c4e81611eb9565b600f54604051630226614760e01b81526001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48811660048301525f9283929116906302266147906024016040805180830381865afa158015611fd4573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ff891906136e9565b915091509091565b5f811561203e578261201e6b033b2e3c9fd0803ce8000000866134bb565b61202d9064e8d4a510006134bb565b61203791906134d2565b9050610c4e565b6120596b033b2e3c9fd0803ce800000064e8d4a510006134bb565b61206384866134bb565b61206d91906134d2565b949350505050565b8260155f8282546120869190613669565b9091555061209690508184612eab565b6120b8816118f8836001600160a01b03165f9081526020819052604090205490565b60408051838152602081018590526001600160a01b0383169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791015b60405180910390a3505050565b6001600160a01b038381165f908152600160209081526040808320938616835292905220545f19811015611f43578181101561216c57604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064016112f3565b611f4384848484035f612d8a565b6001600160a01b0383166121a357604051634b637e8f60e11b81525f60048201526024016112f3565b6001600160a01b0382166121cc5760405163ec442f0560e01b81525f60048201526024016112f3565b611e3b838383612edb565b6121df611e8e565b6121e98282612ff4565b61220b826118f8846001600160a01b03165f9081526020819052604090205490565b61222d816118f8836001600160a01b03165f9081526020819052604090205490565b5050565b6006546001600160a01b03163314610e665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016112f3565b600854600160a01b900460ff16610e6657604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b03811661130557604051630f968f2560e31b815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052611e3b90849063a9059cbb60e01b90606401611f0c565b61231461228b565b6008805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b8082111561222d5760405163304ec58360e11b815260040160405180910390fd5b6001600160a01b0382165f9081526018602090815260408083208484528252808320815181546060948102820185018452928101838152859491938492849190879085015b82821015612414578382905f5260205f2090600302016040518060600160405290815f820154815260200160018201548152602001600282015481525050815260200190600101906123c7565b5050505081526020016001820154815250509050805f0151515f0361243c575f915050610a02565b5f601361244a6001866134a8565b8154811061245a5761245a61363a565b5f91825260208083206040805160a08101825260059094029091018054845260018082015493850193909352600281015491840191909152600381015460608401526004015460ff161515608083015284518051929450916124bc91906134a8565b815181106124cc576124cc61363a565b602002602001015190505f816040015190505f825f015184602001516124f291906134a8565b905080836020015161250491906134bb565b61250e9083613669565b91505f845f0151856020015161252491906134a8565b9050805f0361253b575f9650505050505050610a02565b61254581846134d2565b9998505050505050505050565b5f5f61255e848461166c565b9050805f03612570575f915050610a02565b6001600160a01b0384165f9081526018602090815260408083208484529091528120805490918190036125a8575f9350505050610a02565b6125b182613026565b600101549695505050505050565b600780546001600160a01b03191690556113058161305b565b806001600160a01b0316826001600160a01b03161461222d57604051634983312960e11b815260040160405180910390fd5b6013545f9061261a906001613669565b600b541061263b57604051633c96bfd560e11b815260040160405180910390fd5b60136001600b5461264c91906134a8565b8154811061265c5761265c61363a565b905f5260205f209060050201905090565b5f612676610b16565b6040805160a081018252428082525f60208084018281528486018781526060860184815260808701858152601380546001810182559681905297517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09060059097029687015592517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09186015590517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a092850155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a093840155517f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a094909201805460ff1916921515929092179091559154600b8190558351918252918101849052929350917f29db3deb62ef2036e5eb93aad68d2362aec0711af592cb365566603bd88651d4910160405180910390a250565b6127cd611e8e565b6008805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586123443390565b6001600160a01b03821661283157604051634b637e8f60e11b81525f60048201526024016112f3565b61222d825f83612edb565b6001600160a01b0382165f908152601860209081526040808320600b54845290915281208054909142911561290d575f61287584613026565b805490915061288490846134a8565b915081156128ff57835f0160405180606001604052808581526020018781526020018484600101546128b691906134bb565b84600201546128c59190613669565b90528154600181810184555f9384526020938490208351600390930201918255928201519281019290925560400151600290910155612907565b600181018590555b50612ab3565b6001600160a01b0385165f9081526012602052604090205415612a6d576001600160a01b0385165f90815260186020908152604080832060128352818420548452909152812080549091908290612966906001906134a8565b815481106129765761297661363a565b905f5260205f20906003020190505f60136001600b5461299691906134a8565b815481106129a6576129a661363a565b5f9182526020918290206040805160a08101825260059093029091018054808452600182015494840194909452600281015491830191909152600381015460608301526004015460ff16151560808201529150612a0390866134a8565b9350855f016040518060600160405280878152602001898152602001868560010154612a2f91906134bb565b90528154600181810184555f938452602093849020835160039093020191825592820151928101929092556040015160029091015550612ab3915050565b6040805160608101825283815260208082018781525f938301848152875460018181018a5589875293909520935160039095029093019384555190830155516002909101555b60018301829055600b546001600160a01b0386165f90815260126020908152604080832084905560178252808320938352929052205460ff16612b41576001600160a01b0385165f818152601760209081526040808320600b80548552908352818420805460ff19166001908117909155948452601683529083209054815494850182559083529120909101555b600a54835410612b8f57600b5483546040519081526001600160a01b038716907f81fa37560513d551c71bcabf4a2700eb792debb57f4e9879a5dd882040f3431a9060200160405180910390a35b600b5483546040805187815260208101869052908101919091526001600160a01b038716907f64bf20d81818c8d606b5801b3537bbcb1dc4a052a21965e300a7bcbcb37a16e59060600160405180910390a35050505050565b60605f60145f9054906101000a90046001600160a01b03166001600160a01b031663292252886040518163ffffffff1660e01b81526004015f60405180830381865afa158015612c3a573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052612c61919081019061371f565b5190508067ffffffffffffffff811115612c7d57612c7d61370b565b604051908082528060200260200182016040528015612ca6578160200160208202803683370190505b5091505090565b806113055760405163066d598f60e41b815260040160405180910390fd5b6008546001600160a01b03163314610e665760405162461bcd60e51b81526020600482015260026024820152614e4160f01b60448201526064016112f3565b81831080612d1757508083115b15611e3b57604051630a8fcb4f60e21b815260040160405180910390fd5b5f5f5f612d40611f6a565b9092509050612d506064866134d2565b612d5a90866134a8565b94505f612d6882600a6135d4565b612d7284886134bb565b612d7c91906134d2565b90506110e981611e7e610b16565b6001600160a01b038416612db35760405163e602df0560e01b81525f60048201526024016112f3565b6001600160a01b038316612ddc57604051634a1406b160e11b81525f60048201526024016112f3565b6001600160a01b038085165f9081526001602090815260408083209387168352929052208290558015611f4357826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051612e4e91815260200190565b60405180910390a350505050565b5f612e706001600160a01b038416836130ac565b805190915015611e3b5780806020019051810190612e8e919061364e565b611e3b576040516388d0662b60e01b815260040160405180910390fd5b6001600160a01b038216612ed45760405163ec442f0560e01b81525f60048201526024016112f3565b61222d5f83835b6001600160a01b038316612f05578060025f828254612efa9190613669565b90915550612f759050565b6001600160a01b0383165f9081526020819052604090205481811015612f575760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016112f3565b6001600160a01b0384165f9081526020819052604090209082900390555b6001600160a01b038216612f9157600280548290039055612faf565b6001600160a01b0382165f9081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516120f791815260200190565b806001600160a01b0316826001600160a01b03160361222d576040516378f927ad60e11b815260040160405180910390fd5b80545f908290613038906001906134a8565b815481106130485761304861363a565b905f5260205f2090600302019050919050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6060610c4e83835f6040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525060608247101561314b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016112f3565b5f5f866001600160a01b0316858760405161316691906137ea565b5f6040518083038185875af1925050503d805f81146131a0576040519150601f19603f3d011682016040523d82523d5f602084013e6131a5565b606091505b50915091506131b6878383876131c1565b979650505050505050565b6060831561322f5782515f03613228576001600160a01b0385163b6132285760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016112f3565b508161206d565b61206d83838151156132445781518083602001fd5b8060405162461bcd60e51b81526004016112f391905b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f6020828403121561329f575f5ffd5b5035919050565b6001600160a01b0381168114611305575f5ffd5b5f5f604083850312156132cb575f5ffd5b82356132d6816132a6565b946020939093013593505050565b5f5f604083850312156132f5575f5ffd5b823591506020830135613307816132a6565b809150509250929050565b5f5f5f60608486031215613324575f5ffd5b833561332f816132a6565b9250602084013561333f816132a6565b929592945050506040919091013590565b5f60208284031215613360575f5ffd5b8135610c4e816132a6565b5f5f6040838503121561337c575f5ffd5b8235613387816132a6565b91506020830135613307816132a6565b602080825282518282018190525f918401906040840190835b818110156133ea578351805184526020810151602085015260408101516040850152506060830192506020840193506001810190506133b0565b509095945050505050565b8015158114611305575f5ffd5b5f60208284031215613412575f5ffd5b8135610c4e816133f5565b5f5f5f6060848603121561342f575f5ffd5b833592506020840135613441816132a6565b91506040840135613451816132a6565b809150509250925092565b600181811c9082168061347057607f821691505b60208210810361348e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610a0257610a02613494565b8082028115828204841417610a0257610a02613494565b5f826134ec57634e487b7160e01b5f52601260045260245ffd5b500490565b6001815b600184111561352c5780850481111561351057613510613494565b600184161561351e57908102905b60019390931c9280026134f5565b935093915050565b5f8261354257506001610a02565b8161354e57505f610a02565b8160018114613564576002811461356e5761358a565b6001915050610a02565b60ff84111561357f5761357f613494565b50506001821b610a02565b5060208310610133831016604e8410600b84101617156135ad575081810a610a02565b6135b95f1984846134f1565b805f19048211156135cc576135cc613494565b029392505050565b5f610c4e8383613534565b5f602082840312156135ef575f5ffd5b5051919050565b8051613601816132a6565b919050565b5f60208284031215613616575f5ffd5b8151610c4e816132a6565b60ff8181168382160190811115610a0257610a02613494565b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561365e575f5ffd5b8151610c4e816133f5565b80820180821115610a0257610a02613494565b5f60c0820188835260018060a01b038816602084015286604084015260c0606084015280865180835260e0850191506020880192505f5b818110156136d15783518352602093840193909201916001016136b3565b50506080840195909552505060a00152949350505050565b5f5f604083850312156136fa575f5ffd5b505080516020909101519092909150565b634e487b7160e01b5f52604160045260245ffd5b5f6020828403121561372f575f5ffd5b815167ffffffffffffffff811115613745575f5ffd5b8201601f81018413613755575f5ffd5b805167ffffffffffffffff81111561376f5761376f61370b565b8060051b604051601f19603f830116810181811067ffffffffffffffff8211171561379c5761379c61370b565b6040529182526020818401810192908101878411156137b9575f5ffd5b6020850194505b838510156137df576137d1856135f6565b8152602094850194016137c0565b509695505050505050565b5f82518060208501845e5f92019182525091905056fea2646970667358221220eca00774742f699fbaec134dcf523f837276d5bd6c9f710a9237008d5f1ed77b64736f6c634300081e0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba000000000000000000000000ceb202d3075be4abd24865fd8f307374923948ad0000000000000000000000006936df2d345605b3af42b880660b9717f2ae66dd
-----Decoded View---------------
Arg [0] : _underlyingToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : _atvVault (address): 0x72Ec8447074DC0BFbedfB516cc250B525f3A4AbA
Arg [2] : _atvStorage (address): 0xCeb202D3075bE4abD24865fD8F307374923948ad
Arg [3] : _atvOracle (address): 0x6936df2D345605b3aF42b880660B9717F2ae66Dd
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 00000000000000000000000072ec8447074dc0bfbedfb516cc250b525f3a4aba
Arg [2] : 000000000000000000000000ceb202d3075be4abd24865fd8f307374923948ad
Arg [3] : 0000000000000000000000006936df2d345605b3af42b880660b9717f2ae66dd
Deployed Bytecode Sourcemap
1338:20341:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;14685:158;;;:::i;:::-;;;160:25:19;;;148:2;133:18;14685:158:2;;;;;;;;1726:89:4;;;:::i;:::-;;;;;;;:::i;21046:157:2:-;;;;;;:::i;:::-;;:::i;3885:186:4:-;;;;;;:::i;:::-;;:::i;:::-;;;1523:14:19;;1516:22;1498:41;;1486:2;1471:18;3885:186:4;1358:187:19;20456:207:2;;;;;;:::i;:::-;;:::i;16834:679::-;;;;;;:::i;:::-;;:::i;7344:284::-;;;:::i;2769:114:4:-;2864:12;;2769:114;;15202:296:2;;;;;;:::i;:::-;;:::i;1512:26::-;;;;;;6309:307;;;;;;:::i;:::-;;:::i;:::-;;6956:200;;;;;;:::i;:::-;;:::i;14849:111::-;;;:::i;:::-;;;3252:4:19;3240:17;;;3222:36;;3210:2;3195:18;14849:111:2;3080:184:19;16491:337:2;;;;;;:::i;:::-;;:::i;5701:94:5:-;5781:6;;-1:-1:-1;;;;;5781:6:5;5701:94;;;-1:-1:-1;;;;;3433:32:19;;;3415:51;;3403:2;3388:18;5701:94:5;3269:203:19;1612:46:2;;1655:3;1612:46;;4902:65;;;:::i;6356:108:5:-;;;;;;:::i;:::-;-1:-1:-1;;;6440:17:5;6356:108;16201:166:2;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;1857:24::-;;;;;-1:-1:-1;;;;;1857:24:2;;;20672:215;;;;;;:::i;:::-;;:::i;2005:46::-;;;;;;:::i;:::-;;;;;;;;;;;;;;5844:262;;;;;;:::i;:::-;;:::i;1760:84:14:-;1830:7;;-1:-1:-1;;;1830:7:14;;;;1760:84;;12824:635:2;;;;;;:::i;:::-;;:::i;1974:24::-;;;;;;;;;17519:612;;;;;;:::i;:::-;;:::i;2916:116:4:-;;;;;;:::i;:::-;-1:-1:-1;;;;;3007:18:4;2981:7;3007:18;;;;;;;;;;;;2916:116;1898:101:12;;;:::i;1824:240:10:-;;;:::i;12217:405:2:-;;;:::i;4835:61::-;;;:::i;6622:328::-;;;:::i;1826:25::-;;;;;-1:-1:-1;;;;;1826:25:2;;;5691:147;;;;;;:::i;:::-;;:::i;1268:85:12:-;1340:6;;-1:-1:-1;;;;;1340:6:12;1268:85;;7162:176:2;;;;;;:::i;:::-;;:::i;16091:100::-;;;;;;:::i;:::-;;:::i;1928:93:4:-;;;:::i;2638:67:2:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;13465:613;;;;;;:::i;:::-;;:::i;14966:230::-;;;;;;:::i;:::-;;:::i;2583:49::-;;;;;;:::i;:::-;;:::i;21209:165::-;;;;;;:::i;:::-;;:::i;18313:1506::-;;;;;;:::i;:::-;;:::i;16377:108::-;;;:::i;:::-;;;;;;5317:4:19;5359:3;5348:9;5344:19;5336:27;;5396:6;5390:13;5379:9;5372:32;5460:4;5452:6;5448:17;5442:24;5435:4;5424:9;5420:20;5413:54;5523:4;5515:6;5511:17;5505:24;5498:4;5487:9;5483:20;5476:54;5586:4;5578:6;5574:17;5568:24;5561:4;5550:9;5546:20;5539:54;5663:4;5655:6;5651:17;5645:24;5638:32;5631:40;5624:4;5613:9;5609:20;5602:70;5179:499;;;;;15963:119:2;;;;;;:::i;362:161:11:-;;;;;;:::i;:::-;;:::i;2436:21:2:-;;;;;;:::i;:::-;;:::i;:::-;;;;5936:25:19;;;5992:2;5977:18;;5970:34;;;;6020:18;;;6013:34;;;;6078:2;6063:18;;6056:34;6134:14;6127:22;6121:3;6106:19;;6099:51;5923:3;5908:19;2436:21:2;5683:473:19;20893:147:2;;;;;;:::i;:::-;;:::i;6639:153:5:-;;;;;;:::i;:::-;;:::i;1930:38:2:-;;;;;;527:87:11;598:11;;-1:-1:-1;;;;;598:11:11;527:87;;2490:33:2;;;;;;6827:112:5;;;;;;:::i;:::-;;:::i;2711:64:2:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;3438:140:4;;;;;;:::i;:::-;-1:-1:-1;;;;;3544:18:4;;;3518:7;3544:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3438:140;6116:187:2;;;;;;:::i;:::-;;:::i;913:99:10:-;992:13;;-1:-1:-1;;;;;992:13:10;913:99;;1576:29:2;;;;;;6974:147:5;;;;;;:::i;:::-;;:::i;2463:21:2:-;;;;;-1:-1:-1;;;;;2463:21:2;;;797:171:11;;;;;;:::i;:::-;;:::i;15701:256:2:-;;;;;;:::i;:::-;;:::i;1795:25::-;;;;;-1:-1:-1;;;;;1795:25:2;;;1760:29;;;;;-1:-1:-1;;;;;1760:29:2;;;14685:158;14803:9;;14746:7;;14772:64;;14789:25;;-1:-1:-1;;;;;14803:9:2;14789:5;:25::i;:::-;14816:19;14772:16;:64::i;:::-;14765:71;;14685:158;:::o;1726:89:4:-;1771:13;1803:5;1796:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1726:89;:::o;21046:157:2:-;21125:7;21151:45;21168:6;21176:19;21151:16;:45::i;:::-;21144:52;21046:157;-1:-1:-1;;21046:157:2:o;3885:186:4:-;3958:4;719:10:3;4012:31:4;719:10:3;4028:7:4;4037:5;4012:8;:31::i;:::-;-1:-1:-1;4060:4:4;;3885:186;-1:-1:-1;;;3885:186:4:o;20456:207:2:-;20535:7;20591:11;;20583:5;:19;;;;:::i;:::-;20564:14;:6;20573:5;20564:14;:::i;:::-;20563:40;;;;:::i;:::-;20554:49;;20621:35;20649:6;20621:27;:35::i;16834:679::-;16924:7;1384:19:14;:17;:19::i;:::-;16943:15:2::1;16951:6;16943:7;:15::i;:::-;16971:12;::::0;::::1;;16968:29;;;16992:5;;-1:-1:-1::0;;;16992:5:2::1;;;;;;;;;;;16968:29;17031:9;::::0;-1:-1:-1;;;;;17031:9:2::1;17007:13;17068:12;17031:9:::0;17068:5:::1;:12::i;:::-;17051:29;;17090:76;17124:5;17132:10;17152:4;17159:6;17090:26;:76::i;:::-;17207:17;17227:26;17239:5;17246:6;17227:11;:26::i;:::-;17207:46;;17264:13;17279:11;17294;:9;:11::i;:::-;17263:42:::0;;-1:-1:-1;17263:42:2;-1:-1:-1;17263:42:2;17341:7:::1;17263:42:::0;17341:2:::1;:7;:::i;:::-;17328:21;::::0;:9;:21:::1;:::i;:::-;17327:30;;;;:::i;:::-;17315:42;;17367:14;17384:42;17393:9;17404:14;:12;:14::i;:::-;17420:5;17384:8;:42::i;:::-;17367:59;;17436:44;17452:9;17463:6;17471:8;17436:15;:44::i;:::-;-1:-1:-1::0;17497:9:2;;16834:679;-1:-1:-1;;;;;;;16834:679:2:o;7344:284::-;7440:9;;7477:27;;;-1:-1:-1;;;7477:27:2;;;;7388:16;;-1:-1:-1;;;;;7440:9:2;;7388:16;;7440:9;;7477:25;;:27;;;;;;;;;;;;;;7440:9;7477:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;7460:44;;7514:15;7522:6;7514:7;:15::i;:::-;7563:10;;7551:49;;-1:-1:-1;;;7551:49:2;;-1:-1:-1;;;;;3433:32:19;;;7551:49:2;;;3415:51:19;7615:6:2;;1700:4;;7563:10;;;7551:42;;3388:18:19;;7551:49:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:60;;;;:::i;:::-;7550:71;;;;:::i;:::-;7539:82;;7406:222;;7344:284;:::o;15202:296::-;15313:4;719:10:3;15369:37:2;15385:4;719:10:3;15400:5:2;15369:15;:37::i;:::-;15416:26;15426:4;15432:2;15436:5;15416:9;:26::i;:::-;15452:18;15461:4;15467:2;15452:8;:18::i;:::-;15487:4;15480:11;;;15202:296;;;;;;:::o;6309:307::-;1161:13:12;:11;:13::i;:::-;1631:16:14::1;:14;:16::i;:::-;6411:9:2::2;::::0;6434:27:::2;::::0;;-1:-1:-1;;;6434:27:2;;;;-1:-1:-1;;;;;6411:9:2;;::::2;::::0;;;6434:25;;::::2;::::0;::::2;::::0;:27:::2;::::0;;::::2;::::0;::::2;::::0;;;;;;;;;:25;:27:::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;6434:36:2::2;;6431:53;;6479:5;;-1:-1:-1::0;;;6479:5:2::2;;;;;;;;;;;6431:53;6528:9;:24:::0;;-1:-1:-1;;;;;;6528:24:2::2;-1:-1:-1::0;;;;;6528:24:2;;::::2;::::0;;::::2;::::0;;;6567:42:::2;::::0;;9676:32:19;;;9658:51;;9740:2;9725:18;;9718:60;;;;6513:5:2;;6567:42:::2;::::0;9631:18:19;6567:42:2::2;;;;;;;;6377:239;;6309:307:::0;:::o;6956:200::-;1161:13:12;:11;:13::i;:::-;7061:21:2::1;7070:11;7061:8;:21::i;:::-;7092:10;:24:::0;;-1:-1:-1;;;;;7092:24:2;;::::1;-1:-1:-1::0;;;;;;7092:24:2;;::::1;;::::0;;;7127:9:::1;:22:::0;;;;;::::1;::::0;::::1;;::::0;;6956:200::o;14849:111::-;14907:5;14931:22;14907:5;14931:2;:22;:::i;16491:337::-;1161:13:12;:11;:13::i;:::-;16596:9:2::1;::::0;16563:16:::1;::::0;16582:25:::1;::::0;-1:-1:-1;;;;;16596:9:2::1;16582:5;:25::i;:::-;16563:44;;16632:18;;16620:8;:30;16617:47;;16659:5;;-1:-1:-1::0;;;16659:5:2::1;;;;;;;;;;;16617:47;16674:13;16701:18;;16690:8;:29;;;;:::i;:::-;16744:9;::::0;16674:45;;-1:-1:-1;16729:50:2::1;::::0;-1:-1:-1;;;;;16744:9:2::1;16769:2:::0;16674:45;16729:39:::1;:50::i;:::-;16794:27;::::0;;-1:-1:-1;;;;;10134:32:19;;10116:51;;10198:2;10183:18;;10176:34;;;16794:27:2::1;::::0;10089:18:19;16794:27:2::1;9942:274:19::0;4902:65:2;1161:13:12;:11;:13::i;:::-;4950:10:2::1;:8;:10::i;:::-;4902:65::o:0;16201:166::-;-1:-1:-1;;;;;16325:14:2;;;;;;:8;:14;;;;;;;;:23;;;;;;;;16318:42;;;;;;;;;;;;;;;;;16283:23;;16318:42;;16325:23;;16318:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16201:166;;;;:::o;20672:215::-;20749:7;20812:5;20796:11;;20788:5;:19;;;;:::i;:::-;20778:30;;:6;:30;:::i;:::-;20777:40;;;;:::i;:::-;20768:49;;20835:45;20852:6;20860:19;20835:16;:45::i;5844:262::-;1161:13:12;:11;:13::i;:::-;5947:14:2::1;:32:::0;;-1:-1:-1;;;;;;5947:32:2::1;-1:-1:-1::0;;;;;5947:32:2;::::1;;::::0;;5989:31:::1;5997:4:::0;1655:3:::1;5989:7;:31::i;:::-;6030:11;:18:::0;;;6084:14:::1;::::0;6063:36:::1;::::0;-1:-1:-1;;;;;6084:14:2;;::::1;3415:51:19::0;;6063:36:2::1;::::0;3403:2:19;3388:18;6063:36:2::1;;;;;;;;5844:262:::0;;:::o;12824:635::-;12906:7;12928:12;;;:39;;-1:-1:-1;12954:6:2;:13;12944:23;;12928:39;12925:56;;;12976:5;;-1:-1:-1;;;12976:5:2;;;;;;;;;;;12925:56;12991:18;13012:6;13019:11;13029:1;13019:7;:11;:::i;:::-;13012:19;;;;;;;;:::i;:::-;;;;;;;;;;12991:40;;;;;;;;13012:19;;;;;;;12991:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;13041:33:2;;13069:5;;-1:-1:-1;;;13069:5:2;;;;;;;;;;;13041:33;13113:5;:14;;;13097:5;:12;;;:30;13093:44;;13136:1;13129:8;;;;;13093:44;13148:13;13164:30;13180:4;13186:7;13164:15;:30::i;:::-;13148:46;;13208:5;13217:1;13208:10;13204:131;;13242:45;13273:4;13279:7;13242:30;:45::i;:::-;13234:53;;13304:5;13313:1;13304:10;13301:23;;13323:1;13316:8;;;;;;13301:23;13352:19;13389:5;:14;;;13374:5;:12;;;:29;;;;:::i;:::-;13352:51;-1:-1:-1;1700:4:2;13421:19;13352:51;13421:5;:19;:::i;:::-;13420:32;;;;:::i;:::-;13413:39;12824:635;-1:-1:-1;;;;;;12824:635:2:o;17519:612::-;17617:7;1384:19:14;:17;:19::i;:::-;17636:15:2::1;17644:6;17636:7;:15::i;:::-;17664:12;::::0;::::1;;17661:29;;;17685:5;;-1:-1:-1::0;;;17685:5:2::1;;;;;;;;;;;17661:29;17724:9;::::0;-1:-1:-1;;;;;17724:9:2::1;17766:10;17700:13;17804:12;17724:9:::0;17804:5:::1;:12::i;:::-;17787:29;;17826:68;17853:5;17860:10;17880:4;17887:6;17826:26;:68::i;:::-;17904:28;::::0;-1:-1:-1;;;17904:28:2;;-1:-1:-1;;;;;10134:32:19;;;17904:28:2::1;::::0;::::1;10116:51:19::0;10183:18;;;10176:34;;;17904:13:2;::::1;::::0;::::1;::::0;10089:18:19;;17904:28:2::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;17942:9:2::1;::::0;:37:::1;::::0;-1:-1:-1;;;17942:37:2;;::::1;::::0;::::1;10777:25:19::0;;;-1:-1:-1;;;;;17968:10:2::1;10838:32:19::0;;10818:18;;;10811:60;17942:9:2;;::::1;::::0;:17:::1;::::0;10750:18:19;;17942:37:2::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;17998:17;18018:26;18030:5;18037:6;18018:11;:26::i;:::-;17998:46;;18054:44;18070:9;18081:6;18089:8;18054:15;:44::i;1898:101:12:-:0;1161:13;:11;:13::i;:::-;1962:30:::1;1989:1;1962:18;:30::i;1824:240:10:-:0;992:13;;719:10:3;;-1:-1:-1;;;;;992:13:10;1930:24;;1909:112;;;;-1:-1:-1;;;1909:112:10;;11084:2:19;1909:112:10;;;11066:21:19;11123:2;11103:18;;;11096:30;11162:34;11142:18;;;11135:62;-1:-1:-1;;;11213:18:19;;;11206:39;11262:19;;1909:112:10;;;;;;;;;2031:26;2050:6;2031:18;:26::i;:::-;1860:204;1824:240::o;12217:405:2:-;12280:10;;12261:30;;12268:10;;-1:-1:-1;;;;;12280:10:2;12261:6;:30::i;:::-;12301:19;12323:20;:18;:20::i;:::-;12356:15;;;;12301:42;;-1:-1:-1;12356:15:2;;12353:32;;;12380:5;;-1:-1:-1;;;12380:5:2;;;;;;;;;;;12353:32;12420:15;12404:13;;;:31;12460:14;:12;:14::i;:::-;12445:12;;;:29;;;12484:15;;;:22;;-1:-1:-1;;12484:22:2;12502:4;12484:22;;;;;;12545:14;;12561:13;;;;12530:59;;12545:14;;12530:59;;;;12561:13;12445:29;11466:25:19;;;11522:2;11507:18;;11500:34;11454:2;11439:18;;11292:248;12530:59:2;;;;;;;;12599:16;:14;:16::i;4835:61::-;1161:13:12;:11;:13::i;:::-;4881:8:2::1;:6;:8::i;6622:328::-:0;1161:13:12;:11;:13::i;:::-;1631:16:14::1;:14;:16::i;:::-;6704:9:2::2;::::0;:24:::2;::::0;;-1:-1:-1;;;6704:24:2;;;;6685:16:::2;::::0;-1:-1:-1;;;;;6704:9:2::2;::::0;:22:::2;::::0;:24:::2;::::0;;::::2;::::0;::::2;::::0;;;;;;;;:9;:24:::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;6762:9;::::0;6685:43;;-1:-1:-1;;;;;;6762:9:2::2;6738:13;6796:15;6685:43:::0;6796:5:::2;:15::i;:::-;6821:36;::::0;-1:-1:-1;;;6821:36:2;;-1:-1:-1;;;;;10134:32:19;;;6821:36:2::2;::::0;::::2;10116:51:19::0;10183:18;;;10176:34;;;6782:29:2;;-1:-1:-1;6821:24:2;;::::2;::::0;::::2;::::0;10089:18:19;;6821:36:2::2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6867:9;;;;;;;;;-1:-1:-1::0;;;;;6867:9:2::2;-1:-1:-1::0;;;;;6867:23:2::2;;:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;6907:36:2::2;::::0;;-1:-1:-1;;;;;11765:32:19;;;11747:51;;11834:32;;11829:2;11814:18;;11807:60;11883:18;;;11876:34;;;6907:36:2::2;::::0;-1:-1:-1;11735:2:19;11720:18;;-1:-1:-1;6907:36:2::2;11545:371:19::0;5691:147:2;1161:13:12;:11;:13::i;:::-;5762:12:2::1;:21:::0;;-1:-1:-1;;5762:21:2::1;::::0;::::1;;::::0;;::::1;::::0;;;5798:33:::1;::::0;5762:21:::1;5818:12:::0;;;1523:14:19;1516:22;1498:41;;5798:33:2::1;::::0;1486:2:19;1471:18;5798:33:2::1;;;;;;;;5691:147:::0;:::o;7162:176::-;1161:13:12;:11;:13::i;:::-;7235:21:2::1;7244:11;7235:8;:21::i;:::-;7266:10;:24:::0;;-1:-1:-1;;;;;;7266:24:2::1;-1:-1:-1::0;;;;;7266:24:2;::::1;::::0;;::::1;::::0;;;7305:26:::1;::::0;3415:51:19;;;7305:26:2::1;::::0;3403:2:19;3388:18;7305:26:2::1;3269:203:19::0;16091:100:2;16153:7;16179:5;;-1:-1:-1;;;16179:5:2;;;;;;;;;;;1928:93:4;1975:13;2007:7;2000:14;;;;;:::i;13465:613:2:-;-1:-1:-1;;;;;13609:18:2;;13557:7;13609:18;;;:12;:18;;;;;;;;13576:51;;;;;;;;;;;;;;;;;13557:7;;13576:51;;13609:18;13576:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13637:11;13651:13;:20;13637:34;;13686:3;13693:1;13686:8;13682:22;;13703:1;13696:8;;;;;;13682:22;13715:12;13757:3;13771:227;13785:5;13778:4;:12;13771:227;;;13806:11;13837:1;13821:12;13828:5;13821:4;:12;:::i;:::-;13820:18;;;;:::i;:::-;13806:32;;13877:12;13856:13;13870:3;13856:18;;;;;;;;:::i;:::-;;;;;;;:33;13852:136;;;13916:7;:3;13922:1;13916:7;:::i;:::-;13909:14;;13852:136;;;13970:3;13962:11;;13852:136;13792:206;13771:227;;;14012:4;14020:1;14012:9;14008:23;;14030:1;14023:8;;;;;;;;14008:23;14048:13;14062:8;14069:1;14062:4;:8;:::i;:::-;14048:23;;;;;;;;:::i;:::-;;;;;;;14041:30;;;;;;13465:613;;;;:::o;14966:230::-;15052:4;719:10:3;15106:28:2;719:10:3;15123:2:2;15127:6;15106:9;:28::i;:::-;15144:24;15153:10;15165:2;15144:8;:24::i;2583:49::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;21209:165::-;21284:7;21364:2;21311:44;21328:6;21336:18;21311:16;:44::i;:::-;:50;;21358:3;21311:50;:::i;:::-;:55;;;;:::i;18313:1506::-;18427:7;1384:19:14;:17;:19::i;:::-;18446:15:2::1;18454:6;18446:7;:15::i;:::-;719:10:3::0;-1:-1:-1;;;;;18476:21:2;::::1;;18472:96;;18513:44;18529:5:::0;719:10:3;18550:6:2::1;18513:15;:44::i;:::-;18594:14;18611:23;18627:6;18611:15;:23::i;:::-;18594:40;;18644:17;18664:18;18676:5;18664:11;:18::i;:::-;18644:38;;18705:9;18696:6;:18;18692:83;;;18723:52;::::0;-1:-1:-1;;;18723:52:2;;-1:-1:-1;;;;;12271:32:19;;18723:52:2::1;::::0;::::1;12253:51:19::0;12320:18;;;12313:34;;;12363:18;;;12356:34;;;12226:18;;18723:52:2::1;12051:345:19::0;18692:83:2::1;18794:20;18800:5;18807:6;18794:5;:20::i;:::-;18846:6;18824:18;;:28;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;18868:55:2::1;::::0;;11466:25:19;;;11522:2;11507:18;;11500:34;;;-1:-1:-1;;;;;18868:55:2;;::::1;::::0;;;::::1;::::0;719:10:3;;18868:55:2::1;::::0;11439:18:19;18868:55:2::1;;;;;;;18933:39;18948:5;18955:16;18965:5;-1:-1:-1::0;;;;;3007:18:4;2981:7;3007:18;;;;;;;;;;;;2916:116;18955:16:2::1;18933:14;:39::i;:::-;18983:14;19000:17;19006:10;19000:5;:17::i;:::-;18983:34;;19027:13;19061;;19043:15;:31;;;;:::i;:::-;19027:47;;19084:33;19120:22;:20;:22::i;:::-;19161:9;::::0;:163:::1;::::0;-1:-1:-1;;;19161:163:2;;19084:58;;-1:-1:-1;;;;;;19161:9:2::1;::::0;:18:::1;::::0;:163:::1;::::0;19193:6;;19214:10:::1;::::0;19238:8;;19084:58;;19293:1:::1;::::0;19308:6;;19161:163:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19343:27;19373:31;19385:10;19397:6;19373:11;:31::i;:::-;19343:61;;19414:39;19446:6;19423:19;:29;;19414:8;:39::i;:::-;19472:10;1745:5;19508:11;;19486:19;:33;;;;:::i;:::-;19485:45;;;;:::i;:::-;19472:58;;19549:1;19544:2;:6;:38;;;;-1:-1:-1::0;19554:14:2::1;::::0;-1:-1:-1;;;;;19554:14:2::1;:28:::0;::::1;19544:38;19541:157;;;19597:25;19620:2:::0;19597:25;::::1;:::i;:::-;19668:14;::::0;19597:25;;-1:-1:-1;19636:51:2::1;::::0;-1:-1:-1;;;;;19643:10:2::1;19636:31:::0;::::1;::::0;19668:14:::1;19684:2:::0;19636:31:::1;:51::i;:::-;19708:62;-1:-1:-1::0;;;;;19715:10:2::1;19708:31;19740:8:::0;19750:19;19708:31:::1;:62::i;:::-;-1:-1:-1::0;19793:19:2;18313:1506;-1:-1:-1;;;;;;;;;18313:1506:2:o;16377:108::-;16427:12;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16427:12:2;16458:20;:18;:20::i;:::-;16451:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16377:108;-1:-1:-1;16377:108:2:o;362:161:11:-;423:15;:13;:15::i;:::-;-1:-1:-1;;;;;452:26:11;;444:42;;;;-1:-1:-1;;;444:42:11;;13613:2:19;444:42:11;;;13595:21:19;13652:1;13632:18;;;13625:29;-1:-1:-1;;;13670:18:19;;;13663:33;13713:18;;444:42:11;13411:326:19;444:42:11;492:11;:26;;-1:-1:-1;;;;;;492:26:11;-1:-1:-1;;;;;492:26:11;;;;;;;;;;362:161::o;2436:21:2:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2436:21:2;;;;;;;:::o;20893:147::-;20972:7;20998:35;21026:6;20998:27;:35::i;6639:153:5:-;-1:-1:-1;;;;;3007:18:4;;6704:7:5;3007:18:4;;;;;;;;;;;6730:55:5;;6747:16;2916:116:4;6827:112:5;-1:-1:-1;;;;;3007:18:4;;6890:7:5;3007:18:4;;;;;;;;;;;6916:16:5;2916:116:4;6116:187:2;1161:13:12;:11;:13::i;:::-;6193:31:2::1;6203:8;6213:2;6217:6;6193:9;:31::i;:::-;6234:9;:20:::0;;;6269:27:::1;::::0;160:25:19;;;6269:27:2::1;::::0;148:2:19;133:18;6269:27:2::1;14:177:19::0;6974:147:5;7043:7;7069:45;7086:6;7094:19;7069:16;:45::i;797:171:11:-;864:15;:13;:15::i;:::-;885:13;:24;;-1:-1:-1;;;;;885:24:11;;-1:-1:-1;;;;;;885:24:11;;;;;;;;945:7;1340:6:12;;-1:-1:-1;;;;;1340:6:12;;1268:85;945:7:11;-1:-1:-1;;;;;920:43:11;;;;;;;;;;;797:171;:::o;15701:256:2:-;1161:13:12;:11;:13::i;:::-;15792:9:2::1;::::0;-1:-1:-1;;;;;15792:9:2;;::::1;15775:27:::0;;::::1;::::0;15772:44:::1;;15811:5;;-1:-1:-1::0;;;15811:5:2::1;;;;;;;;;;;15772:44;15826:11;15840:12;15846:5;15840;:12::i;:::-;15826:26:::0;-1:-1:-1;15862:43:2::1;-1:-1:-1::0;;;;;15862:26:2;::::1;15889:10;15826:26:::0;15862::::1;:43::i;:::-;15920:30;::::0;;-1:-1:-1;;;;;10134:32:19;;10116:51;;10198:2;10183:18;;10176:34;;;15920:30:2::1;::::0;10089:18:19;15920:30:2::1;9942:274:19::0;7658:121:2;7734:38;;-1:-1:-1;;;7734:38:2;;7766:4;7734:38;;;3415:51:19;7709:7:2;;-1:-1:-1;;;;;7734:23:2;;;;;3388:18:19;;7734:38:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;21380:297::-;21486:7;21506:13;21521:11;21536;:9;:11::i;:::-;21505:42;;;;21557:19;21579:39;21588:6;21596:14;:12;:14::i;21579:39::-;21557:61;-1:-1:-1;21665:5:2;21651:9;21657:3;21651:2;:9;:::i;:::-;21636:25;;:11;:25;:::i;8613:128:4:-;8697:37;8706:5;8713:7;8722:5;8729:4;8697:8;:37::i;:::-;8613:128;;;:::o;20177:273:2:-;20261:7;20281:13;20296:11;20311;:9;:11::i;:::-;20280:42;;-1:-1:-1;20280:42:2;-1:-1:-1;20332:18:2;20374:9;20280:42;20374:2;:9;:::i;:::-;20354:14;20363:5;20354:6;:14;:::i;:::-;20353:31;;;;:::i;:::-;20332:52;;20401:42;20410:10;20422:14;:12;:14::i;:::-;20438:4;20401:8;:42::i;:::-;20394:49;20177:273;-1:-1:-1;;;;;20177:273:2:o;1912:128:14:-;1830:7;;-1:-1:-1;;;1830:7:14;;;;1973:61;;;2008:15;;-1:-1:-1;;;2008:15:14;;;;;;;;;;;5098:81:2;5152:1;5157;5152:6;5149:23;;5167:5;;-1:-1:-1;;;5167:5:2;;;;;;;;;;;601:189:16;714:68;;-1:-1:-1;;;;;11765:32:19;;;714:68:16;;;11747:51:19;11834:32;;11814:18;;;11807:60;11883:18;;;11876:34;;;701:82:16;;707:5;;-1:-1:-1;;;737:27:16;11720:18:19;;714:68:16;;;;-1:-1:-1;;714:68:16;;;;;;;;;;;;;;-1:-1:-1;;;;;714:68:16;-1:-1:-1;;;;;;714:68:16;;;;;;;;;;701:5;:82::i;:::-;601:189;;;;:::o;7785:180:2:-;7859:7;7878:12;7908:6;7893:12;7899:5;7893;:12::i;:::-;:21;;;;:::i;:::-;7878:36;;7924:13;7932:4;7924:7;:13::i;7971:132::-;8060:9;;8049:47;;-1:-1:-1;;;8049:47:2;;-1:-1:-1;;;;;8085:10:2;3433:32:19;;8049:47:2;;;3415:51:19;-1:-1:-1;;;;8060:9:2;;;8049:35;;3388:18:19;;8049:47:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8042:54;;;;7971:132;;:::o;8109:514::-;8193:7;8216:8;8212:223;;;8421:3;8389:17;1700:4;8389:6;:17;:::i;:::-;:28;;8410:6;8389:28;:::i;:::-;8388:36;;;;:::i;:::-;8381:43;;;;8212:223;8596:19;1700:4;8608:6;8596:19;:::i;:::-;8579:12;8588:3;8579:6;:12;:::i;:::-;8578:38;;;;:::i;:::-;8571:45;8109:514;-1:-1:-1;;;;8109:514:2:o;8632:290::-;8750:9;8728:18;;:31;;;;;;;:::i;:::-;;;;-1:-1:-1;8769:26:2;;-1:-1:-1;8775:8:2;8785:9;8769:5;:26::i;:::-;8805:45;8820:8;8830:19;8840:8;-1:-1:-1;;;;;3007:18:4;2981:7;3007:18;;;;;;;;;;;;2916:116;8805:45:2;8865:50;;;11466:25:19;;;11522:2;11507:18;;11500:34;;;-1:-1:-1;;;;;8865:50:2;;;719:10:3;;8865:50:2;;11439:18:19;8865:50:2;;;;;;;;8632:290;;;:::o;10302:476:4:-;-1:-1:-1;;;;;3544:18:4;;;10401:24;3544:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;-1:-1:-1;;10467:36:4;;10463:309;;;10542:5;10523:16;:24;10519:130;;;10574:60;;-1:-1:-1;;;10574:60:4;;-1:-1:-1;;;;;12271:32:19;;10574:60:4;;;12253:51:19;12320:18;;;12313:34;;;12363:18;;;12356:34;;;12226:18;;10574:60:4;12051:345:19;10519:130:4;10690:57;10699:5;10706:7;10734:5;10715:16;:24;10741:5;10690:8;:57::i;5280:300::-;-1:-1:-1;;;;;5363:18:4;;5359:86;;5404:30;;-1:-1:-1;;;5404:30:4;;5431:1;5404:30;;;3415:51:19;3388:18;;5404:30:4;3269:203:19;5359:86:4;-1:-1:-1;;;;;5458:16:4;;5454:86;;5497:32;;-1:-1:-1;;;5497:32:4;;5526:1;5497:32;;;3415:51:19;3388:18;;5497:32:4;3269:203:19;5454:86:4;5549:24;5557:4;5563:2;5567:5;5549:7;:24::i;15504:191:2:-;1384:19:14;:17;:19::i;:::-;15581:17:2::1;15589:4;15595:2;15581:7;:17::i;:::-;15608:37;15623:4;15629:15;15639:4;-1:-1:-1::0;;;;;3007:18:4;2981:7;3007:18;;;;;;;;;;;;2916:116;15608:37:2::1;15655:33;15670:2;15674:13;15684:2;-1:-1:-1::0;;;;;3007:18:4;2981:7;3007:18;;;;;;;;;;;;2916:116;15655:33:2::1;15504:191:::0;;:::o;1426:130:12:-;1340:6;;-1:-1:-1;;;;;1340:6:12;719:10:3;1489:23:12;1481:68;;;;-1:-1:-1;;;1481:68:12;;14292:2:19;1481:68:12;;;14274:21:19;;;14311:18;;;14304:30;14370:34;14350:18;;;14343:62;14422:18;;1481:68:12;14090:356:19;2112:126:14;1830:7;;-1:-1:-1;;;1830:7:14;;;;2170:62;;2206:15;;-1:-1:-1;;;2206:15:14;;;;;;;;;;;5001:91:2;-1:-1:-1;;;;;5056:15:2;;5053:32;;5080:5;;-1:-1:-1;;;5080:5:2;;;;;;;;;;;434:161:16;529:58;;-1:-1:-1;;;;;10134:32:19;;529:58:16;;;10116:51:19;10183:18;;;10176:34;;;516:72:16;;522:5;;-1:-1:-1;;;552:23:16;10089:18:19;;529:58:16;9942:274:19;2620:117:14;1631:16;:14;:16::i;:::-;2678:7:::1;:15:::0;;-1:-1:-1;;;;2678:15:14::1;::::0;;2708:22:::1;719:10:3::0;2717:12:14::1;2708:22;::::0;-1:-1:-1;;;;;3433:32:19;;;3415:51;;3403:2;3388:18;2708:22:14::1;;;;;;;2620:117::o:0;5272:91:2:-;5341:1;5337;:5;5334:22;;;5351:5;;-1:-1:-1;;;5351:5:2;;;;;;;;;;;11091:702;-1:-1:-1;;;;;11212:14:2;;11170:7;11212:14;;;:8;:14;;;;;;;;:23;;;;;;;;11189:46;;;;;;;;;;;;;;;;;;;;11170:7;;11189:46;;;;11212:23;;11189:46;11170:7;;11189:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11249:4;:16;;;:23;11276:1;11249:28;11245:42;;11286:1;11279:8;;;;;11245:42;11298:18;11319:6;11326:11;11336:1;11326:7;:11;:::i;:::-;11319:19;;;;;;;;:::i;:::-;;;;;;;;;11298:40;;;;;;;;11319:19;;;;;;;11298:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11387:16;;11404:23;;11298:40;;-1:-1:-1;11387:16:2;11404:27;;11298:40;11404:27;:::i;:::-;11387:45;;;;;;;;:::i;:::-;;;;;;;11348:84;;11451:21;11475:14;:21;;;11451:45;;11506:17;11542:14;:24;;;11526:5;:13;;;:40;;;;:::i;:::-;11506:60;;11618:9;11593:14;:22;;;:34;;;;:::i;:::-;11576:51;;;;:::i;:::-;;;11646:17;11682:5;:15;;;11666:5;:13;;;:31;;;;:::i;:::-;11646:51;;11711:9;11724:1;11711:14;11707:28;;11734:1;11727:8;;;;;;;;;;11707:28;11761:25;11777:9;11761:13;:25;:::i;:::-;11754:32;11091:702;-1:-1:-1;;;;;;;;;11091:702:2:o;14084:425::-;14183:7;14202:19;14224:45;14250:4;14256:12;14224:25;:45::i;:::-;14202:67;;14283:11;14298:1;14283:16;14279:30;;14308:1;14301:8;;;;;14279:30;-1:-1:-1;;;;;14344:14:2;;14320:21;14344:14;;;:8;:14;;;;;;;;:27;;;;;;;;14398:23;;14344:27;;14435:11;;;14431:25;;14455:1;14448:8;;;;;;;14431:25;14473:21;14489:4;14473:15;:21::i;:::-;:29;;;;14084:425;-1:-1:-1;;;;;;14084:425:2:o;1591:153:10:-;1680:13;1673:20;;-1:-1:-1;;;;;;1673:20:10;;;1703:34;1728:8;1703:24;:34::i;5496:91:2:-;5565:1;-1:-1:-1;;;;;5560:6:2;:1;-1:-1:-1;;;;;5560:6:2;;5557:23;;5575:5;;-1:-1:-1;;;5575:5:2;;;;;;;;;;;12628:186;12733:6;:13;12681:19;;12733:17;;12749:1;12733:17;:::i;:::-;12715:14;;:35;12712:52;;12759:5;;-1:-1:-1;;;12759:5:2;;;;;;;;;;;12712:52;12781:6;12805:1;12788:14;;:18;;;;:::i;:::-;12781:26;;;;;;;;:::i;:::-;;;;;;;;;;;12774:33;;12628:186;:::o;11799:408::-;11844:18;11865:14;:12;:14::i;:::-;11910:168;;;;;;;;11941:15;11910:168;;;-1:-1:-1;11910:168:2;;;;;;;;;;;;;;;;;;;;;;;;;11898:6;:181;;11910:168;11898:181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;11898:181:2;;;;;;;;;;;12115:13;;12098:14;:30;;;12143:57;;11466:25:19;;;11507:18;;;11500:34;;;11910:168:2;;-1:-1:-1;12115:13:2;12143:57;;11439:18:19;12143:57:2;;;;;;;11834:373;11799:408::o;2373:115:14:-;1384:19;:17;:19::i;:::-;2432:7:::1;:14:::0;;-1:-1:-1;;;;2432:14:14::1;-1:-1:-1::0;;;2432:14:14::1;::::0;;2461:20:::1;2468:12;719:10:3::0;;640:96;7871:206:4;-1:-1:-1;;;;;7941:21:4;;7937:89;;7985:30;;-1:-1:-1;;;7985:30:4;;8012:1;7985:30;;;3415:51:19;3388:18;;7985:30:4;3269:203:19;7937:89:4;8035:35;8043:7;8060:1;8064:5;8035:7;:35::i;8932:2153:2:-;-1:-1:-1;;;;;9033:14:2;;9009:21;9033:14;;;:8;:14;;;;;;;;9048;;9033:30;;;;;;;9152:23;;9033:30;;9095:15;;9152:27;9148:1394;;9195:37;9235:21;9251:4;9235:15;:21::i;:::-;9296:24;;9195:61;;-1:-1:-1;9282:38:2;;:11;:38;:::i;:::-;9270:50;-1:-1:-1;9338:13:2;;9335:358;;9371:4;:16;;9393:211;;;;;;;;9441:11;9393:211;;;;9483:10;9393:211;;;;9574:9;9549:14;:22;;;:34;;;;:::i;:::-;9524:14;:21;;;:60;;;;:::i;:::-;9393:211;;9371:234;;;;;;;;-1:-1:-1;9371:234:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9335:358;;;9643:22;;;:35;;;9335:358;9181:522;9148:1394;;;-1:-1:-1;;;;;9726:17:2;;9746:1;9726:17;;;:11;:17;;;;;;:21;9723:809;;-1:-1:-1;;;;;9794:14:2;;9766:25;9794:14;;;:8;:14;;;;;;;;9809:11;:17;;;;;;9794:33;;;;;;;9906:27;;9794:33;;9766:25;9794:33;;9906:31;;9936:1;;9906:31;:::i;:::-;9885:53;;;;;;;;:::i;:::-;;;;;;;;;;;9845:93;;9956:18;9977:6;10001:1;9984:14;;:18;;;;:::i;:::-;9977:26;;;;;;;;:::i;:::-;;;;;;;;;;9956:47;;;;;;;;9977:26;;;;;;;9956:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10033:29:2;;:11;:29;:::i;:::-;10021:41;;10097:4;:16;;10119:185;;;;;;;;10167:11;10119:185;;;;10209:10;10119:185;;;;10275:9;10250:14;:22;;;:34;;;;:::i;:::-;10119:185;;10097:208;;;;;;;;-1:-1:-1;10097:208:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9723:809:2;;-1:-1:-1;;9723:809:2;;10366:150;;;;;;;;;;;;;;;;;;10344:16;10366:150;;;;;;10344:173;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9723:809;10560:19;;;:33;;;10623:14;;-1:-1:-1;;;;;10603:17:2;;;;;;:11;:17;;;;;;;;:34;;;10660:14;:20;;;;;:36;;;;;;;;;;10656:162;;-1:-1:-1;;;;;10711:20:2;;;;;;:14;:20;;;;;;;;10732:14;;;10711:36;;;;;;;;:43;;-1:-1:-1;;10711:43:2;10750:4;10711:43;;;;;;10768:18;;;:12;:18;;;;;10792:14;;10768:39;;;;;;;;;;;;;;;;10656:162;10867:9;;10840:23;;:36;10836:136;;10921:14;;10937:23;;10897:64;;160:25:19;;;-1:-1:-1;;;;;10897:64:2;;;;;148:2:19;133:18;10897:64:2;;;;;;;10836:136;11013:14;;11054:23;;10995:83;;;14653:25:19;;;14709:2;14694:18;;14687:34;;;14737:18;;;14730:34;;;;-1:-1:-1;;;;;10995:83:2;;;;;14641:2:19;14626:18;10995:83:2;;;;;;;8999:2086;;;8932:2153;;:::o;18137:170::-;18192:16;18220:12;18235:9;;;;;;;;;-1:-1:-1;;;;;18235:9:2;-1:-1:-1;;;;;18235:20:2;;:22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;18235:22:2;;;;;;;;;;;;:::i;:::-;:29;18220:44;;18295:4;18281:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;18281:19:2;;18274:26;;;18137:170;:::o;5185:81::-;5241:4;5237:22;;5254:5;;-1:-1:-1;;;5254:5:2;;;;;;;;;;;268:90:11;335:11;;-1:-1:-1;;;;;335:11:11;321:10;:25;313:40;;;;-1:-1:-1;;;313:40:11;;16249:2:19;313:40:11;;;16231:21:19;16288:1;16268:18;;;16261:29;-1:-1:-1;;;16306:18:19;;;16299:32;16348:18;;313:40:11;16047:325:19;5369:121:2;5455:3;5451:1;:7;:18;;;;5466:3;5462:1;:7;5451:18;5448:35;;;5478:5;;-1:-1:-1;;;5478:5:2;;;;;;;;;;;19824:346;19930:7;19950:13;19965:11;19980;:9;:11::i;:::-;19949:42;;-1:-1:-1;19949:42:2;-1:-1:-1;20020:12:2;20029:3;20020:6;:12;:::i;:::-;20010:23;;:6;:23;:::i;:::-;20001:32;-1:-1:-1;20053:18:2;20094:9;20100:3;20094:2;:9;:::i;:::-;20075:14;20084:5;20075:6;:14;:::i;:::-;20074:30;;;;:::i;:::-;20053:51;;20121:42;20130:10;20142:14;:12;:14::i;9588:432:4:-;-1:-1:-1;;;;;9700:19:4;;9696:89;;9742:32;;-1:-1:-1;;;9742:32:4;;9771:1;9742:32;;;3415:51:19;3388:18;;9742:32:4;3269:203:19;9696:89:4;-1:-1:-1;;;;;9798:21:4;;9794:90;;9842:31;;-1:-1:-1;;;9842:31:4;;9870:1;9842:31;;;3415:51:19;3388:18;;9842:31:4;3269:203:19;9794:90:4;-1:-1:-1;;;;;9893:18:4;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;:35;;;9938:76;;;;9988:7;-1:-1:-1;;;;;9972:31:4;9981:5;-1:-1:-1;;;;;9972:31:4;;9997:5;9972:31;;;;160:25:19;;148:2;133:18;;14:177;9972:31:4;;;;;;;;9588:432;;;;:::o;2191:240:16:-;2257:23;2283:33;-1:-1:-1;;;;;2283:27:16;;2311:4;2283:27;:33::i;:::-;2330:17;;2257:59;;-1:-1:-1;2330:21:16;2326:99;;2382:10;2371:30;;;;;;;;;;;;:::i;:::-;2367:47;;2410:4;;-1:-1:-1;;;2410:4:16;;;;;;;;;;;7345:208:4;-1:-1:-1;;;;;7415:21:4;;7411:91;;7459:32;;-1:-1:-1;;;7459:32:4;;7488:1;7459:32;;;3415:51:19;3388:18;;7459:32:4;3269:203:19;7411:91:4;7511:35;7527:1;7531:7;7540:5;5895:1107;-1:-1:-1;;;;;5984:18:4;;5980:540;;6136:5;6120:12;;:21;;;;;;;:::i;:::-;;;;-1:-1:-1;5980:540:4;;-1:-1:-1;5980:540:4;;-1:-1:-1;;;;;6194:15:4;;6172:19;6194:15;;;;;;;;;;;6227:19;;;6223:115;;;6273:50;;-1:-1:-1;;;6273:50:4;;-1:-1:-1;;;;;12271:32:19;;6273:50:4;;;12253:51:19;12320:18;;;12313:34;;;12363:18;;;12356:34;;;12226:18;;6273:50:4;12051:345:19;6223:115:4;-1:-1:-1;;;;;6458:15:4;;:9;:15;;;;;;;;;;6476:19;;;;6458:37;;5980:540;-1:-1:-1;;;;;6534:16:4;;6530:425;;6697:12;:21;;;;;;;6530:425;;;-1:-1:-1;;;;;6908:13:4;;:9;:13;;;;;;;;;;:22;;;;;;6530:425;6985:2;-1:-1:-1;;;;;6970:25:4;6979:4;-1:-1:-1;;;;;6970:25:4;;6989:5;6970:25;;;;160::19;;148:2;133:18;;14:177;5593:92:2;5663:1;-1:-1:-1;;;;;5658:6:2;:1;-1:-1:-1;;;;;5658:6:2;;5655:23;;5673:5;;-1:-1:-1;;;5673:5:2;;;;;;;;;;;14515:164;14644:23;;14586:22;;14627:4;;14644:27;;14670:1;;14644:27;:::i;:::-;14627:45;;;;;;;;:::i;:::-;;;;;;;;;;;14620:52;;14515:164;;;:::o;2534:187:12:-;2626:6;;;-1:-1:-1;;;;;2642:17:12;;;-1:-1:-1;;;;;;2642:17:12;;;;;;;2674:40;;2626:6;;;2642:17;2626:6;;2674:40;;2607:16;;2674:40;2597:124;2534:187;:::o;3466:185:0:-;3541:12;3572:72;3594:6;3602:4;3608:1;3572:72;;;;;;;;;;;;;;;;;5125:12;5182:5;5157:21;:30;;5149:81;;;;-1:-1:-1;;;5149:81:0;;16579:2:19;5149:81:0;;;16561:21:19;16618:2;16598:18;;;16591:30;16657:34;16637:18;;;16630:62;-1:-1:-1;;;16708:18:19;;;16701:36;16754:19;;5149:81:0;16377:402:19;5149:81:0;5241:12;5255:23;5282:6;-1:-1:-1;;;;;5282:11:0;5301:5;5308:4;5282:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5240:73;;;;5330:69;5357:6;5365:7;5374:10;5386:12;5330:26;:69::i;:::-;5323:76;4960:446;-1:-1:-1;;;;;;;4960:446:0:o;7466:628::-;7646:12;7674:7;7670:418;;;7701:10;:17;7722:1;7701:22;7697:286;;-1:-1:-1;;;;;1465:19:0;;;7908:60;;;;-1:-1:-1;;;7908:60:0;;17292:2:19;7908:60:0;;;17274:21:19;17331:2;17311:18;;;17304:30;17370:31;17350:18;;;17343:59;17419:18;;7908:60:0;17090:353:19;7908:60:0;-1:-1:-1;8003:10:0;7996:17;;7670:418;8044:33;8052:10;8064:12;8775:17;;:21;8771:379;;9003:10;8997:17;9059:15;9046:10;9042:2;9038:19;9031:44;8771:379;9126:12;9119:20;;-1:-1:-1;;;9119:20:0;;;;;;;196:418:19;345:2;334:9;327:21;308:4;377:6;371:13;420:6;415:2;404:9;400:18;393:34;479:6;474:2;466:6;462:15;457:2;446:9;442:18;436:50;535:1;530:2;521:6;510:9;506:22;502:31;495:42;605:2;598;594:7;589:2;581:6;577:15;573:29;562:9;558:45;554:54;546:62;;;196:418;;;;:::o;619:226::-;678:6;731:2;719:9;710:7;706:23;702:32;699:52;;;747:1;744;737:12;699:52;-1:-1:-1;792:23:19;;619:226;-1:-1:-1;619:226:19:o;850:131::-;-1:-1:-1;;;;;925:31:19;;915:42;;905:70;;971:1;968;961:12;986:367;1054:6;1062;1115:2;1103:9;1094:7;1090:23;1086:32;1083:52;;;1131:1;1128;1121:12;1083:52;1170:9;1157:23;1189:31;1214:5;1189:31;:::i;:::-;1239:5;1317:2;1302:18;;;;1289:32;;-1:-1:-1;;;986:367:19:o;1550:::-;1618:6;1626;1679:2;1667:9;1658:7;1654:23;1650:32;1647:52;;;1695:1;1692;1685:12;1647:52;1740:23;;;-1:-1:-1;1839:2:19;1824:18;;1811:32;1852:33;1811:32;1852:33;:::i;:::-;1904:7;1894:17;;;1550:367;;;;;:::o;1922:508::-;1999:6;2007;2015;2068:2;2056:9;2047:7;2043:23;2039:32;2036:52;;;2084:1;2081;2074:12;2036:52;2123:9;2110:23;2142:31;2167:5;2142:31;:::i;:::-;2192:5;-1:-1:-1;2249:2:19;2234:18;;2221:32;2262:33;2221:32;2262:33;:::i;:::-;1922:508;;2314:7;;-1:-1:-1;;;2394:2:19;2379:18;;;;2366:32;;1922:508::o;2435:247::-;2494:6;2547:2;2535:9;2526:7;2522:23;2518:32;2515:52;;;2563:1;2560;2553:12;2515:52;2602:9;2589:23;2621:31;2646:5;2621:31;:::i;2687:388::-;2755:6;2763;2816:2;2804:9;2795:7;2791:23;2787:32;2784:52;;;2832:1;2829;2822:12;2784:52;2871:9;2858:23;2890:31;2915:5;2890:31;:::i;:::-;2940:5;-1:-1:-1;2997:2:19;2982:18;;2969:32;3010:33;2969:32;3010:33;:::i;3477:815::-;3731:2;3743:21;;;3813:13;;3716:18;;;3835:22;;;3683:4;;3914:15;;;3888:2;3873:18;;;3683:4;3957:309;3971:6;3968:1;3965:13;3957:309;;;4036:6;4030:13;4074:2;4068:9;4063:3;4056:22;4126:2;4122;4118:11;4112:18;4107:2;4102:3;4098:12;4091:40;4179:2;4175;4171:11;4165:18;4160:2;4155:3;4151:12;4144:40;;4213:4;4208:3;4204:14;4197:21;;4253:2;4245:6;4241:15;4231:25;;3993:1;3990;3986:9;3981:14;;3957:309;;;-1:-1:-1;4283:3:19;;3477:815;-1:-1:-1;;;;;3477:815:19:o;4297:118::-;4383:5;4376:13;4369:21;4362:5;4359:32;4349:60;;4405:1;4402;4395:12;4420:241;4476:6;4529:2;4517:9;4508:7;4504:23;4500:32;4497:52;;;4545:1;4542;4535:12;4497:52;4584:9;4571:23;4603:28;4625:5;4603:28;:::i;4666:508::-;4743:6;4751;4759;4812:2;4800:9;4791:7;4787:23;4783:32;4780:52;;;4828:1;4825;4818:12;4780:52;4873:23;;;-1:-1:-1;4972:2:19;4957:18;;4944:32;4985:33;4944:32;4985:33;:::i;:::-;5037:7;-1:-1:-1;5096:2:19;5081:18;;5068:32;5109:33;5068:32;5109:33;:::i;:::-;5161:7;5151:17;;;4666:508;;;;;:::o;6382:380::-;6461:1;6457:12;;;;6504;;;6525:61;;6579:4;6571:6;6567:17;6557:27;;6525:61;6632:2;6624:6;6621:14;6601:18;6598:38;6595:161;;6678:10;6673:3;6669:20;6666:1;6659:31;6713:4;6710:1;6703:15;6741:4;6738:1;6731:15;6595:161;;6382:380;;;:::o;6767:127::-;6828:10;6823:3;6819:20;6816:1;6809:31;6859:4;6856:1;6849:15;6883:4;6880:1;6873:15;6899:128;6966:9;;;6987:11;;;6984:37;;;7001:18;;:::i;7032:168::-;7105:9;;;7136;;7153:15;;;7147:22;;7133:37;7123:71;;7174:18;;:::i;7205:217::-;7245:1;7271;7261:132;;7315:10;7310:3;7306:20;7303:1;7296:31;7350:4;7347:1;7340:15;7378:4;7375:1;7368:15;7261:132;-1:-1:-1;7407:9:19;;7205:217::o;7427:375::-;7515:1;7533:5;7547:249;7568:1;7558:8;7555:15;7547:249;;;7618:4;7613:3;7609:14;7603:4;7600:24;7597:50;;;7627:18;;:::i;:::-;7677:1;7667:8;7663:16;7660:49;;;7691:16;;;;7660:49;7774:1;7770:16;;;;;7730:15;;7547:249;;;7427:375;;;;;;:::o;7807:902::-;7856:5;7886:8;7876:80;;-1:-1:-1;7927:1:19;7941:5;;7876:80;7975:4;7965:76;;-1:-1:-1;8012:1:19;8026:5;;7965:76;8057:4;8075:1;8070:59;;;;8143:1;8138:174;;;;8050:262;;8070:59;8100:1;8091:10;;8114:5;;;8138:174;8175:3;8165:8;8162:17;8159:43;;;8182:18;;:::i;:::-;-1:-1:-1;;8238:1:19;8224:16;;8297:5;;8050:262;;8396:2;8386:8;8383:16;8377:3;8371:4;8368:13;8364:36;8358:2;8348:8;8345:16;8340:2;8334:4;8331:12;8327:35;8324:77;8321:203;;;-1:-1:-1;8433:19:19;;;8509:5;;8321:203;8556:42;-1:-1:-1;;8581:8:19;8575:4;8556:42;:::i;:::-;8634:6;8630:1;8626:6;8622:19;8613:7;8610:32;8607:58;;;8645:18;;:::i;:::-;8683:20;;7807:902;-1:-1:-1;;;7807:902:19:o;8714:131::-;8774:5;8803:36;8830:8;8824:4;8803:36;:::i;8850:230::-;8920:6;8973:2;8961:9;8952:7;8948:23;8944:32;8941:52;;;8989:1;8986;8979:12;8941:52;-1:-1:-1;9034:16:19;;8850:230;-1:-1:-1;8850:230:19:o;9085:138::-;9164:13;;9186:31;9164:13;9186:31;:::i;:::-;9085:138;;;:::o;9228:251::-;9298:6;9351:2;9339:9;9330:7;9326:23;9322:32;9319:52;;;9367:1;9364;9357:12;9319:52;9399:9;9393:16;9418:31;9443:5;9418:31;:::i;9789:148::-;9877:4;9856:12;;;9870;;;9852:31;;9895:13;;9892:39;;;9911:18;;:::i;10221:127::-;10282:10;10277:3;10273:20;10270:1;10263:31;10313:4;10310:1;10303:15;10337:4;10334:1;10327:15;10353:245;10420:6;10473:2;10461:9;10452:7;10448:23;10444:32;10441:52;;;10489:1;10486;10479:12;10441:52;10521:9;10515:16;10540:28;10562:5;10540:28;:::i;11921:125::-;11986:9;;;12007:10;;;12004:36;;;12020:18;;:::i;12401:1005::-;12691:4;12739:3;12728:9;12724:19;12770:6;12759:9;12752:25;12842:1;12838;12833:3;12829:11;12825:19;12817:6;12813:32;12808:2;12797:9;12793:18;12786:60;12882:6;12877:2;12866:9;12862:18;12855:34;12925:3;12920:2;12909:9;12905:18;12898:31;12949:6;12984;12978:13;13015:6;13007;13000:22;13053:3;13042:9;13038:19;13031:26;;13092:2;13084:6;13080:15;13066:29;;13113:1;13123:169;13137:6;13134:1;13131:13;13123:169;;;13198:13;;13186:26;;13241:2;13267:15;;;;13232:12;;;;13159:1;13152:9;13123:169;;;-1:-1:-1;;13343:3:19;13328:19;;13321:35;;;;-1:-1:-1;;13387:3:19;13372:19;13365:35;13309:3;12401:1005;-1:-1:-1;;;;12401:1005:19:o;13742:343::-;13821:6;13829;13882:2;13870:9;13861:7;13857:23;13853:32;13850:52;;;13898:1;13895;13888:12;13850:52;-1:-1:-1;;13943:16:19;;14049:2;14034:18;;;14028:25;13943:16;;14028:25;;-1:-1:-1;13742:343:19:o;14775:127::-;14836:10;14831:3;14827:20;14824:1;14817:31;14867:4;14864:1;14857:15;14891:4;14888:1;14881:15;14907:1135;15002:6;15055:2;15043:9;15034:7;15030:23;15026:32;15023:52;;;15071:1;15068;15061:12;15023:52;15104:9;15098:16;15137:18;15129:6;15126:30;15123:50;;;15169:1;15166;15159:12;15123:50;15192:22;;15245:4;15237:13;;15233:27;-1:-1:-1;15223:55:19;;15274:1;15271;15264:12;15223:55;15307:2;15301:9;15333:18;15325:6;15322:30;15319:56;;;15355:18;;:::i;:::-;15401:6;15398:1;15394:14;15437:2;15431:9;15500:2;15496:7;15491:2;15487;15483:11;15479:25;15471:6;15467:38;15571:6;15559:10;15556:22;15535:18;15523:10;15520:34;15517:62;15514:88;;;15582:18;;:::i;:::-;15618:2;15611:22;15668;;;15718:2;15748:11;;;15744:20;;;15668:22;15706:15;;15776:19;;;15773:39;;;15808:1;15805;15798:12;15773:39;15840:2;15836;15832:11;15821:22;;15852:159;15868:6;15863:3;15860:15;15852:159;;;15934:34;15964:3;15934:34;:::i;:::-;15922:47;;15998:2;15885:12;;;;15989;15852:159;;;-1:-1:-1;16030:6:19;14907:1135;-1:-1:-1;;;;;;14907:1135:19:o;16784:301::-;16913:3;16951:6;16945:13;16997:6;16990:4;16982:6;16978:17;16973:3;16967:37;17059:1;17023:16;;17048:13;;;-1:-1:-1;17023:16:19;16784:301;-1:-1:-1;16784:301:19:o
Swarm Source
ipfs://eca00774742f699fbaec134dcf523f837276d5bd6c9f710a9237008d5f1ed77b
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.
Add Token to MetaMask (Web3)