Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment contract encountered an error [APE-1181] #1535

Closed
0x0077 opened this issue Jul 12, 2023 · 1 comment · Fixed by #1539
Closed

Deployment contract encountered an error [APE-1181] #1535

0x0077 opened this issue Jul 12, 2023 · 1 comment · Fixed by #1539
Labels
category: bug Something isn't working

Comments

@0x0077
Copy link

0x0077 commented Jul 12, 2023

Environment information

  • OS: macOS M1
  • Python Version: 3.10.9
0.6.13

Installed Plugins:
  etherscan    0.6.7
  vyper        0.6.9
  hardhat      0.6.10
  solidity     0.6.7
  alchemy      0.6.2

  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
plugins:
  - name: vyper
  - name: solidity
  - name: alchemy
  - name: etherscan
  - name: hardhat

default_ecosystem: ethereum

ethereum:
  default_network: mainnet-fork
  mainnet_fork:
    default_provider: hardhat
    transaction_acceptance_timeout: 99999999
  mainnet:
    transaction_acceptance_timeout: 99999999


hardhat:
  port: auto
  fork:
    ethereum:
      mainnet:
        upstream_provider: alchemy
        enable_hardhat_deployments: true

What went wrong?

Please include information like:

I'm going to deploy my contract in goerli, but it's not working, I don't know what happened

  • what command you ran
ape run main --network ethereum:goerli:alchemy
  • the code that caused the failure (see this link for help with formatting code)
from ape import accounts, project
from ape.cli import get_user_selected_account

def main():
    account = get_user_selected_account()

    account.deploy(project.ERC20)

  • full output of the error you received
Traceback (most recent call last):
  File "/Users/shiqixiang/Documents/envs/apeenv/bin/ape", line 8, in <module>
    sys.exit(cli())
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/_cli.py", line 36, in invoke
    return super().invoke(ctx)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape_run/_cli.py", line 74, in invoke
    return super().invoke(ctx)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/cli/commands.py", line 18, in invoke
    super().invoke(ctx)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape_run/_cli.py", line 146, in call
    main_ns["main"]()  # Execute the script
  File "/Users/shiqixiang/MyProjects/blockchain/2023/7/maskwallet/scripts/main.py", line 7, in main
    account.deploy(project.SignatureChecker)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/api/accounts.py", line 219, in deploy
    receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/contracts/base.py", line 1326, in _cache_wrap
    return function()
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/api/accounts.py", line 219, in <lambda>
    receipt = contract._cache_wrap(lambda: self.call(txn, **kwargs))
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/api/accounts.py", line 140, in call
    signed_txn = self.sign_transaction(txn, **signer_options)
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape_accounts/accounts.py", line 135, in sign_transaction
    user_approves = self.__autosign or click.confirm(f"{txn}\n\nSign: ")
  File "/Users/shiqixiang/Documents/envs/apeenv/lib/python3.10/site-packages/ape/api/transactions.py", line 175, in __str__
    "0x" + bytes(data["data"][:3]).hex() + "..." + bytes(data["data"][-3:]).hex()
TypeError: string argument without an encoding

How can it be fixed?

I moved from 3.11 to 3.10 and the same thing still happens

@0x0077 0x0077 added the category: bug Something isn't working label Jul 12, 2023
@vany365 vany365 changed the title Deployment contract encountered an error Deployment contract encountered an error [APE-1181] Jul 12, 2023
@0x0077 0x0077 closed this as completed Jul 16, 2023
@fubuloubu
Copy link
Member

@0x0077 just to be clear, did you solve your issue another way, or is #1539 your solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants