Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a575671
feat: DiaoracleV3 with historical data
nnn-gif Dec 15, 2025
448910c
feat: DIAOracleV3Meta to use historical values
nnn-gif Dec 15, 2025
3520047
feat: add AveragePriceMethodology contract
nnn-gif Dec 15, 2025
4616ac3
feat: add median methodology and custom window size
nnn-gif Dec 17, 2025
6231eac
chore: make solhint happy for DIAOracleV3
nnn-gif Dec 22, 2025
bd64cb3
feat: add unit test for DIAOracleV3
nnn-gif Dec 22, 2025
e526597
chore: Update DIAOracleV3.sol
nnn-gif Dec 22, 2025
9455a88
chore: add package.json and config files
nnn-gif Dec 22, 2025
31e0328
chore: DIAORacleV3Meta solhint and tests
nnn-gif Dec 24, 2025
b5a9f6f
chore: add tests for DIAOracleV3 for ring buffer
nnn-gif Dec 24, 2025
65525f2
feat: add volume placeholder
nnn-gif Feb 9, 2026
7e78b05
feat: use erc165 for verify oracle address
nnn-gif Feb 10, 2026
d797a5a
chore: run pretteir
nnn-gif Feb 10, 2026
a89f64e
chore run and fix solhint
nnn-gif Feb 11, 2026
deeab30
fix: add max time gap for update
nnn-gif Feb 16, 2026
ec9720c
fix: calculate true median
nnn-gif Feb 17, 2026
5c52869
feat: make DIAOracleV3 upgradable contract
nnn-gif Feb 18, 2026
1720557
fix: add tests for oraclev3 proxy
nnn-gif Feb 18, 2026
7856f85
chore: add smart contract CI workflow (solhint + slither)
khawlahssn Feb 18, 2026
fe8d107
ci: also trigger smart-contracts workflow on PRs targeting oraclev3
khawlahssn Feb 18, 2026
b707243
fix: allow forge install to fail silently, exclude node_modules from …
khawlahssn Feb 18, 2026
f02852a
ci: add unit tests and coverage job
khawlahssn Feb 18, 2026
6f1fe4d
fix: install forge-std explicitly for unit tests
khawlahssn Feb 18, 2026
ce851a9
chore: fix job numbering comments in workflow
khawlahssn Feb 19, 2026
0fd1cb1
fix: make max history size fixed to 100
nnn-gif Feb 19, 2026
38495a9
fix: update immutable max history size tests
nnn-gif Feb 20, 2026
17ef21a
security: harden CI workflow
khawlahssn Feb 20, 2026
dda8cc9
Merge pull request #188 from diadata-org/feature/ci-slither
nnn-gif Feb 20, 2026
d888ea3
fix: add more tests for feeder
nnn-gif Mar 3, 2026
6e91d2d
Merge branch 'oraclev3' of github.com:diadata-org/decentral-feeder in…
nnn-gif Mar 3, 2026
1e113d0
feat: add decimal information in oracles
nnn-gif Mar 3, 2026
c5a72a0
feat: update version
nnn-gif Mar 4, 2026
93cf603
feat: add natspec comemnts
nnn-gif Mar 4, 2026
15e9049
fix: update solidity version
nnn-gif Mar 4, 2026
ffd8915
fix: skip equal timestamps values
nnn-gif Mar 11, 2026
a50f1bb
fix: rawData should be updated on setValue and setMultipleValue of v2
nnn-gif Mar 11, 2026
f3a35c6
fix: remove unused constant MAX_ALLOWED_HISTORY_SIZE
nnn-gif Mar 11, 2026
ed33d5b
fix: inconsistent loop iterate type
nnn-gif Mar 11, 2026
83aa16d
fix: add checks n threshold based on oracles
nnn-gif Mar 11, 2026
2991338
fix: SafeCast volume
nnn-gif Mar 11, 2026
0638911
fix: remove unused ThresholdNotMet error
nnn-gif Mar 11, 2026
37b1fe8
fix: fix incorrect revert name
nnn-gif Mar 11, 2026
6627c4b
fix: methodologies should revert instead of sending zero
nnn-gif Mar 12, 2026
4e35333
fix: skip oracles with zero volume in function getAggregatedVolume
nnn-gif Mar 12, 2026
b8095be
fix: round up in all methodologies
nnn-gif Mar 12, 2026
7e1fc66
fix: remove setDecimal from DIAOracleV3
nnn-gif Mar 12, 2026
2408d27
fix: update DIAOracleV3 Storage slot comment
nnn-gif Mar 13, 2026
854f71d
fix: remove double iteration over oracles
nnn-gif Mar 13, 2026
63fb80a
fix: freeze oz version
nnn-gif Mar 13, 2026
ff2ea10
fix: comment on sorting
nnn-gif Mar 13, 2026
38753f5
fix: update Import and add access control init
nnn-gif Mar 20, 2026
a4bcf32
Merge pull request #194 from diadata-org/oraclev3auditfix
nnn-gif Mar 24, 2026
ade3059
fix: add OpenZeppelin upgradeable contracts and fix SARIF fallback
khawlahssn Mar 24, 2026
5c7adea
Merge branch 'master' into oraclev3
khawlahssn Mar 24, 2026
5913ce0
Merge branch 'master' into oraclev3
nnn-gif Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions .github/workflows/smart-contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: smart-contracts

