Skip to content

AdventureDayton/RTW3-Week2-BuyMeACoffee-Contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuyMeACoffee solidity contract

This repo contains a contract that implements tipping functionality.

Install dependencies with npm install.

Set up by creating a .env file, and filling out these variables:

GOERLI_URL="your Alchemy RPC URL"
GOERLI_API_KEY="your Alchemy API key"
PRIVATE_KEY="your wallet private key"

You can get an Alchemy RPC URL for free here.

!!! Be very careful with exporting your private key !!!

You can get your Private Key from MetaMask like this. If you have any questions or concerns about this, please find someone you trust to sanity check you!

!!! Be very careful with exporting your private key !!!

Deploy your contract with:

npx hardhat run scripts/deploy.js

Run an example buy coffee flow locally with:

npx hardhat run scripts/buy-coffee.js

Once you have a contract deployed to Goerli testnet, grab the contract address and update the contractAddress variable in scripts/withdraw.js, then:

npx hardhat run scripts/withdraw.js

will allow you to withdraw any tips stored on the contract.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 76.9%
  • Solidity 23.1%