Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create gyro E-CLP on v3 #570

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3f003e6
feat: Add GyroECLP create and tests.
johngrantuk Jan 22, 2025
6026b95
feat: Add GyroECLP create and init validation.
johngrantuk Jan 22, 2025
a29371e
merge latest from main
MattPereira Feb 27, 2025
2732298
update addresses and abi
MattPereira Feb 27, 2025
7c3814b
refactor type for tokens of create pool inputs
MattPereira Feb 28, 2025
2971e5f
Merge branch 'main' into v3-gyro-eclp
MattPereira Feb 28, 2025
6c13162
undo part of refactor to avoid scope creep
MattPereira Feb 28, 2025
626c42d
fix gyro ECLP integration test
MattPereira Feb 28, 2025
1911d04
validate gyroECLP params
MattPereira Mar 1, 2025
42758e1
add full param validation for gyroECLP pool creation
MattPereira Mar 1, 2025
1be67ea
add input validation tests for gyro ECLP creation input
MattPereira Mar 2, 2025
4d947a2
add longer timeouts for create gyroE integration test
MattPereira Mar 2, 2025
0bda744
fix test timeout
MattPereira Mar 2, 2025
084d78c
check biome version in CI
MattPereira Mar 2, 2025
8a829f6
check biome version after actions checkout
MattPereira Mar 2, 2025
cc4bf62
fix lock file version of biome
MattPereira Mar 2, 2025
f3903ea
try fixing lockfile another way
MattPereira Mar 2, 2025
9d4e097
log biome version in Lint check
MattPereira Mar 2, 2025
53cd654
clean up input validations
MattPereira Mar 3, 2025
f26e781
install with pnpm version 8.6.0
MattPereira Mar 4, 2025
5896ae5
revert lockfile to main branch commit, then install balancer maths
MattPereira Mar 4, 2025
e89d980
use maths pkg for ECLP validations
MattPereira Mar 5, 2025
21e841e
fix eclp input validation tests
MattPereira Mar 5, 2025
7fc01a9
add changeset
MattPereira Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slow-geese-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@balancer/sdk": minor
---

