SIP-30: Deprecate ERC223 from SNX and all Synths.
Deprecate ERC223 from SNX and all Synths to save gas on dex exchanges and no transaction errors.
The UX for Mintr drove the implementation of ERC223 to reduce the number of transactions a user(minter) had to execute to deposit their sUSD into the Depot FIFO queue to be sold for ETH from 2 to 1 by only eliminating the ERC20 approve transaction prior to calling a ERC20 transferFrom. While this has been a nice UX for mintr users with the Depot the benefits of ERC223 transfer have not outweighed the cons on contract to contract transfers;
- Bloated gas estimations Issue 243
- Causing gas loss Issue 243
- Perceived errors in SNX and Synth Transfers etherscan
There is a lot of Dex activity happening now with SNX on uniswap, Kyber, sUSD uniswap, Kyber and sETH uniswap. The ERC223 implementation is causing a significant cumulative gas loss trading these tokens. We aim to reduce the total gas lost / consumed trading Synthetix tokens.
This will also enable better (cheaper) composability as teams integrate Synths to build Defi products.
- Removing all ERC223 is a simple code change to
ExternStateToken.solwhich is inherited by
- It will require all Synths & SNX to be redeployed but no proxy addresses will change keeping all existing token addresses.
- The current Depot will no longer be able to accept sUSD deposits effectivly putting it to its end of life.
- A new Depot will be required which will go back to using the original ERC20 approve, transferFrom workflow. This could be an opportunity to makes some additional improvements to the Depot such as making it upgradable. Putting it behind a proxy and giving it an external state contract so its logic can be upgraded.
- Removing ERC223 will no longer show the transfer errors in contract to contract transfers. Uniswap sETH exchange
- This will also save 200K gas per contract to contract transfer. github code reference
- Reclaim byte code space for SNX contract deployment by removing the ERC223 implementation in
- The current Depot will no longer be able to accept sUSD deposits but withdrawals and buying sUSD with ETH will still work as expected. It could stay until it is drained of sUSD supply.
- A new Depot version will need to be deployed to allow sUSD deposits. The Dapps will need to switch over to using this Depot for sUSD purchases with ETH when the FiFo queue is drained.
- Mintr will need to be updated to include an approve transaction for the Depot to call transferFrom to transfer the minters sUSD from their wallet to itself and create a deposit entry.
Copyright and related rights waived via CC0.