Problem
PermittableToken
, the contract implementing all token logic for bridge tokens from the OmniBridge causes some pain points with development experience.
Notably, there are multiple code-paths within PermittableToken
that revert
with no reason string, or custom error. This creates user-experience problems where a transfer (as an example), may Fail
, and subsequently provides no input to the user as to what the actual problem is.
As an example, if Alice
wants to send Bob
10 XYZ
but only has a balance of 9 XYZ
, her transfer will Fail
. When Alice
, being diligent, checks Gnosis Scan, her transaction just shows Fail
- no error message.
While the above is trivially identifiable where the error is, the issue becomes more nuanced when a user may subsequently be importing CSVs and making transactions, where the CSV actually contains errors associated with rounding precision. While not an issue of Gnosis Chain’s specific making, debugging arbitrary Fail
transactions requires non-trivial knowledge of stepping through the transaction with a debugger to see the failure point. A user shouldn’t be expected to do this.
Normally, token contracts are immutable, however due to the critical nature of the Omnibridge, the PermittableToken
contract is perceived as somewhat of a “core” contract. To upgrade such a contract requires a hardfork of Gnosis Chain.
Solution
Ensure that all failure paths provide a reason (such as ERC20: Insufficient Balance
etc).
Risks
Upgrading PermittableToken
carries heavy risk as it affects all bridged tokens. Extreme care needs to be taken on keeping the code base auditable.
Enhancements
If it were decided to smooth the user experience, there are a couple of other features that could also be simultaneously implemented in order to greatly improve the Gnosis Ecosystem interoperability, notably:
-
PermittableToken
does not support ERC-1271 smart contract signatures forpermit
. While not required by EIP-2612 Permittable Tokens, enabling this support greatly improves the user experience forSafe
users. - A perhaps more controversial / less-implemented extension to be considered as well to implement is ERC-3009: Transfer With Authorization, such as that deployed in
USDC
’sFiatToken_V2_1
proxy implementation on mainnet. If this were to be implemented as part of this proposal, in addition to (1) above, it would be suggested to allowEIP-1271
authorization as well here. The advantage in this case is that aSafe
could authorize multiple payments, (via signing aSafeMessage
) and these payments could be pulled in various order, eliminating thenonce
binding for transactions otherwise. The alternative here is to enable aSafe
module.
The above 2 enhancements would greatly smooth the user experience for dealing with bridge tokens on Gnosis Chain.