Browse Source

Distribution votes

master
Lev 2 years ago
parent
commit
926aaacb93
  1. 76
      sources/foundation.tact
  2. 2
      sources/output/jetton_Linker.abi
  3. 2
      sources/output/jetton_Linker.code.fc
  4. 2
      sources/output/jetton_Linker.code.fif
  5. 4
      sources/output/jetton_Linker.md
  6. 2
      sources/output/jetton_Linker.pkg
  7. 29
      sources/output/jetton_Linker.ts
  8. 2
      sources/output/jetton_PseudoStaking.abi
  9. 2
      sources/output/jetton_PseudoStaking.code.fc
  10. 2
      sources/output/jetton_PseudoStaking.code.fif
  11. 4
      sources/output/jetton_PseudoStaking.md
  12. 2
      sources/output/jetton_PseudoStaking.pkg
  13. 29
      sources/output/jetton_PseudoStaking.ts
  14. 2
      sources/output/jetton_TONB.abi
  15. 2
      sources/output/jetton_TONB.code.fc
  16. 2
      sources/output/jetton_TONB.code.fif
  17. 4
      sources/output/jetton_TONB.md
  18. 2
      sources/output/jetton_TONB.pkg
  19. 29
      sources/output/jetton_TONB.ts
  20. 2
      sources/output/jetton_TONBWallet.abi
  21. 2
      sources/output/jetton_TONBWallet.code.fc
  22. 2
      sources/output/jetton_TONBWallet.code.fif
  23. 4
      sources/output/jetton_TONBWallet.md
  24. 2
      sources/output/jetton_TONBWallet.pkg
  25. 29
      sources/output/jetton_TONBWallet.ts

76
sources/foundation.tact

