Skip to content

Commit 69c12f5

Browse files
authored
fix: script to upload v3.1.1 price feeds (#63)
* chore: script to upload v3.1.1 price feeds * chore: add broadcast logs to `.gitignore` * chore: fix attach tests in CI
1 parent 64a386a commit 69c12f5

File tree

7 files changed

+139
-6
lines changed

7 files changed

+139
-6
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
run: forge test --match-test test_U -vvv
3838

3939
- name: Print mainnet prices
40+
env:
41+
FOUNDRY_PROFILE: attach-test
4042
run: forge test --match-test print_all_prices -vvv --fork-url ${{ secrets.MAINNET_TESTS_FORK }}
4143

4244
- name: Perform checks

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ node_modules/
55
cache/
66
out/
77

8-
# Ignores development broadcast logs
9-
!/broadcast
10-
/broadcast/*/31337/
11-
/broadcast/**/dry-run/
8+
# Ignores broadcast logs
9+
/broadcast
1210

1311
# Docs
1412
docs/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "lib/@solady"]
88
path = lib/@solady
99
url = https://github.com/Vectorized/solady
10+
[submodule "lib/@gearbox-protocol/permissionless"]
11+
path = lib/@gearbox-protocol/permissionless
12+
url = https://github.com/Gearbox-protocol/permissionless

foundry.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"rev": "5144d61af7d117f86d3fa9b4e2aa05535e2e5433"
66
}
77
},
8+
"lib/@gearbox-protocol/permissionless": {
9+
"tag": {
10+
"name": "v1.5.0",
11+
"rev": "ef0b90dbcd41c13555117ea119ef14c413627612"
12+
}
13+
},
814
"lib/@gearbox-protocol/sdk-gov": {
915
"rev": "affbbe5cde72c6f7796d3a4dae9fed305477fa9e"
1016
},

foundry.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[profile.default]
22
src = 'contracts'
3+
test = 'contracts/test'
4+
script = 'scripts'
35
libs = ['lib']
46
out = 'out'
7+
58
solc_version = '0.8.23'
6-
evm_version = 'cancun'
7-
optimizer_runs = 1000000
9+
evm_version = 'shanghai'
10+
optimizer_runs = 1000
11+
bytecode_hash = 'none'
812

