Functions working without proper storage dealing into unexpected behaviors
function combine(Instance memory self, Instance memory delta) internal pure {
if (!self.skipCombine) {
self.deltaInBinInternal += delta.deltaInBinInternal;
self.deltaInErc += delta.deltaInErc;
self.deltaOutErc += delta.deltaOutErc;
}
self.excess = delta.excess;
self.decrementTick = delta.decrementTick;
self.endSqrtPrice = delta.endSqrtPrice;
self.swappedToMaxPrice = delta.swappedToMaxPrice;
}//@audit not stored
function pastMaxPrice(Instance memory self) internal pure {
self.swappedToMaxPrice = self.sqrtPriceLimit != 0 && (self.tokenAIn ? self.sqrtPriceLimit <= self.sqrtPrice : self.sqrtPriceLimit >= self.sqrtPrice);
}//@audit not stored
function noSwapReset(Instance memory self) internal pure {
self.excess = 0;
self.skipCombine = true;
self.endSqrtPrice = self.sqrtPrice;
}//@audit not stored
Use Instance storage self or return values
The text was updated successfully, but these errors were encountered:
All reactions