Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: forge test --match-test test_U -vvv

- name: Print mainnet prices
env:
FOUNDRY_PROFILE: attach-test
run: forge test --match-test print_all_prices -vvv --fork-url ${{ secrets.MAINNET_TESTS_FORK }}

- name: Perform checks
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ node_modules/
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
# Ignores broadcast logs
/broadcast

# Docs
docs/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/@solady"]
path = lib/@solady
url = https://github.com/Vectorized/solady
[submodule "lib/@gearbox-protocol/permissionless"]
path = lib/@gearbox-protocol/permissionless
url = https://github.com/Gearbox-protocol/permissionless
6 changes: 6 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"rev": "5144d61af7d117f86d3fa9b4e2aa05535e2e5433"
}
},
"lib/@gearbox-protocol/permissionless": {
"tag": {
"name": "v1.5.0",
"rev": "ef0b90dbcd41c13555117ea119ef14c413627612"
}
},
"lib/@gearbox-protocol/sdk-gov": {
"rev": "affbbe5cde72c6f7796d3a4dae9fed305477fa9e"
},
Expand Down
11 changes: 9 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[profile.default]
src = 'contracts'
test = 'contracts/test'
script = 'scripts'
libs = ['lib']
out = 'out'

solc_version = '0.8.23'
evm_version = 'cancun'
optimizer_runs = 1000000
evm_version = 'shanghai'
optimizer_runs = 1000
bytecode_hash = 'none'

# See more config options https://github.com/gakonst/foundry/tree/master/config
block_number = 120000
Expand All @@ -13,3 +17,6 @@ gas_limit = 9223372036854775807 # the gas limit in tests
block_base_fee_per_gas = 100
fs_permissions = [{ access = "read-write", path = "./"}]
ffi = true

[profile.attach-test]
evm_version = 'cancun'
1 change: 1 addition & 0 deletions lib/@gearbox-protocol/permissionless
Submodule permissionless added at ef0b90
116 changes: 116 additions & 0 deletions scripts/upload/Upload_2025_10_21_Oracles.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.23;

import {Bytecode} from "@gearbox-protocol/permissionless/contracts/interfaces/Types.sol";
import {UploadBytecode} from "@gearbox-protocol/permissionless/script/UploadBytecode.sol";

import {BoundedPriceFeed} from "../../contracts/oracles/BoundedPriceFeed.sol";
import {CompositePriceFeed} from "../../contracts/oracles/CompositePriceFeed.sol";
import {ZeroPriceFeed} from "../../contracts/oracles/ZeroPriceFeed.sol";
import {BPTStablePriceFeed} from "../../contracts/oracles/balancer/BPTStablePriceFeed.sol";
import {BPTWeightedPriceFeed} from "../../contracts/oracles/balancer/BPTWeightedPriceFeed.sol";
import {CurveCryptoLPPriceFeed} from "../../contracts/oracles/curve/CurveCryptoLPPriceFeed.sol";
import {CurveStableLPPriceFeed} from "../../contracts/oracles/curve/CurveStableLPPriceFeed.sol";
import {CurveTWAPPriceFeed} from "../../contracts/oracles/curve/CurveTWAPPriceFeed.sol";
import {CurveUSDPriceFeed} from "../../contracts/oracles/curve/CurveUSDPriceFeed.sol";
import {ERC4626PriceFeed} from "../../contracts/oracles/erc4626/ERC4626PriceFeed.sol";
import {KodiakIslandPriceFeed} from "../../contracts/oracles/kodiak/KodiakIslandPriceFeed.sol";
import {WstETHPriceFeed} from "../../contracts/oracles/lido/WstETHPriceFeed.sol";
import {MellowLRTPriceFeed} from "../../contracts/oracles/mellow/MellowLRTPriceFeed.sol";
import {PendleTWAPPTPriceFeed} from "../../contracts/oracles/pendle/PendleTWAPPTPriceFeed.sol";
import {YearnPriceFeed} from "../../contracts/oracles/yearn/YearnPriceFeed.sol";

