Skip to content

Commit

Permalink
Add more controlled account for balances, vesting, token claims logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylavrenov committed Sep 13, 2024
1 parent d33fdec commit 3a8306d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions utils/patch-forked-spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@ PREFIX_SESSION_QUEUED_KEYS="0xcec5070d609dd3497f72bde07fc96ba0e0cdd062e6eaf24295
PREFIX_SESSION_NEXT_KEYS_ALICE="0xcec5070d609dd3497f72bde07fc96ba04c014e6bf8b8c2c011e7290b85696bb3518366b5b1bc7c99d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
PREFIX_SUDO_KEY="0x5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b"
PREFIX_SYSTEM_LAST_RUNTIME_UPGRADE="0x26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8"
PREFIX_SYSTEM_ACCOUNT_NON_ZERO_BALANCE="0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9a768ed4245f326a0c8d95971dcc2c5b9190e469585922bed2be063d1fd0fca121c3830e511207dea4ed10f5e80caf352"
# hmsGT9XUdV5px2o6jwb2LDKHaAYKWgDsf12wkNgbUtkeE3i7a
#
# Seed: bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice
PREFIX_SYSTEM_ACCOUNT_ALICE="0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
# Account: 0x4f96c801b7c77625d5ada4554be06e9581ed696a
PREFIX_TOKEN_CLAIMS_ACCOUNT_WITHOUT_VESTING="0x934fcc747c45b2485f7ff351caf839d09c5d795d0297be56027a4b2464e33397035f7f170d344aec4f96c801b7c77625d5ada4554be06e9581ed696a"
# Account: 0xb6d3f44d325c35e8434bf389efd9ee83b19ded54
PREFIX_TOKEN_CLAIMS_ACCOUNT_WITH_VESTING="0x934fcc747c45b2485f7ff351caf839d09c5d795d0297be56027a4b2464e3339704096cc71f191e51b6d3f44d325c35e8434bf389efd9ee83b19ded54"
# 0xaE3F080BEddB4E5D90230b4dFDdFce1Ec6E04799
#
# PrivKey: 2ab0f446b34efebc4d39cbcbafe1bc11a9c48afb8f831de94d8d4b3225adaab3
PREFIX_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITHOUT_VESTING="0x934fcc747c45b2485f7ff351caf839d09c5d795d0297be56027a4b2464e3339792ec5a7a93816ad6ae3f080beddb4e5d90230b4dfddfce1ec6e04799"
# 0x6B582A51362244b49BA31E3F92Db31053d360F6E
#
# PrivKey: 88469042933a7792c408fd166d681608dcbc9994b75829bfa09ebd5349c8d1d7
PREFIX_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITH_VESTING="0x934fcc747c45b2485f7ff351caf839d09c5d795d0297be56027a4b2464e33397cdde6672ddd625c16b582a51362244b49ba31e3f92db31053d360f6e"
# hmr1mb7yweHS32MERcBoFkAsMtiP4H8LqadMEsAp6hDmqYjNz
PREFIX_VESTING_ACCOUNT_NON_ZERO="0x5f27b51b5ec208ee9cb25b55d8728243347d9208c3a12dab846866426727fa0b454f7119fdfde5999cc6bddd6c83949abad41de55d80e25a735163db57ddb943b800fc597944db48"
# hmqhHsTJVMMq3sncEWf4PTyNc4hJdDgUKWCoRKKTopmizGjWZ
#
# Seed: bottom drive obey lake curtain smoke basket hold race lonely fit walk//Bob
PREFIX_VESTING_ACCOUNT_BOB="0x5f27b51b5ec208ee9cb25b55d8728243347d9208c3a12dab846866426727fa0ba647e755c30521d38eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48"

VALUE_ALICE_BABE_AUTHORITIES_VEC="0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000"
VALUE_ALICE_BABE_NEXT_AUTHORITIES_VEC="0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0100000000000000"
Expand All @@ -63,6 +86,14 @@ VALUE_ALICE="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
VALUE_VALIDATORS="0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
VALUE_QUEUED_KEYS="0x04d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27dd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
VALUE_NEXT_KEYS_FOR_ALICE="0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0eed43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
VALUE_ACCOUNT_NON_ZERO_BALANCE="0x0100000000000000010000000000000024e747251d93cc0da6460a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
VALUE_ALICE_ACCOUNT="0x"
VALUE_TOKEN_CLAIMS_ACCOUNT_WITHOUT_VESTING="0x00c8deb3843d95640c0000000000000000"
VALUE_TOKEN_CLAIMS_ACCOUNT_WITH_VESTING="0x00f02fbe0b73f97f0100000000000000040028f50fa4501103010000000000000000587ccf0100000000587ccf01000000"
VALUE_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITHOUT_VESTING="0x"
VALUE_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITH_VESTING="0x"
VALUE_VESTING_ACCOUNT_NON_ZERO="0x04000000a1edccce1bc2d30000000000000060f13d0700000000c0e27b0e000000"
VALUE_VESTING_ACCOUNT_BOB="0x"

# Set the babe authorities to just `//Alice`.
set_prefix "$PREFIX_BABE_AUTHORITIES" "$VALUE_ALICE_BABE_AUTHORITIES_VEC"
Expand All @@ -85,6 +116,22 @@ set_prefix "$PREFIX_SESSION_NEXT_KEYS_ALICE" "$VALUE_NEXT_KEYS_FOR_ALICE"
# Set sudo key to "//Alice".
set_prefix "$PREFIX_SUDO_KEY" "$VALUE_ALICE"

# Swap balances
set_prefix "$PREFIX_SYSTEM_ACCOUNT_NON_ZERO_BALANCE" "$VALUE_ALICE_ACCOUNT"
set_prefix "$PREFIX_SYSTEM_ACCOUNT_ALICE" "$VALUE_ACCOUNT_NON_ZERO_BALANCE"

# Swap token claims without vesting from uncontrolled account to controlled one.
set_prefix "$PREFIX_TOKEN_CLAIMS_ACCOUNT_WITHOUT_VESTING" "$VALUE_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITHOUT_VESTING"
set_prefix "$PREFIX_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITHOUT_VESTING" "$VALUE_TOKEN_CLAIMS_ACCOUNT_WITHOUT_VESTING"

# Swap token claims with vesting from uncontrolled account to controlled one.
set_prefix "$PREFIX_TOKEN_CLAIMS_ACCOUNT_WITH_VESTING" "$VALUE_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITH_VESTING"
set_prefix "$PREFIX_TOKEN_CLAIMS_CONTROLLED_ACCOUNT_WITH_VESTING" "$VALUE_TOKEN_CLAIMS_ACCOUNT_WITH_VESTING"

# Swap vesting from uncontrolled account to controlled one.
set_prefix "$PREFIX_VESTING_ACCOUNT_NON_ZERO" "$VALUE_VESTING_ACCOUNT_BOB"
set_prefix "$PREFIX_VESTING_ACCOUNT_BOB" "$VALUE_VESTING_ACCOUNT_NON_ZERO"

# Delete the genesis slot to trigger babe initialization.
delete_prefix "$PREFIX_BABE_GENESIS_SLOT"

Expand Down

0 comments on commit 3a8306d

Please sign in to comment.