This is Multichain token bridge that facilitates token transfers between different blockchain networks (including non evm chains)
-
BridgeAssistGenericUpgradeable: this employs a relayer system for transaction verification, uses OpenZeppelin’s access control and security features, and allows for fee management and configurable transaction limits. The contract includes functionality to add or remove supported chains, manage relayers and their consensus threshold, and emit events for key actions. Additionally, it features pausability for emergency stops and requires implementation of post-send and post-fulfill actions in derived contracts.
-
BridgeAssistTransferUpgradeable: The
BridgeAssistTransferUpgradeable
contract is an implementation of theBridgeAssistGenericUpgradeable
abstract contract. The contract includes an initialization function to set up parameters such as the token, transaction limits, fee wallet, fees for sending and fulfilling transactions, the owner, and relayers with their consensus threshold. The_afterSend
and_afterFulfill
functions handle the token transfers and fee deductions. Specifically,_afterSend
ensures tokens are transferred from the user to the contract and then the fee is sent to the fee wallet, while_afterFulfill
transfers the fulfilled amount to the user minus the fee, which is again sent to the fee wallet. The contract uses OpenZeppelin libraries for secure token transfers and upgradeable functionality. -
BridgeAssistMintUpgradeable: The contract extends
BridgeAssistGenericUpgradeable
contracts and includes an initializer to set up key parameters such as the token, transaction limits, fee wallet, fees, owner, relayers, and the consensus threshold. The_afterSend
function burns the specified amount of tokens from the sender and mints the fee to the fee wallet, while the_afterFulfill
function mints the specified amount minus the fee to the recipient and mints the fee to the fee wallet. This ensures secure and efficient token transfers across different blockchains. -
BridgeAssistNativeUpgradeable: The
BridgeAssistNativeUpgradeable
contract extends theBridgeAssistGenericUpgradeable
contract and includes an initializer to set up key parameters such as the token, transaction limits, fee wallet, fees, owner, relayers, and the consensus threshold. The_afterSend
function is overridden to revert with "NOT SUPPORTED," indicating that sending is not supported for this contract. The_afterFulfill
function is designed to transfer the specified amount minus the fee to the recipient and the fee to the fee wallet, ensuring secure and efficient native token transfers across different blockchains. The contract supports multiple chains, enforces transaction limits, and handles fee management, including the ability to set and adjust fees. Thesend
function facilitates native token transfers while ensuring that the amount sent is divisible by the configured exchange rate and meets the minimum required to cover fees. -
BridgeAssistCircleMintUpgradeable: The
BridgeAssistCircleMintUpgradeable
contract extends theBridgeAssistGenericUpgradeable
contract and facilitates token transfers between chains with the help of a relayer. The contract includes an initializer to configure key parameters such as the supported token, transaction limits, fee wallet, send and fulfill fees, owner, relayers, and the consensus threshold. The_afterSend
function transfers the specified amount of tokens from the sender to the contract, burns the tokens, and mints the fee to the fee wallet. The_afterFulfill
function mints the specified amount minus the fee to the recipient and mints the fee to the fee wallet, ensuring secure and efficient token transfers across different blockchains, including non-EVM chains. -
BridgeFactoryUpgradeable: The
BridgeFactoryUpgradeable
contract is designed to create and manage instances of BridgeAssist contracts for cross-chain token transfers. It uses OpenZeppelin'sClonesUpgradeable
library to deploy new instances efficiently. The contract supports three types of bridges:TRANSFER
,MINT
, andNATIVE
. Key functionalities include initializing with specific bridge implementations, creating new bridges, adding and removing third-party bridges, and changing bridge implementations. It employs roles for access control, with specific roles for creators and administrators. The contract also provides functions to query created bridges and their associated tokens, ensuring a comprehensive management system for bridge contracts within a blockchain ecosystem. -
BridgedAssetChainToken: The
BridgedAssetChainToken
contract is anERC20
token implementation designed for use as a bridged asset from another blockchain. The contract includes minting and burning functionalities, along with an optional blacklist feature to restrict transfers for specific addresses. It uses OpenZeppelin'sAccessControl
for role-based access management, defining roles such asMINTER_ROLE
,BURNER_ROLE
, and BLACKLISTER_ROLE. The contract is initialized with parameters including the token name, symbol, decimals, total supply, owner, whether the lock stage is active, the original token address, and the original chain ID. The mint and burn functions can only be called by accounts with the respective roles, and the blacklist functionality can be permanently disabled by an administrator. The decimals and name functions override theERC20
standard to return custom values, and _beforeTokenTransfer ensures transfers are blocked if either the sender or receiver is blacklisted
- contract
cd contracts
# Follow the instructions in the README.md file for setting up the harhat environment
- frontend
cd frontend
# Follow the instructions in the README.md file for setting up the frontend
- backend for each of the token backend (e.g backend_usdt). navigate to the folder and Follow the instructions in the README.md file to set up it environment
See CONTRIBUTING.md for contribution and pull request protocol. We expect contributors to follow our guide when submitting code or comments.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For questions or suggestions, just say Hi on Telegram.
We're always glad to help.