From cfaae321d850afa053e8f476a4d65d58a08d588c Mon Sep 17 00:00:00 2001 From: Dan Rusnac Date: Tue, 23 Jul 2024 11:18:32 +0200 Subject: [PATCH] chore: updated readme --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index 79a5043..602b3ae 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ Unlock the potential of decentralized application development on Vechain with ou Read more about the implementation and key features of this template in our [Developer Docs](https://docs.vebetterdao.org/developer-guides/integration-examples/pattern-2-use-smart-contracts-and-backend). +This template uses the VeBetterDAO ecosystem to distribute rewards to users. To learn more about VeBetterDAO, visit our [documentation](https://docs.vebetterdao.org/developer-guides/integration-examples). + +When using the solo node you can import the following mnemonic into your wallet and have access to 10 pre-funded accounts: + +``` +denial kitchen pet squirrel other broom bar gas better priority spoil cross +``` + ## Requirements Ensure your development environment is set up with the following: @@ -122,12 +130,48 @@ yarn dev ### Setting up rewards +## Testnet + Read the [VeBetterDAO documentation](https://docs.vebetterdao.org/developer-guides/test-environmnet) to learn how to set up rewards for your users and use the Testnet environment. Test environment: [https://dev.testnet.governance.vebetterdao.org/](https://dev.testnet.governance.vebetterdao.org/)
+## Solo Network + +Since the Solo network is a local network with mocked VeBetterDAO contracts you can use the following steps to set up available rewards to distribute to users: + +0. Ensure you are using a wallet with imported pre-funded accounts mnemonic into your wallet. Mnemoninc: + +``` +denial kitchen pet squirrel other broom bar gas better priority spoil cross +``` + +1. Copy the `APP_ID` generated by the `contracts:deploy:solo` script and logged in the console. +2. Run `devpal`, a frontend tool to interact with your contracts: + +```bash +npx @vechain/devpal http://localhost:8669 +``` + +3. Open the `Inspector` tab and perform the following actions: +4. Add the B3TR_Mock contract (get the address from the console logs and ABI from the `apps/contracts/artifacts/contracts/mock/B3TR_Mock.sol/B3TR_Mock.json` file) + ![image](https://i.ibb.co/6Zrj7Nx/SCR-20240723-jorq.png) +5. Add the X2EarnRewardsPool contract (get the address from the console logs and ABI from the `apps/contracts/artifacts/contracts/mock/X2EarnRewardsPoolMock.sol/X2EarnRewardsPoolMock.json` file) + ![image](https://i.ibb.co/yYjLw9v/SCR-20240723-jozk.png) +6. You should now have the following setup: + ![image](https://i.ibb.co/w4XWyh9/SCR-20240723-jpbc.png) +7. To recharge the rewards pool you will need to mint some mocked B3TR tokens, then deposit them into the rewards pool. Perform the following actions: + - Mint some tokens by calling the `mint` function on the B3TR_Mock contract + ![image](https://i.ibb.co/XCQ7LNR/SCR-20240723-kgll.png) + - Approve the X2EarnRewards contract to spend the tokens by calling the `approve` function on the B3TR_Mock contract + ![image](hhttps://i.ibb.co/7WvQL15/SCR-20240723-kedb.png) + - Deposit the tokens into the rewards pool by calling the `deposit` function on the X2EarnRewardsPool contract + ![image](https://i.ibb.co/X7Txx7Y/SCR-20240723-keuu.png) + +NB: Values are in wei, use this tool to convert to VET: [https://eth-converter.com/](https://eth-converter.com/) + ## Disclaimer ⚠️ This template serves as a foundational starting point and should be thoroughly reviewed and customized to suit your project’s specific requirements. Pay special attention to configurations, security settings, and environment variables to ensure a secure and efficient deployment.