Goerli Testnet

Contract

0x60C3aeEb3b8fade6dF3DFdC52A4630D492cDD7e7
Source Code

Overview

ETH Balance

0 ETH

Multi Chain

Multichain Addresses

N/A
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
101692222023-12-06 19:22:121 day 8 hrs ago1701890532
0x60C3ae...92cDD7e7
0 ETH
101692222023-12-06 19:22:121 day 8 hrs ago1701890532
0x60C3ae...92cDD7e7
0 ETH
101151482023-11-27 8:37:0010 days 19 hrs ago1701074220
0x60C3ae...92cDD7e7
0 ETH
100652572023-11-18 13:20:2419 days 14 hrs ago1700313624
0x60C3ae...92cDD7e7
0 ETH
100652572023-11-18 13:20:2419 days 14 hrs ago1700313624
0x60C3ae...92cDD7e7
0 ETH
100366852023-11-13 13:58:0024 days 13 hrs ago1699883880
0x60C3ae...92cDD7e7
0 ETH
100066252023-11-08 8:22:1229 days 19 hrs ago1699431732
0x60C3ae...92cDD7e7
0 ETH
100066252023-11-08 8:22:1229 days 19 hrs ago1699431732
0x60C3ae...92cDD7e7
0 ETH
99553792023-10-30 5:19:1238 days 22 hrs ago1698643152
0x60C3ae...92cDD7e7
0 ETH
99553792023-10-30 5:19:1238 days 22 hrs ago1698643152
0x60C3ae...92cDD7e7
0 ETH
99346472023-10-26 14:28:4842 days 13 hrs ago1698330528
0x60C3ae...92cDD7e7
0 ETH
99346392023-10-26 14:26:1242 days 13 hrs ago1698330372
0x60C3ae...92cDD7e7
0 ETH
99346392023-10-26 14:26:1242 days 13 hrs ago1698330372
0x60C3ae...92cDD7e7
0 ETH
99345972023-10-26 14:16:0042 days 13 hrs ago1698329760
0x60C3ae...92cDD7e7
0 ETH
99345972023-10-26 14:16:0042 days 13 hrs ago1698329760
0x60C3ae...92cDD7e7
0 ETH
99178442023-10-23 15:19:3645 days 12 hrs ago1698074376
0x60C3ae...92cDD7e7
0 ETH
99178442023-10-23 15:19:3645 days 12 hrs ago1698074376
0x60C3ae...92cDD7e7
0 ETH
99059082023-10-21 13:23:4847 days 14 hrs ago1697894628
0x60C3ae...92cDD7e7
0 ETH
99059082023-10-21 13:23:4847 days 14 hrs ago1697894628
0x60C3ae...92cDD7e7
0 ETH
98996652023-10-20 11:25:1248 days 16 hrs ago1697801112
0x60C3ae...92cDD7e7
0 ETH
98996652023-10-20 11:25:1248 days 16 hrs ago1697801112
0x60C3ae...92cDD7e7
0 ETH
98742512023-10-16 3:05:1253 days 33 mins ago1697425512
0x60C3ae...92cDD7e7
0 ETH
98742272023-10-16 2:58:2453 days 40 mins ago1697425104
0x60C3ae...92cDD7e7
0 ETH
98742272023-10-16 2:58:2453 days 40 mins ago1697425104
0x60C3ae...92cDD7e7
0 ETH
98541452023-10-12 14:41:2456 days 12 hrs ago1697121684
0x60C3ae...92cDD7e7
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ExponentialCurve

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : ExponentialCurve.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {ICurve} from "./ICurve.sol";
import {CurveErrorCodes} from "./CurveErrorCodes.sol";
import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol";

/**
 * @author 0xmons, boredGenius, 0xCygaar
 * @notice Bonding curve logic for an exponential curve, where each buy/sell changes spot price by multiplying/dividing delta
 */
