Collateralization Oracle (v2)#146
Conversation
|
|
||
| /// @title a PCV Deposit interface for Fei V2 | ||
| /// @author eswak | ||
| interface IPCVDepositV2 is IPCVDeposit { |
There was a problem hiding this comment.
Ultimately we should just add these methods to the original interface (but I know that would lead to many compilation errors so we should wait until ready to add all of these methods to existing contracts)
45284eb to
2ddc62b
Compare
|
I rebased the branch & updated target to |
| /// of a deposit (holding the same token) is deployed. | ||
| /// @param _oldDeposit : the PCVDeposit to remove from the list. | ||
| /// @param _newDeposit : the PCVDeposit to add to the list. | ||
| function swapDeposit(address _oldDeposit, address _newDeposit) external onlyGovernor { |
There was a problem hiding this comment.
Thoughts on just calling add then remove? It takes a bit more gas but may reduce complexity. This function is pretty simple so I don't feel strongly about it.
There was a problem hiding this comment.
best code is no code 👍
There was a problem hiding this comment.
Now that the logic is remove + add I don't think we need to enforce the tokens are the same as they are effectively distinct operations
Joeysantoro
left a comment
There was a problem hiding this comment.
Added one last nit. Contract looks fantastic
|
|
||
| /// @notice returns true if a token is held in the pcv | ||
| function isTokenInPcv(address token) external view returns(bool) { | ||
| return tokensInPcv.contains(token); |
There was a problem hiding this comment.
Aren't we better off looking up a token in the tokenToOracle mapping and ensuring that the resulting address is not address 0 instead of enumerating over a list of addresses?
This PR adds the Collateralization Oracle required for the V2.
In short, this new oracle...
onlyGovernor)setOracle(token, address))The new PCVDeposit interface has the following methods :
balanceReportedIn()the token address used for accounting in this depositbalanceAndFei()the resistant token balance & the protocol-owned FEI in this depositThe CR Oracle has a function
pcvStats()that returns :