Closed ptisserand closed 1 month ago
Hi @ptisserand , please can I be assigned this when od hack starts?
To solve this issue, I'd take the following steps:
Please assign me.
I am applying to this issue via OnlyDust platform.
Please can I be assigned this issue? This is my first time applying in this ecosystem and I’d love to be given the opportunity. I am a blockchain Developer, and my experience includes html, css, react, JavaScript,TypeScript and solidity, python and Cairo.
To solve this issue, I'd take the following steps:
1. I’ll update withdraw_auto_from_l1() (add logic to reset the escrow mapping after tokens are transferred, ensuring they are no longer recorded in the contract's state). 2. I’ll test that after depositing tokens, withdrawing them using withdraw_auto_from_l1() resets the escrow. Validate the escrow mapping is cleared after the withdrawal. 3. I’ll ensure tests cover multiple scenarios to confirm the escrow is correctly reset in all cases.
Please assign me.
The maintainer ptisserand has assigned od-hunter to this issue via OnlyDust Platform. Good luck!
The maintainer ptisserand has assigned od-hunter to this issue via OnlyDust Platform. Good luck!
Thank you ser🫡
Hi @od-hunter any update on this ?
Hi @od-hunter any update on this ?
I’ve started working on it. Will push a pr soon
From https://codehawks.cyfrin.io/c/2024-07-ark-project/s/177
L2 escrow is not reset when withdrawn.
details
When tokens are deposited on L2 via
deposit_tokens()
, they will be deposited in theescrow
mapping, so when someone transfers back the same NFTs from L1 → L2 to take it from the contract balance, because they already exist.But when they are transferred back to L2,
withdraw_auto_from_l1()
transfers them if they exist in theescrow
mapping, but never resets the mapping when transferring it, this creates confusion that the tokens are still in thebridge.cairo
contract.Unit test must be provided.