Skip to content

Fetch upstream updates#2

Open
Karthik-Gupta wants to merge 157 commits into
MuneFinance:masterfrom
saddle-finance:master
Open

Fetch upstream updates#2
Karthik-Gupta wants to merge 157 commits into
MuneFinance:masterfrom
saddle-finance:master

Conversation

@Karthik-Gupta
Copy link
Copy Markdown
Member

No description provided.

alphastorm and others added 30 commits January 18, 2022 12:50
* Add Optimistic mainnet deployment

* Fix lint
* Add fantom deployment scripts

* Add multisig

* Change tokens to [FRAX, USDC]

* Update deployer FTM address

Co-authored-by: Sunil Srivatsa <sunilsrivatsa@gmail.com>
* Remove show accounts flag

* Replace package-lock.json
* Make it easier to use Alchemy API key

* String concat

* Reduce unnecessary actions when forking for testing

* Update comment when creating smaller fixture

* Better readability on string concat

* Update CI

* Remove ropsten URL from CI env loading

* Fix CI
* Add a meta pool for USDs

* Fix names

* Rename files

* Prevent re-intializing MiniChef on Arbitrum

* Update URL:

* Add partial deployment data

* Add arbitrum deployment data

* Fix linting
* Add SimpleRewarder contract

* Add coverage

* Increase coverage

* Test deposit after adding rewarder

* Add coverage for `massUpdatePools`

* Add explicit lines for transferring ownership

* Add test case replicating Arbitrum setup
- MiniChef's saddlePerSecond is not zero
- rewardToken is not tranferred in

* Update KEEP OpEx wallet address

* Add deployment data for SimpleRewarder on mainnet

* Add Arbitrum side's SimpleRewarder (not yet initialized)

* Update SPA rewards amounts to match on chain

* Fix localhost test by adding tbtc lp token to minichef

* Update comments
* Add a deployment script for T rewards

* Add deployment data

