Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers.
Latest 7 internal transactions
Advanced mode:
Loading...
Loading
Contract Name:
BoringOnChainQueue
Compiler Version
v0.8.21+commit.d9974bed
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {ERC20} from "@solmate/tokens/ERC20.sol"; import {WETH} from "@solmate/tokens/WETH.sol"; import {BoringVault} from "src/base/BoringVault.sol"; import {AccountantWithRateProviders} from "src/base/Roles/AccountantWithRateProviders.sol"; import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol"; import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol"; import {BeforeTransferHook} from "src/interfaces/BeforeTransferHook.sol"; import {Auth, Authority} from "@solmate/auth/Auth.sol"; import {ReentrancyGuard} from "@solmate/utils/ReentrancyGuard.sol"; import {IPausable} from "src/interfaces/IPausable.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import {IBoringSolver} from "src/base/Roles/BoringQueue/IBoringSolver.sol"; contract BoringOnChainQueue is Auth, ReentrancyGuard, IPausable { using EnumerableSet for EnumerableSet.Bytes32Set; using SafeTransferLib for BoringVault; using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; // ========================================= STRUCTS ========================================= /** * @param allowWithdraws Whether or not withdraws are allowed for this asset. * @param secondsToMaturity The time in seconds it takes for the asset to mature. * @param minimumSecondsToDeadline The minimum time in seconds a withdraw request must be valid for before it is expired * @param minDiscount The minimum discount allowed for a withdraw request. * @param maxDiscount The maximum discount allowed for a withdraw request. * @param minimumShares The minimum amount of shares that can be withdrawn. * @param withdrawCapacity The maximum amount of total shares that can be withdrawn. * - Can be set to type(uint256).max to allow unlimited withdraws. * - Decremented when users make requests. * - Incremented when users cancel requests. * - Can be set by admin. */ struct WithdrawAsset { bool allowWithdraws; uint24 secondsToMaturity; uint24 minimumSecondsToDeadline; uint16 minDiscount; uint16 maxDiscount; uint96 minimumShares; uint256 withdrawCapacity; } /** * @param nonce The nonce of the request, used to make it impossible for request Ids to be repeated. * @param user The user that made the request. * @param assetOut The asset that the user wants to withdraw. * @param amountOfShares The amount of shares the user wants to withdraw. * @param amountOfAssets The amount of assets the user will receive. * @param creationTime The time the request was made. * @param secondsToMaturity The time in seconds it takes for the asset to mature. * @param secondsToDeadline The time in seconds the request is valid for. */ struct OnChainWithdraw { uint96 nonce; // read from state, used to make it impossible for request Ids to be repeated. address user; // msg.sender address assetOut; // input sanitized uint128 amountOfShares; // input transfered in uint128 amountOfAssets; // derived from amountOfShares and price uint40 creationTime; // time withdraw was made uint24 secondsToMaturity; // in contract, from withdrawAsset? uint24 secondsToDeadline; // in contract, from withdrawAsset? To get the deadline you take the creationTime add seconds to maturity, add the secondsToDeadline } // ========================================= CONSTANTS ========================================= /** * @notice The maximum discount allowed for a withdraw asset. */ uint16 internal constant MAX_DISCOUNT = 0.3e4; /** * @notice The maximum time in seconds a withdraw asset can take to mature. */ uint24 internal constant MAXIMUM_SECONDS_TO_MATURITY = 30 days; /** * @notice Caps the minimum time in seconds a withdraw request must be valid for before it is expired. */ uint24 internal constant MAXIMUM_MINIMUM_SECONDS_TO_DEADLINE = 30 days; // ========================================= MODIFIERS ========================================= /** * @notice Ensure that the request user is the same as the message sender. */ modifier onlyRequestUser(address requestUser, address msgSender) { if (requestUser != msgSender) revert BoringOnChainQueue__BadUser(); _; } // ========================================= GLOBAL STATE ========================================= /** * @notice Open Zeppelin EnumerableSet to store all withdraw requests, by there request Id. */ EnumerableSet.Bytes32Set private _withdrawRequests; /** * @notice Mapping of asset addresses to WithdrawAssets. */ mapping(address => WithdrawAsset) public withdrawAssets; /** * @notice The nonce of the next request. * @dev The purpose of this nonce is to prevent request Ids from being repeated. * @dev Start at 1, since 0 is considered invalid. * @dev When incrementing the nonce, an unchecked block is used to save gas. * This is safe because you can not feasibly make a request, and then cause an overflow * in the same block such that you can make 2 requests with the same request Id. * And even if you did, the tx would revert with a keccak256 collision error. */ uint96 public nonce = 1; /** * @notice Whether or not the contract is paused. */ bool public isPaused; //============================== ERRORS =============================== error BoringOnChainQueue__Paused(); error BoringOnChainQueue__WithdrawsNotAllowedForAsset(); error BoringOnChainQueue__BadDiscount(); error BoringOnChainQueue__BadShareAmount(); error BoringOnChainQueue__BadDeadline(); error BoringOnChainQueue__BadUser(); error BoringOnChainQueue__DeadlinePassed(); error BoringOnChainQueue__NotMatured(); error BoringOnChainQueue__Keccak256Collision(); error BoringOnChainQueue__RequestNotFound(); error BoringOnChainQueue__PermitFailedAndAllowanceTooLow(); error BoringOnChainQueue__MAX_DISCOUNT(); error BoringOnChainQueue__MAXIMUM_MINIMUM_SECONDS_TO_DEADLINE(); error BoringOnChainQueue__SolveAssetMismatch(); error BoringOnChainQueue__Overflow(); error BoringOnChainQueue__MAXIMUM_SECONDS_TO_MATURITY(); error BoringOnChainQueue__BadInput(); error BoringOnChainQueue__RescueCannotTakeSharesFromActiveRequests(); error BoringOnChainQueue__NotEnoughWithdrawCapacity(); //============================== EVENTS =============================== event OnChainWithdrawRequested( bytes32 indexed requestId, address indexed user, address indexed assetOut, uint96 nonce, uint128 amountOfShares, uint128 amountOfAssets, uint40 creationTime, uint24 secondsToMaturity, uint24 secondsToDeadline ); event OnChainWithdrawCancelled(bytes32 indexed requestId, address indexed user, uint256 timestamp); event OnChainWithdrawSolved(bytes32 indexed requestId, address indexed user, uint256 timestamp); event WithdrawAssetStopped(address indexed assetOut); event WithdrawAssetUpdated( address indexed assetOut, uint24 secondsToMaturity, uint24 minimumSecondsToDeadline, uint16 minDiscount, uint16 maxDiscount, uint96 minimumShares ); event WithdrawCapacityUpdated(address indexed assetOut, uint256 withdrawCapacity); event Paused(); event Unpaused(); //============================== IMMUTABLES =============================== /** * @notice The BoringVault contract to withdraw from. */ BoringVault public immutable boringVault; /** * @notice The AccountantWithRateProviders contract to get rates from. */ AccountantWithRateProviders public immutable accountant; /** * @notice One BoringVault share. */ uint256 public immutable ONE_SHARE; constructor(address _owner, address _auth, address payable _boringVault, address _accountant) Auth(_owner, Authority(_auth)) { boringVault = BoringVault(_boringVault); ONE_SHARE = 10 ** boringVault.decimals(); accountant = AccountantWithRateProviders(_accountant); } //=============================== ADMIN FUNCTIONS ================================ /** * @notice Allows the owner to rescue tokens from the contract. * @dev The owner can only withdraw BoringVault shares if they are accidentally sent to this contract. * Shares from active withdraw requests are not withdrawable. * @param token The token to rescue. * @param amount The amount to rescue. * @param to The address to send the rescued tokens to. * @param activeRequests The active withdraw requests, query `getWithdrawRequests`, or read events to get them. * @dev Provided activeRequests must match the order of active requests in the queue. */ function rescueTokens(ERC20 token, uint256 amount, address to, OnChainWithdraw[] calldata activeRequests) external requiresAuth { if (address(token) == address(boringVault)) { bytes32[] memory requestIds = _withdrawRequests.values(); uint256 requestIdsLength = requestIds.length; if (activeRequests.length != requestIdsLength) revert BoringOnChainQueue__BadInput(); // Iterate through provided activeRequests, and hash each one to compare to the requestIds. // Also track the sum of shares to make sure it is less than or equal to the amount. uint256 activeRequestShareSum; for (uint256 i = 0; i < requestIdsLength; ++i) { if (keccak256(abi.encode(activeRequests[i])) != requestIds[i]) revert BoringOnChainQueue__BadInput(); activeRequestShareSum += activeRequests[i].amountOfShares; } uint256 freeShares = boringVault.balanceOf(address(this)) - activeRequestShareSum; if (amount == type(uint256).max) amount = freeShares; else if (amount > freeShares) revert BoringOnChainQueue__RescueCannotTakeSharesFromActiveRequests(); } else { if (amount == type(uint256).max) amount = token.balanceOf(address(this)); } token.safeTransfer(to, amount); } /** * @notice Pause this contract, which prevents future calls to any functions that * create new requests, or solve active requests. * @dev Callable by MULTISIG_ROLE. */ function pause() external requiresAuth { isPaused = true; emit Paused(); } /** * @notice Unpause this contract, which allows future calls to any functions that * create new requests, or solve active requests. * @dev Callable by MULTISIG_ROLE. */ function unpause() external requiresAuth { isPaused = false; emit Unpaused(); } /** * @notice Update a new withdraw asset or existing. * @dev Callable by MULTISIG_ROLE. * @param assetOut The asset to withdraw. * @param secondsToMaturity The time in seconds it takes for the withdraw to mature. * @param minimumSecondsToDeadline The minimum time in seconds a withdraw request must be valid for before it is expired. * @param minDiscount The minimum discount allowed for a withdraw request. * @param maxDiscount The maximum discount allowed for a withdraw request. * @param minimumShares The minimum amount of shares that can be withdrawn. */ function updateWithdrawAsset( address assetOut, uint24 secondsToMaturity, uint24 minimumSecondsToDeadline, uint16 minDiscount, uint16 maxDiscount, uint96 minimumShares ) external requiresAuth { // Validate input. if (maxDiscount > MAX_DISCOUNT) revert BoringOnChainQueue__MAX_DISCOUNT(); if (secondsToMaturity > MAXIMUM_SECONDS_TO_MATURITY) { revert BoringOnChainQueue__MAXIMUM_SECONDS_TO_MATURITY(); } if (minimumSecondsToDeadline > MAXIMUM_MINIMUM_SECONDS_TO_DEADLINE) { revert BoringOnChainQueue__MAXIMUM_MINIMUM_SECONDS_TO_DEADLINE(); } if (minDiscount > maxDiscount) revert BoringOnChainQueue__BadDiscount(); // Make sure accountant can price it. accountant.getRateInQuoteSafe(ERC20(assetOut)); withdrawAssets[assetOut] = WithdrawAsset({ allowWithdraws: true, secondsToMaturity: secondsToMaturity, minimumSecondsToDeadline: minimumSecondsToDeadline, minDiscount: minDiscount, maxDiscount: maxDiscount, minimumShares: minimumShares, withdrawCapacity: type(uint256).max }); emit WithdrawAssetUpdated( assetOut, secondsToMaturity, minimumSecondsToDeadline, minDiscount, maxDiscount, minimumShares ); } /** * @notice Stop withdraws in an asset. * @dev Callable by MULTISIG_ROLE. * @param assetOut The asset to stop withdraws in. */ function stopWithdrawsInAsset(address assetOut) external requiresAuth { withdrawAssets[assetOut].allowWithdraws = false; emit WithdrawAssetStopped(assetOut); } /** * @notice Set the withdraw capacity for an asset. * @dev Callable by STRATEGIST_MULTISIG_ROLE. * @param assetOut The asset to set the withdraw capacity for. * @param withdrawCapacity The new withdraw capacity. */ function setWithdrawCapacity(address assetOut, uint256 withdrawCapacity) external requiresAuth { withdrawAssets[assetOut].withdrawCapacity = withdrawCapacity; emit WithdrawCapacityUpdated(assetOut, withdrawCapacity); } /** * @notice Cancel multiple user withdraws. * @dev Callable by STRATEGIST_MULTISIG_ROLE. */ function cancelUserWithdraws(OnChainWithdraw[] calldata requests) external requiresAuth returns (bytes32[] memory canceledRequestIds) { uint256 requestsLength = requests.length; canceledRequestIds = new bytes32[](requestsLength); for (uint256 i = 0; i < requestsLength; ++i) { canceledRequestIds[i] = _cancelOnChainWithdraw(requests[i]); } } //=============================== USER FUNCTIONS ================================ /** * @notice Request an on-chain withdraw. * @param assetOut The asset to withdraw. * @param amountOfShares The amount of shares to withdraw. * @param discount The discount to apply to the withdraw in bps. * @param secondsToDeadline The time in seconds the request is valid for. * @return requestId The request Id. */ function requestOnChainWithdraw(address assetOut, uint128 amountOfShares, uint16 discount, uint24 secondsToDeadline) external virtual requiresAuth returns (bytes32 requestId) { _decrementWithdrawCapacity(assetOut, amountOfShares); WithdrawAsset memory withdrawAsset = withdrawAssets[assetOut]; _beforeNewRequest(withdrawAsset, amountOfShares, discount, secondsToDeadline); boringVault.safeTransferFrom(msg.sender, address(this), amountOfShares); (requestId,) = _queueOnChainWithdraw( msg.sender, assetOut, amountOfShares, discount, withdrawAsset.secondsToMaturity, secondsToDeadline ); } /** * @notice Request an on-chain withdraw with permit. * @param assetOut The asset to withdraw. * @param amountOfShares The amount of shares to withdraw. * @param discount The discount to apply to the withdraw in bps. * @param secondsToDeadline The time in seconds the request is valid for. * @param permitDeadline The deadline for the permit. * @param v The v value of the permit signature. * @param r The r value of the permit signature. * @param s The s value of the permit signature. * @return requestId The request Id. */ function requestOnChainWithdrawWithPermit( address assetOut, uint128 amountOfShares, uint16 discount, uint24 secondsToDeadline, uint256 permitDeadline, uint8 v, bytes32 r, bytes32 s ) external virtual requiresAuth returns (bytes32 requestId) { _decrementWithdrawCapacity(assetOut, amountOfShares); WithdrawAsset memory withdrawAsset = withdrawAssets[assetOut]; _beforeNewRequest(withdrawAsset, amountOfShares, discount, secondsToDeadline); try boringVault.permit(msg.sender, address(this), amountOfShares, permitDeadline, v, r, s) {} catch { if (boringVault.allowance(msg.sender, address(this)) < amountOfShares) { revert BoringOnChainQueue__PermitFailedAndAllowanceTooLow(); } } boringVault.safeTransferFrom(msg.sender, address(this), amountOfShares); (requestId,) = _queueOnChainWithdraw( msg.sender, assetOut, amountOfShares, discount, withdrawAsset.secondsToMaturity, secondsToDeadline ); } /** * @notice Cancel an on-chain withdraw. * @param request The request to cancel. * @return requestId The request Id. */ function cancelOnChainWithdraw(OnChainWithdraw memory request) external virtual requiresAuth returns (bytes32 requestId) { requestId = _cancelOnChainWithdrawWithUserCheck(request); } /** * @notice Replace an on-chain withdraw. * @param oldRequest The request to replace. * @param discount The discount to apply to the new withdraw request in bps. * @param secondsToDeadline The time in seconds the new withdraw request is valid for. * @return oldRequestId The request Id of the old withdraw request. * @return newRequestId The request Id of the new withdraw request. */ function replaceOnChainWithdraw(OnChainWithdraw memory oldRequest, uint16 discount, uint24 secondsToDeadline) external virtual requiresAuth returns (bytes32 oldRequestId, bytes32 newRequestId) { (oldRequestId, newRequestId) = _replaceOnChainWithdraw(oldRequest, discount, secondsToDeadline); } //============================== SOLVER FUNCTIONS =============================== /** * @notice Solve multiple on-chain withdraws. * @dev If `solveData` is empty, this contract will skip the callback function. * @param requests The requests to solve. * @param solveData The data to use to solve the requests. * @param solver The address of the solver. */ function solveOnChainWithdraws(OnChainWithdraw[] calldata requests, bytes calldata solveData, address solver) external requiresAuth { if (isPaused) revert BoringOnChainQueue__Paused(); ERC20 solveAsset = ERC20(requests[0].assetOut); uint256 requiredAssets; uint256 totalShares; uint256 requestsLength = requests.length; for (uint256 i = 0; i < requestsLength; ++i) { if (address(solveAsset) != requests[i].assetOut) revert BoringOnChainQueue__SolveAssetMismatch(); uint256 maturity = requests[i].creationTime + requests[i].secondsToMaturity; if (block.timestamp < maturity) revert BoringOnChainQueue__NotMatured(); uint256 deadline = maturity + requests[i].secondsToDeadline; if (block.timestamp > deadline) revert BoringOnChainQueue__DeadlinePassed(); requiredAssets += requests[i].amountOfAssets; totalShares += requests[i].amountOfShares; bytes32 requestId = _dequeueOnChainWithdraw(requests[i]); emit OnChainWithdrawSolved(requestId, requests[i].user, block.timestamp); } // Transfer shares to solver. boringVault.safeTransfer(solver, totalShares); // Run callback function if data is provided. if (solveData.length > 0) { IBoringSolver(solver).boringSolve( msg.sender, address(boringVault), address(solveAsset), totalShares, requiredAssets, solveData ); } for (uint256 i = 0; i < requestsLength; ++i) { solveAsset.safeTransferFrom(solver, requests[i].user, requests[i].amountOfAssets); } } //============================== VIEW FUNCTIONS =============================== /** * @notice Get all request Ids currently in the queue. * @dev Includes requests that are not mature, matured, and expired. But does not include requests that have been solved. * @return requestIds The request Ids. */ function getRequestIds() public view returns (bytes32[] memory) { return _withdrawRequests.values(); } /** * @notice Get the request Id for a request. * @param request The request. * @return requestId The request Id. */ function getRequestId(OnChainWithdraw calldata request) external pure returns (bytes32 requestId) { return keccak256(abi.encode(request)); } /** * @notice Preview assets out from a withdraw request. */ function previewAssetsOut(address assetOut, uint128 amountOfShares, uint16 discount) public view returns (uint128 amountOfAssets128) { uint256 price = accountant.getRateInQuoteSafe(ERC20(assetOut)); price = price.mulDivDown(1e4 - discount, 1e4); uint256 amountOfAssets = uint256(amountOfShares).mulDivDown(price, ONE_SHARE); if (amountOfAssets > type(uint128).max) revert BoringOnChainQueue__Overflow(); amountOfAssets128 = uint128(amountOfAssets); } //============================= INTERNAL FUNCTIONS ============================== /** * @notice Before a new request is made, validate the input. * @param withdrawAsset The withdraw asset. * @param amountOfShares The amount of shares to withdraw. * @param discount The discount to apply to the withdraw in bps. * @param secondsToDeadline The time in seconds the request is valid for. */ function _beforeNewRequest( WithdrawAsset memory withdrawAsset, uint128 amountOfShares, uint16 discount, uint24 secondsToDeadline ) internal view virtual { if (isPaused) revert BoringOnChainQueue__Paused(); if (!withdrawAsset.allowWithdraws) revert BoringOnChainQueue__WithdrawsNotAllowedForAsset(); if (discount < withdrawAsset.minDiscount || discount > withdrawAsset.maxDiscount) { revert BoringOnChainQueue__BadDiscount(); } if (amountOfShares < withdrawAsset.minimumShares) revert BoringOnChainQueue__BadShareAmount(); if (secondsToDeadline < withdrawAsset.minimumSecondsToDeadline) revert BoringOnChainQueue__BadDeadline(); } /** * @notice Cancel an on-chain withdraw. * @dev Verifies that the request user is the same as the msg.sender. * @param request The request to cancel. * @return requestId The request Id. */ function _cancelOnChainWithdrawWithUserCheck(OnChainWithdraw memory request) internal virtual onlyRequestUser(request.user, msg.sender) returns (bytes32 requestId) { requestId = _cancelOnChainWithdraw(request); } /** * @notice Cancel an on-chain withdraw. * @param request The request to cancel. * @return requestId The request Id. */ function _cancelOnChainWithdraw(OnChainWithdraw memory request) internal virtual returns (bytes32 requestId) { requestId = _dequeueOnChainWithdraw(request); _incrementWithdrawCapacity(request.assetOut, request.amountOfShares); boringVault.safeTransfer(request.user, request.amountOfShares); emit OnChainWithdrawCancelled(requestId, request.user, block.timestamp); } /** * @notice Replace an on-chain withdraw. * @dev Does not check withdraw capacity since it is replacing an existing request. * @param oldRequest The request to replace. * @param discount The discount to apply to the new withdraw request in bps. * @param secondsToDeadline The time in seconds the new withdraw request is valid for. * @return oldRequestId The request Id of the old withdraw request. * @return newRequestId The request Id of the new withdraw request. */ function _replaceOnChainWithdraw(OnChainWithdraw memory oldRequest, uint16 discount, uint24 secondsToDeadline) internal virtual onlyRequestUser(oldRequest.user, msg.sender) returns (bytes32 oldRequestId, bytes32 newRequestId) { WithdrawAsset memory withdrawAsset = withdrawAssets[oldRequest.assetOut]; _beforeNewRequest(withdrawAsset, oldRequest.amountOfShares, discount, secondsToDeadline); oldRequestId = _dequeueOnChainWithdraw(oldRequest); emit OnChainWithdrawCancelled(oldRequestId, oldRequest.user, block.timestamp); // Create new request. (newRequestId,) = _queueOnChainWithdraw( oldRequest.user, oldRequest.assetOut, oldRequest.amountOfShares, discount, withdrawAsset.secondsToMaturity, secondsToDeadline ); } /** * @notice Decrement the withdraw capacity for an asset. * @param assetOut The asset to decrement the withdraw capacity for. * @param amountOfShares The amount of shares to decrement the withdraw capacity for. */ function _decrementWithdrawCapacity(address assetOut, uint256 amountOfShares) internal { WithdrawAsset storage withdrawAsset = withdrawAssets[assetOut]; if (withdrawAsset.withdrawCapacity < type(uint256).max) { if (withdrawAsset.withdrawCapacity < amountOfShares) revert BoringOnChainQueue__NotEnoughWithdrawCapacity(); withdrawAsset.withdrawCapacity -= amountOfShares; emit WithdrawCapacityUpdated(assetOut, withdrawAsset.withdrawCapacity); } } /** * @notice Increment the withdraw capacity for an asset. * @param assetOut The asset to increment the withdraw capacity for. * @param amountOfShares The amount of shares to increment the withdraw capacity for. */ function _incrementWithdrawCapacity(address assetOut, uint256 amountOfShares) internal { WithdrawAsset storage withdrawAsset = withdrawAssets[assetOut]; if (withdrawAsset.withdrawCapacity < type(uint256).max) { withdrawAsset.withdrawCapacity += amountOfShares; emit WithdrawCapacityUpdated(assetOut, withdrawAsset.withdrawCapacity); } } /** * @notice Queue an on-chain withdraw. * @dev Reverts if the request is already in the queue. Though this should be impossible. * @param user The user that made the request. * @param assetOut The asset to withdraw. * @param amountOfShares The amount of shares to withdraw. * @param discount The discount to apply to the withdraw in bps. * @param secondsToMaturity The time in seconds it takes for the asset to mature. * @param secondsToDeadline The time in seconds the request is valid for. * @return requestId The request Id. */ function _queueOnChainWithdraw( address user, address assetOut, uint128 amountOfShares, uint16 discount, uint24 secondsToMaturity, uint24 secondsToDeadline ) internal virtual returns (bytes32 requestId, OnChainWithdraw memory req) { // Create new request. uint96 requestNonce; // See nonce definition for unchecked safety. unchecked { // Set request nonce as current nonce, then increment nonce. requestNonce = nonce++; } uint128 amountOfAssets128 = previewAssetsOut(assetOut, amountOfShares, discount); uint40 timeNow = uint40(block.timestamp); // Safe to cast to uint40 as it won't overflow for 10s of thousands of years req = OnChainWithdraw({ nonce: requestNonce, user: user, assetOut: assetOut, amountOfShares: amountOfShares, amountOfAssets: amountOfAssets128, creationTime: timeNow, secondsToMaturity: secondsToMaturity, secondsToDeadline: secondsToDeadline }); requestId = keccak256(abi.encode(req)); bool addedToSet = _withdrawRequests.add(requestId); if (!addedToSet) revert BoringOnChainQueue__Keccak256Collision(); emit OnChainWithdrawRequested( requestId, user, assetOut, requestNonce, amountOfShares, amountOfAssets128, timeNow, secondsToMaturity, secondsToDeadline ); } /** * @notice Dequeue an on-chain withdraw. * @dev Reverts if the request is not in the queue. * @dev Does not remove the request from the onChainWithdraws mapping, so that * it can be referenced later by off-chain systems if needed. * @param request The request to dequeue. * @return requestId The request Id. */ function _dequeueOnChainWithdraw(OnChainWithdraw memory request) internal virtual returns (bytes32 requestId) { // Remove request from queue. requestId = keccak256(abi.encode(request)); bool removedFromSet = _withdrawRequests.remove(requestId); if (!removedFromSet) revert BoringOnChainQueue__RequestNotFound(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.20; import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol"; import {IERC1155Receiver} from "../IERC1155Receiver.sol"; /** * @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. */ abstract contract ERC1155Holder is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be * reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.20; import {IERC721Receiver} from "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or * {IERC721-setApprovalForAll}. */ abstract contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.20; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ```solidity * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position is the index of the value in the `values` array plus 1. // Position 0 is used to mean a value is not in the set. mapping(bytes32 value => uint256) _positions; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._positions[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We cache the value's position to prevent multiple reads from the same storage slot uint256 position = set._positions[value]; if (position != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 valueIndex = position - 1; uint256 lastIndex = set._values.length - 1; if (valueIndex != lastIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the lastValue to the index where the value to delete is set._values[valueIndex] = lastValue; // Update the tracked position of the lastValue (that was just moved) set._positions[lastValue] = position; } // Delete the slot where the moved value was stored set._values.pop(); // Delete the tracked position for the deleted slot delete set._positions[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._positions[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol) /// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol) abstract contract Auth { event OwnershipTransferred(address indexed user, address indexed newOwner); event AuthorityUpdated(address indexed user, Authority indexed newAuthority); address public owner; Authority public authority; constructor(address _owner, Authority _authority) { owner = _owner; authority = _authority; emit OwnershipTransferred(msg.sender, _owner); emit AuthorityUpdated(msg.sender, _authority); } modifier requiresAuth() virtual { require(isAuthorized(msg.sender, msg.sig), "UNAUTHORIZED"); _; } function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) { Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas. // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be // aware that this makes protected functions uncallable even to the owner if the authority is out of order. return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner; } function setAuthority(Authority newAuthority) public virtual { // We check if the caller is the owner first because we want to ensure they can // always swap out the authority even if it's reverting or using up a lot of gas. require(msg.sender == owner || authority.canCall(msg.sender, address(this), msg.sig)); authority = newAuthority; emit AuthorityUpdated(msg.sender, newAuthority); } function transferOwnership(address newOwner) public virtual requiresAuth { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } } /// @notice A generic interface for a contract which provides authorization data to an Auth instance. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol) /// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol) interface Authority { function canCall( address user, address target, bytes4 functionSig ) external view returns (bool); }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "./ERC20.sol"; import {SafeTransferLib} from "../utils/SafeTransferLib.sol"; /// @notice Minimalist and modern Wrapped Ether implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol) /// @author Inspired by WETH9 (https://github.com/dapphub/ds-weth/blob/master/src/weth9.sol) contract WETH is ERC20("Wrapped Ether", "WETH", 18) { using SafeTransferLib for address; event Deposit(address indexed from, uint256 amount); event Withdrawal(address indexed to, uint256 amount); function deposit() public payable virtual { _mint(msg.sender, msg.value); emit Deposit(msg.sender, msg.value); } function withdraw(uint256 amount) public virtual { _burn(msg.sender, amount); emit Withdrawal(msg.sender, amount); msg.sender.safeTransferETH(amount); } receive() external payable virtual { deposit(); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Arithmetic library with operations for fixed-point numbers. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol) /// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol) library FixedPointMathLib { /*////////////////////////////////////////////////////////////// SIMPLIFIED FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ uint256 internal constant MAX_UINT256 = 2**256 - 1; uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s. function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down. } function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up. } function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down. } function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up. } /*////////////////////////////////////////////////////////////// LOW LEVEL FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ function mulDivDown( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // Divide x * y by the denominator. z := div(mul(x, y), denominator) } } function mulDivUp( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // If x * y modulo the denominator is strictly greater than 0, // 1 is added to round up the division of x * y by the denominator. z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator)) } } function rpow( uint256 x, uint256 n, uint256 scalar ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { switch x case 0 { switch n case 0 { // 0 ** 0 = 1 z := scalar } default { // 0 ** n = 0 z := 0 } } default { switch mod(n, 2) case 0 { // If n is even, store scalar in z for now. z := scalar } default { // If n is odd, store x in z for now. z := x } // Shifting right by 1 is like dividing by 2. let half := shr(1, scalar) for { // Shift n right by 1 before looping to halve it. n := shr(1, n) } n { // Shift n right by 1 each iteration to halve it. n := shr(1, n) } { // Revert immediately if x ** 2 would overflow. // Equivalent to iszero(eq(div(xx, x), x)) here. if shr(128, x) { revert(0, 0) } // Store x squared. let xx := mul(x, x) // Round to the nearest number. let xxRound := add(xx, half) // Revert if xx + half overflowed. if lt(xxRound, xx) { revert(0, 0) } // Set x to scaled xxRound. x := div(xxRound, scalar) // If n is even: if mod(n, 2) { // Compute z * x. let zx := mul(z, x) // If z * x overflowed: if iszero(eq(div(zx, x), z)) { // Revert if x is non-zero. if iszero(iszero(x)) { revert(0, 0) } } // Round to the nearest number. let zxRound := add(zx, half) // Revert if zx + half overflowed. if lt(zxRound, zx) { revert(0, 0) } // Return properly scaled zxRound. z := div(zxRound, scalar) } } } } } /*////////////////////////////////////////////////////////////// GENERAL NUMBER UTILITIES //////////////////////////////////////////////////////////////*/ function sqrt(uint256 x) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { let y := x // We start y at x, which will help us make our initial estimate. z := 181 // The "correct" value is 1, but this saves a multiplication later. // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically. // We check y >= 2^(k + 8) but shift right by k bits // each branch to ensure that if x >= 256, then y >= 256. if iszero(lt(y, 0x10000000000000000000000000000000000)) { y := shr(128, y) z := shl(64, z) } if iszero(lt(y, 0x1000000000000000000)) { y := shr(64, y) z := shl(32, z) } if iszero(lt(y, 0x10000000000)) { y := shr(32, y) z := shl(16, z) } if iszero(lt(y, 0x1000000)) { y := shr(16, y) z := shl(8, z) } // Goal was to get z*z*y within a small factor of x. More iterations could // get y in a tighter range. Currently, we will have y in [256, 256*2^16). // We ensured y >= 256 so that the relative difference between y and y+1 is small. // That's not possible if x < 256 but we can just verify those cases exhaustively. // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256. // Correctness can be checked exhaustively for x < 256, so we assume y >= 256. // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps. // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256. // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18. // There is no overflow risk here since y < 2^136 after the first branch above. z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181. // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough. z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) // If x+1 is a perfect square, the Babylonian method cycles between // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor. // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case. // If you don't care whether the floor or ceil square root is returned, you can remove this statement. z := sub(z, lt(div(x, z), z)) } } function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Mod x by y. Note this will return // 0 instead of reverting if y is zero. z := mod(x, y) } } function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) { /// @solidity memory-safe-assembly assembly { // Divide x by y. Note this will return // 0 instead of reverting if y is zero. r := div(x, y) } } function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Add 1 to x * y if x % y > 0. Note this will // return 0 instead of reverting if y is zero. z := add(gt(mod(x, y), 0), div(x, y)) } } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Gas optimized reentrancy protection for smart contracts. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol) abstract contract ReentrancyGuard { uint256 private locked = 1; modifier nonReentrant() virtual { require(locked == 1, "REENTRANCY"); locked = 2; _; locked = 1; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument. mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol"; import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol"; import {ERC20} from "@solmate/tokens/ERC20.sol"; import {BeforeTransferHook} from "src/interfaces/BeforeTransferHook.sol"; import {Auth, Authority} from "@solmate/auth/Auth.sol"; contract BoringVault is ERC20, Auth, ERC721Holder, ERC1155Holder { using Address for address; using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; // ========================================= STATE ========================================= /** * @notice Contract responsbile for implementing `beforeTransfer`. */ BeforeTransferHook public hook; //============================== EVENTS =============================== event Enter(address indexed from, address indexed asset, uint256 amount, address indexed to, uint256 shares); event Exit(address indexed to, address indexed asset, uint256 amount, address indexed from, uint256 shares); //============================== CONSTRUCTOR =============================== constructor(address _owner, string memory _name, string memory _symbol, uint8 _decimals) ERC20(_name, _symbol, _decimals) Auth(_owner, Authority(address(0))) {} //============================== MANAGE =============================== /** * @notice Allows manager to make an arbitrary function call from this contract. * @dev Callable by MANAGER_ROLE. */ function manage(address target, bytes calldata data, uint256 value) external requiresAuth returns (bytes memory result) { result = target.functionCallWithValue(data, value); } /** * @notice Allows manager to make arbitrary function calls from this contract. * @dev Callable by MANAGER_ROLE. */ function manage(address[] calldata targets, bytes[] calldata data, uint256[] calldata values) external requiresAuth returns (bytes[] memory results) { uint256 targetsLength = targets.length; results = new bytes[](targetsLength); for (uint256 i; i < targetsLength; ++i) { results[i] = targets[i].functionCallWithValue(data[i], values[i]); } } //============================== ENTER =============================== /** * @notice Allows minter to mint shares, in exchange for assets. * @dev If assetAmount is zero, no assets are transferred in. * @dev Callable by MINTER_ROLE. */ function enter(address from, ERC20 asset, uint256 assetAmount, address to, uint256 shareAmount) external requiresAuth { // Transfer assets in if (assetAmount > 0) asset.safeTransferFrom(from, address(this), assetAmount); // Mint shares. _mint(to, shareAmount); emit Enter(from, address(asset), assetAmount, to, shareAmount); } //============================== EXIT =============================== /** * @notice Allows burner to burn shares, in exchange for assets. * @dev If assetAmount is zero, no assets are transferred out. * @dev Callable by BURNER_ROLE. */ function exit(address to, ERC20 asset, uint256 assetAmount, address from, uint256 shareAmount) external requiresAuth { // Burn shares. _burn(from, shareAmount); // Transfer assets out. if (assetAmount > 0) asset.safeTransfer(to, assetAmount); emit Exit(to, address(asset), assetAmount, from, shareAmount); } //============================== BEFORE TRANSFER HOOK =============================== /** * @notice Sets the share locker. * @notice If set to zero address, the share locker logic is disabled. * @dev Callable by OWNER_ROLE. */ function setBeforeTransferHook(address _hook) external requiresAuth { hook = BeforeTransferHook(_hook); } /** * @notice Call `beforeTransferHook` passing in `from` `to`, and `msg.sender`. */ function _callBeforeTransfer(address from, address to) internal view { if (address(hook) != address(0)) hook.beforeTransfer(from, to, msg.sender); } function transfer(address to, uint256 amount) public override returns (bool) { _callBeforeTransfer(msg.sender, to); return super.transfer(to, amount); } function transferFrom(address from, address to, uint256 amount) public override returns (bool) { _callBeforeTransfer(from, to); return super.transferFrom(from, to, amount); } //============================== RECEIVE =============================== receive() external payable {} }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; import {FixedPointMathLib} from "@solmate/utils/FixedPointMathLib.sol"; import {IRateProvider} from "src/interfaces/IRateProvider.sol"; import {ERC20} from "@solmate/tokens/ERC20.sol"; import {SafeTransferLib} from "@solmate/utils/SafeTransferLib.sol"; import {BoringVault} from "src/base/BoringVault.sol"; import {Auth, Authority} from "@solmate/auth/Auth.sol"; import {IPausable} from "src/interfaces/IPausable.sol"; contract AccountantWithRateProviders is Auth, IRateProvider, IPausable { using FixedPointMathLib for uint256; using SafeTransferLib for ERC20; // ========================================= STRUCTS ========================================= /** * @param payoutAddress the address `claimFees` sends fees to * @param highwaterMark the highest value of the BoringVault's share price * @param feesOwedInBase total pending fees owed in terms of base * @param totalSharesLastUpdate total amount of shares the last exchange rate update * @param exchangeRate the current exchange rate in terms of base * @param allowedExchangeRateChangeUpper the max allowed change to exchange rate from an update * @param allowedExchangeRateChangeLower the min allowed change to exchange rate from an update * @param lastUpdateTimestamp the block timestamp of the last exchange rate update * @param isPaused whether or not this contract is paused * @param minimumUpdateDelayInSeconds the minimum amount of time that must pass between * exchange rate updates, such that the update won't trigger the contract to be paused * @param platformFee the platform fee * @param performanceFee the performance fee */ struct AccountantState { address payoutAddress; uint96 highwaterMark; uint128 feesOwedInBase; uint128 totalSharesLastUpdate; uint96 exchangeRate; uint16 allowedExchangeRateChangeUpper; uint16 allowedExchangeRateChangeLower; uint64 lastUpdateTimestamp; bool isPaused; uint24 minimumUpdateDelayInSeconds; uint16 platformFee; uint16 performanceFee; } /** * @param isPeggedToBase whether or not the asset is 1:1 with the base asset * @param rateProvider the rate provider for this asset if `isPeggedToBase` is false */ struct RateProviderData { bool isPeggedToBase; IRateProvider rateProvider; } // ========================================= STATE ========================================= /** * @notice Store the accountant state in 3 packed slots. */ AccountantState public accountantState; /** * @notice Maps ERC20s to their RateProviderData. */ mapping(ERC20 => RateProviderData) public rateProviderData; //============================== ERRORS =============================== error AccountantWithRateProviders__UpperBoundTooSmall(); error AccountantWithRateProviders__LowerBoundTooLarge(); error AccountantWithRateProviders__PlatformFeeTooLarge(); error AccountantWithRateProviders__PerformanceFeeTooLarge(); error AccountantWithRateProviders__Paused(); error AccountantWithRateProviders__ZeroFeesOwed(); error AccountantWithRateProviders__OnlyCallableByBoringVault(); error AccountantWithRateProviders__UpdateDelayTooLarge(); error AccountantWithRateProviders__ExchangeRateAboveHighwaterMark(); //============================== EVENTS =============================== event Paused(); event Unpaused(); event DelayInSecondsUpdated(uint24 oldDelay, uint24 newDelay); event UpperBoundUpdated(uint16 oldBound, uint16 newBound); event LowerBoundUpdated(uint16 oldBound, uint16 newBound); event PlatformFeeUpdated(uint16 oldFee, uint16 newFee); event PerformanceFeeUpdated(uint16 oldFee, uint16 newFee); event PayoutAddressUpdated(address oldPayout, address newPayout); event RateProviderUpdated(address asset, bool isPegged, address rateProvider); event ExchangeRateUpdated(uint96 oldRate, uint96 newRate, uint64 currentTime); event FeesClaimed(address indexed feeAsset, uint256 amount); event HighwaterMarkReset(); //============================== IMMUTABLES =============================== /** * @notice The base asset rates are provided in. */ ERC20 public immutable base; /** * @notice The decimals rates are provided in. */ uint8 public immutable decimals; /** * @notice The BoringVault this accountant is working with. * Used to determine share supply for fee calculation. */ BoringVault public immutable vault; /** * @notice One share of the BoringVault. */ uint256 internal immutable ONE_SHARE; constructor( address _owner, address _vault, address payoutAddress, uint96 startingExchangeRate, address _base, uint16 allowedExchangeRateChangeUpper, uint16 allowedExchangeRateChangeLower, uint24 minimumUpdateDelayInSeconds, uint16 platformFee, uint16 performanceFee ) Auth(_owner, Authority(address(0))) { base = ERC20(_base); decimals = ERC20(_base).decimals(); vault = BoringVault(payable(_vault)); ONE_SHARE = 10 ** vault.decimals(); accountantState = AccountantState({ payoutAddress: payoutAddress, highwaterMark: startingExchangeRate, feesOwedInBase: 0, totalSharesLastUpdate: uint128(vault.totalSupply()), exchangeRate: startingExchangeRate, allowedExchangeRateChangeUpper: allowedExchangeRateChangeUpper, allowedExchangeRateChangeLower: allowedExchangeRateChangeLower, lastUpdateTimestamp: uint64(block.timestamp), isPaused: false, minimumUpdateDelayInSeconds: minimumUpdateDelayInSeconds, platformFee: platformFee, performanceFee: performanceFee }); } // ========================================= ADMIN FUNCTIONS ========================================= /** * @notice Pause this contract, which prevents future calls to `updateExchangeRate`, and any safe rate * calls will revert. * @dev Callable by MULTISIG_ROLE. */ function pause() external requiresAuth { accountantState.isPaused = true; emit Paused(); } /** * @notice Unpause this contract, which allows future calls to `updateExchangeRate`, and any safe rate * calls will stop reverting. * @dev Callable by MULTISIG_ROLE. */ function unpause() external requiresAuth { accountantState.isPaused = false; emit Unpaused(); } /** * @notice Update the minimum time delay between `updateExchangeRate` calls. * @dev There are no input requirements, as it is possible the admin would want * the exchange rate updated as frequently as needed. * @dev Callable by OWNER_ROLE. */ function updateDelay(uint24 minimumUpdateDelayInSeconds) external requiresAuth { if (minimumUpdateDelayInSeconds > 14 days) revert AccountantWithRateProviders__UpdateDelayTooLarge(); uint24 oldDelay = accountantState.minimumUpdateDelayInSeconds; accountantState.minimumUpdateDelayInSeconds = minimumUpdateDelayInSeconds; emit DelayInSecondsUpdated(oldDelay, minimumUpdateDelayInSeconds); } /** * @notice Update the allowed upper bound change of exchange rate between `updateExchangeRateCalls`. * @dev Callable by OWNER_ROLE. */ function updateUpper(uint16 allowedExchangeRateChangeUpper) external requiresAuth { if (allowedExchangeRateChangeUpper < 1e4) revert AccountantWithRateProviders__UpperBoundTooSmall(); uint16 oldBound = accountantState.allowedExchangeRateChangeUpper; accountantState.allowedExchangeRateChangeUpper = allowedExchangeRateChangeUpper; emit UpperBoundUpdated(oldBound, allowedExchangeRateChangeUpper); } /** * @notice Update the allowed lower bound change of exchange rate between `updateExchangeRateCalls`. * @dev Callable by OWNER_ROLE. */ function updateLower(uint16 allowedExchangeRateChangeLower) external requiresAuth { if (allowedExchangeRateChangeLower > 1e4) revert AccountantWithRateProviders__LowerBoundTooLarge(); uint16 oldBound = accountantState.allowedExchangeRateChangeLower; accountantState.allowedExchangeRateChangeLower = allowedExchangeRateChangeLower; emit LowerBoundUpdated(oldBound, allowedExchangeRateChangeLower); } /** * @notice Update the platform fee to a new value. * @dev Callable by OWNER_ROLE. */ function updatePlatformFee(uint16 platformFee) external requiresAuth { if (platformFee > 0.2e4) revert AccountantWithRateProviders__PlatformFeeTooLarge(); uint16 oldFee = accountantState.platformFee; accountantState.platformFee = platformFee; emit PlatformFeeUpdated(oldFee, platformFee); } /** * @notice Update the performance fee to a new value. * @dev Callable by OWNER_ROLE. */ function updatePerformanceFee(uint16 performanceFee) external requiresAuth { if (performanceFee > 0.5e4) revert AccountantWithRateProviders__PerformanceFeeTooLarge(); uint16 oldFee = accountantState.performanceFee; accountantState.performanceFee = performanceFee; emit PerformanceFeeUpdated(oldFee, performanceFee); } /** * @notice Update the payout address fees are sent to. * @dev Callable by OWNER_ROLE. */ function updatePayoutAddress(address payoutAddress) external requiresAuth { address oldPayout = accountantState.payoutAddress; accountantState.payoutAddress = payoutAddress; emit PayoutAddressUpdated(oldPayout, payoutAddress); } /** * @notice Update the rate provider data for a specific `asset`. * @dev Rate providers must return rates in terms of `base` or * an asset pegged to base and they must use the same decimals * as `asset`. * @dev Callable by OWNER_ROLE. */ function setRateProviderData(ERC20 asset, bool isPeggedToBase, address rateProvider) external requiresAuth { rateProviderData[asset] = RateProviderData({isPeggedToBase: isPeggedToBase, rateProvider: IRateProvider(rateProvider)}); emit RateProviderUpdated(address(asset), isPeggedToBase, rateProvider); } /** * @notice Reset the highwater mark to the current exchange rate. * @dev Callable by OWNER_ROLE. */ function resetHighwaterMark() external virtual requiresAuth { AccountantState storage state = accountantState; if (state.exchangeRate > state.highwaterMark) { revert AccountantWithRateProviders__ExchangeRateAboveHighwaterMark(); } uint64 currentTime = uint64(block.timestamp); uint256 currentTotalShares = vault.totalSupply(); _calculateFeesOwed(state, state.exchangeRate, state.exchangeRate, currentTotalShares, currentTime); state.totalSharesLastUpdate = uint128(currentTotalShares); state.highwaterMark = accountantState.exchangeRate; state.lastUpdateTimestamp = currentTime; emit HighwaterMarkReset(); } // ========================================= UPDATE EXCHANGE RATE/FEES FUNCTIONS ========================================= /** * @notice Updates this contract exchangeRate. * @dev If new exchange rate is outside of accepted bounds, or if not enough time has passed, this * will pause the contract, and this function will NOT calculate fees owed. * @dev Callable by UPDATE_EXCHANGE_RATE_ROLE. */ function updateExchangeRate(uint96 newExchangeRate) external virtual requiresAuth { ( bool shouldPause, AccountantState storage state, uint64 currentTime, uint256 currentExchangeRate, uint256 currentTotalShares ) = _beforeUpdateExchangeRate(newExchangeRate); if (shouldPause) { // Instead of reverting, pause the contract. This way the exchange rate updater is able to update the exchange rate // to a better value, and pause it. state.isPaused = true; } else { _calculateFeesOwed(state, newExchangeRate, currentExchangeRate, currentTotalShares, currentTime); } newExchangeRate = _setExchangeRate(newExchangeRate, state); state.totalSharesLastUpdate = uint128(currentTotalShares); state.lastUpdateTimestamp = currentTime; emit ExchangeRateUpdated(uint96(currentExchangeRate), newExchangeRate, currentTime); } /** * @notice Claim pending fees. * @dev This function must be called by the BoringVault. * @dev This function will lose precision if the exchange rate * decimals is greater than the feeAsset's decimals. */ function claimFees(ERC20 feeAsset) external { if (msg.sender != address(vault)) revert AccountantWithRateProviders__OnlyCallableByBoringVault(); AccountantState storage state = accountantState; if (state.isPaused) revert AccountantWithRateProviders__Paused(); if (state.feesOwedInBase == 0) revert AccountantWithRateProviders__ZeroFeesOwed(); // Determine amount of fees owed in feeAsset. uint256 feesOwedInFeeAsset; RateProviderData memory data = rateProviderData[feeAsset]; if (address(feeAsset) == address(base)) { feesOwedInFeeAsset = state.feesOwedInBase; } else { uint8 feeAssetDecimals = ERC20(feeAsset).decimals(); uint256 feesOwedInBaseUsingFeeAssetDecimals = _changeDecimals(state.feesOwedInBase, decimals, feeAssetDecimals); if (data.isPeggedToBase) { feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals; } else { uint256 rate = data.rateProvider.getRate(); feesOwedInFeeAsset = feesOwedInBaseUsingFeeAssetDecimals.mulDivDown(10 ** feeAssetDecimals, rate); } } // Zero out fees owed. state.feesOwedInBase = 0; // Transfer fee asset to payout address. feeAsset.safeTransferFrom(msg.sender, state.payoutAddress, feesOwedInFeeAsset); emit FeesClaimed(address(feeAsset), feesOwedInFeeAsset); } // ========================================= VIEW FUNCTIONS ========================================= /** * @notice Get this BoringVault's current rate in the base. */ function getRate() public view returns (uint256 rate) { rate = accountantState.exchangeRate; } /** * @notice Get this BoringVault's current rate in the base. * @dev Revert if paused. */ function getRateSafe() external view returns (uint256 rate) { if (accountantState.isPaused) revert AccountantWithRateProviders__Paused(); rate = getRate(); } /** * @notice Get this BoringVault's current rate in the provided quote. * @dev `quote` must have its RateProviderData set, else this will revert. * @dev This function will lose precision if the exchange rate * decimals is greater than the quote's decimals. */ function getRateInQuote(ERC20 quote) public view returns (uint256 rateInQuote) { if (address(quote) == address(base)) { rateInQuote = accountantState.exchangeRate; } else { RateProviderData memory data = rateProviderData[quote]; uint8 quoteDecimals = ERC20(quote).decimals(); uint256 exchangeRateInQuoteDecimals = _changeDecimals(accountantState.exchangeRate, decimals, quoteDecimals); if (data.isPeggedToBase) { rateInQuote = exchangeRateInQuoteDecimals; } else { uint256 quoteRate = data.rateProvider.getRate(); uint256 oneQuote = 10 ** quoteDecimals; rateInQuote = oneQuote.mulDivDown(exchangeRateInQuoteDecimals, quoteRate); } } } /** * @notice Get this BoringVault's current rate in the provided quote. * @dev `quote` must have its RateProviderData set, else this will revert. * @dev Revert if paused. */ function getRateInQuoteSafe(ERC20 quote) external view returns (uint256 rateInQuote) { if (accountantState.isPaused) revert AccountantWithRateProviders__Paused(); rateInQuote = getRateInQuote(quote); } /** * @notice Preview the result of an update to the exchange rate. * @return updateWillPause Whether the update will pause the contract. * @return newFeesOwedInBase The new fees owed in base. * @return totalFeesOwedInBase The total fees owed in base. */ function previewUpdateExchangeRate(uint96 newExchangeRate) external view virtual returns (bool updateWillPause, uint256 newFeesOwedInBase, uint256 totalFeesOwedInBase) { ( bool shouldPause, AccountantState storage state, uint64 currentTime, uint256 currentExchangeRate, uint256 currentTotalShares ) = _beforeUpdateExchangeRate(newExchangeRate); updateWillPause = shouldPause; totalFeesOwedInBase = state.feesOwedInBase; if (!shouldPause) { (uint256 platformFeesOwedInBase, uint256 shareSupplyToUse) = _calculatePlatformFee( state.totalSharesLastUpdate, state.lastUpdateTimestamp, state.platformFee, newExchangeRate, currentExchangeRate, currentTotalShares, currentTime ); uint256 performanceFeesOwedInBase; if (newExchangeRate > state.highwaterMark) { (performanceFeesOwedInBase,) = _calculatePerformanceFee( newExchangeRate, shareSupplyToUse, state.highwaterMark, state.performanceFee ); } newFeesOwedInBase = platformFeesOwedInBase + performanceFeesOwedInBase; totalFeesOwedInBase += newFeesOwedInBase; } } // ========================================= INTERNAL HELPER FUNCTIONS ========================================= /** * @notice Used to change the decimals of precision used for an amount. */ function _changeDecimals(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256) { if (fromDecimals == toDecimals) { return amount; } else if (fromDecimals < toDecimals) { return amount * 10 ** (toDecimals - fromDecimals); } else { return amount / 10 ** (fromDecimals - toDecimals); } } /** * @notice Check if the new exchange rate is outside of the allowed bounds or if not enough time has passed. */ function _beforeUpdateExchangeRate(uint96 newExchangeRate) internal view returns ( bool shouldPause, AccountantState storage state, uint64 currentTime, uint256 currentExchangeRate, uint256 currentTotalShares ) { state = accountantState; if (state.isPaused) revert AccountantWithRateProviders__Paused(); currentTime = uint64(block.timestamp); currentExchangeRate = state.exchangeRate; currentTotalShares = vault.totalSupply(); shouldPause = currentTime < state.lastUpdateTimestamp + state.minimumUpdateDelayInSeconds || newExchangeRate > currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeUpper, 1e4) || newExchangeRate < currentExchangeRate.mulDivDown(state.allowedExchangeRateChangeLower, 1e4); } /** * @notice Set the exchange rate. */ function _setExchangeRate(uint96 newExchangeRate, AccountantState storage state) internal virtual returns (uint96) { state.exchangeRate = newExchangeRate; return newExchangeRate; } /** * @notice Calculate platform fees. */ function _calculatePlatformFee( uint128 totalSharesLastUpdate, uint64 lastUpdateTimestamp, uint16 platformFee, uint96 newExchangeRate, uint256 currentExchangeRate, uint256 currentTotalShares, uint64 currentTime ) internal view returns (uint256 platformFeesOwedInBase, uint256 shareSupplyToUse) { shareSupplyToUse = currentTotalShares; // Use the minimum between current total supply and total supply for last update. if (totalSharesLastUpdate < shareSupplyToUse) { shareSupplyToUse = totalSharesLastUpdate; } // Determine platform fees owned. if (platformFee > 0) { uint256 timeDelta = currentTime - lastUpdateTimestamp; uint256 minimumAssets = newExchangeRate > currentExchangeRate ? shareSupplyToUse.mulDivDown(currentExchangeRate, ONE_SHARE) : shareSupplyToUse.mulDivDown(newExchangeRate, ONE_SHARE); uint256 platformFeesAnnual = minimumAssets.mulDivDown(platformFee, 1e4); platformFeesOwedInBase = platformFeesAnnual.mulDivDown(timeDelta, 365 days); } } /** * @notice Calculate performance fees. */ function _calculatePerformanceFee( uint96 newExchangeRate, uint256 shareSupplyToUse, uint96 datum, uint16 performanceFee ) internal view returns (uint256 performanceFeesOwedInBase, uint256 yieldEarned) { uint256 changeInExchangeRate = newExchangeRate - datum; yieldEarned = changeInExchangeRate.mulDivDown(shareSupplyToUse, ONE_SHARE); if (performanceFee > 0) { performanceFeesOwedInBase = yieldEarned.mulDivDown(performanceFee, 1e4); } } /** * @notice Calculate fees owed in base. * @dev This function will update the highwater mark if the new exchange rate is higher. */ function _calculateFeesOwed( AccountantState storage state, uint96 newExchangeRate, uint256 currentExchangeRate, uint256 currentTotalShares, uint64 currentTime ) internal virtual { // Only update fees if we are not paused. // Update fee accounting. (uint256 newFeesOwedInBase, uint256 shareSupplyToUse) = _calculatePlatformFee( state.totalSharesLastUpdate, state.lastUpdateTimestamp, state.platformFee, newExchangeRate, currentExchangeRate, currentTotalShares, currentTime ); // Account for performance fees. if (newExchangeRate > state.highwaterMark) { (uint256 performanceFeesOwedInBase,) = _calculatePerformanceFee(newExchangeRate, shareSupplyToUse, state.highwaterMark, state.performanceFee); // Add performance fees to fees owed. newFeesOwedInBase += performanceFeesOwedInBase; // Always update the highwater mark if the new exchange rate is higher. // This way if we are not iniitiall taking performance fees, we can start taking them // without back charging them on past performance. state.highwaterMark = newExchangeRate; } state.feesOwedInBase += uint128(newFeesOwedInBase); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; interface IBoringSolver { function boringSolve( address initiator, address boringVault, address solveAsset, uint256 totalShares, uint256 requiredAssets, bytes calldata solveData ) external; }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; interface BeforeTransferHook { function beforeTransfer(address from, address to, address operator) external view; }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.21; interface IPausable { function pause() external; function unpause() external; }
// SPDX-License-Identifier: UNLICENSED // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. pragma solidity ^0.8.0; interface IRateProvider { function getRate() external view returns (uint256); }
{ "evmVersion": "shanghai", "metadata": { "appendCBOR": true, "bytecodeHash": "ipfs", "useLiteralContent": false }, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "remappings": [ "@solmate/=lib/solmate/src/", "@forge-std/=lib/forge-std/src/", "@ds-test/=lib/forge-std/lib/ds-test/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@ccip/=lib/ccip/", "@oapp-auth/=lib/OAppAuth/src/", "@devtools-oapp-evm/=lib/OAppAuth/lib/devtools/packages/oapp-evm/contracts/oapp/", "@layerzerolabs/lz-evm-messagelib-v2/=lib/OAppAuth/node_modules/@layerzerolabs/lz-evm-messagelib-v2/", "@layerzerolabs/lz-evm-protocol-v2/=lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/", "@layerzerolabs/oapp-evm/=lib/OAppAuth/lib/devtools/packages/oapp-evm/", "@lz-oapp-evm/=lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/oapp/contracts/oapp/", "@sbu/=lib/OAppAuth/lib/solidity-bytes-utils/", "LayerZero-V2/=lib/OAppAuth/lib/", "OAppAuth/=lib/OAppAuth/", "ccip/=lib/ccip/contracts/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/OAppAuth/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solidity-bytes-utils/=lib/OAppAuth/node_modules/solidity-bytes-utils/", "solmate/=lib/solmate/src/" ], "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_auth","type":"address"},{"internalType":"address payable","name":"_boringVault","type":"address"},{"internalType":"address","name":"_accountant","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BoringOnChainQueue__BadDeadline","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__BadDiscount","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__BadInput","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__BadShareAmount","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__BadUser","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__DeadlinePassed","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__Keccak256Collision","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__MAXIMUM_MINIMUM_SECONDS_TO_DEADLINE","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__MAXIMUM_SECONDS_TO_MATURITY","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__MAX_DISCOUNT","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__NotEnoughWithdrawCapacity","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__NotMatured","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__Overflow","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__Paused","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__PermitFailedAndAllowanceTooLow","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__RequestNotFound","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__RescueCannotTakeSharesFromActiveRequests","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__SolveAssetMismatch","type":"error"},{"inputs":[],"name":"BoringOnChainQueue__WithdrawsNotAllowedForAsset","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"OnChainWithdrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"assetOut","type":"address"},{"indexed":false,"internalType":"uint96","name":"nonce","type":"uint96"},{"indexed":false,"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"indexed":false,"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"indexed":false,"internalType":"uint40","name":"creationTime","type":"uint40"},{"indexed":false,"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"indexed":false,"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"name":"OnChainWithdrawRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"requestId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"OnChainWithdrawSolved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"assetOut","type":"address"}],"name":"WithdrawAssetStopped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"assetOut","type":"address"},{"indexed":false,"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"indexed":false,"internalType":"uint24","name":"minimumSecondsToDeadline","type":"uint24"},{"indexed":false,"internalType":"uint16","name":"minDiscount","type":"uint16"},{"indexed":false,"internalType":"uint16","name":"maxDiscount","type":"uint16"},{"indexed":false,"internalType":"uint96","name":"minimumShares","type":"uint96"}],"name":"WithdrawAssetUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"assetOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawCapacity","type":"uint256"}],"name":"WithdrawCapacityUpdated","type":"event"},{"inputs":[],"name":"ONE_SHARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accountant","outputs":[{"internalType":"contract AccountantWithRateProviders","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"contract Authority","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boringVault","outputs":[{"internalType":"contract BoringVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw","name":"request","type":"tuple"}],"name":"cancelOnChainWithdraw","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw[]","name":"requests","type":"tuple[]"}],"name":"cancelUserWithdraws","outputs":[{"internalType":"bytes32[]","name":"canceledRequestIds","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw","name":"request","type":"tuple"}],"name":"getRequestId","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getRequestIds","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"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":[{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint16","name":"discount","type":"uint16"}],"name":"previewAssetsOut","outputs":[{"internalType":"uint128","name":"amountOfAssets128","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw","name":"oldRequest","type":"tuple"},{"internalType":"uint16","name":"discount","type":"uint16"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"name":"replaceOnChainWithdraw","outputs":[{"internalType":"bytes32","name":"oldRequestId","type":"bytes32"},{"internalType":"bytes32","name":"newRequestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint16","name":"discount","type":"uint16"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"name":"requestOnChainWithdraw","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint16","name":"discount","type":"uint16"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"},{"internalType":"uint256","name":"permitDeadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"requestOnChainWithdrawWithPermit","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw[]","name":"activeRequests","type":"tuple[]"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract Authority","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint256","name":"withdrawCapacity","type":"uint256"}],"name":"setWithdrawCapacity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint96","name":"nonce","type":"uint96"},{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"assetOut","type":"address"},{"internalType":"uint128","name":"amountOfShares","type":"uint128"},{"internalType":"uint128","name":"amountOfAssets","type":"uint128"},{"internalType":"uint40","name":"creationTime","type":"uint40"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"secondsToDeadline","type":"uint24"}],"internalType":"struct BoringOnChainQueue.OnChainWithdraw[]","name":"requests","type":"tuple[]"},{"internalType":"bytes","name":"solveData","type":"bytes"},{"internalType":"address","name":"solver","type":"address"}],"name":"solveOnChainWithdraws","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"assetOut","type":"address"}],"name":"stopWithdrawsInAsset","outputs":[],"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":"address","name":"assetOut","type":"address"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"minimumSecondsToDeadline","type":"uint24"},{"internalType":"uint16","name":"minDiscount","type":"uint16"},{"internalType":"uint16","name":"maxDiscount","type":"uint16"},{"internalType":"uint96","name":"minimumShares","type":"uint96"}],"name":"updateWithdrawAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"withdrawAssets","outputs":[{"internalType":"bool","name":"allowWithdraws","type":"bool"},{"internalType":"uint24","name":"secondsToMaturity","type":"uint24"},{"internalType":"uint24","name":"minimumSecondsToDeadline","type":"uint24"},{"internalType":"uint16","name":"minDiscount","type":"uint16"},{"internalType":"uint16","name":"maxDiscount","type":"uint16"},{"internalType":"uint96","name":"minimumShares","type":"uint96"},{"internalType":"uint256","name":"withdrawCapacity","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e060405260016002819055600680546001600160601b03191690911790553480156200002a575f80fd5b5060405162002fb838038062002fb88339810160408190526200004d916200018b565b5f80546001600160a01b03199081166001600160a01b0387811691821784556001805490931690871617909155604051869286929133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36040516001600160a01b0382169033907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350506001600160a01b03821660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa15801562000127573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200014d9190620001f0565b6200015a90600a62000328565b60c0526001600160a01b031660a0525062000338915050565b6001600160a01b038116811462000188575f80fd5b50565b5f805f80608085870312156200019f575f80fd5b8451620001ac8162000173565b6020860151909450620001bf8162000173565b6040860151909350620001d28162000173565b6060860151909250620001e58162000173565b939692955090935050565b5f6020828403121562000201575f80fd5b815160ff8116811462000212575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b808511156200026d57815f190482111562000251576200025162000219565b808516156200025f57918102915b93841c939080029062000232565b509250929050565b5f82620002855750600162000322565b816200029357505f62000322565b8160018114620002ac5760028114620002b757620002d7565b600191505062000322565b60ff841115620002cb57620002cb62000219565b50506001821b62000322565b5060208310610133831016604e8410600b8410161715620002fc575081810a62000322565b6200030883836200022d565b805f19048211156200031e576200031e62000219565b0290505b92915050565b5f6200021260ff84168362000275565b60805160a05160c051612c01620003b75f395f81816103dc01526114ea01525f81816101cc0152818161144f015261163301525f818161047a015281816104d80152818161063301528181610afb01528181610b4e01528181610db301528181610e3701528181610ed4015281816110140152611f170152612c015ff3fe608060405234801561000f575f80fd5b506004361061016d575f3560e01c8063a5672fd7116100d9578063b7d122b511610093578063e69a31c21161006e578063e69a31c214610424578063eed4b3f81461044f578063f2fde38b14610462578063f3b9778414610475575f80fd5b8063b7d122b5146103d7578063bf7e214f146103fe578063e260780c14610411575f80fd5b8063a5672fd71461028c578063aa5a0ffd146102b4578063ac33a2731461036d578063affed0e014610375578063b187bd26146103a0578063b22ed42a146103c4575f80fd5b80636bb3b4761161012a5780636bb3b47614610219578063747327281461022c5780637a9e5e4b1461023f5780638456cb59146102525780638da5cb5b1461025a5780639fff7e2a1461026c575f80fd5b80630bf6cab7146101715780633f4ba83a14610186578063412638dc1461018e5780634a2dc5e4146101a15780634fb3ccc5146101c7578063581b492014610206575b5f80fd5b61018461017f36600461235d565b61049c565b005b61018461076e565b61018461019c3660046123cb565b6107d6565b6101b46101af3660046125ac565b610c49565b6040519081526020015b60405180910390f35b6101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101be565b6101b46102143660046125d8565b610c8a565b6101b461022736600461265e565b610f26565b61018461023a3660046126b1565b611062565b61018461024d3660046126b1565b6110db565b6101846111bf565b5f546101ee906001600160a01b031681565b61027f61027a3660046126cc565b61122d565b6040516101be91906126ff565b61029f61029a366004612742565b611316565b604080519283526020830191909152016101be565b6103216102c23660046126b1565b60056020525f90815260409020805460019091015460ff82169162ffffff610100820481169264010000000083049091169161ffff600160381b8204811692600160481b8304909116916001600160601b03600160581b909104169087565b60408051971515885262ffffff9687166020890152949095169386019390935261ffff91821660608601521660808401526001600160601b031660a083015260c082015260e0016101be565b61027f611360565b600654610388906001600160601b031681565b6040516001600160601b0390911681526020016101be565b6006546103b490600160601b900460ff1681565b60405190151581526020016101be565b6101b46103d2366004612786565b611371565b6101b47f000000000000000000000000000000000000000000000000000000000000000081565b6001546101ee906001600160a01b031681565b61018461041f366004612797565b6113a0565b6104376104323660046127c1565b61142c565b6040516001600160801b0390911681526020016101be565b61018461045d3660046127fa565b611541565b6101846104703660046126b1565b61187a565b6101ee7f000000000000000000000000000000000000000000000000000000000000000081565b6104b1335f356001600160e01b0319166118f5565b6104d65760405162461bcd60e51b81526004016104cd9061286c565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316036106e2575f61051a600361199b565b805190915082811461053f576040516312ed8d4160e21b815260040160405180910390fd5b5f805b828110156106115783818151811061055c5761055c612892565b602002602001015186868381811061057657610576612892565b9050610100020160405160200161058d91906128a6565b60405160208183030381529060405280519060200120146105c1576040516312ed8d4160e21b815260040160405180910390fd5b8585828181106105d3576105d3612892565b9050610100020160600160208101906105ec9190612970565b6105ff906001600160801b03168361299d565b915061060a816129b0565b9050610542565b506040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610678573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061069c91906129c8565b6106a691906129df565b90505f1988036106b8578097506106d9565b808811156106d95760405163fbeb452f60e01b815260040160405180910390fd5b50505050610753565b5f198403610753576040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561072c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061075091906129c8565b93505b6107676001600160a01b03861684866119ae565b5050505050565b610783335f356001600160e01b0319166118f5565b61079f5760405162461bcd60e51b81526004016104cd9061286c565b6006805460ff60601b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b6107eb335f356001600160e01b0319166118f5565b6108075760405162461bcd60e51b81526004016104cd9061286c565b600654600160601b900460ff16156108325760405163158b17e360e11b815260040160405180910390fd5b5f85855f81811061084557610845612892565b90506101000201604001602081019061085e91906126b1565b90505f8086815b81811015610aed5789898281811061087f5761087f612892565b90506101000201604001602081019061089891906126b1565b6001600160a01b0316856001600160a01b0316146108c9576040516331f59b5960e21b815260040160405180910390fd5b5f8a8a838181106108dc576108dc612892565b9050610100020160c00160208101906108f591906129f2565b62ffffff168b8b8481811061090c5761090c612892565b9050610100020160a00160208101906109259190612a0b565b61092f9190612a24565b64ffffffffff16905080421015610959576040516332924a4960e01b815260040160405180910390fd5b5f8b8b8481811061096c5761096c612892565b9050610100020160e001602081019061098591906129f2565b6109949062ffffff168361299d565b9050804211156109b7576040516378b2b00760e01b815260040160405180910390fd5b8b8b848181106109c9576109c9612892565b9050610100020160800160208101906109e29190612970565b6109f5906001600160801b03168761299d565b95508b8b84818110610a0957610a09612892565b905061010002016060016020810190610a229190612970565b610a35906001600160801b03168661299d565b94505f610a698d8d86818110610a4d57610a4d612892565b90506101000201803603810190610a6491906125ac565b611a31565b90508c8c85818110610a7d57610a7d612892565b905061010002016020016020810190610a9691906126b1565b6001600160a01b0316817fd94fc49a6578873ff851671d19cacb1809887f7a9128867ee4306dc3ffc93c2642604051610ad191815260200190565b60405180910390a350505080610ae6906129b0565b9050610865565b50610b226001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001686846119ae565b8515610bae576040516333d5020b60e11b81526001600160a01b038616906367aa041690610b809033907f000000000000000000000000000000000000000000000000000000000000000090899088908a908f908f90600401612a42565b5f604051808303815f87803b158015610b97575f80fd5b505af1158015610ba9573d5f803e3d5ffd5b505050505b5f5b81811015610c3d57610c2d868b8b84818110610bce57610bce612892565b905061010002016020016020810190610be791906126b1565b8c8c85818110610bf957610bf9612892565b905061010002016080016020810190610c129190612970565b6001600160a01b0389169291906001600160801b0316611a8f565b610c36816129b0565b9050610bb0565b50505050505050505050565b5f610c5f335f356001600160e01b0319166118f5565b610c7b5760405162461bcd60e51b81526004016104cd9061286c565b610c8482611b20565b92915050565b5f610ca0335f356001600160e01b0319166118f5565b610cbc5760405162461bcd60e51b81526004016104cd9061286c565b610ccf89896001600160801b0316611b5a565b6001600160a01b0389165f90815260056020908152604091829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff9081166060850152600160481b8304166080840152600160581b9091046001600160601b031660a08301526001015460c0820152610d6b818a8a8a611c04565b60405163d505accf60e01b81523360048201523060248201526001600160801b038a1660448201526064810187905260ff8616608482015260a4810185905260c481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d505accf9060e4015f604051808303815f87803b158015610dfc575f80fd5b505af1925050508015610e0d575060015b610ec757604051636eb1769f60e11b81523360048201523060248201526001600160801b038a16907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610e84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ea891906129c8565b1015610ec757604051634bfd8d1d60e01b815260040160405180910390fd5b610f056001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633306001600160801b038d16611a8f565b610f17338b8b8b85602001518c611cf7565b509a9950505050505050505050565b5f610f3c335f356001600160e01b0319166118f5565b610f585760405162461bcd60e51b81526004016104cd9061286c565b610f6b85856001600160801b0316611b5a565b6001600160a01b0385165f90815260056020908152604091829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff9081166060850152600160481b8304166080840152600160581b9091046001600160601b031660a08301526001015460c082015261100781868686611c04565b6110456001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633306001600160801b038916611a8f565b61105733878787856020015188611cf7565b509695505050505050565b611077335f356001600160e01b0319166118f5565b6110935760405162461bcd60e51b81526004016104cd9061286c565b6001600160a01b0381165f81815260056020526040808220805460ff19169055517ff1abf38a870f414456542524a2b679c0ece751691e36f4feee2ca7826c99e4629190a250565b5f546001600160a01b031633148061116c575060015460405163b700961360e01b81526001600160a01b039091169063b70096139061112d90339030906001600160e01b03195f351690600401612aa5565b602060405180830381865afa158015611148573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061116c9190612ad2565b611174575f80fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350565b6111d4335f356001600160e01b0319166118f5565b6111f05760405162461bcd60e51b81526004016104cd9061286c565b6006805460ff60601b1916600160601b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b6060611244335f356001600160e01b0319166118f5565b6112605760405162461bcd60e51b81526004016104cd9061286c565b818067ffffffffffffffff81111561127a5761127a612474565b6040519080825280602002602001820160405280156112a3578160200160208202803683370190505b5091505f5b8181101561130e576112e18585838181106112c5576112c5612892565b905061010002018036038101906112dc91906125ac565b611ed8565b8382815181106112f3576112f3612892565b6020908102919091010152611307816129b0565b90506112a8565b505092915050565b5f8061132d335f356001600160e01b0319166118f5565b6113495760405162461bcd60e51b81526004016104cd9061286c565b611354858585611f93565b90969095509350505050565b606061136c600361199b565b905090565b5f8160405160200161138391906128a6565b604051602081830303815290604052805190602001209050919050565b6113b5335f356001600160e01b0319166118f5565b6113d15760405162461bcd60e51b81526004016104cd9061286c565b6001600160a01b0382165f8181526005602052604090819020600101839055517f3be638a5ac00f9a7963b3b6f0d577d38cfde72622df2c506690981ae1da6f982906114209084815260200190565b60405180910390a25050565b604051634104b9ed60e11b81526001600160a01b0384811660048301525f9182917f0000000000000000000000000000000000000000000000000000000000000000169063820973da90602401602060405180830381865afa158015611494573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114b891906129c8565b90506114d76114c984612710612af1565b829061ffff166127106120f7565b90505f61150e6001600160801b038616837f00000000000000000000000000000000000000000000000000000000000000006120f7565b90506001600160801b0381111561153857604051635637123160e01b815260040160405180910390fd5b95945050505050565b611556335f356001600160e01b0319166118f5565b6115725760405162461bcd60e51b81526004016104cd9061286c565b610bb861ffff831611156115995760405163daf4c27560e01b815260040160405180910390fd5b62278d0062ffffff861611156115c2576040516341e2834f60e11b815260040160405180910390fd5b62278d0062ffffff851611156115eb57604051632496e55f60e21b815260040160405180910390fd5b8161ffff168361ffff1611156116145760405163a800f19560e01b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b0387811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063820973da90602401602060405180830381865afa158015611678573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061169c91906129c8565b506040518060e001604052806001151581526020018662ffffff1681526020018562ffffff1681526020018461ffff1681526020018361ffff168152602001826001600160601b031681526020015f1981525060055f886001600160a01b03166001600160a01b031681526020019081526020015f205f820151815f015f6101000a81548160ff0219169083151502179055506020820151815f0160016101000a81548162ffffff021916908362ffffff1602179055506040820151815f0160046101000a81548162ffffff021916908362ffffff1602179055506060820151815f0160076101000a81548161ffff021916908361ffff1602179055506080820151815f0160096101000a81548161ffff021916908361ffff16021790555060a0820151815f01600b6101000a8154816001600160601b0302191690836001600160601b0316021790555060c08201518160010155905050856001600160a01b03167f6ece44744f1fe676735f115da497fe130c7acf43fcd142fe92e20df15788797e868686868660405161186a95949392919062ffffff958616815293909416602084015261ffff91821660408401521660608201526001600160601b0391909116608082015260a00190565b60405180910390a2505050505050565b61188f335f356001600160e01b0319166118f5565b6118ab5760405162461bcd60e51b81526004016104cd9061286c565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6001545f906001600160a01b0316801580159061197c575060405163b700961360e01b81526001600160a01b0382169063b70096139061193d90879030908890600401612aa5565b602060405180830381865afa158015611958573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061197c9190612ad2565b8061199357505f546001600160a01b038581169116145b949350505050565b60605f6119a783612112565b9392505050565b5f60405163a9059cbb60e01b81526001600160a01b038416600482015282602482015260205f6044835f895af13d15601f3d1160015f511416171691505080611a2b5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016104cd565b50505050565b5f81604051602001611a439190612b0c565b60408051601f19818403018152919052805160209091012090505f611a6960038361216b565b905080611a8957604051630ba52cdd60e11b815260040160405180910390fd5b50919050565b5f6040516323b872dd60e01b81526001600160a01b03851660048201526001600160a01b038416602482015282604482015260205f6064835f8a5af13d15601f3d1160015f5114161716915050806107675760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016104cd565b60208101515f90336001600160a01b0382168114611b51576040516322583d4960e21b815260040160405180910390fd5b61199384611ed8565b6001600160a01b0382165f90815260056020526040902060018101545f191115611bff578181600101541015611ba35760405163c092fd5360e01b815260040160405180910390fd5b81816001015f828254611bb691906129df565b909155505060018101546040519081526001600160a01b038416907f3be638a5ac00f9a7963b3b6f0d577d38cfde72622df2c506690981ae1da6f9829060200160405180910390a25b505050565b600654600160601b900460ff1615611c2f5760405163158b17e360e11b815260040160405180910390fd5b8351611c4e576040516312baa4e960e11b815260040160405180910390fd5b836060015161ffff168261ffff161080611c735750836080015161ffff168261ffff16115b15611c915760405163a800f19560e01b815260040160405180910390fd5b8360a001516001600160601b0316836001600160801b03161015611cc85760405163030510d560e11b815260040160405180910390fd5b836040015162ffffff168162ffffff161015611a2b576040516394fb53cb60e01b815260040160405180910390fd5b60408051610100810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052600680546bffffffffffffffffffffffff19811660016001600160601b03928316908101909216179091555f611d6d89898961142c565b90505f429050604051806101000160405280846001600160601b031681526020018c6001600160a01b031681526020018b6001600160a01b031681526020018a6001600160801b03168152602001836001600160801b031681526020018264ffffffffff1681526020018862ffffff1681526020018762ffffff16815250935083604051602001611dfe9190612b0c565b60408051601f19818403018152919052805160209091012094505f611e24600387612176565b905080611e4457604051635028981b60e11b815260040160405180910390fd5b604080516001600160601b03861681526001600160801b038c8116602083015285168183015264ffffffffff8416606082015262ffffff8a81166080830152891660a082015290516001600160a01b038d811692908f169189917f2eb08ebdb4d68b4a37e3b424927f3363e1d799ca7e56e7b2c59cc6c1778d33f5919081900360c00190a450505050965096945050505050565b5f611ee282611a31565b9050611eff826040015183606001516001600160801b0316612181565b60208201516060830151611f46916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916001600160801b03166119ae565b81602001516001600160a01b0316817f114ef421aef557f2e4086396789e7fb532b1133ff2982c9d948daa73d0691e3642604051611f8691815260200190565b60405180910390a3919050565b5f80846020015133806001600160a01b0316826001600160a01b031614611fcd576040516322583d4960e21b815260040160405180910390fd5b6040878101516001600160a01b03165f9081526005602090815290829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff908116606080860191909152600160481b84049091166080850152600160581b9092046001600160601b031660a08401526001015460c08301528801516120769082908989611c04565b61207f88611a31565b945087602001516001600160a01b0316857f114ef421aef557f2e4086396789e7fb532b1133ff2982c9d948daa73d0691e36426040516120c191815260200190565b60405180910390a36120e7886020015189604001518a606001518a85602001518b611cf7565b5080945050505050935093915050565b5f825f19048411830215820261210b575f80fd5b5091020490565b6060815f0180548060200260200160405190810160405280929190818152602001828054801561215f57602002820191905f5260205f20905b81548152602001906001019080831161214b575b50505050509050919050565b5f6119a783836121b8565b5f6119a783836122a2565b6001600160a01b0382165f90815260056020526040902060018101545f191115611bff5781816001015f828254611bb6919061299d565b5f8181526001830160205260408120548015612292575f6121da6001836129df565b85549091505f906121ed906001906129df565b905080821461224c575f865f01828154811061220b5761220b612892565b905f5260205f200154905080875f01848154811061222b5761222b612892565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061225d5761225d612bb7565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610c84565b5f915050610c84565b5092915050565b5f8181526001830160205260408120546122e757508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610c84565b505f610c84565b6001600160a01b0381168114612302575f80fd5b50565b8035612310816122ee565b919050565b5f8083601f840112612325575f80fd5b50813567ffffffffffffffff81111561233c575f80fd5b6020830191508360208260081b8501011115612356575f80fd5b9250929050565b5f805f805f60808688031215612371575f80fd5b853561237c816122ee565b9450602086013593506040860135612393816122ee565b9250606086013567ffffffffffffffff8111156123ae575f80fd5b6123ba88828901612315565b969995985093965092949392505050565b5f805f805f606086880312156123df575f80fd5b853567ffffffffffffffff808211156123f6575f80fd5b61240289838a01612315565b9097509550602088013591508082111561241a575f80fd5b818801915088601f83011261242d575f80fd5b81358181111561243b575f80fd5b89602082850101111561244c575f80fd5b6020830195508094505050506040860135612466816122ee565b809150509295509295909350565b634e487b7160e01b5f52604160045260245ffd5b80356001600160601b0381168114612310575f80fd5b80356001600160801b0381168114612310575f80fd5b803564ffffffffff81168114612310575f80fd5b803562ffffff81168114612310575f80fd5b5f6101008083850312156124ec575f80fd5b6040519081019067ffffffffffffffff8211818310171561251b57634e487b7160e01b5f52604160045260245ffd5b8160405280925061252b84612488565b815261253960208501612305565b602082015261254a60408501612305565b604082015261255b6060850161249e565b606082015261256c6080850161249e565b608082015261257d60a085016124b4565b60a082015261258e60c085016124c8565b60c082015261259f60e085016124c8565b60e0820152505092915050565b5f61010082840312156125bd575f80fd5b6119a783836124da565b803561ffff81168114612310575f80fd5b5f805f805f805f80610100898b0312156125f0575f80fd5b88356125fb816122ee565b975061260960208a0161249e565b965061261760408a016125c7565b955061262560608a016124c8565b94506080890135935060a089013560ff81168114612641575f80fd5b979a969950949793969295929450505060c08201359160e0013590565b5f805f8060808587031215612671575f80fd5b843561267c816122ee565b935061268a6020860161249e565b9250612698604086016125c7565b91506126a6606086016124c8565b905092959194509250565b5f602082840312156126c1575f80fd5b81356119a7816122ee565b5f80602083850312156126dd575f80fd5b823567ffffffffffffffff8111156126f3575f80fd5b61135485828601612315565b602080825282518282018190525f9190848201906040850190845b818110156127365783518352928401929184019160010161271a565b50909695505050505050565b5f805f6101408486031215612755575f80fd5b61275f85856124da565b925061276e61010085016125c7565b915061277d61012085016124c8565b90509250925092565b5f6101008284031215611a89575f80fd5b5f80604083850312156127a8575f80fd5b82356127b3816122ee565b946020939093013593505050565b5f805f606084860312156127d3575f80fd5b83356127de816122ee565b92506127ec6020850161249e565b915061277d604085016125c7565b5f805f805f8060c0878903121561280f575f80fd5b863561281a816122ee565b9550612828602088016124c8565b9450612836604088016124c8565b9350612844606088016125c7565b9250612852608088016125c7565b915061286060a08801612488565b90509295509295509295565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b61010081016001600160601b036128bc84612488565b16825260208301356128cd816122ee565b6001600160a01b0390811660208401526040840135906128ec826122ee565b1660408301526128fe6060840161249e565b6001600160801b031660608301526129186080840161249e565b6001600160801b0316608083015261293260a084016124b4565b64ffffffffff1660a083015261294a60c084016124c8565b62ffffff1660c083015261296060e084016124c8565b62ffffff811660e084015261229b565b5f60208284031215612980575f80fd5b6119a78261249e565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c8457610c84612989565b5f600182016129c1576129c1612989565b5060010190565b5f602082840312156129d8575f80fd5b5051919050565b81810381811115610c8457610c84612989565b5f60208284031215612a02575f80fd5b6119a7826124c8565b5f60208284031215612a1b575f80fd5b6119a7826124b4565b64ffffffffff81811683821601908082111561229b5761229b612989565b6001600160a01b038881168252878116602083015286166040820152606081018590526080810184905260c060a0820181905281018290525f828460e08401375f60e0848401015260e0601f19601f850116830101905098975050505050505050565b6001600160a01b0393841681529190921660208201526001600160e01b0319909116604082015260600190565b5f60208284031215612ae2575f80fd5b815180151581146119a7575f80fd5b61ffff82811682821603908082111561229b5761229b612989565b5f610100820190506001600160601b038351168252602083015160018060a01b03808216602085015280604086015116604085015250506001600160801b0360608401511660608301526080830151612b7060808401826001600160801b03169052565b5060a0830151612b8960a084018264ffffffffff169052565b5060c0830151612ba060c084018262ffffff169052565b5060e083015161229b60e084018262ffffff169052565b634e487b7160e01b5f52603160045260245ffdfea2646970667358221220e7252747c7630fd0ba77eec12fcce98a86143cd67504ed4e3bb88d7284ea193e64736f6c634300081500330000000000000000000000005f2f11ad8656439d5c14d9b351f8b09cdac2a02d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db70000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061016d575f3560e01c8063a5672fd7116100d9578063b7d122b511610093578063e69a31c21161006e578063e69a31c214610424578063eed4b3f81461044f578063f2fde38b14610462578063f3b9778414610475575f80fd5b8063b7d122b5146103d7578063bf7e214f146103fe578063e260780c14610411575f80fd5b8063a5672fd71461028c578063aa5a0ffd146102b4578063ac33a2731461036d578063affed0e014610375578063b187bd26146103a0578063b22ed42a146103c4575f80fd5b80636bb3b4761161012a5780636bb3b47614610219578063747327281461022c5780637a9e5e4b1461023f5780638456cb59146102525780638da5cb5b1461025a5780639fff7e2a1461026c575f80fd5b80630bf6cab7146101715780633f4ba83a14610186578063412638dc1461018e5780634a2dc5e4146101a15780634fb3ccc5146101c7578063581b492014610206575b5f80fd5b61018461017f36600461235d565b61049c565b005b61018461076e565b61018461019c3660046123cb565b6107d6565b6101b46101af3660046125ac565b610c49565b6040519081526020015b60405180910390f35b6101ee7f0000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d81565b6040516001600160a01b0390911681526020016101be565b6101b46102143660046125d8565b610c8a565b6101b461022736600461265e565b610f26565b61018461023a3660046126b1565b611062565b61018461024d3660046126b1565b6110db565b6101846111bf565b5f546101ee906001600160a01b031681565b61027f61027a3660046126cc565b61122d565b6040516101be91906126ff565b61029f61029a366004612742565b611316565b604080519283526020830191909152016101be565b6103216102c23660046126b1565b60056020525f90815260409020805460019091015460ff82169162ffffff610100820481169264010000000083049091169161ffff600160381b8204811692600160481b8304909116916001600160601b03600160581b909104169087565b60408051971515885262ffffff9687166020890152949095169386019390935261ffff91821660608601521660808401526001600160601b031660a083015260c082015260e0016101be565b61027f611360565b600654610388906001600160601b031681565b6040516001600160601b0390911681526020016101be565b6006546103b490600160601b900460ff1681565b60405190151581526020016101be565b6101b46103d2366004612786565b611371565b6101b47f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6001546101ee906001600160a01b031681565b61018461041f366004612797565b6113a0565b6104376104323660046127c1565b61142c565b6040516001600160801b0390911681526020016101be565b61018461045d3660046127fa565b611541565b6101846104703660046126b1565b61187a565b6101ee7f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db781565b6104b1335f356001600160e01b0319166118f5565b6104d65760405162461bcd60e51b81526004016104cd9061286c565b60405180910390fd5b7f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db76001600160a01b0316856001600160a01b0316036106e2575f61051a600361199b565b805190915082811461053f576040516312ed8d4160e21b815260040160405180910390fd5b5f805b828110156106115783818151811061055c5761055c612892565b602002602001015186868381811061057657610576612892565b9050610100020160405160200161058d91906128a6565b60405160208183030381529060405280519060200120146105c1576040516312ed8d4160e21b815260040160405180910390fd5b8585828181106105d3576105d3612892565b9050610100020160600160208101906105ec9190612970565b6105ff906001600160801b03168361299d565b915061060a816129b0565b9050610542565b506040516370a0823160e01b81523060048201525f9082906001600160a01b037f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db716906370a0823190602401602060405180830381865afa158015610678573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061069c91906129c8565b6106a691906129df565b90505f1988036106b8578097506106d9565b808811156106d95760405163fbeb452f60e01b815260040160405180910390fd5b50505050610753565b5f198403610753576040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561072c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061075091906129c8565b93505b6107676001600160a01b03861684866119ae565b5050505050565b610783335f356001600160e01b0319166118f5565b61079f5760405162461bcd60e51b81526004016104cd9061286c565b6006805460ff60601b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b6107eb335f356001600160e01b0319166118f5565b6108075760405162461bcd60e51b81526004016104cd9061286c565b600654600160601b900460ff16156108325760405163158b17e360e11b815260040160405180910390fd5b5f85855f81811061084557610845612892565b90506101000201604001602081019061085e91906126b1565b90505f8086815b81811015610aed5789898281811061087f5761087f612892565b90506101000201604001602081019061089891906126b1565b6001600160a01b0316856001600160a01b0316146108c9576040516331f59b5960e21b815260040160405180910390fd5b5f8a8a838181106108dc576108dc612892565b9050610100020160c00160208101906108f591906129f2565b62ffffff168b8b8481811061090c5761090c612892565b9050610100020160a00160208101906109259190612a0b565b61092f9190612a24565b64ffffffffff16905080421015610959576040516332924a4960e01b815260040160405180910390fd5b5f8b8b8481811061096c5761096c612892565b9050610100020160e001602081019061098591906129f2565b6109949062ffffff168361299d565b9050804211156109b7576040516378b2b00760e01b815260040160405180910390fd5b8b8b848181106109c9576109c9612892565b9050610100020160800160208101906109e29190612970565b6109f5906001600160801b03168761299d565b95508b8b84818110610a0957610a09612892565b905061010002016060016020810190610a229190612970565b610a35906001600160801b03168661299d565b94505f610a698d8d86818110610a4d57610a4d612892565b90506101000201803603810190610a6491906125ac565b611a31565b90508c8c85818110610a7d57610a7d612892565b905061010002016020016020810190610a9691906126b1565b6001600160a01b0316817fd94fc49a6578873ff851671d19cacb1809887f7a9128867ee4306dc3ffc93c2642604051610ad191815260200190565b60405180910390a350505080610ae6906129b0565b9050610865565b50610b226001600160a01b037f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db71686846119ae565b8515610bae576040516333d5020b60e11b81526001600160a01b038616906367aa041690610b809033907f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db790899088908a908f908f90600401612a42565b5f604051808303815f87803b158015610b97575f80fd5b505af1158015610ba9573d5f803e3d5ffd5b505050505b5f5b81811015610c3d57610c2d868b8b84818110610bce57610bce612892565b905061010002016020016020810190610be791906126b1565b8c8c85818110610bf957610bf9612892565b905061010002016080016020810190610c129190612970565b6001600160a01b0389169291906001600160801b0316611a8f565b610c36816129b0565b9050610bb0565b50505050505050505050565b5f610c5f335f356001600160e01b0319166118f5565b610c7b5760405162461bcd60e51b81526004016104cd9061286c565b610c8482611b20565b92915050565b5f610ca0335f356001600160e01b0319166118f5565b610cbc5760405162461bcd60e51b81526004016104cd9061286c565b610ccf89896001600160801b0316611b5a565b6001600160a01b0389165f90815260056020908152604091829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff9081166060850152600160481b8304166080840152600160581b9091046001600160601b031660a08301526001015460c0820152610d6b818a8a8a611c04565b60405163d505accf60e01b81523360048201523060248201526001600160801b038a1660448201526064810187905260ff8616608482015260a4810185905260c481018490527f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db76001600160a01b03169063d505accf9060e4015f604051808303815f87803b158015610dfc575f80fd5b505af1925050508015610e0d575060015b610ec757604051636eb1769f60e11b81523360048201523060248201526001600160801b038a16907f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db76001600160a01b03169063dd62ed3e90604401602060405180830381865afa158015610e84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ea891906129c8565b1015610ec757604051634bfd8d1d60e01b815260040160405180910390fd5b610f056001600160a01b037f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db71633306001600160801b038d16611a8f565b610f17338b8b8b85602001518c611cf7565b509a9950505050505050505050565b5f610f3c335f356001600160e01b0319166118f5565b610f585760405162461bcd60e51b81526004016104cd9061286c565b610f6b85856001600160801b0316611b5a565b6001600160a01b0385165f90815260056020908152604091829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff9081166060850152600160481b8304166080840152600160581b9091046001600160601b031660a08301526001015460c082015261100781868686611c04565b6110456001600160a01b037f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db71633306001600160801b038916611a8f565b61105733878787856020015188611cf7565b509695505050505050565b611077335f356001600160e01b0319166118f5565b6110935760405162461bcd60e51b81526004016104cd9061286c565b6001600160a01b0381165f81815260056020526040808220805460ff19169055517ff1abf38a870f414456542524a2b679c0ece751691e36f4feee2ca7826c99e4629190a250565b5f546001600160a01b031633148061116c575060015460405163b700961360e01b81526001600160a01b039091169063b70096139061112d90339030906001600160e01b03195f351690600401612aa5565b602060405180830381865afa158015611148573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061116c9190612ad2565b611174575f80fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350565b6111d4335f356001600160e01b0319166118f5565b6111f05760405162461bcd60e51b81526004016104cd9061286c565b6006805460ff60601b1916600160601b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b6060611244335f356001600160e01b0319166118f5565b6112605760405162461bcd60e51b81526004016104cd9061286c565b818067ffffffffffffffff81111561127a5761127a612474565b6040519080825280602002602001820160405280156112a3578160200160208202803683370190505b5091505f5b8181101561130e576112e18585838181106112c5576112c5612892565b905061010002018036038101906112dc91906125ac565b611ed8565b8382815181106112f3576112f3612892565b6020908102919091010152611307816129b0565b90506112a8565b505092915050565b5f8061132d335f356001600160e01b0319166118f5565b6113495760405162461bcd60e51b81526004016104cd9061286c565b611354858585611f93565b90969095509350505050565b606061136c600361199b565b905090565b5f8160405160200161138391906128a6565b604051602081830303815290604052805190602001209050919050565b6113b5335f356001600160e01b0319166118f5565b6113d15760405162461bcd60e51b81526004016104cd9061286c565b6001600160a01b0382165f8181526005602052604090819020600101839055517f3be638a5ac00f9a7963b3b6f0d577d38cfde72622df2c506690981ae1da6f982906114209084815260200190565b60405180910390a25050565b604051634104b9ed60e11b81526001600160a01b0384811660048301525f9182917f0000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d169063820973da90602401602060405180830381865afa158015611494573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114b891906129c8565b90506114d76114c984612710612af1565b829061ffff166127106120f7565b90505f61150e6001600160801b038616837f0000000000000000000000000000000000000000000000000de0b6b3a76400006120f7565b90506001600160801b0381111561153857604051635637123160e01b815260040160405180910390fd5b95945050505050565b611556335f356001600160e01b0319166118f5565b6115725760405162461bcd60e51b81526004016104cd9061286c565b610bb861ffff831611156115995760405163daf4c27560e01b815260040160405180910390fd5b62278d0062ffffff861611156115c2576040516341e2834f60e11b815260040160405180910390fd5b62278d0062ffffff851611156115eb57604051632496e55f60e21b815260040160405180910390fd5b8161ffff168361ffff1611156116145760405163a800f19560e01b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b0387811660048301527f0000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d169063820973da90602401602060405180830381865afa158015611678573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061169c91906129c8565b506040518060e001604052806001151581526020018662ffffff1681526020018562ffffff1681526020018461ffff1681526020018361ffff168152602001826001600160601b031681526020015f1981525060055f886001600160a01b03166001600160a01b031681526020019081526020015f205f820151815f015f6101000a81548160ff0219169083151502179055506020820151815f0160016101000a81548162ffffff021916908362ffffff1602179055506040820151815f0160046101000a81548162ffffff021916908362ffffff1602179055506060820151815f0160076101000a81548161ffff021916908361ffff1602179055506080820151815f0160096101000a81548161ffff021916908361ffff16021790555060a0820151815f01600b6101000a8154816001600160601b0302191690836001600160601b0316021790555060c08201518160010155905050856001600160a01b03167f6ece44744f1fe676735f115da497fe130c7acf43fcd142fe92e20df15788797e868686868660405161186a95949392919062ffffff958616815293909416602084015261ffff91821660408401521660608201526001600160601b0391909116608082015260a00190565b60405180910390a2505050505050565b61188f335f356001600160e01b0319166118f5565b6118ab5760405162461bcd60e51b81526004016104cd9061286c565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6001545f906001600160a01b0316801580159061197c575060405163b700961360e01b81526001600160a01b0382169063b70096139061193d90879030908890600401612aa5565b602060405180830381865afa158015611958573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061197c9190612ad2565b8061199357505f546001600160a01b038581169116145b949350505050565b60605f6119a783612112565b9392505050565b5f60405163a9059cbb60e01b81526001600160a01b038416600482015282602482015260205f6044835f895af13d15601f3d1160015f511416171691505080611a2b5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016104cd565b50505050565b5f81604051602001611a439190612b0c565b60408051601f19818403018152919052805160209091012090505f611a6960038361216b565b905080611a8957604051630ba52cdd60e11b815260040160405180910390fd5b50919050565b5f6040516323b872dd60e01b81526001600160a01b03851660048201526001600160a01b038416602482015282604482015260205f6064835f8a5af13d15601f3d1160015f5114161716915050806107675760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016104cd565b60208101515f90336001600160a01b0382168114611b51576040516322583d4960e21b815260040160405180910390fd5b61199384611ed8565b6001600160a01b0382165f90815260056020526040902060018101545f191115611bff578181600101541015611ba35760405163c092fd5360e01b815260040160405180910390fd5b81816001015f828254611bb691906129df565b909155505060018101546040519081526001600160a01b038416907f3be638a5ac00f9a7963b3b6f0d577d38cfde72622df2c506690981ae1da6f9829060200160405180910390a25b505050565b600654600160601b900460ff1615611c2f5760405163158b17e360e11b815260040160405180910390fd5b8351611c4e576040516312baa4e960e11b815260040160405180910390fd5b836060015161ffff168261ffff161080611c735750836080015161ffff168261ffff16115b15611c915760405163a800f19560e01b815260040160405180910390fd5b8360a001516001600160601b0316836001600160801b03161015611cc85760405163030510d560e11b815260040160405180910390fd5b836040015162ffffff168162ffffff161015611a2b576040516394fb53cb60e01b815260040160405180910390fd5b60408051610100810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052600680546bffffffffffffffffffffffff19811660016001600160601b03928316908101909216179091555f611d6d89898961142c565b90505f429050604051806101000160405280846001600160601b031681526020018c6001600160a01b031681526020018b6001600160a01b031681526020018a6001600160801b03168152602001836001600160801b031681526020018264ffffffffff1681526020018862ffffff1681526020018762ffffff16815250935083604051602001611dfe9190612b0c565b60408051601f19818403018152919052805160209091012094505f611e24600387612176565b905080611e4457604051635028981b60e11b815260040160405180910390fd5b604080516001600160601b03861681526001600160801b038c8116602083015285168183015264ffffffffff8416606082015262ffffff8a81166080830152891660a082015290516001600160a01b038d811692908f169189917f2eb08ebdb4d68b4a37e3b424927f3363e1d799ca7e56e7b2c59cc6c1778d33f5919081900360c00190a450505050965096945050505050565b5f611ee282611a31565b9050611eff826040015183606001516001600160801b0316612181565b60208201516060830151611f46916001600160a01b037f00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db716916001600160801b03166119ae565b81602001516001600160a01b0316817f114ef421aef557f2e4086396789e7fb532b1133ff2982c9d948daa73d0691e3642604051611f8691815260200190565b60405180910390a3919050565b5f80846020015133806001600160a01b0316826001600160a01b031614611fcd576040516322583d4960e21b815260040160405180910390fd5b6040878101516001600160a01b03165f9081526005602090815290829020825160e081018452815460ff811615158252610100810462ffffff90811694830194909452640100000000810490931693810193909352600160381b820461ffff908116606080860191909152600160481b84049091166080850152600160581b9092046001600160601b031660a08401526001015460c08301528801516120769082908989611c04565b61207f88611a31565b945087602001516001600160a01b0316857f114ef421aef557f2e4086396789e7fb532b1133ff2982c9d948daa73d0691e36426040516120c191815260200190565b60405180910390a36120e7886020015189604001518a606001518a85602001518b611cf7565b5080945050505050935093915050565b5f825f19048411830215820261210b575f80fd5b5091020490565b6060815f0180548060200260200160405190810160405280929190818152602001828054801561215f57602002820191905f5260205f20905b81548152602001906001019080831161214b575b50505050509050919050565b5f6119a783836121b8565b5f6119a783836122a2565b6001600160a01b0382165f90815260056020526040902060018101545f191115611bff5781816001015f828254611bb6919061299d565b5f8181526001830160205260408120548015612292575f6121da6001836129df565b85549091505f906121ed906001906129df565b905080821461224c575f865f01828154811061220b5761220b612892565b905f5260205f200154905080875f01848154811061222b5761222b612892565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061225d5761225d612bb7565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610c84565b5f915050610c84565b5092915050565b5f8181526001830160205260408120546122e757508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610c84565b505f610c84565b6001600160a01b0381168114612302575f80fd5b50565b8035612310816122ee565b919050565b5f8083601f840112612325575f80fd5b50813567ffffffffffffffff81111561233c575f80fd5b6020830191508360208260081b8501011115612356575f80fd5b9250929050565b5f805f805f60808688031215612371575f80fd5b853561237c816122ee565b9450602086013593506040860135612393816122ee565b9250606086013567ffffffffffffffff8111156123ae575f80fd5b6123ba88828901612315565b969995985093965092949392505050565b5f805f805f606086880312156123df575f80fd5b853567ffffffffffffffff808211156123f6575f80fd5b61240289838a01612315565b9097509550602088013591508082111561241a575f80fd5b818801915088601f83011261242d575f80fd5b81358181111561243b575f80fd5b89602082850101111561244c575f80fd5b6020830195508094505050506040860135612466816122ee565b809150509295509295909350565b634e487b7160e01b5f52604160045260245ffd5b80356001600160601b0381168114612310575f80fd5b80356001600160801b0381168114612310575f80fd5b803564ffffffffff81168114612310575f80fd5b803562ffffff81168114612310575f80fd5b5f6101008083850312156124ec575f80fd5b6040519081019067ffffffffffffffff8211818310171561251b57634e487b7160e01b5f52604160045260245ffd5b8160405280925061252b84612488565b815261253960208501612305565b602082015261254a60408501612305565b604082015261255b6060850161249e565b606082015261256c6080850161249e565b608082015261257d60a085016124b4565b60a082015261258e60c085016124c8565b60c082015261259f60e085016124c8565b60e0820152505092915050565b5f61010082840312156125bd575f80fd5b6119a783836124da565b803561ffff81168114612310575f80fd5b5f805f805f805f80610100898b0312156125f0575f80fd5b88356125fb816122ee565b975061260960208a0161249e565b965061261760408a016125c7565b955061262560608a016124c8565b94506080890135935060a089013560ff81168114612641575f80fd5b979a969950949793969295929450505060c08201359160e0013590565b5f805f8060808587031215612671575f80fd5b843561267c816122ee565b935061268a6020860161249e565b9250612698604086016125c7565b91506126a6606086016124c8565b905092959194509250565b5f602082840312156126c1575f80fd5b81356119a7816122ee565b5f80602083850312156126dd575f80fd5b823567ffffffffffffffff8111156126f3575f80fd5b61135485828601612315565b602080825282518282018190525f9190848201906040850190845b818110156127365783518352928401929184019160010161271a565b50909695505050505050565b5f805f6101408486031215612755575f80fd5b61275f85856124da565b925061276e61010085016125c7565b915061277d61012085016124c8565b90509250925092565b5f6101008284031215611a89575f80fd5b5f80604083850312156127a8575f80fd5b82356127b3816122ee565b946020939093013593505050565b5f805f606084860312156127d3575f80fd5b83356127de816122ee565b92506127ec6020850161249e565b915061277d604085016125c7565b5f805f805f8060c0878903121561280f575f80fd5b863561281a816122ee565b9550612828602088016124c8565b9450612836604088016124c8565b9350612844606088016125c7565b9250612852608088016125c7565b915061286060a08801612488565b90509295509295509295565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b634e487b7160e01b5f52603260045260245ffd5b61010081016001600160601b036128bc84612488565b16825260208301356128cd816122ee565b6001600160a01b0390811660208401526040840135906128ec826122ee565b1660408301526128fe6060840161249e565b6001600160801b031660608301526129186080840161249e565b6001600160801b0316608083015261293260a084016124b4565b64ffffffffff1660a083015261294a60c084016124c8565b62ffffff1660c083015261296060e084016124c8565b62ffffff811660e084015261229b565b5f60208284031215612980575f80fd5b6119a78261249e565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c8457610c84612989565b5f600182016129c1576129c1612989565b5060010190565b5f602082840312156129d8575f80fd5b5051919050565b81810381811115610c8457610c84612989565b5f60208284031215612a02575f80fd5b6119a7826124c8565b5f60208284031215612a1b575f80fd5b6119a7826124b4565b64ffffffffff81811683821601908082111561229b5761229b612989565b6001600160a01b038881168252878116602083015286166040820152606081018590526080810184905260c060a0820181905281018290525f828460e08401375f60e0848401015260e0601f19601f850116830101905098975050505050505050565b6001600160a01b0393841681529190921660208201526001600160e01b0319909116604082015260600190565b5f60208284031215612ae2575f80fd5b815180151581146119a7575f80fd5b61ffff82811682821603908082111561229b5761229b612989565b5f610100820190506001600160601b038351168252602083015160018060a01b03808216602085015280604086015116604085015250506001600160801b0360608401511660608301526080830151612b7060808401826001600160801b03169052565b5060a0830151612b8960a084018264ffffffffff169052565b5060c0830151612ba060c084018262ffffff169052565b5060e083015161229b60e084018262ffffff169052565b634e487b7160e01b5f52603160045260245ffdfea2646970667358221220e7252747c7630fd0ba77eec12fcce98a86143cd67504ed4e3bb88d7284ea193e64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005f2f11ad8656439d5c14d9b351f8b09cdac2a02d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db70000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d
-----Decoded View---------------
Arg [0] : _owner (address): 0x5F2F11ad8656439d5C14d9B351f8b09cDaC2A02d
Arg [1] : _auth (address): 0x0000000000000000000000000000000000000000
Arg [2] : _boringVault (address): 0x00007EDa736C6CdF973BDefF2191bbCfE6175db7
Arg [3] : _accountant (address): 0x5555559e499d2107aBb035a5feA1235b7f942E6D
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000005f2f11ad8656439d5c14d9b351f8b09cdac2a02d
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 00000000000000000000000000007eda736c6cdf973bdeff2191bbcfe6175db7
Arg [3] : 0000000000000000000000005555559e499d2107abb035a5fea1235b7f942e6d
Deployed Bytecode Sourcemap
864:29001:16:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9193:1374;;;;;;:::i;:::-;;:::i;:::-;;11079:99;;;:::i;18926:1694::-;;;;;;:::i;:::-;;:::i;17523:230::-;;;;;;:::i;:::-;;:::i;:::-;;;4976:25:21;;;4964:2;4949:18;17523:230:16;;;;;;;;8024:55;;;;;;;;-1:-1:-1;;;;;5212:32:21;;;5194:51;;5182:2;5167:18;8024:55:16;5012:239:21;16277:1094:16;;;;;;:::i;:::-;;:::i;14994:690::-;;;;;;:::i;:::-;;:::i;13338:179::-;;;;;;:::i;:::-;;:::i;1523:434:8:-;;;;;;:::i;:::-;;:::i;10776:94:16:-;;;:::i;562:20:8:-;;;;;-1:-1:-1;;;;;562:20:8;;;14126:417:16;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;18185:341::-;;;;;;:::i;:::-;;:::i;:::-;;;;9200:25:21;;;9256:2;9241:18;;9234:34;;;;9173:18;18185:341:16;9026:248:21;4891:55:16;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;4891:55:16;;;;;-1:-1:-1;;;4891:55:16;;;;;;-1:-1:-1;;;;;;;;4891:55:16;;;;;;;;;;;9700:14:21;;9693:22;9675:41;;9735:8;9779:15;;;9774:2;9759:18;;9752:43;9831:15;;;;9811:18;;;9804:43;;;;9866:6;9908:15;;;9903:2;9888:18;;9881:43;9961:15;9955:3;9940:19;;9933:44;-1:-1:-1;;;;;10014:39:21;10008:3;9993:19;;9986:68;10085:3;10070:19;;10063:35;9662:3;9647:19;4891:55:16;9376:728:21;20955:114:16;;;:::i;5510:23::-;;;;;-1:-1:-1;;;;;5510:23:16;;;;;;-1:-1:-1;;;;;10271:39:21;;;10253:58;;10241:2;10226:18;5510:23:16;10109:208:21;5610:20:16;;;;;-1:-1:-1;;;5610:20:16;;;;;;;;;10487:14:21;;10480:22;10462:41;;10450:2;10435:18;5610:20:16;10322:187:21;21216:152:16;;;;;;:::i;:::-;;:::i;8140:34::-;;;;;589:26:8;;;;;-1:-1:-1;;;;;589:26:8;;;13769:238:16;;;;;;:::i;:::-;;:::i;21449:522::-;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;12149:47:21;;;12131:66;;12119:2;12104:18;21449:522:16;11985:218:21;11794:1385:16;;;;;;:::i;:::-;;:::i;1963:164:8:-;;;;;;:::i;:::-;;:::i;7886:40:16:-;;;;;9193:1374;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;;;;;;;;;9381:11:16::1;-1:-1:-1::0;;;;;9355:38:16::1;9363:5;-1:-1:-1::0;;;;;9355:38:16::1;::::0;9351:1170:::1;;9409:27;9439:26;:17;:24;:26::i;:::-;9506:17:::0;;9409:56;;-1:-1:-1;9541:41:16;;::::1;9537:84;;9591:30;;-1:-1:-1::0;;;9591:30:16::1;;;;;;;;;;;9537:84;9836:29;::::0;9879:255:::1;9903:16;9899:1;:20;9879:255;;;9992:10;10003:1;9992:13;;;;;;;;:::i;:::-;;;;;;;9969:14;;9984:1;9969:17;;;;;;;:::i;:::-;;;;;;9958:29;;;;;;;;:::i;:::-;;;;;;;;;;;;;9948:40;;;;;;:57;9944:100;;10014:30;;-1:-1:-1::0;;;10014:30:16::1;;;;;;;;;;;9944:100;10087:14;;10102:1;10087:17;;;;;;;:::i;:::-;;;;;;:32;;;;;;;;;;:::i;:::-;10062:57;::::0;-1:-1:-1;;;;;10062:57:16::1;::::0;::::1;:::i;:::-;::::0;-1:-1:-1;9921:3:16::1;::::0;::::1;:::i;:::-;;;9879:255;;;-1:-1:-1::0;10168:36:16::1;::::0;-1:-1:-1;;;10168:36:16;;10198:4:::1;10168:36;::::0;::::1;5194:51:21::0;10147:18:16::1;::::0;10207:21;;-1:-1:-1;;;;;10168:11:16::1;:21;::::0;::::1;::::0;5167:18:21;;10168:36:16::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:60;;;;:::i;:::-;10147:81;;-1:-1:-1::0;;10246:6:16::1;:27:::0;10242:165:::1;;10284:10;10275:19;;10242:165;;;10326:10;10317:6;:19;10313:94;;;10345:62;;-1:-1:-1::0;;;10345:62:16::1;;;;;;;;;;;10313:94;9395:1023;;;;9351:1170;;;-1:-1:-1::0;;10442:6:16::1;:27:::0;10438:72:::1;;10480:30;::::0;-1:-1:-1;;;10480:30:16;;10504:4:::1;10480:30;::::0;::::1;5194:51:21::0;-1:-1:-1;;;;;10480:15:16;::::1;::::0;::::1;::::0;5167:18:21;;10480:30:16::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;10471:39;;10438:72;10530:30;-1:-1:-1::0;;;;;10530:18:16;::::1;10549:2:::0;10553:6;10530:18:::1;:30::i;:::-;9193:1374:::0;;;;;:::o;11079:99::-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;11130:8:16::1;:16:::0;;-1:-1:-1;;;;11130:16:16::1;::::0;;11161:10:::1;::::0;::::1;::::0;11141:5:::1;::::0;11161:10:::1;11079:99::o:0;18926:1694::-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;19092:8:16::1;::::0;-1:-1:-1;;;19092:8:16;::::1;;;19088:49;;;19109:28;;-1:-1:-1::0;;;19109:28:16::1;;;;;;;;;;;19088:49;19148:16;19173:8;;19182:1;19173:11;;;;;;;:::i;:::-;;;;;;:20;;;;;;;;;;:::i;:::-;19148:46:::0;-1:-1:-1;19204:22:16::1;::::0;19290:8;19204:22;19315:771:::1;19339:14;19335:1;:18;19315:771;;;19401:8;;19410:1;19401:11;;;;;;;:::i;:::-;;;;;;:20;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;19378:43:16::1;19386:10;-1:-1:-1::0;;;;;19378:43:16::1;;19374:96;;19430:40;;-1:-1:-1::0;;;19430:40:16::1;;;;;;;;;;;19374:96;19484:16;19530:8;;19539:1;19530:11;;;;;;;:::i;:::-;;;;;;:29;;;;;;;;;;:::i;:::-;19503:56;;:8;;19512:1;19503:11;;;;;;;:::i;:::-;;;;;;:24;;;;;;;;;;:::i;:::-;:56;;;;:::i;:::-;19484:75;;;;19595:8;19577:15;:26;19573:71;;;19612:32;;-1:-1:-1::0;;;19612:32:16::1;;;;;;;;;;;19573:71;19658:16;19688:8;;19697:1;19688:11;;;;;;;:::i;:::-;;;;;;:29;;;;;;;;;;:::i;:::-;19677:40;::::0;::::1;;:8:::0;:40:::1;:::i;:::-;19658:59;;19753:8;19735:15;:26;19731:75;;;19770:36;;-1:-1:-1::0;;;19770:36:16::1;;;;;;;;;;;19731:75;19838:8;;19847:1;19838:11;;;;;;;:::i;:::-;;;;;;:26;;;;;;;;;;:::i;:::-;19820:44;::::0;-1:-1:-1;;;;;19820:44:16::1;::::0;::::1;:::i;:::-;;;19893:8;;19902:1;19893:11;;;;;;;:::i;:::-;;;;;;:26;;;;;;;;;;:::i;:::-;19878:41;::::0;-1:-1:-1;;;;;19878:41:16::1;::::0;::::1;:::i;:::-;;;19933:17;19953:36;19977:8;;19986:1;19977:11;;;;;;;:::i;:::-;;;;;;19953:36;;;;;;;;;;:::i;:::-;:23;:36::i;:::-;19933:56;;20041:8;;20050:1;20041:11;;;;;;;:::i;:::-;;;;;;:16;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;20008:67:16::1;20030:9;20008:67;20059:15;20008:67;;;;4976:25:21::0;;4964:2;4949:18;;4830:177;20008:67:16::1;;;;;;;;19360:726;;;19355:3;;;;:::i;:::-;;;19315:771;;;-1:-1:-1::0;20134:45:16::1;-1:-1:-1::0;;;;;20134:11:16::1;:24;20159:6:::0;20167:11;20134:24:::1;:45::i;:::-;20248:20:::0;;20244:209:::1;;20284:158;::::0;-1:-1:-1;;;20284:158:16;;-1:-1:-1;;;;;20284:33:16;::::1;::::0;::::1;::::0;:158:::1;::::0;20335:10:::1;::::0;20355:11:::1;::::0;20377:10;;20390:11;;20403:14;;20419:9;;;;20284:158:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;20244:209;20468:9;20463:151;20487:14;20483:1;:18;20463:151;;;20522:81;20550:6;20558:8;;20567:1;20558:11;;;;;;;:::i;:::-;;;;;;:16;;;;;;;;;;:::i;:::-;20576:8;;20585:1;20576:11;;;;;;;:::i;:::-;;;;;;:26;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;20522:27:16;::::1;::::0;:81;;-1:-1:-1;;;;;20522:81:16::1;:27;:81::i;:::-;20503:3;::::0;::::1;:::i;:::-;;;20463:151;;;;19078:1542;;;;18926:1694:::0;;;;;:::o;17523:230::-;17657:17;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;17702:44:16::1;17738:7;17702:35;:44::i;:::-;17690:56:::0;17523:230;-1:-1:-1;;17523:230:16:o;16277:1094::-;16568:17;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;16597:52:16::1;16624:8;16634:14;-1:-1:-1::0;;;;;16597:52:16::1;:26;:52::i;:::-;-1:-1:-1::0;;;;;16696:24:16;::::1;16659:34;16696:24:::0;;;:14:::1;:24;::::0;;;;;;;;16659:61;;::::1;::::0;::::1;::::0;;;;::::1;::::0;::::1;;;::::0;;::::1;::::0;::::1;;::::0;;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;::::1;::::0;;;;;;;-1:-1:-1;;;16659:61:16;::::1;;::::0;;::::1;::::0;;;;-1:-1:-1;;;16659:61:16;::::1;;::::0;;;;-1:-1:-1;;;16659:61:16;;::::1;-1:-1:-1::0;;;;;16659:61:16::1;::::0;;;;;::::1;::::0;;;;;16731:77:::1;16659:61:::0;16764:14;16780:8;16790:17;16731::::1;:77::i;:::-;16823:86;::::0;-1:-1:-1;;;16823:86:16;;16842:10:::1;16823:86;::::0;::::1;17589:34:21::0;16862:4:16::1;17639:18:21::0;;;17632:43;-1:-1:-1;;;;;17711:47:21;;17691:18;;;17684:75;17775:18;;;17768:34;;;17851:4;17839:17;;17818:19;;;17811:46;17873:19;;;17866:35;;;17917:19;;;17910:35;;;16823:11:16::1;-1:-1:-1::0;;;;;16823:18:16::1;::::0;::::1;::::0;17523:19:21;;16823:86:16::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;16819:295;;16945:48;::::0;-1:-1:-1;;;16945:48:16;;16967:10:::1;16945:48;::::0;::::1;18168:34:21::0;16987:4:16::1;18218:18:21::0;;;18211:43;-1:-1:-1;;;;;16945:65:16;::::1;::::0;:11:::1;-1:-1:-1::0;;;;;16945:21:16::1;::::0;::::1;::::0;18103:18:21;;16945:48:16::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:65;16941:163;;;17037:52;;-1:-1:-1::0;;;17037:52:16::1;;;;;;;;;;;16941:163;17124:71;-1:-1:-1::0;;;;;17124:11:16::1;:28;17153:10;17173:4;-1:-1:-1::0;;;;;17124:71:16;::::1;:28;:71::i;:::-;17221:143;17256:10;17268:8;17278:14;17294:8;17304:13;:31;;;17337:17;17221:21;:143::i;:::-;-1:-1:-1::0;17206:158:16;16277:1094;-1:-1:-1;;;;;;;;;;16277:1094:16:o;14994:690::-;15182:17;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;15215:52:16::1;15242:8;15252:14;-1:-1:-1::0;;;;;15215:52:16::1;:26;:52::i;:::-;-1:-1:-1::0;;;;;15314:24:16;::::1;15277:34;15314:24:::0;;;:14:::1;:24;::::0;;;;;;;;15277:61;;::::1;::::0;::::1;::::0;;;;::::1;::::0;::::1;;;::::0;;::::1;::::0;::::1;;::::0;;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;::::1;::::0;;;;;;;-1:-1:-1;;;15277:61:16;::::1;;::::0;;::::1;::::0;;;;-1:-1:-1;;;15277:61:16;::::1;;::::0;;;;-1:-1:-1;;;15277:61:16;;::::1;-1:-1:-1::0;;;;;15277:61:16::1;::::0;;;;;::::1;::::0;;;;;15349:77:::1;15277:61:::0;15382:14;15398:8;15408:17;15349::::1;:77::i;:::-;15437:71;-1:-1:-1::0;;;;;15437:11:16::1;:28;15466:10;15486:4;-1:-1:-1::0;;;;;15437:71:16;::::1;:28;:71::i;:::-;15534:143;15569:10;15581:8;15591:14;15607:8;15617:13;:31;;;15650:17;15534:21;:143::i;:::-;-1:-1:-1::0;15519:158:16;14994:690;-1:-1:-1;;;;;;14994:690:16:o;13338:179::-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;-1:-1:-1;;;;;13418:24:16;::::1;13460:5;13418:24:::0;;;:14:::1;:24;::::0;;;;;:47;;-1:-1:-1;;13418:47:16::1;::::0;;13480:30;::::1;::::0;13460:5;13480:30:::1;13338:179:::0;:::o;1523:434:8:-;1794:5;;-1:-1:-1;;;;;1794:5:8;1780:10;:19;;:76;;-1:-1:-1;1803:9:8;;:53;;-1:-1:-1;;;1803:53:8;;-1:-1:-1;;;;;1803:9:8;;;;:17;;:53;;1821:10;;1841:4;;-1:-1:-1;;;;;;1803:9:8;1848:7;;;1803:53;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1772:85;;;;;;1868:9;:24;;-1:-1:-1;;;;;;1868:24:8;-1:-1:-1;;;;;1868:24:8;;;;;;;;1908:42;;1925:10;;1908:42;;-1:-1:-1;;1908:42:8;1523:434;:::o;10776:94:16:-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;10825:8:16::1;:15:::0;;-1:-1:-1;;;;10825:15:16::1;-1:-1:-1::0;;;10825:15:16::1;::::0;;10855:8:::1;::::0;::::1;::::0;10825:15;;10855:8:::1;10776:94::o:0;14126:417::-;14247:35;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;14323:8:16;;14369:29:::1;::::0;::::1;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;-1:-1:-1;14369:29:16::1;;14348:50;;14413:9;14408:129;14432:14;14428:1;:18;14408:129;;;14491:35;14514:8;;14523:1;14514:11;;;;;;;:::i;:::-;;;;;;14491:35;;;;;;;;;;:::i;:::-;:22;:35::i;:::-;14467:18;14486:1;14467:21;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;:59;14448:3:::1;::::0;::::1;:::i;:::-;;;14408:129;;;;14288:255;14126:417:::0;;;;:::o;18185:341::-;18366:20;18388;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;18455:64:16::1;18479:10;18491:8;18501:17;18455:23;:64::i;:::-;18424:95:::0;;;;-1:-1:-1;18185:341:16;-1:-1:-1;;;;18185:341:16:o;20955:114::-;21001:16;21036:26;:17;:24;:26::i;:::-;21029:33;;20955:114;:::o;21216:152::-;21295:17;21352:7;21341:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;21331:30;;;;;;21324:37;;21216:152;;;:::o;13769:238::-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;-1:-1:-1;;;;;13874:24:16;::::1;;::::0;;;:14:::1;:24;::::0;;;;;;:41:::1;;:60:::0;;;13949:51;::::1;::::0;::::1;::::0;13918:16;4976:25:21;;4964:2;4949:18;;4830:177;13949:51:16::1;;;;;;;;13769:238:::0;;:::o;21449:522::-;21636:46;;-1:-1:-1;;;21636:46:16;;-1:-1:-1;;;;;5212:32:21;;;21636:46:16;;;5194:51:21;21579:25:16;;;;21636:10;:29;;;;5167:18:21;;21636:46:16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;21620:62;-1:-1:-1;21700:37:16;21717:14;21723:8;21717:3;:14;:::i;:::-;21700:5;;:37;;21733:3;21700:16;:37::i;:::-;21692:45;-1:-1:-1;21747:22:16;21772:52;-1:-1:-1;;;;;21772:23:16;;21692:45;21814:9;21772:34;:52::i;:::-;21747:77;-1:-1:-1;;;;;;21838:34:16;;21834:77;;;21881:30;;-1:-1:-1;;;21881:30:16;;;;;;;;;;;21834:77;21949:14;21449:522;-1:-1:-1;;;;;21449:522:16:o;11794:1385::-;902:33:8;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;3801:5:16::1;12079:26;::::0;::::1;;12075:73;;;12114:34;;-1:-1:-1::0;;;12114:34:16::1;;;;;;;;;;;12075:73;3964:7;12162:47;::::0;::::1;;12158:134;;;12232:49;;-1:-1:-1::0;;;12232:49:16::1;;;;;;;;;;;12158:134;4164:7;12305:62;::::0;::::1;;12301:157;;;12390:57;;-1:-1:-1::0;;;12390:57:16::1;;;;;;;;;;;12301:157;12485:11;12471:25;;:11;:25;;;12467:71;;;12505:33;;-1:-1:-1::0;;;12505:33:16::1;;;;;;;;;;;12467:71;12594:46;::::0;-1:-1:-1;;;12594:46:16;;-1:-1:-1;;;;;5212:32:21;;;12594:46:16::1;::::0;::::1;5194:51:21::0;12594:10:16::1;:29;::::0;::::1;::::0;5167:18:21;;12594:46:16::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;12678:340;;;;;;;;12722:4;12678:340;;;;;;12759:17;12678:340;;;;;;12816:24;12678:340;;;;;;12867:11;12678:340;;;;;;12905:11;12678:340;;;;;;12945:13;-1:-1:-1::0;;;;;12678:340:16::1;;;;;-1:-1:-1::0;;12678:340:16::1;;::::0;12651:14:::1;:24;12666:8;-1:-1:-1::0;;;;;12651:24:16::1;-1:-1:-1::0;;;;;12651:24:16::1;;;;;;;;;;;;:367;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;;;12651:367:16::1;;;;;-1:-1:-1::0;;;;;12651:367:16::1;;;;;;;;;;;;;;;;;13068:8;-1:-1:-1::0;;;;;13034:138:16::1;;13078:17;13097:24;13123:11;13136;13149:13;13034:138;;;;;;;;;19609:8:21::0;19644:15;;;19626:34;;19696:15;;;;19691:2;19676:18;;19669:43;19731:6;19773:15;;;19768:2;19753:18;;19746:43;19825:15;19820:2;19805:18;;19798:43;-1:-1:-1;;;;;19878:39:21;;;;19872:3;19857:19;;19850:68;19586:3;19571:19;;19350:574;13034:138:16::1;;;;;;;;11794:1385:::0;;;;;;:::o;1963:164:8:-;902:33;915:10;927:7;;-1:-1:-1;;;;;;927:7:8;902:12;:33::i;:::-;894:58;;;;-1:-1:-1;;;894:58:8;;;;;;;:::i;:::-;2046:5:::1;:16:::0;;-1:-1:-1;;;;;;2046:16:8::1;-1:-1:-1::0;;;;;2046:16:8;::::1;::::0;;::::1;::::0;;2078:42:::1;::::0;2046:16;;2099:10:::1;::::0;2078:42:::1;::::0;2046:5;2078:42:::1;1963:164:::0;:::o;977:540::-;1097:9;;1064:4;;-1:-1:-1;;;;;1097:9:8;1415:27;;;;;:77;;-1:-1:-1;1446:46:8;;-1:-1:-1;;;1446:46:8;;-1:-1:-1;;;;;1446:12:8;;;;;:46;;1459:4;;1473;;1480:11;;1446:46;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1414:96;;;-1:-1:-1;1505:5:8;;-1:-1:-1;;;;;1497:13:8;;;1505:5;;1497:13;1414:96;1407:103;977:540;-1:-1:-1;;;;977:540:8:o;7776:300:7:-;7839:16;7867:22;7892:19;7900:3;7892:7;:19::i;:::-;7867:44;7776:300;-1:-1:-1;;;7776:300:7:o;3116:1607:13:-;3228:12;3398:4;3392:11;-1:-1:-1;;;3521:17:13;3514:93;-1:-1:-1;;;;;3658:2:13;3654:51;3650:1;3631:17;3627:25;3620:86;3792:6;3787:2;3768:17;3764:26;3757:42;4644:2;4641:1;4637:2;4618:17;4615:1;4608:5;4601;4596:51;4165:16;4158:24;4152:2;4134:16;4131:24;4127:1;4123;4117:8;4114:15;4110:46;4107:76;3907:754;3896:765;;;4689:7;4681:35;;;;-1:-1:-1;;;4681:35:13;;20131:2:21;4681:35:13;;;20113:21:21;20170:2;20150:18;;;20143:30;-1:-1:-1;;;20189:18:21;;;20182:45;20244:18;;4681:35:13;19929:339:21;4681:35:13;3218:1505;3116:1607;;;:::o;29514:349:16:-;29605:17;29705:7;29694:19;;;;;;;;:::i;:::-;;;;-1:-1:-1;;29694:19:16;;;;;;;;;29684:30;;29694:19;29684:30;;;;;-1:-1:-1;29724:19:16;29746:35;:17;29684:30;29746:24;:35::i;:::-;29724:57;;29796:14;29791:65;;29819:37;;-1:-1:-1;;;29819:37:16;;;;;;;;;;;29791:65;29624:239;29514:349;;;:::o;1328:1782:13:-;1466:12;1636:4;1630:11;-1:-1:-1;;;1759:17:13;1752:93;-1:-1:-1;;;;;1896:4:13;1892:53;1888:1;1869:17;1865:25;1858:88;-1:-1:-1;;;;;2038:2:13;2034:51;2029:2;2010:17;2006:26;1999:87;2172:6;2167:2;2148:17;2144:26;2137:42;3026:2;3023:1;3018:3;2999:17;2996:1;2989:5;2982;2977:52;2545:16;2538:24;2532:2;2514:16;2511:24;2507:1;2503;2497:8;2494:15;2490:46;2487:76;2287:756;2276:767;;;3071:7;3063:40;;;;-1:-1:-1;;;3063:40:13;;21568:2:21;3063:40:13;;;21550:21:21;21607:2;21587:18;;;21580:30;-1:-1:-1;;;21626:18:21;;;21619:50;21686:18;;3063:40:13;21366:344:21;23360:260:16;23494:12;;;;23537:17;;23508:10;-1:-1:-1;;;;;4454:24:16;;;;4450:66;;4487:29;;-1:-1:-1;;;4487:29:16;;;;;;;;;;;4450:66;23582:31:::1;23605:7;23582:22;:31::i;25828:509::-:0;-1:-1:-1;;;;;25963:24:16;;25925:35;25963:24;;;:14;:24;;;;;26001:30;;;;-1:-1:-1;;;25997:334:16;;;26104:14;26071:13;:30;;;:47;26067:107;;;26127:47;;-1:-1:-1;;;26127:47:16;;;;;;;;;;;26067:107;26222:14;26188:13;:30;;;:48;;;;;;;:::i;:::-;;;;-1:-1:-1;;26289:30:16;;;;26255:65;;4976:25:21;;;-1:-1:-1;;;;;26255:65:16;;;;;4964:2:21;4949:18;26255:65:16;;;;;;;25997:334;25915:422;25828:509;;:::o;22403:731::-;22607:8;;-1:-1:-1;;;22607:8:16;;;;22603:49;;;22624:28;;-1:-1:-1;;;22624:28:16;;;;;;;;;;;22603:49;22668:28;;22663:91;;22705:49;;-1:-1:-1;;;22705:49:16;;;;;;;;;;;22663:91;22779:13;:25;;;22768:36;;:8;:36;;;:76;;;;22819:13;:25;;;22808:36;;:8;:36;;;22768:76;22764:147;;;22867:33;;-1:-1:-1;;;22867:33:16;;;;;;;;;;;22764:147;22941:13;:27;;;-1:-1:-1;;;;;22924:44:16;:14;-1:-1:-1;;;;;22924:44:16;;22920:93;;;22977:36;;-1:-1:-1;;;22977:36:16;;;;;;;;;;;22920:93;23047:13;:38;;;23027:58;;:17;:58;;;23023:104;;;23094:33;;-1:-1:-1;;;23094:33:16;;;;;;;;;;;27564:1586;-1:-1:-1;;;;;;;;27800:17:16;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;28083:5:16;:7;;-1:-1:-1;;28083:7:16;;;-1:-1:-1;;;;;28083:7:16;;;;;;;;;;;;;-1:-1:-1;28139:52:16;28156:8;28166:14;28182:8;28139:16;:52::i;:::-;28111:80;;28202:14;28226:15;28202:40;;28335:342;;;;;;;;28372:12;-1:-1:-1;;;;;28335:342:16;;;;;28404:4;-1:-1:-1;;;;;28335:342:16;;;;;28432:8;-1:-1:-1;;;;;28335:342:16;;;;;28470:14;-1:-1:-1;;;;;28335:342:16;;;;;28514:17;-1:-1:-1;;;;;28335:342:16;;;;;28559:7;28335:342;;;;;;28599:17;28335:342;;;;;;28649:17;28335:342;;;;;28329:348;;28721:3;28710:15;;;;;;;;:::i;:::-;;;;-1:-1:-1;;28710:15:16;;;;;;;;;28700:26;;28710:15;28700:26;;;;;-1:-1:-1;28737:15:16;28755:32;:17;28700:26;28755:21;:32::i;:::-;28737:50;;28803:10;28798:64;;28822:40;;-1:-1:-1;;;28822:40:16;;;;;;;;;;;28798:64;28878:265;;;-1:-1:-1;;;;;22012:39:21;;21994:58;;-1:-1:-1;;;;;22141:15:21;;;22136:2;22121:18;;22114:43;22193:15;;22173:18;;;22166:43;22257:12;22245:25;;22240:2;22225:18;;22218:53;22290:8;22335:15;;;22329:3;22314:19;;22307:44;22388:15;;22382:3;22367:19;;22360:44;28878:265:16;;-1:-1:-1;;;;;28878:265:16;;;;;;;;28916:9;;28878:265;;;;;;21981:3:21;28878:265:16;;;27847:1303;;;;27564:1586;;;;;;;;;:::o;23772:401::-;23862:17;23903:32;23927:7;23903:23;:32::i;:::-;23891:44;;23945:68;23972:7;:16;;;23990:7;:22;;;-1:-1:-1;;;;;23945:68:16;:26;:68::i;:::-;24048:12;;;;24062:22;;;;24023:62;;-1:-1:-1;;;;;24023:11:16;:24;;-1:-1:-1;;;;;24023:62:16;:24;:62::i;:::-;24136:7;:12;;;-1:-1:-1;;;;;24100:66:16;24125:9;24100:66;24150:15;24100:66;;;;4976:25:21;;4964:2;4949:18;;4830:177;24100:66:16;;;;;;;;23772:401;;;:::o;24693:889::-;24907:20;24929;24861:10;:15;;;24878:10;4469:9;-1:-1:-1;;;;;4454:24:16;:11;-1:-1:-1;;;;;4454:24:16;;4450:66;;4487:29;;-1:-1:-1;;;4487:29:16;;;;;;;;;;;4450:66;25017:19:::1;::::0;;::::1;::::0;-1:-1:-1;;;;;25002:35:16::1;24965:34;25002:35:::0;;;:14:::1;:35;::::0;;;;;;;24965:72;;::::1;::::0;::::1;::::0;;;;::::1;::::0;::::1;;;::::0;;::::1;::::0;::::1;;::::0;;::::1;::::0;;::::1;::::0;;;;;;::::1;::::0;;::::1;::::0;;;;;;;-1:-1:-1;;;24965:72:16;::::1;;::::0;;::::1;::::0;;;;;;;;-1:-1:-1;;;24965:72:16;::::1;::::0;;::::1;::::0;;;;-1:-1:-1;;;24965:72:16;;::::1;-1:-1:-1::0;;;;;24965:72:16::1;::::0;;;;;::::1;::::0;;;;;25081:25;::::1;::::0;25048:88:::1;::::0;24965:72;;25108:8;25118:17;25048::::1;:88::i;:::-;25162:35;25186:10;25162:23;:35::i;:::-;25147:50;;25252:10;:15;;;-1:-1:-1::0;;;;;25213:72:16::1;25238:12;25213:72;25269:15;25213:72;;;;4976:25:21::0;;4964:2;4949:18;;4830:177;25213:72:16::1;;;;;;;;25345:230;25380:10;:15;;;25409:10;:19;;;25442:10;:25;;;25481:8;25503:13;:31;;;25548:17;25345:21;:230::i;:::-;25327:248;;;;;24955:627;24693:889:::0;;;;;;;;:::o;1564:526:11:-;1680:9;1928:1;-1:-1:-1;;1911:19:11;1908:1;1905:26;1902:1;1898:34;1891:42;1878:11;1874:60;1864:116;;1964:1;1961;1954:12;1864:116;-1:-1:-1;2051:9:11;;2047:27;;1564:526::o;5581:109:7:-;5637:16;5672:3;:11;;5665:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5581:109;;;:::o;6221:129::-;6294:4;6317:26;6325:3;6337:5;6317:7;:26::i;5930:123::-;6000:4;6023:23;6028:3;6040:5;6023:4;:23::i;26583:388:16:-;-1:-1:-1;;;;;26718:24:16;;26680:35;26718:24;;;:14;:24;;;;;26756:30;;;;-1:-1:-1;;;26752:213:16;;;26856:14;26822:13;:30;;;:48;;;;;;;:::i;2815:1368:7:-;2881:4;3010:21;;;:14;;;:21;;;;;;3046:13;;3042:1135;;3413:18;3434:12;3445:1;3434:8;:12;:::i;:::-;3480:18;;3413:33;;-1:-1:-1;3460:17:7;;3480:22;;3501:1;;3480:22;:::i;:::-;3460:42;;3535:9;3521:10;:23;3517:378;;3564:17;3584:3;:11;;3596:9;3584:22;;;;;;;;:::i;:::-;;;;;;;;;3564:42;;3731:9;3705:3;:11;;3717:10;3705:23;;;;;;;;:::i;:::-;;;;;;;;;;;;:35;;;;3844:25;;;:14;;;:25;;;;;:36;;;3517:378;3973:17;;:3;;:17;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;4076:3;:14;;:21;4091:5;4076:21;;;;;;;;;;;4069:28;;;4119:4;4112:11;;;;;;;3042:1135;4161:5;4154:12;;;;;3042:1135;2887:1296;2815:1368;;;;:::o;2241:406::-;2304:4;4360:21;;;:14;;;:21;;;;;;2320:321;;-1:-1:-1;2362:23:7;;;;;;;;:11;:23;;;;;;;;;;;;;2544:18;;2520:21;;;:14;;;:21;;;;;;:42;;;;2576:11;;2320:321;-1:-1:-1;2625:5:7;2618:12;;14:138:21;-1:-1:-1;;;;;96:31:21;;86:42;;76:70;;142:1;139;132:12;76:70;14:138;:::o;157:141::-;225:20;;254:38;225:20;254:38;:::i;:::-;157:141;;;:::o;303:391::-;390:8;400:6;454:3;447:4;439:6;435:17;431:27;421:55;;472:1;469;462:12;421:55;-1:-1:-1;495:20:21;;538:18;527:30;;524:50;;;570:1;567;560:12;524:50;607:4;599:6;595:17;583:29;;667:3;660:4;650:6;647:1;643:14;635:6;631:27;627:38;624:47;621:67;;;684:1;681;674:12;621:67;303:391;;;;;:::o;699:869::-;861:6;869;877;885;893;946:3;934:9;925:7;921:23;917:33;914:53;;;963:1;960;953:12;914:53;1002:9;989:23;1021:38;1053:5;1021:38;:::i;:::-;1078:5;-1:-1:-1;1130:2:21;1115:18;;1102:32;;-1:-1:-1;1186:2:21;1171:18;;1158:32;1199:40;1158:32;1199:40;:::i;:::-;1258:7;-1:-1:-1;1316:2:21;1301:18;;1288:32;1343:18;1332:30;;1329:50;;;1375:1;1372;1365:12;1329:50;1414:94;1500:7;1491:6;1480:9;1476:22;1414:94;:::i;:::-;699:869;;;;-1:-1:-1;699:869:21;;-1:-1:-1;1527:8:21;;1388:120;699:869;-1:-1:-1;;;699:869:21:o;1573:1107::-;1723:6;1731;1739;1747;1755;1808:2;1796:9;1787:7;1783:23;1779:32;1776:52;;;1824:1;1821;1814:12;1776:52;1864:9;1851:23;1893:18;1934:2;1926:6;1923:14;1920:34;;;1950:1;1947;1940:12;1920:34;1989:94;2075:7;2066:6;2055:9;2051:22;1989:94;:::i;:::-;2102:8;;-1:-1:-1;1963:120:21;-1:-1:-1;2190:2:21;2175:18;;2162:32;;-1:-1:-1;2206:16:21;;;2203:36;;;2235:1;2232;2225:12;2203:36;2273:8;2262:9;2258:24;2248:34;;2320:7;2313:4;2309:2;2305:13;2301:27;2291:55;;2342:1;2339;2332:12;2291:55;2382:2;2369:16;2408:2;2400:6;2397:14;2394:34;;;2424:1;2421;2414:12;2394:34;2469:7;2464:2;2455:6;2451:2;2447:15;2443:24;2440:37;2437:57;;;2490:1;2487;2480:12;2437:57;2521:2;2517;2513:11;2503:21;;2543:6;2533:16;;;;;2599:2;2588:9;2584:18;2571:32;2612:38;2644:5;2612:38;:::i;:::-;2669:5;2659:15;;;1573:1107;;;;;;;;:::o;2685:127::-;2746:10;2741:3;2737:20;2734:1;2727:31;2777:4;2774:1;2767:15;2801:4;2798:1;2791:15;2817:179;2884:20;;-1:-1:-1;;;;;2933:38:21;;2923:49;;2913:77;;2986:1;2983;2976:12;3001:188;3069:20;;-1:-1:-1;;;;;3118:46:21;;3108:57;;3098:85;;3179:1;3176;3169:12;3194:165;3261:20;;3321:12;3310:24;;3300:35;;3290:63;;3349:1;3346;3339:12;3364:161;3431:20;;3491:8;3480:20;;3470:31;;3460:59;;3515:1;3512;3505:12;3530:1046;3592:5;3622:6;3665:2;3653:9;3648:3;3644:19;3640:28;3637:48;;;3681:1;3678;3671:12;3637:48;3714:2;3708:9;3744:15;;;;3789:18;3774:34;;3810:22;;;3771:62;3768:185;;;3875:10;3870:3;3866:20;3863:1;3856:31;3910:4;3907:1;3900:15;3938:4;3935:1;3928:15;3768:185;3973:10;3969:2;3962:22;4002:6;3993:15;;4032:28;4050:9;4032:28;:::i;:::-;4024:6;4017:44;4094:38;4128:2;4117:9;4113:18;4094:38;:::i;:::-;4089:2;4081:6;4077:15;4070:63;4166:38;4200:2;4189:9;4185:18;4166:38;:::i;:::-;4161:2;4153:6;4149:15;4142:63;4238:38;4272:2;4261:9;4257:18;4238:38;:::i;:::-;4233:2;4225:6;4221:15;4214:63;4311:39;4345:3;4334:9;4330:19;4311:39;:::i;:::-;4305:3;4297:6;4293:16;4286:65;4385:38;4418:3;4407:9;4403:19;4385:38;:::i;:::-;4379:3;4371:6;4367:16;4360:64;4458:38;4491:3;4480:9;4476:19;4458:38;:::i;:::-;4452:3;4444:6;4440:16;4433:64;4531:38;4564:3;4553:9;4549:19;4531:38;:::i;:::-;4525:3;4517:6;4513:16;4506:64;;;3530:1046;;;;:::o;4581:244::-;4673:6;4726:3;4714:9;4705:7;4701:23;4697:33;4694:53;;;4743:1;4740;4733:12;4694:53;4766;4811:7;4800:9;4766:53;:::i;5256:159::-;5323:20;;5383:6;5372:18;;5362:29;;5352:57;;5405:1;5402;5395:12;5420:846;5538:6;5546;5554;5562;5570;5578;5586;5594;5647:3;5635:9;5626:7;5622:23;5618:33;5615:53;;;5664:1;5661;5654:12;5615:53;5703:9;5690:23;5722:38;5754:5;5722:38;:::i;:::-;5779:5;-1:-1:-1;5803:38:21;5837:2;5822:18;;5803:38;:::i;:::-;5793:48;;5860:37;5893:2;5882:9;5878:18;5860:37;:::i;:::-;5850:47;;5916:37;5949:2;5938:9;5934:18;5916:37;:::i;:::-;5906:47;;6000:3;5989:9;5985:19;5972:33;5962:43;;6057:3;6046:9;6042:19;6029:33;6106:4;6097:7;6093:18;6084:7;6081:31;6071:59;;6126:1;6123;6116:12;6071:59;5420:846;;;;-1:-1:-1;5420:846:21;;;;;;6149:7;;-1:-1:-1;;;6203:3:21;6188:19;;6175:33;;6255:3;6240:19;6227:33;;5420:846::o;6271:473::-;6355:6;6363;6371;6379;6432:3;6420:9;6411:7;6407:23;6403:33;6400:53;;;6449:1;6446;6439:12;6400:53;6488:9;6475:23;6507:38;6539:5;6507:38;:::i;:::-;6564:5;-1:-1:-1;6588:38:21;6622:2;6607:18;;6588:38;:::i;:::-;6578:48;;6645:37;6678:2;6667:9;6663:18;6645:37;:::i;:::-;6635:47;;6701:37;6734:2;6723:9;6719:18;6701:37;:::i;:::-;6691:47;;6271:473;;;;;;;:::o;6749:254::-;6808:6;6861:2;6849:9;6840:7;6836:23;6832:32;6829:52;;;6877:1;6874;6867:12;6829:52;6916:9;6903:23;6935:38;6967:5;6935:38;:::i;7493:496::-;7614:6;7622;7675:2;7663:9;7654:7;7650:23;7646:32;7643:52;;;7691:1;7688;7681:12;7643:52;7731:9;7718:23;7764:18;7756:6;7753:30;7750:50;;;7796:1;7793;7786:12;7750:50;7835:94;7921:7;7912:6;7901:9;7897:22;7835:94;:::i;7994:632::-;8165:2;8217:21;;;8287:13;;8190:18;;;8309:22;;;8136:4;;8165:2;8388:15;;;;8362:2;8347:18;;;8136:4;8431:169;8445:6;8442:1;8439:13;8431:169;;;8506:13;;8494:26;;8575:15;;;;8540:12;;;;8467:1;8460:9;8431:169;;;-1:-1:-1;8617:3:21;;7994:632;-1:-1:-1;;;;;;7994:632:21:o;8631:390::-;8739:6;8747;8755;8808:3;8796:9;8787:7;8783:23;8779:33;8776:53;;;8825:1;8822;8815:12;8776:53;8848;8893:7;8882:9;8848:53;:::i;:::-;8838:63;;8920:38;8953:3;8942:9;8938:19;8920:38;:::i;:::-;8910:48;;8977:38;9010:3;8999:9;8995:19;8977:38;:::i;:::-;8967:48;;8631:390;;;;;:::o;10514:202::-;10608:6;10661:3;10649:9;10640:7;10636:23;10632:33;10629:53;;;10678:1;10675;10668:12;11129:322;11197:6;11205;11258:2;11246:9;11237:7;11233:23;11229:32;11226:52;;;11274:1;11271;11264:12;11226:52;11313:9;11300:23;11332:38;11364:5;11332:38;:::i;:::-;11389:5;11441:2;11426:18;;;;11413:32;;-1:-1:-1;;;11129:322:21:o;11456:400::-;11532:6;11540;11548;11601:2;11589:9;11580:7;11576:23;11572:32;11569:52;;;11617:1;11614;11607:12;11569:52;11656:9;11643:23;11675:38;11707:5;11675:38;:::i;:::-;11732:5;-1:-1:-1;11756:38:21;11790:2;11775:18;;11756:38;:::i;:::-;11746:48;;11813:37;11846:2;11835:9;11831:18;11813:37;:::i;12208:617::-;12307:6;12315;12323;12331;12339;12347;12400:3;12388:9;12379:7;12375:23;12371:33;12368:53;;;12417:1;12414;12407:12;12368:53;12456:9;12443:23;12475:38;12507:5;12475:38;:::i;:::-;12532:5;-1:-1:-1;12556:37:21;12589:2;12574:18;;12556:37;:::i;:::-;12546:47;;12612:37;12645:2;12634:9;12630:18;12612:37;:::i;:::-;12602:47;;12668:37;12701:2;12690:9;12686:18;12668:37;:::i;:::-;12658:47;;12724:38;12757:3;12746:9;12742:19;12724:38;:::i;:::-;12714:48;;12781:38;12814:3;12803:9;12799:19;12781:38;:::i;:::-;12771:48;;12208:617;;;;;;;;:::o;13066:336::-;13268:2;13250:21;;;13307:2;13287:18;;;13280:30;-1:-1:-1;;;13341:2:21;13326:18;;13319:42;13393:2;13378:18;;13066:336::o;13407:127::-;13468:10;13463:3;13459:20;13456:1;13449:31;13499:4;13496:1;13489:15;13523:4;13520:1;13513:15;13640:1303;13842:3;13827:19;;-1:-1:-1;;;;;13877:25:21;13895:6;13877:25;:::i;:::-;13873:58;13862:9;13855:77;13979:4;13971:6;13967:17;13954:31;13994:38;14026:5;13994:38;:::i;:::-;-1:-1:-1;;;;;14108:14:21;;;14101:4;14086:20;;14079:44;14172:4;14160:17;;14147:31;;14187:40;14147:31;14187:40;:::i;:::-;14265:16;14258:4;14243:20;;14236:46;14311:37;14342:4;14330:17;;14311:37;:::i;:::-;-1:-1:-1;;;;;11927:46:21;14405:4;14390:20;;11915:59;14442:37;14473:4;14461:17;;14442:37;:::i;:::-;-1:-1:-1;;;;;11927:46:21;14538:4;14523:20;;11915:59;14575:36;14605:4;14593:17;;14575:36;:::i;:::-;13615:12;13604:24;14669:4;14654:20;;13592:37;14706:36;14736:4;14724:17;;14706:36;:::i;:::-;9355:8;9344:20;14800:4;14785:20;;9332:33;14837:36;14867:4;14855:17;;14837:36;:::i;:::-;9355:8;9344:20;;14931:4;14916:20;;9332:33;14882:55;9279:92;14948:186;15007:6;15060:2;15048:9;15039:7;15035:23;15031:32;15028:52;;;15076:1;15073;15066:12;15028:52;15099:29;15118:9;15099:29;:::i;15139:127::-;15200:10;15195:3;15191:20;15188:1;15181:31;15231:4;15228:1;15221:15;15255:4;15252:1;15245:15;15271:125;15336:9;;;15357:10;;;15354:36;;;15370:18;;:::i;15401:135::-;15440:3;15461:17;;;15458:43;;15481:18;;:::i;:::-;-1:-1:-1;15528:1:21;15517:13;;15401:135::o;15541:184::-;15611:6;15664:2;15652:9;15643:7;15639:23;15635:32;15632:52;;;15680:1;15677;15670:12;15632:52;-1:-1:-1;15703:16:21;;15541:184;-1:-1:-1;15541:184:21:o;15730:128::-;15797:9;;;15818:11;;;15815:37;;;15832:18;;:::i;15863:184::-;15921:6;15974:2;15962:9;15953:7;15949:23;15945:32;15942:52;;;15990:1;15987;15980:12;15942:52;16013:28;16031:9;16013:28;:::i;16052:184::-;16110:6;16163:2;16151:9;16142:7;16138:23;16134:32;16131:52;;;16179:1;16176;16169:12;16131:52;16202:28;16220:9;16202:28;:::i;16241:174::-;16308:12;16340:10;;;16352;;;16336:27;;16375:11;;;16372:37;;;16389:18;;:::i;16420:815::-;-1:-1:-1;;;;;16755:15:21;;;16737:34;;16807:15;;;16802:2;16787:18;;16780:43;16859:15;;16854:2;16839:18;;16832:43;16906:2;16891:18;;16884:34;;;16949:3;16934:19;;16927:35;;;16999:3;16717;16978:19;;16971:32;;;17019:19;;17012:35;;;16680:4;17040:6;17090;17084:3;17069:19;;17056:49;17155:1;17149:3;17140:6;17129:9;17125:22;17121:32;17114:43;17225:3;17218:2;17214:7;17209:2;17201:6;17197:15;17193:29;17182:9;17178:45;17174:55;17166:63;;16420:815;;;;;;;;;;:::o;18265:400::-;-1:-1:-1;;;;;18521:15:21;;;18503:34;;18573:15;;;;18568:2;18553:18;;18546:43;-1:-1:-1;;;;;;18625:33:21;;;18620:2;18605:18;;18598:61;18453:2;18438:18;;18265:400::o;18670:277::-;18737:6;18790:2;18778:9;18769:7;18765:23;18761:32;18758:52;;;18806:1;18803;18796:12;18758:52;18838:9;18832:16;18891:5;18884:13;18877:21;18870:5;18867:32;18857:60;;18913:1;18910;18903:12;19174:171;19242:6;19281:10;;;19269;;;19265:27;;19304:12;;;19301:38;;;19319:18;;:::i;20273:1088::-;20431:4;20473:3;20462:9;20458:19;20450:27;;-1:-1:-1;;;;;20514:6:21;20508:13;20504:46;20493:9;20486:65;20598:4;20590:6;20586:17;20580:24;20640:1;20636;20631:3;20627:11;20623:19;20698:2;20684:12;20680:21;20673:4;20662:9;20658:20;20651:51;20770:2;20762:4;20754:6;20750:17;20744:24;20740:33;20733:4;20722:9;20718:20;20711:63;;;-1:-1:-1;;;;;20834:4:21;20826:6;20822:17;20816:24;20812:65;20805:4;20794:9;20790:20;20783:95;20927:4;20919:6;20915:17;20909:24;20942:56;20992:4;20981:9;20977:20;20961:14;-1:-1:-1;;;;;11927:46:21;11915:59;;11861:119;20942:56;;21047:4;21039:6;21035:17;21029:24;21062:55;21111:4;21100:9;21096:20;21080:14;13615:12;13604:24;13592:37;;13539:96;21062:55;;21166:4;21158:6;21154:17;21148:24;21181:55;21230:4;21219:9;21215:20;21199:14;9355:8;9344:20;9332:33;;9279:92;21181:55;;21285:4;21277:6;21273:17;21267:24;21300:55;21349:4;21338:9;21334:20;21318:14;9355:8;9344:20;9332:33;;9279:92;22415:127;22476:10;22471:3;22467:20;22464:1;22457:31;22507:4;22504:1;22497:15;22531:4;22528:1;22521:15
Swarm Source
ipfs://e7252747c7630fd0ba77eec12fcce98a86143cd67504ed4e3bb88d7284ea193e
Loading...
Loading
Loading...
Loading

Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.