https://github.com/mathu97/hello-world-eth-smart-contract
A simple hello world Ethereum Smart Contract
https://github.com/mathu97/hello-world-eth-smart-contract
Last synced: 12 months ago
JSON representation
A simple hello world Ethereum Smart Contract
- Host: GitHub
- URL: https://github.com/mathu97/hello-world-eth-smart-contract
- Owner: mathu97
- Created: 2022-01-29T01:09:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-29T02:45:03.000Z (over 4 years ago)
- Last Synced: 2025-04-05T06:28:50.537Z (about 1 year ago)
- Language: JavaScript
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hello-world-eth-smart-contract
## Setup
`npm install`
## Set Alchemy and your EOA wallet private key as environment variables
create a `.env` file and add the following
```
API_URL = "
PRIVATE_KEY = ""
```
## Compile
`npx hardhat compile`
## Deploy
I used rinkeby, but you can set it to whatever ethereum test network you want to use. Remember to edit the `hardhat.config.js` file if you wanted to use another test network.
`npx hardhat run scripts/deploy.js --network rinkeby`
## Sending a transaction to smart contract
Set the `eoaWalletAddress` and `contractAddress` constants to your own wallet address and contract address respectively, in the `client/sendTransaction.js` file.
Run `node client/sendTransaction.js`, which will log the current message set on the contract (should be "Hello World!" when run for the first time), then sets the message to "Hello Mars!"