"Asm.fif" include 31 -1<< constant wc_undef 0 constant wc_base -1 constant wc_master { wcid@ 2dup <> swap wc_undef <> and abort"workchain_id already set to another value" wcid! } : setworkchain { globalid@ 2dup <> swap and abort"global_id already set to another value" dup 0= abort"global_id cannot be zero" globalid! } : setglobalid constant empty_cell // b x --> b' ( serializes a Gram amount ) { -1 { 1+ 2dup 8 * ufits } until rot over 4 u, -rot 8 * u, } : Gram, // workchain-id -- wc-zero-state { ref, 0 1 u, ref, ref, 0 1 u, b> dup isShardState? not abort"invalid ShardState created" } : mkemptyShardState ' dictnew : Libs{ 'nop : }Libs { 16 config! } : config.validator_num! // min-stake max-stake min-total-stake max-factor -- { 4 0 reverse 17 config! } : config.validator_stake_limits! // elected-for elections-begin-before elections-end-before stakes-frozen { 4 0 reverse 15 config! } : config.election_params! dictnew 0 2constant validator-dict { @' validator-dict } : validator-dict@ { validator-dict@ nip } : validator# // val-pubkey weight -- { dup 0<= abort"validator weight must be non-negative" dup 64 ufits not abort"validator weight must fit into 64 bits" over Blen 32 <> abort"validator public key must be 32 bytes long" 34 config! } : config.validators! dictnew constant workchain-dict // root-hash file-hash enable-utime actual-min-split min-split max-split workchain-id -- { dup isWorkchainDescr? not abort"invalid WorkchainDescr created" s s>c 12 config! } : config.workchains! dictnew constant special-dict // special-smc-addr -- { x{} swap @' special-dict 256 udict! not abort"cannot add a new special smart contract" =: special-dict } : make_special { @' special-dict dict>s s>c 31 config! } : config.special! // bit-pps cell-pps mc-bit-pps mc-cell-pps -- { udict! 0= abort"cannot create storage prices dictionary" 18 config! } : config.storage_prices! { 16 << } : sg* { 16 < } : make-gas-prices { make-gas-prices 20 config! } : config.mc_gas_prices! { make-gas-prices 21 config! } : config.gas_prices! // lump_price bit_price cell_price ihr_factor first_frac next_frac { 6 0 reverse } : make-msg-fwd-prices { make-msg-fwd-prices 24 config! } : config.mc_fwd_prices! { make-msg-fwd-prices 25 config! } : config.fwd_prices! // mc-cc-lifetime sh-cc-lifetime sh-val-lifetime sh-val-num { 4 0 reverse } : make-catchain-params { make-catchain-params 28 config! } : config.catchain_params! // round-candidates next-cand-delay-ms consensus-timeout-ms fast-attempts attempt-duration cc-max-deps max-block-size max-collated-size { 8 0 reverse } : make-vsession-params { make-vsession-params 29 config! } : config.consensus_params! // b [underload soft hard] -- b' { untriple 3 roll x{c3} s, 3 roll 32 u, rot 32 u, swap 32 u, } : param_limits, // bytes-limits gas-limits lt-limits -- c { } : make-block-limits { make-block-limits 22 config! } : config.mc_block_limits! { make-block-limits 23 config! } : config.block_limits! // mc-block-create-fee bc-block-create-fee { } : make-block-create-fees { make-block-create-fees 14 config! } : config.block_create_fees! { } : make-smc-addr-cell { make-smc-addr-cell 0 config! } : config.config_smc! { make-smc-addr-cell 1 config! } : config.elector_smc! { make-smc-addr-cell 2 config! } : config.minter_smc! { make-smc-addr-cell 3 config! } : config.collector_smc! { 7 config! } : config.to_mint! 1000000000 constant Gram 1000000 constant mGram 1000 constant uGram 1 constant nGram { Gram * } : Gram* { mGram * } : mGram* { uGram * } : uGram* 'nop : nGram* { Gram swap */r } : Gram*/ { mGram swap */r } : mGram*/ { uGram swap */r } : uGram*/ { /r } : nGram*/ // GR$.17 is equivalent to 170000000 { bl word (number) ?dup 0= abort"not a valid Gram amount" 1- { Gram swap */r } { Gram * } cond 1 'nop } ::_ GR$ { 10 << } : *Ki { 20 << } : *Mi { 30 << } : *Gi { 10 <