Skip to content

Commit

Permalink
Set withdrawer keys
Browse files Browse the repository at this point in the history
  • Loading branch information
garious committed Mar 7, 2020
1 parent 307ac66 commit 815ca99
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 12 deletions.
41 changes: 35 additions & 6 deletions genesis/src/genesis_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const UNLOCKS_ALL_AT_9_MONTHS: UnlockInfo = UnlockInfo {
cliff_years: 0.75,
unlocks: 0,
unlock_years: 0.0,
custodian: "6LnFgiECFQKUcxNYDvUBMxgjeGQzzy4kgxGhantoxfUe",
custodian: "Mc5XB47H3DKJHym5RLa9mPzWv5snERsF3KNv5AauXK8",
};

// no lockups
Expand All @@ -19,114 +19,135 @@ const UNLOCKS_ALL_DAY_ZERO: UnlockInfo = UnlockInfo {
cliff_years: 0.0,
unlocks: 0,
unlock_years: 0.0,
custodian: "6LnFgiECFQKUcxNYDvUBMxgjeGQzzy4kgxGhantoxfUe",
custodian: "Mc5XB47H3DKJHym5RLa9mPzWv5snERsF3KNv5AauXK8",
};

pub const BATCH_FOUR_STAKER_INFOS: &[StakerInfo] = &[
StakerInfo {
name: "impossible pizza",
staker: "CDtJpwRSiPRDGeKrvymWQKM7JY9M3hU7iimEKBDxZyoP",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "wretched texture",
staker: "HbENu65qjWLEB5TrMouSSWLq9mbtGx2bvfhPjk2FpYek",
lamports: 225_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "nutritious examination",
staker: "C9CfFpmLDsQsz6wt7MrrZquNB5oS4QkpJkmDAiboVEZZ",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "tidy impression",
staker: "6ne6Rbag4FAnop1KNgVdM1SEHnJEysHSWyqvRpFrzaig",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "unbecoming silver",
staker: "4AcoZa1P8fF5XK21RJsiuMRZPEScbbWNc75oakRFHiBz",
lamports: 28_800 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "dramatic treatment",
staker: "GTyawCMwt3kMb51AgDtfdp97mDot7jNwc8ifuS9qqANg",
lamports: 1_205_602 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "angry noise",
staker: "Fqxs9MhqjKuMq6YwjBG4ktEapuZQ3kj19mpuHLZKtkg9",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "hard cousin",
staker: "9MYDzj7QuAX9QAK7da1GhzPB4gA3qbPNWsW3MMSZobru",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "inexpensive uncle",
staker: "E4DLNkmdL34ejA48ApfPDoFVuD9XWAFqi8bXzBGRhKst",
lamports: 300_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "lopsided skill",
staker: "8cV7zCTF5UMrZakZXiL2Jw5uY3ms2Wz4twzFXEY9Kge2",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "red snake",
staker: "JBGnGdLyo7V2z9hz51mnnbyDp9sBACtw5WYH9YRG8n7e",
lamports: 3_655_292 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "hellish money",
staker: "CqKdQ57mBj2mKcAbpjWc28Ls7yXzBXboxSTCRWocmUVj",
lamports: 200_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "full grape",
staker: "2SCJKvh7wWo32PtfUZdVZQ84WnMWoUpF4WTm6ZxcCJ15",
lamports: 450_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "nice ghost",
staker: "FeumxB3gfzrVQzABBiha8AacKPY3Rf4BTFSh2aZWHqR8",
lamports: 650_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "jolly year",
staker: "HBwFWNGPVZgkf3yqUKxuAds5aANGWX62LzUFvZVCWLdJ",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "typical initiative",
staker: "3JMz3kaDUZEVK2JVjRqwERGMp7LbWbgUjAFBb42qxoHb",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "deserted window",
staker: "XTeBBZextvHkoRqDF8yb4hihjcraKQDwTEXhzjd8fip",
lamports: 3_655_292 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "eight nation",
staker: "E5bSU5ywqPiz3ije89ef5gaEC7jy81BAc72Zeb9MqeHY",
lamports: 103_519 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "earsplitting meaning",
staker: "4ZemkSoE75RFE1SVLnnmHcaNWT4qN8KFrKP2wAYfv8CB",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "alike cheese",
staker: "72BGEwYee5txFonmpEarTEKCZVN2UxcSUgdphdhcx3V",
lamports: 3_880_295 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "noisy honey",
staker: "DRp1Scyn4yJZQfMAdQew2x8RtvRmsNELN37JTK5Xvzgn",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
];

Expand All @@ -135,11 +156,13 @@ pub const FOUNDATION_STAKER_INFOS: &[StakerInfo] = &[
name: "lyrical supermarket",
staker: "GRZwoJGisLTszcxtWpeREJ98EGg8pZewhbtcrikoU7b3",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "frequent description",
staker: "J51tinoLdmEdUR27LUVymrb2LB3xQo1aSHSgmbSGdj58",
lamports: 57_500_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
];

Expand All @@ -148,29 +171,34 @@ pub const GRANTS_STAKER_INFOS: &[StakerInfo] = &[
name: "rightful agreement",
staker: "DNaKiBwwbbqk1wVoC5AQxWQbuDhvaDVbAtXzsVos9mrc",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
StakerInfo {
name: "tasty location",
staker: "HvXQPXAijjG1vnQs6HXVtUUtFVzi5HNgXV9LGnHvYF85",
lamports: 15_000_000 * LAMPORTS_PER_SOL,
withdrawer: None,
},
];

pub const COMMUNITY_STAKER_INFOS: &[StakerInfo] = &[
StakerInfo {
name: "shrill charity",
staker: "BzuqQFnu7oNUeok9ZoJezpqu2vZJU7XR1PxVLkk6wwUD",
staker: "Eo1iDtrZZiAkQFA8u431hedChaSUnPbU8MWg849MFvEZ",
lamports: 5_000_000 * LAMPORTS_PER_SOL,
withdrawer: Some("8CUUMKYNGxdgYio5CLHRHyzMEhhVRMcqefgE6dLqnVRK"),
},
StakerInfo {
name: "legal gate",
staker: "FwMbkDZUb78aiMWhZY4BEroAcqmnrXZV77nwrg71C57d",
staker: "7KCzZCbZz6V1U1YXUpBNaqQzQCg2DKo8JsNhKASKtYxe",
lamports: 16_086_641 * LAMPORTS_PER_SOL,
withdrawer: Some("92viKFftk1dJjqJwreFqT2qHXxjSUuEE9VyHvTdY1mpY"),
},
StakerInfo {
name: "cluttered complaint",
staker: "4h1rt2ic4AXwG7p3Qqhw57EMDD4c3tLYb5J3QstGA2p5",
staker: "2J8mJU6tWg78DdQVEqMfpN3rMeNbcRT9qGL3yLbmSXYL",
lamports: 153_333_633 * LAMPORTS_PER_SOL + 41 * LAMPORTS_PER_SOL / 100,
withdrawer: Some("7kgfDmgbEfypBujqn4tyApjf8H7ZWuaL3F6Ah9vQHzgR"),
},
];

Expand Down Expand Up @@ -219,8 +247,9 @@ pub fn add_genesis_accounts(genesis_config: &mut GenesisConfig, mut issued_lampo
genesis_config,
&StakerInfo {
name: "one thanks",
staker: "3b7akieYUyCgz3Cwt5sTSErMWjg8NEygD6mbGjhGkduB",
staker: "7vEAL3nS9CWmy1q6njUUyHE7Cf5RmyQpND6CsoHjzPiR",
lamports: 500_000_000 * LAMPORTS_PER_SOL - issued_lamports,
withdrawer: Some("3FFaheyqtyAXZSYxDzsr5CVKvJuvZD1WE1VEsBtDbRqB"),
},
&UNLOCKS_ALL_DAY_ZERO,
1_000_000 * LAMPORTS_PER_SOL,
Expand Down
24 changes: 18 additions & 6 deletions genesis/src/stakes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use solana_stake_program::{
pub struct StakerInfo {
pub name: &'static str,
pub staker: &'static str,
pub withdrawer: Option<&'static str>,
pub lamports: u64,
}

Expand Down Expand Up @@ -43,12 +44,19 @@ pub fn create_and_add_stakes(
// the largest each stake account should be, in lamports
granularity: u64,
) -> u64 {
let authorized = Authorized::auto(
&staker_info
.staker
.parse::<Pubkey>()
.expect("invalid staker"),
);
let staker = &staker_info
.staker
.parse::<Pubkey>()
.expect("invalid staker");
let withdrawer = &staker_info
.withdrawer
.unwrap_or(staker_info.staker)
.parse::<Pubkey>()
.expect("invalid staker");
let authorized = Authorized {
staker: *staker,
withdrawer: *withdrawer,
};
let custodian = unlock_info
.custodian
.parse::<Pubkey>()
Expand Down Expand Up @@ -239,6 +247,7 @@ mod tests {
name: "fun",
staker: "P1aceHo1derPubkey11111111111111111111111111",
lamports: total_lamports,
withdrawer: None,
},
&UnlockInfo {
cliff_fraction: 0.5,
Expand All @@ -264,6 +273,7 @@ mod tests {
name: "fun",
staker: "P1aceHo1derPubkey11111111111111111111111111",
lamports: total_lamports,
withdrawer: None,
},
&UnlockInfo {
cliff_fraction: 0.5,
Expand All @@ -289,6 +299,7 @@ mod tests {
name: "fun",
staker: "P1aceHo1derPubkey11111111111111111111111111",
lamports: total_lamports,
withdrawer: None,
},
&UnlockInfo {
cliff_fraction: 0.5,
Expand All @@ -313,6 +324,7 @@ mod tests {
name: "fun",
staker: "P1aceHo1derPubkey11111111111111111111111111",
lamports: total_lamports,
withdrawer: None,
},
&UnlockInfo {
cliff_fraction: 0.5,
Expand Down

0 comments on commit 815ca99

Please sign in to comment.