contract ExponentialCurve is ICurve, CurveErrorCodes {
    using FixedPointMathLib for uint256;

    /**
     * @notice Minimum price to prevent numerical issues
     */
    uint256 public constant MIN_PRICE = 1000000 wei;

    /**
     * @dev See {ICurve-validateDelta}
     */
    function validateDelta(uint128 delta) external pure override returns (bool) {
        return delta > FixedPointMathLib.WAD;
    }

    /**
     * @dev See {ICurve-validateSpotPrice}
     */
    function validateSpotPrice(uint128 spotPrice) external pure override returns (bool) {
        return spotPrice >= MIN_PRICE;
    }

    /**
     * @dev See {ICurve-getBuyInfo}
     */
    function getBuyInfo(
        uint128 spotPrice,
        uint128 delta,
        uint256 numItems,
        uint256 feeMultiplier,
        uint256 protocolFeeMultiplier
    )
        external
        pure
        override
        returns (
            Error error,
            uint128 newSpotPrice,
            uint128 newDelta,
            uint256 inputValue,
            uint256 tradeFee,
            uint256 protocolFee
        )
    {
        // NOTE: we assume delta is > 1, as checked by validateDelta()
        // We only calculate changes for buying 1 or more NFTs
        if (numItems == 0) {
            return (Error.INVALID_NUMITEMS, 0, 0, 0, 0, 0);
        }

        uint256 deltaPowN = uint256(delta).rpow(numItems, FixedPointMathLib.WAD);

        // For an exponential curve, the spot price is multiplied by delta for each item bought
        uint256 newSpotPrice_ = uint256(spotPrice).mulWadUp(deltaPowN);
        if (newSpotPrice_ > type(uint128).max) {
            return (Error.SPOT_PRICE_OVERFLOW, 0, 0, 0, 0, 0);
        }
        newSpotPrice = uint128(newSpotPrice_);

        // Spot price is assumed to be the instant sell price. To avoid arbitraging LPs, we adjust the buy price upwards.
        // If spot price for buy and sell were the same, then someone could buy 1 NFT and then sell for immediate profit.
        // EX: Let S be spot price. Then buying 1 NFT costs S ETH, now new spot price is (S * delta).
        // The same person could then sell for (S * delta) ETH, netting them delta ETH profit.
        // If spot price for buy and sell differ by delta, then buying costs (S * delta) ETH.
        // The new spot price would become (S * delta), so selling would also yield (S * delta) ETH.
        uint256 buySpotPrice = uint256(spotPrice).mulWadUp(delta);

        // If the user buys n items, then the total cost is equal to:
        // buySpotPrice + (delta * buySpotPrice) + (delta^2 * buySpotPrice) + ... (delta^(numItems - 1) * buySpotPrice)
        // This is equal to buySpotPrice * (delta^n - 1) / (delta - 1)
        inputValue = buySpotPrice.mulWadUp((deltaPowN - FixedPointMathLib.WAD).divWadUp(delta - FixedPointMathLib.WAD));

        // Account for the protocol fee, a flat percentage of the buy amount
        protocolFee = inputValue.mulWadUp(protocolFeeMultiplier);

        // Account for the trade fee, only for TRADE pools
        tradeFee = inputValue.mulWadUp(feeMultiplier);

        // Add the protocol and trade fees to the required input amount
        inputValue += protocolFee + tradeFee;

        // Keep delta the same
        newDelta = delta;

        // If we got all the way here, no math error happened
        error = Error.OK;
    }

    /**
     * @dev See {ICurve-getSellInfo}
     * If newSpotPrice is less than MIN_PRICE, newSpotPrice is set to MIN_PRICE instead.
     * This is to prevent the spot price from ever becoming 0, which would decouple the price
     * from the bonding curve (since 0 * delta is still 0)
     */
    function getSellInfo(
        uint128 spotPrice,
        uint128 delta,
        uint256 numItems,
        uint256 feeMultiplier,
        uint256 protocolFeeMultiplier
    )
        external
        pure
        override
        returns (
            Error error,
            uint128 newSpotPrice,
            uint128 newDelta,
            uint256 outputValue,
            uint256 tradeFee,
            uint256 protocolFee
        )
    {
        // NOTE: we assume delta is > 1, as checked by validateDelta()

        // We only calculate changes for buying 1 or more NFTs
        if (numItems == 0) {
            return (Error.INVALID_NUMITEMS, 0, 0, 0, 0, 0);
        }

        uint256 invDelta = FixedPointMathLib.WAD.divWadDown(delta);
        uint256 invDeltaPowN = invDelta.rpow(numItems, FixedPointMathLib.WAD);

        // For an exponential curve, the spot price is divided by delta for each item sold
        // safe to convert newSpotPrice directly into uint128 since we know newSpotPrice <= spotPrice
        // and spotPrice <= type(uint128).max
        newSpotPrice = uint128(uint256(spotPrice).mulWadDown(invDeltaPowN));

        // Prevent getting stuck in a minimal price
        if (newSpotPrice < MIN_PRICE) {
            return (Error.SPOT_PRICE_UNDERFLOW, 0, 0, 0, 0, 0);
        }

        // If the user sells n items, then the total revenue is equal to:
        // spotPrice + ((1 / delta) * spotPrice) + ((1 / delta)^2 * spotPrice) + ... ((1 / delta)^(numItems - 1) * spotPrice)
        // This is equal to spotPrice * (1 - (1 / delta^n)) / (1 - (1 / delta))
        outputValue = uint256(spotPrice).mulWadDown(
            (FixedPointMathLib.WAD - invDeltaPowN).divWadDown(FixedPointMathLib.WAD - invDelta)
        );

        // Account for the protocol fee, a flat percentage of the sell amount
        protocolFee = outputValue.mulWadUp(protocolFeeMultiplier);

        // Account for the trade fee, only for TRADE pools
        tradeFee = outputValue.mulWadUp(feeMultiplier);

        // Remove the protocol and trade fees from the output amount
        outputValue -= (protocolFee + tradeFee);

        // Keep delta the same
        newDelta = delta;

        // If we got all the way here, no math error happened
        error = Error.OK;
    }
}

