Description
Secure the fractional token exchange functions against malicious reentrancy callbacks by leveraging ephemeral transient storage locks.
Architecture & Context
When the smart contract invokes an external token contract to perform a transfer, malicious tokens can execute a callback into the original vault before the state balances are updated. Using transient storage (state that clears automatically at the end of the transaction) provides an ultra-cheap, bulletproof mutex lock.
Technical Requirements
- Implement a
non_reentrant modifier pattern in the Soroban SDK utilizing temporary storage keys.
- Wrap all state-mutating mint, burn, and swap functions within this lock.
- Ensure the lock is flawlessly released even if an internal sub-routine fails gracefully.
Acceptance Criteria
Description
Secure the fractional token exchange functions against malicious reentrancy callbacks by leveraging ephemeral transient storage locks.
Architecture & Context
When the smart contract invokes an external token contract to perform a transfer, malicious tokens can execute a callback into the original vault before the state balances are updated. Using transient storage (state that clears automatically at the end of the transaction) provides an ultra-cheap, bulletproof mutex lock.
Technical Requirements
non_reentrantmodifier pattern in the Soroban SDK utilizing temporary storage keys.Acceptance Criteria