Skip to content

Commit 439d48e

Browse files
Apply suggestions from code review
Co-authored-by: Jordan Schalm <jordan.schalm@gmail.com>
1 parent 57ebe7d commit 439d48e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

cadence/tests/adversarial_reentrancy_test.cdc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ fun test_reentrancy_recursiveDepositSink() {
223223
//
224224
// Cadence's post-condition on withdrawAndPull:
225225
// post { !self.state.isPositionLocked(pid): "Position is not unlocked" }
226-
// guarantees the lock is cleared even on revert.
226+
// guarantees the lock is cleared whenever the transaction does not revert. If the transaction reverts,
227+
// all state changes are rolled back (including locking the position).
227228
//
228229
// maxWithdrawTokens = $100 / (CF * price) = $100 / (0.65 * $1.00) ≈ 153.8 FLOW
229230
// 50 FLOW is safely within that limit.

cadence/tests/transactions/position-manager/create_position_reentrant_sink.cdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import "FlowALPModels"
1313
/// TEST TRANSACTION — DO NOT USE IN PRODUCTION
1414
///
1515
/// Opens a FlowALPv0 position wired with VaultSinkHacked as its issuanceSink
16-
/// (drawDownSink), mirroring how create_position_reentrancy.cdc wires
16+
/// (drawDownSink), mirroring how create_position_reentrant_source.cdc wires
1717
/// VaultSourceHacked as repaymentSource.
1818
///
1919
/// The sink is passed directly to createPosition() so the pool stores it

0 commit comments

Comments
 (0)