NFT-Lottery

所属分类:NFT
开发工具:Solidity
文件大小:178KB
下载次数:0
上传日期:2022-05-08 15:48:49
上 传 者sh-1993
说明:  no intro
(Trustless and mostly-trustless smart contracts for decentralized nft lotteries.)

文件列表:
.env (39, 2022-05-08)
contracts (0, 2022-05-08)
contracts\BouleMint.sol (10475, 2022-05-08)
contracts\BouleMintTest.sol (10353, 2022-05-08)
contracts\NFTLottery.sol (10123, 2022-05-08)
contracts\TrustlessNFTLottery.sol (7894, 2022-05-08)
hardhat.config.js (404, 2022-05-08)
nft-metadata-winner.json (241, 2022-05-08)
nft-metadata.json (241, 2022-05-08)
package-lock.json (685446, 2022-05-08)
package.json (657, 2022-05-08)
scripts (0, 2022-05-08)
scripts\deploy.js (432, 2022-05-08)
test (0, 2022-05-08)
test\NFTLottery.js (5536, 2022-05-08)

# NFT Lottery **UI Demo can be found here: https://billion-dollar-mint.web.app/** ## Abstract - Lotteries and raffles can be completely decentralized into trustless contracts, with legitimate checks in place to contract owners that ensure a fair game for all who play. - Developers beware, 'private' lotteries are illegal in some countries (USA included), so be careful how you use this. ## About - Users can mint lottery tickets, which are mapped to their address as ERC721s (NFTs). - The contract owner can mint tickets for addresses manually, up to the COMMUNITY_TICKET_CAP. This can be used to incentivize community outreach. - The contract owner calls the `generateWinningTicket` function, which uses Chainlink VRF to decide the winning ticket ID. - The contract owner then calls the `cashOutWinnings` function, which pays the winning address of the lottery the winner's pot, and then cashes out the remaining balance to the contract owner. - While this contract currently relies on the contract owner to 'decide the winner' there is no way for the winner to access funds until after the winner has been paid out. - If you wish for a 100% trustless (but perhaps less fun?) lottery system, use `TrustlessNFTLottery.sol` instead. ## Development - Install node: https://nodejs.org/en/download/ - Clone this repository and cd into it - Run `npm install` - Enter credentials & API endpoint in .env - To test, run `npx hardhat test` - To deploy to ropsten, run `npx hardhat --network ropsten run scripts/deploy.js`

近期下载者

相关文件


收藏者