Verified contractExactLicenseRef-Gyro-1.0
Gyro2CLPPool
Address0xdeba7d498ccf617c06f53ee110c2cfc65cec0ece
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.27
- Same code
Only this contract
Details
- Compiler
- solc 0.8.27+commit.40a35a09
- Language
- solidity
- Optimization
- Yes, 9,999 runs
- EVM version
- cancun
- Via IR
- yes
- License
- LicenseRef-Gyro-1.0
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 24,349,799
- Creation transaction
- 0x2d4f1b89df…0829c3bcb3
54 files
The source code is large: one file is shown at a time. Choose a file in the list.
- contracts/Gyro2CLPPool.solmain11.15 KB
- @balancer-labs/v3-interfaces/contracts/pool-gyro/IGyro2CLPPool.sol3.55 KB
- @balancer-labs/v3-interfaces/contracts/pool-utils/IPoolInfo.sol2.92 KB
- @balancer-labs/v3-interfaces/contracts/solidity-utils/helpers/IAuthentication.sol608 B
- @balancer-labs/v3-interfaces/contracts/solidity-utils/helpers/IRateProvider.sol795 B
- @balancer-labs/v3-interfaces/contracts/solidity-utils/helpers/IVersion.sol657 B
- @balancer-labs/v3-interfaces/contracts/vault/IAuthorizer.sol625 B
- @balancer-labs/v3-interfaces/contracts/vault/IBasePool.sol4.55 KB
- @balancer-labs/v3-interfaces/contracts/vault/IHooks.sol13.27 KB
- @balancer-labs/v3-interfaces/contracts/vault/IProtocolFeeController.sol20.01 KB
- @balancer-labs/v3-interfaces/contracts/vault/ISwapFeePercentageBounds.sol1.51 KB
- @balancer-labs/v3-interfaces/contracts/vault/IUnbalancedLiquidityInvariantRatioBounds.sol1.38 KB
- @balancer-labs/v3-interfaces/contracts/vault/IVault.sol767 B
- @balancer-labs/v3-interfaces/contracts/vault/IVaultAdmin.sol23.61 KB
- @balancer-labs/v3-interfaces/contracts/vault/IVaultErrors.sol18.66 KB
- @balancer-labs/v3-interfaces/contracts/vault/IVaultEvents.sol11.07 KB
- @balancer-labs/v3-interfaces/contracts/vault/IVaultExtension.sol23.74 KB
- @balancer-labs/v3-interfaces/contracts/vault/IVaultMain.sol9.54 KB
- @balancer-labs/v3-interfaces/contracts/vault/VaultTypes.sol19.94 KB
- @balancer-labs/v3-pool-utils/contracts/PoolInfo.sol2.14 KB
- @balancer-labs/v3-solidity-utils/contracts/helpers/Version.sol1.19 KB
- @balancer-labs/v3-solidity-utils/contracts/math/FixedPoint.sol5.93 KB
- @balancer-labs/v3-solidity-utils/contracts/math/LogExpMath.sol22.49 KB
- @balancer-labs/v3-vault/contracts/BalancerPoolToken.sol7.14 KB
- @balancer-labs/v3-vault/contracts/VaultGuard.sol677 B
- @openzeppelin/contracts/interfaces/IERC1363.sol4.45 KB
- @openzeppelin/contracts/interfaces/IERC165.sol193 B
- @openzeppelin/contracts/interfaces/IERC20.sol182 B
- @openzeppelin/contracts/interfaces/IERC4626.sol12.18 KB
- @openzeppelin/contracts/interfaces/IERC5267.sol740 B
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6.54 KB
- @openzeppelin/contracts/proxy/Proxy.sol2.67 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol684 B
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3.81 KB
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol10.08 KB
- @openzeppelin/contracts/utils/Address.sol6 KB
- @openzeppelin/contracts/utils/Create2.sol4.47 KB
- @openzeppelin/contracts/utils/Errors.sol896 B
- @openzeppelin/contracts/utils/Nonces.sol1.49 KB
- @openzeppelin/contracts/utils/Panic.sol1.97 KB
- @openzeppelin/contracts/utils/ShortStrings.sol4.3 KB
- @openzeppelin/contracts/utils/StorageSlot.sol4.18 KB
- @openzeppelin/contracts/utils/Strings.sol19.28 KB
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol7.82 KB
- @openzeppelin/contracts/utils/cryptography/EIP712.sol6.7 KB
- @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol4.25 KB
- @openzeppelin/contracts/utils/introspection/ERC165.sol879 B
- @openzeppelin/contracts/utils/introspection/IERC165.sol871 B
- @openzeppelin/contracts/utils/math/Math.sol32.15 KB
- @openzeppelin/contracts/utils/math/SafeCast.sol34.94 KB
- @openzeppelin/contracts/utils/math/SignedMath.sol2.61 KB
- contracts/lib/Gyro2CLPMath.sol13.6 KB
- contracts/lib/GyroPoolMath.sol5.01 KB
@balancer-labs/v3-interfaces/contracts/vault/IBasePool.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.24;
import { IUnbalancedLiquidityInvariantRatioBounds } from "./IUnbalancedLiquidityInvariantRatioBounds.sol";
import { ISwapFeePercentageBounds } from "./ISwapFeePercentageBounds.sol";
import { PoolSwapParams, Rounding, SwapKind } from "./VaultTypes.sol";
/**
* @notice Base interface for a Balancer Pool.
* @dev All pool types should implement this interface. Note that it also requires implementation of:
* - `ISwapFeePercentageBounds` to specify the minimum and maximum swap fee percentages.
* - `IUnbalancedLiquidityInvariantRatioBounds` to specify how much the invariant can change during an unbalanced
* liquidity operation.
*/
interface IBasePool is ISwapFeePercentageBounds, IUnbalancedLiquidityInvariantRatioBounds {
/***************************************************************************
Invariant
***************************************************************************/
/**
* @notice Computes the pool's invariant.
* @dev This function computes the invariant based on current balances (and potentially other pool state).
* The rounding direction must be respected for the Vault to round in the pool's favor when calling this function.
* If the invariant computation involves no precision loss (e.g. simple sum of balances), the same result can be
* returned for both rounding directions.
*
* You can think of the invariant as a measure of the "value" of the pool, which is related to the total liquidity
* (i.e., the "BPT rate" is `invariant` / `totalSupply`). Two critical properties must hold:
*
* 1) The invariant should not change due to a swap. In practice, it can *increase* due to swap fees, which
* effectively add liquidity after the swap - but it should never decrease.
*
* 2) The invariant must be "linear"; i.e., increasing the balances proportionally must increase the invariant in
* the same proportion: inv(a * n, b * n, c * n) = inv(a, b, c) * n
*
* Property #1 is required to prevent "round trip" paths that drain value from the pool (and all LP shareholders).
* Intuitively, an accurate pricing algorithm ensures the user gets an equal value of token out given token in, so
* the total value should not change.
*
* Property #2 is essential for the "fungibility" of LP shares. If it did not hold, then different users depositing
* the same total value would get a different number of LP shares. In that case, LP shares would not be
* interchangeable, as they must be in a fair DEX.
*
* @param balancesLiveScaled18 Token balances after paying yield fees, applying decimal scaling and rates
* @param rounding Rounding direction to consider when computing the invariant
* @return invariant The calculated invariant of the pool, represented as a uint256
*/
function computeInvariant(
uint256[] memory balancesLiveScaled18,
Rounding rounding
) external view returns (uint256 invariant);
/**
* @notice Computes a new token balance, given the invariant growth ratio and all other balances.
* @dev Similar to V2's `_getTokenBalanceGivenInvariantAndAllOtherBalances` in StableMath.
* The pool must round up for the Vault to round in the protocol's favor when calling this function.
*
* @param balancesLiveScaled18 Token balances after paying yield fees, applying decimal scaling and rates
* @param tokenInIndex The index of the token we're computing the balance for, sorted in token registration order
* @param invariantRatio The ratio of the new invariant (after an operation) to the old
* @return newBalance The new balance of the selected token, after the operation
*/
function computeBalance(
uint256[] memory balancesLiveScaled18,
uint256 tokenInIndex,
uint256 invariantRatio
) external view returns (uint256 newBalance);
/***************************************************************************
Swaps
***************************************************************************/
/**
* @notice Execute a swap in the pool.
* @param params Swap parameters (see above for struct definition)
* @return amountCalculatedScaled18 Calculated amount for the swap operation
*/
function onSwap(PoolSwapParams calldata params) external returns (uint256 amountCalculatedScaled18);
}
Compiler settingsShow
{
"viaIR": true,
"optimizer": {
"runs": 9999,
"details": {
"yulDetails": {
"optimizerSteps": "dhfoDgvulfnTUtnIf [ xa[r]EscLM cCTUtTOntnfDIul Lcul Vcul [j] Tpeul xa[rul] xa[r]cL gvif CTUca[r]LSsTFOtfDnca[r]Iulc ] jmul[jul] VcTOcul jmul : fDnTOcmu"
}
},
"enabled": true
},
"evmVersion": "cancun"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.