Badger-Finance / Badger-Finance/gitcoin

Badger onChain GuestList Factory Bounty

Open
#47 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

# Context
BadgerDAO uses guestlists for guarded launches.
These are simple contracts that ensure deposits cannot go above a certain threshold.

The process of deploying and setting guestLists can be improved by deploying a factory that automatically allows to set all the values in one go.

This can be further improved by adding logic that calculates the `want` token values for each guestlist and converts it from Dollars to Want, making it easier for the developers to quickly set them up.

## Video Version
https://drive.google.com/file/d/1Tpn-d2YQh0oYdWhgYjrutVYc71r90dC-/view?usp=sharing

# Requirements

A Smart Contract that:
- Allows deployment of non-upgradeable Guestlists (via clones / minimal proxy)
- Allows the setting of the User and Total Cap denominated in USD (USDC / MIM / 3CRV), working in a multichain environment
Ideally does those 2 operations in one call

A brownie project with:
- Code
- Unit tests (Does the factory deploy the guestlist, does it set the proper caps, is the math for price correct or accurate up to a degree)
- Integration tests (Does the thing work when used?)

# Further Details

## Deployment and initial settings
The deployment of guestlist can be done via OZ clones

Code for the guestlist can be found here:
https://github.com/Badger-Finance/badger-sett-1.5/blob/main/contracts/test/TestVipCappedGuestListBbtcUpgradeable.sol

Usual setup of gueslist (done manually)
https://ftmscan.com/address/0x1dcc9af206137378e0654b5c7d509491e461fffb

These are the steps we want to automate away

You can see our scripts (off-chain) are here:
https://github.com/Badger-Finance/badger-vaults-mix-v1.5/blob/main/scripts/2_production_guestlist.py

## Pricing and setting of guestlist

Given the Vault the guestList is for, take the Vault Want, and figure out it's market value.
If it's an LP token you probably need to follow this guide: https://cmichel.io/pricing-lp-tokens/
If instead it's a base token you will need to price it by getting either a price feed (very hard to scale, remember this has to work for any random token) or get a quote from a supporting smart contract which checks multiple AMMs for the best quote.

To get an approximation (an approx with 10/20% margin of error is completely fine) you can write a supporting smart contract with a function similar to this one: https://github.com/GalloDaSballo/strategy-ftm-solidex-DCA-templatized/blob/af10111d0b5c0acb167ced7999960b6c0fbc138d/contracts/StrategyGenericSolidexDCA.sol#L329

Obviously this would need to be customized by chain, so writing generizeable: getUniV2Quote, getSolidlyQuote, getCurveQuote functions, where we specify the Pool or Registry addresses would be ideal.

# Post Bounty Offers
We understand that this is a sizeable bounty, and will pursue the few developers that are able to undertake this challenge and succeed by offering 1-1 tailored bounties with the goal of onboarding them into Core Tech at BadgerDAO (Full time Contributor Positions)

## Dev Discord

Feel free to join us on our Dev Discord: https://discord.gg/Tf2PucrXcE

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with TestVipCappedGuestListBbtcUpgradeable.sol and the existing scripts/2_production_guestlist.py to understand current deployment and setup. Review the linked LP-token pricing guide and StrategyGenericSolidexDCA.sol for the proposed pricing approach. Done means a Brownie project with a non-upgradeable clone-based factory, cap-setting and pricing logic, unit tests, and integration tests across the requested workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, solidity
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.