Scaffold-ETH-DeFi-Challenges icon indicating copy to clipboard operation
Scaffold-ETH-DeFi-Challenges copied to clipboard

Bring in Scaffold-ETH v1 AND/OR v2 and Combine with Foundry Setup

Open steve0xp opened this issue 1 year ago • 4 comments

Detail

There are challenges associated to bringing in foundry in combination with the hardhat default frameworks used with ScaffoldETH v1. It is assumed that this type of conflict will arise with ScaffoldETH v2 as well, but it is yet to be seen.

TODOs:

  • [ ] Incorporate Scaffold-ETH v2 into the mix
    • Deploy localhost, edit deployment scripts to make it work with yearn strategies (may have to pull reference from the deploy scripts used with foundry and convert them over to whatever format is used for ScaffoldETH and hardhat)
    • Troubleshoot until the yearn strategy solutions show up in the troubleshooting UI for localhost
    • Test with its function calls && come up with a good workflow to showcase how it works

steve0xp avatar Mar 29 '23 19:03 steve0xp

It would be great to have a front end that showcases the yearn strategy at play within a testnet or at least a local mainnet fork.

See other issues on these aspects.

steve0xp avatar Mar 29 '23 19:03 steve0xp

Attempting to do this in this forked repo off of ScaffoldETH v2. Link HERE I followed the same processes I took with ScaffoldETH v1 and DEX foundry tests.

I ran into some issues, see the latest commit where I left off in the other repo. My goal is to bring SE v2 into this repo, perhaps create a new branch for DeFi Challenge #1 once SE v2 is merged into main branch. Get foundry working and everything with this new setup with SE v2. Get debugger working and then get a front end going for the challenge itself from solidoracle.

_Latest commit from other repo:

Troubleshoot errors w/ make build

The tests needed their import paths fixed, but I also noticed that the imported vault.json artifact is not setup correctly due to migrating the foundry-strategy-mix setup to this SE v2 framework. I need to take a closer look. Next steps include:

  • [ ] Work through vault.json issue
  • [ ] Write deployment code in 00_deploy_your_contracts.ts for vaults and strategies
  • [ ] Get frontend debugger UI working w/ contracts && add to the README.md as needed_

steve0xp avatar Mar 30 '23 22:03 steve0xp

@solidoracle now that we have se-2 coming into the main branch here, we need to coordinate an effective way to combine foundry and se-2.

Context:

  • Challenge #1 repo created before bringing in se-2
    • NOTE: the branch has been made so it is ready for a student to come in and walk through the README.md. If you want to troubleshoot with it to make sure the foundry tests all work when someone is done the tutorial, just clone the repo, go to the branch on your local machine, and copy over the files in Solutions sub-directory to replace the respective Solidity files (Strategy.sol, StrategyOperations.t.sol, StrategyShutdown.t.sol).
    • Run make test, of course with a .env setup and you'll see everything working.

Next Steps IMO

  • I think I'll make a new branch to replace the current challenge-1-simple-yearn-strategy branch. It's either that or I rebase to main which could cause issues.
  • THEN you can take that branch, and edit the deploy script (hardhat) so it shows up in the "debugging" tab in the localhost for the frontend UI w/ se-2.

Please let me know what you think!

steve0xp avatar Apr 03 '23 15:04 steve0xp

@umphams yes I think it's best to branch off main again, and paste in the challenge-1-simple-yearn-strategy

solidoracle avatar Apr 03 '23 16:04 solidoracle