This repository contains the source code for a smart contract called Boomerang
. The Boomerang
smart contract allows users to create a new Boomerang
speechifying the time for the expiry and the update frequency.
To run the tests for this smart contract, you will need to have the following tools installed on your machine:
- Node.js (version 14 or higher)
- Truffle (version 5 or higher)
- Ganache CLI (version 6 or higher)
- Clone this repository to your local machine.
- Navigate to the root of the repository.
- Run
npm install
to install the project dependencies.
Notes, use
nvm use 18.15.0 --lts
To run the tests for the Boomerang
smart contract, follow these steps:
- Start Ganache CLI by running the following command:
npx ganache-cli
- In a separate terminal window, compile and migrate the smart contract by running the following commands:
npx truffle compile
npx truffle migrate
- Run the tests by running the following command:
npx truffle test
- Start Ganache CLI by running the following command:
npx ganache-cli
Let this terminal run, note down the mnemonic
-
Copy the .env.example file to a new file called .env
-
Set the mnemonic from the output of step 1 , make sure to set it between "apple banana ..."
-
Make sure you have built the contract
npx truffle compile
- Deploy
node scripts/deploy.js
-
Node the contract address and update .env file
-
Now deploy two random boomerangs.
node scripts/boom.js
- Now you are ready to go launch the frontend, go to app dir and follow readme
To deploy the Boomerang
smart contract to a testnet or mainnet, you will need to update the truffle-config.js
file with the appropriate configuration settings for your network of choice.
Once you have updated the truffle-config.js
file, you can deploy the smart contract by running the following command:
truffle migrate --network <network-name>
This project is licensed under the MIT License - see the LICENSE file for details.
- This project was created as part of a tutorial on Ethereum smart contract development.