ApeWorX / ape

The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
https://apeworx.io
Apache License 2.0
872 stars 133 forks source link

UnboundLocalError: local variable 'traces' referenced before assignment #1957

Closed BlinkyStitt closed 6 months ago

BlinkyStitt commented 6 months ago

Environment information

$ ape --version
0.7.11.dev9+ga8d1487d

$ ape plugins list
Installed Plugins
  alchemy         0.7.1
  ens             0.7.0
  etherscan       0.7.1
  foundry         0.7.4.dev6+ga535421
  ganache         0.7.0
  hardhat         0.7.0
  infura          0.7.1
  polygon         0.7.1
  solidity        0.7.1
  template        0.7.0
  tokens          0.7.1
  vyper           0.7.0

Third-party Plugins
  flashprofits    0.0.1
  roll            0.0.3
$ cat ape-config.yaml
# ...copy and paste result of above command here...

What went wrong?

  File "/Users/bryan/code/flashprofits-ape/ape_flashprofits/deploy_helpers.py", line 183, in get_or_create
    receipt = contract_container.constructor.__call__(*constructor_args, sender=sender)
  File "/Users/bryan/code/flashprofits-ape/.venv/lib/python3.10/site-packages/ape/contracts/base.py", line 73, in __call__
    return sender.call(txn, **kwargs)
  File "/Users/bryan/code/flashprofits-ape/.venv/lib/python3.10/site-packages/ape/api/accounts.py", line 125, in call
    txn = self.prepare_transaction(txn)
  File "/Users/bryan/code/flashprofits-ape/.venv/lib/python3.10/site-packages/ape/api/accounts.py", line 357, in prepare_transaction
    txn = self.provider.prepare_transaction(txn)
  File "/Users/bryan/code/flashprofits-ape/.venv/lib/python3.10/site-packages/ape_ethereum/provider.py", line 917, in prepare_transaction
    gas = min(int(self.estimate_gas_cost(txn) * multiplier), self.max_gas)
  File "/Users/bryan/code/flashprofits-ape/.venv/lib/python3.10/site-packages/ape_ethereum/provider.py", line 303, in estimate_gas_cost
    trace=traces,
UnboundLocalError: local variable 'traces' referenced before assignment
INFO: Stopping 'anvil' process.

I expected to see:

    raise ArgumentsLengthError(args_length, inputs=self.constructor.abi)

ERROR: (ArgumentsLengthError) The number of the given arguments (0) do not match what is defined in the ABI:
linear[bot] commented 6 months ago

APE-1705 UnboundLocalError: local variable 'traces' referenced before assignment

theodorecurtil commented 6 months ago

This seems to be caused by the newest version of the package, i have the same happening on 0.7.11.

ape --version
0.7.11

ape plugins list
Installed Plugins
  alchemy      0.7.1
  arbitrum     0.7.2
  etherscan    0.7.2
  foundry      0.7.4
  vyper        0.7.0