@ -1,11 +1,12 @@
import "./messages"; import "./messages";
struct Proposal { struct Proposal {
type: Int; // 0 - Blacklist, 1 - Full liquidation, 2 - Change percents type: Int; // 0 - Blacklist, 1 - Full liquidation, 2 - Change percents
blacklistAddress: Address?; blacklistAddress: Address?;
distribution: Distribution?; distribution_addresses: map[Int]Address;
distribution_addresses_length: Int? = null;
distribution_percents: map[Int]Int;
} }
struct Vote { struct Vote {
@ -81,7 +82,10 @@ contract Foundation {
// todo // todo
} }
if (prop.type == 2) { if (prop.type == 2) {
self.admins = prop.distribution!!; self.admins = Distribution{
addresses: AddressList{ addresses: prop.distribution_addresses, length: prop.distribution_addresses_length!! },
percents: prop.distribution_percents
};
} }
} }
@ -109,7 +113,9 @@ contract Foundation {
let proposal: Proposal = Proposal { let proposal: Proposal = Proposal {
type: 0, type: 0,
blacklistAddress: msg.wallet, blacklistAddress: msg.wallet,
distribution: null distribution_addresses: emptyMap(),
distribution_addresses_length: null,
distribution_percents: emptyMap()
}; };
let vote: Vote = Vote { let vote: Vote = Vote {
id: self.n_votes, id: self.n_votes,
@ -128,34 +134,36 @@ contract Foundation {
self.n_votes = self.n_votes + 1; self.n_votes = self.n_votes + 1;
} }
// receive(msg: InitiateDistributionVote) { receive(msg: InitiateDistributionVote) {
// let ctx: Context = context(); let ctx: Context = context();
// require(ctx.sender == self.admins.addresses.addresses.get(msg.adminIndex), "Only an admin can initiate a vote"); require(ctx.sender == self.admins.addresses.addresses.get(msg.adminIndex), "Only an admin can initiate a vote");
// require(ctx.value >= ton("1.0"), "Voting requires at least 1 ton for the fees"); require(ctx.value >= ton("1.0"), "Voting requires at least 1 ton for the fees");
// require(msg.quorum_percent > 20 && msg.quorum_percent <= 100, "Invalid quorum percent"); require(msg.quorum_percent > 20 && msg.quorum_percent <= 100, "Invalid quorum percent");
// require(msg.vote_time > 0 && msg.vote_time < 3 * 24 * 3600, "Invalid vote time"); require(msg.vote_time > 0 && msg.vote_time < 3 * 24 * 3600, "Invalid vote time");
// let proposal: Proposal = Proposal { let proposal: Proposal = Proposal {
// type: 2, type: 2,
// blacklistAddress: null, blacklistAddress: null,
// distribution: msg.distribution distribution_addresses: msg.distribution.addresses.addresses,
// }; distribution_addresses_length: msg.distribution.addresses.length,
distribution_percents: msg.distribution.percents
// let vote: Vote = Vote { };
// id: self.n_votes,
// vote_end: now() + msg.vote_time, let vote: Vote = Vote {
// proposal: proposal, id: self.n_votes,
// quorum_percent: msg.quorum_percent, vote_end: now() + msg.vote_time,
// votes: emptyMap(), quorum_percent: msg.quorum_percent,
// result: null votes: emptyMap(),
// }; result: null
// let i: Int = 0; };
// while (i < self.admins.addresses.length) { let i: Int = 0;
// vote.votes.set(i, -1); while (i < self.admins.addresses.length) {
// i = i + 1; vote.votes.set(i, -1);
// } i = i + 1;
// self.votes.set(self.n_votes, vote); }
// self.n_votes = self.n_votes + 1; self.votes.set(self.n_votes, vote);
// } self.proposals.set(self.n_votes, proposal);
self.n_votes = self.n_votes + 1;
}
receive(msg: InitiateLiquidationVote) { receive(msg: InitiateLiquidationVote) {
let ctx: Context = context(); let ctx: Context = context();
@ -178,7 +186,9 @@ contract Foundation {
let proposal: Proposal = Proposal { let proposal: Proposal = Proposal {
type: 1, type: 1,
blacklistAddress: null, blacklistAddress: null,
distribution: null distribution_addresses: emptyMap(),
distribution_addresses_length: null,
distribution_percents: emptyMap()
}; };
self.votes.set(self.n_votes, vote); self.votes.set(self.n_votes, vote);
self.proposals.set(self.n_votes, proposal); self.proposals.set(self.n_votes, proposal);

2
sources/output/jetton_Linker.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_Linker.code.fc

@ -229,5 +229,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmZpCUdLNy4uEWdnT2sawL9SAm8Aqp43rhUTB3gAh22zoz"; return "ipfs://QmT6MF61LUeoFNCvMjWniLYhTxNcuqbdymD4hwdqxuPN7t";
} }

2
sources/output/jetton_Linker.code.fif

@ -354,6 +354,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d5a704355644c4e7934754557646e54327361774c3953416d38417170343372685554423367416832327a6f7a} PUSHSLICE x{697066733a2f2f516d54364d4636314c55656f464e43764d6a576e694c596854784e6375716264796d4434687764717875504e3774} PUSHSLICE
}> }>
}END>c }END>c

4
sources/output/jetton_Linker.md

@ -130,8 +130,8 @@ TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 =
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## Proposal ## Proposal
TLB: `_ type:int257 blacklistAddress:Maybe address distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>} = Proposal` TLB: `_ type:int257 blacklistAddress:Maybe address distribution_addresses:dict<int, address> distribution_addresses_length:Maybe int257 distribution_percents:dict<int, int> = Proposal`
Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>}}` Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution_addresses:dict<int, address>,distribution_addresses_length:Maybe int257,distribution_percents:dict<int, int>}`
## Vote ## Vote
TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote` TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote`

2
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

29
sources/output/jetton_Linker.ts

