Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makerdao/osm
Feed with 1 hour delay
https://github.com/makerdao/osm
Last synced: 3 months ago
JSON representation
Feed with 1 hour delay
- Host: GitHub
- URL: https://github.com/makerdao/osm
- Owner: makerdao
- License: agpl-3.0
- Created: 2018-02-23T19:20:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-16T02:28:47.000Z (almost 2 years ago)
- Last Synced: 2023-04-05T23:40:54.205Z (almost 2 years ago)
- Language: Solidity
- Homepage:
- Size: 46.9 KB
- Stars: 21
- Watchers: 21
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oracle Security Module
![Build Status](https://github.com/makerdao/osm/actions/workflows/.github/workflows/tests.yaml/badge.svg?branch=master)This contract is given a `DSValue` as a source to read from. You set a time interval with `step`. Whenever that `step` time has passed, it will let you `poke`. When you `poke` it reads the value from the source and stores it. The previous stored value becomes the current value.
This contracts implements `read` and `peek` from DSValue, but it is not one. It also has a new function `peep` to read what the next value will be after a `poke`.
```
// create
OSM osm = new OSM(DSValue(src));// can be poked every hour, on the hour
osm.step(3600);(val, ok) = osm.peek() // get current value
(val, ok) = osm.peep() // get upcoming value
val = osm.read() // get current value, or fail```
If this `DSValue` has a valid value on creation, the OSM with start with that same value.