Skip to content

fix(forge): do not set balance as apparent value in delegate prank #10304

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Apr 15, 2025

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@grandizzy grandizzy enabled auto-merge (squash) April 15, 2025 05:09
@grandizzy grandizzy added T-bug Type: bug C-forge Command: forge labels Apr 15, 2025
@grandizzy grandizzy self-assigned this Apr 15, 2025
@grandizzy grandizzy moved this to Ready For Review in Foundry Apr 15, 2025
@grandizzy grandizzy removed their assignment Apr 15, 2025
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

@grandizzy grandizzy merged commit 314eded into foundry-rs:master Apr 15, 2025
22 checks passed
@grandizzy grandizzy deleted the issue-10302 branch April 15, 2025 07:32

function testDelegatePassesWhenBalanceSetToZero() external {
vm.createSelectFork("sepolia");
A a = new A();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might fail if this address ever gets a balance.

Vm constant vm = Vm(HEVM_ADDRESS);

function testDelegateFails() external {
vm.createSelectFork("sepolia");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might fail if this address ever have a zero balance. Maybe best to specify a fork number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-bug Type: bug
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

bug(cheatcodes): Facing issues with startPrank where address that have a balance do not work.
3 participants