Skip to content

Commit

Permalink
M-03 [Oval] Newest Prices May Be Reported Ignoring the lockWindow() C…
Browse files Browse the repository at this point in the history
…onstraint (#17)

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
  • Loading branch information
Reinis-FRP committed Jun 18, 2024
1 parent bce772d commit 2aa2c7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controllers/ImmutableController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ abstract contract ImmutableController is Oval {
mapping(address => bool) public unlockers;

constructor(uint256 _lockWindow, uint256 _maxTraversal, address[] memory _unlockers, uint256 _maxAge) {
require(_maxAge > _lockWindow, "Max age not above lock window");
require(_maxTraversal > 0, "Max traversal must be > 0");

LOCK_WINDOW = _lockWindow;
MAX_TRAVERSAL = _maxTraversal;
MAX_AGE = _maxAge;
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/MutableUnlockersController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ abstract contract MutableUnlockersController is Ownable, Oval {
mapping(address => bool) public unlockers;

constructor(uint256 _lockWindow, uint256 _maxTraversal, address[] memory _unlockers, uint256 _maxAge) {
require(_maxAge > _lockWindow, "Max age not above lock window");
require(_maxTraversal > 0, "Max traversal must be > 0");

LOCK_WINDOW = _lockWindow;
MAX_TRAVERSAL = _maxTraversal;
MAX_AGE = _maxAge;
Expand Down
2 changes: 2 additions & 0 deletions src/factories/BaseFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ contract BaseFactory is Ownable {
);

constructor(uint256 _maxTraversal, address[] memory _defaultUnlockers) {
require(_maxTraversal > 0, "Max traversal must be > 0");

MAX_TRAVERSAL = _maxTraversal;
setDefaultUnlockers(_defaultUnlockers);
}
Expand Down

0 comments on commit 2aa2c7d

Please sign in to comment.