-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mainnet #29
Merged
Merged
Mainnet #29
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8f52cbb
Update PufferVaultMainnet
bxmmm1 0642475
wraping/unwraping weth
bxmmm1 fae3483
withdrawal limits
bxmmm1 6234044
daily limit zero case
bxmmm1 9725a83
merge main
bxmmm1 1fd2360
remove pufferOracle from the deployment script
bxmmm1 1536313
update script
bxmmm1 632acb2
Update withdrawals logic
bxmmm1 94bb276
remove oracle from the repository
bxmmm1 2354a85
Merge branch 'main' of github.com:PufferFinance/pufETH into feature/m…
bxmmm1 0224fec
pr comments
bxmmm1 46c0377
puffer oracle interface
bxmmm1 771244a
remove the old puffer oracle
bxmmm1 49545d8
extract roles to separate file
bxmmm1 8ff80d2
Account for the locked ETH
bxmmm1 fe652c6
update oracle interface
bxmmm1 d8578d8
Merge branch 'main' of github.com:PufferFinance/pufETH into feature/m…
bxmmm1 904e400
disable slither alert
bxmmm1 a65968b
Use relative paths because of the compilation issue in PufferProtocol
bxmmm1 3a9f943
use relative imports
bxmmm1 761a4d7
remove outdated test
bxmmm1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.0 <0.9.0; | ||
|
||
// Operations & Community multisig have this role | ||
// Operations with 7 day delay, Community 0 | ||
uint64 constant ROLE_ID_UPGRADER = 1; | ||
// Role assigned to Operations Multisig | ||
uint64 constant ROLE_ID_OPERATIONS = 22; | ||
|
||
// Role assigned to the Puffer Protocol | ||
uint64 constant ROLE_ID_PUFFER_PROTOCOL = 1234; | ||
uint64 constant ROLE_ID_DAO = 77; | ||
uint64 constant ROLE_ID_GUARDIANS = 88; | ||
uint64 constant ROLE_ID_PAUSER = 999; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.8.0 <0.9.0; | ||
|
||
import { stdJson } from "forge-std/StdJson.sol"; | ||
import { BaseScript } from ".//BaseScript.s.sol"; | ||
import { PufferVault } from "../src/PufferVault.sol"; | ||
import { PufferVaultMainnet } from "../src/PufferVaultMainnet.sol"; | ||
import { IEigenLayer } from "../src/interface/EigenLayer/IEigenLayer.sol"; | ||
import { IStrategy } from "../src/interface/EigenLayer/IStrategy.sol"; | ||
import { IStETH } from "../src/interface/Lido/IStETH.sol"; | ||
import { ILidoWithdrawalQueue } from "../src/interface/Lido/ILidoWithdrawalQueue.sol"; | ||
import { stETHMock } from "../test/mocks/stETHMock.sol"; | ||
import { LidoWithdrawalQueueMock } from "../test/mocks/LidoWithdrawalQueueMock.sol"; | ||
import { stETHStrategyMock } from "../test/mocks/stETHStrategyMock.sol"; | ||
import { EigenLayerManagerMock } from "../test/mocks/EigenLayerManagerMock.sol"; | ||
import { UUPSUpgradeable } from "@openzeppelin-contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import { IWETH } from "../src/interface/Other/IWETH.sol"; | ||
import { IPufferOracle } from "../src/interface/IPufferOracle.sol"; | ||
import { WETH9 } from "../test/mocks/WETH9.sol"; | ||
import { Initializable } from "openzeppelin/proxy/utils/Initializable.sol"; | ||
import { AccessManager } from "openzeppelin/access/manager/AccessManager.sol"; | ||
|
||
/** | ||
* @title UpgradePufETH | ||
* @author Puffer Finance | ||
* @notice Upgrades PufETH | ||
* @dev | ||
* | ||
* | ||
* NOTE: | ||
* | ||
* If you ran the deployment script, but did not `--broadcast` the transaction, it will still update your local chainId-deployment.json file. | ||
* Other scripts will fail because addresses will be updated in deployments file, but the deployment never happened. | ||
* | ||
* BaseScript.sol holds the private key logic, if you don't have `PK` ENV variable, it will use the default one PK from `makeAddr("pufferDeployer")` | ||
* | ||
* PK=${deployer_pk} forge script script/UpgradePuffETH.s.sol:UpgradePuffETH --sig 'run(address)' "VAULTADDRESS" -vvvv --rpc-url=... --broadcast | ||
*/ | ||
contract UpgradePuffETH is BaseScript { | ||
/** | ||
* @dev Ethereum Mainnet addresses | ||
*/ | ||
IStrategy internal constant _EIGEN_STETH_STRATEGY = IStrategy(0x93c4b944D05dfe6df7645A86cd2206016c51564D); | ||
IEigenLayer internal constant _EIGEN_STRATEGY_MANAGER = IEigenLayer(0x858646372CC42E1A627fcE94aa7A7033e7CF075A); | ||
IStETH internal constant _ST_ETH = IStETH(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); | ||
IWETH internal constant _WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); | ||
ILidoWithdrawalQueue internal constant _LIDO_WITHDRAWAL_QUEUE = | ||
ILidoWithdrawalQueue(0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1); | ||
|
||
function run(address pufferVault, address accessManager, address pufferOracle) public broadcast { | ||
( | ||
IStETH stETH, | ||
IWETH weth, | ||
ILidoWithdrawalQueue lidoWithdrawalQueue, | ||
IStrategy stETHStrategy, | ||
IEigenLayer eigenStrategyManager | ||
) = _getArgs(); | ||
|
||
//@todo this is for tests only | ||
AccessManager(accessManager).grantRole(1, _broadcaster, 0); | ||
|
||
PufferVaultMainnet newImplementation = new PufferVaultMainnet( | ||
stETH, weth, lidoWithdrawalQueue, stETHStrategy, eigenStrategyManager, IPufferOracle(pufferOracle) | ||
); | ||
|
||
vm.expectEmit(true, true, true, true); | ||
emit Initializable.Initialized(2); | ||
UUPSUpgradeable(pufferVault).upgradeToAndCall( | ||
address(newImplementation), abi.encodeCall(PufferVaultMainnet.initialize, ()) | ||
); | ||
} | ||
|
||
function _getArgs() | ||
internal | ||
returns ( | ||
IStETH stETH, | ||
IWETH weth, | ||
ILidoWithdrawalQueue lidoWithdrawalQueue, | ||
IStrategy stETHStrategy, | ||
IEigenLayer eigenStrategyManager | ||
) | ||
{ | ||
if (isMainnet()) { | ||
stETH = _ST_ETH; | ||
weth = _WETH; | ||
lidoWithdrawalQueue = _LIDO_WITHDRAWAL_QUEUE; | ||
stETHStrategy = _EIGEN_STETH_STRATEGY; | ||
eigenStrategyManager = _EIGEN_STRATEGY_MANAGER; | ||
} else { | ||
stETH = IStETH(address(new stETHMock())); | ||
weth = new WETH9(); | ||
lidoWithdrawalQueue = new LidoWithdrawalQueueMock(); | ||
stETHStrategy = new stETHStrategyMock(); | ||
eigenStrategyManager = new EigenLayerManagerMock(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bxmmm1 is there a test that shows this upgrade works as expected? E.g. we can call the upgrade on the vault and try calling some of the functions in a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/PufferFinance/pufETH/blob/feature/mainnet/test/Integration/PufferTest.integration.t.sol#L362