Skip to content

hasip-timurtas/Nodejs-Solidity-Lottery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lottery Smart Contract

This project includes a Lottery smart contract written in Solidity and demonstrates how to integrate it with a Node.js environment. It includes scripts for compiling, deploying, and testing the smart contracts.

Features

  • Smart Contract Development: Write and manage Solidity contracts.
  • Compilation: Compile Solidity contracts using compile.js.
  • Deployment: Deploy contracts to the Ethereum network with deploy.js.
  • Testing: Run comprehensive tests using the scripts in the test folder.

Prerequisites

  • Node.js
  • npm or yarn

Installation

  1. Clone the repository:
    git clone https://github.com/hasip-timurtas/Nodejs-Solidity-Lottery.git
    cd Nodejs-Solidity-Lottery
  2. Install dependencies:
    npm install

Configuration

  1. Create .env file:

    .env.example file for reference:

    WALLET_MNEMONIC='your wallet mnemonic here'
    INFURA_URL=https://your-infura-url-here
  2. Copy the example file to create your own .env file:

    cp .env.example .env

Usage

Compile Contracts

node compile.js

Deploy Contracts

Update deployment parameters in deploy.js, then run:

node deploy.js

Test Contracts

Add your tests in the test folder and run:

npm test

Folder Structure

  • contracts/: Solidity smart contracts.
  • test/: Test scripts.
  • compile.js: Compilation script.
  • deploy.js: Deployment script.

Contributing

Feel free to submit issues and pull requests.

License

This project is licensed under the MIT License.

About

Lottery Smart Contract with Solidity and Nodejs. With complier, test and deploy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published