ekonomia-tech / protocol-alpha

Alpha version of a DeFi stablecoin protocol
GNU General Public License v3.0
4 stars 0 forks source link

Niv/curve test deploy #21

Closed nmimran99 closed 2 years ago

nmimran99 commented 2 years ago

Deploy a FraxBP-EUSD curve pool

Deploy a curve pool of FraxBP-EUSD and fund it with 10 million EUSD + 10 million FraxBP LP. The deployment will happen on anvil mainnet fork.

Core changes:

  1. scripts/curve/deploy.sh - deploy relevant contracts to mainnet fork.
  2. scripts/curve/vars.sh - define common variables and parameters.
  3. scripts/curve/addresses.sh - relevant contracts addresses store to be used by deploy.sh and curve.sh.
  4. scripts/curve/curve.sh - main file. Calls deploy.sh and performs the pool creation and pools funding.
steve0xp commented 2 years ago

As per Kevin's comments, the branch doesn't run e2e. It looks like Kevin's comments address the immediate errors that are coming up regarding running the bash script curve.sh. I reverted my local copy of your branch to the past commit [31b52e58d1f0a96d023212364296a59932d48e1a](https://github.com/ekonomia-tech/protocol-alpha/pull/21/commits/31b52e58d1f0a96d023212364296a59932d48e1a) and was able to run the tests find there using the manual commands.

I'll leave it to you to decide to get the code working with the bash script changes from your latest commit, or to simply update the README with manual commands and take care of the one-line script change in a separate PR. If you decide to do it in another one, I've gone ahead and outlined an example of what might be good in the README below to correspond with the code you've done here :) Feel free to take it, edit it, or leave it. I'd put it at the bottom of the README.

## Running Interactions with Local Mainnet Fork Using `anvil` and Bash scripts Leveraging `cast`

Currently, the purpose of the repo is to test interactions between newly created EFX/FRAXBP metapools. In order to see these transactions, continue reading.

Open two terminal windows within the project.

1. Start up the environment using the CLI command below:

   `anvil --fork-url https://mainnet.infura.io/v3/$PROVIDER_KEY`

2. In other terminal window, run the following bash command: 

   `bash -x ./scripts/curve/curve.sh`

   The above command does the following: 
   - Details: a curve metapool, FraxBP-EUSD, is deployed and funded with 10 million EUSD & 10 million FraxBP LP tokens  on an anvil local mainnet fork
   > NOTE: The current `usdc_holder` used within the `curve.sh` script only has enough `USDC` for one iteration of the test. Reset your `environment` if you run into funding issues as seen below.

**If you need to troubleshoot at all, consider clearing the environment to start fresh with the following commands:**

`lsof -i :8545`

`kill -9 #PID#`
steve0xp commented 2 years ago

We discussed offline regarding the intent of this PR: whether or not it will be merged into the main or not. So my original comment is not relevant anymore I think :)