SIP-229: Optimism Bridge for Synths

Author
StatusApproved
TypeGovernance
NetworkEthereum & Optimism
ImplementorTBD
ReleaseTBD
ProposalLoading status...
Created2022-04-04

Simple Summary

Enable the transfer of synths for deposit and withdrawal through Optimism Bridge. Initially, only sUSD will be enabled for transfer.

Abstract

Now that SIP-165 has been completed, sUSD is fungible on L1 and L2. Due to no bridges being set up, however, it is still not possible to send sUSD between layers.

Therefore, in a way similar to how we currently deposit or withdraw SNX from L2, synths will be transferrable using the optimism bridge. A user will be able to call a public function on SynthetixBridgeToOptimism or SynthetixBridgeToBase to initiate a transfer to the other layer by burning synths, and after the grace period elapses, the funds will be minted on the other side.

Motivation

The spartan council has decided not to support SIP-204 for bridging synths between networks. Therefore, to recoup some of the benefit of SIP-165, we must support some method for synth transfer between layers.

This will also lead to easier migration of debt from L1 to L2, forced or not.

Technical Specification

Bridge

New methods initializeSynthTransfer(bytes32 currencyKey, address destination, uint amount) and finalizeSynthTransfer(bytes32 currencyKey, address destination, uint amount) will be added to BaseSynthetixBridge. Upon call to initializeSynthTransfer, the specified synth will be burnt from the user, and a cross-chain message sent to the destination chain counterpart to call finalizeSynthTransfer. When finalizeSynthTransfer is called, the usual checks are done to verify the message origin, and then the appropriate synths are minted for the user.

In order to allow chainlink to track debt which is in transit between chains, the running mapped tallies, synthTransferSent and synthTransferReceived will be recorded. By comparing the difference between these values on opposite chains, it is possible to see how much synth is in transit.

The actual mint and burn will be done through Issuer to reduce the upgrade complexity.

Optimism

The optimism.github.io repository will need to be updated to include the sUSD synth information and contract address so that its information appears on Optimism Gateway. If any other synths are approved by the council in the future, they will need to be added using the same process.

Chainlink will need to track 2 new sources per chain for the issued synths and debt ratio oracle, the synths in transit.

In pseudocode, the new equation for the issued synths value within the debt oracles is:

sum(DebtCache.currentDebt() + SynthetixBridge.synthTransferSent() - SynthetixBridge.synthTransferReceived()) for all chains

Note that the contract calls should be atomic or locked to a specific block on-chain.

Also note, on Optimism, the SynthetixBridge contract is called SynthetixBridgeToBase. On mainnet, the contract is called SynthetixBridgeToOptimism. The appropriate contract should be queried for its address from the AddressResolver as we are doing with existing addresses.

Chainlink will be responsible for implementing the code for this additional requirement.

Configurable Values (Via SCCP)

crossChainSynthTransferEnabled(bytes32 currencyKey): specifies whether or not synth is allowed to be initiated for transfer to other layer. 0 = disabled, all other values = enabled

Copyright and related rights waived via CC0.