|
| 1 | +# VToken Proxy Factory |
| 2 | + |
| 3 | +This factory deploys a ERC-1967 compliant transparent proxy and initializes it with the implementation of VToken. |
| 4 | + |
| 5 | +## deploy |
| 6 | + |
| 7 | +```solidity |
| 8 | +function deployVTokenProxy( |
| 9 | + VTokenArgs memory input |
| 10 | +) external returns (VToken) |
| 11 | +``` |
| 12 | + |
| 13 | +#### Parameters |
| 14 | + |
| 15 | +| Name | Type | Description | |
| 16 | +| ---- | ---- | ----------- | |
| 17 | +| `input` | VTokenArgs memory | `VTokenArgs` struct with the parameters for the new market | |
| 18 | + |
| 19 | +The parameters are defined as follows: |
| 20 | +``` |
| 21 | +struct VTokenArgs { |
| 22 | + address underlying_; |
| 23 | + ComptrollerInterface comptroller_; |
| 24 | + InterestRateModel interestRateModel_; |
| 25 | + uint256 initialExchangeRateMantissa_; |
| 26 | + string name_; |
| 27 | + string symbol_; |
| 28 | + uint8 decimals_; |
| 29 | + address payable admin_; |
| 30 | + AccessControlManager accessControlManager_; |
| 31 | + VTokenInterface.RiskManagementInit riskManagement; |
| 32 | + address vTokenProxyAdmin_; |
| 33 | + VToken tokenImplementation_; |
| 34 | +} |
| 35 | +
|
| 36 | +struct RiskManagementInit { |
| 37 | + address shortfall; |
| 38 | + address payable riskFund; |
| 39 | + address payable protocolShareReserve; |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +| Name | Type | Description | |
| 44 | +| ---- | ---- | ----------- | |
| 45 | +| `underlying_` | address | The underlying BEP-20 token to list | |
| 46 | +| `comptroller_` | address | The pool Comptroller | |
| 47 | +| `interestRateModel_` | address | Interest rate model to use | |
| 48 | +| `initialExchangeRateMantissa_` | uint256 | The VToken to underlying exchange rate to start with | |
| 49 | +| `name_` | address | VToken name (usually it's "Venus " + underlying name) | |
| 50 | +| `symbol_` | address | VToken symbol (usually it's "v" + underlying symbol) | |
| 51 | +| `decimals_` | address | VToken decimals (the convention is to use 8 decimals for vTokens) | |
| 52 | +| `admin_` | address | VToken admin (should be Governance). Note that this is **not** the upgradeability administrator | |
| 53 | +| `accessControlManager_` | address | [AccessControlManager](../governance/access-control-manager.md) contract | |
| 54 | +| `riskManagement` | RiskManagementInit | Addreses of the [Shortfall](../shortfall.md), [Risk Fund](../risk-fund.md), and [Protocol Share Reserve](../protocol-share-reserve.md) contracts | |
| 55 | +| `vTokenProxyAdmin_` | address | The address of the upgradeability admin | |
| 56 | +| `tokenImplementation_` | address | VToken implementation contract | |
0 commit comments