This code is to create a proveably random smart contract lottery
- Users can enter by paying for a ticket
- The ticket fees are going to the winner during the draw.
- After X period of time, the lottery will automatically draw a winner
- And this will be done programatically
- Using Chainlink VRF & Chainlink Automation
- Chainlink VRF(Verifiable Random Function) -> Randomness
- Chainlink Automation -> Time based trigger
-
Get the current chainid
-
If it is ETH Mainnet
- Get the necessary parameters for chainlink VRF & Automation
- https://docs.chain.link/vrf/v2/subscription/supported-networks/#ethereum-mainnet
-
If it is Sepolia
- Get the necessary parameters for chainlink VRF & Automation
- https://docs.chain.link/vrf/v2/subscription/supported-networks/#sepolia-testnet
-
If it is Anvil
- Deploy mocks for VRF
- Deploy mocks for Automation
- https://docs.chain.link/vrf/v2/subscription/examples/test-locally
- Write some deploy scripts
- Write our tests
- Work on a local chain
- Forked Testnet
- Forked Mainnet