913
# See more config options https://github.com/gakonst/foundry/tree/master/config
1014
block_number = 120000
@@ -13,3 +17,6 @@ gas_limit = 9223372036854775807 # the gas limit in tests
1317
block_base_fee_per_gas = 100
1418
fs_permissions = [{ access = "read-write", path = "./"}]
1519
ffi = true
20+
21+
[profile.attach-test]
22+
evm_version = 'cancun'
Submodule permissionless added at ef0b90d
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity ^0.8.23;
3+
4+
import {Bytecode} from "@gearbox-protocol/permissionless/contracts/interfaces/Types.sol";
5+
import {UploadBytecode} from "@gearbox-protocol/permissionless/script/UploadBytecode.sol";
6+
7+
import {BoundedPriceFeed} from "../../contracts/oracles/BoundedPriceFeed.sol";
8+
import {CompositePriceFeed} from "../../contracts/oracles/CompositePriceFeed.sol";
9+
import {ZeroPriceFeed} from "../../contracts/oracles/ZeroPriceFeed.sol";
10+
import {BPTStablePriceFeed} from "../../contracts/oracles/balancer/BPTStablePriceFeed.sol";
11+
import {BPTWeightedPriceFeed} from "../../contracts/oracles/balancer/BPTWeightedPriceFeed.sol";
12+
import {CurveCryptoLPPriceFeed} from "../../contracts/oracles/curve/CurveCryptoLPPriceFeed.sol";
13+
import {CurveStableLPPriceFeed} from "../../contracts/oracles/curve/CurveStableLPPriceFeed.sol";
14+
import {CurveTWAPPriceFeed} from "../../contracts/oracles/curve/CurveTWAPPriceFeed.sol";
15+
import {CurveUSDPriceFeed} from "../../contracts/oracles/curve/CurveUSDPriceFeed.sol";
16+
import {ERC4626PriceFeed} from "../../contracts/oracles/erc4626/ERC4626PriceFeed.sol";
17+
import {KodiakIslandPriceFeed} from "../../contracts/oracles/kodiak/KodiakIslandPriceFeed.sol";
18+
import {WstETHPriceFeed} from "../../contracts/oracles/lido/WstETHPriceFeed.sol";
19+
import {MellowLRTPriceFeed} from "../../contracts/oracles/mellow/MellowLRTPriceFeed.sol";
20+
import {PendleTWAPPTPriceFeed} from "../../contracts/oracles/pendle/PendleTWAPPTPriceFeed.sol";
21+
import {YearnPriceFeed} from "../../contracts/oracles/yearn/YearnPriceFeed.sol";
22+
23+
contract Upload_2025_10_21_Oracles is UploadBytecode {
24+
function _getContracts() internal pure override returns (Bytecode[] memory bytecodes) {
25+
bytecodes = new Bytecode[](15);
26+
bytecodes[0].contractType = "PRICE_FEED::BOUNDED";
27+
bytecodes[0].version = 3_11;
28+
bytecodes[0].initCode = type(BoundedPriceFeed).creationCode;
29+
bytecodes[0].source =
30+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/BoundedPriceFeed.sol";
31+
32+
bytecodes[1].contractType = "PRICE_FEED::COMPOSITE";
33+
bytecodes[1].version = 3_11;
34+
bytecodes[1].initCode = type(CompositePriceFeed).creationCode;
35+
bytecodes[1].source =
36+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/CompositePriceFeed.sol";
37+
38+
bytecodes[2].contractType = "PRICE_FEED::ZERO";
39+
bytecodes[2].version = 3_11;
40+
bytecodes[2].initCode = type(ZeroPriceFeed).creationCode;
41+
bytecodes[2].source =
42+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/ZeroPriceFeed.sol";
43+
44+
bytecodes[3].contractType = "PRICE_FEED::BALANCER_STABLE";
45+
bytecodes[3].version = 3_11;
46+
bytecodes[3].initCode = type(BPTStablePriceFeed).creationCode;
47+
bytecodes[3].source =
48+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/balancer/BPTStablePriceFeed.sol";
49+
50+
bytecodes[4].contractType = "PRICE_FEED::BALANCER_WEIGHTED";
51+
bytecodes[4].version = 3_11;
52+
bytecodes[4].initCode = type(BPTWeightedPriceFeed).creationCode;
53+
bytecodes[4].source =
54+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/balancer/BPTWeightedPriceFeed.sol";
55+
56+
bytecodes[5].contractType = "PRICE_FEED::CURVE_CRYPTO";
57+
bytecodes[5].version = 3_11;
58+
bytecodes[5].initCode = type(CurveCryptoLPPriceFeed).creationCode;
59+
bytecodes[5].source =
60+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveCryptoLPPriceFeed.sol";
61+
62+
bytecodes[6].contractType = "PRICE_FEED::CURVE_STABLE";
63+
bytecodes[6].version = 3_11;
64+
bytecodes[6].initCode = type(CurveStableLPPriceFeed).creationCode;
65+
bytecodes[6].source =
66+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveStableLPPriceFeed.sol";
67+
68+
bytecodes[7].contractType = "PRICE_FEED::CURVE_TWAP";
69+
bytecodes[7].version = 3_11;
70+
bytecodes[7].initCode = type(CurveTWAPPriceFeed).creationCode;
71+
bytecodes[7].source =
72+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveTWAPPriceFeed.sol";
73+
74+
bytecodes[8].contractType = "PRICE_FEED::CURVE_USD";
75+
bytecodes[8].version = 3_11;
76+
bytecodes[8].initCode = type(CurveUSDPriceFeed).creationCode;
77+
bytecodes[8].source =
78+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/curve/CurveUSDPriceFeed.sol";
79+
80+
bytecodes[9].contractType = "PRICE_FEED::ERC4626";
81+
bytecodes[9].version = 3_11;
82+
bytecodes[9].initCode = type(ERC4626PriceFeed).creationCode;
83+
bytecodes[9].source =
84+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/erc4626/ERC4626PriceFeed.sol";
85+
86+
bytecodes[10].contractType = "PRICE_FEED::KODIAK_ISLAND";
87+
bytecodes[10].version = 3_11;
88+
bytecodes[10].initCode = type(KodiakIslandPriceFeed).creationCode;
89+
bytecodes[10].source =
90+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/kodiak/KodiakIslandPriceFeed.sol";
91+
92+
bytecodes[11].contractType = "PRICE_FEED::WSTETH";
93+
bytecodes[11].version = 3_11;
94+
bytecodes[11].initCode = type(WstETHPriceFeed).creationCode;
95+
bytecodes[11].source =
96+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/lido/WstETHPriceFeed.sol";
97+
98+
bytecodes[12].contractType = "PRICE_FEED::MELLOW_LRT";
99+
bytecodes[12].version = 3_11;
100+
bytecodes[12].initCode = type(MellowLRTPriceFeed).creationCode;
101+
bytecodes[12].source =
102+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/mellow/MellowLRTPriceFeed.sol";
103+
104+
bytecodes[13].contractType = "PRICE_FEED::PENDLE_PT_TWAP";
105+
bytecodes[13].version = 3_11;
106+
bytecodes[13].initCode = type(PendleTWAPPTPriceFeed).creationCode;
107+
bytecodes[13].source =
108+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/pendle/PendleTWAPPTPriceFeed.sol";
109+
110+
bytecodes[14].contractType = "PRICE_FEED::YEARN";
111+
bytecodes[14].version = 3_11;
112+
bytecodes[14].initCode = type(YearnPriceFeed).creationCode;
113+
bytecodes[14].source =
114+
"https://github.com/Gearbox-protocol/oracles-v3/blob/64a386a25d24ad5984926a3f624c93c7c32c92c9/contracts/oracles/yearn/YearnPriceFeed.sol";
115+
}
116+
}

0 commit comments

Comments
 (0)