Contract Details
Overview
COOK BALANCE
Loading…TOKEN NAME
EVM ContractTOTAL SUPPLY
Not availableMore Info
CONTRACT ADDRESS
0xfed19c0a975ffcf12f9d3c2412a487dd16710282CONTRACT CREATOR
0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30Creation transaction
TOKEN TRACKER
Checking ERC-20 metadata…Contract Info
SOURCE CODE
✓ Verified
TOKEN DECIMALS
Not availableMarket and multichain values require verified data feeds.
Latest Contract Transactions
Loading indexed transactions…
| Transaction Hash | Action | Block | Age | From | To | Amount | Txn Fee |
|---|
Token Transfers
ERC-20 Transfer events from the latest indexed transactions involving this contract.
Loading receipt events…
Contract Events
Event logs emitted by this contract in the latest indexed contract transactions.
Loading receipt events…
Internal Transactions
Execution traces are not currently indexed. Internal calls cannot be reconstructed from receipts alone.
Token & Contract Information
- Network
- Cookchain · Chain ID 20261001
- Contract
- 0xfed19c0a975ffcf12f9d3c2412a487dd16710282
- Verification
- Verified
Token metadata is read from the contract. Market valuations and multichain holdings are not currently indexed.
Verified Solidity Source
Compiler: 0.8.24+commit.e11b9ed9.Emscripten.clang · Contract: contracts/CookDEXPresaleExtensions.sol:CookDEXVestingModuleV1 · Creation bytecode: matched
@openzeppelin/contracts/security/ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
@openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates merkle trees that are safe
* against this attack out of the box.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}.
*
* CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofLen = proof.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
require(proofPos == proofLen, "MerkleProof: invalid multiproof");
unchecked {
return hashes[totalHashes - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
@openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
contracts/CookDEXPresaleExtensions.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
interface ICookDEXReservedAirdrop {
function token() external view returns(IERC20);
function sourceCampaign() external view returns(address);
function totalAllocation() external view returns(uint256);
function claimStart() external view returns(uint64);
}
interface ICookDEXRelativeAirdrop {
function token() external view returns(IERC20);
function sourceCampaign() external view returns(address);
function totalAllocation() external view returns(uint256);
function startOffset() external view returns(uint64);
function activate(uint64 anchor) external;
}
/// @notice Public multi-plan vesting vault. Team and investor plans are kept
/// separate and remain readable after the related presale has ended.
contract CookDEXVestingVaultV1 is ReentrancyGuard {
using SafeERC20 for IERC20;
struct Plan { bytes32 label; uint64 start; uint64 cliff; uint64 duration; uint64 interval; uint16 tgeBps; uint256 allocated; bool relative; bool exists; }
struct Grant { uint256 allocation; uint256 claimed; }
struct AirdropReserve { uint256 amount; uint64 claimStart; uint64 startOffset; address airdrop; bool released; bool relative; bool exists; }
IERC20 public immutable token;
address public immutable sourceCampaign;
address public owner;
bool public vestingSealed;
uint256 public totalAllocated;
uint256 public totalClaimed;
uint256 public totalAirdropReleased;
Plan[] public plans;
mapping(uint256=>mapping(address=>Grant)) public grants;
mapping(bytes32=>AirdropReserve) public airdropReserves;
bytes32[] public airdropScheduleIds;
uint256 public airdropExecutionCursor;
uint256 public unboundAirdropCount;
uint64 public scheduleAnchor;
event PlanCreated(uint256 indexed planId,bytes32 indexed label,uint64 start,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps);
event GrantAdded(uint256 indexed planId,address indexed beneficiary,uint256 amount);
event VestingSealed(uint256 totalAllocated);
event TokensClaimed(uint256 indexed planId,address indexed beneficiary,uint256 amount);
event OwnershipTransferred(address indexed previousOwner,address indexed nextOwner);
event AirdropReserved(bytes32 indexed scheduleId,uint256 amount,uint64 claimStart);
event AirdropReserveReleased(bytes32 indexed scheduleId,address indexed airdrop,uint256 amount);
event AirdropContractBound(bytes32 indexed scheduleId,address indexed airdrop);
event ScheduleAnchored(uint64 timestamp);
constructor(address token_,address campaign_,address owner_){require(token_!=address(0)&&owner_!=address(0),"ADDRESS_ZERO");token=IERC20(token_);sourceCampaign=campaign_;owner=owner_;}
modifier onlyOwner(){require(msg.sender==owner,"NOT_OWNER");_;}
modifier beforeSeal(){require(!vestingSealed,"VESTING_SEALED");_;}
function planCount() external view returns(uint256){return plans.length;}
function createPlan(bytes32 label,uint64 start,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps) external onlyOwner beforeSeal returns(uint256 planId){
require(label!=bytes32(0)&&start>0&&duration>0&&interval>0&&interval<=duration&&tgeBps<=10_000,"PLAN_INVALID");
require(cliff<=3650 days&&duration<=7300 days,"DURATION_INVALID");
planId=plans.length;plans.push(Plan(label,start,cliff,duration,interval,tgeBps,0,false,true));emit PlanCreated(planId,label,start,cliff,duration,interval,tgeBps);
}
function createRelativePlan(bytes32 label,uint64 startOffset,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps) external onlyOwner beforeSeal returns(uint256 planId){
require(label!=bytes32(0)&&startOffset<=3650 days&&duration>0&&interval>0&&interval<=duration&&tgeBps<=10_000,"PLAN_INVALID");require(cliff<=3650 days&&duration<=7300 days,"DURATION_INVALID");
planId=plans.length;plans.push(Plan(label,startOffset,cliff,duration,interval,tgeBps,0,true,true));emit PlanCreated(planId,label,startOffset,cliff,duration,interval,tgeBps);
}
function addGrants(uint256 planId,address[] calldata beneficiaries,uint256[] calldata amounts) external onlyOwner beforeSeal {
require(planId<plans.length&&beneficiaries.length>0&&beneficiaries.length==amounts.length&&beneficiaries.length<=250,"GRANTS_INVALID");
uint256 added;
for(uint256 i;i<beneficiaries.length;i++){address account=beneficiaries[i];uint256 amount=amounts[i];require(account!=address(0)&&amount>0&&grants[planId][account].allocation==0,"GRANT_INVALID");grants[planId][account].allocation=amount;added+=amount;emit GrantAdded(planId,account,amount);}
plans[planId].allocated+=added;totalAllocated+=added;
}
function reserveAirdrop(bytes32 scheduleId,uint256 amount,uint64 claimStart) external onlyOwner beforeSeal {
require(scheduleId!=bytes32(0)&&amount>0&&claimStart>block.timestamp&&!airdropReserves[scheduleId].exists,"AIRDROP_RESERVE_INVALID");
airdropReserves[scheduleId]=AirdropReserve(amount,claimStart,0,address(0),false,false,true);airdropScheduleIds.push(scheduleId);unboundAirdropCount++;totalAllocated+=amount;emit AirdropReserved(scheduleId,amount,claimStart);
}
function reserveRelativeAirdrop(bytes32 scheduleId,uint256 amount,uint64 startOffset) external onlyOwner beforeSeal {
require(scheduleId!=bytes32(0)&&amount>0&&startOffset<=7300 days&&!airdropReserves[scheduleId].exists,"AIRDROP_RESERVE_INVALID");
airdropReserves[scheduleId]=AirdropReserve(amount,0,startOffset,address(0),false,true,true);airdropScheduleIds.push(scheduleId);unboundAirdropCount++;totalAllocated+=amount;emit AirdropReserved(scheduleId,amount,startOffset);
}
function airdropScheduleCount() external view returns(uint256){return airdropScheduleIds.length;}
function bindAirdropContract(bytes32 scheduleId,address airdrop) external onlyOwner beforeSeal {
AirdropReserve storage reserve=airdropReserves[scheduleId];require(reserve.exists&&airdrop!=address(0)&&reserve.airdrop==address(0),"AIRDROP_BIND_INVALID");
if(reserve.relative){ICookDEXRelativeAirdrop target=ICookDEXRelativeAirdrop(airdrop);require(address(target.token())==address(token)&&target.sourceCampaign()==sourceCampaign&&target.totalAllocation()==reserve.amount&&target.startOffset()==reserve.startOffset,"AIRDROP_MISMATCH");}
else{ICookDEXReservedAirdrop target=ICookDEXReservedAirdrop(airdrop);require(address(target.token())==address(token)&&target.sourceCampaign()==sourceCampaign&&target.totalAllocation()==reserve.amount&&target.claimStart()==reserve.claimStart,"AIRDROP_MISMATCH");}
reserve.airdrop=airdrop;unboundAirdropCount--;emit AirdropContractBound(scheduleId,airdrop);
}
function seal() external onlyOwner beforeSeal {require(totalAllocated>0&&token.balanceOf(address(this))>=totalAllocated,"FUNDING_LOW");require(unboundAirdropCount==0,"AIRDROP_UNBOUND");vestingSealed=true;emit VestingSealed(totalAllocated);}
function vestedAmount(uint256 planId,address beneficiary,uint64 timestamp) public view returns(uint256){
require(planId<plans.length,"PLAN_UNKNOWN");Plan memory plan=plans[planId];uint256 allocation=grants[planId][beneficiary].allocation;uint64 start=plan.relative?(scheduleAnchor==0?type(uint64).max:scheduleAnchor+plan.start):plan.start;if(allocation==0||timestamp<start)return 0;
uint256 tge=allocation*plan.tgeBps/10_000;if(timestamp<start+plan.cliff)return tge;
uint256 elapsed=timestamp-(start+plan.cliff);if(elapsed>=plan.duration)return allocation;
elapsed=elapsed/plan.interval*plan.interval;return tge+(allocation-tge)*elapsed/plan.duration;
}
function claimable(uint256 planId,address beneficiary) public view returns(uint256){uint256 vested=vestedAmount(planId,beneficiary,uint64(block.timestamp));uint256 paid=grants[planId][beneficiary].claimed;return vested>paid?vested-paid:0;}
function claim(uint256 planId) external nonReentrant {require(vestingSealed,"NOT_ACTIVE");uint256 amount=claimable(planId,msg.sender);require(amount>0,"NOTHING_TO_CLAIM");grants[planId][msg.sender].claimed+=amount;totalClaimed+=amount;token.safeTransfer(msg.sender,amount);emit TokensClaimed(planId,msg.sender,amount);}
function anchorAfterPresale() public {
require(vestingSealed&&scheduleAnchor==0,"ANCHOR_UNAVAILABLE");
if(sourceCampaign!=address(0)){(bool ok,bytes memory value)=sourceCampaign.staticcall(abi.encodeWithSignature("finalized()"));require(ok&&value.length>=32&&abi.decode(value,(bool)),"PRESALE_NOT_FINALIZED");}
scheduleAnchor=uint64(block.timestamp);emit ScheduleAnchored(scheduleAnchor);
}
function executeAirdropReserve(bytes32 scheduleId) public nonReentrant {
AirdropReserve storage reserve=airdropReserves[scheduleId];require(vestingSealed&&reserve.exists&&!reserve.released&&reserve.airdrop!=address(0),"AIRDROP_RELEASE_INVALID");
if(reserve.relative){require(scheduleAnchor!=0,"SCHEDULE_NOT_ANCHORED");ICookDEXRelativeAirdrop(reserve.airdrop).activate(scheduleAnchor);}
reserve.released=true;totalAirdropReleased+=reserve.amount;token.safeTransfer(reserve.airdrop,reserve.amount);emit AirdropReserveReleased(scheduleId,reserve.airdrop,reserve.amount);
}
function executeScheduledAirdrops(uint256 maxCount) external nonReentrant {
require(vestingSealed&&maxCount>0&&maxCount<=100,"BATCH_INVALID");uint256 cursor=airdropExecutionCursor;uint256 end=cursor+maxCount;if(end>airdropScheduleIds.length)end=airdropScheduleIds.length;
while(cursor<end){bytes32 scheduleId=airdropScheduleIds[cursor];AirdropReserve storage reserve=airdropReserves[scheduleId];if(!reserve.released&&reserve.airdrop!=address(0)){if(reserve.relative&&scheduleAnchor==0)break;if(reserve.relative)ICookDEXRelativeAirdrop(reserve.airdrop).activate(scheduleAnchor);reserve.released=true;totalAirdropReleased+=reserve.amount;token.safeTransfer(reserve.airdrop,reserve.amount);emit AirdropReserveReleased(scheduleId,reserve.airdrop,reserve.amount);}cursor++;}
airdropExecutionCursor=cursor;
}
function recoverExcess(address to,uint256 amount) external onlyOwner {require(to!=address(0),"ADDRESS_ZERO");uint256 reserved=totalAllocated-totalClaimed-totalAirdropReleased;uint256 balance=token.balanceOf(address(this));require(balance>=reserved&&amount<=balance-reserved,"RESERVED_TOKENS");token.safeTransfer(to,amount);}
function transferOwnership(address next) external onlyOwner {require(next!=address(0),"ADDRESS_ZERO");emit OwnershipTransferred(owner,next);owner=next;}
}
contract CookDEXVestingModuleV1 {
event VestingVaultCreated(address indexed vault,address indexed token,address indexed owner,address sourceCampaign);
function createVesting(address token,address sourceCampaign) external returns(address vault){vault=address(new CookDEXVestingVaultV1(token,sourceCampaign,msg.sender));emit VestingVaultCreated(vault,token,msg.sender,sourceCampaign);}
}
/// @notice Claim-based airdrop. Eligibility modes (CSV, registration,
/// historical holders, snapshot holders or deterministic random selection)
/// are calculated off-chain and committed immutably through the Merkle root.
contract CookDEXAirdropV1 is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable token;
address public immutable owner;
address public immutable sourceCampaign;
bytes32 public immutable merkleRoot;
bytes32 public immutable selectionCommitment;
uint8 public immutable eligibilityMode;
uint64 public immutable claimStart;
uint64 public immutable claimEnd;
uint256 public immutable totalAllocation;
uint256 public totalClaimed;
mapping(uint256=>uint256) private claimedBitMap;
event Claimed(uint256 indexed index,address indexed account,uint256 amount);
event UnclaimedRecovered(address indexed to,uint256 amount);
constructor(address token_,address owner_,address campaign_,bytes32 root_,bytes32 selectionCommitment_,uint8 mode_,uint64 start_,uint64 end_,uint256 total_){
require(token_!=address(0)&&owner_!=address(0)&&root_!=bytes32(0)&&start_<end_&&total_>0,"CONFIG_INVALID");
token=IERC20(token_);owner=owner_;sourceCampaign=campaign_;merkleRoot=root_;selectionCommitment=selectionCommitment_;eligibilityMode=mode_;claimStart=start_;claimEnd=end_;totalAllocation=total_;
}
function isClaimed(uint256 index) public view returns(bool){uint256 word=claimedBitMap[index/256];uint256 mask=1<<(index%256);return word&mask==mask;}
function claim(uint256 index,address account,uint256 amount,bytes32[] calldata proof) external nonReentrant {
require(block.timestamp>=claimStart&&block.timestamp<=claimEnd&&!isClaimed(index)&&account!=address(0),"CLAIM_UNAVAILABLE");
bytes32 leaf=keccak256(bytes.concat(keccak256(abi.encode(index,account,amount))));require(MerkleProof.verify(proof,merkleRoot,leaf),"PROOF_INVALID");
claimedBitMap[index/256]|=1<<(index%256);totalClaimed+=amount;require(totalClaimed<=totalAllocation,"ALLOCATION_EXCEEDED");token.safeTransfer(account,amount);emit Claimed(index,account,amount);
}
function recoverUnclaimed(address to) external nonReentrant {require(msg.sender==owner&&block.timestamp>claimEnd&&to!=address(0),"RECOVERY_UNAVAILABLE");uint256 amount=token.balanceOf(address(this));token.safeTransfer(to,amount);emit UnclaimedRecovered(to,amount);}
}
/// @notice Vesting-bound airdrop whose claim window is anchored to the actual
/// presale finalization time. Only its immutable vesting vault may activate it.
contract CookDEXScheduledAirdropV1 is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable token;
address public immutable owner;
address public immutable sourceCampaign;
address public immutable vestingVault;
bytes32 public immutable merkleRoot;
bytes32 public immutable selectionCommitment;
uint8 public immutable eligibilityMode;
uint64 public immutable startOffset;
uint64 public immutable claimDuration;
uint256 public immutable totalAllocation;
uint64 public claimStart;
uint64 public claimEnd;
uint256 public totalClaimed;
mapping(uint256=>uint256) private claimedBitMap;
event Activated(uint64 indexed anchor,uint64 claimStart,uint64 claimEnd);
event Claimed(uint256 indexed index,address indexed account,uint256 amount);
event UnclaimedRecovered(address indexed to,uint256 amount);
constructor(address token_,address owner_,address campaign_,address vault_,bytes32 root_,bytes32 commitment_,uint8 mode_,uint64 offset_,uint64 duration_,uint256 total_){
require(token_!=address(0)&&owner_!=address(0)&&vault_!=address(0)&&root_!=bytes32(0)&&duration_>0&&total_>0,"CONFIG_INVALID");
token=IERC20(token_);owner=owner_;sourceCampaign=campaign_;vestingVault=vault_;merkleRoot=root_;selectionCommitment=commitment_;eligibilityMode=mode_;startOffset=offset_;claimDuration=duration_;totalAllocation=total_;
}
function activate(uint64 anchor) external {require(msg.sender==vestingVault&&claimStart==0&&anchor>0,"ACTIVATION_UNAVAILABLE");claimStart=anchor+startOffset;claimEnd=claimStart+claimDuration;emit Activated(anchor,claimStart,claimEnd);}
function isClaimed(uint256 index) public view returns(bool){uint256 word=claimedBitMap[index/256];uint256 mask=1<<(index%256);return word&mask==mask;}
function claim(uint256 index,address account,uint256 amount,bytes32[] calldata proof) external nonReentrant {
require(claimStart>0&&block.timestamp>=claimStart&&block.timestamp<=claimEnd&&!isClaimed(index)&&account!=address(0),"CLAIM_UNAVAILABLE");
bytes32 leaf=keccak256(bytes.concat(keccak256(abi.encode(index,account,amount))));require(MerkleProof.verify(proof,merkleRoot,leaf),"PROOF_INVALID");
claimedBitMap[index/256]|=1<<(index%256);totalClaimed+=amount;require(totalClaimed<=totalAllocation,"ALLOCATION_EXCEEDED");token.safeTransfer(account,amount);emit Claimed(index,account,amount);
}
function recoverUnclaimed(address to) external nonReentrant {require(msg.sender==owner&&claimEnd>0&&block.timestamp>claimEnd&&to!=address(0),"RECOVERY_UNAVAILABLE");uint256 amount=token.balanceOf(address(this));token.safeTransfer(to,amount);emit UnclaimedRecovered(to,amount);}
}
contract CookDEXAirdropModuleV1 {
event AirdropCreated(address indexed airdrop,address indexed token,address indexed owner,address sourceCampaign,uint8 mode);
function createAirdrop(address token,address sourceCampaign,bytes32 root,bytes32 selectionCommitment,uint8 mode,uint64 start,uint64 end,uint256 totalAllocation) external returns(address airdrop){
airdrop=address(new CookDEXAirdropV1(token,msg.sender,sourceCampaign,root,selectionCommitment,mode,start,end,totalAllocation));emit AirdropCreated(airdrop,token,msg.sender,sourceCampaign,mode);
}
function createScheduledAirdrop(address token,address sourceCampaign,address vestingVault,bytes32 root,bytes32 selectionCommitment,uint8 mode,uint64 startOffset,uint64 claimDuration,uint256 totalAllocation) external returns(address airdrop){
airdrop=address(new CookDEXScheduledAirdropV1(token,msg.sender,sourceCampaign,vestingVault,root,selectionCommitment,mode,startOffset,claimDuration,totalAllocation));emit AirdropCreated(airdrop,token,msg.sender,sourceCampaign,mode);
}
}
/// @notice Escrowed OTC allocation sold before a public presale. Buyers claim
/// sale tokens at the configured release time; owner proceeds unlock after end.
struct CookDEXOTCConfig {address token;address paymentToken;uint8 saleDecimals;uint256 pricePerToken;uint256 minAllocation;uint256 maxAllocation;uint64 startTime;uint64 endTime;uint64 claimTime;bool publicDeal;}
contract CookDEXOTCDealV1 is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable saleToken;
IERC20 public immutable paymentToken;
address public immutable owner;
uint8 public immutable saleDecimals;
uint256 public immutable pricePerToken;
uint256 public immutable minAllocation;
uint256 public immutable maxAllocation;
uint64 public immutable startTime;
uint64 public immutable endTime;
uint64 public immutable claimTime;
bool public immutable publicDeal;
mapping(address=>bool) public allowed;
mapping(address=>uint256) public allocation;
uint256 public totalAllocated;
uint256 public totalClaimed;
event Purchased(address indexed buyer,uint256 tokenAmount,uint256 paymentAmount);
event Claimed(address indexed buyer,uint256 tokenAmount);
constructor(CookDEXOTCConfig memory config,address owner_,address[] memory allowlist){
require(config.token!=address(0)&&owner_!=address(0)&&config.saleDecimals<=36&&config.pricePerToken>0&&config.startTime<config.endTime&&config.claimTime>=config.endTime&&config.maxAllocation>=config.minAllocation,"CONFIG_INVALID");
saleToken=IERC20(config.token);paymentToken=IERC20(config.paymentToken);owner=owner_;saleDecimals=config.saleDecimals;pricePerToken=config.pricePerToken;minAllocation=config.minAllocation;maxAllocation=config.maxAllocation;startTime=config.startTime;endTime=config.endTime;claimTime=config.claimTime;publicDeal=config.publicDeal;
for(uint256 i;i<allowlist.length;i++){require(allowlist[i]!=address(0),"ALLOWLIST_INVALID");allowed[allowlist[i]]=true;}
}
function quote(uint256 tokenAmount) public view returns(uint256){return Math.mulDiv(tokenAmount,pricePerToken,10**saleDecimals);}
function buy(uint256 tokenAmount) external payable nonReentrant {
require(block.timestamp>=startTime&&block.timestamp<=endTime&&(publicDeal||allowed[msg.sender]),"SALE_UNAVAILABLE");
uint256 next=allocation[msg.sender]+tokenAmount;require(tokenAmount>0&&next>=minAllocation&&(maxAllocation==0||next<=maxAllocation),"ALLOCATION_INVALID");
require(saleToken.balanceOf(address(this))>=totalAllocated+tokenAmount,"INSUFFICIENT_TOKENS");uint256 payment=quote(tokenAmount);
if(address(paymentToken)==address(0))require(msg.value==payment,"PAYMENT_INVALID");else{require(msg.value==0,"NATIVE_NOT_ACCEPTED");paymentToken.safeTransferFrom(msg.sender,address(this),payment);}
allocation[msg.sender]=next;totalAllocated+=tokenAmount;emit Purchased(msg.sender,tokenAmount,payment);
}
function claim() external nonReentrant {require(block.timestamp>=claimTime,"CLAIM_LOCKED");uint256 amount=allocation[msg.sender];require(amount>0,"NOTHING_TO_CLAIM");allocation[msg.sender]=0;totalClaimed+=amount;saleToken.safeTransfer(msg.sender,amount);emit Claimed(msg.sender,amount);}
function withdrawProceeds(address payable to) external nonReentrant {require(msg.sender==owner&&block.timestamp>endTime&&to!=address(0),"WITHDRAW_UNAVAILABLE");if(address(paymentToken)==address(0)){uint256 amount=address(this).balance;(bool ok,)=to.call{value:amount}("");require(ok,"TRANSFER_FAILED");}else paymentToken.safeTransfer(to,paymentToken.balanceOf(address(this)));}
function recoverUnsold(address to) external nonReentrant {require(msg.sender==owner&&block.timestamp>endTime&&to!=address(0),"RECOVERY_UNAVAILABLE");uint256 reserved=totalAllocated-totalClaimed;uint256 balance=saleToken.balanceOf(address(this));if(balance>reserved)saleToken.safeTransfer(to,balance-reserved);}
}
contract CookDEXOTCModuleV1 {
event OTCDealCreated(address indexed deal,address indexed token,address indexed owner,address paymentToken,bool publicDeal);
function createOTCDeal(CookDEXOTCConfig calldata config,address[] calldata allowlist) external returns(address deal){
deal=address(new CookDEXOTCDealV1(config,msg.sender,allowlist));
emit OTCDealCreated(deal,config.token,msg.sender,config.paymentToken,config.publicDeal);
}
}
Contract ABI
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "VestingVaultCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "createVesting",
"outputs": [
{
"internalType": "address",
"name": "vault",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]Raw Contract Data · JSON
{
"id": "0xfed19c0a975ffcf12f9d3c2412a487dd16710282",
"contract": "0xfed19c0a975ffcf12f9d3c2412a487dd16710282",
"name": "EVM Contract",
"type": "contract",
"bytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ede69a6714610030575b600080fd5b61004361003e36600461015a565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b600082823360405161007d90610124565b73ffffffffffffffffffffffffffffffffffffffff938416815291831660208301529091166040820152606001604051809103906000f0801580156100c6573d6000803e3d6000fd5b5060405173ffffffffffffffffffffffffffffffffffffffff8481168252919250339185811691908416907ff59b9d818dda53f2493e76b44717a06d1f56f51da4c2e4aaca20015199e8a33e9060200160405180910390a492915050565b613c3e8061018e83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461015557600080fd5b919050565b6000806040838503121561016d57600080fd5b61017683610131565b915061018460208401610131565b9050925092905056fe60c06040523480156200001157600080fd5b5060405162003c3e38038062003c3e8339810160408190526200003491620000e6565b60016000556001600160a01b038316158015906200005a57506001600160a01b03811615155b6200009a5760405162461bcd60e51b815260206004820152600c60248201526b414444524553535f5a45524f60a01b604482015260640160405180910390fd5b6001600160a01b0392831660805290821660a052600180546001600160a01b0319169190921617905562000130565b80516001600160a01b0381168114620000e157600080fd5b919050565b600080600060608486031215620000fc57600080fd5b6200010784620000c9565b92506200011760208501620000c9565b91506200012760408501620000c9565b90509250925092565b60805160a051613a94620001aa6000396000818161059f015281816109af01528181610a430152818161122a01526114bd0152600081816105780152818161118d015281816114200152818161184401528181611de1015281816121a9015281816123490152818161242801526126850152613a946000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638c4169ee1161010f578063d54ad2a1116100a2578063ebf6570a11610071578063ebf6570a14610476578063f2fde38b14610560578063fc0c546a14610573578063ffce38391461059a57600080fd5b8063d54ad2a114610448578063d6c5a54114610451578063dc322d6a14610464578063ea1448181461046d57600080fd5b80639bc14552116100de5780639bc14552146103a9578063a0c7f71c146103b2578063ac953d45146103c5578063b1620616146103d857600080fd5b80638c4169ee1461032b5780638da5cb5b1461033e57806392af90de146103695780639754bf081461037c57600080fd5b806338825f8f11610187578063594f518d11610156578063594f518d146102a55780636180a26e146102b857806368c49f0c146102dc5780637526f517146102e457600080fd5b806338825f8f1461026e5780633fb27b851461028157806345f7f2491461028957806351b0688a1461029257600080fd5b80631d872883116101c35780631d8728831461022d5780632049754714610240578063379607f514610253578063382d39bb1461026657600080fd5b806304ffdd25146101ea578063051b9b2c146101ff57806316d0bb6e14610207575b600080fd5b6101fd6101f836600461356f565b6105c1565b005b6101fd61093e565b61021a6102153660046135a8565b610b98565b6040519081526020015b60405180910390f35b61021a61023b3660046135c1565b610bb9565b6101fd61024e366004613656565b611005565b6101fd6102613660046135a8565b61172d565b60055461021a565b61021a61027c3660046135c1565b6118b1565b6101fd611cef565b61021a60025481565b6101fd6102a03660046135a8565b611f56565b6101fd6102b3366004613686565b61223e565b6001546102cc90600160a01b900460ff1681565b6040519015158152602001610224565b60085461021a565b6103166102f2366004613656565b60066020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610224565b6101fd6103393660046135a8565b612455565b600154610351906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b6101fd61037736600461356f565b6126f4565b600b546103909067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610224565b61021a60095481565b61021a6103c0366004613656565b612a06565b61021a6103d33660046136b2565b612a60565b6103eb6103e63660046135a8565b612d3f565b60408051998a5267ffffffffffffffff98891660208b015296881696890196909652938616606088015294909116608086015261ffff1660a085015260c084019290925290151560e0830152151561010082015261012001610224565b61021a60035481565b6101fd61045f366004613735565b612de0565b61021a600a5481565b61021a60045481565b61050f6104843660046135a8565b600760205260009081526040902080546001820154600290920154909167ffffffffffffffff808216926801000000000000000090920416906001600160a01b0381169060ff600160a01b8204811691750100000000000000000000000000000000000000000081048216917601000000000000000000000000000000000000000000009091041687565b6040805197885267ffffffffffffffff968716602089015295909416948601949094526001600160a01b0390911660608501521515608084015290151560a0830152151560c082015260e001610224565b6101fd61056e3660046137af565b6130c8565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b031633146106205760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e4552000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff161561067a5760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906106895750600082115b80156106a3575063259806008167ffffffffffffffff1611155b80156106db5750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6107275760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e0810182528381526000602080830182815267ffffffffffffffff8681168587019081526060860185815260808701868152600160a0890181815260c08a018281528e8a52600790985299882098518955945188860180549451861668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190951617929092179092559051600290950180549151965193511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff941515750100000000000000000000000000000000000000000002949094167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff971515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009093166001600160a01b0397909716969096179190911795909516939093171790925560088054918201815582527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee301849055600a8054916108d9836137fb565b919050555081600260008282546108f09190613833565b90915550506040805183815267ffffffffffffffff8316602082015284917f4938b8cbe1cbc0af26d57be9fe629f82e711bc23b41647216aa9f20fff3eb806910160405180910390a2505050565b600154600160a01b900460ff1680156109615750600b5467ffffffffffffffff16155b6109ad5760405162461bcd60e51b815260206004820152601260248201527f414e43484f525f554e415641494c41424c4500000000000000000000000000006044820152606401610617565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615610b2b5760408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb3f05b9700000000000000000000000000000000000000000000000000000000179052905160009182916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691610a6d9161386a565b600060405180830381855afa9150503d8060008114610aa8576040519150601f19603f3d011682016040523d82523d6000602084013e610aad565b606091505b5091509150818015610ac157506020815110155b8015610adc575080806020019051810190610adc9190613886565b610b285760405162461bcd60e51b815260206004820152601560248201527f50524553414c455f4e4f545f46494e414c495a454400000000000000000000006044820152606401610617565b50505b600b80547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000164267ffffffffffffffff169081179091556040519081527f98c2ef43a97b5b87a409cdec2c1b05904c2623a30b0162b7b7bd1453097d52b8906020015b60405180910390a1565b60088181548110610ba857600080fd5b600091825260209091200154905081565b6001546000906001600160a01b03163314610c165760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615610c705760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b8615801590610c89575060008667ffffffffffffffff16115b8015610c9f575060008467ffffffffffffffff16115b8015610cb5575060008367ffffffffffffffff16115b8015610cd557508367ffffffffffffffff168367ffffffffffffffff1611155b8015610ce757506127108261ffff1611155b610d335760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015610d5f575063259806008467ffffffffffffffff1611155b610dab5760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016000151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b60405180910390a39695505050505050565b6001546001600160a01b0316331461105f5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156110b95760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60008281526007602052604090206002810154760100000000000000000000000000000000000000000000900460ff1680156110fd57506001600160a01b03821615155b8015611114575060028101546001600160a01b0316155b6111605760405162461bcd60e51b815260206004820152601460248201527f41495244524f505f42494e445f494e56414c49440000000000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff16156114195760008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121791906138a8565b6001600160a01b03161480156112bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b491906138a8565b6001600160a01b0316145b801561132f57508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d91906138c5565b145b80156113c757508160010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b0316639ba7da926040518163ffffffff1660e01b8152600401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906138de565b67ffffffffffffffff16145b6114135760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b506116a8565b60008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa91906138a8565b6001600160a01b031614801561155257507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154791906138a8565b6001600160a01b0316145b80156115c257508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906138c5565b145b801561165a57508160010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b031663f04d688f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561162a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164e91906138de565b67ffffffffffffffff16145b6116a65760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b505b6002810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038416179055600a80549060006116ed836138fb565b90915550506040516001600160a01b0383169084907f37e3857ea6641829c9fdf57fef793928a714f22a46d59336af6b66efeab5b68a90600090a3505050565b6117356131ec565b600154600160a01b900460ff1661178e5760405162461bcd60e51b815260206004820152600a60248201527f4e4f545f414354495645000000000000000000000000000000000000000000006044820152606401610617565b600061179a8233612a06565b9050600081116117ec5760405162461bcd60e51b815260206004820152601060248201527f4e4f5448494e475f544f5f434c41494d000000000000000000000000000000006044820152606401610617565b600082815260066020908152604080832033845290915281206001018054839290611818908490613833565b9250508190555080600360008282546118319190613833565b9091555061186b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383613245565b604051818152339083907f880f2ef2613b092f1a0a819f294155c98667eb294b7e6bf7a3810278142c1a1c906020015b60405180910390a3506118ae6001600055565b50565b6001546000906001600160a01b0316331461190e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156119685760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b861580159061198557506312cc03008667ffffffffffffffff1611155b801561199b575060008467ffffffffffffffff16115b80156119b1575060008367ffffffffffffffff16115b80156119d157508367ffffffffffffffff168367ffffffffffffffff1611155b80156119e357506127108261ffff1611155b611a2f5760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015611a5b575063259806008467ffffffffffffffff1611155b611aa75760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016001151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b6001546001600160a01b03163314611d495760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615611da35760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b6000600254118015611e5757506002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5491906138c5565b10155b611ea35760405162461bcd60e51b815260206004820152600b60248201527f46554e44494e475f4c4f570000000000000000000000000000000000000000006044820152606401610617565b600a5415611ef35760405162461bcd60e51b815260206004820152600f60248201527f41495244524f505f554e424f554e4400000000000000000000000000000000006044820152606401610617565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b1790556002546040517fd62494a718c7d7a587c487366f8aa76e8470d3be0b0508f412bab1683ef267d091610b8e9190815260200190565b611f5e6131ec565b600154600160a01b900460ff168015611f775750600081115b8015611f84575060648111155b611fd05760405162461bcd60e51b815260206004820152600d60248201527f42415443485f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b6009546000611fdf8383613833565b600854909150811115611ff157506008545b808210156122305760006008838154811061200e5761200e613930565b60009182526020808320909101548083526007909152604090912060028101549192509060ff600160a01b90910416158015612056575060028101546001600160a01b031615155b1561221c5760028101547501000000000000000000000000000000000000000000900460ff1680156120925750600b5467ffffffffffffffff16155b1561209e575050612230565b60028101547501000000000000000000000000000000000000000000900460ff161561214b576002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061218f908490613833565b9091555050600281015481546121d3916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200160405180910390a35b83612226816137fb565b9450505050611ff1565b506009556118ae6001600055565b6001546001600160a01b031633146122985760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0382166122ee5760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6000600454600354600254612303919061395f565b61230d919061395f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138c5565b90508181101580156123cf57506123cb828261395f565b8311155b61241b5760405162461bcd60e51b815260206004820152600f60248201527f52455345525645445f544f4b454e5300000000000000000000000000000000006044820152606401610617565b61244f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585613245565b50505050565b61245d6131ec565b6000818152600760205260409020600154600160a01b900460ff1680156124a257506002810154760100000000000000000000000000000000000000000000900460ff165b80156124ba57506002810154600160a01b900460ff16155b80156124d2575060028101546001600160a01b031615155b61251e5760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f52454c454153455f494e56414c49440000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff161561262757600b5467ffffffffffffffff166000036125a05760405162461bcd60e51b815260206004820152601560248201527f5343484544554c455f4e4f545f414e43484f52454400000000000000000000006044820152606401610617565b6002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561260e57600080fd5b505af1158015612622573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061266b908490613833565b9091555050600281015481546126af916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200161189b565b6001546001600160a01b0316331461274e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156127a85760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906127b75750600082115b80156127cc5750428167ffffffffffffffff16115b80156128045750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6128505760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e08101825283815267ffffffffffffffff80841660208084019182526000848601818152606086018281526080870183815260a08801848152600160c08a018181528e87526007909752998520985189559551888a0180549451891668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190981617929092179095559351600290950180549451935192511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff931515750100000000000000000000000000000000000000000002939093167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff941515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009096166001600160a01b03979097169690961794909417929092169390931792909217905560088054928301815581527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909101849055600a8054916108d9836137fb565b600080612a14848442612a60565b60008581526006602090815260408083206001600160a01b0388168452909152902060010154909150808211612a4b576000612a55565b612a55818361395f565b925050505b92915050565b6005546000908410612ab45760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f554e4b4e4f574e00000000000000000000000000000000000000006044820152606401610617565b600060058581548110612ac957612ac9613930565b600091825260208083206040805161012081018252600590940290910180548452600181015467ffffffffffffffff808216868601526801000000000000000082048116868501527001000000000000000000000000000000008204811660608701527801000000000000000000000000000000000000000000000000909104166080850152600281015461ffff1660a0850152600381015460c08501526004015460ff808216151560e0860190815261010092839004909116151591850191909152898552600683528185206001600160a01b038a16865290925283205490519193509190612bbd578260200151612bfa565b600b5467ffffffffffffffff1615612bf0576020830151600b54612beb919067ffffffffffffffff16613972565b612bfa565b67ffffffffffffffff5b9050811580612c1c57508067ffffffffffffffff168567ffffffffffffffff16105b15612c2d5760009350505050612d38565b60006127108460a0015161ffff1684612c46919061399a565b612c5091906139b1565b9050836040015182612c629190613972565b67ffffffffffffffff168667ffffffffffffffff161015612c88579350612d3892505050565b6000846040015183612c9a9190613972565b612ca490886139ec565b67ffffffffffffffff169050846060015167ffffffffffffffff168110612cd2578395505050505050612d38565b608085015167ffffffffffffffff16612ceb81836139b1565b612cf5919061399a565b606086015190915067ffffffffffffffff1681612d12848761395f565b612d1c919061399a565b612d2691906139b1565b612d309083613833565b955050505050505b9392505050565b60058181548110612d4f57600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492945067ffffffffffffffff808316946801000000000000000084048216947001000000000000000000000000000000008504831694780100000000000000000000000000000000000000000000000090049092169261ffff169160ff8082169161010090041689565b6001546001600160a01b03163314612e3a5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615612e945760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60055485108015612ea457508215155b8015612eaf57508281145b8015612ebc575060fa8311155b612f085760405162461bcd60e51b815260206004820152600e60248201527f4752414e54535f494e56414c49440000000000000000000000000000000000006044820152606401610617565b6000805b8481101561306d576000868683818110612f2857612f28613930565b9050602002016020810190612f3d91906137af565b90506000858584818110612f5357612f53613930565b60200291909101359150506001600160a01b03821615801590612f765750600081115b8015612fa2575060008981526006602090815260408083206001600160a01b0386168452909152902054155b612fee5760405162461bcd60e51b815260206004820152600d60248201527f4752414e545f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b60008981526006602090815260408083206001600160a01b0386168452909152902081905561301d8185613833565b9350816001600160a01b0316897f783c96dafbf5d54c99f7930938d5a93114d564f55dde9aa45ab24f12cde635868360405161305b91815260200190565b60405180910390a35050600101612f0c565b50806005878154811061308257613082613930565b906000526020600020906005020160030160008282546130a29190613833565b9250508190555080600260008282546130bb9190613833565b9091555050505050505050565b6001546001600160a01b031633146131225760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0381166131785760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60026000540361323e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610617565b6002600055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526132c59084906132ca565b505050565b600061331f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166133b29092919063ffffffff16565b90508051600014806133405750808060200190518101906133409190613886565b6132c55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610617565b60606133c184846000856133c9565b949350505050565b6060824710156134415760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610617565b600080866001600160a01b0316858760405161345d919061386a565b60006040518083038185875af1925050503d806000811461349a576040519150601f19603f3d011682016040523d82523d6000602084013e61349f565b606091505b50915091506134b0878383876134bb565b979650505050505050565b6060831561352a578251600003613523576001600160a01b0385163b6135235760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610617565b50816133c1565b6133c1838381511561353f5781518083602001fd5b8060405162461bcd60e51b81526004016106179190613a0d565b67ffffffffffffffff811681146118ae57600080fd5b60008060006060848603121561358457600080fd5b8335925060208401359150604084013561359d81613559565b809150509250925092565b6000602082840312156135ba57600080fd5b5035919050565b60008060008060008060c087890312156135da57600080fd5b8635955060208701356135ec81613559565b945060408701356135fc81613559565b9350606087013561360c81613559565b9250608087013561361c81613559565b915060a087013561ffff8116811461363357600080fd5b809150509295509295509295565b6001600160a01b03811681146118ae57600080fd5b6000806040838503121561366957600080fd5b82359150602083013561367b81613641565b809150509250929050565b6000806040838503121561369957600080fd5b82356136a481613641565b946020939093013593505050565b6000806000606084860312156136c757600080fd5b8335925060208401356136d981613641565b9150604084013561359d81613559565b60008083601f8401126136fb57600080fd5b50813567ffffffffffffffff81111561371357600080fd5b6020830191508360208260051b850101111561372e57600080fd5b9250929050565b60008060008060006060868803121561374d57600080fd5b85359450602086013567ffffffffffffffff8082111561376c57600080fd5b61377889838a016136e9565b9096509450604088013591508082111561379157600080fd5b5061379e888289016136e9565b969995985093965092949392505050565b6000602082840312156137c157600080fd5b8135612d3881613641565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361382c5761382c6137cc565b5060010190565b80820180821115612a5a57612a5a6137cc565b60005b83811015613861578181015183820152602001613849565b50506000910152565b6000825161387c818460208701613846565b9190910192915050565b60006020828403121561389857600080fd5b81518015158114612d3857600080fd5b6000602082840312156138ba57600080fd5b8151612d3881613641565b6000602082840312156138d757600080fd5b5051919050565b6000602082840312156138f057600080fd5b8151612d3881613559565b60008161390a5761390a6137cc565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115612a5a57612a5a6137cc565b67ffffffffffffffff818116838216019080821115613993576139936137cc565b5092915050565b8082028115828204841417612a5a57612a5a6137cc565b6000826139e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b67ffffffffffffffff828116828216039080821115613993576139936137cc565b6020815260008251806020840152613a2c816040850160208701613846565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212205d235a0bd782d1d7bf4bcd119a5cd3cf7d327d8405007bdae80cb7a57b3cad9164736f6c63430008180033a2646970667358221220f491d51c6718f04e251fca985a1e7272c1142037e96268aee26359178b854c4d64736f6c63430008180033",
"is_contract": true,
"verified": true,
"verification": {
"address": "0xfed19c0a975ffcf12f9d3c2412a487dd16710282",
"compiler": "0.8.24+commit.e11b9ed9.Emscripten.clang",
"contract": "contracts/CookDEXPresaleExtensions.sol:CookDEXVestingModuleV1",
"verified": true,
"match": "runtime-with-metadata",
"creation_verified": true,
"constructor_arguments": "",
"verified_at": "2026-10-01T10:26:34.666Z",
"chain_id": 20261001,
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "VestingVaultCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "createVesting",
"outputs": [
{
"internalType": "address",
"name": "vault",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"input": {
"language": "Solidity",
"sources": {
"@openzeppelin/contracts/security/ReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n}\n"
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
},
"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n"
},
"@openzeppelin/contracts/utils/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin's JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Calldata version of {verify}\n *\n * _Available since v4.7._\n */\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Calldata version of {processProof}\n *\n * _Available since v4.7._\n */\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Calldata version of {multiProofVerify}\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\n * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\n * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\n * respectively.\n *\n * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\n * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\n * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\n *\n * _Available since v4.7._\n */\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, \"MerkleProof: invalid multiproof\");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, \"MerkleProof: invalid multiproof\");\n\n // The xxxPos values are \"pointers\" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's \"pop\".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the \"main queue\". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the \"main queue\" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, \"MerkleProof: invalid multiproof\");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n"
},
"@openzeppelin/contracts/utils/math/Math.sol": {
"content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n"
},
"contracts/CookDEXPresaleExtensions.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ICookDEXReservedAirdrop {\n function token() external view returns(IERC20);\n function sourceCampaign() external view returns(address);\n function totalAllocation() external view returns(uint256);\n function claimStart() external view returns(uint64);\n}\ninterface ICookDEXRelativeAirdrop {\n function token() external view returns(IERC20);\n function sourceCampaign() external view returns(address);\n function totalAllocation() external view returns(uint256);\n function startOffset() external view returns(uint64);\n function activate(uint64 anchor) external;\n}\n\n/// @notice Public multi-plan vesting vault. Team and investor plans are kept\n/// separate and remain readable after the related presale has ended.\ncontract CookDEXVestingVaultV1 is ReentrancyGuard {\n using SafeERC20 for IERC20;\n struct Plan { bytes32 label; uint64 start; uint64 cliff; uint64 duration; uint64 interval; uint16 tgeBps; uint256 allocated; bool relative; bool exists; }\n struct Grant { uint256 allocation; uint256 claimed; }\n struct AirdropReserve { uint256 amount; uint64 claimStart; uint64 startOffset; address airdrop; bool released; bool relative; bool exists; }\n\n IERC20 public immutable token;\n address public immutable sourceCampaign;\n address public owner;\n bool public vestingSealed;\n uint256 public totalAllocated;\n uint256 public totalClaimed;\n uint256 public totalAirdropReleased;\n Plan[] public plans;\n mapping(uint256=>mapping(address=>Grant)) public grants;\n mapping(bytes32=>AirdropReserve) public airdropReserves;\n bytes32[] public airdropScheduleIds;\n uint256 public airdropExecutionCursor;\n uint256 public unboundAirdropCount;\n uint64 public scheduleAnchor;\n event PlanCreated(uint256 indexed planId,bytes32 indexed label,uint64 start,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps);\n event GrantAdded(uint256 indexed planId,address indexed beneficiary,uint256 amount);\n event VestingSealed(uint256 totalAllocated);\n event TokensClaimed(uint256 indexed planId,address indexed beneficiary,uint256 amount);\n event OwnershipTransferred(address indexed previousOwner,address indexed nextOwner);\n event AirdropReserved(bytes32 indexed scheduleId,uint256 amount,uint64 claimStart);\n event AirdropReserveReleased(bytes32 indexed scheduleId,address indexed airdrop,uint256 amount);\n event AirdropContractBound(bytes32 indexed scheduleId,address indexed airdrop);\n event ScheduleAnchored(uint64 timestamp);\n\n constructor(address token_,address campaign_,address owner_){require(token_!=address(0)&&owner_!=address(0),\"ADDRESS_ZERO\");token=IERC20(token_);sourceCampaign=campaign_;owner=owner_;}\n modifier onlyOwner(){require(msg.sender==owner,\"NOT_OWNER\");_;}\n modifier beforeSeal(){require(!vestingSealed,\"VESTING_SEALED\");_;}\n function planCount() external view returns(uint256){return plans.length;}\n function createPlan(bytes32 label,uint64 start,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps) external onlyOwner beforeSeal returns(uint256 planId){\n require(label!=bytes32(0)&&start>0&&duration>0&&interval>0&&interval<=duration&&tgeBps<=10_000,\"PLAN_INVALID\");\n require(cliff<=3650 days&&duration<=7300 days,\"DURATION_INVALID\");\n planId=plans.length;plans.push(Plan(label,start,cliff,duration,interval,tgeBps,0,false,true));emit PlanCreated(planId,label,start,cliff,duration,interval,tgeBps);\n }\n function createRelativePlan(bytes32 label,uint64 startOffset,uint64 cliff,uint64 duration,uint64 interval,uint16 tgeBps) external onlyOwner beforeSeal returns(uint256 planId){\n require(label!=bytes32(0)&&startOffset<=3650 days&&duration>0&&interval>0&&interval<=duration&&tgeBps<=10_000,\"PLAN_INVALID\");require(cliff<=3650 days&&duration<=7300 days,\"DURATION_INVALID\");\n planId=plans.length;plans.push(Plan(label,startOffset,cliff,duration,interval,tgeBps,0,true,true));emit PlanCreated(planId,label,startOffset,cliff,duration,interval,tgeBps);\n }\n function addGrants(uint256 planId,address[] calldata beneficiaries,uint256[] calldata amounts) external onlyOwner beforeSeal {\n require(planId<plans.length&&beneficiaries.length>0&&beneficiaries.length==amounts.length&&beneficiaries.length<=250,\"GRANTS_INVALID\");\n uint256 added;\n for(uint256 i;i<beneficiaries.length;i++){address account=beneficiaries[i];uint256 amount=amounts[i];require(account!=address(0)&&amount>0&&grants[planId][account].allocation==0,\"GRANT_INVALID\");grants[planId][account].allocation=amount;added+=amount;emit GrantAdded(planId,account,amount);}\n plans[planId].allocated+=added;totalAllocated+=added;\n }\n function reserveAirdrop(bytes32 scheduleId,uint256 amount,uint64 claimStart) external onlyOwner beforeSeal {\n require(scheduleId!=bytes32(0)&&amount>0&&claimStart>block.timestamp&&!airdropReserves[scheduleId].exists,\"AIRDROP_RESERVE_INVALID\");\n airdropReserves[scheduleId]=AirdropReserve(amount,claimStart,0,address(0),false,false,true);airdropScheduleIds.push(scheduleId);unboundAirdropCount++;totalAllocated+=amount;emit AirdropReserved(scheduleId,amount,claimStart);\n }\n function reserveRelativeAirdrop(bytes32 scheduleId,uint256 amount,uint64 startOffset) external onlyOwner beforeSeal {\n require(scheduleId!=bytes32(0)&&amount>0&&startOffset<=7300 days&&!airdropReserves[scheduleId].exists,\"AIRDROP_RESERVE_INVALID\");\n airdropReserves[scheduleId]=AirdropReserve(amount,0,startOffset,address(0),false,true,true);airdropScheduleIds.push(scheduleId);unboundAirdropCount++;totalAllocated+=amount;emit AirdropReserved(scheduleId,amount,startOffset);\n }\n function airdropScheduleCount() external view returns(uint256){return airdropScheduleIds.length;}\n function bindAirdropContract(bytes32 scheduleId,address airdrop) external onlyOwner beforeSeal {\n AirdropReserve storage reserve=airdropReserves[scheduleId];require(reserve.exists&&airdrop!=address(0)&&reserve.airdrop==address(0),\"AIRDROP_BIND_INVALID\");\n if(reserve.relative){ICookDEXRelativeAirdrop target=ICookDEXRelativeAirdrop(airdrop);require(address(target.token())==address(token)&&target.sourceCampaign()==sourceCampaign&&target.totalAllocation()==reserve.amount&&target.startOffset()==reserve.startOffset,\"AIRDROP_MISMATCH\");}\n else{ICookDEXReservedAirdrop target=ICookDEXReservedAirdrop(airdrop);require(address(target.token())==address(token)&&target.sourceCampaign()==sourceCampaign&&target.totalAllocation()==reserve.amount&&target.claimStart()==reserve.claimStart,\"AIRDROP_MISMATCH\");}\n reserve.airdrop=airdrop;unboundAirdropCount--;emit AirdropContractBound(scheduleId,airdrop);\n }\n function seal() external onlyOwner beforeSeal {require(totalAllocated>0&&token.balanceOf(address(this))>=totalAllocated,\"FUNDING_LOW\");require(unboundAirdropCount==0,\"AIRDROP_UNBOUND\");vestingSealed=true;emit VestingSealed(totalAllocated);}\n function vestedAmount(uint256 planId,address beneficiary,uint64 timestamp) public view returns(uint256){\n require(planId<plans.length,\"PLAN_UNKNOWN\");Plan memory plan=plans[planId];uint256 allocation=grants[planId][beneficiary].allocation;uint64 start=plan.relative?(scheduleAnchor==0?type(uint64).max:scheduleAnchor+plan.start):plan.start;if(allocation==0||timestamp<start)return 0;\n uint256 tge=allocation*plan.tgeBps/10_000;if(timestamp<start+plan.cliff)return tge;\n uint256 elapsed=timestamp-(start+plan.cliff);if(elapsed>=plan.duration)return allocation;\n elapsed=elapsed/plan.interval*plan.interval;return tge+(allocation-tge)*elapsed/plan.duration;\n }\n function claimable(uint256 planId,address beneficiary) public view returns(uint256){uint256 vested=vestedAmount(planId,beneficiary,uint64(block.timestamp));uint256 paid=grants[planId][beneficiary].claimed;return vested>paid?vested-paid:0;}\n function claim(uint256 planId) external nonReentrant {require(vestingSealed,\"NOT_ACTIVE\");uint256 amount=claimable(planId,msg.sender);require(amount>0,\"NOTHING_TO_CLAIM\");grants[planId][msg.sender].claimed+=amount;totalClaimed+=amount;token.safeTransfer(msg.sender,amount);emit TokensClaimed(planId,msg.sender,amount);}\n function anchorAfterPresale() public {\n require(vestingSealed&&scheduleAnchor==0,\"ANCHOR_UNAVAILABLE\");\n if(sourceCampaign!=address(0)){(bool ok,bytes memory value)=sourceCampaign.staticcall(abi.encodeWithSignature(\"finalized()\"));require(ok&&value.length>=32&&abi.decode(value,(bool)),\"PRESALE_NOT_FINALIZED\");}\n scheduleAnchor=uint64(block.timestamp);emit ScheduleAnchored(scheduleAnchor);\n }\n function executeAirdropReserve(bytes32 scheduleId) public nonReentrant {\n AirdropReserve storage reserve=airdropReserves[scheduleId];require(vestingSealed&&reserve.exists&&!reserve.released&&reserve.airdrop!=address(0),\"AIRDROP_RELEASE_INVALID\");\n if(reserve.relative){require(scheduleAnchor!=0,\"SCHEDULE_NOT_ANCHORED\");ICookDEXRelativeAirdrop(reserve.airdrop).activate(scheduleAnchor);}\n reserve.released=true;totalAirdropReleased+=reserve.amount;token.safeTransfer(reserve.airdrop,reserve.amount);emit AirdropReserveReleased(scheduleId,reserve.airdrop,reserve.amount);\n }\n function executeScheduledAirdrops(uint256 maxCount) external nonReentrant {\n require(vestingSealed&&maxCount>0&&maxCount<=100,\"BATCH_INVALID\");uint256 cursor=airdropExecutionCursor;uint256 end=cursor+maxCount;if(end>airdropScheduleIds.length)end=airdropScheduleIds.length;\n while(cursor<end){bytes32 scheduleId=airdropScheduleIds[cursor];AirdropReserve storage reserve=airdropReserves[scheduleId];if(!reserve.released&&reserve.airdrop!=address(0)){if(reserve.relative&&scheduleAnchor==0)break;if(reserve.relative)ICookDEXRelativeAirdrop(reserve.airdrop).activate(scheduleAnchor);reserve.released=true;totalAirdropReleased+=reserve.amount;token.safeTransfer(reserve.airdrop,reserve.amount);emit AirdropReserveReleased(scheduleId,reserve.airdrop,reserve.amount);}cursor++;}\n airdropExecutionCursor=cursor;\n }\n function recoverExcess(address to,uint256 amount) external onlyOwner {require(to!=address(0),\"ADDRESS_ZERO\");uint256 reserved=totalAllocated-totalClaimed-totalAirdropReleased;uint256 balance=token.balanceOf(address(this));require(balance>=reserved&&amount<=balance-reserved,\"RESERVED_TOKENS\");token.safeTransfer(to,amount);}\n function transferOwnership(address next) external onlyOwner {require(next!=address(0),\"ADDRESS_ZERO\");emit OwnershipTransferred(owner,next);owner=next;}\n}\n\ncontract CookDEXVestingModuleV1 {\n event VestingVaultCreated(address indexed vault,address indexed token,address indexed owner,address sourceCampaign);\n function createVesting(address token,address sourceCampaign) external returns(address vault){vault=address(new CookDEXVestingVaultV1(token,sourceCampaign,msg.sender));emit VestingVaultCreated(vault,token,msg.sender,sourceCampaign);}\n}\n\n/// @notice Claim-based airdrop. Eligibility modes (CSV, registration,\n/// historical holders, snapshot holders or deterministic random selection)\n/// are calculated off-chain and committed immutably through the Merkle root.\ncontract CookDEXAirdropV1 is ReentrancyGuard {\n using SafeERC20 for IERC20;\n IERC20 public immutable token;\n address public immutable owner;\n address public immutable sourceCampaign;\n bytes32 public immutable merkleRoot;\n bytes32 public immutable selectionCommitment;\n uint8 public immutable eligibilityMode;\n uint64 public immutable claimStart;\n uint64 public immutable claimEnd;\n uint256 public immutable totalAllocation;\n uint256 public totalClaimed;\n mapping(uint256=>uint256) private claimedBitMap;\n event Claimed(uint256 indexed index,address indexed account,uint256 amount);\n event UnclaimedRecovered(address indexed to,uint256 amount);\n constructor(address token_,address owner_,address campaign_,bytes32 root_,bytes32 selectionCommitment_,uint8 mode_,uint64 start_,uint64 end_,uint256 total_){\n require(token_!=address(0)&&owner_!=address(0)&&root_!=bytes32(0)&&start_<end_&&total_>0,\"CONFIG_INVALID\");\n token=IERC20(token_);owner=owner_;sourceCampaign=campaign_;merkleRoot=root_;selectionCommitment=selectionCommitment_;eligibilityMode=mode_;claimStart=start_;claimEnd=end_;totalAllocation=total_;\n }\n function isClaimed(uint256 index) public view returns(bool){uint256 word=claimedBitMap[index/256];uint256 mask=1<<(index%256);return word&mask==mask;}\n function claim(uint256 index,address account,uint256 amount,bytes32[] calldata proof) external nonReentrant {\n require(block.timestamp>=claimStart&&block.timestamp<=claimEnd&&!isClaimed(index)&&account!=address(0),\"CLAIM_UNAVAILABLE\");\n bytes32 leaf=keccak256(bytes.concat(keccak256(abi.encode(index,account,amount))));require(MerkleProof.verify(proof,merkleRoot,leaf),\"PROOF_INVALID\");\n claimedBitMap[index/256]|=1<<(index%256);totalClaimed+=amount;require(totalClaimed<=totalAllocation,\"ALLOCATION_EXCEEDED\");token.safeTransfer(account,amount);emit Claimed(index,account,amount);\n }\n function recoverUnclaimed(address to) external nonReentrant {require(msg.sender==owner&&block.timestamp>claimEnd&&to!=address(0),\"RECOVERY_UNAVAILABLE\");uint256 amount=token.balanceOf(address(this));token.safeTransfer(to,amount);emit UnclaimedRecovered(to,amount);}\n}\n\n/// @notice Vesting-bound airdrop whose claim window is anchored to the actual\n/// presale finalization time. Only its immutable vesting vault may activate it.\ncontract CookDEXScheduledAirdropV1 is ReentrancyGuard {\n using SafeERC20 for IERC20;\n IERC20 public immutable token;\n address public immutable owner;\n address public immutable sourceCampaign;\n address public immutable vestingVault;\n bytes32 public immutable merkleRoot;\n bytes32 public immutable selectionCommitment;\n uint8 public immutable eligibilityMode;\n uint64 public immutable startOffset;\n uint64 public immutable claimDuration;\n uint256 public immutable totalAllocation;\n uint64 public claimStart;\n uint64 public claimEnd;\n uint256 public totalClaimed;\n mapping(uint256=>uint256) private claimedBitMap;\n event Activated(uint64 indexed anchor,uint64 claimStart,uint64 claimEnd);\n event Claimed(uint256 indexed index,address indexed account,uint256 amount);\n event UnclaimedRecovered(address indexed to,uint256 amount);\n constructor(address token_,address owner_,address campaign_,address vault_,bytes32 root_,bytes32 commitment_,uint8 mode_,uint64 offset_,uint64 duration_,uint256 total_){\n require(token_!=address(0)&&owner_!=address(0)&&vault_!=address(0)&&root_!=bytes32(0)&&duration_>0&&total_>0,\"CONFIG_INVALID\");\n token=IERC20(token_);owner=owner_;sourceCampaign=campaign_;vestingVault=vault_;merkleRoot=root_;selectionCommitment=commitment_;eligibilityMode=mode_;startOffset=offset_;claimDuration=duration_;totalAllocation=total_;\n }\n function activate(uint64 anchor) external {require(msg.sender==vestingVault&&claimStart==0&&anchor>0,\"ACTIVATION_UNAVAILABLE\");claimStart=anchor+startOffset;claimEnd=claimStart+claimDuration;emit Activated(anchor,claimStart,claimEnd);}\n function isClaimed(uint256 index) public view returns(bool){uint256 word=claimedBitMap[index/256];uint256 mask=1<<(index%256);return word&mask==mask;}\n function claim(uint256 index,address account,uint256 amount,bytes32[] calldata proof) external nonReentrant {\n require(claimStart>0&&block.timestamp>=claimStart&&block.timestamp<=claimEnd&&!isClaimed(index)&&account!=address(0),\"CLAIM_UNAVAILABLE\");\n bytes32 leaf=keccak256(bytes.concat(keccak256(abi.encode(index,account,amount))));require(MerkleProof.verify(proof,merkleRoot,leaf),\"PROOF_INVALID\");\n claimedBitMap[index/256]|=1<<(index%256);totalClaimed+=amount;require(totalClaimed<=totalAllocation,\"ALLOCATION_EXCEEDED\");token.safeTransfer(account,amount);emit Claimed(index,account,amount);\n }\n function recoverUnclaimed(address to) external nonReentrant {require(msg.sender==owner&&claimEnd>0&&block.timestamp>claimEnd&&to!=address(0),\"RECOVERY_UNAVAILABLE\");uint256 amount=token.balanceOf(address(this));token.safeTransfer(to,amount);emit UnclaimedRecovered(to,amount);}\n}\n\ncontract CookDEXAirdropModuleV1 {\n event AirdropCreated(address indexed airdrop,address indexed token,address indexed owner,address sourceCampaign,uint8 mode);\n function createAirdrop(address token,address sourceCampaign,bytes32 root,bytes32 selectionCommitment,uint8 mode,uint64 start,uint64 end,uint256 totalAllocation) external returns(address airdrop){\n airdrop=address(new CookDEXAirdropV1(token,msg.sender,sourceCampaign,root,selectionCommitment,mode,start,end,totalAllocation));emit AirdropCreated(airdrop,token,msg.sender,sourceCampaign,mode);\n }\n function createScheduledAirdrop(address token,address sourceCampaign,address vestingVault,bytes32 root,bytes32 selectionCommitment,uint8 mode,uint64 startOffset,uint64 claimDuration,uint256 totalAllocation) external returns(address airdrop){\n airdrop=address(new CookDEXScheduledAirdropV1(token,msg.sender,sourceCampaign,vestingVault,root,selectionCommitment,mode,startOffset,claimDuration,totalAllocation));emit AirdropCreated(airdrop,token,msg.sender,sourceCampaign,mode);\n }\n}\n\n/// @notice Escrowed OTC allocation sold before a public presale. Buyers claim\n/// sale tokens at the configured release time; owner proceeds unlock after end.\nstruct CookDEXOTCConfig {address token;address paymentToken;uint8 saleDecimals;uint256 pricePerToken;uint256 minAllocation;uint256 maxAllocation;uint64 startTime;uint64 endTime;uint64 claimTime;bool publicDeal;}\ncontract CookDEXOTCDealV1 is ReentrancyGuard {\n using SafeERC20 for IERC20;\n IERC20 public immutable saleToken;\n IERC20 public immutable paymentToken;\n address public immutable owner;\n uint8 public immutable saleDecimals;\n uint256 public immutable pricePerToken;\n uint256 public immutable minAllocation;\n uint256 public immutable maxAllocation;\n uint64 public immutable startTime;\n uint64 public immutable endTime;\n uint64 public immutable claimTime;\n bool public immutable publicDeal;\n mapping(address=>bool) public allowed;\n mapping(address=>uint256) public allocation;\n uint256 public totalAllocated;\n uint256 public totalClaimed;\n event Purchased(address indexed buyer,uint256 tokenAmount,uint256 paymentAmount);\n event Claimed(address indexed buyer,uint256 tokenAmount);\n constructor(CookDEXOTCConfig memory config,address owner_,address[] memory allowlist){\n require(config.token!=address(0)&&owner_!=address(0)&&config.saleDecimals<=36&&config.pricePerToken>0&&config.startTime<config.endTime&&config.claimTime>=config.endTime&&config.maxAllocation>=config.minAllocation,\"CONFIG_INVALID\");\n saleToken=IERC20(config.token);paymentToken=IERC20(config.paymentToken);owner=owner_;saleDecimals=config.saleDecimals;pricePerToken=config.pricePerToken;minAllocation=config.minAllocation;maxAllocation=config.maxAllocation;startTime=config.startTime;endTime=config.endTime;claimTime=config.claimTime;publicDeal=config.publicDeal;\n for(uint256 i;i<allowlist.length;i++){require(allowlist[i]!=address(0),\"ALLOWLIST_INVALID\");allowed[allowlist[i]]=true;}\n }\n function quote(uint256 tokenAmount) public view returns(uint256){return Math.mulDiv(tokenAmount,pricePerToken,10**saleDecimals);}\n function buy(uint256 tokenAmount) external payable nonReentrant {\n require(block.timestamp>=startTime&&block.timestamp<=endTime&&(publicDeal||allowed[msg.sender]),\"SALE_UNAVAILABLE\");\n uint256 next=allocation[msg.sender]+tokenAmount;require(tokenAmount>0&&next>=minAllocation&&(maxAllocation==0||next<=maxAllocation),\"ALLOCATION_INVALID\");\n require(saleToken.balanceOf(address(this))>=totalAllocated+tokenAmount,\"INSUFFICIENT_TOKENS\");uint256 payment=quote(tokenAmount);\n if(address(paymentToken)==address(0))require(msg.value==payment,\"PAYMENT_INVALID\");else{require(msg.value==0,\"NATIVE_NOT_ACCEPTED\");paymentToken.safeTransferFrom(msg.sender,address(this),payment);}\n allocation[msg.sender]=next;totalAllocated+=tokenAmount;emit Purchased(msg.sender,tokenAmount,payment);\n }\n function claim() external nonReentrant {require(block.timestamp>=claimTime,\"CLAIM_LOCKED\");uint256 amount=allocation[msg.sender];require(amount>0,\"NOTHING_TO_CLAIM\");allocation[msg.sender]=0;totalClaimed+=amount;saleToken.safeTransfer(msg.sender,amount);emit Claimed(msg.sender,amount);}\n function withdrawProceeds(address payable to) external nonReentrant {require(msg.sender==owner&&block.timestamp>endTime&&to!=address(0),\"WITHDRAW_UNAVAILABLE\");if(address(paymentToken)==address(0)){uint256 amount=address(this).balance;(bool ok,)=to.call{value:amount}(\"\");require(ok,\"TRANSFER_FAILED\");}else paymentToken.safeTransfer(to,paymentToken.balanceOf(address(this)));}\n function recoverUnsold(address to) external nonReentrant {require(msg.sender==owner&&block.timestamp>endTime&&to!=address(0),\"RECOVERY_UNAVAILABLE\");uint256 reserved=totalAllocated-totalClaimed;uint256 balance=saleToken.balanceOf(address(this));if(balance>reserved)saleToken.safeTransfer(to,balance-reserved);}\n}\n\ncontract CookDEXOTCModuleV1 {\n event OTCDealCreated(address indexed deal,address indexed token,address indexed owner,address paymentToken,bool publicDeal);\n function createOTCDeal(CookDEXOTCConfig calldata config,address[] calldata allowlist) external returns(address deal){\n deal=address(new CookDEXOTCDealV1(config,msg.sender,allowlist));\n emit OTCDealCreated(deal,config.token,msg.sender,config.paymentToken,config.publicDeal);\n }\n}\n"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 10000
},
"evmVersion": "paris",
"outputSelection": {
"contracts/CookDEXPresaleExtensions.sol": {
"CookDEXVestingModuleV1": [
"abi",
"metadata",
"evm.bytecode",
"evm.deployedBytecode"
],
"": [
"ast"
]
}
}
}
},
"metadata": {
"compiler": {
"version": "0.8.24+commit.e11b9ed9"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "VestingVaultCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "sourceCampaign",
"type": "address"
}
],
"name": "createVesting",
"outputs": [
{
"internalType": "address",
"name": "vault",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/CookDEXPresaleExtensions.sol": "CookDEXVestingModuleV1"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 10000
},
"remappings": []
},
"sources": {
"@openzeppelin/contracts/security/ReentrancyGuard.sol": {
"keccak256": "0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1",
"license": "MIT",
"urls": [
"bzz-raw://41319e7f621f2dc3733511332c4fd032f8e32ad2aa7fd6f665c19741d9941a34",
"dweb:/ipfs/QmcYR3bd862GD1Bc7jwrU9bGxrhUu5na1oP964bDCu2id1"
]
},
"@openzeppelin/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305",
"license": "MIT",
"urls": [
"bzz-raw://bd39944e8fc06be6dbe2dd1d8449b5336e23c6a7ba3e8e9ae5ae0f37f35283f5",
"dweb:/ipfs/QmPV3FGYjVwvKSgAXKUN3r9T9GwniZz83CxBpM7vyj2G53"
]
},
"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
"keccak256": "0xb264c03a3442eb37a68ad620cefd1182766b58bee6cec40343480392d6b14d69",
"license": "MIT",
"urls": [
"bzz-raw://28879d01fd22c07b44f006612775f8577defbe459cb01685c5e25cd518c91a71",
"dweb:/ipfs/QmVgfkwv2Fxw6hhTcDUZhE7NkoSKjab3ipM7UaRbt6uXb5"
]
},
"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
"keccak256": "0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1",
"license": "MIT",
"urls": [
"bzz-raw://9d213d3befca47da33f6db0310826bcdb148299805c10d77175ecfe1d06a9a68",
"dweb:/ipfs/QmRgCn6SP1hbBkExUADFuDo8xkT4UU47yjNF5FhCeRbQmS"
]
},
"@openzeppelin/contracts/utils/Address.sol": {
"keccak256": "0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa",
"license": "MIT",
"urls": [
"bzz-raw://2455248c8ddd9cc6a7af76a13973cddf222072427e7b0e2a7d1aff345145e931",
"dweb:/ipfs/QmfYjnjRbWqYpuxurqveE6HtzsY1Xx323J428AKQgtBJZm"
]
},
"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol": {
"keccak256": "0xcf688741f79f4838d5301dcf72d0af9eff11bbab6ab0bb112ad144c7fb672dac",
"license": "MIT",
"urls": [
"bzz-raw://85d9c87a481fe99fd28a146c205da0867ef7e1b7edbe0036abc86d2e64eb1f04",
"dweb:/ipfs/QmR7m1zWQNfZHUKTtqnjoCjCBbNFcjCxV27rxf6iMfhVtG"
]
},
"@openzeppelin/contracts/utils/math/Math.sol": {
"keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3",
"license": "MIT",
"urls": [
"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c",
"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS"
]
},
"contracts/CookDEXPresaleExtensions.sol": {
"keccak256": "0x8a8778b85ea384c2c220d75211ae7423a2f1189c89d9bac7a5e5fa5e4a74cd10",
"license": "MIT",
"urls": [
"bzz-raw://0d899d8e7b80cb733b25e726ca605d6a433c6d94a273500b0840554841de09aa",
"dweb:/ipfs/QmWDaPeEBjGwinay9CGYCHMD6mn3MwTSsAXxuaTKhJp7CG"
]
}
},
"version": 1
}
},
"deployment": {
"txid": "0xddeb8ff1ddf7fff1625d6bdec3d227bd13f9ba3d22f48759b6eb5cf0728d99aa",
"hash": "0xddeb8ff1ddf7fff1625d6bdec3d227bd13f9ba3d22f48759b6eb5cf0728d99aa",
"sender": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"recipient": "0xfed19c0a975ffcf12f9d3c2412a487dd16710282",
"amount_dec": "0",
"value_raw": "0",
"fee_dec": "0.003458835",
"fee_raw": "3458835000000000",
"asset": "COOK",
"timestamp_ms": 1790849626000,
"block": 4349,
"status": "Success",
"kind": "Contract creation",
"source": "EVM",
"nonce": 25,
"transaction_type": 2,
"gas_limit": "3487453",
"gas_used": "3458835",
"gas_price_wei": "1000000000",
"gas_price_gwei": "1",
"data_hex": "0x608060405234801561001057600080fd5b50613e01806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ede69a6714610030575b600080fd5b61004361003e36600461015a565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b600082823360405161007d90610124565b73ffffffffffffffffffffffffffffffffffffffff938416815291831660208301529091166040820152606001604051809103906000f0801580156100c6573d6000803e3d6000fd5b5060405173ffffffffffffffffffffffffffffffffffffffff8481168252919250339185811691908416907ff59b9d818dda53f2493e76b44717a06d1f56f51da4c2e4aaca20015199e8a33e9060200160405180910390a492915050565b613c3e8061018e83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461015557600080fd5b919050565b6000806040838503121561016d57600080fd5b61017683610131565b915061018460208401610131565b9050925092905056fe60c06040523480156200001157600080fd5b5060405162003c3e38038062003c3e8339810160408190526200003491620000e6565b60016000556001600160a01b038316158015906200005a57506001600160a01b03811615155b6200009a5760405162461bcd60e51b815260206004820152600c60248201526b414444524553535f5a45524f60a01b604482015260640160405180910390fd5b6001600160a01b0392831660805290821660a052600180546001600160a01b0319169190921617905562000130565b80516001600160a01b0381168114620000e157600080fd5b919050565b600080600060608486031215620000fc57600080fd5b6200010784620000c9565b92506200011760208501620000c9565b91506200012760408501620000c9565b90509250925092565b60805160a051613a94620001aa6000396000818161059f015281816109af01528181610a430152818161122a01526114bd0152600081816105780152818161118d015281816114200152818161184401528181611de1015281816121a9015281816123490152818161242801526126850152613a946000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638c4169ee1161010f578063d54ad2a1116100a2578063ebf6570a11610071578063ebf6570a14610476578063f2fde38b14610560578063fc0c546a14610573578063ffce38391461059a57600080fd5b8063d54ad2a114610448578063d6c5a54114610451578063dc322d6a14610464578063ea1448181461046d57600080fd5b80639bc14552116100de5780639bc14552146103a9578063a0c7f71c146103b2578063ac953d45146103c5578063b1620616146103d857600080fd5b80638c4169ee1461032b5780638da5cb5b1461033e57806392af90de146103695780639754bf081461037c57600080fd5b806338825f8f11610187578063594f518d11610156578063594f518d146102a55780636180a26e146102b857806368c49f0c146102dc5780637526f517146102e457600080fd5b806338825f8f1461026e5780633fb27b851461028157806345f7f2491461028957806351b0688a1461029257600080fd5b80631d872883116101c35780631d8728831461022d5780632049754714610240578063379607f514610253578063382d39bb1461026657600080fd5b806304ffdd25146101ea578063051b9b2c146101ff57806316d0bb6e14610207575b600080fd5b6101fd6101f836600461356f565b6105c1565b005b6101fd61093e565b61021a6102153660046135a8565b610b98565b6040519081526020015b60405180910390f35b61021a61023b3660046135c1565b610bb9565b6101fd61024e366004613656565b611005565b6101fd6102613660046135a8565b61172d565b60055461021a565b61021a61027c3660046135c1565b6118b1565b6101fd611cef565b61021a60025481565b6101fd6102a03660046135a8565b611f56565b6101fd6102b3366004613686565b61223e565b6001546102cc90600160a01b900460ff1681565b6040519015158152602001610224565b60085461021a565b6103166102f2366004613656565b60066020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610224565b6101fd6103393660046135a8565b612455565b600154610351906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b6101fd61037736600461356f565b6126f4565b600b546103909067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610224565b61021a60095481565b61021a6103c0366004613656565b612a06565b61021a6103d33660046136b2565b612a60565b6103eb6103e63660046135a8565b612d3f565b60408051998a5267ffffffffffffffff98891660208b015296881696890196909652938616606088015294909116608086015261ffff1660a085015260c084019290925290151560e0830152151561010082015261012001610224565b61021a60035481565b6101fd61045f366004613735565b612de0565b61021a600a5481565b61021a60045481565b61050f6104843660046135a8565b600760205260009081526040902080546001820154600290920154909167ffffffffffffffff808216926801000000000000000090920416906001600160a01b0381169060ff600160a01b8204811691750100000000000000000000000000000000000000000081048216917601000000000000000000000000000000000000000000009091041687565b6040805197885267ffffffffffffffff968716602089015295909416948601949094526001600160a01b0390911660608501521515608084015290151560a0830152151560c082015260e001610224565b6101fd61056e3660046137af565b6130c8565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b031633146106205760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e4552000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff161561067a5760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906106895750600082115b80156106a3575063259806008167ffffffffffffffff1611155b80156106db5750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6107275760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e0810182528381526000602080830182815267ffffffffffffffff8681168587019081526060860185815260808701868152600160a0890181815260c08a018281528e8a52600790985299882098518955945188860180549451861668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190951617929092179092559051600290950180549151965193511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff941515750100000000000000000000000000000000000000000002949094167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff971515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009093166001600160a01b0397909716969096179190911795909516939093171790925560088054918201815582527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee301849055600a8054916108d9836137fb565b919050555081600260008282546108f09190613833565b90915550506040805183815267ffffffffffffffff8316602082015284917f4938b8cbe1cbc0af26d57be9fe629f82e711bc23b41647216aa9f20fff3eb806910160405180910390a2505050565b600154600160a01b900460ff1680156109615750600b5467ffffffffffffffff16155b6109ad5760405162461bcd60e51b815260206004820152601260248201527f414e43484f525f554e415641494c41424c4500000000000000000000000000006044820152606401610617565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615610b2b5760408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb3f05b9700000000000000000000000000000000000000000000000000000000179052905160009182916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691610a6d9161386a565b600060405180830381855afa9150503d8060008114610aa8576040519150601f19603f3d011682016040523d82523d6000602084013e610aad565b606091505b5091509150818015610ac157506020815110155b8015610adc575080806020019051810190610adc9190613886565b610b285760405162461bcd60e51b815260206004820152601560248201527f50524553414c455f4e4f545f46494e414c495a454400000000000000000000006044820152606401610617565b50505b600b80547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000164267ffffffffffffffff169081179091556040519081527f98c2ef43a97b5b87a409cdec2c1b05904c2623a30b0162b7b7bd1453097d52b8906020015b60405180910390a1565b60088181548110610ba857600080fd5b600091825260209091200154905081565b6001546000906001600160a01b03163314610c165760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615610c705760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b8615801590610c89575060008667ffffffffffffffff16115b8015610c9f575060008467ffffffffffffffff16115b8015610cb5575060008367ffffffffffffffff16115b8015610cd557508367ffffffffffffffff168367ffffffffffffffff1611155b8015610ce757506127108261ffff1611155b610d335760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015610d5f575063259806008467ffffffffffffffff1611155b610dab5760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016000151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b60405180910390a39695505050505050565b6001546001600160a01b0316331461105f5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156110b95760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60008281526007602052604090206002810154760100000000000000000000000000000000000000000000900460ff1680156110fd57506001600160a01b03821615155b8015611114575060028101546001600160a01b0316155b6111605760405162461bcd60e51b815260206004820152601460248201527f41495244524f505f42494e445f494e56414c49440000000000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff16156114195760008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121791906138a8565b6001600160a01b03161480156112bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b491906138a8565b6001600160a01b0316145b801561132f57508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d91906138c5565b145b80156113c757508160010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b0316639ba7da926040518163ffffffff1660e01b8152600401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906138de565b67ffffffffffffffff16145b6114135760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b506116a8565b60008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa91906138a8565b6001600160a01b031614801561155257507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154791906138a8565b6001600160a01b0316145b80156115c257508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906138c5565b145b801561165a57508160010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b031663f04d688f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561162a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164e91906138de565b67ffffffffffffffff16145b6116a65760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b505b6002810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038416179055600a80549060006116ed836138fb565b90915550506040516001600160a01b0383169084907f37e3857ea6641829c9fdf57fef793928a714f22a46d59336af6b66efeab5b68a90600090a3505050565b6117356131ec565b600154600160a01b900460ff1661178e5760405162461bcd60e51b815260206004820152600a60248201527f4e4f545f414354495645000000000000000000000000000000000000000000006044820152606401610617565b600061179a8233612a06565b9050600081116117ec5760405162461bcd60e51b815260206004820152601060248201527f4e4f5448494e475f544f5f434c41494d000000000000000000000000000000006044820152606401610617565b600082815260066020908152604080832033845290915281206001018054839290611818908490613833565b9250508190555080600360008282546118319190613833565b9091555061186b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383613245565b604051818152339083907f880f2ef2613b092f1a0a819f294155c98667eb294b7e6bf7a3810278142c1a1c906020015b60405180910390a3506118ae6001600055565b50565b6001546000906001600160a01b0316331461190e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156119685760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b861580159061198557506312cc03008667ffffffffffffffff1611155b801561199b575060008467ffffffffffffffff16115b80156119b1575060008367ffffffffffffffff16115b80156119d157508367ffffffffffffffff168367ffffffffffffffff1611155b80156119e357506127108261ffff1611155b611a2f5760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015611a5b575063259806008467ffffffffffffffff1611155b611aa75760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016001151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b6001546001600160a01b03163314611d495760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615611da35760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b6000600254118015611e5757506002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5491906138c5565b10155b611ea35760405162461bcd60e51b815260206004820152600b60248201527f46554e44494e475f4c4f570000000000000000000000000000000000000000006044820152606401610617565b600a5415611ef35760405162461bcd60e51b815260206004820152600f60248201527f41495244524f505f554e424f554e4400000000000000000000000000000000006044820152606401610617565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b1790556002546040517fd62494a718c7d7a587c487366f8aa76e8470d3be0b0508f412bab1683ef267d091610b8e9190815260200190565b611f5e6131ec565b600154600160a01b900460ff168015611f775750600081115b8015611f84575060648111155b611fd05760405162461bcd60e51b815260206004820152600d60248201527f42415443485f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b6009546000611fdf8383613833565b600854909150811115611ff157506008545b808210156122305760006008838154811061200e5761200e613930565b60009182526020808320909101548083526007909152604090912060028101549192509060ff600160a01b90910416158015612056575060028101546001600160a01b031615155b1561221c5760028101547501000000000000000000000000000000000000000000900460ff1680156120925750600b5467ffffffffffffffff16155b1561209e575050612230565b60028101547501000000000000000000000000000000000000000000900460ff161561214b576002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061218f908490613833565b9091555050600281015481546121d3916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200160405180910390a35b83612226816137fb565b9450505050611ff1565b506009556118ae6001600055565b6001546001600160a01b031633146122985760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0382166122ee5760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6000600454600354600254612303919061395f565b61230d919061395f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138c5565b90508181101580156123cf57506123cb828261395f565b8311155b61241b5760405162461bcd60e51b815260206004820152600f60248201527f52455345525645445f544f4b454e5300000000000000000000000000000000006044820152606401610617565b61244f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585613245565b50505050565b61245d6131ec565b6000818152600760205260409020600154600160a01b900460ff1680156124a257506002810154760100000000000000000000000000000000000000000000900460ff165b80156124ba57506002810154600160a01b900460ff16155b80156124d2575060028101546001600160a01b031615155b61251e5760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f52454c454153455f494e56414c49440000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff161561262757600b5467ffffffffffffffff166000036125a05760405162461bcd60e51b815260206004820152601560248201527f5343484544554c455f4e4f545f414e43484f52454400000000000000000000006044820152606401610617565b6002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561260e57600080fd5b505af1158015612622573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061266b908490613833565b9091555050600281015481546126af916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200161189b565b6001546001600160a01b0316331461274e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156127a85760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906127b75750600082115b80156127cc5750428167ffffffffffffffff16115b80156128045750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6128505760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e08101825283815267ffffffffffffffff80841660208084019182526000848601818152606086018281526080870183815260a08801848152600160c08a018181528e87526007909752998520985189559551888a0180549451891668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190981617929092179095559351600290950180549451935192511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff931515750100000000000000000000000000000000000000000002939093167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff941515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009096166001600160a01b03979097169690961794909417929092169390931792909217905560088054928301815581527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909101849055600a8054916108d9836137fb565b600080612a14848442612a60565b60008581526006602090815260408083206001600160a01b0388168452909152902060010154909150808211612a4b576000612a55565b612a55818361395f565b925050505b92915050565b6005546000908410612ab45760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f554e4b4e4f574e00000000000000000000000000000000000000006044820152606401610617565b600060058581548110612ac957612ac9613930565b600091825260208083206040805161012081018252600590940290910180548452600181015467ffffffffffffffff808216868601526801000000000000000082048116868501527001000000000000000000000000000000008204811660608701527801000000000000000000000000000000000000000000000000909104166080850152600281015461ffff1660a0850152600381015460c08501526004015460ff808216151560e0860190815261010092839004909116151591850191909152898552600683528185206001600160a01b038a16865290925283205490519193509190612bbd578260200151612bfa565b600b5467ffffffffffffffff1615612bf0576020830151600b54612beb919067ffffffffffffffff16613972565b612bfa565b67ffffffffffffffff5b9050811580612c1c57508067ffffffffffffffff168567ffffffffffffffff16105b15612c2d5760009350505050612d38565b60006127108460a0015161ffff1684612c46919061399a565b612c5091906139b1565b9050836040015182612c629190613972565b67ffffffffffffffff168667ffffffffffffffff161015612c88579350612d3892505050565b6000846040015183612c9a9190613972565b612ca490886139ec565b67ffffffffffffffff169050846060015167ffffffffffffffff168110612cd2578395505050505050612d38565b608085015167ffffffffffffffff16612ceb81836139b1565b612cf5919061399a565b606086015190915067ffffffffffffffff1681612d12848761395f565b612d1c919061399a565b612d2691906139b1565b612d309083613833565b955050505050505b9392505050565b60058181548110612d4f57600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492945067ffffffffffffffff808316946801000000000000000084048216947001000000000000000000000000000000008504831694780100000000000000000000000000000000000000000000000090049092169261ffff169160ff8082169161010090041689565b6001546001600160a01b03163314612e3a5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615612e945760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60055485108015612ea457508215155b8015612eaf57508281145b8015612ebc575060fa8311155b612f085760405162461bcd60e51b815260206004820152600e60248201527f4752414e54535f494e56414c49440000000000000000000000000000000000006044820152606401610617565b6000805b8481101561306d576000868683818110612f2857612f28613930565b9050602002016020810190612f3d91906137af565b90506000858584818110612f5357612f53613930565b60200291909101359150506001600160a01b03821615801590612f765750600081115b8015612fa2575060008981526006602090815260408083206001600160a01b0386168452909152902054155b612fee5760405162461bcd60e51b815260206004820152600d60248201527f4752414e545f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b60008981526006602090815260408083206001600160a01b0386168452909152902081905561301d8185613833565b9350816001600160a01b0316897f783c96dafbf5d54c99f7930938d5a93114d564f55dde9aa45ab24f12cde635868360405161305b91815260200190565b60405180910390a35050600101612f0c565b50806005878154811061308257613082613930565b906000526020600020906005020160030160008282546130a29190613833565b9250508190555080600260008282546130bb9190613833565b9091555050505050505050565b6001546001600160a01b031633146131225760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0381166131785760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60026000540361323e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610617565b6002600055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526132c59084906132ca565b505050565b600061331f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166133b29092919063ffffffff16565b90508051600014806133405750808060200190518101906133409190613886565b6132c55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610617565b60606133c184846000856133c9565b949350505050565b6060824710156134415760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610617565b600080866001600160a01b0316858760405161345d919061386a565b60006040518083038185875af1925050503d806000811461349a576040519150601f19603f3d011682016040523d82523d6000602084013e61349f565b606091505b50915091506134b0878383876134bb565b979650505050505050565b6060831561352a578251600003613523576001600160a01b0385163b6135235760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610617565b50816133c1565b6133c1838381511561353f5781518083602001fd5b8060405162461bcd60e51b81526004016106179190613a0d565b67ffffffffffffffff811681146118ae57600080fd5b60008060006060848603121561358457600080fd5b8335925060208401359150604084013561359d81613559565b809150509250925092565b6000602082840312156135ba57600080fd5b5035919050565b60008060008060008060c087890312156135da57600080fd5b8635955060208701356135ec81613559565b945060408701356135fc81613559565b9350606087013561360c81613559565b9250608087013561361c81613559565b915060a087013561ffff8116811461363357600080fd5b809150509295509295509295565b6001600160a01b03811681146118ae57600080fd5b6000806040838503121561366957600080fd5b82359150602083013561367b81613641565b809150509250929050565b6000806040838503121561369957600080fd5b82356136a481613641565b946020939093013593505050565b6000806000606084860312156136c757600080fd5b8335925060208401356136d981613641565b9150604084013561359d81613559565b60008083601f8401126136fb57600080fd5b50813567ffffffffffffffff81111561371357600080fd5b6020830191508360208260051b850101111561372e57600080fd5b9250929050565b60008060008060006060868803121561374d57600080fd5b85359450602086013567ffffffffffffffff8082111561376c57600080fd5b61377889838a016136e9565b9096509450604088013591508082111561379157600080fd5b5061379e888289016136e9565b969995985093965092949392505050565b6000602082840312156137c157600080fd5b8135612d3881613641565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361382c5761382c6137cc565b5060010190565b80820180821115612a5a57612a5a6137cc565b60005b83811015613861578181015183820152602001613849565b50506000910152565b6000825161387c818460208701613846565b9190910192915050565b60006020828403121561389857600080fd5b81518015158114612d3857600080fd5b6000602082840312156138ba57600080fd5b8151612d3881613641565b6000602082840312156138d757600080fd5b5051919050565b6000602082840312156138f057600080fd5b8151612d3881613559565b60008161390a5761390a6137cc565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115612a5a57612a5a6137cc565b67ffffffffffffffff818116838216019080821115613993576139936137cc565b5092915050565b8082028115828204841417612a5a57612a5a6137cc565b6000826139e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b67ffffffffffffffff828116828216039080821115613993576139936137cc565b6020815260008251806020840152613a2c816040850160208701613846565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212205d235a0bd782d1d7bf4bcd119a5cd3cf7d327d8405007bdae80cb7a57b3cad9164736f6c63430008180033a2646970667358221220f491d51c6718f04e251fca985a1e7272c1142037e96268aee26359178b854c4d64736f6c63430008180033",
"receipt": {
"blockHash": "0xe20c48fd7af4be1635c162087620da4889d48275c8f03b491e84e30a03cc7d93",
"blockNumber": "0x10fd",
"contractAddress": "0xfed19c0a975ffcf12f9d3c2412a487dd16710282",
"cumulativeGasUsed": "0x34c713",
"from": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"gasUsed": "0x34c713",
"effectiveGasPrice": "0x3b9aca00",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": null,
"transactionHash": "0xddeb8ff1ddf7fff1625d6bdec3d227bd13f9ba3d22f48759b6eb5cf0728d99aa",
"transactionIndex": "0x0",
"type": "0x2"
},
"logs": [],
"raw_transaction": {
"accessList": [],
"blockHash": "0xe20c48fd7af4be1635c162087620da4889d48275c8f03b491e84e30a03cc7d93",
"blockNumber": "0x10fd",
"blockTimestamp": "0x6abe325a",
"chainId": "0x1352889",
"from": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"gas": "0x3536dd",
"gasPrice": "0x3b9aca00",
"maxPriorityFeePerGas": "0x3b9aca00",
"maxFeePerGas": "0x3b9aca00",
"hash": "0xddeb8ff1ddf7fff1625d6bdec3d227bd13f9ba3d22f48759b6eb5cf0728d99aa",
"input": "0x608060405234801561001057600080fd5b50613e01806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ede69a6714610030575b600080fd5b61004361003e36600461015a565b61006c565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b600082823360405161007d90610124565b73ffffffffffffffffffffffffffffffffffffffff938416815291831660208301529091166040820152606001604051809103906000f0801580156100c6573d6000803e3d6000fd5b5060405173ffffffffffffffffffffffffffffffffffffffff8481168252919250339185811691908416907ff59b9d818dda53f2493e76b44717a06d1f56f51da4c2e4aaca20015199e8a33e9060200160405180910390a492915050565b613c3e8061018e83390190565b803573ffffffffffffffffffffffffffffffffffffffff8116811461015557600080fd5b919050565b6000806040838503121561016d57600080fd5b61017683610131565b915061018460208401610131565b9050925092905056fe60c06040523480156200001157600080fd5b5060405162003c3e38038062003c3e8339810160408190526200003491620000e6565b60016000556001600160a01b038316158015906200005a57506001600160a01b03811615155b6200009a5760405162461bcd60e51b815260206004820152600c60248201526b414444524553535f5a45524f60a01b604482015260640160405180910390fd5b6001600160a01b0392831660805290821660a052600180546001600160a01b0319169190921617905562000130565b80516001600160a01b0381168114620000e157600080fd5b919050565b600080600060608486031215620000fc57600080fd5b6200010784620000c9565b92506200011760208501620000c9565b91506200012760408501620000c9565b90509250925092565b60805160a051613a94620001aa6000396000818161059f015281816109af01528181610a430152818161122a01526114bd0152600081816105780152818161118d015281816114200152818161184401528181611de1015281816121a9015281816123490152818161242801526126850152613a946000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638c4169ee1161010f578063d54ad2a1116100a2578063ebf6570a11610071578063ebf6570a14610476578063f2fde38b14610560578063fc0c546a14610573578063ffce38391461059a57600080fd5b8063d54ad2a114610448578063d6c5a54114610451578063dc322d6a14610464578063ea1448181461046d57600080fd5b80639bc14552116100de5780639bc14552146103a9578063a0c7f71c146103b2578063ac953d45146103c5578063b1620616146103d857600080fd5b80638c4169ee1461032b5780638da5cb5b1461033e57806392af90de146103695780639754bf081461037c57600080fd5b806338825f8f11610187578063594f518d11610156578063594f518d146102a55780636180a26e146102b857806368c49f0c146102dc5780637526f517146102e457600080fd5b806338825f8f1461026e5780633fb27b851461028157806345f7f2491461028957806351b0688a1461029257600080fd5b80631d872883116101c35780631d8728831461022d5780632049754714610240578063379607f514610253578063382d39bb1461026657600080fd5b806304ffdd25146101ea578063051b9b2c146101ff57806316d0bb6e14610207575b600080fd5b6101fd6101f836600461356f565b6105c1565b005b6101fd61093e565b61021a6102153660046135a8565b610b98565b6040519081526020015b60405180910390f35b61021a61023b3660046135c1565b610bb9565b6101fd61024e366004613656565b611005565b6101fd6102613660046135a8565b61172d565b60055461021a565b61021a61027c3660046135c1565b6118b1565b6101fd611cef565b61021a60025481565b6101fd6102a03660046135a8565b611f56565b6101fd6102b3366004613686565b61223e565b6001546102cc90600160a01b900460ff1681565b6040519015158152602001610224565b60085461021a565b6103166102f2366004613656565b60066020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610224565b6101fd6103393660046135a8565b612455565b600154610351906001600160a01b031681565b6040516001600160a01b039091168152602001610224565b6101fd61037736600461356f565b6126f4565b600b546103909067ffffffffffffffff1681565b60405167ffffffffffffffff9091168152602001610224565b61021a60095481565b61021a6103c0366004613656565b612a06565b61021a6103d33660046136b2565b612a60565b6103eb6103e63660046135a8565b612d3f565b60408051998a5267ffffffffffffffff98891660208b015296881696890196909652938616606088015294909116608086015261ffff1660a085015260c084019290925290151560e0830152151561010082015261012001610224565b61021a60035481565b6101fd61045f366004613735565b612de0565b61021a600a5481565b61021a60045481565b61050f6104843660046135a8565b600760205260009081526040902080546001820154600290920154909167ffffffffffffffff808216926801000000000000000090920416906001600160a01b0381169060ff600160a01b8204811691750100000000000000000000000000000000000000000081048216917601000000000000000000000000000000000000000000009091041687565b6040805197885267ffffffffffffffff968716602089015295909416948601949094526001600160a01b0390911660608501521515608084015290151560a0830152151560c082015260e001610224565b6101fd61056e3660046137af565b6130c8565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b6001546001600160a01b031633146106205760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e4552000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b600154600160a01b900460ff161561067a5760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906106895750600082115b80156106a3575063259806008167ffffffffffffffff1611155b80156106db5750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6107275760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e0810182528381526000602080830182815267ffffffffffffffff8681168587019081526060860185815260808701868152600160a0890181815260c08a018281528e8a52600790985299882098518955945188860180549451861668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190951617929092179092559051600290950180549151965193511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff941515750100000000000000000000000000000000000000000002949094167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff971515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009093166001600160a01b0397909716969096179190911795909516939093171790925560088054918201815582527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee301849055600a8054916108d9836137fb565b919050555081600260008282546108f09190613833565b90915550506040805183815267ffffffffffffffff8316602082015284917f4938b8cbe1cbc0af26d57be9fe629f82e711bc23b41647216aa9f20fff3eb806910160405180910390a2505050565b600154600160a01b900460ff1680156109615750600b5467ffffffffffffffff16155b6109ad5760405162461bcd60e51b815260206004820152601260248201527f414e43484f525f554e415641494c41424c4500000000000000000000000000006044820152606401610617565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615610b2b5760408051600481526024810182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fb3f05b9700000000000000000000000000000000000000000000000000000000179052905160009182916001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691610a6d9161386a565b600060405180830381855afa9150503d8060008114610aa8576040519150601f19603f3d011682016040523d82523d6000602084013e610aad565b606091505b5091509150818015610ac157506020815110155b8015610adc575080806020019051810190610adc9190613886565b610b285760405162461bcd60e51b815260206004820152601560248201527f50524553414c455f4e4f545f46494e414c495a454400000000000000000000006044820152606401610617565b50505b600b80547fffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000164267ffffffffffffffff169081179091556040519081527f98c2ef43a97b5b87a409cdec2c1b05904c2623a30b0162b7b7bd1453097d52b8906020015b60405180910390a1565b60088181548110610ba857600080fd5b600091825260209091200154905081565b6001546000906001600160a01b03163314610c165760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615610c705760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b8615801590610c89575060008667ffffffffffffffff16115b8015610c9f575060008467ffffffffffffffff16115b8015610cb5575060008367ffffffffffffffff16115b8015610cd557508367ffffffffffffffff168367ffffffffffffffff1611155b8015610ce757506127108261ffff1611155b610d335760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015610d5f575063259806008467ffffffffffffffff1611155b610dab5760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016000151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b60405180910390a39695505050505050565b6001546001600160a01b0316331461105f5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156110b95760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60008281526007602052604090206002810154760100000000000000000000000000000000000000000000900460ff1680156110fd57506001600160a01b03821615155b8015611114575060028101546001600160a01b0316155b6111605760405162461bcd60e51b815260206004820152601460248201527f41495244524f505f42494e445f494e56414c49440000000000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff16156114195760008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121791906138a8565b6001600160a01b03161480156112bf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b491906138a8565b6001600160a01b0316145b801561132f57508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132d91906138c5565b145b80156113c757508160010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b0316639ba7da926040518163ffffffff1660e01b8152600401602060405180830381865afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb91906138de565b67ffffffffffffffff16145b6114135760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b506116a8565b60008290507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa91906138a8565b6001600160a01b031614801561155257507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031663ffce38396040518163ffffffff1660e01b8152600401602060405180830381865afa158015611523573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154791906138a8565b6001600160a01b0316145b80156115c257508160000154816001600160a01b03166379203dc46040518163ffffffff1660e01b8152600401602060405180830381865afa15801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c091906138c5565b145b801561165a57508160010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16816001600160a01b031663f04d688f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561162a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164e91906138de565b67ffffffffffffffff16145b6116a65760405162461bcd60e51b815260206004820152601060248201527f41495244524f505f4d49534d41544348000000000000000000000000000000006044820152606401610617565b505b6002810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038416179055600a80549060006116ed836138fb565b90915550506040516001600160a01b0383169084907f37e3857ea6641829c9fdf57fef793928a714f22a46d59336af6b66efeab5b68a90600090a3505050565b6117356131ec565b600154600160a01b900460ff1661178e5760405162461bcd60e51b815260206004820152600a60248201527f4e4f545f414354495645000000000000000000000000000000000000000000006044820152606401610617565b600061179a8233612a06565b9050600081116117ec5760405162461bcd60e51b815260206004820152601060248201527f4e4f5448494e475f544f5f434c41494d000000000000000000000000000000006044820152606401610617565b600082815260066020908152604080832033845290915281206001018054839290611818908490613833565b9250508190555080600360008282546118319190613833565b9091555061186b90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383613245565b604051818152339083907f880f2ef2613b092f1a0a819f294155c98667eb294b7e6bf7a3810278142c1a1c906020015b60405180910390a3506118ae6001600055565b50565b6001546000906001600160a01b0316331461190e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156119685760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b861580159061198557506312cc03008667ffffffffffffffff1611155b801561199b575060008467ffffffffffffffff16115b80156119b1575060008367ffffffffffffffff16115b80156119d157508367ffffffffffffffff168367ffffffffffffffff1611155b80156119e357506127108261ffff1611155b611a2f5760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f494e56414c494400000000000000000000000000000000000000006044820152606401610617565b6312cc03008567ffffffffffffffff1611158015611a5b575063259806008467ffffffffffffffff1611155b611aa75760405162461bcd60e51b815260206004820152601060248201527f4455524154494f4e5f494e56414c4944000000000000000000000000000000006044820152606401610617565b600580549050905060056040518061012001604052808981526020018867ffffffffffffffff1681526020018767ffffffffffffffff1681526020018667ffffffffffffffff1681526020018567ffffffffffffffff1681526020018461ffff168152602001600081526020016001151581526020016001151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160020160006101000a81548161ffff021916908361ffff16021790555060c0820151816003015560e08201518160040160006101000a81548160ff0219169083151502179055506101008201518160040160016101000a81548160ff021916908315150217905550505086817f81f95deacd9289aaae8838dfd0b5484e70bedcbca90a437be11efd389a92fe468888888888604051610ff395949392919067ffffffffffffffff958616815293851660208501529184166040840152909216606082015261ffff91909116608082015260a00190565b6001546001600160a01b03163314611d495760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615611da35760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b6000600254118015611e5757506002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5491906138c5565b10155b611ea35760405162461bcd60e51b815260206004820152600b60248201527f46554e44494e475f4c4f570000000000000000000000000000000000000000006044820152606401610617565b600a5415611ef35760405162461bcd60e51b815260206004820152600f60248201527f41495244524f505f554e424f554e4400000000000000000000000000000000006044820152606401610617565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b1790556002546040517fd62494a718c7d7a587c487366f8aa76e8470d3be0b0508f412bab1683ef267d091610b8e9190815260200190565b611f5e6131ec565b600154600160a01b900460ff168015611f775750600081115b8015611f84575060648111155b611fd05760405162461bcd60e51b815260206004820152600d60248201527f42415443485f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b6009546000611fdf8383613833565b600854909150811115611ff157506008545b808210156122305760006008838154811061200e5761200e613930565b60009182526020808320909101548083526007909152604090912060028101549192509060ff600160a01b90910416158015612056575060028101546001600160a01b031615155b1561221c5760028101547501000000000000000000000000000000000000000000900460ff1680156120925750600b5467ffffffffffffffff16155b1561209e575050612230565b60028101547501000000000000000000000000000000000000000000900460ff161561214b576002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561213257600080fd5b505af1158015612146573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061218f908490613833565b9091555050600281015481546121d3916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200160405180910390a35b83612226816137fb565b9450505050611ff1565b506009556118ae6001600055565b6001546001600160a01b031633146122985760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0382166122ee5760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6000600454600354600254612303919061395f565b61230d919061395f565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015612390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b491906138c5565b90508181101580156123cf57506123cb828261395f565b8311155b61241b5760405162461bcd60e51b815260206004820152600f60248201527f52455345525645445f544f4b454e5300000000000000000000000000000000006044820152606401610617565b61244f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585613245565b50505050565b61245d6131ec565b6000818152600760205260409020600154600160a01b900460ff1680156124a257506002810154760100000000000000000000000000000000000000000000900460ff165b80156124ba57506002810154600160a01b900460ff16155b80156124d2575060028101546001600160a01b031615155b61251e5760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f52454c454153455f494e56414c49440000000000000000006044820152606401610617565b60028101547501000000000000000000000000000000000000000000900460ff161561262757600b5467ffffffffffffffff166000036125a05760405162461bcd60e51b815260206004820152601560248201527f5343484544554c455f4e4f545f414e43484f52454400000000000000000000006044820152606401610617565b6002810154600b546040517ffc7e474600000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526001600160a01b039091169063fc7e474690602401600060405180830381600087803b15801561260e57600080fd5b505af1158015612622573d6000803e3d6000fd5b505050505b6002810180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16600160a01b17905580546004805460009061266b908490613833565b9091555050600281015481546126af916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811692911690613245565b600281015481546040519081526001600160a01b039091169083907f1b2cf8718c4a02a20f392fe00e37a33efdecd70f162362a22ffb9164971158b99060200161189b565b6001546001600160a01b0316331461274e5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff16156127a85760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b82158015906127b75750600082115b80156127cc5750428167ffffffffffffffff16115b80156128045750600083815260076020526040902060020154760100000000000000000000000000000000000000000000900460ff16155b6128505760405162461bcd60e51b815260206004820152601760248201527f41495244524f505f524553455256455f494e56414c49440000000000000000006044820152606401610617565b6040805160e08101825283815267ffffffffffffffff80841660208084019182526000848601818152606086018281526080870183815260a08801848152600160c08a018181528e87526007909752998520985189559551888a0180549451891668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009095169190981617929092179095559351600290950180549451935192511515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff931515750100000000000000000000000000000000000000000002939093167fffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffff941515600160a01b027fffffffffffffffffffffff0000000000000000000000000000000000000000009096166001600160a01b03979097169690961794909417929092169390931792909217905560088054928301815581527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3909101849055600a8054916108d9836137fb565b600080612a14848442612a60565b60008581526006602090815260408083206001600160a01b0388168452909152902060010154909150808211612a4b576000612a55565b612a55818361395f565b925050505b92915050565b6005546000908410612ab45760405162461bcd60e51b815260206004820152600c60248201527f504c414e5f554e4b4e4f574e00000000000000000000000000000000000000006044820152606401610617565b600060058581548110612ac957612ac9613930565b600091825260208083206040805161012081018252600590940290910180548452600181015467ffffffffffffffff808216868601526801000000000000000082048116868501527001000000000000000000000000000000008204811660608701527801000000000000000000000000000000000000000000000000909104166080850152600281015461ffff1660a0850152600381015460c08501526004015460ff808216151560e0860190815261010092839004909116151591850191909152898552600683528185206001600160a01b038a16865290925283205490519193509190612bbd578260200151612bfa565b600b5467ffffffffffffffff1615612bf0576020830151600b54612beb919067ffffffffffffffff16613972565b612bfa565b67ffffffffffffffff5b9050811580612c1c57508067ffffffffffffffff168567ffffffffffffffff16105b15612c2d5760009350505050612d38565b60006127108460a0015161ffff1684612c46919061399a565b612c5091906139b1565b9050836040015182612c629190613972565b67ffffffffffffffff168667ffffffffffffffff161015612c88579350612d3892505050565b6000846040015183612c9a9190613972565b612ca490886139ec565b67ffffffffffffffff169050846060015167ffffffffffffffff168110612cd2578395505050505050612d38565b608085015167ffffffffffffffff16612ceb81836139b1565b612cf5919061399a565b606086015190915067ffffffffffffffff1681612d12848761395f565b612d1c919061399a565b612d2691906139b1565b612d309083613833565b955050505050505b9392505050565b60058181548110612d4f57600080fd5b60009182526020909120600590910201805460018201546002830154600384015460049094015492945067ffffffffffffffff808316946801000000000000000084048216947001000000000000000000000000000000008504831694780100000000000000000000000000000000000000000000000090049092169261ffff169160ff8082169161010090041689565b6001546001600160a01b03163314612e3a5760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b600154600160a01b900460ff1615612e945760405162461bcd60e51b815260206004820152600e60248201527f56455354494e475f5345414c45440000000000000000000000000000000000006044820152606401610617565b60055485108015612ea457508215155b8015612eaf57508281145b8015612ebc575060fa8311155b612f085760405162461bcd60e51b815260206004820152600e60248201527f4752414e54535f494e56414c49440000000000000000000000000000000000006044820152606401610617565b6000805b8481101561306d576000868683818110612f2857612f28613930565b9050602002016020810190612f3d91906137af565b90506000858584818110612f5357612f53613930565b60200291909101359150506001600160a01b03821615801590612f765750600081115b8015612fa2575060008981526006602090815260408083206001600160a01b0386168452909152902054155b612fee5760405162461bcd60e51b815260206004820152600d60248201527f4752414e545f494e56414c4944000000000000000000000000000000000000006044820152606401610617565b60008981526006602090815260408083206001600160a01b0386168452909152902081905561301d8185613833565b9350816001600160a01b0316897f783c96dafbf5d54c99f7930938d5a93114d564f55dde9aa45ab24f12cde635868360405161305b91815260200190565b60405180910390a35050600101612f0c565b50806005878154811061308257613082613930565b906000526020600020906005020160030160008282546130a29190613833565b9250508190555080600260008282546130bb9190613833565b9091555050505050505050565b6001546001600160a01b031633146131225760405162461bcd60e51b815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610617565b6001600160a01b0381166131785760405162461bcd60e51b815260206004820152600c60248201527f414444524553535f5a45524f00000000000000000000000000000000000000006044820152606401610617565b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60026000540361323e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610617565b6002600055565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526132c59084906132ca565b505050565b600061331f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166133b29092919063ffffffff16565b90508051600014806133405750808060200190518101906133409190613886565b6132c55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610617565b60606133c184846000856133c9565b949350505050565b6060824710156134415760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610617565b600080866001600160a01b0316858760405161345d919061386a565b60006040518083038185875af1925050503d806000811461349a576040519150601f19603f3d011682016040523d82523d6000602084013e61349f565b606091505b50915091506134b0878383876134bb565b979650505050505050565b6060831561352a578251600003613523576001600160a01b0385163b6135235760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610617565b50816133c1565b6133c1838381511561353f5781518083602001fd5b8060405162461bcd60e51b81526004016106179190613a0d565b67ffffffffffffffff811681146118ae57600080fd5b60008060006060848603121561358457600080fd5b8335925060208401359150604084013561359d81613559565b809150509250925092565b6000602082840312156135ba57600080fd5b5035919050565b60008060008060008060c087890312156135da57600080fd5b8635955060208701356135ec81613559565b945060408701356135fc81613559565b9350606087013561360c81613559565b9250608087013561361c81613559565b915060a087013561ffff8116811461363357600080fd5b809150509295509295509295565b6001600160a01b03811681146118ae57600080fd5b6000806040838503121561366957600080fd5b82359150602083013561367b81613641565b809150509250929050565b6000806040838503121561369957600080fd5b82356136a481613641565b946020939093013593505050565b6000806000606084860312156136c757600080fd5b8335925060208401356136d981613641565b9150604084013561359d81613559565b60008083601f8401126136fb57600080fd5b50813567ffffffffffffffff81111561371357600080fd5b6020830191508360208260051b850101111561372e57600080fd5b9250929050565b60008060008060006060868803121561374d57600080fd5b85359450602086013567ffffffffffffffff8082111561376c57600080fd5b61377889838a016136e9565b9096509450604088013591508082111561379157600080fd5b5061379e888289016136e9565b969995985093965092949392505050565b6000602082840312156137c157600080fd5b8135612d3881613641565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361382c5761382c6137cc565b5060010190565b80820180821115612a5a57612a5a6137cc565b60005b83811015613861578181015183820152602001613849565b50506000910152565b6000825161387c818460208701613846565b9190910192915050565b60006020828403121561389857600080fd5b81518015158114612d3857600080fd5b6000602082840312156138ba57600080fd5b8151612d3881613641565b6000602082840312156138d757600080fd5b5051919050565b6000602082840312156138f057600080fd5b8151612d3881613559565b60008161390a5761390a6137cc565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115612a5a57612a5a6137cc565b67ffffffffffffffff818116838216019080821115613993576139936137cc565b5092915050565b8082028115828204841417612a5a57612a5a6137cc565b6000826139e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b67ffffffffffffffff828116828216039080821115613993576139936137cc565b6020815260008251806020840152613a2c816040850160208701613846565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212205d235a0bd782d1d7bf4bcd119a5cd3cf7d327d8405007bdae80cb7a57b3cad9164736f6c63430008180033a2646970667358221220f491d51c6718f04e251fca985a1e7272c1142037e96268aee26359178b854c4d64736f6c63430008180033",
"nonce": "0x19",
"to": null,
"transactionIndex": "0x0",
"type": "0x2",
"value": "0x0",
"yParity": "0x0",
"v": "0x0",
"r": "0xe8f086e97c3866702d34edbd8759fb00a7f4210960f41390361198296795865b",
"s": "0x6c110d4040c53a10ea5e3db0d66eb3f9e33f143fbfcdad1c94d77a1defd7d419"
}
}
}