Skip to content

Commit 713c129

Browse files
committed
update integral v1.2.1 docs
1 parent 7a9b7b4 commit 713c129

70 files changed

Lines changed: 5108 additions & 436 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/Contracts/Core/AlgebraCommunityVault.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Algebra community fee vault
88
Community fee from pools is sent here, if it is enabled
99

1010
*Developer note: Role system is used to withdraw tokens
11-
Version: Algebra Integral*
11+
Version: Algebra Integral 1.2.1*
1212

13-
**Inherits:** [IAlgebraCommunityVault](interfaces/IAlgebraCommunityVault.md)
13+
**Inherits:** [IAlgebraCommunityVault](interfaces/vault/IAlgebraCommunityVault.md)
1414
## Modifiers
1515
### onlyAdministrator
1616

@@ -118,13 +118,14 @@ Address of Algebra fee manager
118118
### constructor
119119

120120
```solidity
121-
constructor(address _algebraFeeManager) public
121+
constructor(address _factory, address _algebraFeeManager) public
122122
```
123123

124124

125125

126126
| Name | Type | Description |
127127
| ---- | ---- | ----------- |
128+
| _factory | address | |
128129
| _algebraFeeManager | address | |
129130

130131
### withdraw

docs/Contracts/Core/AlgebraFactory.md

Lines changed: 100 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Algebra factory
77

88
Is used to deploy pools and its plugins
99

10-
*Developer note: Version: Algebra Integral*
10+
*Developer note: Version: Algebra Integral 1.2.1*
1111

