Skip to content

Commit e9d785b

Browse files
committed
DOC-1304 : Add CCIP-1.6.1 API reference
1 parent fafc667 commit e9d785b

File tree

3 files changed

+127
-77
lines changed

3 files changed

+127
-77
lines changed

src/content/ccip/api-reference/evm/v1.6.1/burn-mint-token-pool.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,19 @@ string public constant override typeAndVersion = "BurnMintTokenPool 1.6.1";
5656

5757
## Functions
5858

59-
### \_burn
59+
### \_lockOrBurn
6060

61-
Internal function that executes the token burning operation using the standard burn interface.
61+
Internal function that implements the token burning logic for the `BurnMintTokenPool`.
6262

6363
```solidity
64-
function _burn(uint256 amount) internal virtual override;
64+
function _lockOrBurn(uint256 amount) internal virtual override;
6565
```
6666

6767
<Aside>
6868

69-
Implements the abstract burn function from BurnMintTokenPoolAbstract:
69+
Overrides the virtual [`_lockOrBurn`](/ccip/api-reference/evm/v1.6.1/token-pool#_lockorburn) function from the base `TokenPool` contract:
7070

71+
- Provides the specific "burn" implementation for the `BurnMintTokenPool`.
7172
- Calls the token's `burn(amount)` function directly
7273
- Requires the pool to have sufficient burning permissions
7374

src/content/ccip/api-reference/evm/v1.6.1/lock-release-token-pool.mdx

Lines changed: 10 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -193,38 +193,6 @@ function getRebalancer() external view returns (address);
193193
| --------- | ------------------------------------- |
194194
| `address` | The current liquidity manager address |
195195

196-
### lockOrBurn
197-
198-
Locks tokens in the pool for cross-chain transfer.
199-
200-
```solidity
201-
function lockOrBurn(
202-
Pool.LockOrBurnInV1 calldata lockOrBurnIn
203-
) external virtual override returns (Pool.LockOrBurnOutV1 memory);
204-
```
205-
206-
<Aside>
207-
208-
Processes token locking with security validation:
209-
210-
- Performs essential security checks through `_validateLockOrBurn`
211-
- Emits a `Locked` event upon successful locking
212-
- Returns destination token information
213-
214-
</Aside>
215-
216-
**Parameters**
217-
218-
| Name | Type | Description |
219-
| -------------- | --------------------------------------------------------------------------- | --------------------------------------- |
220-
| `lockOrBurnIn` | [`Pool.LockOrBurnInV1`](/ccip/api-reference/evm/v1.6.1/pool#lockorburninv1) | Input parameters for the lock operation |
221-
222-
**Returns**
223-
224-
| Type | Description |
225-
| ----------------------------------------------------------------------------- | ------------------------------------------------ |
226-
| [`Pool.LockOrBurnOutV1`](/ccip/api-reference/evm/v1.6.1/pool#lockorburnoutv1) | Contains destination token address and pool data |
227-
228196
### provideLiquidity
229197

230198
Adds external liquidity to the pool.
@@ -249,38 +217,29 @@ Allows the rebalancer to add liquidity to the pool:
249217
| -------- | --------- | ---------------------------------- |
250218
| `amount` | `uint256` | The amount of liquidity to provide |
251219

252-
### releaseOrMint
220+
### \_releaseOrMint
253221

254-
Releases tokens from the pool to a recipient.
222+
Internal function that implements the token release logic for a `LockReleaseTokenPool`.
255223

256224
```solidity
257-
function releaseOrMint(
258-
Pool.ReleaseOrMintInV1 calldata releaseOrMintIn
259-
) external virtual override returns (Pool.ReleaseOrMintOutV1 memory);
225+
function _releaseOrMint(address receiver, uint256 amount) internal virtual override;
260226
```
261227

262228
<Aside>
263229

264-
Processes token release with security validation:
230+
Overrides the virtual [`_releaseOrMint`](/ccip/api-reference/evm/v1.6.1/token-pool#_releaseormint) function from the base `TokenPool` contract:
265231

266-
- Performs essential security checks through `_validateReleaseOrMint`
267-
- Calculates correct local token amounts using decimal adjustments
268-
- Transfers tokens to the specified receiver
269-
- Emits a `Released` event
232+
- Provides the specific "release" implementation for the `LockReleaseTokenPool`.
233+
- Uses `safeTransfer` to send the specified amount of tokens to the receiver.
270234

271235
</Aside>
272236

273237
**Parameters**
274238

275-
| Name | Type | Description |
276-
| ----------------- | --------------------------------------------------------------------------------- | ------------------------------------------ |
277-
| `releaseOrMintIn` | [`Pool.ReleaseOrMintInV1`](/ccip/api-reference/evm/v1.6.1/pool#releaseormintinv1) | Input parameters for the release operation |
278-
279-
**Returns**
280-
281-
| Type | Description |
282-
| ----------------------------------------------------------------------------------- | -------------------------------------------------- |
283-
| [`Pool.ReleaseOrMintOutV1`](/ccip/api-reference/evm/v1.6.1/pool#releaseormintoutv1) | Contains the final amount released in local tokens |
239+
| Name | Type | Description |
240+
| ---------- | --------- | --------------------------------- |
241+
| `receiver` | `address` | The address to receive the tokens |
242+
| `amount` | `uint256` | The number of tokens to release |
284243

285244
### setRebalancer
286245

@@ -298,28 +257,6 @@ function setRebalancer(address rebalancer) external onlyOwner;
298257
| ------------ | --------- | --------------------------------- |
299258
| `rebalancer` | `address` | The new rebalancer address to set |
300259

301-
### supportsInterface
302-
303-
Checks interface support using ERC165.
304-
305-
```solidity
306-
function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool);
307-
```
308-
309-
<Aside>Implements ERC165 interface detection.</Aside>
310-
311-
**Parameters**
312-
313-
| Name | Type | Description |
314-
| ------------- | -------- | --------------------------------- |
315-
| `interfaceId` | `bytes4` | The interface identifier to check |
316-
317-
**Returns**
318-
319-
| Type | Description |
320-
| ------ | ---------------------------------- |
321-
| `bool` | True if the interface is supported |
322-
323260
### transferLiquidity
324261

325262
Transfers liquidity from an older pool version.

src/content/ccip/api-reference/evm/v1.6.1/token-pool.mdx

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,29 @@ function _encodeLocalDecimals() internal view virtual returns (bytes memory);
732732
| ------- | --------------------------------------------- |
733733
| `bytes` | ABI-encoded decimal places of the local token |
734734

735+
### \_lockOrBurn
736+
737+
Abstract internal function designed to be overridden with the specific token lock or burn logic.
738+
739+
```solidity
740+
function _lockOrBurn(uint256 amount) internal virtual;
741+
```
742+
743+
<Aside>
744+
745+
This function is a virtual placeholder within the main `lockOrBurn` workflow:
746+
747+
- It is called by the public `lockOrBurn` function after all validations are complete.
748+
- Concrete child contracts (e.g., `LockReleaseTokenPool`, `BurnMintTokenPool`) must provide a specific implementation (either locking or burning tokens).
749+
750+
</Aside>
751+
752+
**Parameters**
753+
754+
| Name | Type | Description |
755+
| -------- | --------- | ------------------------------------ |
756+
| `amount` | `uint256` | The amount of tokens to lock or burn |
757+
735758
### \_onlyOffRamp
736759

737760
Checks whether remote chain selector is configured on this contract, and if the msg.sender
@@ -825,6 +848,30 @@ Reverts with [`InvalidRemoteChainDecimals`](#invalidremotechaindecimals) if:
825848
| ------- | ----------------------------------------------- |
826849
| `uint8` | The number of decimals used on the remote chain |
827850

851+
### \_releaseOrMint
852+
853+
Abstract internal function designed to be overridden with the specific token release or mint logic.
854+
855+
```solidity
856+
function _releaseOrMint(address receiver, uint256 amount) internal virtual;
857+
```
858+
859+
<Aside>
860+
861+
This function is a virtual placeholder within the main `releaseOrMint` workflow:
862+
863+
- It is called by the public `releaseOrMint` function after validation and amount calculations.
864+
- Concrete child contracts must implement the logic to either release (transfer) existing tokens or mint new ones to the receiver.
865+
866+
</Aside>
867+
868+
**Parameters**
869+
870+
| Name | Type | Description |
871+
| ---------- | --------- | --------------------------------------- |
872+
| `receiver` | `address` | The address receiving the tokens |
873+
| `amount` | `uint256` | The amount of tokens to release or mint |
874+
828875
### \_setRateLimitConfig
829876

830877
Internal function to update rate limit configuration for a chain.
@@ -1251,6 +1298,71 @@ function isSupportedToken(address token) public view virtual returns (bool);
12511298
| ------ | ------------------------------------------- |
12521299
| `bool` | True if the token is supported by this pool |
12531300

1301+
### lockOrBurn
1302+
1303+
Locks tokens in the pool for cross-chain transfer.
1304+
1305+
```solidity
1306+
function lockOrBurn(
1307+
Pool.LockOrBurnInV1 calldata lockOrBurnIn
1308+
) external virtual override returns (Pool.LockOrBurnOutV1 memory);
1309+
```
1310+
1311+
<Aside>
1312+
1313+
Processes token locking with security validation:
1314+
1315+
- Performs essential security checks through `_validateLockOrBurn`
1316+
- Emits a [`LockedOrBurned`](#lockedorburned) event upon successful locking
1317+
- Returns destination token information
1318+
1319+
</Aside>
1320+
1321+
**Parameters**
1322+
1323+
| Name | Type | Description |
1324+
| -------------- | --------------------------------------------------------------------------- | --------------------------------------- |
1325+
| `lockOrBurnIn` | [`Pool.LockOrBurnInV1`](/ccip/api-reference/evm/v1.6.0/pool#lockorburninv1) | Input parameters for the lock operation |
1326+
1327+
**Returns**
1328+
1329+
| Type | Description |
1330+
| ----------------------------------------------------------------------------- | ------------------------------------------------ |
1331+
| [`Pool.LockOrBurnOutV1`](/ccip/api-reference/evm/v1.6.0/pool#lockorburnoutv1) | Contains destination token address and pool data |
1332+
1333+
### releaseOrMint
1334+
1335+
Releases tokens from the pool to a recipient.
1336+
1337+
```solidity
1338+
function releaseOrMint(
1339+
Pool.ReleaseOrMintInV1 calldata releaseOrMintIn
1340+
) external virtual override returns (Pool.ReleaseOrMintOutV1 memory);
1341+
```
1342+
1343+
<Aside>
1344+
1345+
Processes token release with security validation:
1346+
1347+
- Performs essential security checks through `_validateReleaseOrMint`
1348+
- Calculates correct local token amounts using decimal adjustments
1349+
- Transfers tokens to the specified receiver
1350+
- Emits a [`ReleasedOrMinted`](#releasedorminted) event
1351+
1352+
</Aside>
1353+
1354+
**Parameters**
1355+
1356+
| Name | Type | Description |
1357+
| ----------------- | --------------------------------------------------------------------------------- | ------------------------------------------ |
1358+
| `releaseOrMintIn` | [`Pool.ReleaseOrMintInV1`](/ccip/api-reference/evm/v1.6.0/pool#releaseormintinv1) | Input parameters for the release operation |
1359+
1360+
**Returns**
1361+
1362+
| Type | Description |
1363+
| ----------------------------------------------------------------------------------- | -------------------------------------------------- |
1364+
| [`Pool.ReleaseOrMintOutV1`](/ccip/api-reference/evm/v1.6.0/pool#releaseormintoutv1) | Contains the final amount released in local tokens |
1365+
12541366
### removeRemotePool
12551367

12561368
Removes a pool address from a remote chain's configuration.

0 commit comments

Comments
 (0)