Skip to main content

Module generate_state_bloat

Module generate_state_bloat 

Source
Expand description

State bloat generation tool for generating large TIP20 storage state files.

Generates a binary file containing TIP20 storage slots (total_supply + balances) that can be loaded during genesis initialization to create a bloated state.

Structsยง

GenerateStateBloat ๐Ÿ”’
Generate state bloat file

Constantsยง

MAGIC ๐Ÿ”’
Magic bytes for the state bloat binary format (8 bytes)
VERSION ๐Ÿ”’
Format version

Functionsยง

compute_mapping_slot ๐Ÿ”’
Compute a Solidity mapping slot: keccak256(pad32(key) || pad32(base_slot))
derive_address_fast ๐Ÿ”’
Fast address derivation using keccak256(seed || index). This is much faster than BIP32 but the resulting addresses are NOT signable. Used for generating bloat addresses beyond the signable count.
derive_parent_key ๐Ÿ”’
Derive the parent key for BIP44 Ethereum path: m/44โ€™/60โ€™/0โ€™/0 This performs PBKDF2 once, then subsequent child derivations are fast.
token_address ๐Ÿ”’
Compute a reserved TIP20 token address from a token ID. Reserved addresses use the TIP20 prefix with the token ID in the last 8 bytes.
write_header ๐Ÿ”’
Write a block header to the output. Format: [magic:8][version:2][flags:2][address:20][pair_count:8] = 40 bytes