Coder Social home page Coder Social logo

devcon-raffle's Introduction

Devcon Ticket Sale System

Running Hardhat node

Change directory to packages/contracts and execute:

yarn node:run

This will start a Hardhat node, deploy the contracts and place initial bids using the first twenty auto-generated accounts.

Custom tasks

A number of custom Hardhat tasks were defined to aid testing.

Managing local node

  • yarn node:increase-time [--value <INT>] - increase block time by value seconds, defaults to six hour
  • yarn node:accounts - print a list of available accounts

Interacting with AuctionRaffle contract

Hardhat

  • yarn hardhat:bid --account <STRING> --amount <STRING> - using account place bid of amount ETH
  • yarn hardhat:bid-random --amount <INT> [--account <INT>] - using randomly generated accounts place amount of bids using funds from account with index account (defaults to 0)
  • yarn hardhat:settle-auction - settle auction
  • yarn hardhat:settle-raffle - settle raffle using random numbers
  • yarn hardhat:settle - increase time, settle auction and raffle

Arbitrum Rinkeby

  • yarn rinkeby:generate-dotenv [--path <STRING>] [--count <INT>] - generate .env file needed for other tasks, path - output path, count - number of private keys to generate
  • yarn rinkeby:transfer-ether - transfer ether from DEPLOYER to PRIVATE_KEYS accounts
  • yarn rinkeby:init-bids - place initial bids using PRIVATE_KEYS accounts

Ethereum Mainnet

  • yarn ethereum:generate-random-numbers --blocks <ARRAY> --secret <STRING> - generate random numbers for raffle settlement, blocks - array of block numbers from which extract block hash (e.g. "[1234, 5678]"), secret - secret number represented as 32 bytes hex string

devcon-raffle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.