File 2 of 4 : ICurve.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {CurveErrorCodes} from "./CurveErrorCodes.sol";

interface ICurve {
    /**
     * @notice Validates if a delta value is valid for the curve. The criteria for
     * validity can be different for each type of curve, for instance ExponentialCurve
     * requires delta to be greater than 1.
     * @param delta The delta value to be validated
     * @return valid True if delta is valid, false otherwise
     */
    function validateDelta(uint128 delta) external pure returns (bool valid);

    /**
     * @notice Validates if a new spot price is valid for the curve. Spot price is generally assumed to be the immediate sell price of 1 NFT to the pool, in units of the pool's paired token.
     * @param newSpotPrice The new spot price to be set
     * @return valid True if the new spot price is valid, false otherwise
     */
    function validateSpotPrice(uint128 newSpotPrice) external view returns (bool valid);

    /**
     * @notice Given the current state of the pair and the trade, computes how much the user
     * should pay to purchase an NFT from the pair, the new spot price, and other values.
     * @param spotPrice The current selling spot price of the pair, in tokens
     * @param delta The delta parameter of the pair, what it means depends on the curve
     * @param numItems The number of NFTs the user is buying from the pair
     * @param feeMultiplier Determines how much fee the LP takes from this trade, 18 decimals
     * @param protocolFeeMultiplier Determines how much fee the protocol takes from this trade, 18 decimals
     * @return error Any math calculation errors, only Error.OK means the returned values are valid
     * @return newSpotPrice The updated selling spot price, in tokens
     * @return newDelta The updated delta, used to parameterize the bonding curve
     * @return inputValue The amount that the user should pay, in tokens
     * @return tradeFee The amount that is sent to the trade fee recipient
     * @return protocolFee The amount of fee to send to the protocol, in tokens
     */
    function getBuyInfo(
        uint128 spotPrice,
        uint128 delta,
        uint256 numItems,
        uint256 feeMultiplier,
        uint256 protocolFeeMultiplier
    )
        external
        view
        returns (
            CurveErrorCodes.Error error,
            uint128 newSpotPrice,
            uint128 newDelta,
            uint256 inputValue,
            uint256 tradeFee,
            uint256 protocolFee
        );