on:
pull_request:
branches:
- master
- oraclev3
paths:
- "contracts/**"
- "test-foundry/**"
- "foundry.toml"
- ".github/workflows/smart-contracts.yml"
push:
branches:
- master
paths:
- "contracts/**"
- "foundry.toml"
- ".github/workflows/smart-contracts.yml"
workflow_dispatch:

permissions:
contents: read
security-events: write # required for uploading SARIF to GitHub Security tab

jobs:
# ─────────────────────────────────────────────
# Job 1: Solidity Linter (solhint)
# ─────────────────────────────────────────────
solhint:
name: Solidity Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: contracts/package-lock.json

- name: Install dependencies
working-directory: contracts
run: npm ci

- name: Run solhint
working-directory: contracts
continue-on-error: true
run: |
npx solhint '**/*.sol' \
--ignore-path .solhintignore \
--formatter stylish

# ─────────────────────────────────────────────
# Job 2: Unit Tests & Coverage
# ─────────────────────────────────────────────
tests:
name: Unit Tests & Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Install Foundry dependencies
run: forge install || true

- name: Install forge-std
run: forge install foundry-rs/forge-std --no-git || true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install OpenZeppelin via npm
run: |
npm install @openzeppelin/contracts@5.2.0
npm install @openzeppelin/contracts-upgradeable@5.2.0

- name: Write Foundry remappings
run: |
echo "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/" > remappings.txt
echo "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/" >> remappings.txt
echo "forge-std/=lib/forge-std/src/" >> remappings.txt

- name: Run tests
continue-on-error: true
run: forge test -v

- name: Run coverage
continue-on-error: true
run: forge coverage

# ─────────────────────────────────────────────
# Job 3: Slither Static Analysis
# ─────────────────────────────────────────────
slither:
name: Slither Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable

- name: Install Foundry dependencies
run: forge install || true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install OpenZeppelin via npm
run: |
npm install @openzeppelin/contracts@5.2.0
npm install @openzeppelin/contracts-upgradeable@5.2.0

- name: Remove contracts/node_modules to prevent forge scanning it
run: rm -rf contracts/node_modules

- name: Write Foundry remappings
run: |
echo "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/" > remappings.txt
echo "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/" >> remappings.txt

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install solc
run: |
pip install solc-select==1.2.0
solc-select install 0.8.29
solc-select use 0.8.29

- name: Install Slither
run: pip install slither-analyzer==0.11.5

- name: Run Slither
continue-on-error: true
run: |
python -m slither contracts/ \
--solc-remaps "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ @openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/" \
--filter-paths "contracts/Flattened_for_verification.sol" \
--sarif results.sarif

- name: Ensure SARIF file exists
if: always()
run: |
if [ ! -f results.sarif ]; then
echo '{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0.json","runs":[{"tool":{"driver":{"name":"Slither","version":"0.11.5"}},"results":[]}]}' > results.sarif
fi

- name: Upload SARIF to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
if: always()
with:
sarif_file: results.sarif
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ decentral-feeder
decentral-feeder/build/docker-images.sh
/build/docker-images.sh
.env
.env.local
.deployed_addresses
lib
cache
.vscode
out
coverage-report
lcov.info
node_modules
broadcast


contracts/node_modules
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades

11 changes: 11 additions & 0 deletions .slither.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"detectors_to_exclude": [
"uninitialized-state",
"timestamp"
],
"exclude_informational": false,
"exclude_optimization": false,
"exclude_low": false,
"exclude_medium": false,
"exclude_high": false
}
19 changes: 19 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "solhint:recommended",
"rules": {
"no-global-import": "off",
"compiler-version": ["error", "^0.8.29"],
"max-line-length": ["warn", 120],
"func-name-mixedcase": "warn",
"func-param-name-mixedcase": "warn",
"modifier-name-mixedcase": "warn",
"private-vars-leading-underscore": "warn",
"use-forbidden-name": "warn",
"var-name-mixedcase": "warn",
"no-console": "off",
"no-empty-blocks": "warn",
"no-unused-vars": "warn",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"one-contract-per-file": "off"
}
}
7 changes: 7 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contracts/Flattened_for_verification.sol
**/node_modules/**/*.sol
**/lib/**/*.sol
**/out/**/*.sol
**/cache/**/*.sol
test-foundry/**/*.sol
contracts/node_modules/**/*.sol
2 changes: 2 additions & 0 deletions contracts/.solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flattened_for_verification.sol
node_modules/
Loading
Loading