create gyro E-CLP on v3
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"files": [
"dist/"
],
"files": ["dist/"],
"scripts": {
"build": "tsup",
"format": "biome format --write .",
Expand All @@ -28,6 +26,7 @@
"example": "npx tsx ./examples/lib/executeExample.ts"
},
"dependencies": {
"@balancer-labs/balancer-maths": "0.0.24",
"decimal.js-light": "^2.5.1",
"lodash.clonedeep": "^4.5.0",
"viem": "^2.22.3"
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

339 changes: 339 additions & 0 deletions src/abi/gyroECLPPoolFactory.V3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
export const gyroECLPPoolFactoryAbi_V3 = [
{
inputs: [
{ internalType: 'contract IVault', name: 'vault', type: 'address' },
{
internalType: 'uint32',
name: 'pauseWindowDuration',
type: 'uint32',
},
{ internalType: 'string', name: 'factoryVersion', type: 'string' },
{ internalType: 'string', name: 'poolVersion', type: 'string' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{ inputs: [], name: 'Create2EmptyBytecode', type: 'error' },
{ inputs: [], name: 'Create2FailedDeployment', type: 'error' },
{
inputs: [
{ internalType: 'uint256', name: 'balance', type: 'uint256' },
{ internalType: 'uint256', name: 'needed', type: 'uint256' },
],
name: 'Create2InsufficientBalance',
type: 'error',
},
{ inputs: [], name: 'Disabled', type: 'error' },
{ inputs: [], name: 'IndexOutOfBounds', type: 'error' },
{ inputs: [], name: 'PoolPauseWindowDurationOverflow', type: 'error' },
{ inputs: [], name: 'SenderNotAllowed', type: 'error' },
{ inputs: [], name: 'StandardPoolWithCreator', type: 'error' },
{ inputs: [], name: 'SupportsOnlyTwoTokens', type: 'error' },
{ anonymous: false, inputs: [], name: 'FactoryDisabled', type: 'event' },
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'pool',
type: 'address',
},
],
name: 'PoolCreated',
type: 'event',
},
{
inputs: [
{ internalType: 'string', name: 'name', type: 'string' },
{ internalType: 'string', name: 'symbol', type: 'string' },
{
components: [
{
internalType: 'contract IERC20',
name: 'token',
type: 'address',
},
{
internalType: 'enum TokenType',
name: 'tokenType',
type: 'uint8',
},
{
internalType: 'contract IRateProvider',
name: 'rateProvider',
type: 'address',
},
{
internalType: 'bool',
name: 'paysYieldFees',
type: 'bool',
},
],
internalType: 'struct TokenConfig[]',
name: 'tokens',
type: 'tuple[]',
},
{
components: [
{ internalType: 'int256', name: 'alpha', type: 'int256' },
{ internalType: 'int256', name: 'beta', type: 'int256' },
{ internalType: 'int256', name: 'c', type: 'int256' },
{ internalType: 'int256', name: 's', type: 'int256' },
{ internalType: 'int256', name: 'lambda', type: 'int256' },
],
internalType: 'struct IGyroECLPPool.EclpParams',
name: 'eclpParams',
type: 'tuple',
},
{
components: [
{
components: [
{
internalType: 'int256',
name: 'x',
type: 'int256',
},
{
internalType: 'int256',
name: 'y',
type: 'int256',
},
],
internalType: 'struct IGyroECLPPool.Vector2',
name: 'tauAlpha',
type: 'tuple',
},
{
components: [
{
internalType: 'int256',
name: 'x',
type: 'int256',
},
{
internalType: 'int256',
name: 'y',
type: 'int256',
},
],
internalType: 'struct IGyroECLPPool.Vector2',
name: 'tauBeta',
type: 'tuple',
},
{ internalType: 'int256', name: 'u', type: 'int256' },
{ internalType: 'int256', name: 'v', type: 'int256' },
{ internalType: 'int256', name: 'w', type: 'int256' },
{ internalType: 'int256', name: 'z', type: 'int256' },
{ internalType: 'int256', name: 'dSq', type: 'int256' },
],
internalType: 'struct IGyroECLPPool.DerivedEclpParams',
name: 'derivedEclpParams',
type: 'tuple',
},
{
components: [
{
internalType: 'address',
name: 'pauseManager',
type: 'address',
},
{
internalType: 'address',
name: 'swapFeeManager',
type: 'address',
},
{
internalType: 'address',
name: 'poolCreator',
type: 'address',
},
],
internalType: 'struct PoolRoleAccounts',
name: 'roleAccounts',
type: 'tuple',
},
{
internalType: 'uint256',
name: 'swapFeePercentage',
type: 'uint256',
},
{
internalType: 'address',
name: 'poolHooksContract',
type: 'address',
},
{ internalType: 'bool', name: 'enableDonation', type: 'bool' },
{
internalType: 'bool',
name: 'disableUnbalancedLiquidity',
type: 'bool',
},
{ internalType: 'bytes32', name: 'salt', type: 'bytes32' },
],
name: 'create',
outputs: [{ internalType: 'address', name: 'pool', type: 'address' }],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'disable',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'bytes4', name: 'selector', type: 'bytes4' }],
name: 'getActionId',
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getAuthorizer',
outputs: [
{ internalType: 'contract IAuthorizer', name: '', type: 'address' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getDefaultLiquidityManagement',
outputs: [
{
components: [
{
internalType: 'bool',
name: 'disableUnbalancedLiquidity',
type: 'bool',
},
{
internalType: 'bool',
name: 'enableAddLiquidityCustom',
type: 'bool',
},
{
internalType: 'bool',
name: 'enableRemoveLiquidityCustom',
type: 'bool',
},
{
internalType: 'bool',
name: 'enableDonation',
type: 'bool',
},
],
internalType: 'struct LiquidityManagement',
name: 'liquidityManagement',
type: 'tuple',
},
],
stateMutability: 'pure',
type: 'function',
},
{
inputs: [],
name: 'getDefaultPoolHooksContract',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'pure',
type: 'function',
},
{
inputs: [
{ internalType: 'bytes', name: 'constructorArgs', type: 'bytes' },
{ internalType: 'bytes32', name: 'salt', type: 'bytes32' },
],
name: 'getDeploymentAddress',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getNewPoolPauseWindowEndTime',
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getOriginalPauseWindowEndTime',
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getPauseWindowDuration',
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getPoolCount',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getPoolVersion',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getPools',
outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint256', name: 'start', type: 'uint256' },
{ internalType: 'uint256', name: 'count', type: 'uint256' },
],
name: 'getPoolsInRange',
outputs: [
{ internalType: 'address[]', name: 'pools', type: 'address[]' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'getVault',
outputs: [
{ internalType: 'contract IVault', name: '', type: 'address' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'isDisabled',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'pool', type: 'address' }],
name: 'isPoolFromFactory',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'version',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
] as const;
1 change: 1 addition & 0 deletions src/abi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ export * from './stablePoolFactory.V3';
export * from './balancerCompositeLiquidityRouterNested';
export * from './balancerCompositeLiquidityRouterBoosted';
export * from './stableSurgeFactory';
export * from './gyroECLPPoolFactory.V3';
Loading