Skip to content
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

Permissions #268

Merged
merged 6 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ name = "steward"
authors = ["Collin Brittain", "Eric Bolten", "Ukpai Ugochi", "Zaki Manian"]
version.workspace = true
edition.workspace = true
rust-version = "1.76.0"

[dependencies]
abscissa_tokio = "0.6.0"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reference: https://www.lpalmieri.com/posts/fast-rust-docker-builds/

FROM rust:1.74-bullseye as cargo-chef-rust
FROM rust:1.76-bullseye as cargo-chef-rust
RUN cargo install cargo-chef --version 0.1.62
RUN rustup component add rustfmt

Expand Down
60 changes: 40 additions & 20 deletions src/cellars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ lazy_static! {
// permissions

pub const ALLOWED_V2_0_SETUP_ADAPTORS: [(&str, &str); 0] = [];
pub const ALLOWED_V2_2_CATALOGUE_ADAPTORS: [(&str, &str); 1] =
[(CELLAR_RYETH, ADAPTOR_LIDO_STAKING_V1)];
pub const ALLOWED_V2_5_CATALOGUE_ADAPTORS: [(&str, &str); 3] = [
(CELLAR_TURBO_EETH_DEPLOYMENT_1, ADAPTOR_ERC4626_V1),
(CELLAR_TURBO_STETH, ADAPTOR_LIDO_STAKING_V1),
(CELLAR_TURBO_STETH, ADAPTOR_VESTING_SIMPLE_V1_1_DEPLOYMENT2),
pub const ALLOWED_V2_2_CATALOGUE_ADAPTORS: [(&str, &str); 3] = [
(CELLAR_RYETH, ADAPTOR_AAVE_V3_A_TOKEN_V1_LIDO),
(CELLAR_RYETH, ADAPTOR_AAVE_V3_DEBT_TOKEN_V1_LIDO),
(CELLAR_RYETH, ADAPTOR_PENDLE_ADAPTOR_V1),
];
pub const ALLOWED_V2_5_CATALOGUE_ADAPTORS: [(&str, &str); 2] = [
(CELLAR_TURBO_STETH, ADAPTOR_AAVE_V3_A_TOKEN_V1_LIDO),
(CELLAR_TURBO_STETH, ADAPTOR_AAVE_V3_DEBT_TOKEN_V1_LIDO),
];

// due to position size limits in v2.0, positions must be added and removed from the limited list
Expand All @@ -117,18 +119,35 @@ pub const ALLOWED_V2_0_POSITIONS: [(&str, u32); 20] = [
(CELLAR_RYUSD, 28),
(CELLAR_RYUSD, 29),
];
pub const ALLOWED_V2_2_CATALOGUE_POSITIONS: [(&str, u32); 2] =
[(CELLAR_RYETH, 200), (CELLAR_RYETH, 201)];
pub const ALLOWED_V2_5_CATALOGUE_POSITIONS: [(&str, u32); 9] = [
(CELLAR_MORPHO_ETH_MAXIMIZER, 110000007),
(CELLAR_MORPHO_ETH_MAXIMIZER, 110000008),
(CELLAR_MORPHO_ETH_MAXIMIZER, 110000009),
(CELLAR_MORPHO_ETH_MAXIMIZER, 110000010),
(CELLAR_MORPHO_ETH_MAXIMIZER, 11500004),
(CELLAR_MORPHO_ETH_MAXIMIZER, 11500005),
(CELLAR_TURBO_EETH_DEPLOYMENT_1, 10000004),
(CELLAR_TURBO_STETH, 69000002),
(CELLAR_TURBO_STETH, 100000008),
pub const ALLOWED_V2_2_CATALOGUE_POSITIONS: [(&str, u32); 22] = [
(CELLAR_RYETH, 202),
(CELLAR_RYETH, 203),
(CELLAR_RYETH, 204),
(CELLAR_RYETH, 205),
(CELLAR_RYETH, 206),
(CELLAR_RYETH, 207),
(CELLAR_RYETH, 208),
(CELLAR_RYETH, 209),
(CELLAR_RYETH, 210),
(CELLAR_RYETH, 211),
(CELLAR_RYETH, 212),
(CELLAR_RYETH, 213),
(CELLAR_RYETH, 214),
(CELLAR_RYETH, 215),
(CELLAR_RYETH, 216),
(CELLAR_RYETH, 217),
(CELLAR_RYETH, 218),
(CELLAR_RYETH, 219),
(CELLAR_RYETH, 220),
(CELLAR_RYETH, 221),
(CELLAR_RYETH, 222),
(CELLAR_RYETH, 223),
];
pub const ALLOWED_V2_5_CATALOGUE_POSITIONS: [(&str, u32); 4] = [
(CELLAR_TURBO_STETH, 7000),
(CELLAR_TURBO_STETH, 7001),
(CELLAR_TURBO_STETH, 7500),
(CELLAR_TURBO_STETH, 7501),
];

pub const BLOCKED_ADAPTORS: [&str; 3] = [
Expand Down Expand Up @@ -190,6 +209,8 @@ pub const ADAPTOR_COMPOUND_C_TOKEN_V1: &str = "26dba82495f6189dde7648ae88bead46c
// adaptors

pub const ADAPTOR_AAVE_V3_A_TOKEN_V1: &str = "76cef5606c8b6ba38fe2e3c639e1659afa530b47";
pub const ADAPTOR_AAVE_V3_A_TOKEN_V1_LIDO: &str = "67448b5689012f99db211b516e9fd480d8edfbf3";
pub const ADAPTOR_AAVE_V3_DEBT_TOKEN_V1_LIDO: &str = "7fade03231a694fc12b4ad6098a0f8aa9f732335";
pub const ADAPTOR_AURA_ERC4626_ADAPTOR_V1: &str = "298d97494c5374e796368bcf15f0290771f6ae99";
pub const ADAPTOR_BALANCER_POOL_V1: &str = "2750348a897059c45683d33a1742a3989454f7d6";
pub const ADAPTOR_CELLAR_V2: &str = "3b5ca5de4d808cd793d3a7b3a731d3e67e707b27";
Expand All @@ -206,9 +227,8 @@ pub const ADAPTOR_MORPHO_AAVE_V3_A_TOKEN_COLLATERAL_V1: &str =
"b46e8a03b1aafffb50f281397c57b5b87080363e";
pub const ADAPTOR_MORPHO_AAVE_V3_DEBT_TOKEN_V1: &str = "25a61f771af9a38c10ddd93c2bbab39a88926fa9";
pub const ADAPTOR_MORPHO_AAVE_V3_P2P_V1: &str = "4fe068caad05b82bf3f86e1f7d1a7b8bbf516111";
// used by RYETH, RYBTC
pub const ADAPTOR_PENDLE_ADAPTOR_V1: &str = "3ba55a9151cb67ce15bb3ed2d7a6894989626a8a";
pub const ADAPTOR_UNIV3_V3_DEPLOYMENT_1: &str = "92611574ec9bc13c6137917481dab7bb7b173c9b";
// used by Turbo stETH and eETH
pub const ADAPTOR_UNIV3_V3_DEPLOYMENT_2: &str = "c74ffa211a8148949a77ec1070df7013c8d5ce92";
pub const ADAPTOR_VESTING_SIMPLE_V1_1_DEPLOYMENT1: &str =
"3b98ba00f981342664969e609fb88280704ac479";
Expand Down
Loading