fix: use makeAddr instead of vm.addr which creates a contract#74
Conversation
WalkthroughThe changes update the initialization of address variables in three test contracts, switching from numeric-based address generation using Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
test/Hyperstaker.t.sol (1)
20-22: Descriptive Address Generation Adopted – looks goodSwitching from
vm.addr(uint)tomakeAddr("role")produces deterministic EOAs without the side-effect of deploying contracts and makes the intent crystal-clear ("manager","staker", …).Optional polish for trace readability:
vm.label(manager, "manager"); vm.label(staker, "staker"); vm.label(staker2, "staker2");Labels show up in
forge test -vvlogs and cost nothing at runtime.test/Hyperfund.t.sol (1)
20-22: Cleaner address setup achieved
makeAddr("manager"),"contributor", etc. improve clarity, eliminate accidental contract creation, and keep addresses consistent across tests.As a minor enhancement, consider adding:
vm.label(manager, "manager"); vm.label(contributor, "contributor"); vm.label(contributor2, "contributor2");to make debug output more legible.
test/Integration.t.sol (1)
20-23: Consistent address generation – ✅The move to
makeAddrfor all four actors standardises address allocation across the suite. No functional concerns spotted.Nitpick: Labelling pays off when triaging verbose traces:
vm.label(manager, "manager"); vm.label(contributor, "contributor"); vm.label(contributor2, "contributor2"); vm.label(contributor3, "contributor3");Purely optional, but it often saves time.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
test/Hyperfund.t.sol(1 hunks)test/Hyperstaker.t.sol(1 hunks)test/Integration.t.sol(1 hunks)
this changed in foundry and made the test fail on sending to a contract that doesn't implement onERC1155Recieved