@ -1562,7 +1562,9 @@ export type Proposal = {
$$type: 'Proposal'; $$type: 'Proposal';
type: bigint; type: bigint;
blacklistAddress: Address | null; blacklistAddress: Address | null;
distribution: Distribution | null; distribution_addresses: Dictionary<bigint, Address>;
distribution_addresses_length: bigint | null;
distribution_percents: Dictionary<bigint, bigint>;
} }
export function storeProposal(src: Proposal) { export function storeProposal(src: Proposal) {
@ -1570,7 +1572,9 @@ export function storeProposal(src: Proposal) {
let b_0 = builder; let b_0 = builder;
b_0.storeInt(src.type, 257); b_0.storeInt(src.type, 257);
b_0.storeAddress(src.blacklistAddress); b_0.storeAddress(src.blacklistAddress);
if (src.distribution !== null && src.distribution !== undefined) { b_0.storeBit(true); b_0.store(storeDistribution(src.distribution)); } else { b_0.storeBit(false); } b_0.storeDict(src.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address());
if (src.distribution_addresses_length !== null && src.distribution_addresses_length !== undefined) { b_0.storeBit(true).storeInt(src.distribution_addresses_length, 257); } else { b_0.storeBit(false); }
b_0.storeDict(src.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257));
}; };
} }
@ -1578,27 +1582,28 @@ export function loadProposal(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
let _type = sc_0.loadIntBig(257); let _type = sc_0.loadIntBig(257);
let _blacklistAddress = sc_0.loadMaybeAddress(); let _blacklistAddress = sc_0.loadMaybeAddress();
let _distribution = sc_0.loadBit() ? loadDistribution(sc_0) : null; let _distribution_addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_addresses_length = sc_0.loadBit() ? sc_0.loadIntBig(257) : null;
let _distribution_percents = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function loadTupleProposal(source: TupleReader) { function loadTupleProposal(source: TupleReader) {
let _type = source.readBigNumber(); let _type = source.readBigNumber();
let _blacklistAddress = source.readAddressOpt(); let _blacklistAddress = source.readAddressOpt();
const _distribution_p = source.readTupleOpt(); let _distribution_addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt());
const _distribution = _distribution_p ? loadTupleDistribution(_distribution_p) : null; let _distribution_addresses_length = source.readBigNumberOpt();
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_percents = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt());
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function storeTupleProposal(source: Proposal) { function storeTupleProposal(source: Proposal) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeNumber(source.type); builder.writeNumber(source.type);
builder.writeAddress(source.blacklistAddress); builder.writeAddress(source.blacklistAddress);
if (source.distribution !== null && source.distribution !== undefined) { builder.writeCell(source.distribution_addresses.size > 0 ? beginCell().storeDictDirect(source.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null);
builder.writeTuple(storeTupleDistribution(source.distribution)); builder.writeNumber(source.distribution_addresses_length);
} else { builder.writeCell(source.distribution_percents.size > 0 ? beginCell().storeDictDirect(source.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null);
builder.writeTuple(null);
}
return builder.build(); return builder.build();
} }

2
sources/output/jetton_PseudoStaking.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_PseudoStaking.code.fc

@ -284,5 +284,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmYHQGN9gwud65wi4XsLW1FLFnWHo9Rygo9VUzpnpozJ4w"; return "ipfs://Qmd2r7TFbd5yEF7FuvHJJGMr438Yefi1v8tSa9QgS8sf32";
} }

2
sources/output/jetton_PseudoStaking.code.fif

@ -490,6 +490,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT 209801025412363888721030803524359905849 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d594851474e3967777564363577693458734c5731464c466e57486f395279676f3956557a706e706f7a4a3477} PUSHSLICE x{697066733a2f2f516d64327237544662643579454637467576484a4a474d7234333859656669317638745361395167533873663332} PUSHSLICE
}> }>
}END>c }END>c

4
sources/output/jetton_PseudoStaking.md

@ -130,8 +130,8 @@ TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 =
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## Proposal ## Proposal
TLB: `_ type:int257 blacklistAddress:Maybe address distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>} = Proposal` TLB: `_ type:int257 blacklistAddress:Maybe address distribution_addresses:dict<int, address> distribution_addresses_length:Maybe int257 distribution_percents:dict<int, int> = Proposal`
Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>}}` Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution_addresses:dict<int, address>,distribution_addresses_length:Maybe int257,distribution_percents:dict<int, int>}`
## Vote ## Vote
TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote` TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote`

2
sources/output/jetton_PseudoStaking.pkg

File diff suppressed because one or more lines are too long

29
sources/output/jetton_PseudoStaking.ts

