Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ The scripts automatically calculate these fees and include them in the transacti

## How to release:

<!-- TODO use main branch and create PR for artifacts -->
* First, deploy on Testnets and make sure all tests are ok.
* Create a release branch `release/X.X.X` that starts from the `main` branch.
- Note that GitHub environments `arbitrum` and `ethereum` can only be used with `release/*` branches. The `main` branch cannot be used as the CI will not be able to commit deployment artifacts.
Expand Down
51 changes: 48 additions & 3 deletions docs/soldoc/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ This project implements a cross-chain token bridge system for the RLC token usin

## Diagrams and source code docs (soldocs):

- [Diagrams](../../diagrams/)
- [Source code docs](../../soldoc/src/SUMMARY.md)
- [Diagrams](docs/diagrams)
- [Source code docs](docs/soldoc/src/SUMMARY.md)

## Audits

* [Halborn audit report](audits/Halborn_iExec-RLC-Multichain-Bridge-Smart-Contract-Security-Assessment-Report.pdf)

## Architecture

Expand Down Expand Up @@ -116,7 +120,17 @@ The core contracts of the multichain bridge system:

## Usage

### Bridge RLC
### Network Support

The bridge currently supports:

#### **Testnets**
- **Ethereum Sepolia** ↔ **Arbitrum Sepolia**

#### **Mainnets**
- **Ethereum Mainnet** ↔ **Arbitrum Mainnet**

### Bridge RLC on Testnets

A. To send RLC tokens from Ethereum Sepolia to Arbitrum Sepolia:

Expand Down Expand Up @@ -144,6 +158,20 @@ This will:
2. Send a cross-chain message via LayerZero to Ethereum
3. Release the original RLC tokens from the RLCLiquidityUnifier on Ethereum

### Bridge RLC on Mainnets

A. To send RLC tokens from Ethereum Mainnet to Arbitrum Mainnet:

```bash
make send-tokens-to-arbitrum-mainnet
```

B. To send RLC tokens from Arbitrum Mainnet back to Ethereum Mainnet:

```bash
make send-tokens-to-ethereum-mainnet
```

## 📊 Code Coverage Analysis

### Generating Coverage Reports
Expand Down Expand Up @@ -309,8 +337,25 @@ The scripts automatically calculate these fees and include them in the transacti
- [Forge Coverage](https://book.getfoundry.sh/reference/forge/forge-coverage)
- [iExec Platform Documentation](https://docs.iex.ec/)

## How to release:

<!-- TODO use main branch and create PR for artifacts -->
* First, deploy on Testnets and make sure all tests are ok.
* Create a release branch `release/X.X.X` that starts from the `main` branch.
- Note that GitHub environments `arbitrum` and `ethereum` can only be used with `release/*` branches. The `main` branch cannot be used as the CI will not be able to commit deployment artifacts.
* Commit required changes (salt, ...)
* Go to "Actions" section on GitHub
* Trigger `Deploy contracts` job and choose the correct release branch and the target Github environment.

## TODO

- Use an enterprise RPC URL for `secrets.SEPOLIA_RPC_URL` in Github environment `ci`.
- Add git pre-commit hook to format code locally.
- Testing Documentation
- Parametrize the following addresses by chain in `config.json`:
```
"initialAdmin": "0x111165a109feca14e4ad4d805f6460c7d206ead1",
"initialUpgrader": "0x111121e2ec2557f484f65d5b1ad2b6b07b8acd23",
"initialPauser": "0x11113fe3513787f5a4f5f19690700e2736b3056e",
```
- Clean README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RLCCrosschainToken
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/RLCCrosschainToken.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/RLCCrosschainToken.sol)

**Inherits:**
UUPSUpgradeable, AccessControlDefaultAdminRulesUpgradeable, ERC20PermitUpgradeable, ERC20BridgeableUpgradeable
Expand All @@ -11,8 +11,6 @@ by permitted bridge contracts.
To whitelist a token bridge contract, the admin (with `DEFAULT_ADMIN_ROLE`) sends
a transaction to grant the role `TOKEN_BRIDGE_ROLE` to the bridge contract address
using `grantRole` function.
TODO upgrade openzeppelin packages when the audited version of ERC20BridgeableUpgradeable
is released.


## State Variables
Expand Down Expand Up @@ -116,7 +114,7 @@ an account with the UPGRADER_ROLE.*


```solidity
function _authorizeUpgrade(address newImplementation) internal override onlyRole(UPGRADER_ROLE);
function _authorizeUpgrade(address) internal override onlyRole(UPGRADER_ROLE);
```

### _checkTokenBridge
Expand All @@ -129,12 +127,6 @@ Checks if the caller is a trusted token bridge that is allowed by iExec to call


```solidity
function _checkTokenBridge(address caller) internal view override;
function _checkTokenBridge(address) internal view override onlyRole(TOKEN_BRIDGE_ROLE);
```
**Parameters**

|Name|Type|Description|
|----|----|-----------|
|`caller`|`address`|The address of the caller that is trying to mint or burn tokens.|


Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RLCLiquidityUnifier
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/RLCLiquidityUnifier.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/RLCLiquidityUnifier.sol)

