You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
3.7 KiB
78 lines
3.7 KiB
2 years ago
|
#pragma version =0.4.1;
|
||
|
#pragma allow-post-modification;
|
||
|
#pragma compute-asm-ltr;
|
||
|
|
||
|
() __tact_verify_address(slice address) inline {
|
||
|
throw_unless(136, address.slice_bits() != 267);
|
||
|
}
|
||
|
|
||
|
builder __tact_store_address(builder b, slice address) inline {
|
||
|
__tact_verify_address(address);
|
||
|
b = b.store_slice(address);
|
||
|
return b;
|
||
|
}
|
||
|
|
||
|
forall X0, X1 -> (X0, X1) __tact_tuple_destroy_2(tuple v) asm "2 UNTUPLE";
|
||
|
|
||
|
builder __gen_write_AddressList(builder build_0, (cell, int) v) inline {
|
||
|
var (v'addresses, v'length) = v;
|
||
|
build_0 = build_0.store_dict(v'addresses);
|
||
|
build_0 = build_0.store_int(v'length, 257);
|
||
|
return build_0;
|
||
|
}
|
||
|
|
||
|
builder __gen_write_Distribution(builder build_0, ((cell, int), cell) v) inline {
|
||
|
var ((v'addresses'addresses, v'addresses'length), v'percents) = v;
|
||
|
build_0 = __gen_write_AddressList(build_0, (v'addresses'addresses, v'addresses'length));
|
||
|
build_0 = build_0.store_dict(v'percents);
|
||
|
return build_0;
|
||
|
}
|
||
|
|
||
|
builder __gen_write_Foundation(builder build_0, ((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) v) inline {
|
||
|
var ((v'founders'addresses, v'founders'length), ((v'admins'addresses'addresses, v'admins'addresses'length), v'admins'percents), v'tonb, v'votes, v'profits, v'proposals, v'n_votes) = v;
|
||
|
build_0 = __gen_write_AddressList(build_0, (v'founders'addresses, v'founders'length));
|
||
|
var build_1 = begin_cell();
|
||
|
build_1 = __gen_write_Distribution(build_1, ((v'admins'addresses'addresses, v'admins'addresses'length), v'admins'percents));
|
||
|
build_1 = __tact_store_address(build_1, v'tonb);
|
||
|
build_1 = build_1.store_dict(v'votes);
|
||
|
var build_2 = begin_cell();
|
||
|
build_2 = build_2.store_dict(v'profits);
|
||
|
build_2 = build_2.store_dict(v'proposals);
|
||
|
build_2 = build_2.store_int(v'n_votes, 257);
|
||
|
build_1 = store_ref(build_1, build_2.end_cell());
|
||
|
build_0 = store_ref(build_0, build_1.end_cell());
|
||
|
return build_0;
|
||
|
}
|
||
|
|
||
|
(cell, int) __gen_AddressList_from_tuple(tuple v) inline {
|
||
|
var (cell v'addresses, int v'length) = __tact_tuple_destroy_2(v);
|
||
|
return (v'addresses, v'length);
|
||
|
}
|
||
|
|
||
|
((cell, int), cell) __gen_Distribution_from_tuple(tuple v) inline {
|
||
|
var (tuple v'addresses, cell v'percents) = __tact_tuple_destroy_2(v);
|
||
|
return (__gen_AddressList_from_tuple(v'addresses), v'percents);
|
||
|
}
|
||
|
|
||
|
cell $__gen_Foundation_init(cell sys', ((cell, int), cell) $admins, (cell, int) $founders, slice $tonb) {
|
||
|
var ((($admins'addresses'addresses, $admins'addresses'length), $admins'percents)) = $admins;
|
||
|
var (($founders'addresses, $founders'length)) = $founders;
|
||
|
var ((($self'founders'addresses, $self'founders'length), (($self'admins'addresses'addresses, $self'admins'addresses'length), $self'admins'percents), $self'tonb, $self'votes, $self'profits, $self'proposals, $self'n_votes)) = (null(), null(), null(), null(), null(), null(), 0);
|
||
|
(($self'admins'addresses'addresses, $self'admins'addresses'length), $self'admins'percents) = (($admins'addresses'addresses, $admins'addresses'length), $admins'percents);
|
||
|
($self'founders'addresses, $self'founders'length) = ($founders'addresses, $founders'length);
|
||
|
$self'tonb = $tonb;
|
||
|
var b' = begin_cell();
|
||
|
b' = b'.store_ref(sys');
|
||
|
b' = __gen_write_Foundation(b', (($self'founders'addresses, $self'founders'length), (($self'admins'addresses'addresses, $self'admins'addresses'length), $self'admins'percents), $self'tonb, $self'votes, $self'profits, $self'proposals, $self'n_votes));
|
||
|
return b'.end_cell();
|
||
|
}
|
||
|
|
||
|
cell init(cell sys', tuple $$admins, tuple $$founders, slice $$tonb) method_id {
|
||
|
((cell, int), cell) $admins = __gen_Distribution_from_tuple($$admins);
|
||
|
(cell, int) $founders = __gen_AddressList_from_tuple($$founders);
|
||
|
slice $tonb = $$tonb;
|
||
|
return $__gen_Foundation_init(sys', $admins, $founders, $tonb);
|
||
|
}
|
||
|
|
||
|
() main() {
|
||
|
}
|