owned this note
owned this note
Published
Linked with GitHub
# ROADMAP TERITORI LAUNCHPAD GNO BASED
Timeline:
1. Contrats -> Front-End -> Back-End
> :question: I don't know how much time would i need to do this
## Contrats
Project Struct
- /r/teritori/launchpad_grc20/factory_grc20 (based on this https://github.com/gnolang/gno/blob/master/examples/gno.land/r/demo/grc20factory/grc20factory.gno) (function CreateToken)
- contains an avl.tree // token_hash (hash of name + symbol) -> token
- ``` CreateToken(name string, symbol string, image string, initialSupply uint64, decimals uint8, allowMint bool, allowBurn bool)``` -> 2.5% of total supply fee to create the token // also verify the hash does not already exist
- GetToken function from tokenAddress
- airdrop.gno (handle merklized airdrop)
- NewAirdrop(token, merkleRoot, amountPerAddress, startTime, endTime)
- Claim (proof []string) -> verify the proof, verify it's not already claimed and send it
- airdrop_factory.gno
- contains an avl.tree //
- merkelized_whitelist.gno (handle merkelized wl)
- NewWhitelist(merkleRoot, tokenSale addr)
- IsWhitelisted(addr, proof) (method of WL)
- CacheIsWhitelisted(addr) (method of WL) -> Look into cache is the addr is wl
- sale.gno (to handle periods of sales)
- NewSale(token, price, minGoal, maxGoal, startTime, endTime)
- Buy(amount) // verify sale is still running & buyer can buy it
- Finalize () // close the sale period & send money to owner
- Should handle refund if minGoal is not reached at the end of sales
- SetWhitelist()
- sale_factory.gno
## Front-UI
- Page for creating token
- ask for Token Name
- ask for Symbol
- ask for Initial Supply
- ask for Decimals
- ask if token can burn
- ask if token can mint
- set total supply cap for minting
- change owner (input address)
- max number of tokens per address is limited
- Manage Token
- Mint
- Burn
- Renounce Ownership
- Change Tokens Per Address Limit
- Create Sale
- Price per token in GNOT
- SOFT CAP & HARD CAP
- Investment limit per investor (min & max)
- Set the start time
- Set the Token Sale duration in days
- Set the Lock duration in days (0 to no lock)
- Activate Whitelist (boolean)
- Set token sale owner address (receive fund at the end)
- Manage Token Sale
- Set new whitelist (CSV or Insert Manually)
- Send tokens to the contract before the SALE
- Create Airdrop:
- Start time, end time
- Lock duration
- Whiteliste (list of address CSV or Insert manually)
### LOW-FI PROTOTYPES
Excalidraw prototype: https://excalidraw.com/#json=t0cm4QCyOnHt56OYKN-Z9,MoolTPtSN4a_-NDr7MO0kQ
## Back-End
> :warning: as a web2 dev. and new to web3 i don't know if it's really matter to save in db this data that is available on-chain, I would be happy to discuss this, maybe i have to listen for event and index in db to avoid retrieve data from chain each time. I also did not include Token image for now, i think i have to use IPFS to keep the thing decentralized i need to check more in depth this
### Models (not 100% accurate, i will add what i need and delete what i don't need)
```
LaunchpadERC20Token:
- UserID networks.UserID
- NetworkID string (indexed on this)
- TokenID string
- Token Name
- Token Symbol
- IsMintable bool
- IsBurnable bool
- TotalSupplyCap uint
- TokenContractAddress string
- IsUserOwner bool
```
```
LaunchpadERC20Airdrop:
- LaunchpadERC20TokenID tokenID
- MerkleRoot string
- start & end period
- amount per people
- lock duration
```
```
LaunchpadERC20Sales:
- LaunchpadERC20TokenID tokenID
- hasWhitelist
- PricePerToken uint
- start & end period
- WhitelistMerkleRoot string
- lock duration
- minGoal uint
- maxGoal uint
- limit per investor uint
```
### Routes
- BuildAddressesMerkleTree(addr[]) -> merkleTree
- CreateLaunchpadERC20Token(...) -> // persist
- UpdateLaunchpadERC20Token(tokenID, ...) -> // persist
- DeleteLaunchpadERC20Token(tokenID, ...) -> // if i renounce ownership or can be trigger if contract the user does not own the toke anymore
- CreateLaunchpadERC20Airdrop(tokenID, ...) // persist
- CreateLaunchpadERC20Sales(tokenID, ...) // persist
- UpdateLaunchpadERC20SalesWhitelist(salesID, ...) // persist