lekhovitsky, desnake
[GIP-230] outlined the vision and design for Gearbox v3.1 and the Permissionless update. This proposal presents the first actionable steps to implement that plan, seeking DAO approval for key actions to deploy and configure the Permissionless system.
The v3.1 Permissionless system is audited by ChainSecurity (audits are already public and can be seen here).
Among the key contracts of Permissionless system are Cross-Chain Multisig deployed at 0xcCcccCcCC78ed81c09A9415c7B836e3a4Ea381De, Instance Manager deployed at 0x77777777dC70963123bf5A6ED99663fEB824c03A, and Bytecode Repository deployed at 0x9700a405AFF956f0BAafC0a7eC57b71e656d5D9B (these addresses are identical for all chains).
Cross-Chain Multisig consists of the same signers as existing Technical Multisig and is currently owned by Technical Multisig (in future, ownership shall passed to an on-chain voting system). Instance Manager is owned by Cross-Chain Multisig with ownership to be passed to chain-specific Instance Owners upon activation of each instance. Bytecode Repository is configured by Cross-Chain Multisig.
Note: adding auditors is a chain-agnostic transaction, meaning that after being signed by Cross-Chain Multisig it can be executed on any chain (that is active now or will be activated in the future).
Bytecode Repository stores smart contract bytecodes and audit details, enabling permissionless deployment and validation across the Gearbox protocol. Bytecodes and auditor signatures can be uploaded permissionlessly, encouraging external collaboration.
The initial list of whitelisted auditors' addresses to be added via addAuditor function of Bytecode Repository is as follows:
Note: adding public domain is a chain-agnostic transaction, meaning that after being signed by Cross-Chain Multisig, it can be executed on any chain (that is active now or will be activated in the future).
There are two kinds of contract domains: public and system.
Below is proposed initial list of public domains to be created using addPubicDomain function of Bytecode Repository:
"ADAPTER""BOT""DEGEN_NFT""IRM""LOSS_POLICY""PRICE_FEED""RATE_KEEPER""ZAPPER"New public domains can only be added by DAO, to avoid cybersquatting and other misuse.
Note: allowing contracts is a chain-agnostic transaction, meaning that after being signed by Cross-Chain Multisig it can be executed on any chain (that is active now or will be activated in the future).
The list of contracts initially uploaded to the Bytecode Repository can be seen here.
It is proposed to allow the 24 contracts listed in _getCoreContracts function as system contracts using allowSystemContract function of Bytecode Repository.
For completeness, it is also proposed to allow remaining contracts from this file as public in the same batch using allowPublicContract function of Bytecode Repository even though it doesn't require Cross-Chain Multisig permissions.
Note: deploying system contracts is a chain-agnostic transaction, meaning that after being signed by Cross-Chain Multisig it can be executed on any chain (that is active now or will be activated in the future).
Some system contracts are required to be deployed from the day-0, below is the list to be deployed using deploySystemContract function of Instance Manager.
BotListV3GearStakingV3 (note that this contract isn't redeployed for chains with existing using existing v3.0 staking contract)PriceFeedStoreMarketConfiguratorFactoryCreditFactoryPoolFactoryPriceOracleFactoryInterestRateModelFactoryRateKeeperFactoryLossPolicyFactorySome contracts require different implementations for interacting with specific tokens. For example, existing Pools and Credit Managers for USDT use implementation that accounts for USDT-specific transfer fees.
It's proposed to add USDT-specific postfix on Mainnet using setTokenSpecificPostfix function of Bytecode Repository.
Note: adding global addresses is a chain-agnostic transaction, meaning that after being signed by Cross-Chain Multisig it can be executed on any chain (that is active now or will be activated in the future).
It is proposed to save some global addresses for easier discovery by off-chain services via setGlobalAddress function of the Instance Manager contract.
Compressors are periphery contracts not intended for on-chain usage and mostly used by Gearbox SDK and services that are reliant on it allowing to get useful data in an easy to work with format. The list of compressors to be saved can be found here.
Router is another periphery contract that builds routes to enter into and exit from positions and is used extensively by front-end as well as liquidation bots.
For chains with existing v3.0 markets it's also proposed to store the address of a legacy router contract:
Gearbox DAO approves operations of the Protocol by activating Instance for a particular chain using activate function of Instance Manager.
The list of instances to activate is as follows:
Proposed instance owner is 4/12 multisig that consists of existing members of Technical Multisig, except that Mikko is replaced with desnake.
As described in [GIP-230], Instance Owners' goal is to ensure that Risk Curator are equipped with sufficient list of available price feeds. Instance Owners' sole goal is to serve as a preliminary protection layer against misconfigurations and malicious actions.
Once ownership of Instance Managers is given to an Instance Owner, DAO fully passes decision-making power to an IO to further act without additional DAO approvals.
Note: GEAR token is not present on Avalance and BNB Chain, hence its address is not set upon activation. Should the token ever be added there at some later stage, it can be set by Cross-Chain Multisig using setGlobalAddress function of the Instance Manager contract.
Upon DAO approval via this GIP, transactions will be submitted to the Cross-Chain Multisig for signing by Technical Multisig members. All actions are designed to align with the audited v3.1 Permissionless system, ensuring security and decentralization.
To speed up implementation, this GIP doesn't include the list of transactions, hashes of bytecode to allow and addresses of compressors and router which undergo rigorous testing at this very moment. Instead, it just lists steps to be executed by the Cross-Chain Multisig in a descriptive manner. Taken that these transactions set up new entities and their configs, no existing positions and funds are affected by its correctness.