Skip to content

Commit

Permalink
regorg (#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
aelmanaa authored Jan 17, 2025
1 parent be95a8b commit 6b86519
Show file tree
Hide file tree
Showing 22 changed files with 3,306 additions and 1,593 deletions.
4 changes: 4 additions & 0 deletions src/config/sidebar/ccip/api-reference/v1_5_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"title": "Client Library",
"url": "ccip/api-reference/v1.5.0/client"
},
{
"title": "ITypeAndVersion",
"url": "ccip/api-reference/v1.5.0/i-type-and-version"
},
{
"title": "IRouterClient",
"url": "ccip/api-reference/v1.5.0/i-router-client"
Expand Down
12 changes: 12 additions & 0 deletions src/config/sidebar/ccip/api-reference/v1_5_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"title": "Client Library",
"url": "ccip/api-reference/v1.5.1/client"
},
{
"title": "ITypeAndVersion",
"url": "ccip/api-reference/v1.5.1/i-type-and-version"
},
{
"title": "IRouterClient",
"url": "ccip/api-reference/v1.5.1/i-router-client"
Expand Down Expand Up @@ -54,5 +58,13 @@
{
"title": "Errors",
"url": "ccip/api-reference/v1.5.1/errors"
},
{
"title": "Ownable2Step",
"url": "ccip/api-reference/v1.5.1/ownable-2-step"
},
{
"title": "Ownable2StepMsgSender",
"url": "ccip/api-reference/v1.5.1/ownable-2-step-msg-sender"
}
]
6 changes: 6 additions & 0 deletions src/config/versions/page-availability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export const PAGE_AVAILABILITY: Record<string, Record<string, PageAvailability>>
"rate-limiter": {
notAvailableIn: ["v1.5.0"],
},
"ownable-2-step-msg-sender": {
notAvailableIn: ["v1.5.0"],
},
"ownable-2-step": {
notAvailableIn: ["v1.5.0"],
},
},
"chainlink-local": {
"mock-evm2evm-offramp": {
Expand Down
34 changes: 34 additions & 0 deletions src/content/ccip/api-reference/v1.5.0/i-type-and-version.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
section: ccip
date: Last Modified
title: "CCIP v1.5.0 ITypeAndVersion Interface API Reference"
metadata:
description: "API documentation for the ITypeAndVersion interface in Chainlink CCIP v1.5.0, providing type and version information for contracts."
---

import { Aside } from "@components"
import CcipCommon from "@features/ccip/CcipCommon.astro"

<CcipCommon callout="importCCIPPackage151" />

## ITypeAndVersion

An interface that provides type and version information for contracts.

[Git Source](https://github.com/smartcontractkit/ccip/tree/release/contracts-ccip-1.5.0/contracts/src/v0.8/shared/interfaces/ITypeAndVersion.sol)

## Functions

### typeAndVersion

Returns the type and version of the contract.

```solidity
function typeAndVersion() external pure returns (string memory);
```

**Returns**

| Type | Description |
| -------- | ------------------------------------- |
| `string` | The type and version of the contract. |
108 changes: 66 additions & 42 deletions src/content/ccip/api-reference/v1.5.1/burn-from-mint-token-pool.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,71 +11,95 @@ import CcipCommon from "@features/ccip/CcipCommon.astro"

<CcipCommon callout="importCCIPPackage151" />

The [`BurnFromMintTokenPool`](https://github.com/smartcontractkit/ccip/blob/release/contracts-ccip-1.5.1/contracts/src/v0.8/ccip/pools/BurnFromMintTokenPool.sol) contract extends BurnMintTokenPoolAbstract to implement burn/mint functionality for third-party tokens using the `burnFrom(from, amount)` signature.
## BurnFromMintTokenPool

A specialized token pool contract that manages third-party tokens through minting and burning operations, specifically using the `burnFrom` function.

[Git Source](https://github.com/smartcontractkit/ccip/blob/0df0625eea603ba8572d5382d72979a7f2b12bfb/contracts/src/v0.8/ccip/pools/BurnFromMintTokenPool.sol)

**Inherits:**

- [BurnMintTokenPoolAbstract](/ccip/api-reference/v1.5.1/burn-mint-token-pool-abstract)
- [ITypeAndVersion](/ccip/api-reference/v1.5.1/i-type-and-version)

<Aside>

This pool manages third-party token minting and burning operations with the following characteristics:

- The pool's whitelisting mode is permanently set during contract deployment
- The pool can be configured to either:
- Accept transactions from any address as originalSender
- Accept transactions only from whitelisted originalSender addresses
- Whitelisting mode can only be changed by deploying a new pool
- Before deployment, ensure the token's burner/minter roles can be adjusted if needed
- This implementation extends BurnMintTokenPool by using the `burnFrom(from, amount)` function

<Aside type="caution">
Pool whitelisting mode is set in the constructor and cannot be modified later. It either accepts any address as
originalSender, or only accepts whitelisted originalSender. The only way to change whitelisting mode is to deploy a
new pool. If that is expected, please make sure the token's burner/minter roles are adjustable.
</Aside>

## Functions
## State Variables

### constructor
### typeAndVersion

```solidity
constructor(
IBurnMintERC20 token,
uint8 localTokenDecimals,
address[] memory allowlist,
address rmnProxy,
address router
) TokenPool(token, localTokenDecimals, allowlist, rmnProxy, router)
string public constant override typeAndVersion = "BurnFromMintTokenPool 1.5.1";
```

Initializes the token pool with the specified parameters and approves the pool to burn from itself.
<Aside>A constant identifier that specifies the contract type and version number.</Aside>

<Aside type="note">
Some tokens allow burning from the sender without approval, but not all do. To be safe, the constructor approves the
pool to burn from itself with the maximum allowance.
</Aside>
**Returns**

#### Parameters
| Type | Description |
| -------- | ----------------------------------------------------- |
| `string` | The contract identifier "BurnFromMintTokenPool 1.5.1" |

| Name | Type | Description |
| ------------------ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| token | IBurnMintERC20 | The token managed by this pool |
| localTokenDecimals | uint8 | The number of decimals for the token on the local chain |
| allowlist | address[] | List of addresses allowed to be original senders for token transfers. When allowlist is enabled, it ensures only token-developer specified addresses can transfer tokens |
| rmnProxy | address | Address of the RMN proxy |
| router | address | Address of the router |
## Functions

### \_burn

Internal function that executes the token burning operation.

```solidity
function _burn(
uint256 amount
) internal virtual override
function _burn(uint256 amount) internal virtual override;
```

Burns the specified amount of tokens using the `burnFrom(from, amount)` signature.
<Aside>
Implements the core burn functionality for the pool.

The function can be overridden in derived contracts to implement different burning mechanisms while preserving the base logic.

#### Parameters
</Aside>

| Name | Type | Description |
| ------ | ------- | ------------------------ |
| amount | uint256 | Amount of tokens to burn |
**Parameters**

### typeAndVersion
| Name | Type | Description |
| -------- | --------- | ------------------------------ |
| `amount` | `uint256` | The quantity of tokens to burn |

### constructor

```solidity
string public constant override typeAndVersion = "BurnFromMintTokenPool 1.5.1"
constructor(
IBurnMintERC20 token,
uint8 localTokenDecimals,
address[] memory allowlist,
address rmnProxy,
address router
) TokenPool(token, localTokenDecimals, allowlist, rmnProxy, router);
```

Returns the type and version of the contract.
<Aside>
Sets up the BurnFromMintTokenPool contract with initial configuration.

For maximum compatibility, the constructor automatically grants the pool maximum allowance to burn tokens from itself, as some tokens require explicit approval for burning operations.

</Aside>

#### Return Value
**Parameters**

| Type | Description |
| ------ | ---------------------------------------- |
| string | The string "BurnFromMintTokenPool 1.5.1" |
| Name | Type | Description |
| -------------------- | ---------------- | ------------------------------------------------------ |
| `token` | `IBurnMintERC20` | Address of the token contract to be managed |
| `localTokenDecimals` | `uint8` | Decimal precision of the local token |
| `allowlist` | `address[]` | List of addresses authorized to interact with the pool |
| `rmnProxy` | `address` | Address of the RMN proxy contract |
| `router` | `address` | Address of the router contract |
Loading

0 comments on commit 6b86519

Please sign in to comment.