@ -1562,7 +1562,9 @@ export type Proposal = {
$$type: 'Proposal'; $$type: 'Proposal';
type: bigint; type: bigint;
blacklistAddress: Address | null; blacklistAddress: Address | null;
distribution: Distribution | null; distribution_addresses: Dictionary<bigint, Address>;
distribution_addresses_length: bigint | null;
distribution_percents: Dictionary<bigint, bigint>;
} }
export function storeProposal(src: Proposal) { export function storeProposal(src: Proposal) {
@ -1570,7 +1572,9 @@ export function storeProposal(src: Proposal) {
let b_0 = builder; let b_0 = builder;
b_0.storeInt(src.type, 257); b_0.storeInt(src.type, 257);
b_0.storeAddress(src.blacklistAddress); b_0.storeAddress(src.blacklistAddress);
if (src.distribution !== null && src.distribution !== undefined) { b_0.storeBit(true); b_0.store(storeDistribution(src.distribution)); } else { b_0.storeBit(false); } b_0.storeDict(src.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address());
if (src.distribution_addresses_length !== null && src.distribution_addresses_length !== undefined) { b_0.storeBit(true).storeInt(src.distribution_addresses_length, 257); } else { b_0.storeBit(false); }
b_0.storeDict(src.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257));
}; };
} }
@ -1578,27 +1582,28 @@ export function loadProposal(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
let _type = sc_0.loadIntBig(257); let _type = sc_0.loadIntBig(257);
let _blacklistAddress = sc_0.loadMaybeAddress(); let _blacklistAddress = sc_0.loadMaybeAddress();
let _distribution = sc_0.loadBit() ? loadDistribution(sc_0) : null; let _distribution_addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_addresses_length = sc_0.loadBit() ? sc_0.loadIntBig(257) : null;
let _distribution_percents = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function loadTupleProposal(source: TupleReader) { function loadTupleProposal(source: TupleReader) {
let _type = source.readBigNumber(); let _type = source.readBigNumber();
let _blacklistAddress = source.readAddressOpt(); let _blacklistAddress = source.readAddressOpt();
const _distribution_p = source.readTupleOpt(); let _distribution_addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt());
const _distribution = _distribution_p ? loadTupleDistribution(_distribution_p) : null; let _distribution_addresses_length = source.readBigNumberOpt();
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_percents = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt());
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function storeTupleProposal(source: Proposal) { function storeTupleProposal(source: Proposal) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeNumber(source.type); builder.writeNumber(source.type);
builder.writeAddress(source.blacklistAddress); builder.writeAddress(source.blacklistAddress);
if (source.distribution !== null && source.distribution !== undefined) { builder.writeCell(source.distribution_addresses.size > 0 ? beginCell().storeDictDirect(source.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null);
builder.writeTuple(storeTupleDistribution(source.distribution)); builder.writeNumber(source.distribution_addresses_length);
} else { builder.writeCell(source.distribution_percents.size > 0 ? beginCell().storeDictDirect(source.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null);
builder.writeTuple(null);
}
return builder.build(); return builder.build();
} }

2
sources/output/jetton_TONB.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_TONB.code.fc

@ -825,5 +825,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmeT98SB67aKiLNmYcvUMbNWL75MuNs6JXZbK3o1ySrLTC"; return "ipfs://QmaCsDf34Xaxg6RGCy1BqUwKzksQBKWiYMbsGQHRtkYiEi";
} }

2
sources/output/jetton_TONB.code.fif

@ -1564,6 +1564,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT 86142586315491086060343270784266291122 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d6554393853423637614b694c4e6d596376554d624e574c37354d754e73364a585a624b336f317953724c5443} PUSHSLICE x{697066733a2f2f516d6143734466333458617867365247437931427155774b7a6b7351424b5769594d627347514852746b59694569} PUSHSLICE
}> }>
}END>c }END>c

4
sources/output/jetton_TONB.md

@ -130,8 +130,8 @@ TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 =
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## Proposal ## Proposal
TLB: `_ type:int257 blacklistAddress:Maybe address distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>} = Proposal` TLB: `_ type:int257 blacklistAddress:Maybe address distribution_addresses:dict<int, address> distribution_addresses_length:Maybe int257 distribution_percents:dict<int, int> = Proposal`
Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>}}` Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution_addresses:dict<int, address>,distribution_addresses_length:Maybe int257,distribution_percents:dict<int, int>}`
## Vote ## Vote
TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote` TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote`

2
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

29
sources/output/jetton_TONB.ts

