Skip to content

gmaf/cryptonacademy-test

Repository files navigation

Prerequisites:

  1. create .env file
  2. add ALCHEMY_API_KEY to .env
  3. add RINKEBY_PRIVATE_KEY to .env

Rinkeby proof:

1. Accounts:

Deploy a contract to the rinkeby network

Command

hardhat run --network rinkeby scripts/deploy.ts

Output

Deploying contracts with the account: 0x8658eba532306C137fAAa31ec0b1d2a16D03B5a8
Account balance: 200000000000000000
Donations deployed to: 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6

2. Donate 50 wei

Command

npx hardhat donate --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 --amount 50 --unit wei

Output

Successfully donated 50 Wei to address 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6

3. Check all donater addresses

Command

npx hardhat getAllDonaters --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6

Output

All donated addresses:
[ '0x8658eba532306C137fAAa31ec0b1d2a16D03B5a8' ]

4. Check getDonatedAmountByAddress

Command

npx hardhat getDonatedAmountByAddress --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 --donater 0x8658eba532306C137fAAa31ec0b1d2a16D03B5a8

Output

Address: 0x8658eba532306C137fAAa31ec0b1d2a16D03B5a8 donated: 50 Wei to contract: 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6

5. Withdraw 30 wei

Command

npx hardhat withdraw --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 --toaddress 0x65a376d42efE83eAE122Da52B652539d078206c8 --amount 30 --unit wei

Output

Successfully withdrew 30 Wei from: 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 to address 0x65a376d42efE83eAE122Da52B652539d078206c8

6. Additional donate of 77 Gwei

Command

npx hardhat donate --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 --amount 77 --unit gwei

Output

Successfully donated 77000000000 Wei to address 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6

7. Additional withdrawal of 33 Gwei

Command

npx hardhat withdraw --network rinkeby --contract 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 --toaddress 0x65a376d42efE83eAE122Da52B652539d078206c8 --amount 33 --unit gwei        

Output

Successfully withdrew 33000000000 Wei from: 0x033aBd77e0CA9484699F43Fc9c14378f46191Bd6 to address 0x65a376d42efE83eAE122Da52B652539d078206c8

About

Test task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published