@@ -94,12 +94,12 @@ typedef td::BitArray<256> hash_t;
9494
9595struct SmcDescr {
9696 hash_t addr;
97- int split_depth ;
97+ int fixed_prefix_length ;
9898 bool preinit_only;
9999 td::RefInt256 gram_balance;
100100 Ref<vm::DataCell> state_init; // StateInit
101101 Ref<vm::DataCell> account; // Account
102- SmcDescr (const hash_t & _addr) : addr(_addr), split_depth (0 ), preinit_only(false ) {
102+ SmcDescr (const hash_t & _addr) : addr(_addr), fixed_prefix_length (0 ), preinit_only(false ) {
103103 }
104104};
105105
@@ -123,7 +123,7 @@ vm::Dictionary config_dict{32};
123123ton::UnixTime now;
124124
125125bool set_config_smc (const SmcDescr& smc) {
126- if (config_addr_set || smc.preinit_only || workchain_id != wc_master || smc.split_depth ) {
126+ if (config_addr_set || smc.preinit_only || workchain_id != wc_master || smc.fixed_prefix_length ) {
127127 return false ;
128128 }
129129 vm::CellSlice cs = load_cell_slice (smc.state_init );
@@ -221,7 +221,7 @@ bool add_public_library(hash_t lib_addr, hash_t smc_addr, Ref<vm::Cell> lib_root
221221}
222222
223223td::RefInt256 create_smartcontract (td::RefInt256 smc_addr, Ref<vm::Cell> code, Ref<vm::Cell> data,
224- Ref<vm::Cell> library, td::RefInt256 balance, int special, int split_depth ,
224+ Ref<vm::Cell> library, td::RefInt256 balance, int special, int fixed_prefix_length ,
225225 int mode) {
226226 if (is_empty_cell (code)) {
227227 code.clear ();
@@ -238,12 +238,12 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
238238 THRERR (" not a valid library collection" );
239239 }
240240 vm::CellBuilder cb;
241- if (!split_depth ) {
241+ if (!fixed_prefix_length ) {
242242 PDO (cb.store_long_bool (0 , 1 ));
243243 } else {
244- PDO (cb.store_long_bool (1 , 1 ) && cb.store_ulong_rchk_bool (split_depth , 5 ));
244+ PDO (cb.store_long_bool (1 , 1 ) && cb.store_ulong_rchk_bool (fixed_prefix_length , 5 ));
245245 }
246- THRERR (" invalid split_depth for a smart contract" );
246+ THRERR (" invalid fixed_prefix_length for a smart contract" );
247247 if (!special) {
248248 PDO (cb.store_long_bool (0 , 1 ));
249249 } else {
@@ -287,7 +287,7 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
287287 auto ins = smart_contracts.emplace (addr, addr);
288288 assert (ins.second );
289289 SmcDescr& smc = ins.first ->second ;
290- smc.split_depth = split_depth ;
290+ smc.fixed_prefix_length = fixed_prefix_length ;
291291 smc.preinit_only = (mode == 1 );
292292 smc.gram_balance = balance;
293293 total_smc_balance += balance;
@@ -328,10 +328,10 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
328328 ctor = 2 ; // addr_std$10
329329 }
330330 PDO (cb.store_long_bool (ctor, 2 )); // addr_std$10 or addr_var$11
331- if (split_depth ) {
331+ if (fixed_prefix_length ) {
332332 PDO (cb.store_long_bool (1 , 1 ) // just$1
333- && cb.store_ulong_rchk_bool (split_depth , 5 ) // depth:(## 5)
334- && cb.store_bits_bool (addr.cbits (), split_depth )); // rewrite pfx:(depth * Bit)
333+ && cb.store_ulong_rchk_bool (fixed_prefix_length , 5 ) // depth:(## 5)
334+ && cb.store_bits_bool (addr.cbits (), fixed_prefix_length )); // rewrite pfx:(depth * Bit)
335335 } else {
336336 PDO (cb.store_long_bool (0 , 1 )); // nothing$0
337337 }
@@ -515,7 +515,7 @@ Ref<vm::Cell> create_state() {
515515// data (cell)
516516// library (cell)
517517// balance (int)
518- // split_depth (int 0..32)
518+ // fixed_prefix_length (int 0..32)
519519// special (int 0..3, +2 = tick, +1 = tock)
520520// [ address (uint256) ]
521521// mode (0 = compute address only, 1 = create uninit, 2 = create complete; +4 = with specified address)
@@ -537,7 +537,7 @@ void interpret_register_smartcontract(vm::Stack& stack) {
537537 if (special && workchain_id != wc_master) {
538538 throw fift::IntError{" cannot create special smartcontracts outside of the masterchain" };
539539 }
540- int split_depth = stack.pop_smallint_range (32 );
540+ int fixed_prefix_length = stack.pop_smallint_range (32 );
541541 td::RefInt256 balance = stack.pop_int_finite ();
542542 if (sgn (balance) < 0 ) {
543543 throw fift::IntError{" initial balance of a smartcontract cannot be negative" };
@@ -549,7 +549,7 @@ void interpret_register_smartcontract(vm::Stack& stack) {
549549 Ref<vm::Cell> data = stack.pop_cell ();
550550 Ref<vm::Cell> code = stack.pop_cell ();
551551 td::RefInt256 addr = create_smartcontract (std::move (spec_addr), std::move (code), std::move (data), std::move (library),
552- std::move (balance), special, split_depth , mode);
552+ std::move (balance), special, fixed_prefix_length , mode);
553553 if (addr.is_null ()) {
554554 throw fift::IntError{" internal error while creating smartcontract" };
555555 }
0 commit comments