The KittyBridge::bridgeNftWithData function missing IERC20::approve for router, making bridgeNftWithData fails as router would never able to send fees
when using KittyConnect::bridgeNftToAnotherChain after the proper checks pass, it would call KittyBridge::bridgeNftWithData function but this particular function should fail because after it calculate the fee required, router instance would fail to send the LINK as fee on KittyBridge behalf because router does not have sufficient approval to spend LINK owned by KittyBridge contract.
KittyBridge.sol:
add SEPOLIA_RPC_URL and FUJI_RPC_URL to .env file using value from infura/alchemy rpc url.
add this contract in test folder:
BridgeTest.t.sol:
then run forge test --mt test_bridgeNftToAnotherChainFromSepoliaToFuji and the result should FAIL:
Protocol would be unable to bridge NFTs because it cannot pay for fees needed to send the CCIP message.
foundry and manual review
after checking if KittyBridge contract have sufficient fees to send the CCIP message, there should be a line to approve the router to send LINK token on behalf of KittyBridge before router.ccipSend is called.
add the following code to KittyBridge.sol:
then run forge test --mt test_bridgeNftToAnotherChainFromSepoliaToFuji and the result should PASS:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.