Enigma is a secure computation protocol, where “secret nodes” in our network perform computations over encrypted data. Enigma brings privacy to any kind of computation - not just transactions - helping to improve the adoption and usability of decentralized technologies.
This application uses enigma's secret contracts and ethereum's smart contracts to create a private NFT lottery.
Key Features:
- client enables the contract owner can encrypt and send a list of 100 whitelisted Ethereum addresses
- client enables users encrypt and submit their addresses to the secret contract
- winner receives his token automatically
This project comes with a few handy scripts to help you create ERC721 contracts and mint tokens.
-
Create an ERC721 contract:
npx truffle exec ./scripts/createERC721.js <name> <symbol>
will printout the address of the contract
-
Mint a token
npx truffle exec ./scripts/mintToken.js <address> <tokenId>
- next-js
- react
- mobx-state-tree
- web3
npm install
- rename
.env-default
to.env
- modify
.env
"BUILD_CONTRACTS_PATH" discovery compile
discovery start
- once started:
discovery migrate
cd client
npm install
- rename
.env-default
to.env
- modify
.env
according to your setup npm run dev
- After doing
discovery start
make sure you reset metamask - Cannot run discovery because docker.sock doesn't exist in windows OS.
- When using WSL, docker-compose mount paths don't work.
- Sometimes running tests fail: "incorrect epoch", fixed by delaying each test for 1 second.
- Secret contract's
Cargo.toml
must have name "contract".