    /**
     * @notice Given the current state of the pair and the trade, computes how much the user
     * should receive when selling NFTs to the pair, the new spot price, and other values.
     * @param spotPrice The current selling spot price of the pair, in tokens
     * @param delta The delta parameter of the pair, what it means depends on the curve
     * @param numItems The number of NFTs the user is selling to the pair
     * @param feeMultiplier Determines how much fee the LP takes from this trade, 18 decimals
     * @param protocolFeeMultiplier Determines how much fee the protocol takes from this trade, 18 decimals
     * @return error Any math calculation errors, only Error.OK means the returned values are valid
     * @return newSpotPrice The updated selling spot price, in tokens
     * @return newDelta The updated delta, used to parameterize the bonding curve
     * @return outputValue The amount that the user should receive, in tokens
     * @return tradeFee The amount that is sent to the trade fee recipient
     * @return protocolFee The amount of fee to send to the protocol, in tokens
     */
    function getSellInfo(
        uint128 spotPrice,
        uint128 delta,
        uint256 numItems,
        uint256 feeMultiplier,
        uint256 protocolFeeMultiplier
    )
        external
        view
        returns (
            CurveErrorCodes.Error error,
            uint128 newSpotPrice,
            uint128 newDelta,
            uint256 outputValue,
            uint256 tradeFee,
            uint256 protocolFee
        );
}

File 3 of 4 : CurveErrorCodes.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

contract CurveErrorCodes {
    enum Error {
        OK, // No error
        INVALID_NUMITEMS, // The numItem value is 0
        SPOT_PRICE_OVERFLOW, // The updated spot price doesn't fit into 128 bits
        DELTA_OVERFLOW, // The updated delta doesn't fit into 128 bits
        SPOT_PRICE_UNDERFLOW // The updated spot price goes too low
    }
}

