diff --git a/src/oracles/CoinbaseOracle.sol b/src/oracles/CoinbaseOracle.sol index c361ac2..3fc88e1 100644 --- a/src/oracles/CoinbaseOracle.sol +++ b/src/oracles/CoinbaseOracle.sol @@ -6,7 +6,7 @@ import {IAggregatorV3Source} from "../interfaces/chainlink/IAggregatorV3Source.s contract CoinbaseOracle is IAggregatorV3Source { address immutable reporter; - uint8 public constant decimals = 6; + uint8 public immutable decimals; string public symbol; @@ -15,8 +15,9 @@ contract CoinbaseOracle is IAggregatorV3Source { mapping(uint80 => int256) public roundAnswers; mapping(uint80 => uint256) public roundTimestamps; - constructor(string memory _symbol, address _reporter) { + constructor(string memory _symbol, uint8 _decimals, address _reporter) { symbol = _symbol; + decimals = _decimals; reporter = _reporter; } diff --git a/test/unit/CoinbaseOracle.sol b/test/unit/CoinbaseOracle.sol index 6fcfcbb..8ad98de 100644 --- a/test/unit/CoinbaseOracle.sol +++ b/test/unit/CoinbaseOracle.sol @@ -19,7 +19,7 @@ contract CoinbaseSourceAdapterTest is CommonTest { (address _reporter, uint256 _reporterPk) = makeAddrAndKey("reporter"); reporter = _reporter; reporterPk = _reporterPk; - coinbaseOracle = new CoinbaseOracle("ETH", reporter); + coinbaseOracle = new CoinbaseOracle("ETH", 6, reporter); } function testPushPrice() public { diff --git a/test/unit/CoinbaseOracleSourceAdapter.sol b/test/unit/CoinbaseOracleSourceAdapter.sol index 89fcdc2..57f3efc 100644 --- a/test/unit/CoinbaseOracleSourceAdapter.sol +++ b/test/unit/CoinbaseOracleSourceAdapter.sol @@ -73,7 +73,7 @@ contract CoinbaseSourceAdapterTest is CommonTest { (address _reporter, uint256 _reporterPk) = makeAddrAndKey("reporter"); reporter = _reporter; reporterPk = _reporterPk; - coinbase = new CoinbaseOracle(ticker, reporter); + coinbase = new CoinbaseOracle(ticker, 6, reporter); sourceAdapter = new TestedSourceAdapter(coinbase); // Push some prices to the oracle @@ -183,7 +183,7 @@ contract CoinbaseSourceAdapterTest is CommonTest { } function testNonHistoricalData() public { - coinbase = new CoinbaseOracle(ticker, reporter); + coinbase = new CoinbaseOracle(ticker, 6, reporter); sourceAdapter = new TestedSourceAdapter(coinbase); // Push only one price to the oracle