Skip to content

[Dev Tools] foundry-zksync non-broadcast (read-only) scripts fail to execute #916

Answered by cpb8010
ezynda3 asked this question in Dev Tooling
Discussion options

You must be logged in to vote

So here's a quick read-only script example

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script} from "forge-std/Script.sol";
import {console} from "forge-std/console.sol";

contract ReadOnlyScript is Script {
    function run() external view {
        address otherAccountAddress = 0xAf3fDfAb4CA3182Dc58B6E81a4a2D89FdE0214cD;
        console.log("Other account balance:", otherAccountAddress.balance);
    }
}

@ezynda3
Does your script run function have the view modifier?
You say broadcast is disabled, but if you don't configure it all, do you see failures?

I'd need more specific information to help here since it's not like all read-only scripts with zksync forge …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@ezynda3
Comment options

@cpb8010
Comment options

@MexicanAce
Comment options

Answer selected by MexicanAce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devtools Questions related to zkSync Tooling
3 participants