12-
**Inherits:** [IAlgebraFactory](interfaces/IAlgebraFactory.md) [Ownable2Step](https://docs.openzeppelin.com/contracts/4.x/) [AccessControlEnumerable](https://docs.openzeppelin.com/contracts/4.x/)
12+
**Inherits:** [IAlgebraFactory](interfaces/IAlgebraFactory.md) [Ownable2Step](https://docs.openzeppelin.com/contracts/4.x/) [AccessControlEnumerable](https://docs.openzeppelin.com/contracts/4.x/) [ReentrancyGuard](https://docs.openzeppelin.com/contracts/4.x/)
1313

1414
## Public variables
1515
### POOLS_ADMINISTRATOR_ROLE
@@ -21,22 +21,22 @@ bytes32 constant POOLS_ADMINISTRATOR_ROLE = 0xb73ce166ead2f8e9add217713a7989e4ed
2121
role that can change communityFee and tickspacing in pools
2222

2323

24-
### poolDeployer
24+
### CUSTOM_POOL_DEPLOYER
2525
```solidity
26-
address immutable poolDeployer
26+
bytes32 constant CUSTOM_POOL_DEPLOYER = 0xc9cf812513d9983585eb40fcfe6fd49fbb6a45815663ec33b30a6c6c7de3683b
2727
```
28-
**Selector**: `0x3119049a`
28+
**Selector**: `0x07810754`
2929

30-
Returns the current poolDeployerAddress
30+
role that can call `createCustomPool` function
3131

3232

33-
### communityVault
33+
### poolDeployer
3434
```solidity
35-
address immutable communityVault
35+
address immutable poolDeployer
3636
```
37-
**Selector**: `0x53e97868`
37+
**Selector**: `0x3119049a`
3838

39-
Returns the current communityVaultAddress
39+
Returns the current poolDeployerAddress
4040

4141

4242
### defaultCommunityFee
@@ -83,6 +83,17 @@ contract IAlgebraPluginFactory defaultPluginFactory
8383

8484
Return the current pluginFactory address
8585

86+
*Developer note: This contract is used to automatically set a plugin address in new liquidity pools*
87+
88+
### vaultFactory
89+
```solidity
90+
contract IAlgebraVaultFactory vaultFactory
91+
```
92+
**Selector**: `0xd8a06f73`
93+
94+
Return the current vaultFactory address
95+
96+
*Developer note: This contract is used to automatically set a vault address in new liquidity pools*
8697

8798
### poolByPair
8899
```solidity
@@ -94,9 +105,19 @@ Returns the pool address for a given pair of tokens, or address 0 if it does not
94105

95106
*Developer note: tokenA and tokenB may be passed in either token0/token1 or token1/token0 order*
96107

108+
### customPoolByPair
109+
```solidity
110+
mapping(address => mapping(address => mapping(address => address))) customPoolByPair
111+
```
112+
**Selector**: `0x23da36cc`
113+
114+
Returns the custom pool address for a customDeployer and a given pair of tokens, or address 0 if it does not exist
115+
116+
*Developer note: tokenA and tokenB may be passed in either token0/token1 or token1/token0 order*
117+
97118
### POOL_INIT_CODE_HASH
98119
```solidity
99-
bytes32 constant POOL_INIT_CODE_HASH = 0x177d5fbf994f4d130c008797563306f1a168dc689f81b2fa23b4396931014d91
120+
bytes32 constant POOL_INIT_CODE_HASH = 0xa18736c3ee97fe3c96c9428c0cc2a9116facec18e84f95f9da30543f8238a782
100121
```
101122
**Selector**: `0xdc6fd8ab`
102123

@@ -162,7 +183,7 @@ function defaultConfigurationForPool() external view returns (uint16 communityFe
162183
```
163184
**Selector**: `0x25b355d6`
164185

165-
Returns the default communityFee and tickspacing
186+
Returns the default communityFee, tickspacing, fee and communityFeeVault for pool
166187

167188
**Returns:**
168189

@@ -194,12 +215,35 @@ Deterministically computes the pool address given the token0 and token1
194215
| ---- | ---- | ----------- |
195216
| pool | address | The contract address of the Algebra pool |
196217

218+
### computeCustomPoolAddress
219+
220+
```solidity
221+
function computeCustomPoolAddress(address deployer, address token0, address token1) public view returns (address customPool)
222+
```
223+
**Selector**: `0x1ba89df4`
224+
225+
Deterministically computes the custom pool address given the customDeployer, token0 and token1
226+
227+
*Developer note: The method does not check if such a pool has been created*
228+
229+
| Name | Type | Description |
230+
| ---- | ---- | ----------- |
231+
| deployer | address | |
232+
| token0 | address | first token |
233+
| token1 | address | second token |
234+
235+
**Returns:**
236+
237+
| Name | Type | Description |
238+
| ---- | ---- | ----------- |
239+
| customPool | address | The contract address of the Algebra pool |
240+
197241
### createPool
198242

199243
```solidity
200-
function createPool(address tokenA, address tokenB) external returns (address pool)
244+
function createPool(address tokenA, address tokenB, bytes data) external returns (address pool)
201245
```
202-
**Selector**: `0xe3433615`
246+
**Selector**: `0x321935c6`
203247

204248
Creates a pool for the given two tokens
205249

@@ -210,13 +254,40 @@ The call will revert if the pool already exists or the token arguments are inval
210254
| ---- | ---- | ----------- |
211255
| tokenA | address | One of the two tokens in the desired pool |
212256
| tokenB | address | The other of the two tokens in the desired pool |
257+
| data | bytes | Data for plugin creation |
213258

214259
**Returns:**
215260

216261
| Name | Type | Description |
217262
| ---- | ---- | ----------- |
218263
| pool | address | The address of the newly created pool |
219264

265+
### createCustomPool
266+
267+
```solidity
268+
function createCustomPool(address deployer, address creator, address tokenA, address tokenB, bytes data) external returns (address customPool)
269+
```
270+
**Selector**: `0xdbbf3db4`
271+
272+
Creates a custom pool for the given two tokens using `deployer` contract
273+
274+
*Developer note: tokenA and tokenB may be passed in either order: token0/token1 or token1/token0.
275+
The call will revert if the pool already exists or the token arguments are invalid.*
276+
277+
| Name | Type | Description |
278+
| ---- | ---- | ----------- |
279+
| deployer | address | The address of plugin deployer, also used for custom pool address calculation |
280+
| creator | address | The initiator of custom pool creation |
281+
| tokenA | address | One of the two tokens in the desired pool |
282+
| tokenB | address | The other of the two tokens in the desired pool |
283+
| data | bytes | The additional data bytes |
284+
285+
**Returns:**
286+
287+
| Name | Type | Description |
288+
| ---- | ---- | ----------- |
289+
| customPool | address | The address of the newly created custom pool |
290+
220291
### setDefaultCommunityFee
221292

222293
```solidity
@@ -277,6 +348,21 @@ function setDefaultPluginFactory(address newDefaultPluginFactory) external
277348
| ---- | ---- | ----------- |
278349
| newDefaultPluginFactory | address | address of new plugin factory |
279350

351+
### setVaultFactory
352+
353+
```solidity
354+
function setVaultFactory(address newVaultFactory) external
355+
```
356+
**Selector**: `0x3ea7fbdb`
357+
358+
359+
360+
*Developer note: updates vaultFactory address*
361+
362+
| Name | Type | Description |
363+
| ---- | ---- | ----------- |
364+
| newVaultFactory | address | address of new vault factory |
365+
280366
### startRenounceOwnership
281367

282368
```solidity

docs/Contracts/Core/AlgebraPool.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,24 @@ Algebra concentrated liquidity pool
77

88
This contract is responsible for liquidity positions, swaps and flashloans
99

10-
*Developer note: Version: Algebra Integral*
10+
*Developer note: Version: Algebra Integral 1.2.1*
1111

1212
**Inherits:** [AlgebraPoolBase](base/AlgebraPoolBase.md) [TickStructure](base/TickStructure.md) ReentrancyGuard [Positions](base/Positions.md) SwapCalculation [ReservesManager](base/ReservesManager.md)
1313

14+
## Structs
15+
### SwapEventParams
16+
17+
18+
19+
```solidity
20+
struct SwapEventParams {
21+
uint160 currentPrice;
22+
int24 currentTick;
23+
uint128 currentLiquidity;
24+
}
25+
```
26+
27+
1428
## Functions
1529
### initialize
1630

@@ -234,11 +248,27 @@ function setPluginConfig(uint8 newConfig) external
234248
```
235249
**Selector**: `0xbca57f81`
236250

237-
Set new plugin config
251+
Set new plugin config. Only factory owner or POOLS_ADMINISTRATOR_ROLE role
252+
253+
| Name | Type | Description |
254+
| ---- | ---- | ----------- |
255+
| newConfig | uint8 | In the new configuration of the plugin, each bit of which is responsible for a particular hook. |
256+
257+
### setCommunityVault
258+
259+
```solidity
260+
function setCommunityVault(address newCommunityVault) external
261+
```
262+
**Selector**: `0xd8544cf3`
263+
264+
Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role
265+
266+
*Developer note: Community fee vault receives collected community fees.
267+
**accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address***
238268

239269
| Name | Type | Description |
240270
| ---- | ---- | ----------- |
241-
| newConfig | uint8 | In the new configuration of the plugin, each bit of which is responsible for a particular hook. Only factory owner or POOLS_ADMINISTRATOR_ROLE role |
271+
| newCommunityVault | address | The address of new community fee vault |
242272

243273
### setFee
244274

@@ -254,3 +284,25 @@ Called by the plugin if dynamic fee is enabled
254284
| ---- | ---- | ----------- |
255285
| newFee | uint16 | The new fee value |
256286

287+
### sync
288+
289+
```solidity
290+
function sync() external
291+
```
292+
**Selector**: `0xfff6cae9`
293+
294+
Forces balances to match reserves. Excessive tokens will be distributed between active LPs
295+
296+
*Developer note: Only plugin can call this function*
297+
298+
### skim
299+
300+
```solidity
301+
function skim() external
302+
```
303+
**Selector**: `0x1dd19cb4`
304+
305+
Forces balances to match reserves. Excessive tokens will be sent to msg.sender
306+
307+
*Developer note: Only plugin can call this function*
308+

docs/Contracts/Core/AlgebraPoolDeployer.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ Algebra pool deployer
77

88
Is used by AlgebraFactory to deploy pools
99

10-
*Developer note: Version: Algebra Integral*
10+
*Developer note: Version: Algebra Integral 1.2.1*
1111

1212
**Inherits:** [IAlgebraPoolDeployer](interfaces/IAlgebraPoolDeployer.md)
1313

1414
## Functions
1515
### constructor
1616

1717
```solidity
18-
constructor(address _factory, address _communityVault) public
18+
constructor(address _factory) public
1919
```
2020

2121

2222

2323
| Name | Type | Description |
2424
| ---- | ---- | ----------- |
2525
| _factory | address | |
26-
| _communityVault | address | |
2726

2827
### getDeployParameters
2928

3029
```solidity
31-
function getDeployParameters() external view returns (address _plugin, address _factory, address _communityVault, address _token0, address _token1)
30+
function getDeployParameters() external view returns (address _plugin, address _factory, address _token0, address _token1)
3231
```
3332
**Selector**: `0x04889e26`
3433

@@ -42,16 +41,15 @@ Get the parameters to be used in constructing the pool, set transiently during p
4241
| ---- | ---- | ----------- |
4342
| _plugin | address | |
4443
| _factory | address | |
45-
| _communityVault | address | |
4644
| _token0 | address | |
4745
| _token1 | address | |
4846

4947
### deploy
5048

5149
```solidity
52-
function deploy(address plugin, address token0, address token1) external returns (address pool)
50+
function deploy(address plugin, address token0, address token1, address deployer) external returns (address pool)
5351
```
54-
**Selector**: `0xd9181cd3`
52+
**Selector**: `0xfd82b73a`
5553

5654

5755

@@ -62,6 +60,7 @@ function deploy(address plugin, address token0, address token1) external returns
6260
| plugin | address | The pool associated plugin (if any) |
6361
| token0 | address | The first token of the pool by address sort order |
6462
| token1 | address | The second token of the pool by address sort order |
63+
| deployer | address | |
6564

6665
**Returns:**
6766

0 commit comments

Comments
 (0)