Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niklr/vite-quota-bank
Quota Bank for VITE based on Solidity++
https://github.com/niklr/vite-quota-bank
blockchain smart-contracts soliditypp vite vitejs
Last synced: about 6 hours ago
JSON representation
Quota Bank for VITE based on Solidity++
- Host: GitHub
- URL: https://github.com/niklr/vite-quota-bank
- Owner: niklr
- License: mit
- Created: 2021-06-22T16:37:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-07T18:13:09.000Z (over 2 years ago)
- Last Synced: 2024-04-14T07:44:56.791Z (7 months ago)
- Topics: blockchain, smart-contracts, soliditypp, vite, vitejs
- Language: TypeScript
- Homepage: https://niklr.github.io/vite-quota-bank/
- Size: 21.3 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VITE Quota Bank
Many blockchains solve the spamming problem with gas. Transactions on Vite, however, are free. To fight spamming, Vite transactions consume something called Quota. Quota can be secured by either locking VITE or running Proof-of-Work. When the Vite network is congested, locking VITE is required to secure Quota. At any time, the user can lock VITE to secure Quota for themselves or for another Vite address.
Users can lock their own VITE to secure Quota, or someone else can lock VITE to secure Quota on their behalf. For instance, if Alice doesn’t have enough VITE to lock up for getting sufficient Quota, she can ask Bob to lock his own VITE and set her address as a Quota beneficiary.
Video Walkthrough: [YouTube](https://www.youtube.com/watch?v=3pDNr3Qd60Y)
Live Demo: [https://niklr.github.io/vite-quota-bank/](https://niklr.github.io/vite-quota-bank/)
## ViteConnect integration
## Features/requirements
- A frontend for Quota Bank, where users can apply for Quota (the Quota Bank can set its own standards for who would be eligible)
- Ability to lock VITE on behalf of said users
- Display the amount of VITE in reserve, to be used for locking
- A way to see which addresses received how much Quota
- The Quota Bank needs to set its own policies for expiration of locking support (e.g., Quota will only be provided to applicants for two weeks)## Current limitations
This project was developed as part of the Gitcoin Grants Round 10 Hackathon taking place from Jun 16, 2021 to Jul 7, 2021.
At that time the most recent version of `soliditypp` was `0.4.3` which has some limitations in terms of the feasability related to the submission requirements.1. send() does not support sending tokens from one contract to another
2. contract binary size is limited to around ~11000 characters (compiled)To overcome the mentioned limitations temporarily, the following measures have been applied/implemented:
- a mock contract to simulate and test the behaviour of the built-in `Quota` contract
- reduced the functionality of the `QuotaBank` contract to its bare minimum to showcase the PoC on `TestNet`
- a mock service on client-side to simulate and test the behaviour of functionalities currently missing by the `QuotaBank` contract## Minimal setup
- Download [gvite](https://github.com/vitelabs/go-vite/releases/tag/v2.10.2)
- Copy content of `assets/gvite-v2.10.2.zip` into gvite folder
- Run `./gvite --config node_config_dev.json`
- Download [soliditypp](https://github.com/vitelabs/soliditypp-bin/releases/tag/v0.4.3) executable and modify `const solppc` in `scripts/deploy.js`
- Run `node ./scripts/init.js` to fund test accounts## Deploy contract
1. Modify `./scripts/constants.js`
2. Run `node ./scripts/deploy_test.js`
3. Replace `BankContractAddress` in `app/src/constants.ts`
4. Replace `QuotaBank.json` in `app/public/assets/contracts`## Test contracts
Test QuotaBank.solpp contract:
```bash
node ./scripts/quota_bank_test.js
```Test QuotaMock.solpp contract:
```bash
node ./scripts/quota_mock_test.js
```