- lang: Rust (backend) + Svelte (Frontend) + Solidity (Smart Contract)
- stack: AWS EC2 + MongoDB + Ganache + MetaMask
export LOTTERY_DB="private mongodb addr"
export LOTTERY_EC2="private ec2 addr"
export GANACHE="ganache addr"
ubuntu:~$ cd backend && rustup override set nightly && cargo run --release
ubuntu:~$ cd frontend && yarn install && yarn dev --host
ubuntu:~$ truffle migrate --network dev
- Svelte
- ViteJS
- Cannot run ChainLink VRF v2 to use provably fair RNG
- However, our implementation is hard to exploit as we generate the lottery number when the admin clicks the Pick Winner button.
- On the call, it generates on the fly and sends money right away. No one can see the number before the game finishes.
- The estimated gas fee to call of this library is about $4.