mobiusAMM / mobius-governance

1 stars 0 forks source link

Test governance contracts with Mobius swap pair and gauges #5

Open kyscott18 opened 2 years ago

kyscott18 commented 2 years ago

Before transferring ownership of all of our contracts to the Governance contracts, I want to make sure that they are compatible by doing a couple of test proposals and transactions.

kyscott18 commented 2 years ago

Mobius governance capabilities

Overview

Mobius governance needs to be in control of all the pools, all the gauges, the gauge controller, the minter, erc20Mobi, and VotingEscrowMOBI. Each of these contracts have their own admins, with some admins intending to be set to other contracts in this list, and others intending to be either under control of a emergency admin or the governance contracts.

Controls of each contract

Erc20Mobi

The Erc20Mobi contract has an admin that can change the name.

VotingEscrow

The VotingEscrow contract has an admin that is the only account that is able to configure a smartContractChecker. This smart contract checker checks certain non-EOA accounts and whitelists them. Otherwise only EOA accounts can lock MOBI.

Swap pools

Swap pools have the power to change amplification coefficients and fees, and also pause the pool to prevent adding liquidity or swapping.

PoolProxy

PoolProxy is a contract that has control of all the pools. It then is able to call all the admin function on all the pools and acts as a reservoir for admin funds, that can then handle a burn mechanism if wanted.

Minter

Minter doesn't have any admin controls

Gauge

Gauge is the staking contract for the Mobius rewards distribution. There are two admin functionalities that are important to note. The first is the ability to kill the gauge, stopping rewards from being distributed to this contract. The second is the ability to set an external rewards, which can allow us to change the contract for distributing Poof, Moo, Celo, Etc.

Gauge Proxy

Gauge proxy is a wrapper over all the gauges. It allows you to control all the gauges with one contract. Gauge Proxy separates the admin functions into an emergency admin that can only kill a gauge, and a ownership admin that is able to kill any gauge or set the rewards for any gauge.

Gauge Controller

Gauge controller is the contract that manages all the gauges for the rewards distribution. It has an admin that is able to add a gauge to the rewards, set a type for a gauge, and then set a reward amount for each type.

kyscott18 commented 2 years ago

To test potential interactions the governance will have I am going to test several proposals that check advanced features of governance to make sure it is functioning properly such as:

  1. Change the implementation of the governance
  2. Kill a gauge through a gauge proxy
  3. Set the admin fee through the pool proxy
  4. Add a gauge through the gauge controller
kyscott18 commented 2 years ago

Implementation changed with https://explorer.celo.org/tx/0x2b409e2f18b14db2d2ad68041c441409663802c950ebdeaf0760ab6ad75d92f0/internal-transactions

kyscott18 commented 2 years ago

Test mobi-dao contracts veMOBI: 0xd2Fc9ebE9602340f9917794d1B549cA3A275dd9f MOBI: 0xA04E399d9b42F1B8F3b11f0685282BfA41912a0a Minter: 0x2B52d2160b088029f689D481BD1f5D3E83e57ba8 GaugeController: 0xF8eABb30A124AAc16B9eD6aFaed830BE30fB128E PoolProxy: 0xb9138AC8fef20ddd2BA853AF38925f60b1714f0d GaugeProxy: 0x61eBd5a8051b255E1bd6dcE769DeA4349aF8B40b LiquidityGauge: 0xBe66E91445E68f9EeF6A4d79596B4e130F7A1B0f LiquidityGauge2: 0x507A04850028A3E309CE5Cb4dcB3C06343552784 Swap: 0x8DA2D5F2d4De1fF5Bb10377D520a84617fc80D36 Swap2: 0x065a10587D189F8050abb1ca4E4341823D2b38ED

kyscott18 commented 2 years ago

Gauge killed with https://explorer.celo.org/tx/0x844ec26ea0de3f5ded42f2c2d231f6aca095df4bb79bcff3331dfb0870ed4dd9/internal-transactions

kyscott18 commented 2 years ago

Swap fee changed with https://explorer.celo.org/tx/0xcd9fc3bc61c9a55b8f19d5df9a710b15be97d5cd9751aa31102119ed914745df/internal-transactions

kyscott18 commented 2 years ago

Gauge added to controller with https://explorer.celo.org/tx/0x8ca5076ec096b891d125c011bddd648492adff4c6e3849be4fa4cb55df7703f2/internal-transactions