Gelato-automations/contracts/mocks/MockCDAI.sol
2020-10-23 16:46:29 +02:00

24 lines
818 B
Solidity

// "SPDX-License-Identifier: UNLICENSED"
pragma solidity 0.7.4;
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.
//uint256 public supplyRatePerSecond = 1000000000627937192491029810; // per second==2% annually
uint256 public supplyRatePerSecond;
constructor(uint256 _sRPS) {
supplyRatePerSecond = _sRPS;
}
/// @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;
}
}