Skip to content

Commit

Permalink
feat: add StaderWithdrawals (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
iherger authored Dec 18, 2024
1 parent c87d4d0 commit 4cddbb0
Show file tree
Hide file tree
Showing 17 changed files with 558 additions and 74 deletions.
7 changes: 7 additions & 0 deletions .changeset/fast-rats-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@enzymefinance/environment": minor
"@enzymefinance/abis": minor
"@enzymefinance/sdk": minor
---

Add StaderWithdrawals
129 changes: 129 additions & 0 deletions packages/abis/abis/IStaderWithdrawalsPositionLib.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "_userWithdrawalManagerAddress",
"type": "address",
"internalType": "address"
},
{
"name": "_ethxAddress",
"type": "address",
"internalType": "address"
},
{
"name": "_wethAddress",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "ETHX_ADDRESS",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "USER_WITHDRAWAL_MANAGER",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract IStaderUserWithdrawalManager"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "WETH_ADDRESS",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getDebtAssets",
"inputs": [],
"outputs": [
{
"name": "assets_",
"type": "address[]",
"internalType": "address[]"
},
{
"name": "amounts_",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"stateMutability": "pure"
},
{
"type": "function",
"name": "getManagedAssets",
"inputs": [],
"outputs": [
{
"name": "assets_",
"type": "address[]",
"internalType": "address[]"
},
{
"name": "amounts_",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "init",
"inputs": [
{
"name": "",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "receiveCallFromVault",
"inputs": [
{
"name": "_actionData",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "error",
"name": "StaderWithdrawalsPositionLib__ReceiveCallFromVault__InvalidActionId",
"inputs": []
}
]
14 changes: 14 additions & 0 deletions packages/abis/abis/IStaderWithdrawalsPositionLib.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.0 <0.9.0;

interface IStaderWithdrawalsPositionLib {
error StaderWithdrawalsPositionLib__ReceiveCallFromVault__InvalidActionId();

function ETHX_ADDRESS() external view returns (address);
function USER_WITHDRAWAL_MANAGER() external view returns (address);
function WETH_ADDRESS() external view returns (address);
function getDebtAssets() external pure returns (address[] memory assets_, uint256[] memory amounts_);
function getManagedAssets() external view returns (address[] memory assets_, uint256[] memory amounts_);
function init(bytes memory) external;
function receiveCallFromVault(bytes memory _actionData) external;
}
129 changes: 129 additions & 0 deletions packages/abis/src/IStaderWithdrawalsPositionLib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
export const IStaderWithdrawalsPositionLib = [
{
type: "constructor",
inputs: [
{
name: "_userWithdrawalManagerAddress",
type: "address",
internalType: "address",
},
{
name: "_ethxAddress",
type: "address",
internalType: "address",
},
{
name: "_wethAddress",
type: "address",
internalType: "address",
},
],
stateMutability: "nonpayable",
},
{
type: "function",
name: "ETHX_ADDRESS",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "USER_WITHDRAWAL_MANAGER",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "contract IStaderUserWithdrawalManager",
},
],
stateMutability: "view",
},
{
type: "function",
name: "WETH_ADDRESS",
inputs: [],
outputs: [
{
name: "",
type: "address",
internalType: "address",
},
],
stateMutability: "view",
},
{
type: "function",
name: "getDebtAssets",
inputs: [],
outputs: [
{
name: "assets_",
type: "address[]",
internalType: "address[]",
},
{
name: "amounts_",
type: "uint256[]",
internalType: "uint256[]",
},
],
stateMutability: "pure",
},
{
type: "function",
name: "getManagedAssets",
inputs: [],
outputs: [
{
name: "assets_",
type: "address[]",
internalType: "address[]",
},
{
name: "amounts_",
type: "uint256[]",
internalType: "uint256[]",
},
],
stateMutability: "view",
},
{
type: "function",
name: "init",
inputs: [
{
name: "",
type: "bytes",
internalType: "bytes",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "receiveCallFromVault",
inputs: [
{
name: "_actionData",
type: "bytes",
internalType: "bytes",
},
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "error",
name: "StaderWithdrawalsPositionLib__ReceiveCallFromVault__InvalidActionId",
inputs: [],
},
] as const;
1 change: 1 addition & 0 deletions packages/abis/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export { ISolvV2BondBuyerPositionParser } from "./ISolvV2BondBuyerPositionParser
export { ISolvV2BondIssuerPositionLib } from "./ISolvV2BondIssuerPositionLib.js";
export { ISolvV2BondIssuerPositionParser } from "./ISolvV2BondIssuerPositionParser.js";
export { IStaderStakingAdapter } from "./IStaderStakingAdapter.js";
export { IStaderWithdrawalsPositionLib } from "./IStaderWithdrawalsPositionLib.js";
export { IStakeWiseV3StakingPositionLib } from "./IStakeWiseV3StakingPositionLib.js";
export { IStakeWiseV3StakingPositionParser } from "./IStakeWiseV3StakingPositionParser.js";
export { IStakingWrapper } from "./IStakingWrapper.js";
Expand Down
2 changes: 2 additions & 0 deletions packages/environment/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export interface SuluContracts extends CommonContracts {
readonly SolvV2BondIssuerPositionParser: Address;
readonly StaderSDPriceFeed: Address;
readonly StaderStakingAdapter: Address;
readonly StaderWithdrawalsPositionLib: Address;
readonly StaderWithdrawalsPositionParser: Address;
readonly StakeWiseV3StakingPositionLib: Address;
readonly StakeWiseV3StakingPositionParser: Address;
readonly SwellStakingAdapter: Address;
Expand Down
3 changes: 3 additions & 0 deletions packages/environment/src/deployments/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default defineDeployment<Deployment.ARBITRUM>({
paraswapV5TokenTransferProxy: "0x216b4b4ba9f3e719726886d34a177484278bfcae",
pendlePtLpOracle: "0x0000000000000000000000000000000000000000",
staderStakingPoolManager: "0x0000000000000000000000000000000000000000",
staderUserWithdrawManager: "0x0000000000000000000000000000000000000000",
stakeWiseV3KeeperRewards: "0x0000000000000000000000000000000000000000",
theGraphDelegationStakingProxy: "0x00669a4cf01450b64e8a2a20e9b1fcb71e61ef03",
theGraphEpochManagerProxy: "0x5a843145c43d328b9bb7a4401d94918f131bb281",
Expand Down Expand Up @@ -207,6 +208,8 @@ export default defineDeployment<Deployment.ARBITRUM>({
SolvV2BondIssuerPositionParser: "0x0000000000000000000000000000000000000000",
StaderSDPriceFeed: "0x0000000000000000000000000000000000000000",
StaderStakingAdapter: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionLib: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionParser: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionLib: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionParser: "0x0000000000000000000000000000000000000000",
SwellStakingAdapter: "0x0000000000000000000000000000000000000000",
Expand Down
5 changes: 4 additions & 1 deletion packages/environment/src/deployments/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default defineDeployment<Deployment.BASE>({
paraswapV5TokenTransferProxy: "0x93aaae79a53759cd164340e4c8766e4db5331cd7",
pendlePtLpOracle: "0x0000000000000000000000000000000000000000",
stakeWiseV3KeeperRewards: "0x0000000000000000000000000000000000000000",
staderUserWithdrawManager: "0x0000000000000000000000000000000000000000",
uniswapV3NonFungiblePositionManager: "0x0000000000000000000000000000000000000000",
voteLockedConvexToken: "0x0000000000000000000000000000000000000000",
votiumVoteProxy: "0x0000000000000000000000000000000000000000",
Expand Down Expand Up @@ -201,8 +202,10 @@ export default defineDeployment<Deployment.BASE>({
SolvV2BondBuyerPositionParser: "0x0000000000000000000000000000000000000000",
SolvV2BondIssuerPositionLib: "0x0000000000000000000000000000000000000000",
SolvV2BondIssuerPositionParser: "0x0000000000000000000000000000000000000000",
StaderStakingAdapter: "0x0000000000000000000000000000000000000000",
StaderSDPriceFeed: "0x0000000000000000000000000000000000000000",
StaderStakingAdapter: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionLib: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionParser: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionLib: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionParser: "0x0000000000000000000000000000000000000000",
SwellStakingAdapter: "0x0000000000000000000000000000000000000000",
Expand Down
10 changes: 9 additions & 1 deletion packages/environment/src/deployments/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default defineDeployment<Deployment.ETHEREUM>({
paraswapV5TokenTransferProxy: "0x216b4b4ba9f3e719726886d34a177484278bfcae",
pendlePtLpOracle: "0x66a1096c6366b2529274df4f5d8247827fe4cea8",
staderStakingPoolManager: "0xcf5ea1b38380f6af39068375516daf40ed70d299",
staderUserWithdrawManager: "0x9f0491b32dbce587c50c4c43ab303b06478193a7",
stakeWiseV3KeeperRewards: "0x6b5815467da09daa7dc83db21c9239d98bb487b5",
theGraphDelegationStakingProxy: "0xf55041e37e12cd407ad00ce2910b8269b01263b9",
theGraphEpochManagerProxy: "0x64f990bf16552a693dcb043bb7bf3866c5e05ddb",
Expand Down Expand Up @@ -79,6 +80,7 @@ export default defineDeployment<Deployment.ETHEREUM>({
cvx: "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b",
dai: "0x6b175474e89094c44da98b954eedeac495271d0f",
diva: "0xbfabde619ed5c4311811cf422562709710db587d",
ethx: "0xa35b1b31ce002fbf2058d22f30f95d405200a15b",
grt: "0xc944e90c64b2c07662a292be6244bdf05cda44a7",
idle: "0x875773784af8135ea0ef43b5a374aad105c5d39e",
lusd: "0x5f98805a4e8be255a32880fdec7f6728c6568ba0",
Expand Down Expand Up @@ -226,6 +228,8 @@ export default defineDeployment<Deployment.ETHEREUM>({
SolvV2BondIssuerPositionParser: "0xc4b599043a5479398eb8af387b1e36d9a924f8c2",
StaderSDPriceFeed: "0x9938b14a25a4910531d5cbdf3c41510b19aaf016",
StaderStakingAdapter: "0x7f1b68d5ed183cda6788a66520506eaf3544001c",
StaderWithdrawalsPositionLib: "0x5cf43f5f8c1648db23948e3814d0099c408201a4",
StaderWithdrawalsPositionParser: "0xaefe3260dcbcfaa2a4b927a6494057837e6dd902",
StakeWiseV3StakingPositionLib: "0xef268eb475a096adb95712b05b095acc1fc2d3ae",
StakeWiseV3StakingPositionParser: "0x642348ee0c28c2943082f950f3a35db07bd4bbdf",
SwellStakingAdapter: "0x50bae03333dd8495263c9049091a8925063b068e",
Expand Down Expand Up @@ -394,7 +398,11 @@ export default defineDeployment<Deployment.ETHEREUM>({
subgraphs: {
assets: { slug: "asset-universe", id: "4ZW3mDNgpDVy68RipQLJxvRw1FReJTfvA7nbB52J4Gjg" },
balances: { slug: "vault-balances", id: "HwR7jTExHWNvQetTxRYEMQ5hywHyUkierAYvnGS7pBUS" },
core: { slug: "enzyme-core", id: "9DLBBLep5UyU16kUQRvxBCMqko4q9XzuE4XsMMpARhKK", devVersion: "version/latest" },
core: {
slug: "enzyme-core",
id: "9DLBBLep5UyU16kUQRvxBCMqko4q9XzuE4XsMMpARhKK",
devVersion: "version/latest",
},
shares: { slug: "vault-shares", id: "6p2L2gQ4Hw4Dh2kxZFDJbcqtbv44vrJbrBEh3EjS7qVo" },
vaults: { slug: "vault-lineage", id: "5FdivFcUPmVSqCFkv3jqJh3QYjHjh1ztzd7GHiCAMP1h" },
},
Expand Down
3 changes: 3 additions & 0 deletions packages/environment/src/deployments/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default defineDeployment<Deployment.POLYGON>({
morphoBlue: "0x0000000000000000000000000000000000000000",
multicall: "0xca11bde05977b3631167028862be2a173976ca11",
staderStakingPoolManager: "0x0000000000000000000000000000000000000000",
staderUserWithdrawManager: "0x0000000000000000000000000000000000000000",
paraswapV5AugustusSwapper: "0xdef171fe48cf0115b1d80b88dc8eab59176fee57",
paraswapV5TokenTransferProxy: "0x216b4b4ba9f3e719726886d34a177484278bfcae",
pendlePtLpOracle: "0x0000000000000000000000000000000000000000",
Expand Down Expand Up @@ -211,6 +212,8 @@ export default defineDeployment<Deployment.POLYGON>({
SolvV2BondIssuerPositionParser: "0x0000000000000000000000000000000000000000",
StaderSDPriceFeed: "0x0000000000000000000000000000000000000000",
StaderStakingAdapter: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionLib: "0x0000000000000000000000000000000000000000",
StaderWithdrawalsPositionParser: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionLib: "0x0000000000000000000000000000000000000000",
StakeWiseV3StakingPositionParser: "0x0000000000000000000000000000000000000000",
SwellStakingAdapter: "0x0000000000000000000000000000000000000000",
Expand Down
Loading

0 comments on commit 4cddbb0

Please sign in to comment.