1
forge create --rpc-url $QUICKNODE_RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY --verify src/Token.sol:Token

[⠒] Compiling...
No files changed, compilation skipped
The application panicked (crashed).
Message:  cannot convert a slice of length 20 to FixedBytes<32>
Location: crates/wallets/src/utils.rs:29

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮                               
   8: foundry_wallets::utils::create_private_key_signer::hae595b93e73a1f32
      at <unknown source file>:<unknown line>
   9: foundry_wallets::raw_wallet::RawWalletOpts::signer::h0f06950036ff3ae2
      at <unknown source file>:<unknown line>
  10: forge::cmd::create::CreateArgs::run::{{closure}}::hf984a39a664a7ad0
      at <unknown source file>:<unknown line>
  11: tokio::runtime::park::CachedParkThread::block_on::he3630ffb62fd787b
      at <unknown source file>:<unknown line>
  12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h3edb630d02e51c95
      at <unknown source file>:<unknown line>
  13: foundry_cli::utils::block_on::he0455b9ea97b4d21
      at <unknown source file>:<unknown line>
  14: forge::main::hde24f0af3c219a65
      at <unknown source file>:<unknown line>
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::hc71c08e973e7572c
      at <unknown source file>:<unknown line>
  16: std::rt::lang_start::{{closure}}::h09210dfb4fdbda93
      at <unknown source file>:<unknown line>
  17: std::rt::lang_start_internal::h103c42a9c4e95084
      at <unknown source file>:<unknown line>
  18: main<unknown>
      at <unknown source file>:<unknown line>
  19: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  20: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Aborted (core dumped)
3
  • Make sure that you've assigned the private key to the PRIVATE_KEY environment variable, because the error is suggesting that you've assigned the wallet address instead of private key. Commented May 15 at 23:08
  • Thank you very much, can't believe I didn't see that mistake!
    – Flegi
    Commented May 17 at 7:45
  • You’re welcome. I’ve submitted that as the answer, kindly mark that as accepted so that it would benefit others who might face the same problem. Happy coding! Commented May 17 at 8:26

1 Answer 1

0

Make sure that you've assigned the private key to the PRIVATE_KEY environment variable, because the error is suggesting that you've assigned the wallet address instead of private key.

You can follow these docs to export the private key corresponding to your MetaMask account.

Your Answer

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

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