Gelato-automations/contracts/MockCDAI.sol

24 lines
826 B
Solidity
Raw Normal View History

2020-08-17 10:17:04 +00:00
// "SPDX-License-Identifier: UNLICENSED"
pragma solidity 0.6.12;
contract MockCDAI {
// DSR
// https://compound.finance/docs#protocol-math
// CDAI uses supplyRatePerBlock with 10**18 precision
// Because MakerDAO dsr is rate per second with 10**27 precision,
// we also adopt this for CDAI.
2020-08-23 16:20:19 +00:00
//uint256 public supplyRatePerSecond = 1000000000627937192491029810; // per second==2% annually
uint256 public supplyRatePerSecond;
constructor(uint256 _sRPS) public {
supplyRatePerSecond = _sRPS;
}
2020-08-17 10:17:04 +00:00
/// @dev Use this during tests to simulate changing CDAI.supplyRatePerBlock conditions
/// @param _rate CDAI.supplyRatePerBlock but in seconds and 10**27 precision
function setSupplyRatePerSecond(uint256 _rate) external virtual {
supplyRatePerSecond = _rate;
}
}