diff --git a/src/pot.sol b/src/pot.sol index dfdff599..15dd9bd5 100644 --- a/src/pot.sol +++ b/src/pot.sol @@ -139,13 +139,18 @@ contract Pot is LibNote { // --- Savings Rate Accumulation --- function drip() external note returns (uint tmp) { require(now >= rho, "Pot/invalid-now"); - tmp = rmul(rpow(dsr, now - rho, ONE), chi); + tmp = drop(); uint chi_ = sub(tmp, chi); chi = tmp; rho = now; vat.suck(address(vow), address(this), mul(Pie, chi_)); } + function drop() external view returns (uint) { + if (now == rho) return chi; + return rmul(rpow(dsr, now - rho, ONE), chi); + } + // --- Savings Dai Management --- function join(uint wad) external note { require(now == rho, "Pot/rho-not-updated");