Skip to content

Commit 78ad827

Browse files
authored
Merge pull request #40 from Gearbox-protocol/next
feat: version 3.1
2 parents db47ef6 + cc81c7f commit 78ad827

File tree

151 files changed

+2533
-27554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+2533
-27554
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- "main"
7-
- "pendle-pt-price-feed"
5+
branches: ["main", "next"]
86

97
env:
108
HUSKY: 0

.gitignore

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
/node_modules
2-
/forge-out
3-
.DS_Store
4-
cache
1+
# Dependencies
2+
node_modules/
3+
4+
# Compiler files
5+
cache/
6+
out/
7+
8+
# Ignores development broadcast logs
9+
!/broadcast
10+
/broadcast/*/31337/
11+
/broadcast/**/dry-run/
12+
13+
# Docs
14+
docs/
15+
16+
# Dotenv file
517
.env
18+
19+
# Logs
20+
*.log

.gitmodules

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
[submodule "lib/forge-std"]
2-
path = lib/forge-std
3-
url = https://github.com/foundry-rs/forge-std
1+
[submodule "lib/@gearbox-protocol/core-v3"]
2+
path = lib/@gearbox-protocol/core-v3
3+
url = https://github.com/Gearbox-protocol/core-v3
4+
[submodule "lib/@gearbox-protocol/sdk-gov"]
5+
path = lib/@gearbox-protocol/sdk-gov
6+
url = https://github.com/Gearbox-protocol/sdk-gov
7+
[submodule "lib/@solady"]
8+
path = lib/@solady
9+
url = https://github.com/Vectorized/solady

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
node_modules
2-
artifacts
32
cache
4-
types
5-
forge-out
3+
out

.releaserc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"name": "main"
55
},
66
{
7-
"name": "pendle-pt-price-feed",
8-
"channel": "pendle",
9-
"prerelease": "pendle"
7+
"name": "next",
8+
"channel": "next",
9+
"prerelease": "next"
1010
}
1111
],
1212
"plugins": [

.vscode/settings.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
"[solidity]": {
66
"editor.defaultFormatter": "JuanBlanco.solidity"
77
},
8-
98
"editor.defaultFormatter": "esbenp.prettier-vscode",
109
"editor.formatOnSave": true,
1110
"editor.tabSize": 4,
12-
"eslint.validate": ["javascript", "typescript"],
1311
"files.eol": "\n",
1412
"solidity.formatter": "forge",
1513
"solidity.packageDefaultDependenciesContractsDirectory": "contracts",
16-
"solidity.packageDefaultDependenciesDirectory": "node_modules",
17-
"solidity.compileUsingRemoteVersion": "v0.8.17"
14+
"solidity.packageDefaultDependenciesDirectory": "lib",
15+
"solidity.compileUsingRemoteVersion": "v0.8.23"
1816
}
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
// SPDX-License-Identifier: MIT
22
// Gearbox Protocol. Generalized leverage for DeFi protocols
3-
// (c) Gearbox Foundation, 2023.
4-
pragma solidity ^0.8.17;
3+
// (c) Gearbox Foundation, 2024.
4+
pragma solidity ^0.8.23;
55

6-
import {IPriceFeed} from "@gearbox-protocol/core-v2/contracts/interfaces/IPriceFeed.sol";
6+
import {IPriceFeed} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IPriceFeed.sol";
7+
8+
/// @title LP price feed interface
9+
interface ILPPriceFeed is IPriceFeed {
10+
// ------ //
11+
// EVENTS //
12+
// ------ //
713

8-
interface ILPPriceFeedEvents {
914
/// @notice Emitted when new LP token exchange rate bounds are set
1015
event SetBounds(uint256 lowerBound, uint256 upperBound);
1116

12-
/// @notice Emitted when permissionless bounds update is allowed or forbidden
13-
event SetUpdateBoundsAllowed(bool allowed);
14-
}
17+
// ------ //
18+
// ERRORS //
19+
// ------ //
1520

16-
interface ILPPriceFeedExceptions {
1721
/// @notice Thrown when trying to set exchange rate lower bound to zero
1822
error LowerBoundCantBeZeroException();
1923

2024
/// @notice Thrown when exchange rate falls below lower bound during price calculation
2125
/// or new boudns don't contain exchange rate during bounds update
2226
error ExchangeRateOutOfBoundsException();
2327

24-
/// @notice Thrown when trying to call `updateBounds` while it's not allowed
25-
error UpdateBoundsNotAllowedException();
26-
27-
/// @notice Thrown when trying to call `updateBounds` before cooldown since the last update has passed
28-
error UpdateBoundsBeforeCooldownException();
29-
30-
/// @notice Thrown when price oracle's reserve price feed is the LP price feed itself
31-
error ReserveFeedMustNotBeSelfException();
32-
}
33-
34-
/// @title LP price feed interface
35-
interface ILPPriceFeed is IPriceFeed, ILPPriceFeedEvents, ILPPriceFeedExceptions {
36-
function priceOracle() external view returns (address);
28+
// ------- //
29+
// GETTERS //
30+
// ------- //
3731

3832
function lpToken() external view returns (address);
3933
function lpContract() external view returns (address);
4034

4135
function lowerBound() external view returns (uint256);
4236
function upperBound() external view returns (uint256);
43-
function updateBoundsAllowed() external view returns (bool);
44-
function lastBoundsUpdate() external view returns (uint40);
4537

4638
function getAggregatePrice() external view returns (int256 answer);
4739
function getLPExchangeRate() external view returns (uint256 exchangeRate);
@@ -51,8 +43,5 @@ interface ILPPriceFeed is IPriceFeed, ILPPriceFeedEvents, ILPPriceFeedExceptions
5143
// CONFIGURATION //
5244
// ------------- //
5345

54-
function allowBoundsUpdate() external;
55-
function forbidBoundsUpdate() external;
5646
function setLimiter(uint256 newLowerBound) external;
57-
function updateBounds(bytes calldata updateData) external;
5847
}

contracts/interfaces/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(c) Gearbox Foundation, 2023.
1+
(c) Gearbox Foundation, 2024.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

contracts/interfaces/aave/IWAToken.sol

Lines changed: 0 additions & 8 deletions
This file was deleted.

contracts/interfaces/balancer/IBalancerStablePool.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
// Gearbox Protocol. Generalized leverage for DeFi protocols
3-
// (c) Gearbox Foundation, 2023.
4-
pragma solidity ^0.8.17;
3+
// (c) Gearbox Foundation, 2024.
4+
pragma solidity ^0.8.23;
55

66
interface IBalancerStablePool {
77
function getRate() external view returns (uint256);

0 commit comments

Comments
 (0)