ApeWorX/ape-avalanche

Cannot deploy smart contract to Fuji Testnet [APE-1167]

Closed this issue · 6 comments

Environment information

$ ape --version

0.6.12

$ ape plugins list

Installed Plugins:
vyper 0.6.9
avalanche 0.6.3

  • Python Version: 3.8.12
  • OS: Mac Ventura 13.4.1

What went wrong?

ape-config.yaml
name: sc_learn

plugins:

  • name: avalanche
  • name: vyper

geth:
avalanche:
fuji:
uri: https://api.avax-test.network/ext/bc/C/rpc

  • what command you ran

I loaded an active account on the Avalanche fuji testnet with 1.9 avax. I had a contract that I was able to deploy locally. Here is the sequence of events:

ape console
a = accounts[0]
contract = a.deploy(project.erc721)

Locally this worked and the contract was successfully deployed. I then started ape trying to upload a contract to Fuji testnet.

ape console --network avalanche:fuji:geth --verbosity DEBUG
a = accounts[0]
contract = a.deploy(project.erc721)

The previous command failed with the following traceback: (I'm including successful DEBUG lines too)

DEBUG: Making request. Method: eth_getTransactionCount
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getTransactionCount
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getTransactionCount, Response: {'jsonrpc': '2.0', 'id': 7, 'result': '0x4'}
DEBUG: Making request. Method: eth_maxPriorityFeePerGas
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_maxPriorityFeePerGas
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_maxPriorityFeePerGas, Response: {'jsonrpc': '2.0', 'id': 8, 'result': '0x0'}
DEBUG: Making request. Method: eth_getBlockByNumber
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber, Response: {'jsonrpc': '2.0', 'id': 9, 'result': {'baseFeePerGas': '0x5d21dba00', 'blockExtraData': '0x', 'blockGasCost': '0x0', 'difficulty': '0x1', 'extDataGasUsed': '0x0', 'extDataHash': '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', 'extraData': '0x00000000000c8c400000000000000000000000000016dfca0000000000000000000000000000000000000000000000000000000000036a46000000000000000000000000000000000000000000000000', 'gasLimit': '0xe4e1c0', 'gasUsed': '0x164aa', 'hash': '0xc70b77b747f44729657d10fd79c65d7688b0972234140c643ecd8e1d738d6687', 'logsBloom': '0x00000000000000000000000002100000000100000000080000000000020000000000000000004000000000000000000000000000000000000000000000000000000000000000000000008000000000000020000000000000200200000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'miner': '0x0100000000000000000000000000000000000000', 'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000', 'nonce': '0x0000000000000000', 'number': '0x16c599d', 'parentHash': '0xa371025a9a666fd933149f8476d814b64778ad941259c37e9fce8b010edba2fe', 'receiptsRoot': '0x77dc911449e0a8288a573b30201b5a6fcbf6bd4551963d4f57b5a84ad25e4c7a', 'sha3Uncles': '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', 'size': '0x5d4', 'stateRoot': '0xf964f2d921607f50ebdfefc15d2b61e7a51287500ac7d91910490c0326772ce4', 'timestamp': '0x64a706ad', 'totalDifficulty': '0x16c599d', 'transactions': ['0x1db44d5568278ae970183961696085aaeabe0ec2209161cb72dfa29483838e2f'], 'transactionsRoot': '0xb2d0563601d7d0a10d1938b378b1cc47f90fcb4daa90cdaf22c5811e5024b5e7', 'uncles': []}}
DEBUG: Making request. Method: eth_feeHistory
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_feeHistory
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_feeHistory, Response: {'jsonrpc': '2.0', 'id': 10, 'result': {'oldestBlock': '0x16c599d', 'baseFeePerGas': ['0x5d21dba00'], 'gasUsedRatio': [0.006087066666666667]}}
DEBUG: Not enough fee_history. Defaulting less-accurate approach.
DEBUG: Making request. Method: eth_getBlockByNumber
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber, Response: {'jsonrpc': '2.0', 'id': 11, 'result': {'baseFeePerGas': '0x5d21dba00', 'blockExtraData': '0x', 'blockGasCost': '0x0', 'difficulty': '0x1', 'extDataGasUsed': '0x0', 'extDataHash': '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', 'extraData': '0x00000000000c8c400000000000000000000000000016dfca0000000000000000000000000000000000000000000000000000000000036a46000000000000000000000000000000000000000000000000', 'gasLimit': '0xe4e1c0', 'gasUsed': '0x164aa', 'hash': '0xc70b77b747f44729657d10fd79c65d7688b0972234140c643ecd8e1d738d6687', 'logsBloom': '0x00000000000000000000000002100000000100000000080000000000020000000000000000004000000000000000000000000000000000000000000000000000000000000000000000008000000000000020000000000000200200000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'miner': '0x0100000000000000000000000000000000000000', 'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000', 'nonce': '0x0000000000000000', 'number': '0x16c599d', 'parentHash': '0xa371025a9a666fd933149f8476d814b64778ad941259c37e9fce8b010edba2fe', 'receiptsRoot': '0x77dc911449e0a8288a573b30201b5a6fcbf6bd4551963d4f57b5a84ad25e4c7a', 'sha3Uncles': '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', 'size': '0x5d4', 'stateRoot': '0xf964f2d921607f50ebdfefc15d2b61e7a51287500ac7d91910490c0326772ce4', 'timestamp': '0x64a706ad', 'totalDifficulty': '0x16c599d', 'transactions': ['0x1db44d5568278ae970183961696085aaeabe0ec2209161cb72dfa29483838e2f'], 'transactionsRoot': '0xb2d0563601d7d0a10d1938b378b1cc47f90fcb4daa90cdaf22c5811e5024b5e7', 'uncles': []}}
DEBUG: Making request. Method: eth_estimateGas
DEBUG: Making request. Method: eth_chainId
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_chainId
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_chainId, Response: {'result': '0xa869', 'id': 12, 'jsonrpc': '2.0'}
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_estimateGas
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_estimateGas, Response: {'jsonrpc': '2.0', 'id': 13, 'error': {'code': -32000, 'message': 'invalid opcode: PUSH0'}}
ERROR: (TransactionError) Traceback (most recent call last):
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/providers.py", line 817, in estimate_gas_cost
    return self.web3.eth.estimate_gas(txn_params, block_identifier=block_id)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/web3/eth/eth.py", line 292, in estimate_gas
    return self._estimate_gas(transaction, block_identifier)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/web3/module.py", line 68, in caller
    result = w3.manager.request_blocking(
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/web3/manager.py", line 232, in request_blocking
    return self.formatted_response(
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/web3/manager.py", line 205, in formatted_response
    raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'invalid opcode: PUSH0'}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3508, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-e66b3a4103cc>", line 1, in <module>
    contract = a.deploy(project.erc721)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py", line 219, in deploy
    receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/contracts/base.py", line 1325, in _cache_wrap
    return function()
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py", line 219, in <lambda>
    receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py", line 112, in call
    txn = self.prepare_transaction(txn)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py", line 304, in prepare_transaction
    txn = self.provider.prepare_transaction(txn)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/providers.py", line 1285, in prepare_transaction
    txn.gas_limit = self.estimate_gas_cost(txn)
  File "/Users/hankbirkdale/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/providers.py", line 827, in estimate_gas_cost
    raise TransactionError(
ape.exceptions.TransactionError: Gas estimation failed: '(-32000) invalid opcode: PUSH0'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.

How can it be fixed?

Its hard to tell if the problem is in the plugin or https://github.com/ApeWorX/ape/blob/main/src/ape/api/accounts.py, specificallly the prepare transaction.

BTW, I'm not so sure its the plugin - it might be the latest Ape release

So this issue is from the configuration of the compiler you're using to deploy, seems like you are compiling with EIP-3855 being utilized on a network that doesn't support it yet

The fix should be to add this to your ape config:

[compiler plugin you are using]:
  evm_version: paris

So this issue is from the configuration of the compiler you're using to deploy, seems like you are compiling with EIP-3855 being utilized on a network that doesn't support it yet

The fix should be to add this to your ape config:

[compiler plugin you are using]:
  evm_version: paris

Also you might have to purge your .build/ cache

@fubuloubu OK here's what happened. Sorry for the amount of detail.

  1. Destroy the virtual environment and recreate with pipenv install --python 3.8.12
  2. Create a Pipfile with the following:
eth-ape = "==0.6.11"
[dev-packages]
ape-vyper = "==0.6.8"
  1. pipenv install --dev
  2. ape --version comes back with 0.6.11
  3. Here is my ape-config.yaml
name: sc_learn

plugins:
  - name: avalanche
  - name: vyper

geth:
  avalanche:
    fuji:
      uri: https://api.avax-test.network/ext/bc/C/rpc

vyper:
  evm_version: paris
ape console --network avalanche:fuji:geth --verbosity DEBUG
 a = accounts[0]
contract = a.deploy(project.erc721) 

RESULT: Successful deploy to Avalanche. Note that when I did this yesterday it failed, but in the interim I manually deleted my venv and recreated, so I suspect something in the environment.

pipenv uninstall eth-ape
pipenv uninstall ape-vyper  
pipenv install eth-ape
pipenv install ape-vyper

At this point the Pipfile looks like:

eth-ape = "*"
[dev-packages]
ape-vyper = "*"

and eth-ape is at 0.6.12

  1. No change to ape-config.
ape console --network avalanche:fuji:geth --verbosity DEBUG
 a = accounts[0]
contract = a.deploy(project.erc721) 

RESULT: Failure, but different from yesterday's failure.

In [1]: a = accounts[0]

In [2]: contract = a.deploy(project.erc721)
DEBUG: Making request. Method: eth_getTransactionCount
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getTransactionCount
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getTransactionCount, Response: {'jsonrpc': '2.0', 'id': 7, 'result': '0xb'}
DEBUG: Making request. Method: eth_maxPriorityFeePerGas
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_maxPriorityFeePerGas
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_maxPriorityFeePerGas, Response: {'jsonrpc': '2.0', 'id': 8, 'result': '0x0'}
DEBUG: Making request. Method: eth_getBlockByNumber
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber, Response: {'jsonrpc': '2.0', 'id': 9, 'result': {'baseFeePerGas': '0x5d21dba00', 'blockExtraData': '0x', 'blockGasCost': '0x0', 'difficulty': '0x1', 'extDataGasUsed': '0x0', 'extDataHash': '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', 'extraData': '0x000000000000000000000000000186a40000000000000000000000000002f27e000000000000000000000000000186980000000000000000000000000015713e00000000000000000000000000000000', 'gasLimit': '0xe4e1c0', 'gasUsed': '0x157832', 'hash': '0x21c3e23f4fbbd647cf5a8bcbaa1e5b9e2627c198c1485ffb4cd3356d1b532692', 'logsBloom': '0x00000000000000000000000801800000000040000200020000000100100000100000000000000000000000000000040000000110000000000000000000200000024000001220000000400008000000000000000000000000000000000000000000040002020000000002000000800810000004000800400000000010000011020002000400000000000000000000000009000000280000000000000000000000020080004000220000880000000010000042002000000000000000004000000000001002000088000000000040000000000000004000004000000020000220001010000004000002010000000000000000000800400000000020000000001000', 'miner': '0x0100000000000000000000000000000000000000', 'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000', 'nonce': '0x0000000000000000', 'number': '0x16cedd7', 'parentHash': '0x468c58f2c16ab160257a16ad4065f16cb4dbf855f0fdaac6098fdbe9a7f77a54', 'receiptsRoot': '0x7e86459e6b6a77778f9bfa402a4405c28bde0d162346575e6e2d491c2639e2aa', 'sha3Uncles': '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', 'size': '0x3ee9', 'stateRoot': '0xc8969138924d321cf73a27fba6aaccacf39ecbb34e0d7188828a2fbe2131e068', 'timestamp': '0x64a855d6', 'totalDifficulty': '0x16cedd7', 'transactions': ['0x31c1d7a08c5e9173980e25785dccf98ef3f9bc4d180ca930b36b3f05712a45b7', '0x8b8bca03d0344f43d122e582351d2bfd640b7a7bf54a16617a91962ffb3a8c30', '0xa005af088a86823a8040c9f7539ddd3814bd22d8398c1cf29348678b2b3548b3', '0x8988c4523122f7160be794a2a8d1497c08c4e895a2b453db572ff0e549ee9acc', '0x31fa183d8361b20f0c29fc403cc6790df4e597747e824476ae5fd9bf9510a338', '0x53c23cd87097c90793f2fb7a2b8e0f40185bfa2511fac2f4b72734cc3b765a3b', '0xdb9f18462ac06cbb5f02ba5132b3fb14c3f9984a49f9e14a77355e3c15c09b0b', '0x7baa45c2a73d748e4a5219a16ff26acd49a44372749e3776e982502b0163de5e', '0xc0f389fbf5a3848b3295183169d28c57f0dc434f4a120a8f04a5db47c33fa661'], 'transactionsRoot': '0xa5ac61df98f10894a2beaac3479b91c38d5223c55530f0e68b3a154201ee031b', 'uncles': []}}
DEBUG: Making request. Method: eth_feeHistory
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_feeHistory
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_feeHistory, Response: {'jsonrpc': '2.0', 'id': 10, 'result': {'oldestBlock': '0x16cedd7', 'baseFeePerGas': ['0x5d21dba00'], 'gasUsedRatio': [0.09380173333333333]}}
DEBUG: Not enough fee_history. Defaulting less-accurate approach.
DEBUG: Making request. Method: eth_getBlockByNumber
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBlockByNumber, Response: {'jsonrpc': '2.0', 'id': 11, 'result': {'baseFeePerGas': '0x5d21dba00', 'blockExtraData': '0x', 'blockGasCost': '0x0', 'difficulty': '0x1', 'extDataGasUsed': '0x0', 'extDataHash': '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', 'extraData': '0x000000000000000000000000000186a40000000000000000000000000002f27e000000000000000000000000000186980000000000000000000000000015713e00000000000000000000000000000000', 'gasLimit': '0xe4e1c0', 'gasUsed': '0x157832', 'hash': '0x21c3e23f4fbbd647cf5a8bcbaa1e5b9e2627c198c1485ffb4cd3356d1b532692', 'logsBloom': '0x00000000000000000000000801800000000040000200020000000100100000100000000000000000000000000000040000000110000000000000000000200000024000001220000000400008000000000000000000000000000000000000000000040002020000000002000000800810000004000800400000000010000011020002000400000000000000000000000009000000280000000000000000000000020080004000220000880000000010000042002000000000000000004000000000001002000088000000000040000000000000004000004000000020000220001010000004000002010000000000000000000800400000000020000000001000', 'miner': '0x0100000000000000000000000000000000000000', 'mixHash': '0x0000000000000000000000000000000000000000000000000000000000000000', 'nonce': '0x0000000000000000', 'number': '0x16cedd7', 'parentHash': '0x468c58f2c16ab160257a16ad4065f16cb4dbf855f0fdaac6098fdbe9a7f77a54', 'receiptsRoot': '0x7e86459e6b6a77778f9bfa402a4405c28bde0d162346575e6e2d491c2639e2aa', 'sha3Uncles': '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', 'size': '0x3ee9', 'stateRoot': '0xc8969138924d321cf73a27fba6aaccacf39ecbb34e0d7188828a2fbe2131e068', 'timestamp': '0x64a855d6', 'totalDifficulty': '0x16cedd7', 'transactions': ['0x31c1d7a08c5e9173980e25785dccf98ef3f9bc4d180ca930b36b3f05712a45b7', '0x8b8bca03d0344f43d122e582351d2bfd640b7a7bf54a16617a91962ffb3a8c30', '0xa005af088a86823a8040c9f7539ddd3814bd22d8398c1cf29348678b2b3548b3', '0x8988c4523122f7160be794a2a8d1497c08c4e895a2b453db572ff0e549ee9acc', '0x31fa183d8361b20f0c29fc403cc6790df4e597747e824476ae5fd9bf9510a338', '0x53c23cd87097c90793f2fb7a2b8e0f40185bfa2511fac2f4b72734cc3b765a3b', '0xdb9f18462ac06cbb5f02ba5132b3fb14c3f9984a49f9e14a77355e3c15c09b0b', '0x7baa45c2a73d748e4a5219a16ff26acd49a44372749e3776e982502b0163de5e', '0xc0f389fbf5a3848b3295183169d28c57f0dc434f4a120a8f04a5db47c33fa661'], 'transactionsRoot': '0xa5ac61df98f10894a2beaac3479b91c38d5223c55530f0e68b3a154201ee031b', 'uncles': []}}
DEBUG: Making request. Method: eth_estimateGas
DEBUG: Making request. Method: eth_chainId
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_chainId
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_chainId, Response: {'result': '0xa869', 'id': 12, 'jsonrpc': '2.0'}
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_estimateGas
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_estimateGas, Response: {'jsonrpc': '2.0', 'id': 13, 'result': '0x10cb04'}
DEBUG: Making request. Method: eth_getBalance
DEBUG: Making request HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBalance
DEBUG: Getting response HTTP. URI: https://api.avax-test.network/ext/bc/C/rpc, Method: eth_getBalance, Response: {'jsonrpc': '2.0', 'id': 14, 'result': '0x19ab82f851b46d9c'}
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 contract = a.deploy(project.erc721)

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py:219, in AccountAPI.deploy(self, contract, publish, *args, **kwargs)
    217 txn = contract(*args, **kwargs)
    218 txn.sender = self.address
--> 219 receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
    220 if not (address := receipt.contract_address):
    221     raise AccountsError(f"'{receipt.txn_hash}' did not create a contract.")

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/contracts/base.py:1325, in ContractContainer._cache_wrap(self, function)
   1318 """
   1319 A helper method to ensure a contract type is cached as early on
   1320 as possible to help enrich errors from ``deploy()`` transactions
   1321 as well produce nicer tracebacks for these errors. It also helps
   1322 make assertions about these revert conditions in your tests.
   1323 """
   1324 try:
-> 1325     return function()
   1326 except ContractLogicError as err:
   1327     if address := err.address:

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py:219, in AccountAPI.deploy.<locals>.<lambda>()
    217 txn = contract(*args, **kwargs)
    218 txn.sender = self.address
--> 219 receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
    220 if not (address := receipt.contract_address):
    221     raise AccountsError(f"'{receipt.txn_hash}' did not create a contract.")

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/accounts.py:140, in AccountAPI.call(self, txn, send_everything, private, **signer_options)
    137     else:
    138         txn.value = amount_to_send
--> 140 signed_txn = self.sign_transaction(txn, **signer_options)
    141 if not signed_txn:
    142     raise SignatureError("The transaction was not signed.")

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape_accounts/accounts.py:135, in KeyfileAccount.sign_transaction(self, txn, **kwargs)
    134 def sign_transaction(self, txn: TransactionAPI, **kwargs) -> Optional[TransactionAPI]:
--> 135     user_approves = self.__autosign or click.confirm(f"{txn}\n\nSign: ")
    136     if not user_approves:
    137         return None

File ~/.local/share/virtualenvs/sc_learn-y1B6Fsfv/lib/python3.8/site-packages/ape/api/transactions.py:175, in TransactionAPI.__str__(self)
    172 data = self.dict()
    173 if len(data["data"]) > 9:
    174     data["data"] = (
--> 175         "0x" + bytes(data["data"][:3]).hex() + "..." + bytes(data["data"][-3:]).hex()
    176     )
    177 else:
    178     data["data"] = "0x" + bytes(data["data"]).hex()

TypeError: string argument without an encoding

Good find, seems like a regression in latest ape

This got fixed here: ApeWorX/ape#1539
Please re-open if anything remains!

Thank you :)