Home > Software engineering >  'export' in VS code show problem statement "Declaration or statement expected."
'export' in VS code show problem statement "Declaration or statement expected."

Time:04-03

I am trying to create a ERC20 standard token using VS code by following a Youtube video https://www.youtube.com/watch?v=8rpir_ZSK1g . Until I reached the .env file, there was a problem showed which is this:My brownie-config.yaml file:

Can someone tell me what that I missed or why will this problem will occur?

I am new learner of blockchain application. I think there is something I missed to install.

CodePudding user response:

Declarations of environment variables in .env file should follow key-value manner, like:

PRIVATE_KEY='some-private-key-hex'

Using export command is useful when you want to source this file outside of brownie. If your .env file looks like:

export PRIVATE_KEY='some-private-key-hex'

then source it, like

source .env

However the recommended way of setting envs is the first one.

CodePudding user response:

I am having the same issue. Adding "const" to export the private key got rid of the error message , but now I am returning "ValueError: The private key must be exactly 32 bytes long, instead of 0 bytes"

I also tried importing the .env to my test which worked fine when doing unit test, but not with my integration test.

  • Related