Skip to content

JediFaust/donation_smart_contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Donation Smart Contract

This contract can recieve donations from other addresses and storing whole list of unique addresses and total sum of their donations. After that owner of the contract, which is the address deploys exact contract, can withdraw certain amount of available tokens to any address

Functions

  • donate(amount)

make donation with certain amount

  • getDonators()

returns unique list of donator addresses

  • getAmount(address)

returns total amount of donations of exact address

  • withdraw(address, amount)

send certain amount of tokens from contract balance to provided address, this function can be called just by the owner of contract

HardHat Custom Tasks

node scripts/deploy.js --network rinkeby
npx hardhat donate --amount 100
npx hardhat donators
npx hardhat total-amount --address 0x5FbDB2315678afecb367f032d93F642f64180aa3
npx hardhat withdraw --address 0x5FbDB2315678afecb367f032d93F642f64180aa3 --amount 100

Other commands

node scripts/deploy.js --network rinkeby
npx hardhat test
npx hardhat coverage --testfiles "test/*.js"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published