-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add description for VIP setting VBNBAdmin
- Loading branch information
Showing
16 changed files
with
160 additions
and
114 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
import { ProposalType } from "../../src/types"; | ||
import { makeProposal } from "../../src/utils"; | ||
|
||
const vBNB_ADDRESS = "0xA07c5b74C9B40447a954e1466938b865b6BBea36"; | ||
const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; | ||
const ACM = "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555"; | ||
const VBNBAdmin_ADDRESS = "0x9A7890534d9d91d473F28cB97962d176e2B65f1d"; | ||
const PSR = "0xCa01D5A9A248a830E9D93231e791B1afFed7c446"; | ||
const RISK_FUND = "0xdF31a28D68A2AB381D42b380649Ead7ae2A76E42"; | ||
const TREASURY = "0xf322942f644a996a617bd29c16bd7d231d9f35e9"; | ||
const FAST_TRACK_TIMELOCK = "0x555ba73dB1b006F3f2C7dB7126d6e4343aDBce02"; | ||
const CRITICAL_TIMELOCK = "0x213c446ec11e45b15a6E29C1C1b402B8897f606d"; | ||
const POOL_REGISTRY = "0x9F7b01A536aFA00EF10310A162877fd792cD0666"; | ||
const NEW_RISK_FUND_IMPLEMENTATION = "0x0E8Ef0EC1e0C109c5B5249CcefB703A414835eaC"; | ||
const PROXY_ADMIN = "0x6beb6D2695B67FEb73ad4f172E8E2975497187e4"; | ||
|
||
export const vip189 = () => { | ||
const meta = { | ||
version: "v2", | ||
title: "VIP-189 Automatic income allocation: deployment stage 1", | ||
description: `#### Summary | ||
If passed, this VIP will change the admin of the [VBNB market in the Core pool](https://bscscan.com/address/0xA07c5b74C9B40447a954e1466938b865b6BBea36), from the [Normal Timelock](https://bscscan.com/address/0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396) contract to the new contract [VBNBAdmin](https://bscscan.com/address/0x9A7890534d9d91d473F28cB97962d176e2B65f1d). Moreover, it will upgrade the implementation of the [RiskFund](https://bscscan.com/address/0xdF31a28D68A2AB381D42b380649Ead7ae2A76E42) contract, to support funds from the Core pool. | ||
#### Description | ||
This VIP is part of the proposal [Automatic Income Allocation & Token Converter](https://community.venus.io/t/automatic-income-allocation-token-converter/3702), published in the Venus community forum. At this time, it only affects the reserves generated by the VBNB market in the Core pool as the BNB contract is not upgradable and need to be dealt with separately. | ||
The new VBNBAdmin will be authorized to reduce the reserves of the VBNB market, and send them to the new [ProtocolShareReserve](https://bscscan.com/address/0xCa01D5A9A248a830E9D93231e791B1afFed7c446) contract, where distribution rules are configured following the [protocol tokenomics](https://docs-v4.venus.io/governance/tokenomics): | ||
- 40% to the RiskFund contract | ||
- 40% to the [Venus Treasury](https://bscscan.com/address/0xf322942f644a996a617bd29c16bd7d231d9f35e9) contract | ||
- 10% to the Venus Prime Program. This 10% will be sent temporarily to the Venus Treasury, until the Venus Prime contract is ready. | ||
- 10% for the XVS Vault rewards. This 10% will be sent temporarily to the Venus Treasury, until the [Token Converter contracts](https://community.venus.io/t/automatic-income-allocation-token-converter/3702) are ready. | ||
With this change, BNB reserve transfers will be performed in a permissionless fashion. | ||
Moreover, VBNBAdmin wraps the BNB reserves into [WBNB](https://bscscan.com/address/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c), so the downstream contracts do not have to deal with native tokens anymore, simplifying the logic. | ||
There will be a second stage for the Automatic Income Allocation, proposed in the following days, where the markets of the Core pool and the markets of the Isolated pools will start using this new ProtocolShareReserve contract. | ||
The owner of the VBNBAdmin contract is the Normal Timelock. The owner of the new ProtocolShareReserve contract is also the Normal Timelock. | ||
**Security and additional considerations** | ||
We applied the following security procedures for this upgrade: | ||
- **VBNB configuration post upgrade**: in a simulation environment, validating the configuration of the VBNB contract is the expected one after the VIP | ||
- **Reduce reserves from the VBNB contract**: in a simulation environment, validating the BNB reserves are distributed as expected to the different destinations: RiskFund and Venus Treasury | ||
- **Deployment on testnet**: the same VBNBAdmin and ProtocolShareReserve contracts were deployed and configured to testnet, and used in the Venus Protocol testnet deployment | ||
- **Audit: Quantstamp, Certik, Peckshield and Fairyproof have audited the deployed code** | ||
**Audit reports** | ||
- [Quantstamp audit report (2023/09/13)](https://github.com/VenusProtocol/venus-protocol/blob/9ef8901dfef84a11338751881fd10a2d36c576ad/audits/058_automatic_income_allocation_quantstamp_20230913.pdf) | ||
- [Certik audit audit report (2023/09/12)](https://github.com/VenusProtocol/venus-protocol/blob/90f913fd345c24c60efa613ab5ab7e633b7aa07a/audits/059_automatic_income_allocation_certik_20230912.pdf) | ||
- [Peckshield audit report (2023/08/12)](https://github.com/VenusProtocol/venus-protocol/blob/90f913fd345c24c60efa613ab5ab7e633b7aa07a/audits/054_automatic_income_allocation_peckshield_20230812.pdf) | ||
- [Fairyproof audit report (2023/08/03)](https://github.com/VenusProtocol/venus-protocol/blob/90f913fd345c24c60efa613ab5ab7e633b7aa07a/audits/050_automatic_income_allocation_fairyproof_20230803.pdf) | ||
**Deployed contracts on main net** | ||
- [VBNBAdmin](https://bscscan.com/address/0x9A7890534d9d91d473F28cB97962d176e2B65f1d) | ||
- New [ProtocolShareReserve](https://bscscan.com/address/0xCa01D5A9A248a830E9D93231e791B1afFed7c446) | ||
**References** | ||
- [Pull request with the VBNBAdmin contract](https://github.com/VenusProtocol/venus-protocol/pull/289) | ||
- [Simulation post upgrade](https://github.com/VenusProtocol/vips/pull/53) | ||
- [Documentation](https://docs-v4.venus.io/technical-reference/reference-technical-articles/automatic-income-allocation)`, | ||
forDescription: "Execute this proposal", | ||
againstDescription: "Do not execute this proposal", | ||
abstainDescription: "Indifferent to execution", | ||
}; | ||
|
||
return makeProposal( | ||
[ | ||
{ | ||
target: PROXY_ADMIN, | ||
signature: "upgrade(address,address)", | ||
params: [RISK_FUND, NEW_RISK_FUND_IMPLEMENTATION], | ||
}, | ||
{ | ||
target: VBNBAdmin_ADDRESS, | ||
signature: "acceptOwnership()", | ||
params: [], | ||
}, | ||
{ | ||
target: vBNB_ADDRESS, | ||
signature: "_setPendingAdmin(address)", | ||
params: [VBNBAdmin_ADDRESS], | ||
}, | ||
{ | ||
target: VBNBAdmin_ADDRESS, | ||
signature: "_acceptAdmin()", | ||
params: [], | ||
}, | ||
{ | ||
target: PSR, | ||
signature: "acceptOwnership()", | ||
params: [], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "addOrUpdateDistributionConfigs(DistributionConfig[])", NORMAL_TIMELOCK], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "addOrUpdateDistributionConfigs(DistributionConfig[])", FAST_TRACK_TIMELOCK], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "addOrUpdateDistributionConfigs(DistributionConfig[])", CRITICAL_TIMELOCK], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "removeDistributionConfig(Schema,address)", CRITICAL_TIMELOCK], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "removeDistributionConfig(Schema,address)", FAST_TRACK_TIMELOCK], | ||
}, | ||
{ | ||
target: ACM, | ||
signature: "giveCallPermission(address,string,address)", | ||
params: [PSR, "removeDistributionConfig(Schema,address)", NORMAL_TIMELOCK], | ||
}, | ||
{ | ||
target: PSR, | ||
signature: "addOrUpdateDistributionConfigs((uint8,uint8,address)[])", | ||
params: [ | ||
[ | ||
[0, 40, RISK_FUND], | ||
[0, 60, TREASURY], | ||
[1, 50, RISK_FUND], | ||
[1, 50, TREASURY], | ||
], | ||
], | ||
}, | ||
{ | ||
target: PSR, | ||
signature: "setPoolRegistry(address)", | ||
params: [POOL_REGISTRY], | ||
}, | ||
], | ||
meta, | ||
ProposalType.REGULAR, | ||
); | ||
}; |