balancer / scaffold-balancer-v3

Starter kit for creating custom pools and hooks contracts on Balancer v3
https://scaffold-balancerv3.vercel.app
MIT License
19 stars 17 forks source link

1.3b Tooling Development (Smart Contracts) #26

Closed steve0xp closed 4 months ago

steve0xp commented 5 months ago

Factory Smart Contracts

Custom Pool Examples

steve0xp commented 5 months ago

Quick Research Notes on Factory creation:

steve0xp commented 5 months ago

Updates from last time:

Today:

NOTES:

From Discussions w/ Matt: Recall: the full repo, off the shelf, will do the following: deploy a constant price custom pool factory, deploy a new pool from said factory, register and initialize the pool.

The factory and the new pool will be deployed, off the shelf, in the local mainnet fork. So the dev can interact with their new pool with the ScaffoldBalancer front end. They can also interact with it via scripts and other development tools including hardhat and foundry.

  1. Creating new pools once the factory is deployed:
    • Going with a hardhat script so dev can simply run make createPool or something with the appropriate params within a script. This is alternative to doing it within the debug tab in the localhost FE. The main reason to do it this way vs the FE was that it would be a better developer UX as it would be cumbersome to repeatedly type in the input params via the debug tab (especially if a machine crashed, etc.).
      • SE-2 currently doesn't have the foundry framework setup so it feeds new internally deployed contracts and their addresses to new scripts. Thus we are using hardhat scripts. We'll still have foundry scripts in case devs want those, but they will have to feed some foundry scripts with contract addresses appropriately.

Next Steps:

steve0xp commented 5 months ago

Questions for Balancer Labs Team Possibly (Draft)

  1. Are pools registered if they come from a BalancerPoolFactory that abides by the Balancer architecture? I guess the better question is how do we know that a specific Balancer Pool Factory abides by the Balancer architecture / standards?
  2. Does initialization happen before or after registration?
johngrantuk commented 5 months ago

Questions for Balancer Labs Team Possibly (Draft)

1. Are pools registered if they come from a BalancerPoolFactory that abides by the Balancer architecture? I guess the better question is how do we know that a specific Balancer Pool Factory abides by the Balancer architecture / standards?

2. Does initialization happen before or after registration?
  1. It permissionless so any pool could be registered. It won't be scaffolds job to enforce standards.
  2. Register then initialise
steve0xp commented 5 months ago

Beating me to the punch on even finalizing the questions! Haha, thanks @johngrantuk.

steve0xp commented 5 months ago

More Questions / Requests for Feedback from Balancer Labs specific to CreatePoolFromFactoryExample.s.sol - THIS NEEDS TO BE FINALIZED BEFORE REVIEWING WITH BLABS

  1. So if a factory is created that inherits BasePoolFactory, are pools from said factory automatically registered? This message below is causing me to ask:

Image

  1. Default Setup:
  1. Should the pricing of assets with Balancer be OKed before working with new assets? Currently, we run scripts to deploy and mint 1000 fake ERC20 tokens $scBAL & $scETH where we assume 1 scBAL == 1 scETH. If these tokens are newly created (fresh ERC20s) on mainnet forks or testnets, do we need to add rate providers for them before creating pools that the Balancer vault will register?
steve0xp commented 4 months ago

The remaining test TODOs are being handled by PR #34 and are also documented in issue #28. Thus I am closing this issue.