@ -1562,7 +1562,9 @@ export type Proposal = {
$$type: 'Proposal'; $$type: 'Proposal';
type: bigint; type: bigint;
blacklistAddress: Address | null; blacklistAddress: Address | null;
distribution: Distribution | null; distribution_addresses: Dictionary<bigint, Address>;
distribution_addresses_length: bigint | null;
distribution_percents: Dictionary<bigint, bigint>;
} }
export function storeProposal(src: Proposal) { export function storeProposal(src: Proposal) {
@ -1570,7 +1572,9 @@ export function storeProposal(src: Proposal) {
let b_0 = builder; let b_0 = builder;
b_0.storeInt(src.type, 257); b_0.storeInt(src.type, 257);
b_0.storeAddress(src.blacklistAddress); b_0.storeAddress(src.blacklistAddress);
if (src.distribution !== null && src.distribution !== undefined) { b_0.storeBit(true); b_0.store(storeDistribution(src.distribution)); } else { b_0.storeBit(false); } b_0.storeDict(src.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address());
if (src.distribution_addresses_length !== null && src.distribution_addresses_length !== undefined) { b_0.storeBit(true).storeInt(src.distribution_addresses_length, 257); } else { b_0.storeBit(false); }
b_0.storeDict(src.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257));
}; };
} }
@ -1578,27 +1582,28 @@ export function loadProposal(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
let _type = sc_0.loadIntBig(257); let _type = sc_0.loadIntBig(257);
let _blacklistAddress = sc_0.loadMaybeAddress(); let _blacklistAddress = sc_0.loadMaybeAddress();
let _distribution = sc_0.loadBit() ? loadDistribution(sc_0) : null; let _distribution_addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_addresses_length = sc_0.loadBit() ? sc_0.loadIntBig(257) : null;
let _distribution_percents = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function loadTupleProposal(source: TupleReader) { function loadTupleProposal(source: TupleReader) {
let _type = source.readBigNumber(); let _type = source.readBigNumber();
let _blacklistAddress = source.readAddressOpt(); let _blacklistAddress = source.readAddressOpt();
const _distribution_p = source.readTupleOpt(); let _distribution_addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt());
const _distribution = _distribution_p ? loadTupleDistribution(_distribution_p) : null; let _distribution_addresses_length = source.readBigNumberOpt();
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_percents = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt());
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function storeTupleProposal(source: Proposal) { function storeTupleProposal(source: Proposal) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeNumber(source.type); builder.writeNumber(source.type);
builder.writeAddress(source.blacklistAddress); builder.writeAddress(source.blacklistAddress);
if (source.distribution !== null && source.distribution !== undefined) { builder.writeCell(source.distribution_addresses.size > 0 ? beginCell().storeDictDirect(source.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null);
builder.writeTuple(storeTupleDistribution(source.distribution)); builder.writeNumber(source.distribution_addresses_length);
} else { builder.writeCell(source.distribution_percents.size > 0 ? beginCell().storeDictDirect(source.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null);
builder.writeTuple(null);
}
return builder.build(); return builder.build();
} }

2
sources/output/jetton_TONBWallet.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_TONBWallet.code.fc

@ -514,5 +514,5 @@ _ supported_interfaces() method_id {
} }
_ get_abi_ipfs() { _ get_abi_ipfs() {
return "ipfs://QmRxkkCZ4Mtd1np4xEBLzcMDLA1JrQnk7JGaUN72eGuM8h"; return "ipfs://QmRzLCb5R2UswBfZBwdXxRm4MWmH4xYWfkxPfFmWZUAkQ6";
} }

2
sources/output/jetton_TONBWallet.code.fif

@ -1011,6 +1011,6 @@ PROGRAM{
209778528950190195973528115415557644819 PUSHINT 209778528950190195973528115415557644819 PUSHINT
}> }>
get_abi_ipfs PROC:<{ get_abi_ipfs PROC:<{
x{697066733a2f2f516d52786b6b435a344d7464316e70347845424c7a634d444c41314a72516e6b374a4761554e37326547754d3868} PUSHSLICE x{697066733a2f2f516d527a4c436235523255737742665a4277645878526d344d576d4834785957666b785066466d575a55416b5136} PUSHSLICE
}> }>
}END>c }END>c

4
sources/output/jetton_TONBWallet.md

