EIP2 - Enabling Cheaper L1 / L2 Wrapping

Author

@kbrizzle (Equilibria)

Background

Currently, wrapping and unwrapping USDC to and from DSU is gas cost prohibitive in the Empty Set protocol.

These operations require performing a Compound mint or redeem internally so that no USDC sits idle in the Empty Set reserve contract. This ensures a trustless mechanism, however it comes at the expense of extremely high gas costs for these operations (approx. 250,000 - 275,000).

L2 Extensibility

In addition to the high gas costs on L1, there is no feasible way to wrap / unwrap directly on L2. Currently, DSU must be bridged to an L2 before it can be used there, making it less accessible and increasing its volatility around the peg.

Trusted Borrowing

We propose adding a new feature to the Empty Set reserve called Trusted Borrowing which allows the Empty Set DAO to front DSU to programmatically-trusted contracts, which are able to ensure that they can repay the fronted DSU in full at all times.

Interface

borrow(address account, uint256 amount)

  • Allows owner of the protocol (DAO) to front DSU to account.

repay(address account, uint256 amount)

  • Allows the borrower contract to repay their debt.

debt(address account) returns (uint256)

  • The outstanding debt for contract account.

totalDebt() returns (uint256)

  • The total outstanding debt.

Implementation

An initial implementation can be seen here.

Safety

To improve safety, the initial list of borrowable contracts should be hardcoded into the reserve to dissuade abuse.

L1 Batcher

The first of these trusted contracts would be a wrapping-only batcher contract. This is the lowest hanging fruit and doesn’t rely on a USDC buffer, but still grants a vastly cheaper onboarding experience into DSU.

This batcher reduces wrapping gas to approx. 80,000 - 115,000 depending on the prior state of the sender and batcher. When included as an operation of a forwarder contract, this is further reduced to 60,000 - 95,0000.

Implementation

An initial implementation can be seen here.