> For the complete documentation index, see [llms.txt](https://cll-devrel.gitbook.io/chainlink-local-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cll-devrel.gitbook.io/chainlink-local-documentation/api-reference/mockv3aggregator.sol-api.md).

# MockV3Aggregator.sol API

## API Methods

* [`decimals()`](#mockv3aggregator-.decimals)
* [`description()`](#mockv3aggregator-.description)
* [`version()`](#mockv3aggregator-.version)
* [`getRoundData(uint80 _roundId)`](#mockv3aggregator-.getrounddata-uint80-_roundid)
* [`latestRoundData()`](#mockv3aggregator-.latestrounddata)
* [`updateAnswer(int256 _answer)`](#mockv3aggregator-.updateanswer-int256-_answer)
* [`updateRoundData(uint80 _roundId, int256 _answer, uint256 _timestamp, uint256 _startedAt)`](#mockv3aggregator-.updaterounddata-uint80-_roundid-int256-_answer-uint256-_timestamp-uint256-_started)
* [`aggregator()`](#mockv3aggregator-.aggregator)
* [`proposedAggregator()`](#mockv3aggregator-.proposedaggregator)
* [`proposeAggregator(AggregatorV2V3Interface _aggregator)`](#mockv3aggregator-.proposeaggregator-aggregatorv2v3interface-_aggregator)
* [`confirmAggregator(address _aggregator)`](#mockv3aggregator-.confirmaggregator-address-_aggregator)
* [`latestAnswer()`](#mockv3aggregator-.latestanswer-deprecated) :warning: Deprecated
* [`latestTimestamp()`](#mockv3aggregator-.latesttimestamp-deprecated) :warning: Deprecated
* [`latestRound()`](#mockv3aggregator-.latestround-deprecated) :warning: Deprecated
* [`getAnswer(uint256 roundId)`](#mockv3aggregator-.getanswer-uint256-roundid-deprecated) :warning: Deprecated
* [`getTimestamp(uint256 roundId)`](#mockv3aggregator-.gettimestamp-uint256-roundid-deprecated) :warning: Deprecated

## \[MockV3Aggregator].decimals()

```solidity
function decimals() external view returns(uint8);
```

Return the number of digits of precision for the stored answer. Answers are stored in fixed-point format.

**Return values:**

* `decimalPlaces` (uint8): The number of digits of precision for the stored answer.

***

## \[MockV3Aggregator].description()

```solidity
function description() external pure returns(string memory);
```

Return a description for this data feed. Usually this is an asset pair for a price feed. In mocks it is hard-coded to: `"src/data-feeds/MockV3Aggregator.sol"`.

**Return values:**

* `description` (string): The description for this data feed.

***

## \[MockV3Aggregator].version()

```solidity
function version() public pure returns(uint256);
```

Returns the contract version. This is different from the `typeAndVersion` for the aggregator. In mocks it is hard-coded to `0`.

**Return values:**

* `version` (uint256): The contract version.

***

## \[MockV3Aggregator].getRoundData(uint80 \_roundId)

```solidity
function getRoundData(uint80 _roundId) external view returns(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
```

Get the full information for a specific aggregator round including the answer and update timestamps. Use this to get the full historical data for a round.

**Parameters:**

* `_roundId` (uint80): The round ID.

**Return values:**

* `roundId` (uint80): The round ID.
* `answer` (iint256): The answer for this round.
* `startedAt` (uint256): Timestamp of when the round started.
* `updatedAt` (uint256): Timestamp of when the round was updated.
* `answeredInRound`(uint80): :warning: Deprecated - Previously used when answers could take multiple rounds to be computed.

***

## \[MockV3Aggregator].latestRoundData()

```solidity
 function latestRoundData() external view returns(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
```

Get the full information for the most recent round including the answer and update timestamps.

**Return values:**

* `roundId` (uint80): The round ID.
* `answer` (iint256): The answer for this round.
* `startedAt` (uint256): Timestamp of when the round started.
* `updatedAt` (uint256): Timestamp of when the round was updated.
* `answeredInRound`(uint80): :warning: Deprecated - Previously used when answers could take multiple rounds to be computed.

***

## \[MockV3Aggregator].updateAnswer(int256 \_answer)

```solidity
function updateAnswer(int256 _answer) public;
```

Sets the new answer that the mock contract will return. Starts the new round automatically. Bumps the `roundId` by one. Sets the `startedAt`, `updatedAt` and `answeredInRound` values to `block.timestamp`. To update all of these values, use the `updateRoundData` function.

**Parameters:**

* `_answer` (int256): The new answer for the next round.

***

## \[MockV3Aggregator].updateRoundData(uint80 \_roundId, int256 \_answer, uint256 \_timestamp, uint256 \_startedAt)

```solidity
function updateRoundData(uint80 _roundId, int256 _answer, uint256 _timestamp, uint256 _startedAt) public;
```

Sets new details of the specific round that the mock contract will return.

**Parameters:**

* `roundId` (uint80): The round ID.
* `answer` (iint256): The answer for this round.
* `startedAt` (uint256): Timestamp of when the round started.
* `updatedAt` (uint256): Timestamp of when the round was updated.
* `answeredInRound`(uint80): :warning: Deprecated - Previously used when answers could take multiple rounds to be computed.

***

## \[MockV3Aggregator].aggregator()

```solidity
function aggregator() public view returns(address);
```

Returns the address of the current `MockOffchainAggregator.sol` contract.

**Return values:**

* `aggregator` (address): The address of the current `MockOffchainAggregator.sol` contract.

***

## \[MockV3Aggregator].proposedAggregator()

```solidity
function proposedAggregator() public view returns(address);
```

Returns the address of the proposed `MockOffchainAggregator.sol` contract. It is `address(0)` by default.

**Return values:**

* `proposedAggregator` (address): The address of the proposed `MockOffchainAggregator.sol` contract.

***

## \[MockV3Aggregator].proposeAggregator(AggregatorV2V3Interface \_aggregator)

```solidity
function proposedAggregator(AggregatorV2V3Interface _aggregator) public;
```

Proposes the new `MockOffchainAggregator.sol` contract. Used as a first step in changing the underlying `MockOffchainAggregator.sol` contract. The second step is to call the `confirmAggregator()` function.

**Parameters:**

* `_aggregator` (address): The address of the `MockOffchainAggregator.sol` contract to propose.

***

## \[MockV3Aggregator].confirmAggregator(address \_aggregator)

```solidity
function confirmAggregator(address _aggregator) public;
```

Sets the proposed `MockOffchainAggregator.sol` contract as the current `aggregator`. The `proposedAggregator` becomes `address(0)`. Reverts if `_aggregator` is not equal to `proposedAggregator`.

**Parameters:**

* `_aggregator` (address): The address of the new `MockOffchainAggregator.sol` contract.

***

## \[MockV3Aggregator].latestAnswer() - :warning: Deprecated

```solidity
function latestAnswer() external view returns(int256);
```

:warning: Deprecated - Do not use this function.

***

## \[MockV3Aggregator].latestTimestamp() - :warning: Deprecated

```solidity
function latestTimestamp() external view returns(uint256);
```

:warning: Deprecated - Do not use this function.

***

## \[MockV3Aggregator].latestRound() - :warning: Deprecated

```solidity
function latestRound() external view returns(uint256);
```

:warning: Deprecated - Do not use this function.

***

## \[MockV3Aggregator].getAnswer(uint256 roundId) - :warning: Deprecated

```solidity
function getAnswer(uint256 roundId) external view returns(int256);
```

:warning: Deprecated - Do not use this function.

***

## \[MockV3Aggregator].getTimestamp(uint256 roundId) - :warning: Deprecated

```solidity
function getTimestamp(uint256 roundId) external view returns(uint256);
```

:warning: Deprecated - Do not use this function.
