Skip to content

reddio-com/reddio_bridge_contract

Repository files navigation

reddio_evm_bridge

This directory contains the Solidity code for Reddio's L1 and L2 bridge contracts implemented using the Diamond Proxy pattern (EIP-2535). The Diamond standard allows for modular and upgradeable smart contracts by separating functionality into multiple facets. Diamond Proxy Pattern (EIP-2535) The Diamond Proxy pattern enables:

Modular design: Functionality is split into independent facets

Upgradeability: Individual facets can be upgraded without affecting others

Size management: Avoids Ethereum contract size limitations

Clear separation: Storage, logic, and interfaces are separated

Learn more about EIP-2535(https://eips.ethereum.org/EIPS/eip-2535)

Directory Structure

 
├── Diamond.sol - Main diamond proxy contract 
├── access - Access control contracts (Ownable, Roles, etc.) 
├── childLayer - L2 bridge contracts (Reddio L2) 
├── common - Shared utilities and libraries 
├── interfaces - Core contract interfaces 
├── libraries - Reusable libraries and utilities 
├── parentLayer - L1 bridge contracts (Ethereum) 
├── storage - Diamond storage layout definitions 
├── tokens - Token contracts (ERC20, ERC721, etc.) 
└── utils - Utility contracts and helpers 

Installation

Clone this repo:

git clone https://github.com/reddio-com/reddio_bridge_contract.git

Install NPM packages:

cd evm-bridge
npm install

Environment variables

.sepolia.env

export HARDHAT_ENV=sepolia
export DIAMOND_ADDRESS=...
export RPC_PROVIDER=...
export ADMIN_PRIVATE_KEY=...
export ETHERSCAN_KEY=...

.localhost.env

export HARDHAT_ENV=localhost
export DIAMOND_ADDRESS=...
export RPC_PROVIDER=...
export ADMIN_PRIVATE_KEY=...
export ETHERSCAN_KEY=...

Deploy

deploy parentLayer on sepolia

npm run deployParentLayer:sepolia

deploy childLayer on localhost

npm run deployChildLayer:localhost

Run clients

run parentLayer client on sepolia

npm run parentClient:sepolia

run childLayer client on localhost

npm run childClient:localhost

License

This project is licensed under the Apache-2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published