**Inherits:**
UUPSUpgradeable, AccessControlDefaultAdminRulesUpgradeable, [IRLCLiquidityUnifier](/src/interfaces/IRLCLiquidityUnifier.sol/interface.IRLCLiquidityUnifier.md), IERC7802
Expand All @@ -9,7 +9,8 @@ the minting and burning of tokens on the RLC token contract. All bridges
should interact with this contract to perform RLC transfers.
The implementation is inspired by the OpenZeppelin ERC20Bridgeable contract
without being an ERC20 token itself. Functions are overridden to lock/unlock
tokens on an external ERC20 contract.*
tokens on an external ERC20 contract. ERC20Bridgeable is not used directly
because it embarks the ERC20 token logic, which is not needed here.*


## State Variables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IexecLayerZeroBridge
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/bridges/layerZero/IexecLayerZeroBridge.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/bridges/layerZero/IexecLayerZeroBridge.sol)

**Inherits:**
UUPSUpgradeable, AccessControlDefaultAdminRulesUpgradeable, OFTCoreUpgradeable, [DualPausableUpgradeable](/src/bridges/utils/DualPausableUpgradeable.sol/abstract.DualPausableUpgradeable.md), [IIexecLayerZeroBridge](/src/interfaces/IIexecLayerZeroBridge.sol/interface.IIexecLayerZeroBridge.md)
Expand Down Expand Up @@ -205,13 +205,29 @@ function token() external view returns (address);
|`<none>`|`address`|The address of the RLC token contract|


### owner
### renounceOwnership

*Overridden to prevent ownership renouncement.
AccessControlDefaultAdminRulesUpgradeable is used to manage ownership.*


```solidity
function renounceOwnership() public pure override;
```

### transferOwnership

*Overridden to prevent ownership transfer.
AccessControlDefaultAdminRulesUpgradeable is used to manage ownership.*


```solidity
function transferOwnership(address) public pure override;
```

Returns the owner of the contract
### owner

*This override resolves the conflict between OwnableUpgradeable and
AccessControlDefaultAdminRulesUpgradeable, both of which define owner().
We use the OwnableUpgradeable version for consistency.*
Returns the owner of the contract which is also the default admin.


```solidity
Expand All @@ -225,8 +241,21 @@ function owner()

|Name|Type|Description|
|----|----|-----------|
|`<none>`|`address`|The address of the current owner|
|`<none>`|`address`|The address of the current owner and default admin|


### _acceptDefaultAdminTransfer

Accepts the default admin transfer and sets the owner to the new admin.

*This ensures the state variable `OwnableUpgradeable._owner` is set correctly after the default
admin transfer. Even though `OwnableUpgradeable._owner` is not used in `owner()` accessor, we chose
to update it for consistency purposes.*


```solidity
function _acceptDefaultAdminTransfer() internal override;
```

### _debit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DualPausableUpgradeable
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/bridges/utils/DualPausableUpgradeable.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/bridges/utils/DualPausableUpgradeable.sol)

**Inherits:**
PausableUpgradeable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IIexecLayerZeroBridge
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/interfaces/IIexecLayerZeroBridge.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/interfaces/IIexecLayerZeroBridge.sol)


## Functions
Expand Down Expand Up @@ -47,3 +47,10 @@ Unpauses the `_debit` function, allowing outbound transfers again.
function unpauseOutboundTransfers() external;
```

## Errors
### OperationNotAllowed

```solidity
error OperationNotAllowed(string message);
```

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IRLCLiquidityUnifier
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/interfaces/IRLCLiquidityUnifier.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/interfaces/IRLCLiquidityUnifier.sol)

*Interface for the RLC Liquidity Unifier contract.
This interface defines the contract that is used to centralize the RLC liquidity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ITokenSpender
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/61326e3abe32aee8683989ab94220c30da0cb2e6/src/interfaces/ITokenSpender.sol)
[Git Source](https://github.com/iExecBlockchainComputing/rlc-multichain/blob/93b2d2b8fb41a03ccb6bc3a710204b628f122d69/src/interfaces/ITokenSpender.sol)

*See [RLCrosschainToken-approveAndCall](/src/RLCCrosschainToken.sol/contract.RLCCrosschainToken.md#approveandcall).
An interface for a contract that can receive approval from an ERC20 token and execute
Expand Down
3 changes: 0 additions & 3 deletions src/RLCCrosschainToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import {ITokenSpender} from "./interfaces/ITokenSpender.sol";
* To whitelist a token bridge contract, the admin (with `DEFAULT_ADMIN_ROLE`) sends
* a transaction to grant the role `TOKEN_BRIDGE_ROLE` to the bridge contract address
* using `grantRole` function.
*
* TODO upgrade openzeppelin packages when the audited version of ERC20BridgeableUpgradeable
* is released.
*/
contract RLCCrosschainToken is
UUPSUpgradeable,
Expand Down
Loading