@@ -94,12 +94,12 @@ typedef td::BitArray<256> hash_t;
94
94
95
95
struct SmcDescr {
96
96
hash_t addr;
97
- int split_depth ;
97
+ int fixed_prefix_length ;
98
98
bool preinit_only;
99
99
td::RefInt256 gram_balance;
100
100
Ref<vm::DataCell> state_init; // StateInit
101
101
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 ) {
103
103
}
104
104
};
105
105
@@ -123,7 +123,7 @@ vm::Dictionary config_dict{32};
123
123
ton::UnixTime now;
124
124
125
125
bool 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 ) {
127
127
return false ;
128
128
}
129
129
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
221
221
}
222
222
223
223
td::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 ,
225
225
int mode) {
226
226
if (is_empty_cell (code)) {
227
227
code.clear ();
@@ -238,12 +238,12 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
238
238
THRERR (" not a valid library collection" );
239
239
}
240
240
vm::CellBuilder cb;
241
- if (!split_depth ) {
241
+ if (!fixed_prefix_length ) {
242
242
PDO (cb.store_long_bool (0 , 1 ));
243
243
} 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 ));
245
245
}
246
- THRERR (" invalid split_depth for a smart contract" );
246
+ THRERR (" invalid fixed_prefix_length for a smart contract" );
247
247
if (!special) {
248
248
PDO (cb.store_long_bool (0 , 1 ));
249
249
} else {
@@ -287,7 +287,7 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
287
287
auto ins = smart_contracts.emplace (addr, addr);
288
288
assert (ins.second );
289
289
SmcDescr& smc = ins.first ->second ;
290
- smc.split_depth = split_depth ;
290
+ smc.fixed_prefix_length = fixed_prefix_length ;
291
291
smc.preinit_only = (mode == 1 );
292
292
smc.gram_balance = balance;
293
293
total_smc_balance += balance;
@@ -328,10 +328,10 @@ td::RefInt256 create_smartcontract(td::RefInt256 smc_addr, Ref<vm::Cell> code, R
328
328
ctor = 2 ; // addr_std$10
329
329
}
330
330
PDO (cb.store_long_bool (ctor, 2 )); // addr_std$10 or addr_var$11
331
- if (split_depth ) {
331
+ if (fixed_prefix_length ) {
332
332
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)
335
335
} else {
336
336
PDO (cb.store_long_bool (0 , 1 )); // nothing$0
337
337
}
@@ -514,7 +514,7 @@ Ref<vm::Cell> create_state() {
514
514
// data (cell)
515
515
// library (cell)
516
516
// balance (int)
517
- // split_depth (int 0..32)
517
+ // fixed_prefix_length (int 0..32)
518
518
// special (int 0..3, +2 = tick, +1 = tock)
519
519
// [ address (uint256) ]
520
520
// mode (0 = compute address only, 1 = create uninit, 2 = create complete; +4 = with specified address)
@@ -536,7 +536,7 @@ void interpret_register_smartcontract(vm::Stack& stack) {
536
536
if (special && workchain_id != wc_master) {
537
537
throw fift::IntError{" cannot create special smartcontracts outside of the masterchain" };
538
538
}
539
- int split_depth = stack.pop_smallint_range (32 );
539
+ int fixed_prefix_length = stack.pop_smallint_range (32 );
540
540
td::RefInt256 balance = stack.pop_int_finite ();
541
541
if (sgn (balance) < 0 ) {
542
542
throw fift::IntError{" initial balance of a smartcontract cannot be negative" };
@@ -548,7 +548,7 @@ void interpret_register_smartcontract(vm::Stack& stack) {
548
548
Ref<vm::Cell> data = stack.pop_cell ();
549
549
Ref<vm::Cell> code = stack.pop_cell ();
550
550
td::RefInt256 addr = create_smartcontract (std::move (spec_addr), std::move (code), std::move (data), std::move (library),
551
- std::move (balance), special, split_depth , mode);
551
+ std::move (balance), special, fixed_prefix_length , mode);
552
552
if (addr.is_null ()) {
553
553
throw fift::IntError{" internal error while creating smartcontract" };
554
554
}
0 commit comments