Skip to content

Commit

Permalink
draft impl
Browse files Browse the repository at this point in the history
  • Loading branch information
dapp-whisperer committed Dec 21, 2023
1 parent c7b7f12 commit 56dfe08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/contracts/contracts/ActivePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ contract ActivePool is
{
using SafeERC20 for IERC20;
string public constant NAME = "ActivePool";
uint256 public constant MAXIMUM_DEBT = 1e27; // Maximum debt value allowed. Prevents TWAP accumulator overflow for any viable timescale. 1e27 = 1e18 * 1e9

Check warning on line 33 in packages/contracts/contracts/ActivePool.sol

View workflow job for this annotation

GitHub Actions / lint

Line length must be no more than 120 but current length is 158

address public immutable borrowerOperationsAddress;
address public immutable cdpManagerAddress;
Expand Down Expand Up @@ -205,6 +206,7 @@ contract ActivePool is
_requireCallerIsBOorCdpM();

uint256 cachedSystemDebt = systemDebt + _amount;
require(cachedSystemDebt <= MAXIMUM_DEBT, "ActivePool: Maximum system debt exceeded");

_setValue(uint128(cachedSystemDebt)); // @audit update TWAP spot value
update(); // @audit update TWAP accumulator and weighted average
Expand Down

0 comments on commit 56dfe08

Please sign in to comment.