Skip to content

Commit eaafaa3

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

File tree

2 files changed

+21
-114
lines changed

2 files changed

+21
-114
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,29 @@ string public constant override typeAndVersion = "BurnFromMintTokenPool 1.6.1";
5454

5555
## Functions
5656

57-
### \_burn
57+
### \_lockOrBurn
5858

59-
Internal function that executes the token burning operation.
59+
Internal function that implements the token burning logic for the `BurnFromMintTokenPool`.
6060

6161
```solidity
62-
function _burn(uint256 amount) internal virtual override;
62+
function _lockOrBurn(uint256 amount) internal virtual override;
6363
```
6464

6565
<Aside>
66-
Implements the core burn functionality for the pool.
6766

68-
The function can be overridden in derived contracts to implement different burning mechanisms while preserving the base logic.
67+
Overrides the virtual [`_lockOrBurn`](/ccip/api-reference/evm/v1.6.1/token-pool#_lockorburn) function from the base `TokenPool` contract:
68+
69+
- Provides the specific "burn" implementation for the `BurnFromMintTokenPool`.
70+
- Calls the token's `burnFrom(address(this), amount)` function.
71+
- Relies on the token allowance set in the constructor to authorize the burn operation from the pool's own address.
6972

7073
</Aside>
7174

7275
**Parameters**
7376

74-
| Name | Type | Description |
75-
| -------- | --------- | ------------------------------ |
76-
| `amount` | `uint256` | The quantity of tokens to burn |
77+
| Name | Type | Description |
78+
| -------- | --------- | ---------------------------- |
79+
| `amount` | `uint256` | The number of tokens to burn |
7780

7881
### constructor
7982

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

Lines changed: 10 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -21,124 +21,28 @@ An abstract contract that implements core token pool functionality for burning a
2121

2222
- [TokenPool](/ccip/api-reference/evm/v1.6.1/token-pool)
2323

24-
## Events
25-
26-
### Burned
27-
28-
```solidity
29-
event Burned(address indexed sender, uint256 amount);
30-
```
31-
32-
<Aside>Emitted when tokens are burned in the pool.</Aside>
33-
34-
**Parameters**
35-
36-
| Name | Type | Indexed | Description |
37-
| -------- | --------- | ------- | ----------------------------------------- |
38-
| `sender` | `address` | Yes | The address initiating the burn operation |
39-
| `amount` | `uint256` | No | The number of tokens burned |
40-
41-
### Minted
42-
43-
```solidity
44-
event Minted(address indexed sender, address indexed recipient, uint256 amount);
45-
```
46-
47-
<Aside>Emitted when new tokens are minted from the pool.</Aside>
48-
49-
**Parameters**
50-
51-
| Name | Type | Indexed | Description |
52-
| ----------- | --------- | ------- | ----------------------------------------- |
53-
| `sender` | `address` | Yes | The address initiating the mint operation |
54-
| `recipient` | `address` | Yes | The address receiving the minted tokens |
55-
| `amount` | `uint256` | No | The number of tokens minted |
56-
5724
## Functions
5825

59-
### \_burn
60-
61-
Internal function that executes the token burning operation.
62-
63-
```solidity
64-
function _burn(uint256 amount) internal virtual;
65-
```
66-
67-
<Aside>
68-
Contains the specific burn call for a pool.
69-
70-
This method can be overridden to create pools with different burn signatures without duplicating the underlying logic.
26+
### \_releaseOrMint
7127

72-
</Aside>
73-
74-
**Parameters**
75-
76-
| Name | Type | Description |
77-
| -------- | --------- | ---------------------------- |
78-
| `amount` | `uint256` | The number of tokens to burn |
79-
80-
### lockOrBurn
81-
82-
Burns tokens in the pool during a cross-chain transfer.
83-
84-
```solidity
85-
function lockOrBurn(
86-
Pool.LockOrBurnInV1 calldata lockOrBurnIn
87-
) external virtual override returns (Pool.LockOrBurnOutV1 memory);
88-
```
89-
90-
<Aside>
91-
92-
Burns tokens in the pool with essential security validation:
93-
94-
- Performs security validation through `_validateLockOrBurn`
95-
- Burns the specified amount of tokens
96-
- Emits a `Burned` event
97-
- Returns destination token information
98-
99-
</Aside>
100-
101-
**Parameters**
102-
103-
| Name | Type | Description |
104-
| -------------- | --------------------------------------------------------------------------- | --------------------------------------- |
105-
| `lockOrBurnIn` | [`Pool.LockOrBurnInV1`](/ccip/api-reference/evm/v1.6.1/pool#lockorburninv1) | Input parameters for the burn operation |
106-
107-
**Returns**
108-
109-
| Type | Description |
110-
| ----------------------------------------------------------------------------- | ------------------------------------------------ |
111-
| [`Pool.LockOrBurnOutV1`](/ccip/api-reference/evm/v1.6.1/pool#lockorburnoutv1) | Contains destination token address and pool data |
112-
113-
### releaseOrMint
114-
115-
Mints new tokens to a recipient during a cross-chain transfer.
28+
Internal function that implements the token minting logic for a `BurnMintTokenPool`.
11629

11730
```solidity
118-
function releaseOrMint(
119-
Pool.ReleaseOrMintInV1 calldata releaseOrMintIn
120-
) external virtual override returns (Pool.ReleaseOrMintOutV1 memory);
31+
function _releaseOrMint(address receiver, uint256 amount) internal virtual override;
12132
```
12233

12334
<Aside>
12435

125-
Mints tokens to a specified recipient with the following steps:
36+
Overrides the virtual [`_releaseOrMint`](/ccip/api-reference/evm/v1.6.1/token-pool#_releaseormint) function from the base `TokenPool` contract:
12637

127-
- Performs security validation through `_validateReleaseOrMint`
128-
- Calculates the correct local token amount using decimal adjustments
129-
- Mints tokens to the specified receiver
130-
- Emits a `Minted` event
38+
- Provides the specific "mint" implementation for the `BurnMintTokenPool`.
39+
- Calls the token's `mint(receiver, amount)` function directly.
13140

13241
</Aside>
13342

13443
**Parameters**
13544

136-
| Name | Type | Description |
137-
| ----------------- | --------------------------------------------------------------------------------- | --------------------------------------- |
138-
| `releaseOrMintIn` | [`Pool.ReleaseOrMintInV1`](/ccip/api-reference/evm/v1.6.1/pool#releaseormintinv1) | Input parameters for the mint operation |
139-
140-
**Returns**
141-
142-
| Type | Description |
143-
| ----------------------------------------------------------------------------------- | ------------------------------------------------ |
144-
| [`Pool.ReleaseOrMintOutV1`](/ccip/api-reference/evm/v1.6.1/pool#releaseormintoutv1) | Contains the final amount minted in local tokens |
45+
| Name | Type | Description |
46+
| ---------- | --------- | --------------------------------- |
47+
| `receiver` | `address` | The address to receive the tokens |
48+
| `amount` | `uint256` | The number of tokens to mint |

0 commit comments

Comments
 (0)