Giter Site home page Giter Site logo

malik672 / vmooney-erc721-sweepstakes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from official-moondao/vmooney-erc721-sweepstakes

0.0 0.0 0.0 10 KB

vMooney holders can mint 1 Raffle Ticket, contract will choose a random winner using Chainlink VRF

Solidity 100.00%

vmooney-erc721-sweepstakes's Introduction

vMooney Sweepstakes ๐ŸŒ•

This smart contract allows vMooney holders to enter a sweepstakes by minting an ERC-721 ticket. Holders can mint up to 1 ticket which cannot be transfered until the contract Owner enables "ticketTransfer". Winners are selected by generating a random number using the Chainlink VRF and randomly selecting a token id.

Deployment Guide

  1. Pin metadata for ticket to IPFS, add it to the tokenURI function in the contract
  2. Create a Chainlink VRF
  3. Ensure that the LinkTokenInterface, keyHash and vrfCoordinator in the contract are correct. This will vary based on the network you would like to deploy to. Supported Networks (the vMooney contracts are currently deployed on Goerli and Mainnet)
  4. Deploy the vMooney Sweepstakes, then copy the contract address
  5. Navigate to the Chainlink VRF you created in step 2 and add the vMooney Sweepstakes contract address as a "consumer" for your VRF
  6. Copy the id of your VRF, set the id of the VRF in the vMooney Sweepstakes contract by using the "setSubscript" function
  7. vMooney holders can now mint 1 ticket
  8. When the sweepstakes comes to an end, pause the contract, and use the "chooseWinner" function to randomly select a winner. Use the "winner" function to see the address of the winner. (Safeguard: verify that the winner has properly obtained the ticket throught the portal, double check the google-sheet used in the front-end and ensure that the holder's ticket is valid. If not, run the chooseWinner function again and select a new winner)
  9. (optional) After a winner has been chosen the contract owner can choose to allow holders to transfer their tickets, to enable ticket transfering use the "setTicketTransfer" function and pass in "true"

vmooney-erc721-sweepstakes's People

Contributors

colinmfoster4723 avatar malik672 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.