File 4 of 4 : FixedPointMathLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
    /*//////////////////////////////////////////////////////////////
                    SIMPLIFIED FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    uint256 internal constant MAX_UINT256 = 2**256 - 1;

    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.

    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
    }

    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
    }

    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
    }

    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
    }

    /*//////////////////////////////////////////////////////////////
                    LOW LEVEL FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
            if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
                revert(0, 0)
            }

            // Divide x * y by the denominator.
            z := div(mul(x, y), denominator)
        }
    }

    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y))
            if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) {
                revert(0, 0)
            }

            // If x * y modulo the denominator is strictly greater than 0,
            // 1 is added to round up the division of x * y by the denominator.
            z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator))
        }
    }

    function rpow(
        uint256 x,
        uint256 n,
        uint256 scalar
    ) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            switch x
            case 0 {
                switch n
                case 0 {
                    // 0 ** 0 = 1
                    z := scalar
                }
                default {
                    // 0 ** n = 0
                    z := 0
                }
            }
            default {
                switch mod(n, 2)
                case 0 {
                    // If n is even, store scalar in z for now.
                    z := scalar
                }
                default {
                    // If n is odd, store x in z for now.
                    z := x
                }

                // Shifting right by 1 is like dividing by 2.
                let half := shr(1, scalar)

                for {
                    // Shift n right by 1 before looping to halve it.
                    n := shr(1, n)
                } n {
                    // Shift n right by 1 each iteration to halve it.
                    n := shr(1, n)
                } {
                    // Revert immediately if x ** 2 would overflow.
                    // Equivalent to iszero(eq(div(xx, x), x)) here.
                    if shr(128, x) {
                        revert(0, 0)
                    }

                    // Store x squared.
                    let xx := mul(x, x)

                    // Round to the nearest number.
                    let xxRound := add(xx, half)

                    // Revert if xx + half overflowed.
                    if lt(xxRound, xx) {
                        revert(0, 0)
                    }

                    // Set x to scaled xxRound.
                    x := div(xxRound, scalar)

                    // If n is even:
                    if mod(n, 2) {
                        // Compute z * x.
                        let zx := mul(z, x)

                        // If z * x overflowed:
                        if iszero(eq(div(zx, x), z)) {
                            // Revert if x is non-zero.
                            if iszero(iszero(x)) {
                                revert(0, 0)
                            }
                        }

                        // Round to the nearest number.
                        let zxRound := add(zx, half)

                        // Revert if zx + half overflowed.
                        if lt(zxRound, zx) {
                            revert(0, 0)
                        }

                        // Return properly scaled zxRound.
                        z := div(zxRound, scalar)
                    }
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                        GENERAL NUMBER UTILITIES
    //////////////////////////////////////////////////////////////*/

    function sqrt(uint256 x) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            let y := x // We start y at x, which will help us make our initial estimate.

            z := 181 // The "correct" value is 1, but this saves a multiplication later.

            // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
            // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.

            // We check y >= 2^(k + 8) but shift right by k bits
            // each branch to ensure that if x >= 256, then y >= 256.
            if iszero(lt(y, 0x10000000000000000000000000000000000)) {
                y := shr(128, y)
                z := shl(64, z)
            }
            if iszero(lt(y, 0x1000000000000000000)) {
                y := shr(64, y)
                z := shl(32, z)
            }
            if iszero(lt(y, 0x10000000000)) {
                y := shr(32, y)
                z := shl(16, z)
            }
            if iszero(lt(y, 0x1000000)) {
                y := shr(16, y)
                z := shl(8, z)
            }

            // Goal was to get z*z*y within a small factor of x. More iterations could
            // get y in a tighter range. Currently, we will have y in [256, 256*2^16).
            // We ensured y >= 256 so that the relative difference between y and y+1 is small.
            // That's not possible if x < 256 but we can just verify those cases exhaustively.

            // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
            // Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
            // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.

            // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
            // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.

            // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
            // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.

            // There is no overflow risk here since y < 2^136 after the first branch above.
            z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.

            // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))

            // If x+1 is a perfect square, the Babylonian method cycles between
            // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
            // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
            // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
            // If you don't care whether the floor or ceil square root is returned, you can remove this statement.
            z := sub(z, lt(div(x, z), z))
        }
    }

    function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            // Mod x by y. Note this will return
            // 0 instead of reverting if y is zero.
            z := mod(x, y)
        }
    }

    function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
        /// @solidity memory-safe-assembly
        assembly {
            // Divide x by y. Note this will return
            // 0 instead of reverting if y is zero.
            r := div(x, y)
        }
    }

    function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            // Add 1 to x * y if x % y > 0. Note this will
            // return 0 instead of reverting if y is zero.
            z := add(gt(mod(x, y), 0), div(x, y))
        }
    }
}