* Fix local tests
…inputs (#536)

* Add method for calculateSwapInput

* Linting

* Update comments

* Add support for pool addresses

* Fix tests and increase coverage

* Add forked mainnet testing

* Fix relativePrice() unit test

* Silly optimization

* Add comments

* Clean up require statements

* Add deployment data

* Fix linting

* Fix file names
Adding deploy deploy script and contract to deploy multicall3 for
local development. Edited the hardhat.config.ts for file specific
optimizer settings.
Clean up existing deploy scripts to use the new constants instead
… contracts on chain (#485)

* Add `PoolRegistry` and `MasterRegistry` contracts

Includes basic test coverage of adding new pool entries.

* Add new deploy scripts for mainnet and ropsten

* Update typos in comments
* Update dependencies and linter

* Use GitPkg to run postInstall on hardhat-deploy import

* Format .eslintrc spacings

How tragic. It enforces arbitrary rules on another yet it cannot even
keep its own laws.

* Temporarilly use forked hardhat-deploy

* Fix test imports
* Added deploy scripts for EVMOS Testnet Launch

Added deploy scripts for evmos testnet, currently blocked
by EVMOS token deployments

* Updated network and config for testnet and mainnet

Added both EVMOS test and mainnet to config files.
Updated deploy scripts to deploy the 4pool.

* Fixed token names for 4pool

Changed DAI, Tether, and Terra to correct names.

* Updated network config, renamed tokens to test-token

Updated chain ID's and provider urls, updated token args
to create test tokens on deployment.

* Updated deploy scripts, successfult testnet deploy

Updated deploy scripts to correctly mint test tokens,
performed test deploy.

* Updated to correct test token names.

* Ran eslint

Co-authored-by: Michael Daly <dalymike102@gmail.com>
Co-authored-by: mjdatadog <michael.daly@saddle.finance>
* Add Permissionless versions of Swap contracts

* Add PermissionlessDeployer contract that helps deploy clones

* Optimize external calls with payable modifier

* Add tests for PermissionlessDeployer contract

* Add deploy script for permissionless swaps and deployer

* Check for unique names before calling `addCommunityPool()`

* Added permissionless test, updated swap initialize

Added test for permissionless deploy for base and meta pool,
included comments for events and public functions, added an
update of the fee collector cache on permissionless swap deploy.

* Optimized tests, added functionality to Metaswap initilizer

Added consts for all places in test, succesfully tests
withdrawl of admin fees to both collector and pool owner.

Added functionality to the Metaswap initializer to update
fee collector cache.

* Replaced user input LP token names with static (#558)

* Replaced user input LP token names with static

Removed lp_token_name from pool input struct, LP Token name
is now: Saddle <lp token symbol> LP Token

* Small cleanup of comments

Clean up comments

* Add visibility for strings

* Changing LP values to public constant

* wip fix deployment script

* Add support for impersonating deployer address on forked mainnet

* Added initializer to PermissionlessMetaSwap, typos (#562)

* Add deployer as community manager. Add check for zero address

* Add deployment files for PermissionlessDeployer contracts

* Linting

Co-authored-by: Michael Daly <dalymike102@gmail.com>
Co-authored-by: mjdatadog <97006234+mjdatadog@users.noreply.github.com>
Co-authored-by: Arthur <arthurzhuk@gmail.com>
* Added files for evmos mainnet deploy.

Added deploy scripts for evmos mainnet deployment,
waiting on Evmos deployment to get live token addresses.

* Changed token names typo.

* Typo in test pool deployment.

* Added mainnet deployments for 3pool coins, deploy 3pool.

Added mainnet deployments for DAI, USDC, USDT. Changed
deployment from 4pool to 3pool.

* Succesfull mainnet evmos deployment.

* Ran eslint for mainnet deploy changes.

* Add Multicall deployment files

Co-authored-by: Jongseung Lim <penandlim@gmail.com>
* Cleaned commit of W/REN BTC basepoll and tBTC metapool deploys.

Reset head of branch to master, added wbtc/renbtc base pool
and tbtc metapool deploy scripts and their live token deploys.

* Add decimal checks to ensure decimals on evmos

* Change deploy order to preserve the nonces

* Deploy a new pool instead of trying to initialize an already initialized
one

* Use correct base pool address for tBTC meta pool

* Remove waitForConfirmations and fix typing on decimals() call

* Use consistent names for BTC pool deployments

* Add deployment files

* Add MetaPoolDeposit deployment files

Co-authored-by: Jongseung Lim <penandlim@gmail.com>
…570)

* Override existing deploy task to add pre and post deployment actions

* Add newline when printing for better readability
* Script for confirming onchain libs via etherscan

* support other chains

* bash script for fetching metaswaputils
* Add scripts to run against contracts on forked network

* Change script to be able to run against any network

* Revert "Change script to be able to run against any network"

This reverts commit 2ec9572.

Encountering some problems with creating fixtures for tests.
Stick to hard coding fork url in the script

* Rename folder to invariant_test

* Fix fixture issues by correcting imports

Although the optimism scripts are unused, having incorrect imports
causes the fixtures to fail for some reason.
* Remove existing MetaSwap deployments and copy existing MetaSwapDeposit
deployment information into the deployments folder

* Add deploy scripts for the new meta pools and meta pool deposits

* Fix local test

Manually save MetaSwapDeposit if it doesnt exist

* Add to generalized swap migrator only on localhost

* Ensure strict equality (===)

* Update constructor parameters such as lp token name, symbol, fee.

* Add deployment data.

Ignore past LPToken json changes (whitesapce changes)

* falsy check

* Linting

* Fix incorrect registry field and use .filter(Boolean) trick

* Do not modify existing LP tokens

Co-authored-by: ug02fast <arthurzhuk@gmail.com>
* Deploy scripts for mainnet DAI/USDC/USDT/FRAX 4pool.

* Updated pool deploy script string constants for consistency.

* Added all constructor args as constants, fixed LP token name

* Add 4 pool deployments

* Reduce amounts withdrawn when testing for any change in invariants

* Change back default test values to match the comments

* Linting fix

Co-authored-by: Jongseung Lim <penandlim@gmail.com>
* Added deploy script for evmos 4pool.

Added deploy script for 4pool (DAI/USDC/USDT/FRAX) as well
as its tokens. Added deployment for live frax deployment
given by nomad. LP token name: "Saddle 4pool"
LP token symbol: "saddleEvmos4pool"

* Changed initial admin fee to 50%.

* Deployed 4pool to evmos mainnet. Updated deploy script.

* Redeploy evmos 4 pool with cannonical frax token

* Add verification script and verify all pools

* Linting fix

Co-authored-by: Jongseung Lim <penandlim@gmail.com>
penandlim and others added 30 commits November 9, 2022 00:37
* Change deploy scripts to be manual deploys
* Add mainnet deployment jsons

* Add deployment jsons of child gauges on Arbitrum

* Add deployment jsons for optimism contracts
* Change test weights to use 1e18 decimal

* Clean up

* Linting
* Update bridger tests for RootGauge.transmit_emissions() interaction

* Remove console log

* Remove unused file

* Fix typo when naming functions in comments
* added new versions to metaswap contracts

* created token consts for tests

* upgrated new versions of contracts

* added dynamic versioning

* corrected openzepplin version

* WIP updated contracts with correct previous version

* WIP added test for LPToken

* added lptoken contract to test

* fixed getD()

* fixed incorrect math operations

* fixed lpToken test

* fixed versioning, added swap deployer contract

* finished lptoken test, started metaSwap test

* added metaSwap decimals test

* added metaSwap deposit test

* removed contract factories consts

* added inflated bp test, included latest openzepp package version

* included latest openzepp package

* removed unneede imports & logs

* added new versions of metaswap tests

* updated metaswapUtils

* correct test init of metaswap

* added unchecked math and previous reverts

* updated metaswapUtils swapUnderlying function

* Fixed inflated VP on basepools bug

* upgraded openzepp to 4.7.3

* fixing openzepp package issue

* Increase max heap size on coverage

Co-authored-by: Jongseung (John) Lim <penandlim@gmail.com>
Co-authored-by: Hannes Pfeiffer <hannespfeiffer@Hanness-MacBook-Pro.local>
* Makes env keys and named accounts explicit

* Force using hardhat signers in tests
* Add new deploy script for 2 replacement BTC pools

* Remove unnecessary logging

* Add deployment jsons
* Add Multisend contract json

* Linting fix
…#785)

* Add readmes for specifying usages. Add more checks in RewardScheduler

* Update readme to be explicit
* Update forge

* Add tests to see if the fix works for minichef off by 1 error

* Add comments for clarity

* Update comments to reflect actions correctly
* Added initial deploy scripts

* cleaning up network config

* finished registry and permissionless deploy scripts

* finalized deploy scripts, updated deploy utils to check for multisig

* removed unneeded multicall deployment

* added USDT pool deployment scripts

* fixed incorrect script tags

* Add deployment for LPToken logic contract

* deployed to aurora-mainnet

* added deployment of Multicall

* deployed permissionless pools to aurora, added checks in deploy utils

* lint fix

* ran linter

---------

Co-authored-by: Jongseung (John) Lim <penandlim@gmail.com>
* Add deploy script and LP token json for BaoUSD meta pool

* Add gas limit from fork run

* Lint json

* Add deployment json for the newly deployed gauge
…nctionality. (#796)

* Add comments and security to RewardScheduler

* Add SPA token deployment json

* Add more generalized tests for RewardScheduler
* Initial commit
- add `/spec` folder
- add `/scripts` folder
- add empty `.spec` files

* Add empty `VerifyAll.sh` scripts

* certora setup folder; PoolRegistry setup done

* Delete deprecated folder structure

* Spec file skeletons

* First batch of ideas for rules/invariants for `Swap.sol`

* Add custom OZ imports for munged `initialized` var

* Add `inRampA()` method to Swap harness

* Add `runSwap.sh` script

* Add `getPooledTokenAddress()` to SwapHarness

* Add `.gitignore` for certora runtime data

* Add to `.gitignore` of top level folder

* Move all OZ contracts to `/imports` folder

* fix munging

* beginning to refactor code

* hook for _initialized, rule to test wip

* moved imports out of munged folder to clean up patch file

* refactoring and summarization

* comments

* onlyOwnerCanSetFee rule

* add script

* some more rules done, some failing

* Swap rules updates

* Add `initializing` hook

* Adding getters for `max_fees` to swap harness

* solvency invariant working

* Add rule `monotonicallyIncreasingFees`

* Add `pausedImpliesNoSingleTokenWithdrawal` rule [WIP]

* new summarization for getD

* Add new rule idea

* Added rule `uninitializedImpliesRevert`

* Split invariant `underlyingTokensDifferent` into two rules

* update ghost and hook for solvency invariant

* fix typos

* edit: tokenA => tokenAIndex

* tokenA => tokenAIndex

* tokenA => tokenAIndex

* incomplete rule uninitializedImpliesZeroValue

* Add solc version to runSwap.sh

* Quick notes on MetaSwap.spec

* added getAllGetters function

* finalized* uninit-means-zero-val rules, some rules need dev fix to pass but likely will

* Add hook `sum_all_underlying_balances` and refactor

* Add 'virtualPriceNeverZeroOnceLiquidityProvided' rule

* Adapt rule `onlyWithdrawWithOneTokenDecreasesUnderlyingsOnesided`

* [WIP] Added generalized unit test rules. Still to be tested against the prover

* Deleted `SwapUtils.spec` and `MetaSwapUtils.spec`

* remove finder contract and add to .gitignore

* Change rule `onlyWithdrawWithOneTokenDecreasesUnderlyingsOnesided`

* Add `ifLPTotalSupplyZeroThenIndividualUnderlyingsZero`

* Add MetaSwapSpec and MetaSwapHarness

* Edited comment

* Add SwapHarness to scene

* Fixed `getDApprox` bug

* Adding rules and fixing deadline bugs

* fix applyHarness

* Add getLPToken helper function to harness

* Fixed setup() bug

* Add VirtualPrice general rule

* harness.patch fix

* Remove double getPooledTokenIndex from Harness

* add rules blocks in run script

* Add timeout settings to run script

* Make comment first argument of `runSwap.sh` calls

* Add `setup()` to fee check rules

* Removed one rule from runSwap batches

* Adapted monotonicallyIncreasingFees rule

* adding potenial invariants

* add certoraRun for each batch

* moved finished rules down

* Prioritized rules

* Refactor and review

* trying extra required for invariants

* revive paused ratio rules to replace paused single sided withdrawl rule

* Fix minDyAmount on swap

* add addresses in run script; change setup to requireInitialized

* invariants in progress

* fixed ifSumUnderlyingsZeroLPTotalSupplyZero and partially oneUnderlyingZeroMeansAllUnderlyingsZero

* Merge commit

* Add basicAssumptions

* 2 new rules passing

* tokenRatioDoesntGoBelowOne passing

* add new settings to deal with timeouts

* reorg; 2 rules and 1 invariant left

* update comments to mean cvldoc spec and progress on final invariant

* trying to split final invariant

* final invariant passing

* add getMultiplier function to SwapHarness

* reorg

* remove unnecessary requirement

* add back requirement

* reorg

* Add `requireInitialized` to `onlyAdminCanSetAdminFees`

* fix getD summary, modify hook on struct element to be more readable

* add filters, batch rules/invariants

* Delete empty files and edit comments

* Add report PDF

---------

Co-authored-by: teryanarmen <61996358+teryanarmen@users.noreply.github.com>
Co-authored-by: Jongseung (John) Lim <penandlim@gmail.com>
* Added deployments for Root/Child Gauges, Reward Forwarder/Scheduler, for Community fUSDC pool

* correct file naming, updated to correct reward token

* reverted change to utils, added fUSDC reward manager address

* linter fix

* fixed rewarder constructor, changed child gauge deploy script

* deployed on mainnet and arbitrum

* Included adding reward token to gauge

* added checks for more consitent state-recreation

* linter fix

* fixed typo in fUSDC deployment address

* added test for reward token edge case

* updating test for child gauge adding non-erc20 as reward token

* updating test for child gauge adding non-erc20 as reward token

* updating test for child gauge adding EOA  as reward token
* added network info for base chain

* added deploy scripts for base_testnet

* deployed to base_testnet

* removed unneeded multicall deployment, ran linter

* deployed USDC/WETH pool to base_testnet

* cleaned up deployments, added base as custom verify api

* added correct setup for verifying base_testnet contracts

* removed old deployments, added new DummyToken contract and DummyPool with said tokens

* adding official multicall deployment

* remove un-needed config entry

* linter fix

* moving dummy contract to correct location

* updated to newest permissionless deploy util

* moved testing logic from deploy script to test

* merged mike/updated_l2_deploys_childGauge_permissions deployutils

* removed unneeded test, typo in deploy script

* deployed all contracts to testnet, updated verify script

* ran linter

---------

Co-authored-by: Jongseung (John) Lim <penandlim@gmail.com>
* redployment of the RewardScheduler

* deploying new Saddle Owned instances of reward schedulers for fUSDC and SDL

* removed un-needed reward forwarder deployment

* deployed new RewardSchedulers

* ran linter
* rootGaugeV2 contract and test

* cleaned up tests ran linter

* optimized reads in contract, added implementaion deploy script

* udpated deploy scripts and utils for new implementation deployment

* added updated implementation to arbitrum deploy script

* ran linter

* updated test to use more current forked setup

* added optimism script, ran deploys, updated utils
…rder contracts (#810)

* WIP deployscripts for sUSDC ChildGauge, and rewarder contracts

* deploy scripts for fUSDCGauge V3 and 3rd party rewards

* deployed all contract to mainnet and arbitrum
* test: Add MinterCommitEmissionTest for emission rate update

* test: Update test comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants