These contracts provide the core functionality for the Omnibridge AMB extension.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Fungible Tokens OmniBridge contracts are an extension for Arbitrary Message Bridge to transfer ERC20/ERC677 tokens between EVM-based blockchains
Home Page: https://omni.xdaichain.com/
License: GNU General Public License v3.0
These contracts provide the core functionality for the Omnibridge AMB extension.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
The idea of this issue is to implement a support of meta transactions on the mediators contract as so bridged tokens (or native tokens permit()
) could be triggered for the transfer without the necessity in the direct interaction with the contracts from the user side.
For example, the interaction flow could be like the following:
relayTokens
/relayTokensAndCall
relayTokens
/relayTokensAndCall
to the mediator contracttransferFrom
Consider to support fungible tokens implemented with the EIP-1155 standard.
Several notes:
The set of changes could be shared with omni/omnibridge-nft#24.
Since now the Fee Manager is a separate module, the public methods provided by the mediator before (like calculateFee
) are accessible in different way -- through the fee manager contract. It means that the compatibility with the previous version of the mediator contracts is broken. That's why the major value must be increased in the getBridgeInterfacesVersion
method.
There is a set of modules which were extracted from the OmniBridge contracts to reduce the deployed bytecode as so OB uses them as external contracts:
TokenFactory
MultiTokenForwardingRulesManager
OmnibridgeFeeManager
SelectorTokenGasLimitManager
There is also a module which is deployed by the token factory: TokenProxy
Currently it is hard to discover a difference between the previous version of a deployed version of a module and the module in the repo. It could be used, for example, to identify if the module needs to be redeployed.
Consider to introduce versioning for the modules listed above. So, when the code of a module is changed, the version is updated also. That's why the next step to identify whether the module needs to be re-deployed is trivial.
Initially, when the permit()
functionality was integrated in the bridged token contract the EIP-2612 standard did not exist. That's why the permit()
method was copied from the MakerDAO DAI token.
Currently, EIP-2612 looks finished. So, it makes sense to port the implementation of the permit()
method from the standard to the bridged token contract. But the current implementation of permit()
must be preserved moreover its selectors differs from the standard's selector.
https://github.com/WETH10/WETH10/blob/main/contracts/WETH10.sol can be used a referenced implementation.
Currently the suffix added to the token name is hardcoded in the contracts:
Consider research a way how to support more suffixes "from xDai", "from Mainnet", "from BSC".
The functionality of the fixMediatorBalance
method was designed to allow for the extension admins to correct the issue with the token balances if the tokens were sent to the mediator improperly.
But the current implementation only works if the token was bridged to another side of the bridge and then returned back.
Address the issue by removing this check and using the same method to generate the message call on the opposite side of the bridge how it is done in the _prepareMessage
method:
Consider to add a task for the GitHub action similar to https://github.com/poanetwork/tokenbridge-contracts/blob/cdef2c6d696e46677a9125a064ab6c8c514bfc9d/.github/workflows/main.yml#L74-L92 to publish the docker image with the scripts and compiled contracts to simplify the deployment process.
Consider to use the configuration admin (owner) of the mediator contract to allow to modify parameters in the following external modules instead of initializing their own admins:
MultiTokenForwardingRulesManager
OmnibridgeFeeManager
SelectorTokenGasLimitManager
It will simplify the migration to new owner if it is required.
Currently there are three modules serving some aspects of the bridge contracts configuration:
These modules are implemented as a separate contracts and the bridge contract calls the modules' methods to get/store some information.
During the bridge usage the modules could collect lots of configuration data. But if an issue is found in the code of the modules they need to be updated. Since current contracts of the modules do not support the upgradable pattern, it means that the bridge admins could be required to perform lots of transactions to migrate the state from the old version of the module to the new one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.