VIP 10: Deploy and Authorize ERC20 Allocator

Motivation

Create infrastructure allowing Volt Protocol to easily move protocol assets between the Peg Stability Modules where VOLT is minted or redeemed, and yield venues like Compound v2.

Description

This Volt Improvement Proposal creates an ERC20 Allocator contract that can be used to easily move funds between Peg Stability Modules where VOLT is minted and redeemed, (PSMs) and whitelisted yield venues.

There are limits on both the total amount that will be held idle in the PSMs at any given time, and on the total amount that can be moved into the PSMs daily, so that if losses occur in the system, they can be fairly accounted for across all VOLT holders instead of the first to exit getting out ahead of the rest. The initial limits are such that at most 1/4 of the VOLT supply can be redeemed per day (buffer cap of $250k, target balance of $100k). A subsequent VIP will add a mechanism by which a larger portion of the supply can be redeemed on demand, so long as all funds are safely withdrawn from venues by the redeemer.

Code and Security

View the pull request on Github.

Primary author: Elliot Friedman

Reviewers: Al-Kassim Kassim, Erwan Beauvois, Tom Waite, Namaskar, and 0xBookland.

Audit Log:

Code review with Kassim: 9/11 1 hour review, found 1 high issue that could have caused a failure on drip if decimals aren't 18 on underlying token and adjustedAmountOut would have been larger than the available buffer.

Bug was promptly patched after the review.

9/11 1.2 hour code review with Kyle and Russell. No medium or high issues found. 1 low issue found which was both the overloaded skim and drip function took a PSM param, but these functions that accepted the psm address were not needed because the psm can always be found from the pcvDeposit's address.

Low issue was promptly fixed after the review.

9/11 50 minute code review with Erwan. No high, medium or low issues found. Compared RateLimitedV2 to FEI implementation. RateLimitedV2 is forked off of VOLT's version of RateLimited which had the RateLimited feature and was audited by both zellic and code4rena. Erwan to review diff offline.

9/12 Review with Kassim, able to make 1 function targetBalance external as it was marked as public. Added 2 additional tests to assert that the onlyGovernor modifier was working correctly on 2 permissioned functions.

Had internal discussion at standup and moved the maximum amount that can leave the system at once down to 500k from 700k by adjusting buffercap down from 500k to 300k as each psm holds 100k.

9/12 Review with Tom, all low issues found. 1. add explicit rather than implicit checks that the address of the PSM is not 0 in drip, skim and doAction. 2. edit PSM should not allow changing of decimals as this only introduces additional ways things could fail. 3. change name of editPSM function to editPSMTargetBalance because now you can only edit the target balance of the psm 4. events in _skim and _drip should emit the destination of funds transferred for off chain tracking.

9/12 All bugs patched at commit hash 6fcc2e0
1 Like

VIP-10 will be submitted tomorrow pending today’s final review.

VIP-10 was submitted to the timelock today and will go live tomorrow afternoon.

VIP 10 is now live!