SimplePriceFeed

Git Source

Inherits: IPriceFeed

A simplistic implementation of IPriceFeed for demonstration purposes.

State Variables

prices

mapping(bytes32 => uint256) private prices;

Functions

setPrice

Sets the price for a security.

function setPrice(bytes32 securityId, uint256 price) external;

Parameters

Name
Type
Description

securityId

bytes32

The identifier of the security.

price

uint256

The new price.

getPrice

Fetches the current price of a security.

function getPrice(bytes32 securityId) external view override returns (uint256 price);

Events

PriceUpdated

event PriceUpdated(bytes32 indexed securityId, uint256 newPrice);

Last updated

Was this helpful?