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.
- 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
testfolder.
- Node.js
- npm or yarn
- Clone the repository:
git clone https://github.com/hasip-timurtas/Nodejs-Solidity-Lottery.git cd Nodejs-Solidity-Lottery - Install dependencies:
npm install
-
Create
.envfile:.env.examplefile for reference:WALLET_MNEMONIC='your wallet mnemonic here' INFURA_URL=https://your-infura-url-here
-
Copy the example file to create your own
.envfile:cp .env.example .env
node compile.jsUpdate deployment parameters in deploy.js, then run:
node deploy.jsAdd your tests in the test folder and run:
npm testcontracts/: Solidity smart contracts.test/: Test scripts.compile.js: Compilation script.deploy.js: Deployment script.
Feel free to submit issues and pull requests.
This project is licensed under the MIT License.