Simple fix for a non-working swap function#1626
Simple fix for a non-working swap function#1626stackoverflowed1 wants to merge 1 commit intolifinance:mainfrom
Conversation
WalkthroughA single parameter in the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
script/demoScripts/demoChainflip.ts (1)
76-84:⚠️ Potential issue | 🔴 CriticalBug:
lifiDiamondAddressis not in scope — this will throw aReferenceErrorat runtime.
executeWithSourceSwapis a top-level function whose parameters arelifiDiamondContract,bridgeData,chainflipData,amount, andpublicClient. The variablelifiDiamondAddressis only defined insidemain()(line 141) and is not accessible here. The PR description states the intent was to uselifiDiamondContract.address, which is consistent with the function's parameters.Proposed fix
- lifiDiamondAddress.address, + lifiDiamondContract.address,
Replaced the undefined variable
lifiDiamondAddresswithlifiDiamondContract.addressin theexecuteWithSourceSwap function.I chose this particular correction option because: