-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loan Repayment - VIP 3 #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just one comment on the differences in balance, and also we could add a test for the revokeReceivedToken
function
…date function, rename variable in LoanRepayment integration test
… into feat/loan-repayment
…ork with TribalCouncil timelock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! just curious about the changes on the IntegrationVoltDeployment
test
* remove vcon deployment from core init method * add core unit tests * VOLT Protocol System Documentation * fix typo * add title to image imports * image import casing * SPO update * add audits * add zellic audit report * Update SystemArchitecture.md * Update docs * Readme * VOLT System pic * update with newest C4 items * add system deploy script * refactor deployment script * fix ScalingPriceOracle test * move scripts to deploy folder * compound interest on request instead of fulfill * remove local oracle contracts from config * add sequential test * update tests * add tests * use parseEther in config file * remove return from oracle deploy * update comments in deploy scripts * remove console.log, added comment to inflation data in config and new test script * add explanation to hardhat gas price config * chore: rename function to fetch oracle price * fix: test fix * fix: test & deployment fix * chore: add docs for running locally * Add backwards compatibility with the frax system * PSM deposits on mint * update starting price to FPI price in ScalingPriceOracle * address requested changes * ⚡mainnet deploy⚡ * update config, fix failing tests * add protocol multisig * add etherscan api key env * feat: setup psm router * add pcv deposit deploy script, deploy fuse volt pcv deposit * router tests * rate limited fix * update MultiRateLimited contract, fix issues, add addAddressUnderCaps method * update interface and tests * DSTest imports Deviation.sol * remove using deviation from DSTest * caleb was right on the naming * test: add more router tests * test: remove router specific tests * choose right block number * fix failing integration tests * tests pass * tests passing now * GlobalRateLimitedMinter and NonCustodial PSM deployment script, updated deployed contracts in config * deploy volt/fei swap contract * inline functions * remove hardhat console * address elliots comments * remove getMaxMinAmountOut * remove maxmint test * psm router deploy & verify * revert package-lock.json changes * feat: setup pcv guardian * intial whitelist in constructor * address comments, setup unit test * remove unused modifier * Aave PCV Deposit * add forge aave pcv deposit test * Price Bound PSM * update config to have volt address properly cased, add checks to deploy script to ensure params are properly configured * update comments in deploy script * add unit tests * add integration tests * setup deployment script * include scripts in tsconfig * remove console.sol * add integration tests, fix deployment script to have proper floor and ceiling price * fix test * remove useless tests * verify script, add PriceBoundPSM address to config * complete deployment script * test tweaks * cleanup * validate whitelisted addresses * fix assertions * IPCVGuardAdmin.sol * add pcv guard admin contract & tests * fix integration test contract naming * deployment script adjustments * comment fix * add more tests * comment fix * add withdrawAllToSafeAddress function & minor tweaks * renaming & cleanup * add natspec comments for clarity * natspec fixes * add withdrawERC20ToSafeAddress function * deploy script cleanup * remove pause/unpause logic * add withdrawAllERC20ToSafeAddress * do not grant roles & validate deployment on mainnet * natspec & error messages clarity * fix typo * clearer error messages * fix revert tests * remove unneccessary check, fix typo * natspec fixes, test cleanup * minor test cleanup * add pcvdeposit pause tests * fix typo, index token in event * rename pausablelib typo * run deploy script validation locally * update & use helper logic * impersonate protocol multisig * cleanup & add addresses to config file * USDC PSM (#76) * add usdc psm * add tests, fix logic error in OracleRef, add comments to deploy script * update deployment script to use correct floor and ceiling prices * update naming in tests, add additional docs in deploy script * change naming in usdc psm * remove unused vars in integration test * remove unused vars in test * remove incorrect comment * add comment in integration tests * add explainer comments to deploy script * update reserves threshold to be uint_max so that surplus can never be allocated * add USDC PSM to config file, add newlines and logging on etherscan verification * remove unused roles (#78) * Timelock Setup (#80) * add scripts to construct calldata * proposal calldata constructing * Construct call and execution data * Bump OZ contracts version, fix failing tests, set up timelock integration testing framework * remove dummy vip vip_2 * cleanup * update comment on cancelling proposals in OA contract * update comment in OA, upgrade to async 2.6.4 * add integration test for OA timelock * forge oa timelock integration tests * L2 Arbitrum Deployment (#77) * first cut of l2 oracle and core contracts * add fuzz tests * update fuzz test runs and max fuzz rejects * l2 deployment * add oracle and oracle pass through to the deployment, updated Config.ts, removed unused deployment files * validate current and previous month, also validate change rate basis points * add chainlink l2 info * override function ownerSyncOraclePrice * house cleaning, remove sync logic * remove _setStartTime * update mint fee to 50bps, complete etherscan verification in l2 deploy script, update comments * update unit tests to check remaining time * add tests for L2Core, add more assertions for L2ScalingPriceOracle, add USDC PSM into deploy script * add more assertions to L2Core test * polish l2 core tests * remove empty newline in deploy script, add usdc psm in arbitrum config * add govern role to config, add additional validation around PCV Guardian and Guard Admin roles in l2 deployment * add additional checks that core contract is correct on deployed contracts * update deploy script * Add integration test for L2 oracle, comment in L2Core changed from Arbitrum to L2 * refactor deployment script to use mainnetAddresses.ts instead of addresses from Config.ts * L2 deploy refactor into respective deploy, configuration, validation, and block explorer verify scripts * add arbitrum smart contracts * validated deployment on arbitrum, adjusted scripts for updates to deploy script * change type to l2 scaling price oracle in types.ts * Scaling Price Oracle Sets Chainlink Token (#81) * Scaling Price Oracle sets chainlink token when not on local network * update with new params from may numbers * update ScalingPriceOracle to use chainlink token provided in constructor rather than function setPublicChainlinkToken * add arbitrum chainlink token to config * add test to verify cl token address, expose getter method in SPO to get cl token address * add new scaling price oracle to mainnet addresses file, remove unnecessary comment * Refactoring & Test Cleanup (#79) * update test block number * remove PSM router * generalize tests * change block number * use guardian address in correct places * clean up PCV Guardian tests * remove safe cast where not needed * add comment for clarity * remove safemath * use mainnetaddresses.sol for usdc psm tests * use mainnetaddresses.sol for fei psm tests * use mainnetaddresses.sol for pcv guardian tests * generalize withdraw amount * rename feitestaddresses to volttestaddresses * rename address section * Fix Failing Tests (#84) * remove unused import * fix imports & failing tests * Generic deployment script (#86) * Timelock Deploy Script (#88) * add new EOA's to mainnetAddresses, create timelock deploy script * timelock deploy update to wait for transactions to resolve, add timelock controller addresses to mainnetAddresses * updated timelock deployment script to no longer use env variables, do not grant msig admin role over timelock, simulation scripts point to new timelock, integration tests, remove optimistic timelock * update addresses to new timelocks where only the timelock is the admin on mainnet and arbitrum * remove optimistic timelock unit tests and deploy script * executors * add new timelocks * Add Arbitrum addresses, remove deprecated integration tests (#90) * Role Integration Testing (#89) * Role Integration Testing * update integration test run script, remove gas coverage integration tests * add setup function to role test * remove console log and add setup function to arbitrum tests * fix integration tests * remove arbitrum tests * remove arbitrum role test * Add Arbitrum addresses, remove deprecated integration tests * Arbitrum Role Integration Testing * remove deprecated volt system integration test * update test structure * Create k-array tree to test role hierarchy * Add method to set role of a node, add test for mainnet roles * forge install: forge-std * add solidity 0.8.13 to hardhat config file * Fix unit tests and KArray tree class * add exists function, add additional test coverage to KArray tree * add tests for free, delete the whole array in free * simplify insert method * revert back to DSTest to fix hardhat build issue * Remove deprecated contracts and roles * all integration tests complete * remove unused IERC20, VOLT and VCON imports * remove forge-std * move state variables into RoleConfig contracts * additional cleanup * update naming for PCV Guardian in address file * update to PCV_GUARDIAN in arbitrum addresses * Loan Repayment - VIP 3 (#85) * Volt Improvement Protocol #3, timelock script, integration tests * update check proposal script, add additional validation in vip_3 validate function, rename variable in LoanRepayment integration test * Deploy OTC Escrow Contract * update integration tests, deployment scripts, and VIP-3 proposal to work with TribalCouncil timelock * added new otc escrow contract and updated block number * Create VIP Simulation Framework (#91) * Create VIP simulation framework * Framework update to allow timelock simulation + role testing * ⚡volt protocol⚡ * remove javascript tests * update circleci config * remove hardhat compile from config * remove compile in buildgp * lowercased VIP import * fix typo in running tests for mainnet * remove javascript unit tests * add forge to unit test environment runner * remove duplicate restore cache * remove unit test parallelization * rename to AllRoles * fix capitalization issue for hardhat compile * remove arbitrum roles config, enhance testRoleArity error message * Add Kyle and Russel oracle audit reports (#92) * remove loan repayment integration test (#93) * Remove Failing Deviation Unit Test (#95) * remove division by 0 in unit deviation test * ensure both x and y are non zero * remove failing fuzz unit test * remove block numbers from package.json * remove block numbers from package.json * Volt System Oracle (#82) * Volt System Oracle * remove reference to scaling price oracle, and instead set start price in the constructor * add helper method to fuzz tests to avoid duplicate logic in tests * add new fuzz tests * fix failing tests from merge with develop * fix failing integration test * add fuzz test for multiple sequential compounding periods * fix fuzz test for multiple sequential compounding periods * add oracle integration tests * add integration tests for PSM swaps * fix PR feedback review * fix nits * remove cycles terminology * make period max 6,193 in fuzz test * remove duplicate contract calls in unit test * remove fuzz test and instead test all 6,192 states instead * add redeem flow for integration test * VIP-2, deploy new Oracle Pass Through, Volt System Oracle, and set PSM Oracle to point to new Oracle Pass Through * add arbitrum integration tests * Add newlines in VoltOracle doc, remove whitespace in config.yml * fix unit tests, add additional test coverage around oracle end time, update test run script in package.json * Update VoltOracle.md Co-authored-by: Kyle <kyletrusler@gmail.com> * remove word minified from VoltOracle * Update to use LaTex * update LaTeX to include original formula, and left justify content * LaTeX * remove non LaTeX from github formula * add arbitrum simulation framework * add linear interpolation formula and unit tests to verify algorithm * streamline tests * test lerp across each day in a whole year * vip 2 additions to add eoa guardian on arbitrum, cleanup revoked role on arbitrum proposer, add new eoa1 proposer to timelock * grant eoa 2 guardian on mainnet * Governance Docs * Move Volt System Oracle to monthly compounding * Update name in package.json * Docs on known contract limitations * set mint fee basis points to 0 on L1, and 5 basis points on L2 * Add integration tests to lower mint fee on L1 to 0 and L2 to 5 bps * fix Russel's feedback on PR, corrected vip_2 typo, updated arbitrum integration test to pass after upgrade, removed magic address and switched to ArbitrumAddresses * remove unneeded override in VoltSystemOracle.sol state variables * fix arbitrum test comments and variable names * remove all references to previous 1 year compounding period * update docs to use the month instead of year for period, renamed variable in unit test * add todo in config * update governance actions to not add or revoke system roles * New Volt System Oracle, Oracle Pass Through all owned by Timelock on mainnet and arbitrum. Oracle will go live August 2nd * vip_2 validation in solidity, matching ts and solidity timelock proposal data * Add simulation framework into integration tests, extend timelock simulation framework to optionally log calldata to make integration tests not log unnecessary data * remove unused variables in integration tests * update to allow only 1 basis point of deviation in mainnet tests * assert oracle is correctly updated by governance proposal, bump deviation back up to 5 bips in mainnet validation * add fuzzing to integration testing for get mint and redeem amount out on both mainnet and arbitrum * add command to generate arbitrum calldata to package.json * fix integration tests to have correct end time based on actual proposal * fix timelock simulation framework to not schedule already executed proposals * remove assertion that price is greater after upgrade Co-authored-by: Kyle <kyletrusler@gmail.com> * Cleanup Fixtures (#96) * replace fixtures with mainnet addresses where needed * fix failing test * Create framework to ensure newly added PCV Controllers are also set in the PCV Guardian whitelist, delete outdated integration tests (#98) * VIP5 Burn Excess VOLT in Deprecated Timelock (#94) * VIP 5 - burn excess VOLT in deprecated timelock * fix failing integration test for AllArbitrumRoles by updating role addresses * logging on runner * fix compile issues in runner.sol, fix 2 warnings * Set Arbitrum Fees to 0 (#99) * VIP 6 Arbitrum fee update, mint fees to 0 * set redemption fee to 0 as well * update description to correct PSM * Cleanup (#102) * cleanup * remove aave pcv deposit * Vip 7 Dai PSM (#97) * setup dai psm integration tests * change test from fuzz test to normal test * setup vip skeleton * simplify test * remove comment * fix failing test * add action to unpause redemptions on usdc psm * remove mockpcvdeposit * add dai pricebound psm deploy script * use address one instead of address zero as surplus target * use vip framework for proposal * delete unused deploy script * grantPCVController to daiPriceBoundPSM * remove dai psm as pcv controller * remove setup * setup maker router * rename to vip 7 * add helper contract for withdrawing tokens * remove unnecessary variables * fix deployment parameters * address feedback comments * validate PSM parameters * add natspec & deployment validation * add fuzz test * add function to swap total balances * convert test to fuzz test * natspec fixes * address feedback comments * expand fuzz test space * remove test for l2 deprecated oracle * review changes * add checks and withdraw function * fix failing test * fix reserves threshold amount * transfer volt to psm in setup * use constants for token addresses * withdraw & transfer volt in pre-proposal action * Deploy Dai PSM and Maker Router * remove unused imports * point to oracle pass through * bump container size to xlarge * set oracle pass through on dai psm * simulate proposal * natspec fixes * fix failing test * external imports at top * add simulation to psm, add tests for router * tidy imports * remove console.log * fix failing role integration test * remove maxmint test * remove l2scaling price oracle address * remove console.sol import * increase fuzz runs, remove unused variables Co-authored-by: Elliot <elliotfriedman3@gmail.com> * VIP 8 Enable DAI PSM (#100) * setup vip 8 * setup vip in hardhat framework * fix VIP title * add comment to arbitrum addresses * add comment to arbitrum addresses * add comment to arbitrum addresses * add comment to arbitrum addresses * Set Arbitrum Fees to 0 (#99) * VIP 6 Arbitrum fee update, mint fees to 0 * set redemption fee to 0 as well * update description to correct PSM * revoke router approvals after actions * pass uint256 to abi encode * integreation tests for VIP 8 * remove vip7 simulation from integration test * change approval amount given to router * setup parity * pause redemptions as governance action * validate dai psm balance * fix failing test * transfer volt to dai psm in setup * remove minting from psm in test Co-authored-by: Elliot <elliotfriedman3@gmail.com> Co-authored-by: Elliot <34463580+ElliotFriedman@users.noreply.github.com> * clean up imports, make token and cToken immutable (#103) * Fix failing integration tests from VIP8 (#105) * fix failing integration tests from VIP8 * comment out mainnet proposal simulation for VIP-8 * remove console.log import * Add new folder and file for Compound audit. (#107) * Add new folder and file for Compound audit. * add pdf version of report Co-authored-by: Elliot <elliotfriedman3@gmail.com> * VIP-9 Deploy FEI, DAI, USDC Compound PCV Deposits (#104) * VIP-9, deploy FEI, DAI, USDC Compound PCV Deposits * remove unused variables * fix description in solidity vip 9, only get factory once * deploy one contract at a time, then wait, remove unused var in vip9.sol, add todo comment for after deployment * vip 9 fixes * vip9 tests, add smart contract addresses, finalize gov proposal * Slither (#109) * slither github action * fix package-lock file * fix dep issue in package.json * remove unused packages * remove requirement to specify max-old-space-size for node * remove waffle * fix slither issues * fix failing vip8 integration tests * fix failing compound pcv deposit integration test * do not execute vip9 in runner * remove unused variables from test * slither config file to exclude mocks, test, and openzeppelin * slither output, remove unused deps * lock openzeppelin contracts * Simulation Framework Upgrade (#106) * Add additional assertions to simulation framework to ensure PCV safety before, during and after proposals * revert all state changes in mint and redeem verification, add volt into pcv that is accounted for, only allow for 3 bips of slippage during proposals * make functionDetectors mapping private * add arbitrum support for pcv verification * add additional oracle verification check * Update Readme (#110) * update readme * updated readme * ERC20 Allocator (#108) * ERC20Allocator, RateLimitedV2, erc20 holding pcv deposit * fix unit tests * 2xlarge container to fix failing tests * lower fuzz runs to reduce memory used * 2xlarge resource group * add additional tests for erc20 allocator, add new min check on buffer for dripping * beef up unit tests, test non whitelisted psms, doAction, edit, delete, deposit, check drip condition, add check effects interaction comments in allocator * fuzz test getAdjustedAmount * buffer exhaustion causes dripaction to not be allowed * add test that sets buffer to 0, which means all condition checks are false * remove unused _resetBuffer function in RateLimitedV2 * Add tests for RateLimitedV2, mock RateLimitedV2, event for replenishing buffer, fuzz tests for RateLimitedV2 * add fuzz test to both deplete and replenish the buffer * add comment to rate limited v2 explaining why SSTORE can be saved when already at buffer cap * VIP-10 solidity and calldata for timelock * fix bug where drip condition can be true even if pcv deposit has no balance * increase test coverage for ERC20Allocator with 2 deposits, 1 with decimal normalization, one without, add setup tests * add more unit test assertions * refactor allocator to call getSkimDetails, add additional test assertions in decimal normalized unit tests * add additional assertions on decimals normalizer test * add additional assertions for getSkimDetails on skim logic in decimal normalizer test * remove log emit on no-op deposit, change comment from fei to volt * mainnet roles, integration tests for erc20 allocator * add skimming integration tests * remove pesky hardcoded hardhat mainnet block number, vip 10 in typescript and deploy * remove test looking for log in erc20holding deposit test * allocator connector feature and tests * refactor arch to remove default pcv deposit * fix fialing compound pcv deposit test * downsize circleci config to large * lock version pragma on ERC20HoldingPCVDeposit * lock version pragma on IERC20HoldingPCVDeposit * update comments for IERC20 allocator * simplified proposal creation to remove array assignments * remove address 0 checks, fix issue in check action allowed where buffer was being checked in isolation, rename from target to pcvDeposit, fix tests * add additional test assertions * update function and event naming * fix buffer scaling issue in get drip details function, add more comments and tests * fix test name, add additional assertions * remove return value in _depleteBuffer() * add unit tests where decimals are negative adjusted * fix typescript proposal * add example comment to get drip details * remove unnecessary drip and skim functions that allow passing the psm address, updated tests * update PSMUpdated event to remove token param * clean up ts DAO scripts * update comments in allocator, no code changes * change view only function in ERC20Allocator from public to external as it was not used inside the contract. Add additional tests to ERC20Allocator, remove console.log from RateLimitedV2 * update buffer cap to 300k, keep 500k per day rate limit per second, fix vip description in typescript * remove decimal normalizer setter in editPSM, rename editPSM, add to param in skim and drip events, fix tests, add more tests for RateLimitedV2 * fix rate limit buffer * remove comments from test * remove chain specific logic for ERC20HoldingPCVDeposit * add memo to pcv deposit to not use in production, and only use for testing as is * update names of local variables to be more accurate * remove check on granting pcv controller role being a whitelisted address in the guardian * add deployed ERC20 allocator address * fix bug in integration tests for calculating pcv pre and post proposal * vip 10 calldata generation matching * add additional doAction integration tests, add vip10 to erc20 allocator integration tests, add doLogging bool to pre and post timelock verification scripts * add assertions to vip10 * remove slither from CI (#115) * Add ERC20allocator as PCVController (#116) * chore: add erc20allocator as pcv controller * fix: fix failing arbitrum role tests * fix: fix failing arbitrum role tests * fix: hot fix for role testing * fix: reflect chain id on patch * fix: add correct whitepaper link (#117) * VIP 11 (#111) * vip 11 * checkpoint * vip 11 * deploy to arbitrum and mainnet * add arbitrum support for integration tests * add mint and redeem verification support for arbitrum * arbitrum and mainnet integration tests * Daniel Luca Audit Report (#118) * Add Daniel Luca Audit Report * Add Daniel Luca Audit Report * add hardhat natspec doc generation (#114) Co-authored-by: kassim <alkassimk@gmail.com> Co-authored-by: k-xo <32230412+k-xo@users.noreply.github.com> Co-authored-by: Kyle <kyletrusler@gmail.com> Co-authored-by: Kirk Hutchison <77758614+OneTrueKirk@users.noreply.github.com>
No description provided.