1

I'm using this program to make an NFT https://github.com/PatrickAlphaC/nft-mix and I get this error when I run create_collectable.py

File "brownie/_cli/run.py", line 50, in main
    return_value, frame = run(
  File "brownie/project/scripts.py", line 103, in run
    return_value = f_locals[method_name](*args, **kwargs)
  File "./scripts/rizer_incept/create_incept.py", line 10, in main
    fund_with_link(rizer_incept.address, "as_proxy_for")
  File "./scripts/helpful_scripts.py", line 40, in fund_with_link
    tx = interface.LinkTokenInterface(link_token).transfer(
  File "brownie/network/contract.py", line 615, in __call__
    return Contract.from_abi(self._name, address, self.abi, owner)
  File "brownie/network/contract.py", line 929, in from_abi
    address = _resolve_address(address)
  File "brownie/network/web3.py", line 193, in _resolve_address
    return to_address(domain)
  File "brownie/convert/main.py", line 43, in to_address
    return str(EthAddress(value))
  File "brownie/convert/datatypes.py", line 204, in __new__
    raise ValueError(f"'{value}' is not a valid ETH address") from None
ValueError: 'None' is not a valid ETH address

I think that the error has something to do with

tx = interface.LinkTokenInterface(link_token).transfer(
        contract_address, amount, {"from": account}
    )

aka line 40 in helpful_scripts.py

I think it has something to do with the fact that account=None. How should I set account to avoid this error?

2 Answers 2

2

Without just hardcoding your private key into the script you are running, you'll have to set your private key as an environment variable with $ export PRIVATE_KEY=<PRIVATE_KEY>. In your context, the account in create_collectable.py is instantiated from brownie-config which reads in your private key from .env. To set the environment variables from your .env run $ source .env in the same directory.

1
  • 1
    This is good but the problem was actually the chainlink address. The variable link_token was actually never set, and it should be the chainlink token's contract address. I'm assuming because the repo set link_token to None you're probably supposed to set this variable in your env file or something like that. Nov 3, 2021 at 1:59
2

I figured out what the problem was. You have to actually put the chainlink token address into the variable link_token so lines 84 to 86 in /scripts/helpful_scripts.py currently look like this:

def fund_with_link(
    contract_address, account=None, link_token=None, amount=1000000000000000000
):

But that function is supposed to look like this:

def fund_with_link(
    contract_address, account=None, link_token="0x01BE23585060835E02B77ef475b0Cc51aA1e0709", amount=1000000000000000000
):

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.