smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.76k stars 2.9k forks source link

Lesson 5: brownie simple storage account address error #1892

Open its-all-relative opened 9 months ago

its-all-relative commented 9 months ago

In Lesson 5 of Youtube video, 3 ways to add account and pvt key to brownie accounts are demonstrated.

In the 2nd way of adding an account from Metamask using pvt key, running the script gives the account address which is same as my Metamask account as expected.

When 3rd way of adding via environment variables is used, using the same pvt key from the metamask account, a different account address is generated on running the script.

Q1 It seems that the private key in .env is not getting pulled into the script when running it. Can you share why this could be happening? I have tried without quotes too. The error I get is it is an invalid hexadecimal digit when it is right. Can the private key be used either from Metamask's or Ganache? Is there a change in using pvt keys from the 2 sources?

Screenshot 2023-12-12 at 12 18 16 PM

image

image