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

The application panicked (crashed): failed finding contract #355

Open
2 tasks done
NOOMA-42 opened this issue May 2, 2024 · 6 comments
Open
2 tasks done

The application panicked (crashed): failed finding contract #355

NOOMA-42 opened this issue May 2, 2024 · 6 comments
Labels
cheatcode Issue with a cheat code against zksync

Comments

@NOOMA-42
Copy link

NOOMA-42 commented May 2, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.0.2 (aafafa3 2024-05-02T03:16:11.592205000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

I'm trying to test Mailbox.t.sol but get following error, can someone shed some lights to it?

The application panicked (crashed).
Message:  failed finding contract for 0x60806040526000805461ffff191661010617905534801561001f57600080fd5b506101d98061002f6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80636465e69f14610046578063951a291f1461006a578063f7e83aee14610094575b600080fd5b6000546100539060ff1681565b60405160ff90911681526020015b60405180910390f35b6100926100783660046100c5565b600080549115156101000261ff0019909216919091179055565b005b6100b56100a2366004610137565b5050600054610100900460ff1692915050565b6040519015158152602001610061565b6000602082840312156100d757600080fd5b813580151581146100e757600080fd5b9392505050565b60008083601f84011261010057600080fd5b50813567ffffffffffffffff81111561011857600080fd5b60208301915083602082850101111561013057600080fd5b9250929050565b6000806000806040858703121561014d57600080fd5b843567ffffffffffffffff8082111561016557600080fd5b610171888389016100ee565b9096509450602087013591508082111561018a57600080fd5b50610197878288016100ee565b9598949750955050505056fea2646970667358221220cbf35c5578f339dc887414eccf5bd193891f5dd5a35d1dc1c027b58180baf27964736f6c63430008130033
Location: /Users/nooma42/paul_playground/foundry-zksync/crates/cheatcodes/src/inspector.rs:1696

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry
@NOOMA-42 NOOMA-42 added the T-bug label May 2, 2024
@NOOMA-42 NOOMA-42 changed the title failed finding contract for The application panicked (crashed): failed finding contract May 2, 2024
@dutterbutter
Copy link
Collaborator

dutterbutter commented May 2, 2024

Can you confirm you used forge test --zksync. Also keep in mind we currently do not support compiling 0.8.25 so you may need to run with forge test --use 0.8.24 (or whatever version being used) --zksync.

Will investigate and triage accordingly.

@dutterbutter dutterbutter added compiler Issues specific to compiling and removed T-bug labels May 2, 2024
@NOOMA-42
Copy link
Author

NOOMA-42 commented May 2, 2024

Yes 0.8.24 the output is as below. I've made another separate repo to deploy. Here's it, we can triage based on it
https://github.com/NOOMA-42/hyperlane-zksync-deploy

[⠊] Compiling...
[⠒] Compiling 234 files with 0.8.24
[⠆] Solc 0.8.24 finished in 23.69s
Compiler run successful with warnings:
Warning (2018): Function state mutability can be restricted to view
  --> test/Mailbox.t.sol:62:5:
   |
62 |     function test_localDomain() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/Mailbox.t.sol:66:5:
   |
66 |     function test_initialize() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/MerkleTreeHook.t.sol:65:5:
   |
65 |     function testQuoteDispatch() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/MerkleTreeHook.t.sol:73:5:
   |
73 |     function testHookType() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
  --> test/ValidatorAnnounce.t.sol:41:5:
   |
41 |     function assertEqAddrArr(address[] memory a, address[] memory b) internal {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
  --> test/ValidatorAnnounce.t.sol:47:5:
   |
47 |     function assertEqStrArrArr(
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/igps/gas-oracles/StorageGasOracle.t.sol:31:5:
   |
31 |     function testConstructorSetsOwnership() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/igps/gas-oracles/StorageGasOracle.t.sol:37:5:
   |
37 |     function testGetExchangeRateAndGasPrice() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/igps/gas-oracles/StorageGasOracle.t.sol:44:5:
   |
44 |     function testGetExchangeRateAndGasPriceUnknownDomain() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/token/HypERC20.t.sol:93:5:
   |
93 |     function _expectRemoteBalance(address _user, uint256 _balance) internal {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
   --> test/token/HypERC20.t.sol:196:5:
    |
196 |     function testTotalSupply() public {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
   --> test/token/HypERC20.t.sol:200:5:
    |
200 |     function testDecimals() public {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
   --> test/token/HypERC721.t.sol:170:5:
    |
170 |     function testTotalSupply() public {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
   --> test/token/HypERC721.t.sol:174:5:
    |
174 |     function testOwnerOf() public {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/token/HypNativeScaled.t.sol:65:5:
   |
65 |     function test_constructor() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).

zksolc not found in `.zksync` directory. Downloading zksolc compiler from https://github.com/matter-labs/zksolc-bin/releases/download/v1.4.1/zksolc-macosx-arm64-v1.4.1

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Warning: It looks like you are using 'ecrecover' to validate a signature of a user account.      │
│ zkSync Era comes with native account abstraction support, therefore it is highly recommended NOT │
│ to rely on the fact that the account has an ECDSA private key attached to it since accounts might│
│ implement other signature schemes.                                                               │
│ Read more about Account Abstraction at https://v2-docs.zksync.io/dev/developer-guides/aa.html    │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol

Warning: Function state mutability can be restricted to view
  --> test/Mailbox.t.sol:62:5:
   |
62 |     function test_localDomain() public {
   |     ^ (Relevant source part starts here and spans across multiple lines).


Warning: Function state mutability can be restricted to pure
  --> test/ValidatorAnnounce.t.sol:41:5:
   |
41 |     function assertEqAddrArr(address[] memory a, address[] memory b) internal {
   |     ^ (Relevant source part starts here and spans across multiple lines).


The application panicked (crashed).
Message:  failed finding contract for 0x60806040526000805461ffff191661010617905534801561001f57600080fd5b506101d98061002f6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80636465e69f14610046578063951a291f1461006a578063f7e83aee14610094575b600080fd5b6000546100539060ff1681565b60405160ff90911681526020015b60405180910390f35b6100926100783660046100c5565b600080549115156101000261ff0019909216919091179055565b005b6100b56100a2366004610137565b5050600054610100900460ff1692915050565b6040519015158152602001610061565b6000602082840312156100d757600080fd5b813580151581146100e757600080fd5b9392505050565b60008083601f84011261010057600080fd5b50813567ffffffffffffffff81111561011857600080fd5b60208301915083602082850101111561013057600080fd5b9250929050565b6000806000806040858703121561014d57600080fd5b843567ffffffffffffffff8082111561016557600080fd5b610171888389016100ee565b9096509450602087013591508082111561018a57600080fd5b50610197878288016100ee565b9598949750955050505056fea26469706673582212208152a132666379c0c0233d553f86d02ac0a616ab069804f4dd6cb869a7c85c2b64736f6c63430008180033
Location: /Users/paulyu/paul_playground/foundry-zksync/crates/cheatcodes/src/inspector.rs:1696

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

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  <empty backtrace>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
[1]    41730 abort      forge test --use 0.8.24 --zksync

Can you confirm you used forge test --zksync. Also keep in mind we currently do not support compiling 0.8.25 so you may need to run with forge test --use 0.8.24 --zksync.

Will investigate and triage accordingly.

@NOOMA-42
Copy link
Author

NOOMA-42 commented May 3, 2024

@dutterbutter we can triage based on this repo, I extract all the contract that need to deploy
https://github.com/NOOMA-42/hyperlane-zksync-deploy

@dutterbutter
Copy link
Collaborator

Thank you @NOOMA-42

Will make it apart of the next wave of bug fixes to review / fix.

@dutterbutter dutterbutter added cheatcode Issue with a cheat code against zksync and removed compiler Issues specific to compiling labels May 7, 2024
@hbriese
Copy link

hbriese commented May 15, 2024

Ran into this issue. It went away after removing the build & cache dirs

@nbaztec
Copy link
Contributor

nbaztec commented May 19, 2024

We're currently working on a fix that should avoid failed finding contract for 0x... class of errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cheatcode Issue with a cheat code against zksync
Projects
None yet
Development

No branches or pull requests

4 participants