[go: up one dir, main page]

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

Update transact cheatcode example #1023

Open
mattsse opened this issue Oct 4, 2023 · 3 comments
Open

Update transact cheatcode example #1023

mattsse opened this issue Oct 4, 2023 · 3 comments
Assignees
Labels
good first issue Good for newcomers T-enhancement Type: enhance existing docs

Comments

@mattsse
Copy link
Member
mattsse commented Oct 4, 2023

ref foundry-rs/foundry#5985

TODO

  • add additional working example
  • make existing example work in the same block by manually setting the nonce
  • make existing example work on the parent block by manually decreasing the block's basefee
@Sabnock01
Copy link
Contributor

Will take this one.

@mattsse
Copy link
Member Author
mattsse commented Oct 7, 2023

wb!

@kamuik16
Copy link
Contributor

ref foundry-rs/foundry#5985

TODO

  • add additional working example
  • make existing example work in the same block by manually setting the nonce
  • make existing example work on the parent block by manually decreasing the block's basefee

Hey @mattsse! I noticed something interesting in this. If we see the transaction specified in the example. We can see the state changes here.

image

We can see the nonce of the sender changes from 1 to 2. Now if I set the nonce manually in the example like this vm.setNonce(sender, 1); but I get an error like this [FAIL. Reason: new nonce (1) must be strictly equal to or higher than the account's current nonce (2)] and if I set the nonce greater than or equal to 2 it says [FAIL. Reason: backend: failed committing transaction] so there's no way to pass this test? Or am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers T-enhancement Type: enhance existing docs
Projects
No open projects
Status: Todo
Development

No branches or pull requests

4 participants