Replies: 1 comment
-
Hey! Right now we are concentrated on our new bridge version https://github.com/ChainSafe/chainbridge-core. |
Beta Was this translation helpful? Give feedback.
-
Hey! Right now we are concentrated on our new bridge version https://github.com/ChainSafe/chainbridge-core. |
Beta Was this translation helpful? Give feedback.
-
Motivation
Meta transactions for deposits would be really helpful for this project given its popularity. They essentially allow people to use EVM compatible chains without having the native token, and this is especially useful for first time users of the chain as they will have no native balance on that chain. A classic example is the following:
I floated the idea a few months ago in the discord but we now have the resources to help out with it.
We at SX Network would be happy to tackle the implementation given some guidance regarding PR acceptance criteria.
Technical discussion
The obvious place where this would be the most useful would be the deposit function
https://github.com/ChainSafe/chainbridge-solidity/blob/master/contracts/Bridge.sol#L328
The main issue here is that the method is
payable
for the fee. With a meta txn, this won't work so the fee would probably have to be taken in-kind. Then there's also the question of how does that fee work, is it %, flat, etc.Feels like the most obvious/simple thing to do would be a flat fee map from token address -> fee amount stored in the handler contracts.
https://github.com/ChainSafe/chainbridge-solidity/blob/master/contracts/handlers/ERC20Handler.sol#L14
Apart from that, it looks like the GSN Context is already used in some places
https://github.com/ChainSafe/chainbridge-solidity/blob/6869c8db364926dc8a8fec83cd29e14f8ff532d8/contracts/utils/AccessControl.sol
which will make it relatively easy to integrate.
Looking forward to hearing others' thoughts!
Beta Was this translation helpful? Give feedback.
All reactions