The goal of this project is to explore Uniswap V4 hooks by building a hook that issues points to the user based on what is done on the exchange with the memecoin we have created.
Let's name the memecoin as RAX and the points as SOUL.
RAX token follows ERC-20 standard from solmate library and SOUL token follows ERC-20 standard from solmate too.
Points are ERC-721 tokens given to the users. Using solmate contracts for ERC-721 tokens.
- Each time an user swaps RAX by trading their ETH on the exchange, the user gets the SOULs based on the number of ETH traded.
- Each time an user provided liquidity to the ETH-RAX pool we have created, the user gets SOULs based on the number of ETH added.
- Referrer and referree functionality.
- Nothing
NOTE: We are using a mapping to keep track of the REFERRER and REFERREE. mapping(referreeAddress => referrerAddress) public referredBy // user => referrer [key => value] So referree cant be repeated and there can be multiple referrer in the mapping.
- REFERRER is the person who is refering someone.
- REFERRER can refer multiple users(REFERREE).
- REFERRER gets 500 points when they reffer someone for the first time.
- From the second time onwards, REFERRER gets 10% of the transaction done by the referree as points.
- REFERREE is the person who is being referred. Each REFRREE can have only 1 REFERRER.
- Issuing points each time someone buys our memecoin with ETH.
- Issuing points each time someone adds liquidity to the pool.
- Referal mechanism where Alice gets 10% of points when she refers Bob to do (1) and (2).