https://frosty-lovelace-f800b7.netlify.app/
Goal: One day this contract will make someone a crypto millionaires in the long run....
Crypto market is volatile with high intensity of fear vs greed. I think it is hard sometime to be a real Hodler - Hold on for deal life when there is a big crashes in the market, however those day are likely to provide the highest gain if you buy the dip.
A smart contract service to help discipline and force you to be a hodler!. the contract will be connected to an existing dex but with hodling oriented features:
- User could deposit ETH but could not withdraw before a specific set of time
- User could used the deposited eth to buy target token and it is also timelocked
- In the future, this could be update to use price oracle to force user to buy at dip or sell at the pump
- User could deposit eth to a contract but might not able to withdraw out within a specific period using timelock feature.
- User could only use the deposit eth to buy a specific token only from UniswapV3 dex
- Both ETH, and specific token could only be withdrawn after specify timelockperiod
Future: The contract could may be call to check daily gains (red or green candles) move price check to frontend instead, criteria check within buy seem costly
API for archival node fork from Moralis
MORALIS_API=
MNEMONIC=
frontend/.env config chainid=42 for kovan testnet
REACT_APP_CHAINID=42
- Node.js >= v14
- Hardhat (plugin: hardhat-deploy, hardhat-etherscan)
- npm
- Moralis API in .env to locally fork kovan testnet =>Moralis
git checkout main
- Run npm install in project root to install all dependency
- Update moralis api in the .env with API key
- Run testnet forking with
npm run node
(Forking the DEX with liquidity) - To compile run
npm run compile
- Run test with
npm run test
- Run local deployment with
npm run deploy-contract
- Development network id is 31337 change it in metamask
cd frontend
npm install
npm start
- Open
http:/localhost:3000
- metamask might show error, fix: Metamask>setting>advance>reset account
frontend
: Project React app frontendcontracts
: Smart contract that are deployed on Kovan test netdeploy
: deployment scripts for hardhat-deploy plugintask
: A script to aid during developmenttest
: Tests for smartcontracts
To test the Dex , i have deployed a mocked token on Kovan with step below
- MockToken was deployed on kovan with
npx hardhat deploy --tags token --network kovan
- Token address
0xf09F34Ade2D66EA69372C828454873bFa9c04556
- Token was verified with command:
npx hardhat verify --network kovan 0xf09F34Ade2D66EA69372C828454873bFa9c04556
- Manually minted: 1,000,000 tokens
- Pool created with 0.48 ETH: 1,000,000 tokens
- Uniswap Web
- Liqudiity Transaction
- Pool Address
- Block: 28577077, forked block for local dev 28577078
https://www.loom.com/share/d4217be422d0475786c37eea31e2ed2e
0x6D9469aD7BdFc6BFb0638b8DD31D4C814726Ed43
- Price reading data in the future.
- Auto Dollar-Cost Averaging , keep buying weekly or monthly or at dip
- Dead man switch or Beneficiary protocol, so your hodling stash could transfer ownership in longterm.
- May be a customizable input for different tokens or scenario like, 1 year hodling etc.
- Chaotic ape trading - Buy random token just for fun!