Settings
{
  "remappings": [
    "@manifoldxyz/=lib/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@prb/math/=lib/prb-math/src/",
    "clones-with-immutable-args/=lib/clones-with-immutable-args/src/",
    "create3-factory/=lib/create3-factory/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "libraries-solidity/=lib/libraries-solidity/contracts/",
    "manifoldxyz/=lib/royalty-registry-solidity/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "royalty-registry-solidity/=lib/royalty-registry-solidity/contracts/",
    "solmate/=lib/solmate/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract ABI

[{"inputs":[],"name":"MIN_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"spotPrice","type":"uint128"},{"internalType":"uint128","name":"delta","type":"uint128"},{"internalType":"uint256","name":"numItems","type":"uint256"},{"internalType":"uint256","name":"feeMultiplier","type":"uint256"},{"internalType":"uint256","name":"protocolFeeMultiplier","type":"uint256"}],"name":"getBuyInfo","outputs":[{"internalType":"enum CurveErrorCodes.Error","name":"error","type":"uint8"},{"internalType":"uint128","name":"newSpotPrice","type":"uint128"},{"internalType":"uint128","name":"newDelta","type":"uint128"},{"internalType":"uint256","name":"inputValue","type":"uint256"},{"internalType":"uint256","name":"tradeFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint128","name":"spotPrice","type":"uint128"},{"internalType":"uint128","name":"delta","type":"uint128"},{"internalType":"uint256","name":"numItems","type":"uint256"},{"internalType":"uint256","name":"feeMultiplier","type":"uint256"},{"internalType":"uint256","name":"protocolFeeMultiplier","type":"uint256"}],"name":"getSellInfo","outputs":[{"internalType":"enum CurveErrorCodes.Error","name":"error","type":"uint8"},{"internalType":"uint128","name":"newSpotPrice","type":"uint128"},{"internalType":"uint128","name":"newDelta","type":"uint128"},{"internalType":"uint256","name":"outputValue","type":"uint256"},{"internalType":"uint256","name":"tradeFee","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint128","name":"delta","type":"uint128"}],"name":"validateDelta","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint128","name":"spotPrice","type":"uint128"}],"name":"validateSpotPrice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50610704806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80637ca542ac116100505780637ca542ac146100d9578063a1bbb2e8146100ec578063ad9f20a61461011757600080fd5b8063097cc63d1461006c5780630ae67ccc1461009a575b600080fd5b61007f61007a36600461059d565b61012f565b604051610091969594939291906105ea565b60405180910390f35b6100c96100a836600461065e565b670de0b6b3a76400006fffffffffffffffffffffffffffffffff9091161190565b6040519015158152602001610091565b61007f6100e736600461059d565b61027f565b6100c96100fa36600461065e565b620f42406fffffffffffffffffffffffffffffffff909116101590565b610121620f424081565b604051908152602001610091565b600080600080600080886000036101585750600194506000935083925082915081905080610272565b600061017e670de0b6b3a76400006fffffffffffffffffffffffffffffffff8d166103dd565b90506000610195828c670de0b6b3a76400006103fb565b90506101b36fffffffffffffffffffffffffffffffff8e16826104b9565b9650620f4240876fffffffffffffffffffffffffffffffff1610156101ef57600460008060008060009750975097509750975097505050610272565b61023861021f61020784670de0b6b3a76400006106a8565b61021984670de0b6b3a76400006106a8565b906103dd565b6fffffffffffffffffffffffffffffffff8f16906104b9565b9450610244858a6104ce565b9250610250858b6104ce565b935061025c84846106bb565b61026690866106a8565b94508b95506000975050505b9550955095509550955095565b600080600080600080886000036102a85750600194506000935083925082915081905080610272565b60006102cf6fffffffffffffffffffffffffffffffff8c168b670de0b6b3a76400006103fb565b905060006102ef6fffffffffffffffffffffffffffffffff8e16836104ce565b90506fffffffffffffffffffffffffffffffff81111561032657600260008060008060009750975097509750975097505050610272565b955085600061034a6fffffffffffffffffffffffffffffffff8f8116908f166104ce565b9050610397610390670de0b6b3a76400008f6fffffffffffffffffffffffffffffffff1661037891906106a8565b61038a670de0b6b3a7640000876106a8565b906104e3565b82906104ce565b95506103a3868b6104ce565b93506103af868c6104ce565b94506103bb85856106bb565b6103c590876106bb565b60009f989e509b509399509197509495505050505050565b60006103f283670de0b6b3a7640000846104f8565b90505b92915050565b600083801561049b576001841680156104165785925061041a565b8392505b508260011c8460011c94505b8415610495578560801c1561043a57600080fd5b8586028181018181101561044d57600080fd5b859004965050600185161561048a57858302838782041461047357861561047357600080fd5b8181018181101561048357600080fd5b8590049350505b8460011c9450610426565b506104b1565b8380156104ab57600092506104af565b8392505b505b509392505050565b60006103f28383670de0b6b3a76400006104f8565b60006103f28383670de0b6b3a7640000610534565b60006103f283670de0b6b3a764000084610534565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261052d57600080fd5b5091020490565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261056957600080fd5b50910281810615159190040190565b80356fffffffffffffffffffffffffffffffff8116811461059857600080fd5b919050565b600080600080600060a086880312156105b557600080fd5b6105be86610578565b94506105cc60208701610578565b94979496505050506040830135926060810135926080909101359150565b60c0810160058810610625577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9681526fffffffffffffffffffffffffffffffff95861660208201529390941660408401526060830191909152608082015260a0015290565b60006020828403121561067057600080fd5b6103f282610578565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156103f5576103f5610679565b808201808211156103f5576103f561067956fea26469706673582212205b5b8df45f26b2d0256a40c6bf1603e637ba3ae3bf015b41cf746b35f75e216064736f6c63430008140033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100675760003560e01c80637ca542ac116100505780637ca542ac146100d9578063a1bbb2e8146100ec578063ad9f20a61461011757600080fd5b8063097cc63d1461006c5780630ae67ccc1461009a575b600080fd5b61007f61007a36600461059d565b61012f565b604051610091969594939291906105ea565b60405180910390f35b6100c96100a836600461065e565b670de0b6b3a76400006fffffffffffffffffffffffffffffffff9091161190565b6040519015158152602001610091565b61007f6100e736600461059d565b61027f565b6100c96100fa36600461065e565b620f42406fffffffffffffffffffffffffffffffff909116101590565b610121620f424081565b604051908152602001610091565b600080600080600080886000036101585750600194506000935083925082915081905080610272565b600061017e670de0b6b3a76400006fffffffffffffffffffffffffffffffff8d166103dd565b90506000610195828c670de0b6b3a76400006103fb565b90506101b36fffffffffffffffffffffffffffffffff8e16826104b9565b9650620f4240876fffffffffffffffffffffffffffffffff1610156101ef57600460008060008060009750975097509750975097505050610272565b61023861021f61020784670de0b6b3a76400006106a8565b61021984670de0b6b3a76400006106a8565b906103dd565b6fffffffffffffffffffffffffffffffff8f16906104b9565b9450610244858a6104ce565b9250610250858b6104ce565b935061025c84846106bb565b61026690866106a8565b94508b95506000975050505b9550955095509550955095565b600080600080600080886000036102a85750600194506000935083925082915081905080610272565b60006102cf6fffffffffffffffffffffffffffffffff8c168b670de0b6b3a76400006103fb565b905060006102ef6fffffffffffffffffffffffffffffffff8e16836104ce565b90506fffffffffffffffffffffffffffffffff81111561032657600260008060008060009750975097509750975097505050610272565b955085600061034a6fffffffffffffffffffffffffffffffff8f8116908f166104ce565b9050610397610390670de0b6b3a76400008f6fffffffffffffffffffffffffffffffff1661037891906106a8565b61038a670de0b6b3a7640000876106a8565b906104e3565b82906104ce565b95506103a3868b6104ce565b93506103af868c6104ce565b94506103bb85856106bb565b6103c590876106bb565b60009f989e509b509399509197509495505050505050565b60006103f283670de0b6b3a7640000846104f8565b90505b92915050565b600083801561049b576001841680156104165785925061041a565b8392505b508260011c8460011c94505b8415610495578560801c1561043a57600080fd5b8586028181018181101561044d57600080fd5b859004965050600185161561048a57858302838782041461047357861561047357600080fd5b8181018181101561048357600080fd5b8590049350505b8460011c9450610426565b506104b1565b8380156104ab57600092506104af565b8392505b505b509392505050565b60006103f28383670de0b6b3a76400006104f8565b60006103f28383670de0b6b3a7640000610534565b60006103f283670de0b6b3a764000084610534565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261052d57600080fd5b5091020490565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261056957600080fd5b50910281810615159190040190565b80356fffffffffffffffffffffffffffffffff8116811461059857600080fd5b919050565b600080600080600060a086880312156105b557600080fd5b6105be86610578565b94506105cc60208701610578565b94979496505050506040830135926060810135926080909101359150565b60c0810160058810610625577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9681526fffffffffffffffffffffffffffffffff95861660208201529390941660408401526060830191909152608082015260a0015290565b60006020828403121561067057600080fd5b6103f282610578565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156103f5576103f5610679565b808201808211156103f5576103f561067956fea26469706673582212205b5b8df45f26b2d0256a40c6bf1603e637ba3ae3bf015b41cf746b35f75e216064736f6c63430008140033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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