Skip to content

Commit

Permalink
fix: #26
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jan 1, 2025
1 parent 83a4f2a commit e527b72
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/curve/stable/StablePair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@ contract StablePair is ReservoirPair {
uint64 public lastInvariantAmp;

constructor(IERC20 aToken0, IERC20 aToken1) ReservoirPair(aToken0, aToken1, PAIR_SWAP_FEE_NAME) {
ampData.initialA = factory.read(AMPLIFICATION_COEFFICIENT_NAME).toUint64() * uint64(StableMath.A_PRECISION);
uint64 lImpreciseA = factory.read(AMPLIFICATION_COEFFICIENT_NAME).toUint64();
require(lImpreciseA >= StableMath.MIN_A && lImpreciseA <= StableMath.MAX_A, InvalidA());

ampData.initialA = lImpreciseA * uint64(StableMath.A_PRECISION);
ampData.futureA = ampData.initialA;
ampData.initialATime = uint64(block.timestamp);
ampData.futureATime = uint64(block.timestamp);

require(
ampData.initialA >= StableMath.MIN_A * uint64(StableMath.A_PRECISION)
&& ampData.initialA <= StableMath.MAX_A * uint64(StableMath.A_PRECISION),
InvalidA()
);
}

function rampA(uint64 aFutureARaw, uint64 aFutureATime) external onlyFactory {
Expand Down

0 comments on commit e527b72

Please sign in to comment.