We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11097d6 commit b4683bbCopy full SHA for b4683bb
contract/r/gnoswap/pool/v1/swap.gno
@@ -159,7 +159,9 @@ func (i *poolV1) Swap(
159
return "0", "0"
160
}
161
162
+ // Apply reentrancy lock to the actual pool state
163
slot0Start.SetUnlocked(false)
164
+ pool.SetSlot0(slot0Start)
165
166
// Call swap start hook if set
167
if i.store.HasSwapStartHook() {
@@ -172,7 +174,10 @@ func (i *poolV1) Swap(
172
174
173
175
176
defer func() {
- slot0Start.SetUnlocked(true)
177
+ // Release reentrancy lock on the actual pool state
178
+ slot0End := pool.Slot0()
179
+ slot0End.SetUnlocked(true)
180
+ pool.SetSlot0(slot0End)
181
182
if i.store.HasSwapEndHook() {
183
swapEndHook := i.store.GetSwapEndHook()
0 commit comments