This is the smart contract repository for the Lottery Bridge App, a Polymer challenged from polymerdevs/Quest-Into-The-Polyverse-Phase-1#13.
The frontned repository can be found at https://github.com/stevenlei/polymer-lottery-frontend.
The repo is compatible with both Hardhat and Foundry development environments.
- Have git installed
- Have node installed (v18+)
- Have Foundry installed (Hardhat will be installed when running
npm install
) - Have just installed (recommended but not strictly necessary)
You'll need some API keys from third party's:
- Optimism Sepolia and Base Sepolia Blockscout Explorer API keys
- Have an Alchemy API key for OP and Base Sepolia
Some basic knowledge of all of these tools is also required, although the details are abstracted away for basic usage.
To compile your contracts and start testing, make sure that you have all dependencies installed.
From the root directory run:
just install
to install the vIBC core smart contracts as a dependency.
Additionally Hardhat will be installed as a dev dependency with some useful plugins. Check package.json
for an exhaustive list.
Note: In case you're experiencing issues with dependencies using the
just install
recipe, check that all prerequisites are correctly installed. If issues persist with forge, try to do the individual dependency installations...
Convert the .env.example
file into an .env
file. This will ignore the file for future git commits as well as expose the environment variables. Add your private keys and update the other values if you want to customize (advanced usage feature).
cp .env.example .env
This will enable you to sign transactions with your private key(s). If not added, the scripts from the justfile will fail.
The account associated with your private key must have both Base Sepolia and Optimism Sepolia ETH. To obtain the testnet ETH visit:
The project comes with a LotteryUC smart contract. You can find the contracts in the /contracts
directory as LotteryUC.sol, which is using the universal channel.
Run the following command to deploy the Lottery smart contract:
just do-it
This project is built with the starter template from Polymer Hub, through the vIBC core contracts.
Join the Polymer Labs Community and build together.