- This is a test project that I've written to learn Solidity.
- It's a smart contract that allows players to enter a lottery that picks a random winner.
- The corresponding front end React UI can be viewed here.
- Web3 (JavaScript interface to Ethereum blockchain)
- Ganache (testing)
- Mocha (testing)
- Infura (deploying to test network node)
- Truffle (wallet + deployment provider)
- dotenv (storing environment variables)
npm run test
- run test suitenode deploy.js
- deploy contract to test network- You'll need to create a
.env
file with yourINFURA_API
and Metamask walletMNEMONIC
. This is parsed incompile.js
, so that the variables are available when runningnode deploy.js
. - If you get an error to do with
ERR_OSSL_EVP_UNSUPPORTED
, it'll be due to an issue with the node version you're using. I usednvm
to switch to version 15.8.0, which does the trick. Alternatively if you don't want to do this, set this optionexport NODE_OPTIONS=--openssl-legacy-provider
.
- You'll need to create a
- https://infura.io/ - Free API to connect to an Ethereum test network node
- https://rinkeby.etherscan.io/ - Etherscan Rinkeby test network
- https://faucets.chain.link/rinkeby - request test ether
- https://eth-converter.com/extended-converter.html - Eth converter