contract Upload_2025_10_21_Oracles is UploadBytecode {
function _getContracts() internal pure override returns (Bytecode[] memory bytecodes) {
bytecodes = new Bytecode[](15);
bytecodes[0].contractType = "PRICE_FEED::BOUNDED";
bytecodes[0].version = 3_11;
bytecodes[0].initCode = type(BoundedPriceFeed).creationCode;
bytecodes[0].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/BoundedPriceFeed.sol";

bytecodes[1].contractType = "PRICE_FEED::COMPOSITE";
bytecodes[1].version = 3_11;
bytecodes[1].initCode = type(CompositePriceFeed).creationCode;
bytecodes[1].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/CompositePriceFeed.sol";

bytecodes[2].contractType = "PRICE_FEED::ZERO";
bytecodes[2].version = 3_11;
bytecodes[2].initCode = type(ZeroPriceFeed).creationCode;
bytecodes[2].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/ZeroPriceFeed.sol";

bytecodes[3].contractType = "PRICE_FEED::BALANCER_STABLE";
bytecodes[3].version = 3_11;
bytecodes[3].initCode = type(BPTStablePriceFeed).creationCode;
bytecodes[3].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/balancer/BPTStablePriceFeed.sol";

bytecodes[4].contractType = "PRICE_FEED::BALANCER_WEIGHTED";
bytecodes[4].version = 3_11;
bytecodes[4].initCode = type(BPTWeightedPriceFeed).creationCode;
bytecodes[4].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/balancer/BPTWeightedPriceFeed.sol";

bytecodes[5].contractType = "PRICE_FEED::CURVE_CRYPTO";
bytecodes[5].version = 3_11;
bytecodes[5].initCode = type(CurveCryptoLPPriceFeed).creationCode;
bytecodes[5].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveCryptoLPPriceFeed.sol";

bytecodes[6].contractType = "PRICE_FEED::CURVE_STABLE";
bytecodes[6].version = 3_11;
bytecodes[6].initCode = type(CurveStableLPPriceFeed).creationCode;
bytecodes[6].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveStableLPPriceFeed.sol";

bytecodes[7].contractType = "PRICE_FEED::CURVE_TWAP";
bytecodes[7].version = 3_11;
bytecodes[7].initCode = type(CurveTWAPPriceFeed).creationCode;
bytecodes[7].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveTWAPPriceFeed.sol";

bytecodes[8].contractType = "PRICE_FEED::CURVE_USD";
bytecodes[8].version = 3_11;
bytecodes[8].initCode = type(CurveUSDPriceFeed).creationCode;
bytecodes[8].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveUSDPriceFeed.sol";

bytecodes[9].contractType = "PRICE_FEED::ERC4626";
bytecodes[9].version = 3_11;
bytecodes[9].initCode = type(ERC4626PriceFeed).creationCode;
bytecodes[9].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/erc4626/ERC4626PriceFeed.sol";

bytecodes[10].contractType = "PRICE_FEED::KODIAK_ISLAND";
bytecodes[10].version = 3_11;
bytecodes[10].initCode = type(KodiakIslandPriceFeed).creationCode;
bytecodes[10].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/kodiak/KodiakIslandPriceFeed.sol";

bytecodes[11].contractType = "PRICE_FEED::WSTETH";
bytecodes[11].version = 3_11;
bytecodes[11].initCode = type(WstETHPriceFeed).creationCode;
bytecodes[11].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/lido/WstETHPriceFeed.sol";

bytecodes[12].contractType = "PRICE_FEED::MELLOW_LRT";
bytecodes[12].version = 3_11;
bytecodes[12].initCode = type(MellowLRTPriceFeed).creationCode;
bytecodes[12].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/mellow/MellowLRTPriceFeed.sol";

bytecodes[13].contractType = "PRICE_FEED::PENDLE_PT_TWAP";
bytecodes[13].version = 3_11;
bytecodes[13].initCode = type(PendleTWAPPTPriceFeed).creationCode;
bytecodes[13].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/pendle/PendleTWAPPTPriceFeed.sol";

bytecodes[14].contractType = "PRICE_FEED::YEARN";
bytecodes[14].version = 3_11;
bytecodes[14].initCode = type(YearnPriceFeed).creationCode;
bytecodes[14].source =
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/yearn/YearnPriceFeed.sol";
}
}