Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 1.95 KB

TIP-112.md

File metadata and controls

34 lines (19 loc) · 1.95 KB
id Title Status Author Description Discussions to Created
TIP-112 Upgrade Thales AMM contracts Implemented Danijel (@danthales) Upgrade Thales AMM contract to latest solidity compiler version https://discord.gg/thales 2022-12-07

Simple Summary

This TIP allows Protocol DAO to upgrade Thales AMM contracts on Optimism and Polygon to latest Solidity compiler version

Motivation

Due to legacy code, the version of the AMM we use on Optimism and Polygon has an old Solidity version of 0.5.16. On Arbitrum and BSC we had the chance to upgrade this contract to version 0.8.* which brings various security improvements.

At the moment we are maintaining both versions of the contract across chains which is quite an overhead. We did so as the migration entails deploying a new contract which then also has to be replaced in depending contracts (RangedMarketsAMM, PositionalManager), as well as various integrations (Dune, Teal finance).
However, I think the longer we prolong this, the more challenging the migration becomes, so might as well execute it now.

Specification

As upgrading a proxy contract across solidity versions is not possible, we will deploy a new AMM contract with latest Solidity compiler to Optimism and Polygon and link it to depending contracts, dapps and other integration points.

The new AMM contract will support all existing markets, however all discounts, premiums and risk caps will be reset.

The migration should be executed first on Polygon as the legacy Polygon AMM generally doesnt have many pending positions, and then on Optimism when the timing feels right (when reseting the discounts would not have a great effect on the AMM's PnL).

Thales Vaults will have to have the AMM address updated at the start of a new round.

Implementation

n/a

Copyright

Copyright and related rights waived via CC0.