Contract Details
Overview
COOK BALANCE
Loading…TOKEN NAME
EVM ContractTOTAL SUPPLY
Not availableMore Info
CONTRACT ADDRESS
0xec3adb83b157629fa0f3c166d34171293ede505aCONTRACT 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
- 0xec3adb83b157629fa0f3c166d34171293ede505a
- Verification
- Verified
Token metadata is read from the contract. Market valuations and multichain holdings are not currently indexed.
Verified Solidity Source
Compiler: 0.8.26+commit.8a97fa7a.Emscripten.clang · Contract: system-curve-sources/SystemBondingCurve.sol:SystemBondingCurve · Creation bytecode: matched
system-curve-sources/SystemBondingCurve.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
interface ISystemV2Factory { function getPair(address,address) external view returns(address); }
interface ISystemV2Pair { function totalSupply() external view returns(uint256); function getReserves() external view returns(uint112,uint112,uint32); function token0() external view returns(address); function mint(address) external returns(uint256); function balanceOf(address) external view returns(uint256); }
interface ISystemV2Router { function factory() external view returns(address); function addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256) external returns(uint256,uint256,uint256); }
/// Existing ERC20 inventory; no minting, bridge, admin withdrawal or upgrade.
/// Virtual quote reserve is pricing only. Sales can only spend real receipts.
contract SystemBondingCurve is ReentrancyGuard {
using SafeERC20 for IERC20;
IERC20 public immutable token;
IERC20 public immutable quote;
ISystemV2Router public immutable router;
address public immutable launcher;
uint256 public immutable initialInventory;
uint256 public immutable startReserve;
uint256 public immutable targetReserve;
uint256 public virtualTokens;
uint256 public realReserve;
bool public active;
bool public migrated;
address public pool;
address public constant LP_BURN=address(0xdead);
event Funded(address indexed launcher,uint256 tokens);
event Trade(address indexed wallet,bool buy,uint256 input,uint256 output);
event Graduated(address indexed pool,uint256 tokens,uint256 quoteAmount,uint256 liquidity);
event SurplusReturned(uint256 tokens,uint256 quoteAmount);
constructor(address token_,address quote_,address router_,address launcher_,uint256 inventory_,uint256 reserve_) {
require(token_!=quote_&&token_.code.length>0&"e_.code.length>0&&router_.code.length>0&&launcher_!=address(0),"Invalid assets");
require(inventory_>0&&inventory_<=1e30&&reserve_>0&&reserve_<=1e30,"Reserve bounds");
token=IERC20(token_);quote=IERC20(quote_);router=ISystemV2Router(router_);launcher=launcher_;
require(router.factory().code.length>0,"Invalid factory");
initialInventory=inventory_;virtualTokens=inventory_;startReserve=reserve_;targetReserve=reserve_*2;
}
function fund() external nonReentrant {
require(msg.sender==launcher&&!active&&!migrated,"Funding unavailable");
uint256 beforeBalance=token.balanceOf(address(this));token.safeTransferFrom(msg.sender,address(this),initialInventory);
require(token.balanceOf(address(this))-beforeBalance==initialInventory,"Transfer-tax token unsupported");
active=true;emit Funded(msg.sender,initialInventory);
}
function virtualReserve() public view returns(uint256){return startReserve+realReserve;}
function ready() public view returns(bool){return active&&!migrated&&realReserve>=targetReserve;}
function quoteBuy(uint256 maximum) public view returns(uint256 spent,uint256 output){
require(active&&!migrated,"Curve inactive");spent=Math.min(maximum,targetReserve-realReserve);
if(spent==0)return(0,0);
output=virtualTokens-Math.mulDiv(virtualTokens,virtualReserve(),virtualReserve()+spent,Math.Rounding.Up);
}
function quoteSell(uint256 amount) public view returns(uint256 output){
require(active&&!migrated&&amount>0,"Curve inactive");
output=virtualReserve()-Math.mulDiv(virtualTokens,virtualReserve(),virtualTokens+amount,Math.Rounding.Up);
require(output<=realReserve,"Insufficient real reserve");
}
function buy(uint256 maximum,uint256 minimum,uint256 deadline) external nonReentrant returns(uint256 output){
require(block.timestamp<=deadline,"Expired");uint256 spent;(spent,output)=quoteBuy(maximum);
require(spent>0&&output>0&&output>=minimum,"Slippage or target reached");
uint256 beforeBalance=quote.balanceOf(address(this));quote.safeTransferFrom(msg.sender,address(this),spent);
require(quote.balanceOf(address(this))-beforeBalance==spent,"Transfer-tax quote unsupported");
realReserve+=spent;virtualTokens-=output;token.safeTransfer(msg.sender,output);emit Trade(msg.sender,true,spent,output);
}
function sell(uint256 amount,uint256 minimum,uint256 deadline) external nonReentrant returns(uint256 output){
require(block.timestamp<=deadline,"Expired");output=quoteSell(amount);require(output>0&&output>=minimum,"Slippage");
uint256 beforeBalance=token.balanceOf(address(this));token.safeTransferFrom(msg.sender,address(this),amount);
require(token.balanceOf(address(this))-beforeBalance==amount,"Transfer-tax token unsupported");
virtualTokens+=amount;realReserve-=output;quote.safeTransfer(msg.sender,output);emit Trade(msg.sender,false,amount,output);
}
// Manual migration. Existing funded pools are acceptable only within the
// launcher's explicit, capped price tolerance. All net quote is deposited.
function migrate(uint16 maximumDeviationBps) external nonReentrant {
require(msg.sender==launcher&&ready()&&maximumDeviationBps<=1000,"Migration unavailable");
address factory=router.factory();address existing=ISystemV2Factory(factory).getPair(address(token),address(quote));
uint256 desired=Math.mulDiv(realReserve,virtualTokens,virtualReserve(),Math.Rounding.Up);
uint256 amount=desired;bool direct;uint256 donated;
if(existing!=address(0)){
uint256 supply=ISystemV2Pair(existing).totalSupply();
if(supply==0){
require(token.balanceOf(existing)==0,"Unminted token donation");
donated=quote.balanceOf(existing);direct=donated>0;
amount=Math.mulDiv(realReserve+donated,virtualTokens,virtualReserve(),Math.Rounding.Up);
}else{
(uint112 r0,uint112 r1,)=ISystemV2Pair(existing).getReserves();
bool base0=ISystemV2Pair(existing).token0()==address(token);
uint256 base=base0?r0:r1;uint256 counter=base0?r1:r0;require(base>0&&counter>0,"Invalid existing reserves");
amount=Math.mulDiv(realReserve,base,counter,Math.Rounding.Up);
uint256 difference=amount>desired?amount-desired:desired-amount;
require(difference<=Math.mulDiv(desired,maximumDeviationBps,10000),"Existing pool price differs");
}
}
require(amount>0&&amount<=token.balanceOf(address(this)),"Migration inventory insufficient");
uint256 burnedBefore=existing==address(0)?0:ISystemV2Pair(existing).balanceOf(LP_BURN);
uint256 usedToken;uint256 usedQuote;uint256 liquidity;
if(direct){token.safeTransfer(existing,amount);quote.safeTransfer(existing,realReserve);liquidity=ISystemV2Pair(existing).mint(LP_BURN);usedToken=amount;usedQuote=realReserve;}
else{
token.safeApprove(address(router),0);token.safeApprove(address(router),amount);
quote.safeApprove(address(router),0);quote.safeApprove(address(router),realReserve);
(usedToken,usedQuote,liquidity)=router.addLiquidity(address(token),address(quote),amount,realReserve,amount>1?amount-1:amount,realReserve,LP_BURN,block.timestamp);
token.safeApprove(address(router),0);quote.safeApprove(address(router),0);
}
require(usedQuote==realReserve&&usedToken>0&&liquidity>0,"Incomplete migration");
pool=ISystemV2Factory(factory).getPair(address(token),address(quote));
require(pool!=address(0)&&ISystemV2Pair(pool).balanceOf(LP_BURN)-burnedBefore>=liquidity,"LP burn missing");
migrated=true;active=false;emit Graduated(pool,usedToken,usedQuote+donated,liquidity);
// Unsold original inventory is not LP. Only after all real receipts are
// in the burned pool may this remainder return to its original owner.
uint256 surplus=token.balanceOf(address(this));uint256 extraQuote=quote.balanceOf(address(this));
if(surplus>0)token.safeTransfer(launcher,surplus);if(extraQuote>0)quote.safeTransfer(launcher,extraQuote);
emit SurplusReturned(surplus,extraQuote);
}
}
@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/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/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);
}
}
}
@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/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/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);
}
}
}
Contract ABI
[
{
"inputs": [
{
"internalType": "address",
"name": "token_",
"type": "address"
},
{
"internalType": "address",
"name": "quote_",
"type": "address"
},
{
"internalType": "address",
"name": "router_",
"type": "address"
},
{
"internalType": "address",
"name": "launcher_",
"type": "address"
},
{
"internalType": "uint256",
"name": "inventory_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserve_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "launcher",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
}
],
"name": "Funded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "pool",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"name": "Graduated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
}
],
"name": "SurplusReturned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "wallet",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "buy",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint256",
"name": "input",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"name": "Trade",
"type": "event"
},
{
"inputs": [],
"name": "LP_BURN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "active",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "buy",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "fund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "initialInventory",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launcher",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "maximumDeviationBps",
"type": "uint16"
}
],
"name": "migrate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "migrated",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "quote",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
}
],
"name": "quoteBuy",
"outputs": [
{
"internalType": "uint256",
"name": "spent",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "quoteSell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ready",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "realReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "contract ISystemV2Router",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "sell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "startReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "targetReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualTokens",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]Raw Contract Data · JSON
{
"id": "0xec3adb83b157629fa0f3c166d34171293ede505a",
"contract": "0xec3adb83b157629fa0f3c166d34171293ede505a",
"name": "EVM Contract",
"type": "contract",
"bytecode": "0x608080604052600436101561001357600080fd5b60003560e01c90816302fb0c5e146117505750806316eebd1e1461170b57806316f0115b146116de5780631d3dad09146116c05780632c678c641461169a57806340993b26146114155780634beb394c146113eb5780636defbf80146113c657806380c08a5d14611387578063999b93af14611342578063a64190c41461131c578063b60d4288146110fa578063cb639322146110dc578063cd33f2bd146110a1578063d1ec980b14611084578063d3c9727c14610e69578063dd8ab0121461020b578063e5e0e016146101d0578063f393630114610195578063f887ea40146101505763fc0c546a1461010657600080fd5b3461014b57600036600319011261014b576040517f000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da8696001600160a01b03168152602090f35b600080fd5b3461014b57600036600319011261014b576040517f000000000000000000000000086cf2482f13bfcaad24ae55ae083f02ffbd8ef46001600160a01b03168152602090f35b3461014b57600036600319011261014b5760206040517f0000000000000000000000000000000000000000000000000000000df84758008152f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000007f40f778ab3977963c8152f35b3461014b57602036600319011261014b5760043561ffff811680910361014b57610233611ad7565b7f000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d3090336001600160a01b0383161480610e5b575b80610e4f575b15610e125760405163c45a015560e01b81527f000000000000000000000000086cf2482f13bfcaad24ae55ae083f02ffbd8ef46001600160a01b031690602081600481855afa90811561065b57600091610df3575b5060405163e6a4390560e01b81526001600160a01b037f000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869818116600484018190527f000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a80841660248601819052989096909592949093919290911690602081604481855afa90811561065b57600091610dd4575b5060025497600154917f0000000000000000000000000000000000000000000000000000000df84758009261039461038d8c8661181b565b828d611bbb565b9a6000946001600160a01b0384169486938615939290918f8515610a51575b50505050508b1515806109ea575b156109a6576000901561093157506000965b600091156108065750506000916103fb826103f18d6020958c611b78565b600254908c611b78565b6024604051809481936335313c2160e11b835261dead60048401525af190811561065b576000916107d4575b5097916002545b6002548114806107cb575b806107c2575b156107865760405163e6a4390560e01b81526001600160a01b0386811660048301528c16602482015291602090839060449082905afa91821561065b57600092610755575b506003805462010000600160b01b03198116601094851b62010000600160b01b0316908117928390559790939190911c6001600160a01b03168015159190826106d5575b50501561069e576024996105197fcb64f2436060c9575db20c5dcf9cdc11657017ee5b0301949f531b3dd7da6b199461010060209960609682600160b01b03191617179360ff19851660035561181b565b604080519687528887019190915285015260101c6001600160a01b031692a26040516370a0823160e01b815230600482015295869182905afa93841561065b57600094610667575b50602060249495604051958680926370a0823160e01b82523060048301525afa93841561065b57600094610602575b50918382869485604097957f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b996105f1575b505050816105e0575b50505082519182526020820152a16001600055005b6105e992611b78565b8481816105cb565b6105fa92611b78565b8785826105c2565b9091936020823d602011610653575b8161061e602093836117c0565b8101031261065057505192907f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b610590565b80fd5b3d9150610611565b6040513d6000823e3d90fd5b94936020863d602011610696575b81610682602093836117c0565b810103126106505750935192936020610561565b3d9150610675565b60405162461bcd60e51b815260206004820152600f60248201526e4c50206275726e206d697373696e6760881b6044820152606490fd5b6040516370a0823160e01b815261dead60048201529250602090839060249082905afa801561065b578c9260009161071c575b5090610713916117f8565b10158c806104c8565b919250506020813d60201161074d575b81610739602093836117c0565b8101031261014b57518b9190610713610708565b3d915061072c565b61077891925060203d60201161077f575b61077081836117c0565b810190611aa4565b908b610484565b503d610766565b60405162461bcd60e51b815260206004820152601460248201527324b731b7b6b83632ba329036b4b3b930ba34b7b760611b6044820152606490fd5b5089151561043f565b50831515610439565b90506020813d6020116107fe575b816107ef602093836117c0565b8101031261014b57518a610427565b3d91506107e2565b80959350610817919b925088611d2a565b610822818589611d67565b61082c848a611d2a565b610839600254858b611d67565b600254600182111561092b576000198201828111610917575b6040519262e8e33760e81b84528760048501528d60248501526044840152816064840152608483015260a482015261dead60c48201524260e4820152606081610104818d885af1801561090c578a918b80926108c7575b50506108c2909a91946108bc818a611d2a565b8a611d2a565b61042e565b92509a505060608a3d606011610904575b816108e5606093836117c0565b810103126106505750885160208a01516040909a01516108c28d6108a9565b3d91506108d8565b6040513d8c823e3d90fd5b634e487b7160e01b8c52601160045260248cfd5b81610852565b6040516370a0823160e01b815261dead6004820152602081602481885afa91821561099a578092610965575b5050966103d3565b9091506020823d602011610992575b81610981602093836117c0565b810103126106505750518d8061095d565b3d9150610974565b604051903d90823e3d90fd5b606460405162461bcd60e51b815260206004820152602060248201527f4d6967726174696f6e20696e76656e746f727920696e73756666696369656e746044820152fd5b506040516370a0823160e01b81523060048201526020816024818b5afa90811561065b57600091610a1f575b508c11156103c1565b90506020813d602011610a49575b81610a3a602093836117c0565b8101031261014b57518e610a16565b3d9150610a2d565b909398929591949f506040516318160ddd60e01b81526020816004818c5afa90811561065b57600091610da2575b50610bc357505050506040516370a0823160e01b81528460048201526020816024818b5afa90811561065b57600091610b91575b50610b4c5760249160208e604051948580926370a0823160e01b82528960048301525afa92831561065b57600093610b16575b5090610b0a91610b048497610afe861515968261181b565b9361181b565b91611bbb565b9a5b8d808080806103b3565b90926020823d602011610b44575b81610b31602093836117c0565b8101031261065057505191610b0a610ae6565b3d9150610b24565b60405162461bcd60e51b815260206004820152601760248201527f556e6d696e74656420746f6b656e20646f6e6174696f6e0000000000000000006044820152606490fd5b90506020813d602011610bbb575b81610bac602093836117c0565b8101031261014b57518e610ab3565b3d9150610b9f565b929e935093509560405190630240bc6b60e21b82526060826004818a5afa801561065b576000928391610d47575b50604051630dfe168160e01b8152906020826004818c5afa91821561065b576001600160701b03928d91600091610d28575b506001600160a01b031614938415610d215782815b169415610d1a57505b1682151580610d11575b15610ccc57610c7792610c5d92611bbb565b9d8e8380821115610cc257610c71916117f8565b92611bfb565b1015610b0c5760405162461bcd60e51b815260206004820152601b60248201527f4578697374696e6720706f6f6c207072696365206469666665727300000000006044820152606490fd5b90610c71916117f8565b60405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206578697374696e67207265736572766573000000000000006044820152606490fd5b50801515610c4b565b9050610c41565b8282610c38565b610d41915060203d60201161077f5761077081836117c0565b38610c23565b9290506060833d606011610d9a575b81610d63606093836117c0565b8101031261065057610d7483611ac3565b906040610d8360208601611ac3565b94015163ffffffff81160361065057509138610bf1565b3d9150610d56565b90506020813d602011610dcc575b81610dbd602093836117c0565b8101031261014b575138610a7f565b3d9150610db0565b610ded915060203d60201161077f5761077081836117c0565b89610355565b610e0c915060203d60201161077f5761077081836117c0565b846102c2565b60405162461bcd60e51b81526020600482015260156024820152744d6967726174696f6e20756e617661696c61626c6560581b6044820152606490fd5b506103e881111561026d565b50610e64611935565b610267565b3461014b57610e8e610e7a36611770565b610e8693919293611ad7565b42111561178a565b610e9782611985565b908115159081611079575b5015611049576040516370a0823160e01b8152306004820152917f000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da8696001600160a01b03811690602085602481855afa94851561065b57600095611014575b50602491610f148460209330903390611b2d565b6040516370a0823160e01b815230600482015292839182905afa90811561065b57600091610fe2575b5081610f4e602095610f54936117f8565b14611a58565b610f608160015461181b565b600155610f6f826002546117f8565b600255610f9d82337f000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a611b78565b6040519060008252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b90506020813d60201161100c575b81610ffd602093836117c0565b8101031261014b575181610f3d565b3d9150610ff0565b9094506020813d602011611041575b81611030602093836117c0565b8101031261014b5751936024610f00565b3d9150611023565b60405162461bcd60e51b8152602060048201526008602482015267536c69707061676560c01b6044820152606490fd5b905081101583610ea2565b3461014b57600036600319011261014b57602060405161dead8152f35b3461014b57600036600319011261014b5760206040517f0000000000000000000000000000000000000000000000000000001bf08eb0008152f35b3461014b57600036600319011261014b576020600254604051908152f35b3461014b57600036600319011261014b57611113611ad7565b337f000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d306001600160a01b0316148061130f575b806112ff575b156112c4576040516370a0823160e01b81523060048201527f000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869906001600160a01b038216602082602481845afa91821561065b5760009261128f575b509060206024926111dd7f00000000000000000000000000000000000000000000007f40f778ab3977963c809630903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b578392600091611256575b506112169291610f4e916117f8565b600160ff1960035416176003556040519081527f5af8184bef8e4b45eb9f6ed7734d04da38ced226495548f46e0c8ff8d7d9a52460203392a26001600055005b9250506020823d602011611287575b81611272602093836117c0565b8101031261014b579051829190611216611207565b3d9150611265565b91506020823d6020116112bc575b816112aa602093836117c0565b8101031261014b5790519060206111a7565b3d915061129d565b60405162461bcd60e51b815260206004820152601360248201527246756e64696e6720756e617661696c61626c6560681b6044820152606490fd5b5060ff60035460081c161561114b565b5060ff6003541615611145565b3461014b57602036600319011261014b57602061133a600435611985565b604051908152f35b3461014b57600036600319011261014b576040517f000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a6001600160a01b03168152602090f35b3461014b57600036600319011261014b57602061133a6002547f0000000000000000000000000000000000000000000000000000000df847580061181b565b3461014b57600036600319011261014b5760206113e1611935565b6040519015158152f35b3461014b57602036600319011261014b576040611409600435611865565b82519182526020820152f35b3461014b5761143461143961142936611770565b610e86949194611ad7565b611865565b90918215159081611690575b81611685575b5015611640576040516370a0823160e01b81523060048201527f000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a6001600160a01b03811691602081602481865afa91821561065b578591600093611607575b50926114be60209260249530903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b5784926000916115ce575b50906114f3916117f8565b03611589578161150760209360025461181b565b600255611516826001546117f8565b60015561154482337f000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869611b78565b6040519060018252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d7461782071756f746520756e737570706f7274656400006044820152606490fd5b919250506020813d6020116115ff575b816115eb602093836117c0565b8101031261014b57518391906114f36114e8565b3d91506115de565b915091506020813d602011611638575b81611624602093836117c0565b8101031261014b57519084906114be6114aa565b3d9150611617565b60405162461bcd60e51b815260206004820152601a60248201527f536c697070616765206f722074617267657420726561636865640000000000006044820152606490fd5b90508110158361144b565b8215159150611445565b3461014b57600036600319011261014b57602060ff60035460081c166040519015158152f35b3461014b57600036600319011261014b576020600154604051908152f35b3461014b57600036600319011261014b5760035460405160109190911c6001600160a01b03168152602090f35b3461014b57600036600319011261014b576040517f000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d306001600160a01b03168152602090f35b3461014b57600036600319011261014b5760209060ff6003541615158152f35b606090600319011261014b57600435906024359060443590565b1561179157565b60405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b6044820152606490fd5b90601f8019910116810190811067ffffffffffffffff8211176117e257604052565b634e487b7160e01b600052604160045260246000fd5b9190820391821161180557565b634e487b7160e01b600052601160045260246000fd5b9190820180921161180557565b1561182f57565b60405162461bcd60e51b815260206004820152600e60248201526d437572766520696e61637469766560901b6044820152606490fd5b9061187d60035460ff81169081611926575b50611828565b600254916118ab837f0000000000000000000000000000000000000000000000000000001bf08eb0006117f8565b8082101561191e5750915b8215611915576119129061190c60015491611905866119007f0000000000000000000000000000000000000000000000000000000df8475800936118fa818661181b565b9461181b565b61181b565b9083611bbb565b906117f8565b90565b50600091508190565b9050916118b6565b60ff915060081c161538611877565b60035460ff81169081611976575b508061194c5790565b506002547f0000000000000000000000000000000000000000000000000000001bf08eb000111590565b60ff915060081c161538611943565b9060035460ff81169081611a49575b5080611a40575b6119a490611828565b6119f27f0000000000000000000000000000000000000000000000000000000df84758009261190c600254946119da868261181b565b92610b046119eb886001549461181b565b918361181b565b9182116119fb57565b60405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e74207265616c2072657365727665000000000000006044820152606490fd5b5081151561199b565b60ff915060081c161538611994565b15611a5f57565b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d74617820746f6b656e20756e737570706f7274656400006044820152606490fd5b9081602091031261014b57516001600160a01b038116810361014b5790565b51906001600160701b038216820361014b57565b600260005414611ae8576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152611b7691611b716084836117c0565b611e97565b565b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044820192909252611b7691611b7182606481015b03601f1981018452836117c0565b9190611bc8828285611ca1565b928215611be55709611bd75790565b600181018091116118055790565b634e487b7160e01b600052601260045260246000fd5b60001982820982820291828083109203918083039214611c9657816127101115611c59577fbc01a36e2eb1c432ca57a786c226809d495182a9930be0ded288ce703afb7e9193612710910990828211900360fc1b910360041c170290565b60405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606490fd5b505061271091500490565b916000198284099282810292838086109503948086039514611d1c5784831115611c595782910960018219018216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b505080925015611be5570490565b60405163095ea7b360e01b60208201526001600160a01b03909216602483015260006044808401919091528252611b769190611b716064836117c0565b91909181158015611e16575b15611db25760405163095ea7b360e01b60208201526001600160a01b0390931660248401526044830191909152611b769190611b718260648101611bad565b60405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b50604051636eb1769f60e11b81523060048201526001600160a01b0384166024820152602081806044810103816001600160a01b0386165afa90811561065b57600091611e65575b5015611d73565b90506020813d602011611e8f575b81611e80602093836117c0565b8101031261014b575138611e5e565b3d9150611e73565b60018060a01b0316604091600080845192611eb286856117c0565b602084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602085015260208151910182865af13d15611fb8573d9067ffffffffffffffff82116117e2578451611f28949092611f19601f8201601f1916602001856117c0565b83523d6000602085013e611fc1565b8051908115918215611f95575b505015611f3f5750565b5162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b819250906020918101031261014b5760200151801515810361014b573880611f35565b91611f28926060915b919290156120235750815115611fd5575090565b3b15611fde5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156120365750805190602001fd5b6040519062461bcd60e51b8252602060048301528181519182602483015260005b8381106120795750508160006044809484010152601f80199101168101030190fd5b6020828201810151604487840101528593500161205756fea264697066735822122040220398d5fb0312dac1737b7a6f445145f8689e6334c06b2aa7d145df18e3f864736f6c634300081a0033",
"is_contract": true,
"verified": true,
"verification": {
"address": "0xec3adb83b157629fa0f3c166d34171293ede505a",
"compiler": "0.8.26+commit.8a97fa7a.Emscripten.clang",
"contract": "system-curve-sources/SystemBondingCurve.sol:SystemBondingCurve",
"verified": true,
"match": "runtime-with-metadata",
"creation_verified": true,
"factory_deployment": null,
"constructor_arguments": "000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a000000000000000000000000086cf2482f13bfcaad24ae55ae083f02ffbd8ef4000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d3000000000000000000000000000000000000000000000007f40f778ab3977963c0000000000000000000000000000000000000000000000000000000df8475800",
"verified_at": "2026-10-07T14:07:05.754Z",
"chain_id": 20261001,
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "token_",
"type": "address"
},
{
"internalType": "address",
"name": "quote_",
"type": "address"
},
{
"internalType": "address",
"name": "router_",
"type": "address"
},
{
"internalType": "address",
"name": "launcher_",
"type": "address"
},
{
"internalType": "uint256",
"name": "inventory_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserve_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "launcher",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
}
],
"name": "Funded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "pool",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"name": "Graduated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
}
],
"name": "SurplusReturned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "wallet",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "buy",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint256",
"name": "input",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"name": "Trade",
"type": "event"
},
{
"inputs": [],
"name": "LP_BURN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "active",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "buy",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "fund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "initialInventory",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launcher",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "maximumDeviationBps",
"type": "uint16"
}
],
"name": "migrate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "migrated",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "quote",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
}
],
"name": "quoteBuy",
"outputs": [
{
"internalType": "uint256",
"name": "spent",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "quoteSell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ready",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "realReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "contract ISystemV2Router",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "sell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "startReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "targetReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualTokens",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"input": {
"language": "Solidity",
"sources": {
"system-curve-sources/SystemBondingCurve.sol": {
"content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\n\ninterface ISystemV2Factory { function getPair(address,address) external view returns(address); }\ninterface ISystemV2Pair { function totalSupply() external view returns(uint256); function getReserves() external view returns(uint112,uint112,uint32); function token0() external view returns(address); function mint(address) external returns(uint256); function balanceOf(address) external view returns(uint256); }\ninterface ISystemV2Router { function factory() external view returns(address); function addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256) external returns(uint256,uint256,uint256); }\n\n/// Existing ERC20 inventory; no minting, bridge, admin withdrawal or upgrade.\n/// Virtual quote reserve is pricing only. Sales can only spend real receipts.\ncontract SystemBondingCurve is ReentrancyGuard {\n using SafeERC20 for IERC20;\n IERC20 public immutable token;\n IERC20 public immutable quote;\n ISystemV2Router public immutable router;\n address public immutable launcher;\n uint256 public immutable initialInventory;\n uint256 public immutable startReserve;\n uint256 public immutable targetReserve;\n uint256 public virtualTokens;\n uint256 public realReserve;\n bool public active;\n bool public migrated;\n address public pool;\n address public constant LP_BURN=address(0xdead);\n event Funded(address indexed launcher,uint256 tokens);\n event Trade(address indexed wallet,bool buy,uint256 input,uint256 output);\n event Graduated(address indexed pool,uint256 tokens,uint256 quoteAmount,uint256 liquidity);\n event SurplusReturned(uint256 tokens,uint256 quoteAmount);\n constructor(address token_,address quote_,address router_,address launcher_,uint256 inventory_,uint256 reserve_) {\n require(token_!=quote_&&token_.code.length>0&"e_.code.length>0&&router_.code.length>0&&launcher_!=address(0),\"Invalid assets\");\n require(inventory_>0&&inventory_<=1e30&&reserve_>0&&reserve_<=1e30,\"Reserve bounds\");\n token=IERC20(token_);quote=IERC20(quote_);router=ISystemV2Router(router_);launcher=launcher_;\n require(router.factory().code.length>0,\"Invalid factory\");\n initialInventory=inventory_;virtualTokens=inventory_;startReserve=reserve_;targetReserve=reserve_*2;\n }\n function fund() external nonReentrant {\n require(msg.sender==launcher&&!active&&!migrated,\"Funding unavailable\");\n uint256 beforeBalance=token.balanceOf(address(this));token.safeTransferFrom(msg.sender,address(this),initialInventory);\n require(token.balanceOf(address(this))-beforeBalance==initialInventory,\"Transfer-tax token unsupported\");\n active=true;emit Funded(msg.sender,initialInventory);\n }\n function virtualReserve() public view returns(uint256){return startReserve+realReserve;}\n function ready() public view returns(bool){return active&&!migrated&&realReserve>=targetReserve;}\n function quoteBuy(uint256 maximum) public view returns(uint256 spent,uint256 output){\n require(active&&!migrated,\"Curve inactive\");spent=Math.min(maximum,targetReserve-realReserve);\n if(spent==0)return(0,0);\n output=virtualTokens-Math.mulDiv(virtualTokens,virtualReserve(),virtualReserve()+spent,Math.Rounding.Up);\n }\n function quoteSell(uint256 amount) public view returns(uint256 output){\n require(active&&!migrated&&amount>0,\"Curve inactive\");\n output=virtualReserve()-Math.mulDiv(virtualTokens,virtualReserve(),virtualTokens+amount,Math.Rounding.Up);\n require(output<=realReserve,\"Insufficient real reserve\");\n }\n function buy(uint256 maximum,uint256 minimum,uint256 deadline) external nonReentrant returns(uint256 output){\n require(block.timestamp<=deadline,\"Expired\");uint256 spent;(spent,output)=quoteBuy(maximum);\n require(spent>0&&output>0&&output>=minimum,\"Slippage or target reached\");\n uint256 beforeBalance=quote.balanceOf(address(this));quote.safeTransferFrom(msg.sender,address(this),spent);\n require(quote.balanceOf(address(this))-beforeBalance==spent,\"Transfer-tax quote unsupported\");\n realReserve+=spent;virtualTokens-=output;token.safeTransfer(msg.sender,output);emit Trade(msg.sender,true,spent,output);\n }\n function sell(uint256 amount,uint256 minimum,uint256 deadline) external nonReentrant returns(uint256 output){\n require(block.timestamp<=deadline,\"Expired\");output=quoteSell(amount);require(output>0&&output>=minimum,\"Slippage\");\n uint256 beforeBalance=token.balanceOf(address(this));token.safeTransferFrom(msg.sender,address(this),amount);\n require(token.balanceOf(address(this))-beforeBalance==amount,\"Transfer-tax token unsupported\");\n virtualTokens+=amount;realReserve-=output;quote.safeTransfer(msg.sender,output);emit Trade(msg.sender,false,amount,output);\n }\n // Manual migration. Existing funded pools are acceptable only within the\n // launcher's explicit, capped price tolerance. All net quote is deposited.\n function migrate(uint16 maximumDeviationBps) external nonReentrant {\n require(msg.sender==launcher&&ready()&&maximumDeviationBps<=1000,\"Migration unavailable\");\n address factory=router.factory();address existing=ISystemV2Factory(factory).getPair(address(token),address(quote));\n uint256 desired=Math.mulDiv(realReserve,virtualTokens,virtualReserve(),Math.Rounding.Up);\n uint256 amount=desired;bool direct;uint256 donated;\n if(existing!=address(0)){\n uint256 supply=ISystemV2Pair(existing).totalSupply();\n if(supply==0){\n require(token.balanceOf(existing)==0,\"Unminted token donation\");\n donated=quote.balanceOf(existing);direct=donated>0;\n amount=Math.mulDiv(realReserve+donated,virtualTokens,virtualReserve(),Math.Rounding.Up);\n }else{\n (uint112 r0,uint112 r1,)=ISystemV2Pair(existing).getReserves();\n bool base0=ISystemV2Pair(existing).token0()==address(token);\n uint256 base=base0?r0:r1;uint256 counter=base0?r1:r0;require(base>0&&counter>0,\"Invalid existing reserves\");\n amount=Math.mulDiv(realReserve,base,counter,Math.Rounding.Up);\n uint256 difference=amount>desired?amount-desired:desired-amount;\n require(difference<=Math.mulDiv(desired,maximumDeviationBps,10000),\"Existing pool price differs\");\n }\n }\n require(amount>0&&amount<=token.balanceOf(address(this)),\"Migration inventory insufficient\");\n uint256 burnedBefore=existing==address(0)?0:ISystemV2Pair(existing).balanceOf(LP_BURN);\n uint256 usedToken;uint256 usedQuote;uint256 liquidity;\n if(direct){token.safeTransfer(existing,amount);quote.safeTransfer(existing,realReserve);liquidity=ISystemV2Pair(existing).mint(LP_BURN);usedToken=amount;usedQuote=realReserve;}\n else{\n token.safeApprove(address(router),0);token.safeApprove(address(router),amount);\n quote.safeApprove(address(router),0);quote.safeApprove(address(router),realReserve);\n (usedToken,usedQuote,liquidity)=router.addLiquidity(address(token),address(quote),amount,realReserve,amount>1?amount-1:amount,realReserve,LP_BURN,block.timestamp);\n token.safeApprove(address(router),0);quote.safeApprove(address(router),0);\n }\n require(usedQuote==realReserve&&usedToken>0&&liquidity>0,\"Incomplete migration\");\n pool=ISystemV2Factory(factory).getPair(address(token),address(quote));\n require(pool!=address(0)&&ISystemV2Pair(pool).balanceOf(LP_BURN)-burnedBefore>=liquidity,\"LP burn missing\");\n migrated=true;active=false;emit Graduated(pool,usedToken,usedQuote+donated,liquidity);\n // Unsold original inventory is not LP. Only after all real receipts are\n // in the burned pool may this remainder return to its original owner.\n uint256 surplus=token.balanceOf(address(this));uint256 extraQuote=quote.balanceOf(address(this));\n if(surplus>0)token.safeTransfer(launcher,surplus);if(extraQuote>0)quote.safeTransfer(launcher,extraQuote);\n emit SurplusReturned(surplus,extraQuote);\n }\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/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/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"
},
"@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/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/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"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"system-curve-sources/SystemBondingCurve.sol": {
"SystemBondingCurve": [
"abi",
"metadata",
"evm.bytecode",
"evm.deployedBytecode"
],
"": [
"ast"
]
}
}
}
},
"metadata": {
"compiler": {
"version": "0.8.26+commit.8a97fa7a"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "token_",
"type": "address"
},
{
"internalType": "address",
"name": "quote_",
"type": "address"
},
{
"internalType": "address",
"name": "router_",
"type": "address"
},
{
"internalType": "address",
"name": "launcher_",
"type": "address"
},
{
"internalType": "uint256",
"name": "inventory_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reserve_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "launcher",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
}
],
"name": "Funded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "pool",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "liquidity",
"type": "uint256"
}
],
"name": "Graduated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "tokens",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "quoteAmount",
"type": "uint256"
}
],
"name": "SurplusReturned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "wallet",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "buy",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint256",
"name": "input",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"name": "Trade",
"type": "event"
},
{
"inputs": [],
"name": "LP_BURN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "active",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "buy",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "fund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "initialInventory",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launcher",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "maximumDeviationBps",
"type": "uint16"
}
],
"name": "migrate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "migrated",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "quote",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maximum",
"type": "uint256"
}
],
"name": "quoteBuy",
"outputs": [
{
"internalType": "uint256",
"name": "spent",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "quoteSell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ready",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "realReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "contract ISystemV2Router",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "minimum",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
"name": "sell",
"outputs": [
{
"internalType": "uint256",
"name": "output",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "startReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "targetReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "token",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualReserve",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "virtualTokens",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "Existing ERC20 inventory; no minting, bridge, admin withdrawal or upgrade. Virtual quote reserve is pricing only. Sales can only spend real receipts.",
"version": 1
}
},
"settings": {
"compilationTarget": {
"system-curve-sources/SystemBondingCurve.sol": "SystemBondingCurve"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true
},
"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/math/Math.sol": {
"keccak256": "0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3",
"license": "MIT",
"urls": [
"bzz-raw://cc8841b3cd48ad125e2f46323c8bad3aa0e88e399ec62acb9e57efa7e7c8058c",
"dweb:/ipfs/QmSqE4mXHA2BXW58deDbXE8MTcsL5JSKNDbm23sVQxRLPS"
]
},
"system-curve-sources/SystemBondingCurve.sol": {
"keccak256": "0x6d8b717f6f5ecc8373f52aeeb72c1f949555e285d28cefcbc322e54d8c87a0c8",
"license": "MIT",
"urls": [
"bzz-raw://7978ca57e7d95eb2d4abd454d040e0050c7c2cc98af708248e891546d2b316cc",
"dweb:/ipfs/QmYCwx27gmLTAZMJvQSgqZ2DEsTytciRbw2o3i94tFaown"
]
}
},
"version": 1
}
},
"deployment": {
"txid": "0xda0da3408e1028decb5df655ddfcd73d6cd2ca835d57dca73d36e1b34bcec907",
"hash": "0xda0da3408e1028decb5df655ddfcd73d6cd2ca835d57dca73d36e1b34bcec907",
"sender": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"recipient": "0xec3adb83b157629fa0f3c166d34171293ede505a",
"amount_dec": "0",
"value_raw": "0",
"fee_dec": "0.00000001930391",
"fee_raw": "19303910000",
"asset": "COOK",
"timestamp_ms": 1791045604000,
"block": 69621,
"status": "Success",
"kind": "Contract creation",
"source": "EVM",
"nonce": 149,
"transaction_type": 2,
"gas_limit": "1946879",
"gas_used": "1930391",
"gas_price_wei": "10000",
"gas_price_gwei": "0.00001",
"data_hex": "0x61016080604052346102695760c08161246c80380380916100208285610357565b8339810103126102695761003381610390565b9061004060208201610390565b9161004d60408301610390565b9261005a60608401610390565b608084015160a0909401516001600055946001600160a01b03838116949081169384861415918261034c575b5081610341575b5080610337575b80610325575b156102ef57841515806102d8575b806102cf575b806102b8575b156102825760049360209360805260a05260018060a01b0316908160c05260e0526040519283809263c45a015560e01b82525afa90811561027657600091610237575b503b1561020057806101005260015580610120528060011b90808204600214901517156101ea57610140526040516120c790816103a5823960805181818161011c015281816102da01528181610ebe015281816111650152611520015260a05181818161030501528181610f79015281816113580152611466015260c0518181816101660152610281015260e0518181816102350152818161111601526117210152610100518181816101e801526111b30152610120518181816101ad01528181610360015281816113a2015281816118d001526119a90152610140518181816110b90152818161188701526119520152f35b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c696420666163746f727960881b6044820152606490fd5b90506020813d60201161026e575b8161025260209383610357565b810103126102695761026390610390565b386100f7565b600080fd5b3d9150610245565b6040513d6000823e3d90fd5b60405162461bcd60e51b815260206004820152600e60248201526d5265736572766520626f756e647360901b6044820152606490fd5b506c0c9f2c9cd04674edea400000008611156100b4565b508515156100ae565b506c0c9f2c9cd04674edea400000008511156100a8565b60405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061737365747360901b6044820152606490fd5b506001600160a01b038216151561009a565b50803b1515610094565b90503b15153861008d565b3b1515915038610086565b601f909101601f19168101906001600160401b0382119082101761037a57604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036102695756fe608080604052600436101561001357600080fd5b60003560e01c90816302fb0c5e146117505750806316eebd1e1461170b57806316f0115b146116de5780631d3dad09146116c05780632c678c641461169a57806340993b26146114155780634beb394c146113eb5780636defbf80146113c657806380c08a5d14611387578063999b93af14611342578063a64190c41461131c578063b60d4288146110fa578063cb639322146110dc578063cd33f2bd146110a1578063d1ec980b14611084578063d3c9727c14610e69578063dd8ab0121461020b578063e5e0e016146101d0578063f393630114610195578063f887ea40146101505763fc0c546a1461010657600080fd5b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b600080fd5b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57602036600319011261014b5760043561ffff811680910361014b57610233611ad7565b7f000000000000000000000000000000000000000000000000000000000000000090336001600160a01b0383161480610e5b575b80610e4f575b15610e125760405163c45a015560e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690602081600481855afa90811561065b57600091610df3575b5060405163e6a4390560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000818116600484018190527f000000000000000000000000000000000000000000000000000000000000000080841660248601819052989096909592949093919290911690602081604481855afa90811561065b57600091610dd4575b5060025497600154917f00000000000000000000000000000000000000000000000000000000000000009261039461038d8c8661181b565b828d611bbb565b9a6000946001600160a01b0384169486938615939290918f8515610a51575b50505050508b1515806109ea575b156109a6576000901561093157506000965b600091156108065750506000916103fb826103f18d6020958c611b78565b600254908c611b78565b6024604051809481936335313c2160e11b835261dead60048401525af190811561065b576000916107d4575b5097916002545b6002548114806107cb575b806107c2575b156107865760405163e6a4390560e01b81526001600160a01b0386811660048301528c16602482015291602090839060449082905afa91821561065b57600092610755575b506003805462010000600160b01b03198116601094851b62010000600160b01b0316908117928390559790939190911c6001600160a01b03168015159190826106d5575b50501561069e576024996105197fcb64f2436060c9575db20c5dcf9cdc11657017ee5b0301949f531b3dd7da6b199461010060209960609682600160b01b03191617179360ff19851660035561181b565b604080519687528887019190915285015260101c6001600160a01b031692a26040516370a0823160e01b815230600482015295869182905afa93841561065b57600094610667575b50602060249495604051958680926370a0823160e01b82523060048301525afa93841561065b57600094610602575b50918382869485604097957f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b996105f1575b505050816105e0575b50505082519182526020820152a16001600055005b6105e992611b78565b8481816105cb565b6105fa92611b78565b8785826105c2565b9091936020823d602011610653575b8161061e602093836117c0565b8101031261065057505192907f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b610590565b80fd5b3d9150610611565b6040513d6000823e3d90fd5b94936020863d602011610696575b81610682602093836117c0565b810103126106505750935192936020610561565b3d9150610675565b60405162461bcd60e51b815260206004820152600f60248201526e4c50206275726e206d697373696e6760881b6044820152606490fd5b6040516370a0823160e01b815261dead60048201529250602090839060249082905afa801561065b578c9260009161071c575b5090610713916117f8565b10158c806104c8565b919250506020813d60201161074d575b81610739602093836117c0565b8101031261014b57518b9190610713610708565b3d915061072c565b61077891925060203d60201161077f575b61077081836117c0565b810190611aa4565b908b610484565b503d610766565b60405162461bcd60e51b815260206004820152601460248201527324b731b7b6b83632ba329036b4b3b930ba34b7b760611b6044820152606490fd5b5089151561043f565b50831515610439565b90506020813d6020116107fe575b816107ef602093836117c0565b8101031261014b57518a610427565b3d91506107e2565b80959350610817919b925088611d2a565b610822818589611d67565b61082c848a611d2a565b610839600254858b611d67565b600254600182111561092b576000198201828111610917575b6040519262e8e33760e81b84528760048501528d60248501526044840152816064840152608483015260a482015261dead60c48201524260e4820152606081610104818d885af1801561090c578a918b80926108c7575b50506108c2909a91946108bc818a611d2a565b8a611d2a565b61042e565b92509a505060608a3d606011610904575b816108e5606093836117c0565b810103126106505750885160208a01516040909a01516108c28d6108a9565b3d91506108d8565b6040513d8c823e3d90fd5b634e487b7160e01b8c52601160045260248cfd5b81610852565b6040516370a0823160e01b815261dead6004820152602081602481885afa91821561099a578092610965575b5050966103d3565b9091506020823d602011610992575b81610981602093836117c0565b810103126106505750518d8061095d565b3d9150610974565b604051903d90823e3d90fd5b606460405162461bcd60e51b815260206004820152602060248201527f4d6967726174696f6e20696e76656e746f727920696e73756666696369656e746044820152fd5b506040516370a0823160e01b81523060048201526020816024818b5afa90811561065b57600091610a1f575b508c11156103c1565b90506020813d602011610a49575b81610a3a602093836117c0565b8101031261014b57518e610a16565b3d9150610a2d565b909398929591949f506040516318160ddd60e01b81526020816004818c5afa90811561065b57600091610da2575b50610bc357505050506040516370a0823160e01b81528460048201526020816024818b5afa90811561065b57600091610b91575b50610b4c5760249160208e604051948580926370a0823160e01b82528960048301525afa92831561065b57600093610b16575b5090610b0a91610b048497610afe861515968261181b565b9361181b565b91611bbb565b9a5b8d808080806103b3565b90926020823d602011610b44575b81610b31602093836117c0565b8101031261065057505191610b0a610ae6565b3d9150610b24565b60405162461bcd60e51b815260206004820152601760248201527f556e6d696e74656420746f6b656e20646f6e6174696f6e0000000000000000006044820152606490fd5b90506020813d602011610bbb575b81610bac602093836117c0565b8101031261014b57518e610ab3565b3d9150610b9f565b929e935093509560405190630240bc6b60e21b82526060826004818a5afa801561065b576000928391610d47575b50604051630dfe168160e01b8152906020826004818c5afa91821561065b576001600160701b03928d91600091610d28575b506001600160a01b031614938415610d215782815b169415610d1a57505b1682151580610d11575b15610ccc57610c7792610c5d92611bbb565b9d8e8380821115610cc257610c71916117f8565b92611bfb565b1015610b0c5760405162461bcd60e51b815260206004820152601b60248201527f4578697374696e6720706f6f6c207072696365206469666665727300000000006044820152606490fd5b90610c71916117f8565b60405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206578697374696e67207265736572766573000000000000006044820152606490fd5b50801515610c4b565b9050610c41565b8282610c38565b610d41915060203d60201161077f5761077081836117c0565b38610c23565b9290506060833d606011610d9a575b81610d63606093836117c0565b8101031261065057610d7483611ac3565b906040610d8360208601611ac3565b94015163ffffffff81160361065057509138610bf1565b3d9150610d56565b90506020813d602011610dcc575b81610dbd602093836117c0565b8101031261014b575138610a7f565b3d9150610db0565b610ded915060203d60201161077f5761077081836117c0565b89610355565b610e0c915060203d60201161077f5761077081836117c0565b846102c2565b60405162461bcd60e51b81526020600482015260156024820152744d6967726174696f6e20756e617661696c61626c6560581b6044820152606490fd5b506103e881111561026d565b50610e64611935565b610267565b3461014b57610e8e610e7a36611770565b610e8693919293611ad7565b42111561178a565b610e9782611985565b908115159081611079575b5015611049576040516370a0823160e01b8152306004820152917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811690602085602481855afa94851561065b57600095611014575b50602491610f148460209330903390611b2d565b6040516370a0823160e01b815230600482015292839182905afa90811561065b57600091610fe2575b5081610f4e602095610f54936117f8565b14611a58565b610f608160015461181b565b600155610f6f826002546117f8565b600255610f9d82337f0000000000000000000000000000000000000000000000000000000000000000611b78565b6040519060008252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b90506020813d60201161100c575b81610ffd602093836117c0565b8101031261014b575181610f3d565b3d9150610ff0565b9094506020813d602011611041575b81611030602093836117c0565b8101031261014b5751936024610f00565b3d9150611023565b60405162461bcd60e51b8152602060048201526008602482015267536c69707061676560c01b6044820152606490fd5b905081101583610ea2565b3461014b57600036600319011261014b57602060405161dead8152f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57600036600319011261014b576020600254604051908152f35b3461014b57600036600319011261014b57611113611ad7565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316148061130f575b806112ff575b156112c4576040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b038216602082602481845afa91821561065b5760009261128f575b509060206024926111dd7f0000000000000000000000000000000000000000000000000000000000000000809630903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b578392600091611256575b506112169291610f4e916117f8565b600160ff1960035416176003556040519081527f5af8184bef8e4b45eb9f6ed7734d04da38ced226495548f46e0c8ff8d7d9a52460203392a26001600055005b9250506020823d602011611287575b81611272602093836117c0565b8101031261014b579051829190611216611207565b3d9150611265565b91506020823d6020116112bc575b816112aa602093836117c0565b8101031261014b5790519060206111a7565b3d915061129d565b60405162461bcd60e51b815260206004820152601360248201527246756e64696e6720756e617661696c61626c6560681b6044820152606490fd5b5060ff60035460081c161561114b565b5060ff6003541615611145565b3461014b57602036600319011261014b57602061133a600435611985565b604051908152f35b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b57602061133a6002547f000000000000000000000000000000000000000000000000000000000000000061181b565b3461014b57600036600319011261014b5760206113e1611935565b6040519015158152f35b3461014b57602036600319011261014b576040611409600435611865565b82519182526020820152f35b3461014b5761143461143961142936611770565b610e86949194611ad7565b611865565b90918215159081611690575b81611685575b5015611640576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811691602081602481865afa91821561065b578591600093611607575b50926114be60209260249530903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b5784926000916115ce575b50906114f3916117f8565b03611589578161150760209360025461181b565b600255611516826001546117f8565b60015561154482337f0000000000000000000000000000000000000000000000000000000000000000611b78565b6040519060018252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d7461782071756f746520756e737570706f7274656400006044820152606490fd5b919250506020813d6020116115ff575b816115eb602093836117c0565b8101031261014b57518391906114f36114e8565b3d91506115de565b915091506020813d602011611638575b81611624602093836117c0565b8101031261014b57519084906114be6114aa565b3d9150611617565b60405162461bcd60e51b815260206004820152601a60248201527f536c697070616765206f722074617267657420726561636865640000000000006044820152606490fd5b90508110158361144b565b8215159150611445565b3461014b57600036600319011261014b57602060ff60035460081c166040519015158152f35b3461014b57600036600319011261014b576020600154604051908152f35b3461014b57600036600319011261014b5760035460405160109190911c6001600160a01b03168152602090f35b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b5760209060ff6003541615158152f35b606090600319011261014b57600435906024359060443590565b1561179157565b60405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b6044820152606490fd5b90601f8019910116810190811067ffffffffffffffff8211176117e257604052565b634e487b7160e01b600052604160045260246000fd5b9190820391821161180557565b634e487b7160e01b600052601160045260246000fd5b9190820180921161180557565b1561182f57565b60405162461bcd60e51b815260206004820152600e60248201526d437572766520696e61637469766560901b6044820152606490fd5b9061187d60035460ff81169081611926575b50611828565b600254916118ab837f00000000000000000000000000000000000000000000000000000000000000006117f8565b8082101561191e5750915b8215611915576119129061190c60015491611905866119007f0000000000000000000000000000000000000000000000000000000000000000936118fa818661181b565b9461181b565b61181b565b9083611bbb565b906117f8565b90565b50600091508190565b9050916118b6565b60ff915060081c161538611877565b60035460ff81169081611976575b508061194c5790565b506002547f0000000000000000000000000000000000000000000000000000000000000000111590565b60ff915060081c161538611943565b9060035460ff81169081611a49575b5080611a40575b6119a490611828565b6119f27f00000000000000000000000000000000000000000000000000000000000000009261190c600254946119da868261181b565b92610b046119eb886001549461181b565b918361181b565b9182116119fb57565b60405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e74207265616c2072657365727665000000000000006044820152606490fd5b5081151561199b565b60ff915060081c161538611994565b15611a5f57565b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d74617820746f6b656e20756e737570706f7274656400006044820152606490fd5b9081602091031261014b57516001600160a01b038116810361014b5790565b51906001600160701b038216820361014b57565b600260005414611ae8576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152611b7691611b716084836117c0565b611e97565b565b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044820192909252611b7691611b7182606481015b03601f1981018452836117c0565b9190611bc8828285611ca1565b928215611be55709611bd75790565b600181018091116118055790565b634e487b7160e01b600052601260045260246000fd5b60001982820982820291828083109203918083039214611c9657816127101115611c59577fbc01a36e2eb1c432ca57a786c226809d495182a9930be0ded288ce703afb7e9193612710910990828211900360fc1b910360041c170290565b60405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606490fd5b505061271091500490565b916000198284099282810292838086109503948086039514611d1c5784831115611c595782910960018219018216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b505080925015611be5570490565b60405163095ea7b360e01b60208201526001600160a01b03909216602483015260006044808401919091528252611b769190611b716064836117c0565b91909181158015611e16575b15611db25760405163095ea7b360e01b60208201526001600160a01b0390931660248401526044830191909152611b769190611b718260648101611bad565b60405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b50604051636eb1769f60e11b81523060048201526001600160a01b0384166024820152602081806044810103816001600160a01b0386165afa90811561065b57600091611e65575b5015611d73565b90506020813d602011611e8f575b81611e80602093836117c0565b8101031261014b575138611e5e565b3d9150611e73565b60018060a01b0316604091600080845192611eb286856117c0565b602084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602085015260208151910182865af13d15611fb8573d9067ffffffffffffffff82116117e2578451611f28949092611f19601f8201601f1916602001856117c0565b83523d6000602085013e611fc1565b8051908115918215611f95575b505015611f3f5750565b5162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b819250906020918101031261014b5760200151801515810361014b573880611f35565b91611f28926060915b919290156120235750815115611fd5575090565b3b15611fde5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156120365750805190602001fd5b6040519062461bcd60e51b8252602060048301528181519182602483015260005b8381106120795750508160006044809484010152601f80199101168101030190fd5b6020828201810151604487840101528593500161205756fea264697066735822122040220398d5fb0312dac1737b7a6f445145f8689e6334c06b2aa7d145df18e3f864736f6c634300081a0033000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a000000000000000000000000086cf2482f13bfcaad24ae55ae083f02ffbd8ef4000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d3000000000000000000000000000000000000000000000007f40f778ab3977963c0000000000000000000000000000000000000000000000000000000df8475800",
"receipt": {
"blockHash": "0x1784a98d9e9b844a0cdeacf07bd01e171094a706ec220c2dd1449f77a2ad674c",
"blockNumber": "0x10ff5",
"contractAddress": "0xec3adb83b157629fa0f3c166d34171293ede505a",
"cumulativeGasUsed": "0x1d7497",
"from": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"gasUsed": "0x1d7497",
"effectiveGasPrice": "0x2710",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": null,
"transactionHash": "0xda0da3408e1028decb5df655ddfcd73d6cd2ca835d57dca73d36e1b34bcec907",
"transactionIndex": "0x0",
"type": "0x2"
},
"logs": [],
"raw_transaction": {
"accessList": [],
"blockHash": "0x1784a98d9e9b844a0cdeacf07bd01e171094a706ec220c2dd1449f77a2ad674c",
"blockNumber": "0x10ff5",
"blockTimestamp": "0x6ac12fe4",
"chainId": "0x1352889",
"from": "0xdf6e7e94ed8c6fe335c28a8ec50381e9172f7d30",
"gas": "0x1db4ff",
"gasPrice": "0x2710",
"maxPriorityFeePerGas": "0x2710",
"maxFeePerGas": "0x2710",
"hash": "0xda0da3408e1028decb5df655ddfcd73d6cd2ca835d57dca73d36e1b34bcec907",
"input": "0x61016080604052346102695760c08161246c80380380916100208285610357565b8339810103126102695761003381610390565b9061004060208201610390565b9161004d60408301610390565b9261005a60608401610390565b608084015160a0909401516001600055946001600160a01b03838116949081169384861415918261034c575b5081610341575b5080610337575b80610325575b156102ef57841515806102d8575b806102cf575b806102b8575b156102825760049360209360805260a05260018060a01b0316908160c05260e0526040519283809263c45a015560e01b82525afa90811561027657600091610237575b503b1561020057806101005260015580610120528060011b90808204600214901517156101ea57610140526040516120c790816103a5823960805181818161011c015281816102da01528181610ebe015281816111650152611520015260a05181818161030501528181610f79015281816113580152611466015260c0518181816101660152610281015260e0518181816102350152818161111601526117210152610100518181816101e801526111b30152610120518181816101ad01528181610360015281816113a2015281816118d001526119a90152610140518181816110b90152818161188701526119520152f35b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b815260206004820152600f60248201526e496e76616c696420666163746f727960881b6044820152606490fd5b90506020813d60201161026e575b8161025260209383610357565b810103126102695761026390610390565b386100f7565b600080fd5b3d9150610245565b6040513d6000823e3d90fd5b60405162461bcd60e51b815260206004820152600e60248201526d5265736572766520626f756e647360901b6044820152606490fd5b506c0c9f2c9cd04674edea400000008611156100b4565b508515156100ae565b506c0c9f2c9cd04674edea400000008511156100a8565b60405162461bcd60e51b815260206004820152600e60248201526d496e76616c69642061737365747360901b6044820152606490fd5b506001600160a01b038216151561009a565b50803b1515610094565b90503b15153861008d565b3b1515915038610086565b601f909101601f19168101906001600160401b0382119082101761037a57604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036102695756fe608080604052600436101561001357600080fd5b60003560e01c90816302fb0c5e146117505750806316eebd1e1461170b57806316f0115b146116de5780631d3dad09146116c05780632c678c641461169a57806340993b26146114155780634beb394c146113eb5780636defbf80146113c657806380c08a5d14611387578063999b93af14611342578063a64190c41461131c578063b60d4288146110fa578063cb639322146110dc578063cd33f2bd146110a1578063d1ec980b14611084578063d3c9727c14610e69578063dd8ab0121461020b578063e5e0e016146101d0578063f393630114610195578063f887ea40146101505763fc0c546a1461010657600080fd5b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b600080fd5b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57602036600319011261014b5760043561ffff811680910361014b57610233611ad7565b7f000000000000000000000000000000000000000000000000000000000000000090336001600160a01b0383161480610e5b575b80610e4f575b15610e125760405163c45a015560e01b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690602081600481855afa90811561065b57600091610df3575b5060405163e6a4390560e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000818116600484018190527f000000000000000000000000000000000000000000000000000000000000000080841660248601819052989096909592949093919290911690602081604481855afa90811561065b57600091610dd4575b5060025497600154917f00000000000000000000000000000000000000000000000000000000000000009261039461038d8c8661181b565b828d611bbb565b9a6000946001600160a01b0384169486938615939290918f8515610a51575b50505050508b1515806109ea575b156109a6576000901561093157506000965b600091156108065750506000916103fb826103f18d6020958c611b78565b600254908c611b78565b6024604051809481936335313c2160e11b835261dead60048401525af190811561065b576000916107d4575b5097916002545b6002548114806107cb575b806107c2575b156107865760405163e6a4390560e01b81526001600160a01b0386811660048301528c16602482015291602090839060449082905afa91821561065b57600092610755575b506003805462010000600160b01b03198116601094851b62010000600160b01b0316908117928390559790939190911c6001600160a01b03168015159190826106d5575b50501561069e576024996105197fcb64f2436060c9575db20c5dcf9cdc11657017ee5b0301949f531b3dd7da6b199461010060209960609682600160b01b03191617179360ff19851660035561181b565b604080519687528887019190915285015260101c6001600160a01b031692a26040516370a0823160e01b815230600482015295869182905afa93841561065b57600094610667575b50602060249495604051958680926370a0823160e01b82523060048301525afa93841561065b57600094610602575b50918382869485604097957f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b996105f1575b505050816105e0575b50505082519182526020820152a16001600055005b6105e992611b78565b8481816105cb565b6105fa92611b78565b8785826105c2565b9091936020823d602011610653575b8161061e602093836117c0565b8101031261065057505192907f1e05d3d0f6890ff463fa7b90d4340c00191ff62cc7d607e313d6d32726f2294b610590565b80fd5b3d9150610611565b6040513d6000823e3d90fd5b94936020863d602011610696575b81610682602093836117c0565b810103126106505750935192936020610561565b3d9150610675565b60405162461bcd60e51b815260206004820152600f60248201526e4c50206275726e206d697373696e6760881b6044820152606490fd5b6040516370a0823160e01b815261dead60048201529250602090839060249082905afa801561065b578c9260009161071c575b5090610713916117f8565b10158c806104c8565b919250506020813d60201161074d575b81610739602093836117c0565b8101031261014b57518b9190610713610708565b3d915061072c565b61077891925060203d60201161077f575b61077081836117c0565b810190611aa4565b908b610484565b503d610766565b60405162461bcd60e51b815260206004820152601460248201527324b731b7b6b83632ba329036b4b3b930ba34b7b760611b6044820152606490fd5b5089151561043f565b50831515610439565b90506020813d6020116107fe575b816107ef602093836117c0565b8101031261014b57518a610427565b3d91506107e2565b80959350610817919b925088611d2a565b610822818589611d67565b61082c848a611d2a565b610839600254858b611d67565b600254600182111561092b576000198201828111610917575b6040519262e8e33760e81b84528760048501528d60248501526044840152816064840152608483015260a482015261dead60c48201524260e4820152606081610104818d885af1801561090c578a918b80926108c7575b50506108c2909a91946108bc818a611d2a565b8a611d2a565b61042e565b92509a505060608a3d606011610904575b816108e5606093836117c0565b810103126106505750885160208a01516040909a01516108c28d6108a9565b3d91506108d8565b6040513d8c823e3d90fd5b634e487b7160e01b8c52601160045260248cfd5b81610852565b6040516370a0823160e01b815261dead6004820152602081602481885afa91821561099a578092610965575b5050966103d3565b9091506020823d602011610992575b81610981602093836117c0565b810103126106505750518d8061095d565b3d9150610974565b604051903d90823e3d90fd5b606460405162461bcd60e51b815260206004820152602060248201527f4d6967726174696f6e20696e76656e746f727920696e73756666696369656e746044820152fd5b506040516370a0823160e01b81523060048201526020816024818b5afa90811561065b57600091610a1f575b508c11156103c1565b90506020813d602011610a49575b81610a3a602093836117c0565b8101031261014b57518e610a16565b3d9150610a2d565b909398929591949f506040516318160ddd60e01b81526020816004818c5afa90811561065b57600091610da2575b50610bc357505050506040516370a0823160e01b81528460048201526020816024818b5afa90811561065b57600091610b91575b50610b4c5760249160208e604051948580926370a0823160e01b82528960048301525afa92831561065b57600093610b16575b5090610b0a91610b048497610afe861515968261181b565b9361181b565b91611bbb565b9a5b8d808080806103b3565b90926020823d602011610b44575b81610b31602093836117c0565b8101031261065057505191610b0a610ae6565b3d9150610b24565b60405162461bcd60e51b815260206004820152601760248201527f556e6d696e74656420746f6b656e20646f6e6174696f6e0000000000000000006044820152606490fd5b90506020813d602011610bbb575b81610bac602093836117c0565b8101031261014b57518e610ab3565b3d9150610b9f565b929e935093509560405190630240bc6b60e21b82526060826004818a5afa801561065b576000928391610d47575b50604051630dfe168160e01b8152906020826004818c5afa91821561065b576001600160701b03928d91600091610d28575b506001600160a01b031614938415610d215782815b169415610d1a57505b1682151580610d11575b15610ccc57610c7792610c5d92611bbb565b9d8e8380821115610cc257610c71916117f8565b92611bfb565b1015610b0c5760405162461bcd60e51b815260206004820152601b60248201527f4578697374696e6720706f6f6c207072696365206469666665727300000000006044820152606490fd5b90610c71916117f8565b60405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206578697374696e67207265736572766573000000000000006044820152606490fd5b50801515610c4b565b9050610c41565b8282610c38565b610d41915060203d60201161077f5761077081836117c0565b38610c23565b9290506060833d606011610d9a575b81610d63606093836117c0565b8101031261065057610d7483611ac3565b906040610d8360208601611ac3565b94015163ffffffff81160361065057509138610bf1565b3d9150610d56565b90506020813d602011610dcc575b81610dbd602093836117c0565b8101031261014b575138610a7f565b3d9150610db0565b610ded915060203d60201161077f5761077081836117c0565b89610355565b610e0c915060203d60201161077f5761077081836117c0565b846102c2565b60405162461bcd60e51b81526020600482015260156024820152744d6967726174696f6e20756e617661696c61626c6560581b6044820152606490fd5b506103e881111561026d565b50610e64611935565b610267565b3461014b57610e8e610e7a36611770565b610e8693919293611ad7565b42111561178a565b610e9782611985565b908115159081611079575b5015611049576040516370a0823160e01b8152306004820152917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811690602085602481855afa94851561065b57600095611014575b50602491610f148460209330903390611b2d565b6040516370a0823160e01b815230600482015292839182905afa90811561065b57600091610fe2575b5081610f4e602095610f54936117f8565b14611a58565b610f608160015461181b565b600155610f6f826002546117f8565b600255610f9d82337f0000000000000000000000000000000000000000000000000000000000000000611b78565b6040519060008252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b90506020813d60201161100c575b81610ffd602093836117c0565b8101031261014b575181610f3d565b3d9150610ff0565b9094506020813d602011611041575b81611030602093836117c0565b8101031261014b5751936024610f00565b3d9150611023565b60405162461bcd60e51b8152602060048201526008602482015267536c69707061676560c01b6044820152606490fd5b905081101583610ea2565b3461014b57600036600319011261014b57602060405161dead8152f35b3461014b57600036600319011261014b5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014b57600036600319011261014b576020600254604051908152f35b3461014b57600036600319011261014b57611113611ad7565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316148061130f575b806112ff575b156112c4576040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b038216602082602481845afa91821561065b5760009261128f575b509060206024926111dd7f0000000000000000000000000000000000000000000000000000000000000000809630903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b578392600091611256575b506112169291610f4e916117f8565b600160ff1960035416176003556040519081527f5af8184bef8e4b45eb9f6ed7734d04da38ced226495548f46e0c8ff8d7d9a52460203392a26001600055005b9250506020823d602011611287575b81611272602093836117c0565b8101031261014b579051829190611216611207565b3d9150611265565b91506020823d6020116112bc575b816112aa602093836117c0565b8101031261014b5790519060206111a7565b3d915061129d565b60405162461bcd60e51b815260206004820152601360248201527246756e64696e6720756e617661696c61626c6560681b6044820152606490fd5b5060ff60035460081c161561114b565b5060ff6003541615611145565b3461014b57602036600319011261014b57602061133a600435611985565b604051908152f35b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b57602061133a6002547f000000000000000000000000000000000000000000000000000000000000000061181b565b3461014b57600036600319011261014b5760206113e1611935565b6040519015158152f35b3461014b57602036600319011261014b576040611409600435611865565b82519182526020820152f35b3461014b5761143461143961142936611770565b610e86949194611ad7565b611865565b90918215159081611690575b81611685575b5015611640576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03811691602081602481865afa91821561065b578591600093611607575b50926114be60209260249530903390611b2d565b6040516370a0823160e01b815230600482015293849182905afa801561065b5784926000916115ce575b50906114f3916117f8565b03611589578161150760209360025461181b565b600255611516826001546117f8565b60015561154482337f0000000000000000000000000000000000000000000000000000000000000000611b78565b6040519060018252838201528160408201527ff6462a0afa0880720a9b8317f39324757851bd340a51fe6fb4e94374975358e060603392a26001600055604051908152f35b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d7461782071756f746520756e737570706f7274656400006044820152606490fd5b919250506020813d6020116115ff575b816115eb602093836117c0565b8101031261014b57518391906114f36114e8565b3d91506115de565b915091506020813d602011611638575b81611624602093836117c0565b8101031261014b57519084906114be6114aa565b3d9150611617565b60405162461bcd60e51b815260206004820152601a60248201527f536c697070616765206f722074617267657420726561636865640000000000006044820152606490fd5b90508110158361144b565b8215159150611445565b3461014b57600036600319011261014b57602060ff60035460081c166040519015158152f35b3461014b57600036600319011261014b576020600154604051908152f35b3461014b57600036600319011261014b5760035460405160109190911c6001600160a01b03168152602090f35b3461014b57600036600319011261014b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461014b57600036600319011261014b5760209060ff6003541615158152f35b606090600319011261014b57600435906024359060443590565b1561179157565b60405162461bcd60e51b8152602060048201526007602482015266115e1c1a5c995960ca1b6044820152606490fd5b90601f8019910116810190811067ffffffffffffffff8211176117e257604052565b634e487b7160e01b600052604160045260246000fd5b9190820391821161180557565b634e487b7160e01b600052601160045260246000fd5b9190820180921161180557565b1561182f57565b60405162461bcd60e51b815260206004820152600e60248201526d437572766520696e61637469766560901b6044820152606490fd5b9061187d60035460ff81169081611926575b50611828565b600254916118ab837f00000000000000000000000000000000000000000000000000000000000000006117f8565b8082101561191e5750915b8215611915576119129061190c60015491611905866119007f0000000000000000000000000000000000000000000000000000000000000000936118fa818661181b565b9461181b565b61181b565b9083611bbb565b906117f8565b90565b50600091508190565b9050916118b6565b60ff915060081c161538611877565b60035460ff81169081611976575b508061194c5790565b506002547f0000000000000000000000000000000000000000000000000000000000000000111590565b60ff915060081c161538611943565b9060035460ff81169081611a49575b5080611a40575b6119a490611828565b6119f27f00000000000000000000000000000000000000000000000000000000000000009261190c600254946119da868261181b565b92610b046119eb886001549461181b565b918361181b565b9182116119fb57565b60405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e74207265616c2072657365727665000000000000006044820152606490fd5b5081151561199b565b60ff915060081c161538611994565b15611a5f57565b60405162461bcd60e51b815260206004820152601e60248201527f5472616e736665722d74617820746f6b656e20756e737570706f7274656400006044820152606490fd5b9081602091031261014b57516001600160a01b038116810361014b5790565b51906001600160701b038216820361014b57565b600260005414611ae8576002600055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152611b7691611b716084836117c0565b611e97565b565b60405163a9059cbb60e01b60208201526001600160a01b0390921660248301526044820192909252611b7691611b7182606481015b03601f1981018452836117c0565b9190611bc8828285611ca1565b928215611be55709611bd75790565b600181018091116118055790565b634e487b7160e01b600052601260045260246000fd5b60001982820982820291828083109203918083039214611c9657816127101115611c59577fbc01a36e2eb1c432ca57a786c226809d495182a9930be0ded288ce703afb7e9193612710910990828211900360fc1b910360041c170290565b60405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606490fd5b505061271091500490565b916000198284099282810292838086109503948086039514611d1c5784831115611c595782910960018219018216809204600281600302188082026002030280820260020302808202600203028082026002030280820260020302809102600203029360018380600003040190848311900302920304170290565b505080925015611be5570490565b60405163095ea7b360e01b60208201526001600160a01b03909216602483015260006044808401919091528252611b769190611b716064836117c0565b91909181158015611e16575b15611db25760405163095ea7b360e01b60208201526001600160a01b0390931660248401526044830191909152611b769190611b718260648101611bad565b60405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b50604051636eb1769f60e11b81523060048201526001600160a01b0384166024820152602081806044810103816001600160a01b0386165afa90811561065b57600091611e65575b5015611d73565b90506020813d602011611e8f575b81611e80602093836117c0565b8101031261014b575138611e5e565b3d9150611e73565b60018060a01b0316604091600080845192611eb286856117c0565b602084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564602085015260208151910182865af13d15611fb8573d9067ffffffffffffffff82116117e2578451611f28949092611f19601f8201601f1916602001856117c0565b83523d6000602085013e611fc1565b8051908115918215611f95575b505015611f3f5750565b5162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608490fd5b819250906020918101031261014b5760200151801515810361014b573880611f35565b91611f28926060915b919290156120235750815115611fd5575090565b3b15611fde5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156120365750805190602001fd5b6040519062461bcd60e51b8252602060048301528181519182602483015260005b8381106120795750508160006044809484010152601f80199101168101030190fd5b6020828201810151604487840101528593500161205756fea264697066735822122040220398d5fb0312dac1737b7a6f445145f8689e6334c06b2aa7d145df18e3f864736f6c634300081a0033000000000000000000000000f800bf07394e8290807b4ce579f4e9f99c3da869000000000000000000000000a28324ec703c1620ae798b1cd540bb90a2712d4a000000000000000000000000086cf2482f13bfcaad24ae55ae083f02ffbd8ef4000000000000000000000000df6e7e94ed8c6fe335c28a8ec50381e9172f7d3000000000000000000000000000000000000000000000007f40f778ab3977963c0000000000000000000000000000000000000000000000000000000df8475800",
"nonce": "0x95",
"to": null,
"transactionIndex": "0x0",
"type": "0x2",
"value": "0x0",
"yParity": "0x0",
"v": "0x0",
"r": "0x173c7c10ccf170eb886f08f04efbd42429ef32f03c7e21c5d7bd2a3a70a535ff",
"s": "0x78e0f0b32543aa55d662f9573e121256c68b59943aa2b21e02e1f3f1da1d277e"
}
}
}