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

Support vm.setArbitraryStorage cheatcode #825

Open
Jrigada opened this issue Jan 9, 2025 · 0 comments
Open

Support vm.setArbitraryStorage cheatcode #825

Jrigada opened this issue Jan 9, 2025 · 0 comments
Labels
cheatcode 🎮 Issue with a cheat code against zksync feature ➕ Feature item Internal ⚙️ p2 🟡 Indicates moderately high priority item upstream-parity 🟰 Needed for upstream feature parity

Comments

@Jrigada
Copy link
Contributor

Jrigada commented Jan 9, 2025

Component

Forge

Describe the feature you would like

Foundry added the vm.setArbitraryStorage cheat code to use with vm.copyStorage. It is not working right now, so we should add the necessary changes to support it.

This test currently fails in Foundry-zksync

    function test_copy_storage_from_arbitrary() public {
        CounterForArbitraryStorage counter2 = new CounterForArbitraryStorage();
        vm.setArbitraryStorage(address(counter2));
        // Next call would fail with array out of bounds without arbitrary storage
        address owner = counter2.getOwner(55);
        // Subsequent calls to same slot returns same value
        assertEq(counter2.getOwner(55), owner);
        // The new value is returned if explicitly written
        counter2.setOwner(55, address(111));
        assertEq(counter2.getOwner(55), address(111));
    }

Additional context

https://book.getfoundry.sh/cheatcodes/set-arbitrary-storage?highlight=setArbi#setarbitrarystorage

@Jrigada Jrigada added feature ➕ Feature item needs triage ♟️ Issue needs to be picked up or assigned cheatcode 🎮 Issue with a cheat code against zksync p2 🟡 Indicates moderately high priority item Internal ⚙️ upstream-parity 🟰 Needed for upstream feature parity and removed needs triage ♟️ Issue needs to be picked up or assigned labels Jan 9, 2025
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 feature ➕ Feature item Internal ⚙️ p2 🟡 Indicates moderately high priority item upstream-parity 🟰 Needed for upstream feature parity
Projects
None yet
Development

No branches or pull requests

1 participant