@ -130,8 +130,8 @@ TLB: `_ addresses:dict<int, address> amounts:dict<int, int> n_requests:int257 =
Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}` Signature: `WithdrawalRequests{addresses:dict<int, address>,amounts:dict<int, int>,n_requests:int257}`
## Proposal ## Proposal
TLB: `_ type:int257 blacklistAddress:Maybe address distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>} = Proposal` TLB: `_ type:int257 blacklistAddress:Maybe address distribution_addresses:dict<int, address> distribution_addresses_length:Maybe int257 distribution_percents:dict<int, int> = Proposal`
Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution:Maybe Distribution{addresses:AddressList{addresses:dict<int, address>,length:int257},percents:dict<int, int>}}` Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution_addresses:dict<int, address>,distribution_addresses_length:Maybe int257,distribution_percents:dict<int, int>}`
## Vote ## Vote
TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote` TLB: `_ id:int257 votes:dict<int, int> vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote`

2
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

29
sources/output/jetton_TONBWallet.ts

@ -1562,7 +1562,9 @@ export type Proposal = {
$$type: 'Proposal'; $$type: 'Proposal';
type: bigint; type: bigint;
blacklistAddress: Address | null; blacklistAddress: Address | null;
distribution: Distribution | null; distribution_addresses: Dictionary<bigint, Address>;
distribution_addresses_length: bigint | null;
distribution_percents: Dictionary<bigint, bigint>;
} }
export function storeProposal(src: Proposal) { export function storeProposal(src: Proposal) {
@ -1570,7 +1572,9 @@ export function storeProposal(src: Proposal) {
let b_0 = builder; let b_0 = builder;
b_0.storeInt(src.type, 257); b_0.storeInt(src.type, 257);
b_0.storeAddress(src.blacklistAddress); b_0.storeAddress(src.blacklistAddress);
if (src.distribution !== null && src.distribution !== undefined) { b_0.storeBit(true); b_0.store(storeDistribution(src.distribution)); } else { b_0.storeBit(false); } b_0.storeDict(src.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address());
if (src.distribution_addresses_length !== null && src.distribution_addresses_length !== undefined) { b_0.storeBit(true).storeInt(src.distribution_addresses_length, 257); } else { b_0.storeBit(false); }
b_0.storeDict(src.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257));
}; };
} }
@ -1578,27 +1582,28 @@ export function loadProposal(slice: Slice) {
let sc_0 = slice; let sc_0 = slice;
let _type = sc_0.loadIntBig(257); let _type = sc_0.loadIntBig(257);
let _blacklistAddress = sc_0.loadMaybeAddress(); let _blacklistAddress = sc_0.loadMaybeAddress();
let _distribution = sc_0.loadBit() ? loadDistribution(sc_0) : null; let _distribution_addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_addresses_length = sc_0.loadBit() ? sc_0.loadIntBig(257) : null;
let _distribution_percents = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0);
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function loadTupleProposal(source: TupleReader) { function loadTupleProposal(source: TupleReader) {
let _type = source.readBigNumber(); let _type = source.readBigNumber();
let _blacklistAddress = source.readAddressOpt(); let _blacklistAddress = source.readAddressOpt();
const _distribution_p = source.readTupleOpt(); let _distribution_addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt());
const _distribution = _distribution_p ? loadTupleDistribution(_distribution_p) : null; let _distribution_addresses_length = source.readBigNumberOpt();
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution: _distribution }; let _distribution_percents = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt());
return { $$type: 'Proposal' as const, type: _type, blacklistAddress: _blacklistAddress, distribution_addresses: _distribution_addresses, distribution_addresses_length: _distribution_addresses_length, distribution_percents: _distribution_percents };
} }
function storeTupleProposal(source: Proposal) { function storeTupleProposal(source: Proposal) {
let builder = new TupleBuilder(); let builder = new TupleBuilder();
builder.writeNumber(source.type); builder.writeNumber(source.type);
builder.writeAddress(source.blacklistAddress); builder.writeAddress(source.blacklistAddress);
if (source.distribution !== null && source.distribution !== undefined) { builder.writeCell(source.distribution_addresses.size > 0 ? beginCell().storeDictDirect(source.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null);
builder.writeTuple(storeTupleDistribution(source.distribution)); builder.writeNumber(source.distribution_addresses_length);
} else { builder.writeCell(source.distribution_percents.size > 0 ? beginCell().storeDictDirect(source.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null);
builder.writeTuple(null);
}
return builder.build(); return builder.build();
} }

Loading…
Cancel
Save