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
@openzeppelin/contracts/utils/ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
assembly ("memory-safe") {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {toShortStringWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {toShortStringWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}
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.