From 971a36b4b6c6c18fb683a72a367e854a99003039 Mon Sep 17 00:00:00 2001 From: ennucore Date: Mon, 13 Feb 2023 15:00:49 +0100 Subject: [PATCH] Cli for Foundation-related ops --- sources/cli.js | 126 +- sources/foundation.deploy.ts | 49 + sources/foundation.tact | 2 + sources/jetton.deploy.ts | 8 +- sources/output/jetton_Foundation.abi | 1 + sources/output/jetton_Foundation.code.boc | Bin 0 -> 3554 bytes sources/output/jetton_Foundation.code.fc | 765 +++++ sources/output/jetton_Foundation.code.fif | 1531 ++++++++++ sources/output/jetton_Foundation.code.rev.fif | 2663 +++++++++++++++++ sources/output/jetton_Foundation.init.boc | Bin 0 -> 128 bytes sources/output/jetton_Foundation.init.fc | 78 + sources/output/jetton_Foundation.init.fif | 93 + sources/output/jetton_Foundation.init.rev.fif | 64 + sources/output/jetton_Foundation.md | 162 + sources/output/jetton_Foundation.pkg | 1 + sources/output/jetton_Foundation.ts | 1978 ++++++++++++ sources/utils/config.ts | 6 +- sources/utils/interactions.ts | 79 +- 18 files changed, 7589 insertions(+), 17 deletions(-) create mode 100644 sources/foundation.deploy.ts create mode 100644 sources/output/jetton_Foundation.abi create mode 100644 sources/output/jetton_Foundation.code.boc create mode 100644 sources/output/jetton_Foundation.code.fc create mode 100644 sources/output/jetton_Foundation.code.fif create mode 100644 sources/output/jetton_Foundation.code.rev.fif create mode 100644 sources/output/jetton_Foundation.init.boc create mode 100644 sources/output/jetton_Foundation.init.fc create mode 100644 sources/output/jetton_Foundation.init.fif create mode 100644 sources/output/jetton_Foundation.init.rev.fif create mode 100644 sources/output/jetton_Foundation.md create mode 100644 sources/output/jetton_Foundation.pkg create mode 100644 sources/output/jetton_Foundation.ts diff --git a/sources/cli.js b/sources/cli.js index 4e7ac4b..5fc5c73 100644 --- a/sources/cli.js +++ b/sources/cli.js @@ -1,9 +1,19 @@ const subcommand = require('subcommand'); -const { deployTONB, deposit, withdraw, transfer, blacklistAddress } = require('./utils/interactions'); -const { wallet_data, client } = require('./utils/config'); +const { deployTONB, deposit, withdraw, transfer, blacklistAddress, getTONBOpen, getFoundationOpen, changeTONBOwner, createBlacklistVote } = require('./utils/interactions'); +const { wallet_data, client, client4 } = require('./utils/config'); const { randomAddress, TON } = require('./utils/helpers'); const { toNano, Address } = require('ton'); +const { TONB } = require('./output/jetton_TONB'); +const { Foundation } = require('./output/jetton_Foundation'); + +const wal_opt = { + name: 'wallet', + abbr: 'w', + default: '0', + required: false +}; + const match = subcommand([ { @@ -22,7 +32,7 @@ const match = subcommand([ } ], async command(opts) { - let {my_wallet, secretKey} = await wallet_data(parseInt(opts._[1])); + let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1])); let tonb_addr = await deployTONB(undefined, true); await deposit(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr); } @@ -44,7 +54,7 @@ const match = subcommand([ } ], async command(opts) { - let {my_wallet, secretKey} = await wallet_data(parseInt(opts._[1])); + let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1])); let tonb_addr = await deployTONB(undefined, true); await withdraw(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr); } @@ -63,7 +73,7 @@ const match = subcommand([ default: randomAddress() }], async command(opts) { - let {my_wallet, secretKey} = await wallet_data(); + let { my_wallet, secretKey } = await wallet_data(); let tonb_addr = await deployTONB(undefined, true); await transfer(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr, opts._[1]); } @@ -82,7 +92,7 @@ const match = subcommand([ } ], async command(opts) { - let {my_wallet, secretKey} = await wallet_data(parseInt(opts._[1])); + let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1])); let tonb_addr = await deployTONB(undefined, true); if (!opts._[0]) { opts._[0] = 'kQD7zbEMaWC2yMgSJXmIF7HbLr1yuBo2GnZF_CJNkUiGSVZ8'// my_wallet.address; @@ -90,6 +100,110 @@ const match = subcommand([ let addr = Address.parse(opts._[0]); await blacklistAddress(my_wallet, secretKey, tonb_addr, addr); } + }, + { + name: 'change-tonb-owner', + options: [ + { + name: 'address', + }, + { + name: 'tonb', + required: false + }, wal_opt + ], + async command(opts) { + let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w)); + let tonb = await getTONBOpen(); + let addr = Address.parse(opts._[0]); + if (opts._[1]) { + let tonb_addr = Address.parse(opts._[1]); + tonb = client4.open(TONB.fromAddress(tonb_addr)); + } + await changeTONBOwner(my_wallet, secretKey, tonb.address, addr); + // await tonb.send(my_wallet, { value: toNano('0.1') }, { + // $$type: 'SetOwner', owner: addr }); + } + }, + { + name: 'create-blacklist-vote', + options: [ + { + name: 'address', + }, + { + name: 'foundation-address', + required: false + }, + wal_opt + ], + async command(opts) { + let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w)); + let foundation = await getFoundationOpen((await getTONBOpen()).address); + if (opts._[1]) { + let foundation_addr = Address.parse(opts._[1]); + foundation = client.open(Foundation.fromAddress(foundation_addr)); + } + let addr = Address.parse(opts._[0]); + let adminIndex = BigInt(parseInt(opts.w)); + // let msg = { + // $$type: 'InitiateBlacklistVote', wallet: addr, + // vote_time: 10n, quorum_percent: 50n, adminIndex // An admin has to create the vote + // }; + // await foundation.send(my_wallet, { value: toNano('1.1') }, msg); + await createBlacklistVote(my_wallet, secretKey, foundation.address, + addr, 10n, adminIndex); + } + }, + { + name: 'get-vote', + options: [ + { + name: 'vote-id' + }, + { + name: 'foundation-address', + required: false + } + ], + async command(opts) { + let foundation = await getFoundationOpen((await getTONBOpen()).address); + if (opts._[1]) { + let foundation_addr = Address.parse(opts._[1]); + foundation = client4.open(Foundation.fromAddress(foundation_addr)); + } + let vote = await foundation.getNthVote(opts._[0]); + console.log(vote); + } + }, + { + name: 'vote', + options: [ + { + name: 'vote-id' + }, + { + name: 'vote', + abbr: 'v', + help: 'Vote for or against the proposal (1 - for, 2 - against)', + }, + { + name: 'foundation-address', + required: false + }, + wal_opt + ], + async command(opts) { + let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w)); + let foundation = await getFoundationOpen((await getTONBOpen()).address); + if (opts._[2]) { + let foundation_addr = Address.parse(opts._[2]); + foundation = client.open(Foundation.fromAddress(foundation_addr)); + } + await foundation.send(my_wallet, { value: toNano('0.1') }, { + $$type: 'VoteMsg', voteId: opts._[0], vote: opts._[1], adminIndex: BigInt(parseInt(opts.w)) + }); + } } ]); const argv = process.argv.slice(2); diff --git a/sources/foundation.deploy.ts b/sources/foundation.deploy.ts new file mode 100644 index 0000000..ebd29c8 --- /dev/null +++ b/sources/foundation.deploy.ts @@ -0,0 +1,49 @@ +import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano, Cell} from "ton"; +import {mnemonicToPrivateKey} from "ton-crypto"; +import {buildOnchainMetadata} from "./utils/helpers"; +import {Foundation} from "./output/jetton_Foundation"; +import {client, wallet_data, workchain} from "./utils/config"; +import { createDistribution, createAddressList, getTONBState } from './utils/interactions'; + + +(async () => { + + //create client for testnet sandboxv4 API - alternative endpoint + const client4 = new TonClient4({ + endpoint: "https://sandbox-v4.tonhubapi.com" + }) + let {my_wallet, secretKey} = await wallet_data(); + + // Get deployment wallet balance + let balance: bigint = await my_wallet.getBalance(); + // Compute init data for deployment + let init = await Foundation.init( + createDistribution([my_wallet.address], [100n]), + createAddressList([my_wallet.address]), + contractAddress(workchain, await getTONBState())); + let destination_address = contractAddress(workchain, init); + + + let deployAmount = toNano('0.2'); + + + // send a message on new address contract to deploy it + let seqno: number = await my_wallet.getSeqno(); + + + console.log('🛠️Preparing new outgoing massage from deployment wallet. Seqno = ', seqno); + console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON'); + await my_wallet.sendTransfer({ + seqno, + secretKey, + messages: [internal({ + value: deployAmount, + to: destination_address, + init: { + code : init.code, + data : init.data + } + })] + }); + console.log('======deployment message sent to ', destination_address, ' ======'); +})(); diff --git a/sources/foundation.tact b/sources/foundation.tact index 8f024c7..3d33bd2 100644 --- a/sources/foundation.tact +++ b/sources/foundation.tact @@ -243,6 +243,8 @@ contract Foundation { }); } + receive() {} + get fun numVotes(): Int { return self.n_votes; } diff --git a/sources/jetton.deploy.ts b/sources/jetton.deploy.ts index 7e6d8a0..1260edf 100644 --- a/sources/jetton.deploy.ts +++ b/sources/jetton.deploy.ts @@ -3,9 +3,10 @@ import {mnemonicToPrivateKey} from "ton-crypto"; import {buildOnchainMetadata} from "./utils/helpers"; import {TONB} from "./output/jetton_TONB"; import {client, wallet_data, workchain, owner, jettonParams, default_content} from "./utils/config"; +import { getTONBState } from "./utils/interactions"; -(async () => { //need changes for jetton +(async () => { //create client for testnet sandboxv4 API - alternative endpoint const client4 = new TonClient4({ @@ -16,13 +17,11 @@ import {client, wallet_data, workchain, owner, jettonParams, default_content} fr // Get deployment wallet balance let balance: bigint = await my_wallet.getBalance(); // Compute init data for deployment - let init = await TONB.init(owner, default_content); + let init = await getTONBState(); let destination_address = contractAddress(workchain, init); let deployAmount = toNano('0.2'); - let supply = 500; - let amount = BigInt(supply * Math.pow(10, 9)); // send a message on new address contract to deploy it @@ -31,7 +30,6 @@ import {client, wallet_data, workchain, owner, jettonParams, default_content} fr console.log('🛠️Preparing new outgoing massage from deployment wallet. Seqno = ', seqno); console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON'); - console.log('Totally supply for deployed Token = ', supply, ', amount = ', amount.toString()); await my_wallet.sendTransfer({ seqno, secretKey, diff --git a/sources/output/jetton_Foundation.abi b/sources/output/jetton_Foundation.abi new file mode 100644 index 0000000..fc01e74 --- /dev/null +++ b/sources/output/jetton_Foundation.abi @@ -0,0 +1 @@ +{"name":"Foundation","types":[{"name":"StateInit","header":null,"fields":[{"name":"code","type":{"kind":"simple","type":"cell","optional":false}},{"name":"data","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"Context","header":null,"fields":[{"name":"bounced","type":{"kind":"simple","type":"bool","optional":false}},{"name":"sender","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"raw","type":{"kind":"simple","type":"slice","optional":false}}]},{"name":"SendParameters","header":null,"fields":[{"name":"bounce","type":{"kind":"simple","type":"bool","optional":false}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"value","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mode","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}},{"name":"code","type":{"kind":"simple","type":"cell","optional":true}},{"name":"data","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"TokenTransfer","header":260734629,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"destination","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseDestination","type":{"kind":"simple","type":"address","optional":true}},{"name":"customPayload","type":{"kind":"simple","type":"cell","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenTransferInternal","header":395134233,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}},{"name":"forwardTonAmount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}},{"name":"setLinker","type":{"kind":"simple","type":"int","optional":true,"format":257}},{"name":"setLinkerAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenNotification","header":1935855772,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"from","type":{"kind":"simple","type":"address","optional":false}},{"name":"forwardPayload","type":{"kind":"simple","type":"slice","optional":false,"format":"remainder"}}]},{"name":"TokenBurn","header":1499400124,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenBurnNotification","header":2078119902,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"TokenExcesses","header":3576854235,"fields":[{"name":"queryId","type":{"kind":"simple","type":"uint","optional":false,"format":64}}]},{"name":"TokenUpdateContent","header":201882270,"fields":[{"name":"content","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"StakingWithdraw","header":3665837821,"fields":[{"name":"value","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}}]},{"name":"JettonData","header":null,"fields":[{"name":"totalSupply","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"mintable","type":{"kind":"simple","type":"bool","optional":false}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"content","type":{"kind":"simple","type":"cell","optional":true}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"JettonWalletData","header":null,"fields":[{"name":"balance","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"master","type":{"kind":"simple","type":"address","optional":false}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"SetLinkerNeighbor","header":3019699393,"fields":[{"name":"neighbor","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"InitLinker","header":1740669268,"fields":[{"name":"neighbor","type":{"kind":"simple","type":"address","optional":true}},{"name":"walletAmount","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"walletCode","type":{"kind":"simple","type":"cell","optional":false}},{"name":"walletData","type":{"kind":"simple","type":"cell","optional":false}},{"name":"walletAddress","type":{"kind":"simple","type":"address","optional":false}},{"name":"responseAddress","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"ForwardToWallet","header":1562223291,"fields":[{"name":"body","type":{"kind":"simple","type":"cell","optional":false}}]},{"name":"BlacklistWallet","header":43811734,"fields":[{"name":"wallet","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"InitiateBlacklistVote","header":3909090059,"fields":[{"name":"adminIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"wallet","type":{"kind":"simple","type":"address","optional":false}},{"name":"quorum_percent","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"vote_time","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"InitiateLiquidationVote","header":301696559,"fields":[{"name":"adminIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"quorum_percent","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"vote_time","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"FinishVote","header":710362179,"fields":[{"name":"voteId","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"VoteMsg","header":1493035179,"fields":[{"name":"voteId","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"adminIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"vote","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"AddressList","header":null,"fields":[{"name":"addresses","type":{"kind":"dict","key":"int","value":"address"}},{"name":"length","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"Distribution","header":null,"fields":[{"name":"addresses","type":{"kind":"simple","type":"AddressList","optional":false}},{"name":"percents","type":{"kind":"dict","key":"int","value":"int"}}]},{"name":"InitiateDistributionVote","header":2512227654,"fields":[{"name":"adminIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"quorum_percent","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"vote_time","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"distribution","type":{"kind":"simple","type":"Distribution","optional":false}}]},{"name":"SetStakingPool","header":124047688,"fields":[{"name":"staking_pool","type":{"kind":"simple","type":"address","optional":true}}]},{"name":"RequestLinker","header":1512653598,"fields":[{"name":"client","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"Unstake","header":3125946401,"fields":[{"name":"amount","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"RequestUnstake","header":3922648959,"fields":[{"name":"founderIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"CollectProfit","header":1368467253,"fields":[{"name":"adminIndex","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"SetOwner","header":3072093686,"fields":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"WithdrawalRequests","header":null,"fields":[{"name":"addresses","type":{"kind":"dict","key":"int","value":"address"}},{"name":"amounts","type":{"kind":"dict","key":"int","value":"int"}},{"name":"n_requests","type":{"kind":"simple","type":"int","optional":false,"format":257}}]},{"name":"Proposal","header":null,"fields":[{"name":"type","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"blacklistAddress","type":{"kind":"simple","type":"address","optional":true}},{"name":"distribution_addresses","type":{"kind":"dict","key":"int","value":"address"}},{"name":"distribution_addresses_length","type":{"kind":"simple","type":"int","optional":true,"format":257}},{"name":"distribution_percents","type":{"kind":"dict","key":"int","value":"int"}}]},{"name":"Vote","header":null,"fields":[{"name":"id","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"votes","type":{"kind":"dict","key":"int","value":"int"}},{"name":"vote_end","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"quorum_percent","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"ended","type":{"kind":"simple","type":"bool","optional":false}},{"name":"result","type":{"kind":"simple","type":"bool","optional":true}}]},{"name":"ChangeOwner","header":256331011,"fields":[{"name":"newOwner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"Deposit","header":569292295,"fields":[{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}}]},{"name":"Withdraw","header":1616450832,"fields":[{"name":"amount","type":{"kind":"simple","type":"int","optional":false,"format":257}}]}],"receivers":[{"receiver":"internal","message":{"kind":"typed","type":"FinishVote"}},{"receiver":"internal","message":{"kind":"typed","type":"VoteMsg"}},{"receiver":"internal","message":{"kind":"typed","type":"InitiateBlacklistVote"}},{"receiver":"internal","message":{"kind":"typed","type":"InitiateDistributionVote"}},{"receiver":"internal","message":{"kind":"typed","type":"InitiateLiquidationVote"}},{"receiver":"internal","message":{"kind":"typed","type":"Unstake"}},{"receiver":"internal","message":{"kind":"typed","type":"RequestUnstake"}},{"receiver":"internal","message":{"kind":"typed","type":"CollectProfit"}},{"receiver":"internal","message":{"kind":"empty"}}],"getters":[{"name":"numVotes","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"nthVote","arguments":[{"name":"n","type":{"kind":"simple","type":"int","optional":false,"format":257}}],"returnType":{"kind":"simple","type":"Vote","optional":true}},{"name":"AdminList","arguments":[],"returnType":{"kind":"simple","type":"AddressList","optional":false}},{"name":"AdminPercents","arguments":[],"returnType":{"kind":"dict","key":"int","value":"int"}}],"errors":{"2":{"message":"Stack undeflow"},"3":{"message":"Stack overflow"},"4":{"message":"Integer overflow"},"5":{"message":"Integer out of expected range"},"6":{"message":"Invalid opcode"},"7":{"message":"Type check error"},"8":{"message":"Cell overflow"},"9":{"message":"Cell underflow"},"10":{"message":"Dictionary error"},"13":{"message":"Out of gas error"},"32":{"message":"Method ID not found"},"34":{"message":"Action is invalid or not supported"},"37":{"message":"Not enough TON"},"38":{"message":"Not enough extra-currencies"},"128":{"message":"Null reference exception"},"129":{"message":"Invalid serialization prefix"},"130":{"message":"Invalid incoming message"},"131":{"message":"Constraints error"},"132":{"message":"Access denied"},"133":{"message":"Contract stopped"},"134":{"message":"Invalid argument"},"135":{"message":"Code of a contract was not found"},"136":{"message":"Invalid address"},"4429":{"message":"Invalid sender"},"6384":{"message":"not enough money for withdraw"},"6873":{"message":"Only an admin can initiate a vote"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"18474":{"message":"only the owner can set a new owner"},"19362":{"message":"Invalid quorum percent"},"29720":{"message":"Invalid vote"},"29821":{"message":"Voting requires at least 1 ton for the fees"},"30386":{"message":"Vote already ended"},"32366":{"message":"not enough money for deposit"},"34326":{"message":"Vote is not finished yet"},"37444":{"message":"Only a founder can request unstake"},"41207":{"message":"invalid sender"},"42983":{"message":"No profit to collect"},"44816":{"message":"Wallet is blacklisted"},"46931":{"message":"Invalid vote id"},"49606":{"message":"Invalid admin index"},"53981":{"message":"Only an admin can collect profit"},"56549":{"message":"Only an admin can vote"},"61070":{"message":"Invalid vote time"},"61265":{"message":"Only the owner can trigger un-staking"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_Foundation.code.boc b/sources/output/jetton_Foundation.code.boc new file mode 100644 index 0000000000000000000000000000000000000000..02fe51f70ef6b4917982de44b35b7ba65aa5ea24 GIT binary patch literal 3554 zcmb_eZA?^G8b0UVJLB*%aF`iJmO66h15j7%#ThKI6TJ%9))u`2gCJSiwC>t83|x(A zyPGu3j19In9c2`1jaF<(YtuBTrM89IW`K;AoO9miydTeb&U@zkFDLh5DhDI&HG~agNNUnc7owp!OyQ>~nxcA05`|et1t0Yy z_{7FxZ%h7_{sJwZR=b*ioDh?!IJq^u$a6@30hN~Y>c$5(ybKb{-j+Hq?4+3lY^n;G-nGlhMh zJa%c#s&&!9L8J9JUnG2pr(>G#YbW|i ze9w_YyfnLl7D_5qUX1ZbeAsD1nhJHLg*hGeCbVuPci!`=KP$aEVyr!$68Cy7ihu3S zYX?bUAJ!ePznIyfF&rAi4DlAWT1*2eNeuCI{+j<6Wpwbdv9HHRFMsgA=d$~CdP6dW zOV>U^g}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NN!An^%oP(V!1m;Q3QJ4!nQBX)o%cE>82@_npl1lhZt#J5{=NN`VEegiZTC1AVtD4XGpOSSSf)yEoY*o#t-_2bqY3ez LB_oV}Lte^nw4x>O literal 0 HcmV?d00001 diff --git a/sources/output/jetton_Foundation.code.fc b/sources/output/jetton_Foundation.code.fc new file mode 100644 index 0000000..cc1d218 --- /dev/null +++ b/sources/output/jetton_Foundation.code.fc @@ -0,0 +1,765 @@ +#pragma version =0.4.1; +#pragma allow-post-modification; +#pragma compute-asm-ltr; + +forall X -> X __tact_not_null(X x) inline { throw_if(128, null?(x)); return x; } + +(cell, int) __tact_dict_delete(cell dict, int key_len, slice index) asm(index dict key_len) "DICTDEL"; + +(slice, int) __tact_dict_get(cell dict, int key_len, slice index) asm(index dict key_len) "DICTGET" "NULLSWAPIFNOT"; + +global (int, slice, int, slice) __tact_context; +global cell __tact_context_sys; + +(int, slice, int, slice) __tact_context_get() inline { return __tact_context; } + +() __tact_verify_address(slice address) inline { + throw_unless(136, address.slice_bits() != 267); +} + +builder __tact_store_bool(builder b, int v) inline { + b = b.store_int(v, 1); + return b; +} + +(slice, slice) __tact_load_address(slice cs) inline { + slice raw = cs~load_msg_addr(); + __tact_verify_address(raw); + return (cs, raw); +} + +(slice, slice) __tact_load_address_opt(slice cs) inline { + slice raw = cs~load_msg_addr(); + if (raw.preload_uint(2) != 0) { + __tact_verify_address(raw); + return (cs, raw); + } else { + return (cs, null()); + } +} + +builder __tact_store_address(builder b, slice address) inline { + __tact_verify_address(address); + b = b.store_slice(address); + return b; +} + +builder __tact_store_address_opt(builder b, slice address) inline { + if (null?(address)) { + b = b.store_uint(0, 2); + return b; + } else { + return __tact_store_address(b, address); + } +} + +(cell, ()) __tact_dict_set_int_int(cell d, int kl, int k, int v, int vl) inline { + if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); + } else { + return (idict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + } +} + +int __tact_dict_get_int_int(cell d, int kl, int k, int vl) inline { + var (r, ok) = idict_get?(d, kl, k); + if (ok) { + return r~load_int(vl); + } else { + return null(); + } +} + +(cell, ()) __tact_dict_set_int_cell(cell d, int kl, int k, cell v) inline { + if (null?(v)) { + var (r, ok) = idict_delete?(d, kl, k); + return (r, ()); + } else { + return (idict_set_ref(d, kl, k, v), ()); + } +} + +cell __tact_dict_get_int_cell(cell d, int kl, int k) { + var (r, ok) = idict_get_ref?(d, kl, k); + if (ok) { + return r; + } else { + return null(); + } +} + +slice __tact_dict_get_int_slice(cell d, int kl, int k) inline { + var (r, ok) = idict_get?(d, kl, k); + if (ok) { + return r; + } else { + return null(); + } +} + +(cell, ()) __tact_dict_set_slice_int(cell d, int kl, slice k, int v, int vl) { + if (null?(v)) { + var (r, ok) = __tact_dict_delete(d, kl, k); + return (r, ()); + } else { + return (dict_set_builder(d, kl, k, begin_cell().store_int(v, vl)), ()); + } +} + +int __tact_dict_get_slice_int(cell d, int kl, slice k, int vl) inline { + var (r, ok) = __tact_dict_get(d, kl, k); + if (ok) { + return r~load_int(vl); + } else { + return null(); + } +} + +int __tact_address_eq(slice a, slice b) inline { + return equal_slice_bits(a, b); +} + +forall X0, X1, X2, X3, X4 -> tuple __tact_tuple_create_5((X0, X1, X2, X3, X4) v) asm "5 TUPLE"; + +forall X0, X1, X2, X3, X4 -> (X0, X1, X2, X3, X4) __tact_tuple_destroy_5(tuple v) asm "5 UNTUPLE"; + +forall X0, X1, X2, X3, X4, X5 -> tuple __tact_tuple_create_6((X0, X1, X2, X3, X4, X5) v) asm "6 TUPLE"; + +forall X0, X1, X2, X3, X4, X5 -> (X0, X1, X2, X3, X4, X5) __tact_tuple_destroy_6(tuple v) asm "6 UNTUPLE"; + +builder __gen_write_BlacklistWallet(builder build_0, (slice) v) inline { + var (v'wallet) = v; + build_0 = store_uint(build_0, 43811734, 32); + build_0 = __tact_store_address(build_0, v'wallet); + return build_0; +} + +cell __gen_writecell_BlacklistWallet((slice) v) inline_ref { + return __gen_write_BlacklistWallet(begin_cell(), v).end_cell(); +} + +(slice, ((int, slice, int, int))) __gen_read_InitiateBlacklistVote(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 3909090059); + var v'adminIndex = sc_0~load_int(257); + var v'wallet = sc_0~__tact_load_address(); + var v'quorum_percent = sc_0~load_int(257); + slice sc_1 = sc_0~load_ref().begin_parse(); + var v'vote_time = sc_1~load_int(257); + return (sc_0, (v'adminIndex, v'wallet, v'quorum_percent, v'vote_time)); +} + +(slice, ((int, int, int))) __gen_read_InitiateLiquidationVote(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 301696559); + var v'adminIndex = sc_0~load_int(257); + var v'quorum_percent = sc_0~load_int(257); + var v'vote_time = sc_0~load_int(257); + return (sc_0, (v'adminIndex, v'quorum_percent, v'vote_time)); +} + +(slice, ((int))) __gen_read_FinishVote(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 710362179); + var v'voteId = sc_0~load_int(257); + return (sc_0, (v'voteId)); +} + +(slice, ((int, int, int))) __gen_read_VoteMsg(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 1493035179); + var v'voteId = sc_0~load_int(257); + var v'adminIndex = sc_0~load_int(257); + var v'vote = sc_0~load_int(257); + return (sc_0, (v'voteId, v'adminIndex, v'vote)); +} + +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; +} + +(slice, ((cell, int))) __gen_read_AddressList(slice sc_0) inline { + var v'addresses = sc_0~load_dict(); + var v'length = sc_0~load_int(257); + return (sc_0, (v'addresses, v'length)); +} + +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; +} + +(slice, (((cell, int), cell))) __gen_read_Distribution(slice sc_0) inline { + var v'addresses = sc_0~__gen_read_AddressList(); + var v'percents = sc_0~load_dict(); + return (sc_0, (v'addresses, v'percents)); +} + +(slice, ((int, int, int, ((cell, int), cell)))) __gen_read_InitiateDistributionVote(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 2512227654); + var v'adminIndex = sc_0~load_int(257); + var v'quorum_percent = sc_0~load_int(257); + var v'vote_time = sc_0~load_int(257); + slice sc_1 = sc_0~load_ref().begin_parse(); + var v'distribution = sc_1~__gen_read_Distribution(); + return (sc_0, (v'adminIndex, v'quorum_percent, v'vote_time, v'distribution)); +} + +builder __gen_write_Unstake(builder build_0, (int) v) inline { + var (v'amount) = v; + build_0 = store_uint(build_0, 3125946401, 32); + build_0 = build_0.store_int(v'amount, 257); + return build_0; +} + +cell __gen_writecell_Unstake((int) v) inline_ref { + return __gen_write_Unstake(begin_cell(), v).end_cell(); +} + +(slice, ((int))) __gen_read_Unstake(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 3125946401); + var v'amount = sc_0~load_int(257); + return (sc_0, (v'amount)); +} + +(slice, ((int))) __gen_read_RequestUnstake(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 3922648959); + var v'founderIndex = sc_0~load_int(257); + return (sc_0, (v'founderIndex)); +} + +(slice, ((int))) __gen_read_CollectProfit(slice sc_0) inline { + throw_unless(129, sc_0~load_uint(32) == 1368467253); + var v'adminIndex = sc_0~load_int(257); + return (sc_0, (v'adminIndex)); +} + +builder __gen_write_Proposal(builder build_0, (int, slice, cell, int, cell) v) inline { + var (v'type, v'blacklistAddress, v'distribution_addresses, v'distribution_addresses_length, v'distribution_percents) = v; + build_0 = build_0.store_int(v'type, 257); + build_0 = __tact_store_address_opt(build_0, v'blacklistAddress); + build_0 = build_0.store_dict(v'distribution_addresses); + build_0 = ~ null?(v'distribution_addresses_length) ? build_0.store_int(true, 1).store_int(v'distribution_addresses_length, 257) : build_0.store_int(false, 1); + build_0 = build_0.store_dict(v'distribution_percents); + return build_0; +} + +cell __gen_writecell_Proposal((int, slice, cell, int, cell) v) inline_ref { + return __gen_write_Proposal(begin_cell(), v).end_cell(); +} + +(slice, ((int, slice, cell, int, cell))) __gen_read_Proposal(slice sc_0) inline { + var v'type = sc_0~load_int(257); + var v'blacklistAddress = sc_0~__tact_load_address_opt(); + var v'distribution_addresses = sc_0~load_dict(); + var v'distribution_addresses_length = sc_0~load_int(1) ? sc_0~load_int(257) : null(); + var v'distribution_percents = sc_0~load_dict(); + return (sc_0, (v'type, v'blacklistAddress, v'distribution_addresses, v'distribution_addresses_length, v'distribution_percents)); +} + +tuple __gen_Proposal_as_optional(((int, slice, cell, int, cell)) v) inline { + var (v'type, v'blacklistAddress, v'distribution_addresses, v'distribution_addresses_length, v'distribution_percents) = v; + return __tact_tuple_create_5(v'type, v'blacklistAddress, v'distribution_addresses, v'distribution_addresses_length, v'distribution_percents); +} + +tuple __gen_readopt_Proposal(cell cl) inline_ref { + if (null?(cl)) { + return null(); + } + var sc = cl.begin_parse(); + return __gen_Proposal_as_optional(sc~__gen_read_Proposal()); +} + +builder __gen_write_Vote(builder build_0, (int, cell, int, int, int, int) v) inline_ref { + var (v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result) = v; + build_0 = build_0.store_int(v'id, 257); + build_0 = build_0.store_dict(v'votes); + build_0 = build_0.store_int(v'vote_end, 257); + build_0 = build_0.store_int(v'quorum_percent, 257); + build_0 = build_0.store_int(v'ended, 1); + build_0 = ~ null?(v'result) ? build_0.store_int(true, 1).store_int(v'result, 1) : build_0.store_int(false, 1); + return build_0; +} + +cell __gen_writecell_Vote((int, cell, int, int, int, int) v) inline_ref { + return __gen_write_Vote(begin_cell(), v).end_cell(); +} + +(slice, ((int, cell, int, int, int, int))) __gen_read_Vote(slice sc_0) inline_ref { + var v'id = sc_0~load_int(257); + var v'votes = sc_0~load_dict(); + var v'vote_end = sc_0~load_int(257); + var v'quorum_percent = sc_0~load_int(257); + var v'ended = sc_0~load_int(1); + var v'result = sc_0~load_int(1) ? sc_0~load_int(1) : null(); + return (sc_0, (v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result)); +} + +tuple __gen_Vote_as_optional(((int, cell, int, int, int, int)) v) inline { + var (v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result) = v; + return __tact_tuple_create_6(v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result); +} + +tuple __gen_readopt_Vote(cell cl) inline_ref { + if (null?(cl)) { + return null(); + } + var sc = cl.begin_parse(); + return __gen_Vote_as_optional(sc~__gen_read_Vote()); +} + +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; +} + +(slice, (((cell, int), ((cell, int), cell), slice, cell, cell, cell, int))) __gen_read_Foundation(slice sc_0) inline { + var v'founders = sc_0~__gen_read_AddressList(); + slice sc_1 = sc_0~load_ref().begin_parse(); + var v'admins = sc_1~__gen_read_Distribution(); + var v'tonb = sc_1~__tact_load_address(); + var v'votes = sc_1~load_dict(); + slice sc_2 = sc_1~load_ref().begin_parse(); + var v'profits = sc_2~load_dict(); + var v'proposals = sc_2~load_dict(); + var v'n_votes = sc_2~load_int(257); + return (sc_0, (v'founders, v'admins, v'tonb, v'votes, v'profits, v'proposals, v'n_votes)); +} + +(cell, int) __gen_AddressList_to_external(((cell, int)) v) inline { + var (v'addresses, v'length) = v; + return (v'addresses, v'length); +} + +((int, slice, cell, int, cell)) __gen_Proposal_not_null(tuple v) inline { + throw_if(128, null?(v)); + var (int vvv'type, slice vvv'blacklistAddress, cell vvv'distribution_addresses, int vvv'distribution_addresses_length, cell vvv'distribution_percents) = __tact_tuple_destroy_5(v); + return (vvv'type, vvv'blacklistAddress, vvv'distribution_addresses, vvv'distribution_addresses_length, vvv'distribution_percents); +} + +((int, cell, int, int, int, int)) __gen_Vote_not_null(tuple v) inline { + throw_if(128, null?(v)); + var (int vvv'id, cell vvv'votes, int vvv'vote_end, int vvv'quorum_percent, int vvv'ended, int vvv'result) = __tact_tuple_destroy_6(v); + return (vvv'id, vvv'votes, vvv'vote_end, vvv'quorum_percent, vvv'ended, vvv'result); +} + +tuple __gen_Vote_to_tuple(((int, cell, int, int, int, int)) v) inline { + var (v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result) = v; + return __tact_tuple_create_6(v'id, v'votes, v'vote_end, v'quorum_percent, v'ended, v'result); +} + +tuple __gen_Vote_opt_to_tuple(tuple v) inline { + if (null?(v)) { return null(); } + return __gen_Vote_to_tuple(__gen_Vote_not_null(v)); +} + +tuple __gen_Vote_opt_to_external(tuple v) inline { + var loaded = __gen_Vote_opt_to_tuple(v); + if (null?(loaded)) { + return null(); + } else { + return (loaded); + } +} + +((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) __gen_load_Foundation() inline { + slice sc = get_data().begin_parse(); + __tact_context_sys = sc~load_ref(); + return sc~__gen_read_Foundation(); +} + +() __gen_store_Foundation(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) v) impure inline { + builder b = begin_cell(); + b = b.store_ref(__tact_context_sys); + b = __gen_write_Foundation(b, v); + set_data(b.end_cell()); +} + +() $send((int, slice, int, int, cell, cell, cell) $params) impure inline_ref { + var (($params'bounce, $params'to, $params'value, $params'mode, $params'body, $params'code, $params'data)) = $params; + builder $b = begin_cell(); + $b = store_int($b, 1, 2); + $b = __tact_store_bool($b, $params'bounce); + $b = store_int($b, 0, 3); + $b = __tact_store_address($b, $params'to); + $b = store_coins($b, $params'value); + $b = store_int($b, 0, ((((1 + 4) + 4) + 64) + 32)); + if (((~ null?($params'code)) | (~ null?($params'data)))) { + $b = __tact_store_bool($b, true); + builder $bc = begin_cell(); + $bc = __tact_store_bool($bc, false); + $bc = __tact_store_bool($bc, false); + if ((~ null?($params'code))) { + $bc = __tact_store_bool($bc, true); + $bc = store_ref($bc, __tact_not_null($params'code)); + } else { + $bc = __tact_store_bool($bc, false); + } + if ((~ null?($params'data))) { + $bc = __tact_store_bool($bc, true); + $bc = store_ref($bc, __tact_not_null($params'data)); + } else { + $bc = __tact_store_bool($bc, false); + } + $bc = __tact_store_bool($bc, false); + $b = __tact_store_bool($b, true); + $b = store_ref($b, end_cell($bc)); + } else { + $b = __tact_store_bool($b, false); + } + cell $body = $params'body; + if ((~ null?($body))) { + $b = __tact_store_bool($b, true); + $b = store_ref($b, __tact_not_null($body)); + } else { + $b = __tact_store_bool($b, false); + } + cell $c = end_cell($b); + send_raw_message($c, $params'mode); +} + +int $__gen_Foundation_numVotes(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self) impure inline_ref { + 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)) = $self; + return $self'n_votes; +} + +_ $__gen_get_numVotes() method_id(70748) { + var self = __gen_load_Foundation(); + var res = $__gen_Foundation_numVotes(self); + return res; +} + +tuple $__gen_Foundation_nthVote(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, int $n) impure inline_ref { + 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)) = $self; + return __gen_readopt_Vote(__tact_dict_get_int_cell($self'votes, 257, $n)); +} + +_ $__gen_get_nthVote(int $$n) method_id(115768) { + int $n = $$n; + var self = __gen_load_Foundation(); + var res = $__gen_Foundation_nthVote(self, $n); + return __gen_Vote_opt_to_external(res); +} + +(cell, int) $__gen_Foundation_AdminList(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self) impure inline_ref { + 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)) = $self; + return ($self'admins'addresses'addresses, $self'admins'addresses'length); +} + +_ $__gen_get_AdminList() method_id(125436) { + var self = __gen_load_Foundation(); + var res = $__gen_Foundation_AdminList(self); + return __gen_AddressList_to_external(res); +} + +cell $__gen_Foundation_AdminPercents(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self) impure inline_ref { + 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)) = $self; + return $self'admins'percents; +} + +_ $__gen_get_AdminPercents() method_id(87676) { + var self = __gen_load_Foundation(); + var res = $__gen_Foundation_AdminPercents(self); + return res; +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_FinishVote(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int) $msg) impure inline { + 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) = $self; + var ($msg'voteId) = $msg; + throw_unless(46931, ($msg'voteId < $self'n_votes)); + var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = __gen_Vote_not_null(__gen_readopt_Vote(__tact_dict_get_int_cell($self'votes, 257, $msg'voteId))); + throw_unless(30386, ($vote'ended == false)); + throw_unless(34326, ($vote'vote_end >= now())); + int $n_yes = 0; + int $n_no = 0; + int $n_abstain = 0; + int $i = 0; + while (($i < $self'admins'addresses'length)) { + int $vote_i = __tact_not_null(__tact_dict_get_int_int($vote'votes, 257, $i, 257)); + if (($vote_i == 1)) { + $n_yes = ($n_yes + __tact_not_null(__tact_dict_get_int_int($self'admins'percents, 257, $i, 257))); + } elseif (($vote_i == 2)) { + $n_no = ($n_no + __tact_not_null(__tact_dict_get_int_int($self'admins'percents, 257, $i, 257))); + } elseif (($vote_i == 0)) { + $n_abstain = ($n_abstain + __tact_not_null(__tact_dict_get_int_int($self'admins'percents, 257, $i, 257))); + } + $i = ($i + 1); + } + int $n_total = (($n_yes + $n_no) + $n_abstain); + int $present = $n_total; + if (($present < $vote'quorum_percent)) { + $vote'result = false; + } elseif (($n_yes > $n_no)) { + $vote'result = true; + } else { + $vote'result = false; + } + $vote'ended = true; + $self'votes~__tact_dict_set_int_cell(257, $msg'voteId, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result))); + if (($vote'result == true)) { + var ($prop'type, $prop'blacklistAddress, $prop'distribution_addresses, $prop'distribution_addresses_length, $prop'distribution_percents) = __gen_Proposal_not_null(__gen_readopt_Proposal(__tact_dict_get_int_cell($self'proposals, 257, $msg'voteId))); + if (($prop'type == 0)) { + $send((true, $self'tonb, 0, 64, __gen_writecell_BlacklistWallet((__tact_not_null($prop'blacklistAddress))), null(), null())); + } + if (($prop'type == 1)) { + } + if (($prop'type == 2)) { + (($self'admins'addresses'addresses, $self'admins'addresses'length), $self'admins'percents) = (($prop'distribution_addresses, __tact_not_null($prop'distribution_addresses_length)), $prop'distribution_percents); + } + } + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_VoteMsg(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int, int, int) $msg) impure inline { + 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) = $self; + var ($msg'voteId, $msg'adminIndex, $msg'vote) = $msg; + throw_unless(49606, ($msg'adminIndex < $self'admins'addresses'length)); + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(56549, __tact_address_eq($ctx'sender, __tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $msg'adminIndex))); + throw_unless(46931, ($msg'voteId < $self'n_votes)); + var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = __gen_Vote_not_null(__gen_readopt_Vote(__tact_dict_get_int_cell($self'votes, 257, $msg'voteId))); + throw_unless(30386, ($vote'ended == false)); + throw_unless(29720, (($msg'vote >= 0) & ($msg'vote <= 2))); + $vote'votes~__tact_dict_set_int_int(257, $msg'adminIndex, $msg'vote, 257); + $self'votes~__tact_dict_set_int_cell(257, $msg'voteId, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result))); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_InitiateBlacklistVote(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int, slice, int, int) $msg) impure inline { + 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) = $self; + var ($msg'adminIndex, $msg'wallet, $msg'quorum_percent, $msg'vote_time) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(6873, __tact_address_eq($ctx'sender, __tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $msg'adminIndex))); + throw_unless(29821, ($ctx'value >= 1000000000)); + throw_unless(19362, (($msg'quorum_percent > 20) & ($msg'quorum_percent <= 100))); + throw_unless(61070, (($msg'vote_time >= 0) & ($msg'vote_time < ((3 * 24) * 3600)))); + var ($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents) = (0, $msg'wallet, null(), null(), null()); + var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = ($self'n_votes, null(), (now() + $msg'vote_time), $msg'quorum_percent, false, null()); + int $i = 0; + while (($i < $self'admins'addresses'length)) { + $vote'votes~__tact_dict_set_int_int(257, $i, (- 1), 257); + $i = ($i + 1); + } + $self'votes~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result))); + $self'proposals~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Proposal(($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents))); + $self'n_votes = ($self'n_votes + 1); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_InitiateDistributionVote(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int, int, int, ((cell, int), cell)) $msg) impure inline { + 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) = $self; + var ($msg'adminIndex, $msg'quorum_percent, $msg'vote_time, (($msg'distribution'addresses'addresses, $msg'distribution'addresses'length), $msg'distribution'percents)) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(6873, __tact_address_eq($ctx'sender, __tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $msg'adminIndex))); + throw_unless(29821, ($ctx'value >= 1000000000)); + throw_unless(19362, (($msg'quorum_percent > 20) & ($msg'quorum_percent <= 100))); + throw_unless(61070, (($msg'vote_time >= 0) & ($msg'vote_time < ((3 * 24) * 3600)))); + var ($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents) = (2, null(), $msg'distribution'addresses'addresses, $msg'distribution'addresses'length, $msg'distribution'percents); + var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = ($self'n_votes, null(), (now() + $msg'vote_time), $msg'quorum_percent, false, null()); + int $i = 0; + while (($i < $self'admins'addresses'length)) { + $vote'votes~__tact_dict_set_int_int(257, $i, (- 1), 257); + $i = ($i + 1); + } + $self'votes~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result))); + $self'proposals~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Proposal(($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents))); + $self'n_votes = ($self'n_votes + 1); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_InitiateLiquidationVote(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int, int, int) $msg) impure inline { + 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) = $self; + var ($msg'adminIndex, $msg'quorum_percent, $msg'vote_time) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(6873, __tact_address_eq($ctx'sender, __tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $msg'adminIndex))); + throw_unless(29821, ($ctx'value >= 1000000000)); + throw_unless(19362, (($msg'quorum_percent > 85) & ($msg'quorum_percent <= 100))); + throw_unless(61070, (($msg'vote_time > 0) & ($msg'vote_time < ((3 * 24) * 3600)))); + var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = ($self'n_votes, null(), (now() + $msg'vote_time), $msg'quorum_percent, false, null()); + int $i = 0; + while (($i < $self'admins'addresses'length)) { + $vote'votes~__tact_dict_set_int_int(257, $i, (- 1), 257); + $i = ($i + 1); + } + var ($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents) = (1, null(), null(), null(), null()); + $self'votes~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result))); + $self'proposals~__tact_dict_set_int_cell(257, $self'n_votes, __gen_writecell_Proposal(($proposal'type, $proposal'blacklistAddress, $proposal'distribution_addresses, $proposal'distribution_addresses_length, $proposal'distribution_percents))); + $self'n_votes = ($self'n_votes + 1); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_Unstake(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int) $msg) impure inline { + 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) = $self; + var ($msg'amount) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + if (__tact_address_eq($ctx'sender, $self'tonb)) { + int $value = $ctx'value; + int $i = 0; + while (($i < $self'admins'addresses'length)) { + slice $addr = __tact_not_null(__tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $i)); + int $percent = __tact_not_null(__tact_dict_get_int_int($self'admins'percents, 257, $i, 257)); + int $amount = (($value * $percent) / 100); + int $current_profit = 0; + int $profit_record = __tact_dict_get_slice_int($self'profits, 267, $addr, 257); + if ((~ null?($profit_record))) { + $current_profit = __tact_not_null($profit_record); + } + $self'profits~__tact_dict_set_slice_int(267, $addr, ($current_profit + $amount), 257); + $i = ($i + 1); + } + } + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_RequestUnstake(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int) $msg) impure inline { + 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) = $self; + var ($msg'founderIndex) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(37444, __tact_address_eq(__tact_dict_get_int_slice($self'founders'addresses, 257, $msg'founderIndex), $ctx'sender)); + $send((true, $self'tonb, 0, 64, __gen_writecell_Unstake((0)), null(), null())); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive_CollectProfit(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self, (int) $msg) impure inline { + 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) = $self; + var ($msg'adminIndex) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(53981, __tact_address_eq(__tact_dict_get_int_slice($self'admins'addresses'addresses, 257, $msg'adminIndex), $ctx'sender)); + int $profit = __tact_dict_get_slice_int($self'profits, 267, $ctx'sender, 257); + throw_unless(42983, (~ null?($profit))); + int $amount = __tact_not_null($profit); + $self'profits~__tact_dict_set_slice_int(267, $ctx'sender, 0, 257); + $send((true, $ctx'sender, ($amount - 150000000), 64, null(), null(), null())); + return ((($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), ()); +} + +((((cell, int), ((cell, int), cell), slice, cell, cell, cell, int)), ()) $__gen_Foundation_receive(((cell, int), ((cell, int), cell), slice, cell, cell, cell, int) $self) impure inline { + 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) = $self; + return ((($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), ()); +} + + +() recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { + + ;; Parse incoming message + int op = 0; + if (slice_bits(in_msg) >= 32) { + op = in_msg.preload_uint(32); + } + var cs = in_msg_cell.begin_parse(); + var msg_flags = cs~load_uint(4); + var msg_bounced = ((msg_flags & 1) == 1 ? true : false); + slice msg_sender_addr = cs~load_msg_addr(); + __tact_context = (msg_bounced, msg_sender_addr, msg_value, cs); + + ;; Handle bounced messages + if (msg_bounced) { + return (); + } + + ;; Receive FinishVote message + if (op == 710362179) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_FinishVote(); + self~$__gen_Foundation_receive_FinishVote(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive VoteMsg message + if (op == 1493035179) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_VoteMsg(); + self~$__gen_Foundation_receive_VoteMsg(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive InitiateBlacklistVote message + if (op == 3909090059) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_InitiateBlacklistVote(); + self~$__gen_Foundation_receive_InitiateBlacklistVote(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive InitiateDistributionVote message + if (op == 2512227654) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_InitiateDistributionVote(); + self~$__gen_Foundation_receive_InitiateDistributionVote(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive InitiateLiquidationVote message + if (op == 301696559) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_InitiateLiquidationVote(); + self~$__gen_Foundation_receive_InitiateLiquidationVote(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive Unstake message + if (op == 3125946401) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_Unstake(); + self~$__gen_Foundation_receive_Unstake(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive RequestUnstake message + if (op == 3922648959) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_RequestUnstake(); + self~$__gen_Foundation_receive_RequestUnstake(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive CollectProfit message + if (op == 1368467253) { + var self = __gen_load_Foundation(); + var msg = in_msg~__gen_read_CollectProfit(); + self~$__gen_Foundation_receive_CollectProfit(msg); + __gen_store_Foundation(self); + return (); + } + + ;; Receive empty message + if ((op == 0) & (slice_bits(in_msg) <= 32)) { + var self = __gen_load_Foundation(); + self~$__gen_Foundation_receive(); + __gen_store_Foundation(self); + return (); + } + + throw(130); +} + +_ supported_interfaces() method_id { + return ( + "org.ton.introspection.v0"H >> 128, + "org.ton.abi.ipfs.v0"H >> 128 + ); +} + +_ get_abi_ipfs() { + return "ipfs://QmTpahMZ5QmQr9Tr28bzZjVXyrZDoiJu5wUsDtQignQvds"; +} \ No newline at end of file diff --git a/sources/output/jetton_Foundation.code.fif b/sources/output/jetton_Foundation.code.fif new file mode 100644 index 0000000..8f24492 --- /dev/null +++ b/sources/output/jetton_Foundation.code.fif @@ -0,0 +1,1531 @@ +PROGRAM{ + DECLPROC __tact_not_null + DECLPROC __tact_context_get + DECLPROC __tact_verify_address + DECLPROC __tact_store_bool + DECLPROC __tact_load_address + DECLPROC __tact_load_address_opt + DECLPROC __tact_store_address + DECLPROC __tact_store_address_opt + DECLPROC __tact_dict_set_int_int + DECLPROC __tact_dict_get_int_int + DECLPROC __tact_dict_set_int_cell + DECLPROC __tact_dict_get_int_cell + DECLPROC __tact_dict_get_int_slice + DECLPROC __tact_dict_set_slice_int + DECLPROC __tact_dict_get_slice_int + DECLPROC __tact_address_eq + DECLPROC __gen_write_BlacklistWallet + DECLPROC __gen_writecell_BlacklistWallet + DECLPROC __gen_read_InitiateBlacklistVote + DECLPROC __gen_read_InitiateLiquidationVote + DECLPROC __gen_read_FinishVote + DECLPROC __gen_read_VoteMsg + DECLPROC __gen_write_AddressList + DECLPROC __gen_read_AddressList + DECLPROC __gen_write_Distribution + DECLPROC __gen_read_Distribution + DECLPROC __gen_read_InitiateDistributionVote + DECLPROC __gen_write_Unstake + DECLPROC __gen_writecell_Unstake + DECLPROC __gen_read_Unstake + DECLPROC __gen_read_RequestUnstake + DECLPROC __gen_read_CollectProfit + DECLPROC __gen_write_Proposal + DECLPROC __gen_writecell_Proposal + DECLPROC __gen_read_Proposal + DECLPROC __gen_Proposal_as_optional + DECLPROC __gen_readopt_Proposal + DECLPROC __gen_write_Vote + DECLPROC __gen_writecell_Vote + DECLPROC __gen_read_Vote + DECLPROC __gen_Vote_as_optional + DECLPROC __gen_readopt_Vote + DECLPROC __gen_write_Foundation + DECLPROC __gen_read_Foundation + DECLPROC __gen_AddressList_to_external + DECLPROC __gen_Proposal_not_null + DECLPROC __gen_Vote_not_null + DECLPROC __gen_Vote_to_tuple + DECLPROC __gen_Vote_opt_to_tuple + DECLPROC __gen_Vote_opt_to_external + DECLPROC __gen_load_Foundation + DECLPROC __gen_store_Foundation + DECLPROC $send + DECLPROC $__gen_Foundation_numVotes + 70748 DECLMETHOD $__gen_get_numVotes + DECLPROC $__gen_Foundation_nthVote + 115768 DECLMETHOD $__gen_get_nthVote + DECLPROC $__gen_Foundation_AdminList + 125436 DECLMETHOD $__gen_get_AdminList + DECLPROC $__gen_Foundation_AdminPercents + 87676 DECLMETHOD $__gen_get_AdminPercents + DECLPROC $__gen_Foundation_receive_FinishVote + DECLPROC $__gen_Foundation_receive_VoteMsg + DECLPROC $__gen_Foundation_receive_InitiateBlacklistVote + DECLPROC $__gen_Foundation_receive_InitiateDistributionVote + DECLPROC $__gen_Foundation_receive_InitiateLiquidationVote + DECLPROC $__gen_Foundation_receive_Unstake + DECLPROC $__gen_Foundation_receive_RequestUnstake + DECLPROC $__gen_Foundation_receive_CollectProfit + DECLPROC $__gen_Foundation_receive + DECLPROC recv_internal + 113617 DECLMETHOD supported_interfaces + DECLPROC get_abi_ipfs + DECLGLOBVAR __tact_context + DECLGLOBVAR __tact_context_sys + __tact_not_null PROCINLINE:<{ + DUP + ISNULL + 128 THROWIF + }> + __tact_context_get PROCINLINE:<{ + __tact_context GETGLOB + 4 UNTUPLE + }> + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_bool PROCINLINE:<{ + SWAP + 1 STI + }> + __tact_load_address PROCINLINE:<{ + LDMSGADDR + SWAP + }> + __tact_load_address_opt PROCINLINE:<{ + LDMSGADDR + OVER + 2 PLDU + 0 NEQINT + IF:<{ + SWAP + }>ELSE<{ + NIP + PUSHNULL + }> + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __tact_store_address_opt PROCINLINE:<{ + DUP + ISNULL + IF:<{ + DROP + 0 PUSHINT + SWAP + 2 STU + }>ELSE<{ + __tact_store_address INLINECALLDICT + }> + }> + __tact_dict_set_int_int PROCINLINE:<{ + OVER + ISNULL + IF:<{ + 2DROP + -ROT + DICTIDEL + DROP + }>ELSE<{ + NEWC + SWAP + STIX + s1 s3 s3 XCHG3 + DICTISETB + }> + }> + __tact_dict_get_int_int PROCINLINE:<{ + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + IF:<{ + SWAP + LDIX + DROP + }>ELSE<{ + 2DROP + PUSHNULL + }> + }> + __tact_dict_set_int_cell PROCINLINE:<{ + DUP + ISNULL + IF:<{ + DROP + -ROT + DICTIDEL + DROP + }>ELSE<{ + s1 s3 s3 XCHG3 + DICTISETREF + }> + }> + __tact_dict_get_int_cell PROC:<{ + -ROT + DICTIGETREF + NULLSWAPIFNOT + IFJMP:<{ + }> + DROP + PUSHNULL + }> + __tact_dict_get_int_slice PROCINLINE:<{ + -ROT + DICTIGET + NULLSWAPIFNOT + IF:<{ + }>ELSE<{ + DROP + PUSHNULL + }> + }> + __tact_dict_set_slice_int PROC:<{ + OVER + ISNULL + IFJMP:<{ + 2DROP + -ROT + DICTDEL + DROP + }> + NEWC + SWAP + STIX + s1 s3 s3 XCHG3 + DICTSETB + }> + __tact_dict_get_slice_int PROCINLINE:<{ + s1 s3 s3 XCHG3 + DICTGET + NULLSWAPIFNOT + IF:<{ + SWAP + LDIX + DROP + }>ELSE<{ + 2DROP + PUSHNULL + }> + }> + __tact_address_eq PROCINLINE:<{ + SDEQ + }> + __gen_write_BlacklistWallet PROCINLINE:<{ + 43811734 PUSHINT + ROT + 32 STU + SWAP + __tact_store_address INLINECALLDICT + }> + __gen_writecell_BlacklistWallet PROCREF:<{ + NEWC + SWAP + __gen_write_BlacklistWallet INLINECALLDICT + ENDC + }> + __gen_read_InitiateBlacklistVote PROCINLINE:<{ + 32 LDU + SWAP + 3909090059 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + __tact_load_address INLINECALLDICT + SWAP + 257 PUSHINT + LDIX + LDREF + SWAP + CTOS + 257 PUSHINT + LDIX + DROP + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_read_InitiateLiquidationVote PROCINLINE:<{ + 32 LDU + SWAP + 301696559 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 3 -ROLL + }> + __gen_read_FinishVote PROCINLINE:<{ + 32 LDU + SWAP + 710362179 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + SWAP + }> + __gen_read_VoteMsg PROCINLINE:<{ + 32 LDU + SWAP + 1493035179 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 3 -ROLL + }> + __gen_write_AddressList PROCINLINE:<{ + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + }> + __gen_read_AddressList PROCINLINE:<{ + LDDICT + 257 PUSHINT + LDIX + -ROT + }> + __gen_write_Distribution PROCINLINE:<{ + 3 -ROLL + __gen_write_AddressList INLINECALLDICT + STDICT + }> + __gen_read_Distribution PROCINLINE:<{ + __gen_read_AddressList INLINECALLDICT + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + }> + __gen_read_InitiateDistributionVote PROCINLINE:<{ + 32 LDU + SWAP + 2512227654 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + LDREF + SWAP + CTOS + __gen_read_Distribution INLINECALLDICT + s3 POP + s3 s6 XCHG + s3 s5 XCHG + s3 s4 XCHG + ROT + }> + __gen_write_Unstake PROCINLINE:<{ + 3125946401 PUSHINT + ROT + 32 STU + 257 PUSHINT + STIX + }> + __gen_writecell_Unstake PROCREF:<{ + NEWC + SWAP + __gen_write_Unstake INLINECALLDICT + ENDC + }> + __gen_read_Unstake PROCINLINE:<{ + 32 LDU + SWAP + 3125946401 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + SWAP + }> + __gen_read_RequestUnstake PROCINLINE:<{ + 32 LDU + SWAP + 3922648959 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + SWAP + }> + __gen_read_CollectProfit PROCINLINE:<{ + 32 LDU + SWAP + 1368467253 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + SWAP + }> + __gen_write_Proposal PROCINLINE:<{ + s4 s5 XCHG2 + 257 PUSHINT + STIX + ROT + __tact_store_address_opt INLINECALLDICT + STDICT + OVER + ISNULL + NOT + IF:<{ + TRUE + SWAP + 1 STI + 257 PUSHINT + STIX + }>ELSE<{ + FALSE + s2 POP + 1 STI + }> + STDICT + }> + __gen_writecell_Proposal PROCREF:<{ + NEWC + 5 -ROLL + __gen_write_Proposal INLINECALLDICT + ENDC + }> + __gen_read_Proposal PROCINLINE:<{ + 257 PUSHINT + LDIX + __tact_load_address_opt INLINECALLDICT + SWAP + LDDICT + 1 LDI + SWAP + IF:<{ + 257 PUSHINT + LDIX + }>ELSE<{ + PUSHNULL + SWAP + }> + LDDICT + 5 -ROLL + }> + __gen_Proposal_as_optional PROCINLINE:<{ + 5 TUPLE + }> + __gen_readopt_Proposal PROCREF:<{ + DUP + ISNULL + IFJMP:<{ + DROP + PUSHNULL + }> + CTOS + __gen_read_Proposal INLINECALLDICT + 1 5 BLKDROP2 + __gen_Proposal_as_optional INLINECALLDICT + }> + __gen_write_Vote PROCREF:<{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + OVER + ISNULL + NOT + IF:<{ + TRUE + SWAP + 1 STI + 1 STI + }>ELSE<{ + FALSE + s2 POP + 1 STI + }> + }> + __gen_writecell_Vote PROCREF:<{ + NEWC + 6 -ROLL + __gen_write_Vote INLINECALLDICT + ENDC + }> + __gen_read_Vote PROCREF:<{ + 257 PUSHINT + LDIX + LDDICT + 257 PUSHINT + LDIX + 257 PUSHINT + LDIX + 1 LDI + 1 LDI + SWAP + IF:<{ + 1 LDI + }>ELSE<{ + PUSHNULL + SWAP + }> + 6 -ROLL + }> + __gen_Vote_as_optional PROCINLINE:<{ + 6 TUPLE + }> + __gen_readopt_Vote PROCREF:<{ + DUP + ISNULL + IFJMP:<{ + DROP + PUSHNULL + }> + CTOS + __gen_read_Vote INLINECALLDICT + 1 6 BLKDROP2 + __gen_Vote_as_optional INLINECALLDICT + }> + __gen_write_Foundation PROCINLINE:<{ + s10 s9 s8 XCHG3 + __gen_write_AddressList INLINECALLDICT + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + __gen_write_Distribution INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + SWAP + STREF + }> + __gen_read_Foundation PROCINLINE:<{ + __gen_read_AddressList INLINECALLDICT + s0 s2 XCHG + LDREF + SWAP + CTOS + __gen_read_Distribution INLINECALLDICT + s0 s3 XCHG + __tact_load_address INLINECALLDICT + SWAP + LDDICT + LDREF + DROP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDIX + DROP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + }> + __gen_AddressList_to_external PROCINLINE:<{ + }> + __gen_Proposal_not_null PROCINLINE:<{ + DUP + ISNULL + 128 THROWIF + 5 UNTUPLE + }> + __gen_Vote_not_null PROCINLINE:<{ + DUP + ISNULL + 128 THROWIF + 6 UNTUPLE + }> + __gen_Vote_to_tuple PROCINLINE:<{ + 6 TUPLE + }> + __gen_Vote_opt_to_tuple PROCINLINE:<{ + DUP + ISNULL + IF:<{ + DROP + PUSHNULL + }>ELSE<{ + __gen_Vote_not_null INLINECALLDICT + __gen_Vote_to_tuple INLINECALLDICT + }> + }> + __gen_Vote_opt_to_external PROCINLINE:<{ + __gen_Vote_opt_to_tuple INLINECALLDICT + DUP + ISNULL + IF:<{ + DROP + PUSHNULL + }>ELSE<{ + }> + }> + __gen_load_Foundation PROCINLINE:<{ + c4 PUSH + CTOS + LDREF + SWAP + __tact_context_sys SETGLOB + __gen_read_Foundation INLINECALLDICT + 1 10 BLKDROP2 + }> + __gen_store_Foundation PROCINLINE:<{ + NEWC + __tact_context_sys GETGLOB + SWAP + STREF + 10 -ROLL + __gen_write_Foundation INLINECALLDICT + ENDC + c4 POP + }> + $send PROCREF:<{ + NEWC + 1 PUSHINT + SWAP + 2 STI + s0 s7 XCHG2 + __tact_store_bool INLINECALLDICT + 0 PUSHINT + SWAP + 3 STI + s0 s5 XCHG2 + __tact_store_address INLINECALLDICT + s0 s3 XCHG2 + STGRAMS + 0 PUSHINT + SWAP + 105 STI + s3 PUSH + ISNULL + NOT + s5 PUSH + ISNULL + NOT + OR + IF:<{ + TRUE + __tact_store_bool INLINECALLDICT + NEWC + FALSE + __tact_store_bool INLINECALLDICT + FALSE + __tact_store_bool INLINECALLDICT + s4 PUSH + ISNULL + NOT + IF:<{ + TRUE + __tact_store_bool INLINECALLDICT + s0 s4 XCHG + __tact_not_null INLINECALLDICT + s0 s4 XCHG2 + STREF + }>ELSE<{ + s4 POP + s0 s3 XCHG + FALSE + __tact_store_bool INLINECALLDICT + }> + s4 PUSH + ISNULL + NOT + IF:<{ + TRUE + __tact_store_bool INLINECALLDICT + s0 s4 XCHG + __tact_not_null INLINECALLDICT + s0 s4 XCHG2 + STREF + }>ELSE<{ + s4 POP + s0 s3 XCHG + FALSE + __tact_store_bool INLINECALLDICT + }> + FALSE + __tact_store_bool INLINECALLDICT + s0 s2 XCHG + TRUE + __tact_store_bool INLINECALLDICT + s0 s2 XCHG + ENDC + ROT + STREF + }>ELSE<{ + s3 POP + s3 POP + SWAP + FALSE + __tact_store_bool INLINECALLDICT + }> + OVER + ISNULL + NOT + IF:<{ + TRUE + __tact_store_bool INLINECALLDICT + SWAP + __tact_not_null INLINECALLDICT + SWAP + STREF + }>ELSE<{ + NIP + FALSE + __tact_store_bool INLINECALLDICT + }> + ENDC + SWAP + SENDRAWMSG + }> + $__gen_Foundation_numVotes PROCREF:<{ + 9 1 BLKDROP2 + }> + $__gen_get_numVotes PROC:<{ + __gen_load_Foundation INLINECALLDICT + $__gen_Foundation_numVotes INLINECALLDICT + }> + $__gen_Foundation_nthVote PROCREF:<{ + s5 POP + 3 BLKDROP + s5 s6 XCHG2 + 5 BLKDROP + 257 PUSHINT + SWAP + __tact_dict_get_int_cell CALLDICT + __gen_readopt_Vote INLINECALLDICT + }> + $__gen_get_nthVote PROC:<{ + __gen_load_Foundation INLINECALLDICT + 10 ROLL + $__gen_Foundation_nthVote INLINECALLDICT + __gen_Vote_opt_to_external INLINECALLDICT + }> + $__gen_Foundation_AdminList PROCREF:<{ + 6 BLKDROP + 2 2 BLKDROP2 + }> + $__gen_get_AdminList PROC:<{ + __gen_load_Foundation INLINECALLDICT + $__gen_Foundation_AdminList INLINECALLDICT + __gen_AddressList_to_external INLINECALLDICT + }> + $__gen_Foundation_AdminPercents PROCREF:<{ + s5 s9 XCHG + 9 BLKDROP + }> + $__gen_get_AdminPercents PROC:<{ + __gen_load_Foundation INLINECALLDICT + $__gen_Foundation_AdminPercents INLINECALLDICT + }> + $__gen_Foundation_receive_FinishVote PROCINLINE:<{ + 46931 PUSHINT + s1 s2 PUSH2 + LESS + THROWANYIFNOT + s4 PUSH + 257 PUSHINT + s2 PUSH + __tact_dict_get_int_cell CALLDICT + __gen_readopt_Vote INLINECALLDICT + __gen_Vote_not_null INLINECALLDICT + DROP + 30386 PUSHINT + SWAP + 0 EQINT + THROWANYIFNOT + 34326 PUSHINT + s2 PUSH + NOW + GEQ + THROWANYIFNOT + 0 PUSHINT + s0 s0 s0 PUSH3 + WHILE:<{ + s0 s15 PUSH2 + LESS + }>DO<{ + 257 PUSHINT + s7 s(-1) s(-1) PUXCPU + s3 s(-1) PUXC + __tact_dict_get_int_int INLINECALLDICT + __tact_not_null INLINECALLDICT + DUP + 1 EQINT + IF:<{ + DROP + 257 PUSHINT + s15 s(-1) s(-1) PUXCPU + s3 s(-1) PUXC + __tact_dict_get_int_int INLINECALLDICT + __tact_not_null INLINECALLDICT + s1 s4 XCHG + ADD + }>ELSE<{ + DUP + 2 EQINT + IF:<{ + DROP + 257 PUSHINT + s15 s(-1) s(-1) PUXCPU + s3 s(-1) PUXC + __tact_dict_get_int_int INLINECALLDICT + __tact_not_null INLINECALLDICT + s1 s3 XCHG + ADD + }>ELSE<{ + 0 EQINT + IF:<{ + 257 PUSHINT + s15 s(-1) s(-1) PUXCPU + s3 s(-1) PUXC + __tact_dict_get_int_int INLINECALLDICT + __tact_not_null INLINECALLDICT + s1 s2 XCHG + ADD + SWAP + }> + s0 s2 XCHG + }> + s0 s1 s3 XCHG3 + }> + s0 s3 XCHG + INC + }> + DROP + s2 s1 PUSH2 + ADD + SWAP + ADD + s3 PUSH + LESS + IF:<{ + 2DROP + FALSE + }>ELSE<{ + GREATER + IF:<{ + TRUE + }>ELSE<{ + FALSE + }> + }> + s4 s3 s0 XCHG3 + TRUE + s5 s4 XCHG2 + 257 PUSHINT + s5 s6 XCPU + __gen_writecell_Vote INLINECALLDICT + s3 PUSH + s3 s8 XCHG + SWAP + __tact_dict_set_int_cell INLINECALLDICT + s0 s5 XCHG + -1 EQINT + IF:<{ + 257 PUSHINT + s3 PUSH + s0 s2 XCHG + __tact_dict_get_int_cell CALLDICT + __gen_readopt_Proposal INLINECALLDICT + __gen_Proposal_not_null INLINECALLDICT + s4 PUSH + 0 EQINT + IF:<{ + TRUE + 0 PUSHINT + 64 PUSHINT + s0 s6 XCHG + __tact_not_null INLINECALLDICT + __gen_writecell_BlacklistWallet INLINECALLDICT + s12 PUSH + s0 s3 XCHG + s0 s4 XCHG + s7 s7 XCHG2 + PUSHNULL + PUSHNULL + $send INLINECALLDICT + }>ELSE<{ + s3 POP + }> + s3 PUSH + 1 EQINT + DROP + s0 s3 XCHG + 2 EQINT + IF:<{ + s8 POP + s8 POP + s8 POP + s0 s7 XCHG + __tact_not_null INLINECALLDICT + s5 s7 XCHG + s0 s6 XCHG + s0 s5 XCHG + }>ELSE<{ + 3 BLKDROP + }> + }>ELSE<{ + DROP + }> + }> + $__gen_Foundation_receive_VoteMsg PROCINLINE:<{ + 49606 PUSHINT + s2 s10 PUSH2 + LESS + THROWANYIFNOT + __tact_context_get INLINECALLDICT + s2 s3 XCHG + 3 BLKDROP + 56549 PUSHINT + s12 PUSH + 257 PUSHINT + s5 PUSH + __tact_dict_get_int_slice INLINECALLDICT + s1 s2 XCHG + __tact_address_eq INLINECALLDICT + THROWANYIFNOT + 46931 PUSHINT + s3 s4 PUSH2 + LESS + THROWANYIFNOT + s6 PUSH + 257 PUSHINT + s4 PUSH + __tact_dict_get_int_cell CALLDICT + __gen_readopt_Vote INLINECALLDICT + __gen_Vote_not_null INLINECALLDICT + 30386 PUSHINT + s2 PUSH + 0 EQINT + THROWANYIFNOT + 29720 PUSHINT + s7 PUSH + -1 GTINT + s8 PUSH + 3 LESSINT + AND + THROWANYIFNOT + 257 PUSHINT + DUP + s4 s6 XCHG + s9 s3 s0 XCHG3 + s1 s8 XCHG + __tact_dict_set_int_int INLINECALLDICT + s0 s3 XCHG + s2 s4 XCHG2 + 257 PUSHINT + s0 s6 XCHG + __gen_writecell_Vote INLINECALLDICT + s3 s6 XCHG + s1 s2 XCHG + __tact_dict_set_int_cell INLINECALLDICT + s0 s3 XCHG + }> + $__gen_Foundation_receive_InitiateBlacklistVote PROCINLINE:<{ + __tact_context_get INLINECALLDICT + DROP + s2 POP + 6873 PUSHINT + 257 PUSHINT + s15 s0 s7 PUXC2 + __tact_dict_get_int_slice INLINECALLDICT + __tact_address_eq INLINECALLDICT + s1 s5 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s4 XCHG + 1000000000 PUSHINT + GEQ + s1 s4 XCHG + THROWANYIFNOT + 19362 PUSHINT + OVER + 20 GTINT + s2 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s3 PUSH + -1 GTINT + s4 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + 0 PUSHINT + PUSHNULL + PUSHNULL + PUSHNULL + PUSHNULL + NOW + s0 s8 XCHG2 + ADD + FALSE + PUSHNULL + s10 s6 PUSH2 + WHILE:<{ + DUP + 19 s() PUSH + LESS + }>DO<{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s15 XCHG + -ROT + __tact_dict_set_int_int INLINECALLDICT + s0 s11 XCHG + INC + }> + DROP + s0 s4 XCHG + s0 s10 XCHG + s3 s8 s3 XCHG3 + 257 PUSHINT + s0 s9 XCHG + __gen_writecell_Vote INLINECALLDICT + s10 s4 s0 XCHG3 + s7 s(-1) PUXC + __tact_dict_set_int_cell INLINECALLDICT + s8 s8 XCHG2 + s3 s1 s3 XCHG3 + 257 PUSHINT + s0 s5 XCHG + __gen_writecell_Proposal INLINECALLDICT + s2 PUSH + s3 s4 XCHG + SWAP + __tact_dict_set_int_cell INLINECALLDICT + SWAP + INC + }> + $__gen_Foundation_receive_InitiateDistributionVote PROCINLINE:<{ + __tact_context_get INLINECALLDICT + DROP + s2 POP + 6873 PUSHINT + 257 PUSHINT + 17 s() PUSH + s0 s1 s10 XCHG3 + __tact_dict_get_int_slice INLINECALLDICT + __tact_address_eq INLINECALLDICT + s1 s7 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s6 XCHG + 1000000000 PUSHINT + GEQ + s1 s6 XCHG + THROWANYIFNOT + 19362 PUSHINT + s4 PUSH + 20 GTINT + s5 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s3 PUSH + -1 GTINT + s4 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + 2 PUSHINT + PUSHNULL + PUSHNULL + NOW + s0 s6 XCHG2 + ADD + FALSE + PUSHNULL + s10 PUSH + 0 PUSHINT + WHILE:<{ + DUP + 19 s() PUSH + LESS + }>DO<{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s13 XCHG + -ROT + __tact_dict_set_int_int INLINECALLDICT + s0 s9 XCHG + INC + }> + DROP + s0 s4 XCHG + s0 s8 XCHG + s3 s9 s3 XCHG3 + 257 PUSHINT + s0 s10 XCHG + __gen_writecell_Vote INLINECALLDICT + s10 s5 s0 XCHG3 + s7 s(-1) PUXC + __tact_dict_set_int_cell INLINECALLDICT + s0 s8 XCHG + 257 PUSHINT + s0 s5 XCHG + __gen_writecell_Proposal INLINECALLDICT + s2 PUSH + s3 s4 XCHG + SWAP + __tact_dict_set_int_cell INLINECALLDICT + SWAP + INC + }> + $__gen_Foundation_receive_InitiateLiquidationVote PROCINLINE:<{ + __tact_context_get INLINECALLDICT + DROP + s2 POP + 6873 PUSHINT + 257 PUSHINT + s14 s0 s6 PUXC2 + __tact_dict_get_int_slice INLINECALLDICT + __tact_address_eq INLINECALLDICT + s1 s4 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s3 XCHG + 1000000000 PUSHINT + GEQ + s1 s3 XCHG + THROWANYIFNOT + 19362 PUSHINT + OVER + 85 GTINT + s2 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s2 PUSH + 0 GTINT + s3 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + PUSHNULL + NOW + s0 s3 XCHG2 + ADD + FALSE + PUSHNULL + s5 PUSH + 0 PUSHINT + WHILE:<{ + s0 s13 PUSH2 + LESS + }>DO<{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s10 XCHG + -ROT + __tact_dict_set_int_int INLINECALLDICT + s0 s6 XCHG + INC + }> + DROP + 1 PUSHINT + SWAP + PUSHNULL + PUSHNULL + s8 s6 XCHG2 + PUSHNULL + PUSHNULL + s9 s7 XCHG2 + 257 PUSHINT + s0 s7 XCHG + __gen_writecell_Vote INLINECALLDICT + s10 s10 s0 XCHG3 + s7 s(-1) PUXC + __tact_dict_set_int_cell INLINECALLDICT + s0 s8 XCHG + s4 s4 s3 XCHG3 + 257 PUSHINT + s0 s5 XCHG + __gen_writecell_Proposal INLINECALLDICT + s2 PUSH + s3 s4 XCHG + SWAP + __tact_dict_set_int_cell INLINECALLDICT + SWAP + INC + }> + $__gen_Foundation_receive_Unstake PROCINLINE:<{ + DROP + __tact_context_get INLINECALLDICT + DROP + s2 POP + s6 PUSH + __tact_address_eq INLINECALLDICT + IF:<{ + 0 PUSHINT + WHILE:<{ + s0 s8 PUSH2 + LESS + }>DO<{ + s9 PUSH + 257 PUSHINT + s2 PUSH + __tact_dict_get_int_slice INLINECALLDICT + __tact_not_null INLINECALLDICT + 257 PUSHINT + s9 s(-1) s(-1) PUXCPU + s4 s(-1) PUXC + __tact_dict_get_int_int INLINECALLDICT + __tact_not_null INLINECALLDICT + s3 s(-1) PUXC + MUL + 100 PUSHINT + DIV + 0 PUSHINT + s7 PUSH + 267 PUSHINT + s4 PUSH + 257 PUSHINT + __tact_dict_get_slice_int INLINECALLDICT + DUP + ISNULL + NOT + IF:<{ + NIP + __tact_not_null INLINECALLDICT + }>ELSE<{ + DROP + }> + 267 PUSHINT + s0 s2 XCHG + ADD + s3 s7 XCHG + s1 s2 XCHG + 257 PUSHINT + __tact_dict_set_slice_int CALLDICT + s0 s4 XCHG + INC + }> + 2DROP + }>ELSE<{ + DROP + }> + }> + $__gen_Foundation_receive_RequestUnstake PROCINLINE:<{ + __tact_context_get INLINECALLDICT + s2 s3 XCHG + 3 BLKDROP + 37444 PUSHINT + 257 PUSHINT + s13 s0 s3 PUXC2 + __tact_dict_get_int_slice INLINECALLDICT + SWAP + __tact_address_eq INLINECALLDICT + THROWANYIFNOT + TRUE + 0 PUSHINT + 64 PUSHINT + OVER + __gen_writecell_Unstake INLINECALLDICT + s8 PUSH + 3 -ROLL + PUSHNULL + PUSHNULL + $send INLINECALLDICT + }> + $__gen_Foundation_receive_CollectProfit PROCINLINE:<{ + __tact_context_get INLINECALLDICT + s2 s3 XCHG + 3 BLKDROP + 53981 PUSHINT + 257 PUSHINT + s11 s0 s3 PUXC2 + __tact_dict_get_int_slice INLINECALLDICT + OVER + __tact_address_eq INLINECALLDICT + s1 s2 XCHG + THROWANYIFNOT + s3 PUSH + 267 PUSHINT + s2 PUSH + 257 PUSHINT + __tact_dict_get_slice_int INLINECALLDICT + 42983 PUSHINT + OVER + ISNULL + NOT + THROWANYIFNOT + __tact_not_null INLINECALLDICT + s0 s4 XCHG + 267 PUSHINT + s2 PUSH + 0 PUSHINT + 257 PUSHINT + __tact_dict_set_slice_int CALLDICT + TRUE + s0 s5 XCHG + 150000000 PUSHINT + SUB + s5 s5 s0 XCHG3 + 64 PUSHINT + PUSHNULL + PUSHNULL + PUSHNULL + $send INLINECALLDICT + }> + $__gen_Foundation_receive PROCINLINE:<{ + }> + recv_internal PROC:<{ + 0 PUSHINT + OVER + SBITS + 31 GTINT + IF:<{ + DROP + DUP + 32 PLDU + }> + s0 s2 XCHG + CTOS + 4 LDU + SWAP + 1 PUSHINT + AND + 1 EQINT + IF:<{ + TRUE + }>ELSE<{ + FALSE + }> + SWAP + LDMSGADDR + s2 PUSH + s6 s6 XCHG2 + 4 TUPLE + __tact_context SETGLOB + s0 s2 XCHG + IFJMP:<{ + 2DROP + }> + DUP + 710362179 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_FinishVote INLINECALLDICT + NIP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_Foundation_receive_FinishVote INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 1493035179 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_VoteMsg INLINECALLDICT + s3 POP + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + ROT + $__gen_Foundation_receive_VoteMsg INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 3909090059 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_InitiateBlacklistVote INLINECALLDICT + s4 POP + s12 s13 XCHG + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + 3 ROLL + $__gen_Foundation_receive_InitiateBlacklistVote INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 2512227654 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_InitiateDistributionVote INLINECALLDICT + s6 POP + s14 s15 XCHG + s13 s14 XCHG + s12 s13 XCHG + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + 5 ROLL + $__gen_Foundation_receive_InitiateDistributionVote INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 301696559 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_InitiateLiquidationVote INLINECALLDICT + s3 POP + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + ROT + $__gen_Foundation_receive_InitiateLiquidationVote INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 3125946401 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_Unstake INLINECALLDICT + NIP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_Foundation_receive_Unstake INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 3922648959 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_RequestUnstake INLINECALLDICT + NIP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_Foundation_receive_RequestUnstake INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + DUP + 1368467253 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_Foundation INLINECALLDICT + s0 s10 XCHG + __gen_read_CollectProfit INLINECALLDICT + NIP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_Foundation_receive_CollectProfit INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + 0 EQINT + SWAP + SBITS + 33 LESSINT + AND + IFJMP:<{ + __gen_load_Foundation INLINECALLDICT + $__gen_Foundation_receive INLINECALLDICT + __gen_store_Foundation INLINECALLDICT + }> + 130 THROW + }> + supported_interfaces PROC:<{ + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + }> + get_abi_ipfs PROC:<{ + x{697066733a2f2f516d547061684d5a35516d51723954723238627a5a6a565879725a446f694a753577557344745169676e51766473} PUSHSLICE + }> +}END>c diff --git a/sources/output/jetton_Foundation.code.rev.fif b/sources/output/jetton_Foundation.code.rev.fif new file mode 100644 index 0000000..24908be --- /dev/null +++ b/sources/output/jetton_Foundation.code.rev.fif @@ -0,0 +1,2663 @@ +SETCP0 +(:methods + recv_internal: + 0 PUSHINT + s1 PUSH + SBITS + 31 GTINT + <{ + s0 POP + s0 PUSH + 32 PLDU + }> PUSHCONT + IF + s0 s2 XCHG + CTOS + 4 LDU + s0 s1 XCHG + 1 PUSHINT + AND + 1 EQINT + <{ + -1 PUSHINT + }> PUSHCONT + <{ + 0 PUSHINT + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s2 PUSH + s6 s6 XCHG2 + 4 TUPLE + 1 SETGLOBVAR + s0 s2 XCHG + <{ + 2DROP + }> PUSHCONT + IFJMP + s0 PUSH + 710362179 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 710362179 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + s1 POP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + <{ + 46931 PUSHINT + s1 s2 PUSH2 + LESS + THROWANYIFNOT + s4 PUSH + 257 PUSHINT + s2 PUSH + 12 CALLDICT + <{ + s0 PUSH + ISNULL + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFJMP + CTOS + <{ + 257 PUSHINT + LDI + LDDICT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 1 LDI + 1 LDI + s0 s1 XCHG + <{ + 1 LDI + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 6 1 BLKSWAP + }> CALLREF + 1 6 BLKDROP2 + 6 TUPLE + }> CALLREF + s0 PUSH + ISNULL + 128 THROWIF + 6 UNTUPLE + s0 POP + 30386 PUSHINT + s0 s1 XCHG + 0 EQINT + THROWANYIFNOT + 34326 PUSHINT + s2 PUSH + NOW + GEQ + THROWANYIFNOT + 0 PUSHINT + 0 0 0 PUSH3 + <{ + s0 s15 PUSH2 + LESS + }> PUSHCONT + PUSHREFCONT + WHILE + s0 POP + s2 s1 PUSH2 + ADD + s0 s1 XCHG + ADD + s3 PUSH + LESS + <{ + 2DROP + 0 PUSHINT + }> PUSHCONT + <{ + GREATER + <{ + -1 PUSHINT + }> PUSHCONT + <{ + 0 PUSHINT + }> PUSHCONT + IFELSE + }> PUSHCONT + IFELSE + s4 s3 s0 XCHG3 + -1 PUSHINT + s5 s4 XCHG2 + 257 PUSHINT + s5 s6 XCPU + <{ + 257 PUSHINT + 7 -1 -1 PUXCPU + s3 s-1 PUXC + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + 128 THROWIF + s0 PUSH + 1 EQINT + <{ + s0 PUSH + 2 EQINT + <{ + s0 POP + 257 PUSHINT + 15 -1 -1 PUXCPU + s3 s-1 PUXC + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + 128 THROWIF + s1 s3 XCHG + ADD + }> PUSHCONT + <{ + 0 EQINT + <{ + 257 PUSHINT + 15 -1 -1 PUXCPU + s3 s-1 PUXC + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + 128 THROWIF + s1 s2 XCHG + ADD + s0 s1 XCHG + }> PUSHCONT + IF + s0 s2 XCHG + }> PUSHCONT + IFELSE + s0 s1 s3 XCHG3 + }> PUSHCONT + <{ + s0 POP + 257 PUSHINT + 15 -1 -1 PUXCPU + s3 s-1 PUXC + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + 128 THROWIF + s1 s4 XCHG + ADD + }> IFREFELSE + s0 s3 XCHG + INC + }> CALLREF + s3 PUSH + s3 s8 XCHG + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s5 XCHG + -1 EQINT + NEWC + 6 1 BLKSWAP + <{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 1 STI + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> IFJMPREF + s0 PUSH + 1493035179 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 1493035179 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 3 1 BLKSWAP + s3 POP + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + ROT + <{ + 49606 PUSHINT + s2 s10 PUSH2 + LESS + THROWANYIFNOT + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + 56549 PUSHINT + s12 PUSH + 257 PUSHINT + s5 PUSH + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + s1 s2 XCHG + SDEQ + THROWANYIFNOT + 46931 PUSHINT + s3 s4 PUSH2 + LESS + THROWANYIFNOT + s6 PUSH + 257 PUSHINT + s4 PUSH + 12 CALLDICT + <{ + s0 PUSH + ISNULL + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFJMP + CTOS + <{ + 257 PUSHINT + LDI + LDDICT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 1 LDI + 1 LDI + s0 s1 XCHG + <{ + 1 LDI + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 6 1 BLKSWAP + }> CALLREF + 1 6 BLKDROP2 + 6 TUPLE + }> CALLREF + s0 PUSH + ISNULL + 128 THROWIF + 6 UNTUPLE + 30386 PUSHINT + s2 PUSH + 0 EQINT + THROWANYIFNOT + 29720 PUSHINT + s7 PUSH + -1 GTINT + s8 PUSH + 3 LESSINT + AND + THROWANYIFNOT + 257 PUSHINT + s0 PUSH + s4 s6 XCHG + s9 s3 s0 XCHG3 + s1 s8 XCHG + s1 PUSH + ISNULL + <{ + 2DROP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + NEWC + s0 s1 XCHG + STIX + s1 s3 s3 XCHG3 + DICTISETB + }> PUSHCONT + IFELSE + s0 s3 XCHG + s2 s4 XCHG2 + 257 PUSHINT + s0 s6 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 1 STI + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + s3 s6 XCHG + s1 s2 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s3 XCHG + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> IFJMPREF + s0 PUSH + 3909090059 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 3909090059 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 257 PUSHINT + LDI + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + s0 POP + s1 s4 XCHG + s3 s3 s0 XCHG3 + s4 POP + s12 s13 XCHG + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + 1 3 BLKSWAP + <{ + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + s2 POP + 6873 PUSHINT + 257 PUSHINT + 15 0 7 PUXC2 + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + SDEQ + s1 s5 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s4 XCHG + 1000000000 PUSHINT + GEQ + s1 s4 XCHG + THROWANYIFNOT + 19362 PUSHINT + s1 PUSH + 20 GTINT + s2 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s3 PUSH + -1 GTINT + s4 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + 0 PUSHINT + PUSHNULL + PUSHNULL + PUSHNULL + PUSHNULL + NOW + s0 s8 XCHG2 + ADD + 0 PUSHINT + PUSHNULL + s10 s6 PUSH2 + <{ + s0 PUSH + s19 PUSH + LESS + }> PUSHCONT + <{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s15 XCHG + ROTREV + s1 PUSH + ISNULL + <{ + 2DROP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + NEWC + s0 s1 XCHG + STIX + s1 s3 s3 XCHG3 + DICTISETB + }> PUSHCONT + IFELSE + s0 s11 XCHG + INC + }> PUSHCONT + WHILE + s0 POP + s0 s4 XCHG + s0 s10 XCHG + s3 s8 s3 XCHG3 + 257 PUSHINT + s0 s9 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 1 STI + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + s10 s4 s0 XCHG3 + s7 s-1 PUXC + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s8 s8 XCHG2 + s3 s1 s3 XCHG3 + 257 PUSHINT + s0 s5 XCHG + <{ + NEWC + 5 1 BLKSWAP + s4 s5 XCHG2 + 257 PUSHINT + STIX + ROT + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + STDICT + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 257 PUSHINT + STIX + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + STDICT + ENDC + }> CALLREF + s2 PUSH + s3 s4 XCHG + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s1 XCHG + INC + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> IFJMPREF + s0 PUSH + 2512227654 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 2512227654 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 257 PUSHINT + LDI + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s3 POP + s3 s6 XCHG + s3 s5 XCHG + s3 s4 XCHG + ROT + s6 POP + s14 s15 XCHG + s13 s14 XCHG + s12 s13 XCHG + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + 1 5 BLKSWAP + <{ + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + s2 POP + 6873 PUSHINT + 257 PUSHINT + s17 PUSH + s0 s1 s10 XCHG3 + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + SDEQ + s1 s7 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s6 XCHG + 1000000000 PUSHINT + GEQ + s1 s6 XCHG + THROWANYIFNOT + 19362 PUSHINT + s4 PUSH + 20 GTINT + s5 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s3 PUSH + -1 GTINT + s4 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + 2 PUSHINT + PUSHNULL + PUSHNULL + NOW + s0 s6 XCHG2 + ADD + 0 PUSHINT + PUSHNULL + s10 PUSH + 0 PUSHINT + <{ + s0 PUSH + s19 PUSH + LESS + }> PUSHCONT + <{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s13 XCHG + ROTREV + s1 PUSH + ISNULL + <{ + 2DROP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + NEWC + s0 s1 XCHG + STIX + s1 s3 s3 XCHG3 + DICTISETB + }> PUSHCONT + IFELSE + s0 s9 XCHG + INC + }> PUSHCONT + WHILE + s0 POP + s0 s4 XCHG + s0 s8 XCHG + s3 s9 s3 XCHG3 + 257 PUSHINT + s0 s10 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 1 STI + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + s10 s5 s0 XCHG3 + s7 s-1 PUXC + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s8 XCHG + 257 PUSHINT + s0 s5 XCHG + <{ + NEWC + 5 1 BLKSWAP + s4 s5 XCHG2 + 257 PUSHINT + STIX + ROT + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + STDICT + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 257 PUSHINT + STIX + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + STDICT + ENDC + }> CALLREF + s2 PUSH + s3 s4 XCHG + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s1 XCHG + INC + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> IFJMPREF + s0 PUSH + 301696559 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 301696559 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 3 1 BLKSWAP + s3 POP + s11 s12 XCHG + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + ROT + <{ + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + s2 POP + 6873 PUSHINT + 257 PUSHINT + 14 0 6 PUXC2 + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + SDEQ + s1 s4 XCHG + THROWANYIFNOT + 29821 PUSHINT + s0 s3 XCHG + 1000000000 PUSHINT + GEQ + s1 s3 XCHG + THROWANYIFNOT + 19362 PUSHINT + s1 PUSH + 85 GTINT + s2 PUSH + 101 LESSINT + AND + THROWANYIFNOT + 61070 PUSHINT + s2 PUSH + 0 GTINT + s3 PUSH + 259200 PUSHINT + LESS + AND + THROWANYIFNOT + PUSHNULL + NOW + s0 s3 XCHG2 + ADD + 0 PUSHINT + PUSHNULL + s5 PUSH + 0 PUSHINT + <{ + s0 s13 PUSH2 + LESS + }> PUSHCONT + <{ + 257 PUSHINT + -1 PUSHINT + s1 s2 PUSH2 + s4 s10 XCHG + ROTREV + s1 PUSH + ISNULL + <{ + 2DROP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + NEWC + s0 s1 XCHG + STIX + s1 s3 s3 XCHG3 + DICTISETB + }> PUSHCONT + IFELSE + s0 s6 XCHG + INC + }> PUSHCONT + WHILE + s0 POP + 1 PUSHINT + s0 s1 XCHG + PUSHNULL + PUSHNULL + s8 s6 XCHG2 + PUSHNULL + PUSHNULL + s9 s7 XCHG2 + 257 PUSHINT + s0 s7 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + s5 s6 XCHG2 + 257 PUSHINT + STIX + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + 257 PUSHINT + STIX + 1 STI + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 1 STI + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + s10 s10 s0 XCHG3 + s7 s-1 PUXC + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s8 XCHG + s4 s4 s3 XCHG3 + 257 PUSHINT + s0 s5 XCHG + <{ + NEWC + 5 1 BLKSWAP + s4 s5 XCHG2 + 257 PUSHINT + STIX + ROT + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + STDICT + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + 257 PUSHINT + STIX + }> PUSHCONT + <{ + 0 PUSHINT + s2 POP + 1 STI + }> PUSHCONT + IFELSE + STDICT + ENDC + }> CALLREF + s2 PUSH + s3 s4 XCHG + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + ROTREV + DICTIDEL + s0 POP + }> PUSHCONT + <{ + s1 s3 s3 XCHG3 + DICTISETREF + }> PUSHCONT + IFELSE + s0 s1 XCHG + INC + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> PUSHCONT + IFJMP + s0 PUSH + 3125946401 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 3125946401 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + s1 POP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + s0 POP + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + s2 POP + s6 PUSH + SDEQ + <{ + s0 POP + }> PUSHCONT + <{ + 0 PUSHINT + <{ + s0 s8 PUSH2 + LESS + }> PUSHCONT + <{ + s9 PUSH + 257 PUSHINT + s2 PUSH + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + s0 PUSH + ISNULL + 128 THROWIF + 257 PUSHINT + 9 -1 -1 PUXCPU + s4 s-1 PUXC + s1 s3 s3 XCHG3 + DICTIGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + 128 THROWIF + s3 s-1 PUXC + MUL + 100 PUSHINT + DIV QOUT + 0 PUSHINT + s7 PUSH + 267 PUSHINT + s4 PUSH + 257 PUSHINT + s1 s3 s3 XCHG3 + DICTGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + NOT + <{ + s1 POP + s0 PUSH + ISNULL + 128 THROWIF + }> PUSHCONT + <{ + s0 POP + }> PUSHCONT + IFELSE + 267 PUSHINT + s0 s2 XCHG + ADD + s3 s7 XCHG + s1 s2 XCHG + 257 PUSHINT + 14 CALLDICT + s0 s4 XCHG + INC + }> PUSHCONT + WHILE + 2DROP + }> IFREFELSE + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> PUSHCONT + IFJMP + s0 PUSH + 3922648959 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 3922648959 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + s1 POP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + 37444 PUSHINT + 257 PUSHINT + 13 0 3 PUXC2 + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + s0 s1 XCHG + SDEQ + THROWANYIFNOT + -1 PUSHINT + 0 PUSHINT + 64 PUSHINT + s1 PUSH + <{ + NEWC + s0 s1 XCHG + 3125946401 PUSHINT + ROT + 32 STU + 257 PUSHINT + STIX + ENDC + }> CALLREF + s8 PUSH + 3 1 BLKSWAP + PUSHNULL + PUSHNULL + <{ + NEWC + 1 PUSHINT + s0 s1 XCHG + 2 STI + s0 s7 XCHG2 + s0 s1 XCHG + 1 STI + 0 PUSHINT + s0 s1 XCHG + 3 STI + s0 s5 XCHG2 + STSLICER + s0 s3 XCHG2 + STGRAMS + 0 PUSHINT + s0 s1 XCHG + 105 STI + s3 PUSH + ISNULL + NOT + s5 PUSH + ISNULL + NOT + OR + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + NEWC + 0 PUSHINT + s0 s1 XCHG + 1 STI + 0 PUSHINT + s0 s1 XCHG + 1 STI + s4 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s4 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s4 XCHG2 + STREF + }> PUSHCONT + <{ + s4 POP + s0 s3 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + s4 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s4 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s4 XCHG2 + STREF + }> PUSHCONT + <{ + s4 POP + s0 s3 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + 0 PUSHINT + s0 s1 XCHG + 1 STI + s0 s2 XCHG + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s2 XCHG + ENDC + ROT + STREF + }> PUSHCONT + <{ + s3 POP + s3 POP + s0 s1 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s1 XCHG + STREF + }> PUSHCONT + <{ + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + SENDRAWMSG + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> PUSHCONT + IFJMP + s0 PUSH + 1368467253 PUSHINT + EQUAL + <{ + s0 POP + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + s0 s10 XCHG + 32 LDU + s0 s1 XCHG + 1368467253 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + s1 POP + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + 53981 PUSHINT + 257 PUSHINT + 11 0 3 PUXC2 + ROTREV + DICTIGET + NULLSWAPIFNOT + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFNOT + s1 PUSH + SDEQ + s1 s2 XCHG + THROWANYIFNOT + s3 PUSH + 267 PUSHINT + s2 PUSH + 257 PUSHINT + s1 s3 s3 XCHG3 + DICTGET + NULLSWAPIFNOT + <{ + s0 s1 XCHG + LDI + s0 POP + }> PUSHCONT + <{ + 2DROP + PUSHNULL + }> PUSHCONT + IFELSE + 42983 PUSHINT + s1 PUSH + ISNULL + NOT + THROWANYIFNOT + s0 PUSH + ISNULL + 128 THROWIF + s0 s4 XCHG + 267 PUSHINT + s2 PUSH + 0 PUSHINT + 257 PUSHINT + 14 CALLDICT + -1 PUSHINT + s0 s5 XCHG + 150000000 PUSHINT + SUB + s5 s5 s0 XCHG3 + 64 PUSHINT + PUSHNULL + PUSHNULL + PUSHNULL + <{ + NEWC + 1 PUSHINT + s0 s1 XCHG + 2 STI + s0 s7 XCHG2 + s0 s1 XCHG + 1 STI + 0 PUSHINT + s0 s1 XCHG + 3 STI + s0 s5 XCHG2 + STSLICER + s0 s3 XCHG2 + STGRAMS + 0 PUSHINT + s0 s1 XCHG + 105 STI + s3 PUSH + ISNULL + NOT + s5 PUSH + ISNULL + NOT + OR + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + NEWC + 0 PUSHINT + s0 s1 XCHG + 1 STI + 0 PUSHINT + s0 s1 XCHG + 1 STI + s4 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s4 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s4 XCHG2 + STREF + }> PUSHCONT + <{ + s4 POP + s0 s3 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + s4 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s4 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s4 XCHG2 + STREF + }> PUSHCONT + <{ + s4 POP + s0 s3 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + 0 PUSHINT + s0 s1 XCHG + 1 STI + s0 s2 XCHG + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s2 XCHG + ENDC + ROT + STREF + }> PUSHCONT + <{ + s3 POP + s3 POP + s0 s1 XCHG + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + s1 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + 128 THROWIF + s0 s1 XCHG + STREF + }> PUSHCONT + <{ + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + SENDRAWMSG + }> CALLREF + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> IFJMPREF + 0 EQINT + s0 s1 XCHG + SBITS + 33 LESSINT + AND + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 10 1 BLKSWAP + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + c4 POP + }> PUSHCONT + IFJMP + 130 THROW + + 12: + ROTREV + DICTIGETREF + NULLSWAPIFNOT + IFRET + s0 POP + PUSHNULL + + 14: + s1 PUSH + ISNULL + <{ + 2DROP + ROTREV + DICTDEL + s0 POP + }> PUSHCONT + IFJMP + NEWC + s0 s1 XCHG + STIX + s1 s3 s3 XCHG3 + DICTSETB + + 70748: + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + <{ + 9 1 BLKDROP2 + }> CALLREF + + 87676: + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + <{ + s5 s9 XCHG + 9 BLKDROP + }> CALLREF + + 113617: + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + + 115768: + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + 1 10 BLKSWAP + <{ + s5 POP + 3 BLKDROP + s5 s6 XCHG2 + 5 BLKDROP + 257 PUSHINT + s0 s1 XCHG + 12 CALLDICT + <{ + s0 PUSH + ISNULL + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IFJMP + CTOS + <{ + 257 PUSHINT + LDI + LDDICT + 257 PUSHINT + LDI + 257 PUSHINT + LDI + 1 LDI + 1 LDI + s0 s1 XCHG + <{ + 1 LDI + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 6 1 BLKSWAP + }> CALLREF + 1 6 BLKDROP2 + 6 TUPLE + }> CALLREF + }> CALLREF + s0 PUSH + ISNULL + <{ + s0 POP + PUSHNULL + }> PUSHCONT + <{ + s0 PUSH + ISNULL + 128 THROWIF + 6 UNTUPLE + 6 TUPLE + }> PUSHCONT + IFELSE + s0 PUSH + ISNULL + <{ + s0 POP + PUSHNULL + }> PUSHCONT + IF + + 125436: + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDREF + s0 s1 XCHG + CTOS + LDDICT + 257 PUSHINT + LDI + ROTREV + s0 s2 XCHG + LDDICT + s3 s3 XCHG2 + s0 s3 XCHG + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDDICT + LDREF + s0 POP + CTOS + LDDICT + LDDICT + 257 PUSHINT + LDI + s0 POP + s8 s10 XCHG + s6 s7 XCHG + s5 s6 XCHG + 1 10 BLKDROP2 + <{ + 6 BLKDROP + 2 2 BLKDROP2 + }> CALLREF +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_Foundation.init.boc b/sources/output/jetton_Foundation.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..163f5ef29e7cd69aa46433923e480ac429db7810 GIT binary patch literal 128 zcmdn`ZcY&+BO4<_DFdU(e}*qhgum?hbb_0ai7|ALa#e4_gt9nxolv& z=c16+#KHbRkb&_IL+kDA?Cgdxw}gOZua6o{n?eqVFJR%|;HzMBGMLr0Xe9%b%f5ht ZuVTaW1q^EL3mE1@m3SRX^WaPK0RZ%PDmwrG literal 0 HcmV?d00001 diff --git a/sources/output/jetton_Foundation.init.fc b/sources/output/jetton_Foundation.init.fc new file mode 100644 index 0000000..c99988f --- /dev/null +++ b/sources/output/jetton_Foundation.init.fc @@ -0,0 +1,78 @@ +#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() { +} \ No newline at end of file diff --git a/sources/output/jetton_Foundation.init.fif b/sources/output/jetton_Foundation.init.fif new file mode 100644 index 0000000..196fef1 --- /dev/null +++ b/sources/output/jetton_Foundation.init.fif @@ -0,0 +1,93 @@ +PROGRAM{ + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __gen_write_AddressList + DECLPROC __gen_write_Distribution + DECLPROC __gen_write_Foundation + DECLPROC __gen_AddressList_from_tuple + DECLPROC __gen_Distribution_from_tuple + DECLPROC $__gen_Foundation_init + 107886 DECLMETHOD init + DECLPROC main + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __gen_write_AddressList PROCINLINE:<{ + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + }> + __gen_write_Distribution PROCINLINE:<{ + 3 -ROLL + __gen_write_AddressList INLINECALLDICT + STDICT + }> + __gen_write_Foundation PROCINLINE:<{ + s10 s9 s8 XCHG3 + __gen_write_AddressList INLINECALLDICT + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + __gen_write_Distribution INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + SWAP + STREF + }> + __gen_AddressList_from_tuple PROCINLINE:<{ + 2 UNTUPLE + }> + __gen_Distribution_from_tuple PROCINLINE:<{ + 2 UNTUPLE + SWAP + __gen_AddressList_from_tuple INLINECALLDICT + ROT + }> + $__gen_Foundation_init PROC:<{ + PUSHNULL + PUSHNULL + PUSHNULL + 0 PUSHINT + s0 s10 XCHG + NEWC + STREF + s0 s10 XCHG + s6 s9 XCHG + 4 5 REVERSE + s5 s6 XCHG + __gen_write_Foundation INLINECALLDICT + ENDC + }> + init PROC:<{ + s0 s2 XCHG + __gen_Distribution_from_tuple INLINECALLDICT + s0 s3 XCHG + __gen_AddressList_from_tuple INLINECALLDICT + s3 s5 XCHG + s1 s0 s4 XCHG3 + s0 s3 XCHG + $__gen_Foundation_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_Foundation.init.rev.fif b/sources/output/jetton_Foundation.init.rev.fif new file mode 100644 index 0000000..1aac198 --- /dev/null +++ b/sources/output/jetton_Foundation.init.rev.fif @@ -0,0 +1,64 @@ +SETCP0 +(:methods + recv_internal: + + 8: + PUSHNULL + PUSHNULL + PUSHNULL + 0 PUSHINT + s0 s10 XCHG + NEWC + STREF + s0 s10 XCHG + s6 s9 XCHG + 4 5 REVERSE + s5 s6 XCHG + s10 s9 s8 XCHG3 + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + NEWC + s6 s1 s3 XCHG3 + s5 s4 XCHG2 + 3 1 BLKSWAP + s0 s2 XCHG + STDICT + 257 PUSHINT + STIX + STDICT + s0 s1 XCHG + STSLICER + s1 s2 XCHG + STDICT + s0 s4 XCHG + NEWC + STDICT + s1 s3 XCHG + STDICT + 257 PUSHINT + STIX + ENDC + ROT + STREF + ENDC + s0 s1 XCHG + STREF + ENDC + + 107886: + s0 s2 XCHG + 2 UNTUPLE + s0 s1 XCHG + 2 UNTUPLE + ROT + s0 s3 XCHG + 2 UNTUPLE + s3 s5 XCHG + s1 s0 s4 XCHG3 + s0 s3 XCHG + 8 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_Foundation.md b/sources/output/jetton_Foundation.md new file mode 100644 index 0000000..2493c81 --- /dev/null +++ b/sources/output/jetton_Foundation.md @@ -0,0 +1,162 @@ +# TACT Compilation Report +Contract: Foundation +BOC Size: 3554 bytes + +# Types +Total Types: 36 + +## StateInit +TLB: `_ code:^cell data:^cell = StateInit` +Signature: `StateInit{code:^cell,data:^cell}` + +## Context +TLB: `_ bounced:bool sender:address value:int257 raw:^slice = Context` +Signature: `Context{bounced:bool,sender:address,value:int257,raw:^slice}` + +## SendParameters +TLB: `_ bounce:bool to:address value:int257 mode:int257 body:Maybe ^cell code:Maybe ^cell data:Maybe ^cell = SendParameters` +Signature: `SendParameters{bounce:bool,to:address,value:int257,mode:int257,body:Maybe ^cell,code:Maybe ^cell,data:Maybe ^cell}` + +## TokenTransfer +TLB: `token_transfer#0f8a7ea5 queryId:uint64 amount:coins destination:address responseDestination:Maybe address customPayload:Maybe ^cell forwardTonAmount:coins forwardPayload:remainder = TokenTransfer` +Signature: `TokenTransfer{queryId:uint64,amount:coins,destination:address,responseDestination:Maybe address,customPayload:Maybe ^cell,forwardTonAmount:coins,forwardPayload:remainder}` + +## TokenTransferInternal +TLB: `token_transfer_internal#178d4519 queryId:uint64 amount:coins from:address responseAddress:Maybe address forwardTonAmount:coins forwardPayload:remainder setLinker:Maybe int257 setLinkerAddress:Maybe address = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder,setLinker:Maybe int257,setLinkerAddress:Maybe address}` + +## TokenNotification +TLB: `token_notification#7362d09c queryId:uint64 amount:coins from:address forwardPayload:remainder = TokenNotification` +Signature: `TokenNotification{queryId:uint64,amount:coins,from:address,forwardPayload:remainder}` + +## TokenBurn +TLB: `token_burn#595f07bc queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurn` +Signature: `TokenBurn{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenBurnNotification +TLB: `token_burn_notification#7bdd97de queryId:uint64 amount:coins owner:address responseAddress:Maybe address = TokenBurnNotification` +Signature: `TokenBurnNotification{queryId:uint64,amount:coins,owner:address,responseAddress:Maybe address}` + +## TokenExcesses +TLB: `token_excesses#d53276db queryId:uint64 = TokenExcesses` +Signature: `TokenExcesses{queryId:uint64}` + +## TokenUpdateContent +TLB: `token_update_content#0c087a9e content:Maybe ^cell = TokenUpdateContent` +Signature: `TokenUpdateContent{content:Maybe ^cell}` + +## StakingWithdraw +TLB: `staking_withdraw#da803efd value:coins = StakingWithdraw` +Signature: `StakingWithdraw{value:coins}` + +## JettonData +TLB: `_ totalSupply:int257 mintable:bool owner:address content:Maybe ^cell walletCode:^cell = JettonData` +Signature: `JettonData{totalSupply:int257,mintable:bool,owner:address,content:Maybe ^cell,walletCode:^cell}` + +## JettonWalletData +TLB: `_ balance:int257 owner:address master:address walletCode:^cell = JettonWalletData` +Signature: `JettonWalletData{balance:int257,owner:address,master:address,walletCode:^cell}` + +## SetLinkerNeighbor +TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` +Signature: `SetLinkerNeighbor{neighbor:Maybe address}` + +## InitLinker +TLB: `init_linker#67c08154 neighbor:Maybe address walletAmount:int257 walletCode:^cell walletData:^cell walletAddress:address responseAddress:Maybe address = InitLinker` +Signature: `InitLinker{neighbor:Maybe address,walletAmount:int257,walletCode:^cell,walletData:^cell,walletAddress:address,responseAddress:Maybe address}` + +## ForwardToWallet +TLB: `forward_to_wallet#5d1da2bb body:^cell = ForwardToWallet` +Signature: `ForwardToWallet{body:^cell}` + +## BlacklistWallet +TLB: `blacklist_wallet#029c8396 wallet:address = BlacklistWallet` +Signature: `BlacklistWallet{wallet:address}` + +## InitiateBlacklistVote +TLB: `initiate_blacklist_vote#e8fffb0b adminIndex:int257 wallet:address quorum_percent:int257 vote_time:int257 = InitiateBlacklistVote` +Signature: `InitiateBlacklistVote{adminIndex:int257,wallet:address,quorum_percent:int257,vote_time:int257}` + +## InitiateLiquidationVote +TLB: `initiate_liquidation_vote#11fb862f adminIndex:int257 quorum_percent:int257 vote_time:int257 = InitiateLiquidationVote` +Signature: `InitiateLiquidationVote{adminIndex:int257,quorum_percent:int257,vote_time:int257}` + +## FinishVote +TLB: `finish_vote#2a574443 voteId:int257 = FinishVote` +Signature: `FinishVote{voteId:int257}` + +## VoteMsg +TLB: `vote_msg#58fde8ab voteId:int257 adminIndex:int257 vote:int257 = VoteMsg` +Signature: `VoteMsg{voteId:int257,adminIndex:int257,vote:int257}` + +## AddressList +TLB: `_ addresses:dict length:int257 = AddressList` +Signature: `AddressList{addresses:dict,length:int257}` + +## Distribution +TLB: `_ addresses:AddressList{addresses:dict,length:int257} percents:dict = Distribution` +Signature: `Distribution{addresses:AddressList{addresses:dict,length:int257},percents:dict}` + +## InitiateDistributionVote +TLB: `initiate_distribution_vote#95bd8d46 adminIndex:int257 quorum_percent:int257 vote_time:int257 distribution:Distribution{addresses:AddressList{addresses:dict,length:int257},percents:dict} = InitiateDistributionVote` +Signature: `InitiateDistributionVote{adminIndex:int257,quorum_percent:int257,vote_time:int257,distribution:Distribution{addresses:AddressList{addresses:dict,length:int257},percents:dict}}` + +## SetStakingPool +TLB: `set_staking_pool#0764d148 staking_pool:Maybe address = SetStakingPool` +Signature: `SetStakingPool{staking_pool:Maybe address}` + +## RequestLinker +TLB: `request_linker#5a29431e client:address = RequestLinker` +Signature: `RequestLinker{client:address}` + +## Unstake +TLB: `unstake#ba522821 amount:int257 = Unstake` +Signature: `Unstake{amount:int257}` + +## RequestUnstake +TLB: `request_unstake#e9cedf7f founderIndex:int257 = RequestUnstake` +Signature: `RequestUnstake{founderIndex:int257}` + +## CollectProfit +TLB: `collect_profit#51912735 adminIndex:int257 = CollectProfit` +Signature: `CollectProfit{adminIndex:int257}` + +## SetOwner +TLB: `set_owner#b71c6df6 owner:address = SetOwner` +Signature: `SetOwner{owner:address}` + +## WithdrawalRequests +TLB: `_ addresses:dict amounts:dict n_requests:int257 = WithdrawalRequests` +Signature: `WithdrawalRequests{addresses:dict,amounts:dict,n_requests:int257}` + +## Proposal +TLB: `_ type:int257 blacklistAddress:Maybe address distribution_addresses:dict distribution_addresses_length:Maybe int257 distribution_percents:dict = Proposal` +Signature: `Proposal{type:int257,blacklistAddress:Maybe address,distribution_addresses:dict,distribution_addresses_length:Maybe int257,distribution_percents:dict}` + +## Vote +TLB: `_ id:int257 votes:dict vote_end:int257 quorum_percent:int257 ended:bool result:Maybe bool = Vote` +Signature: `Vote{id:int257,votes:dict,vote_end:int257,quorum_percent:int257,ended:bool,result:Maybe bool}` + +## ChangeOwner +TLB: `change_owner#0f474d03 newOwner:address = ChangeOwner` +Signature: `ChangeOwner{newOwner:address}` + +## Deposit +TLB: `deposit#21eeb607 amount:coins = Deposit` +Signature: `Deposit{amount:coins}` + +## Withdraw +TLB: `withdraw#60591510 amount:int257 = Withdraw` +Signature: `Withdraw{amount:int257}` + +# Get Methods +Total Get Methods: 4 + +## numVotes + +## nthVote +Argument: n + +## AdminList + +## AdminPercents diff --git a/sources/output/jetton_Foundation.pkg b/sources/output/jetton_Foundation.pkg new file mode 100644 index 0000000..056c477 --- /dev/null +++ b/sources/output/jetton_Foundation.pkg @@ -0,0 +1 @@ +{"name":"Foundation","code":"te6ccgECOAEADdYAART/APSkE/S88sgLAQIBYgIDAgLMEBECASAEBQIBIAYHAgEgCgsBgblFztRNDUAfhi9ASBAQHXAFkC1AHQ9ASBAQHXAFkC9ARQMwP6QAEB9ATUMND0BPQEgQEB1wAwEIoQZxBWbBrbPICAGBuWfO1E0NQB+GL0BIEBAdcAWQLUAdD0BIEBAdcAWQL0BFAzA/pAAQH0BNQw0PQE9ASBAQHXADAQihBnEFZsGts8gJAARskQAIEFlfCQBNu70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYAgEgDA0BsbSHHaiaGoA/DF6AkCAgOuALIFqAOh6AkCAgOuALIF6AigZgf0gAID6AmoYaHoCegJAgID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AIEBAc8A9AABzxYS9AAEyPQAE/QAgQEBzwDJWMzJAczJ7VQAMJx/AcoAASBu8tCAAcyVMXABygDiyQH7AAARRZ9A1vodwwbYACNCFulVtZ9Fkw4MgBzwBBM/RBg=","abi":"{\"name\":\"Foundation\",\"types\":[{\"name\":\"StateInit\",\"header\":null,\"fields\":[{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"Context\",\"header\":null,\"fields\":[{\"name\":\"bounced\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"sender\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"raw\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false}}]},{\"name\":\"SendParameters\",\"header\":null,\"fields\":[{\"name\":\"bounce\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"to\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mode\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"code\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"data\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"TokenTransfer\",\"header\":260734629,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"destination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseDestination\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"customPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenTransferInternal\",\"header\":395134233,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"forwardTonAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}},{\"name\":\"setLinker\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":true,\"format\":257}},{\"name\":\"setLinkerAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenNotification\",\"header\":1935855772,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"from\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"forwardPayload\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false,\"format\":\"remainder\"}}]},{\"name\":\"TokenBurn\",\"header\":1499400124,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenBurnNotification\",\"header\":2078119902,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"TokenExcesses\",\"header\":3576854235,\"fields\":[{\"name\":\"queryId\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":64}}]},{\"name\":\"TokenUpdateContent\",\"header\":201882270,\"fields\":[{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"StakingWithdraw\",\"header\":3665837821,\"fields\":[{\"name\":\"value\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}}]},{\"name\":\"JettonData\",\"header\":null,\"fields\":[{\"name\":\"totalSupply\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"mintable\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"content\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"JettonWalletData\",\"header\":null,\"fields\":[{\"name\":\"balance\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"master\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"SetLinkerNeighbor\",\"header\":3019699393,\"fields\":[{\"name\":\"neighbor\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"InitLinker\",\"header\":1740669268,\"fields\":[{\"name\":\"neighbor\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"walletAmount\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"walletCode\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}},{\"name\":\"walletData\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}},{\"name\":\"walletAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"responseAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"ForwardToWallet\",\"header\":1562223291,\"fields\":[{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":false}}]},{\"name\":\"BlacklistWallet\",\"header\":43811734,\"fields\":[{\"name\":\"wallet\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"InitiateBlacklistVote\",\"header\":3909090059,\"fields\":[{\"name\":\"adminIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"wallet\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"quorum_percent\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"vote_time\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"InitiateLiquidationVote\",\"header\":301696559,\"fields\":[{\"name\":\"adminIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"quorum_percent\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"vote_time\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"FinishVote\",\"header\":710362179,\"fields\":[{\"name\":\"voteId\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"VoteMsg\",\"header\":1493035179,\"fields\":[{\"name\":\"voteId\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"adminIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"vote\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"AddressList\",\"header\":null,\"fields\":[{\"name\":\"addresses\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"address\"}},{\"name\":\"length\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"Distribution\",\"header\":null,\"fields\":[{\"name\":\"addresses\",\"type\":{\"kind\":\"simple\",\"type\":\"AddressList\",\"optional\":false}},{\"name\":\"percents\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"int\"}}]},{\"name\":\"InitiateDistributionVote\",\"header\":2512227654,\"fields\":[{\"name\":\"adminIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"quorum_percent\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"vote_time\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"distribution\",\"type\":{\"kind\":\"simple\",\"type\":\"Distribution\",\"optional\":false}}]},{\"name\":\"SetStakingPool\",\"header\":124047688,\"fields\":[{\"name\":\"staking_pool\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"name\":\"RequestLinker\",\"header\":1512653598,\"fields\":[{\"name\":\"client\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"Unstake\",\"header\":3125946401,\"fields\":[{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"RequestUnstake\",\"header\":3922648959,\"fields\":[{\"name\":\"founderIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"CollectProfit\",\"header\":1368467253,\"fields\":[{\"name\":\"adminIndex\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"SetOwner\",\"header\":3072093686,\"fields\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"WithdrawalRequests\",\"header\":null,\"fields\":[{\"name\":\"addresses\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"address\"}},{\"name\":\"amounts\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"int\"}},{\"name\":\"n_requests\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]},{\"name\":\"Proposal\",\"header\":null,\"fields\":[{\"name\":\"type\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"blacklistAddress\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}},{\"name\":\"distribution_addresses\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"address\"}},{\"name\":\"distribution_addresses_length\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":true,\"format\":257}},{\"name\":\"distribution_percents\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"int\"}}]},{\"name\":\"Vote\",\"header\":null,\"fields\":[{\"name\":\"id\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"votes\",\"type\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"int\"}},{\"name\":\"vote_end\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"quorum_percent\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"ended\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":false}},{\"name\":\"result\",\"type\":{\"kind\":\"simple\",\"type\":\"bool\",\"optional\":true}}]},{\"name\":\"ChangeOwner\",\"header\":256331011,\"fields\":[{\"name\":\"newOwner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"Deposit\",\"header\":569292295,\"fields\":[{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}}]},{\"name\":\"Withdraw\",\"header\":1616450832,\"fields\":[{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}]}],\"receivers\":[{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"FinishVote\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"VoteMsg\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"InitiateBlacklistVote\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"InitiateDistributionVote\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"InitiateLiquidationVote\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"Unstake\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"RequestUnstake\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"CollectProfit\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"empty\"}}],\"getters\":[{\"name\":\"numVotes\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"nthVote\",\"arguments\":[{\"name\":\"n\",\"type\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}],\"returnType\":{\"kind\":\"simple\",\"type\":\"Vote\",\"optional\":true}},{\"name\":\"AdminList\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"AddressList\",\"optional\":false}},{\"name\":\"AdminPercents\",\"arguments\":[],\"returnType\":{\"kind\":\"dict\",\"key\":\"int\",\"value\":\"int\"}}],\"errors\":{\"2\":{\"message\":\"Stack undeflow\"},\"3\":{\"message\":\"Stack overflow\"},\"4\":{\"message\":\"Integer overflow\"},\"5\":{\"message\":\"Integer out of expected range\"},\"6\":{\"message\":\"Invalid opcode\"},\"7\":{\"message\":\"Type check error\"},\"8\":{\"message\":\"Cell overflow\"},\"9\":{\"message\":\"Cell underflow\"},\"10\":{\"message\":\"Dictionary error\"},\"13\":{\"message\":\"Out of gas error\"},\"32\":{\"message\":\"Method ID not found\"},\"34\":{\"message\":\"Action is invalid or not supported\"},\"37\":{\"message\":\"Not enough TON\"},\"38\":{\"message\":\"Not enough extra-currencies\"},\"128\":{\"message\":\"Null reference exception\"},\"129\":{\"message\":\"Invalid serialization prefix\"},\"130\":{\"message\":\"Invalid incoming message\"},\"131\":{\"message\":\"Constraints error\"},\"132\":{\"message\":\"Access denied\"},\"133\":{\"message\":\"Contract stopped\"},\"134\":{\"message\":\"Invalid argument\"},\"135\":{\"message\":\"Code of a contract was not found\"},\"136\":{\"message\":\"Invalid address\"},\"4429\":{\"message\":\"Invalid sender\"},\"6384\":{\"message\":\"not enough money for withdraw\"},\"6873\":{\"message\":\"Only an admin can initiate a vote\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"18474\":{\"message\":\"only the owner can set a new owner\"},\"19362\":{\"message\":\"Invalid quorum percent\"},\"29720\":{\"message\":\"Invalid vote\"},\"29821\":{\"message\":\"Voting requires at least 1 ton for the fees\"},\"30386\":{\"message\":\"Vote already ended\"},\"32366\":{\"message\":\"not enough money for deposit\"},\"34326\":{\"message\":\"Vote is not finished yet\"},\"37444\":{\"message\":\"Only a founder can request unstake\"},\"41207\":{\"message\":\"invalid sender\"},\"42983\":{\"message\":\"No profit to collect\"},\"44816\":{\"message\":\"Wallet is blacklisted\"},\"46931\":{\"message\":\"Invalid vote id\"},\"49606\":{\"message\":\"Invalid admin index\"},\"53981\":{\"message\":\"Only an admin can collect profit\"},\"56549\":{\"message\":\"Only an admin can vote\"},\"61070\":{\"message\":\"Invalid vote time\"},\"61265\":{\"message\":\"Only the owner can trigger un-staking\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBgEAdQABFP8A9KQT9LzyyAsBAgFiAgMCAswEBQAnoUrcBN5EAt5EsAbeRCBqgggH4BEAAdwAhdtra2uAVkZgUINK8SiCslTAF6AECAgOeAZCMJqCoqkAF6AECAgOeAegAA54sJegACZHoACfoAQICA54BkrGZkgOZkw=","args":[{"name":"admins","type":{"kind":"simple","type":"Distribution","optional":false}},{"name":"founders","type":{"kind":"simple","type":"AddressList","optional":false}},{"name":"tonb","type":{"kind":"simple","type":"address","optional":false}}],"deployment":{"kind":"system-cell","system":"te6cckEC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fwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFuszEAMJx/AcoAASBu8tCAAcyVMXABygDiyQH7AAAcyAGCCpyDlljLHwHPFskAZCBukjBt4NCBAQHXAPpAIdcLAcMAkQGSMW3iAfQE0gABlYEBAdcAkm0B4vQEVUBsFW8FAQzIVVDbPMk1AExQVoEBAc8AE/QAgQEBzwCBAQHPAMoAIW6zln8BygDKAJRwMsoA4gHmgQEBVFcAUjBBM/QMb6GUAdcAMJJbbeIgbvLQgCDAAY5OIMACjh8wgQEBVF8AUjBBM/QMb6GUAdcAMJJbbeIgbvLQgBOgjiXAAI4fgQEBVF8AUjBBM/QMb6GUAdcAMJJbbeIgbvLQgBKgAd4C4kAT4w0DpDcAPjCBAQFUXwBSMEEz9AxvoZQB1wAwkltt4iBu8tCAFKABGiBukjBt4NDbPGwWbwY5AD6BAQHXAPQEgQEB1wCBAQHXANIA0gABktIAkm0B4lVQ3xyhHA=="}},"compiler":{"name":"tact","version":"0.9.2"}} \ No newline at end of file diff --git a/sources/output/jetton_Foundation.ts b/sources/output/jetton_Foundation.ts new file mode 100644 index 0000000..ac98060 --- /dev/null +++ b/sources/output/jetton_Foundation.ts @@ -0,0 +1,1978 @@ +import { Cell, Slice, Address, Builder, beginCell, ComputeError, TupleItem, TupleReader, Dictionary, contractAddress, ContractProvider, Sender, Contract, ContractABI, TupleBuilder, DictionaryValue } from 'ton-core'; +import { ContractSystem, ContractExecutor } from 'ton-emulator'; + +export type StateInit = { + $$type: 'StateInit'; + code: Cell; + data: Cell; +} + +export function storeStateInit(src: StateInit) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeRef(src.code); + b_0.storeRef(src.data); + }; +} + +export function loadStateInit(slice: Slice) { + let sc_0 = slice; + let _code = sc_0.loadRef(); + let _data = sc_0.loadRef(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; +} + +function loadTupleStateInit(source: TupleReader) { + let _code = source.readCell(); + let _data = source.readCell(); + return { $$type: 'StateInit' as const, code: _code, data: _data }; +} + +function storeTupleStateInit(source: StateInit) { + let builder = new TupleBuilder(); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); +} + +function dictValueParserStateInit(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeStateInit(src)).endCell()); + }, + parse: (src) => { + return loadStateInit(src.loadRef().beginParse()); + } + } +} +export type Context = { + $$type: 'Context'; + bounced: boolean; + sender: Address; + value: bigint; + raw: Cell; +} + +export function storeContext(src: Context) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounced); + b_0.storeAddress(src.sender); + b_0.storeInt(src.value, 257); + b_0.storeRef(src.raw); + }; +} + +export function loadContext(slice: Slice) { + let sc_0 = slice; + let _bounced = sc_0.loadBit(); + let _sender = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _raw = sc_0.loadRef(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function loadTupleContext(source: TupleReader) { + let _bounced = source.readBoolean(); + let _sender = source.readAddress(); + let _value = source.readBigNumber(); + let _raw = source.readCell(); + return { $$type: 'Context' as const, bounced: _bounced, sender: _sender, value: _value, raw: _raw }; +} + +function storeTupleContext(source: Context) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounced); + builder.writeAddress(source.sender); + builder.writeNumber(source.value); + builder.writeSlice(source.raw); + return builder.build(); +} + +function dictValueParserContext(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeContext(src)).endCell()); + }, + parse: (src) => { + return loadContext(src.loadRef().beginParse()); + } + } +} +export type SendParameters = { + $$type: 'SendParameters'; + bounce: boolean; + to: Address; + value: bigint; + mode: bigint; + body: Cell | null; + code: Cell | null; + data: Cell | null; +} + +export function storeSendParameters(src: SendParameters) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeBit(src.bounce); + b_0.storeAddress(src.to); + b_0.storeInt(src.value, 257); + b_0.storeInt(src.mode, 257); + if (src.body !== null && src.body !== undefined) { b_0.storeBit(true).storeRef(src.body); } else { b_0.storeBit(false); } + if (src.code !== null && src.code !== undefined) { b_0.storeBit(true).storeRef(src.code); } else { b_0.storeBit(false); } + if (src.data !== null && src.data !== undefined) { b_0.storeBit(true).storeRef(src.data); } else { b_0.storeBit(false); } + }; +} + +export function loadSendParameters(slice: Slice) { + let sc_0 = slice; + let _bounce = sc_0.loadBit(); + let _to = sc_0.loadAddress(); + let _value = sc_0.loadIntBig(257); + let _mode = sc_0.loadIntBig(257); + let _body = sc_0.loadBit() ? sc_0.loadRef() : null; + let _code = sc_0.loadBit() ? sc_0.loadRef() : null; + let _data = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function loadTupleSendParameters(source: TupleReader) { + let _bounce = source.readBoolean(); + let _to = source.readAddress(); + let _value = source.readBigNumber(); + let _mode = source.readBigNumber(); + let _body = source.readCellOpt(); + let _code = source.readCellOpt(); + let _data = source.readCellOpt(); + return { $$type: 'SendParameters' as const, bounce: _bounce, to: _to, value: _value, mode: _mode, body: _body, code: _code, data: _data }; +} + +function storeTupleSendParameters(source: SendParameters) { + let builder = new TupleBuilder(); + builder.writeBoolean(source.bounce); + builder.writeAddress(source.to); + builder.writeNumber(source.value); + builder.writeNumber(source.mode); + builder.writeCell(source.body); + builder.writeCell(source.code); + builder.writeCell(source.data); + return builder.build(); +} + +function dictValueParserSendParameters(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSendParameters(src)).endCell()); + }, + parse: (src) => { + return loadSendParameters(src.loadRef().beginParse()); + } + } +} +export type TokenTransfer = { + $$type: 'TokenTransfer'; + queryId: bigint; + amount: bigint; + destination: Address; + responseDestination: Address | null; + customPayload: Cell | null; + forwardTonAmount: bigint; + forwardPayload: Cell; +} + +export function storeTokenTransfer(src: TokenTransfer) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(260734629, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.destination); + b_0.storeAddress(src.responseDestination); + if (src.customPayload !== null && src.customPayload !== undefined) { b_0.storeBit(true).storeRef(src.customPayload); } else { b_0.storeBit(false); } + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenTransfer(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 260734629) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _destination = sc_0.loadAddress(); + let _responseDestination = sc_0.loadMaybeAddress(); + let _customPayload = sc_0.loadBit() ? sc_0.loadRef() : null; + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenTransfer(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _destination = source.readAddress(); + let _responseDestination = source.readAddressOpt(); + let _customPayload = source.readCellOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenTransfer' as const, queryId: _queryId, amount: _amount, destination: _destination, responseDestination: _responseDestination, customPayload: _customPayload, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenTransfer(source: TokenTransfer) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.destination); + builder.writeAddress(source.responseDestination); + builder.writeCell(source.customPayload); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenTransfer(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransfer(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransfer(src.loadRef().beginParse()); + } + } +} +export type TokenTransferInternal = { + $$type: 'TokenTransferInternal'; + queryId: bigint; + amount: bigint; + from: Address; + responseAddress: Address | null; + forwardTonAmount: bigint; + forwardPayload: Cell; + setLinker: bigint | null; + setLinkerAddress: Address | null; +} + +export function storeTokenTransferInternal(src: TokenTransferInternal) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(395134233, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + b_0.storeAddress(src.responseAddress); + b_0.storeCoins(src.forwardTonAmount); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + let b_1 = new Builder(); + if (src.setLinker !== null && src.setLinker !== undefined) { b_1.storeBit(true).storeInt(src.setLinker, 257); } else { b_1.storeBit(false); } + b_1.storeAddress(src.setLinkerAddress); + b_0.storeRef(b_1.endCell()); + }; +} + +export function loadTokenTransferInternal(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 395134233) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _responseAddress = sc_0.loadMaybeAddress(); + let _forwardTonAmount = sc_0.loadCoins(); + let _forwardPayload = sc_0.asCell(); + let sc_1 = sc_0.loadRef().beginParse(); + let _setLinker = sc_1.loadBit() ? sc_1.loadIntBig(257) : null; + let _setLinkerAddress = sc_1.loadMaybeAddress(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress }; +} + +function loadTupleTokenTransferInternal(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + let _forwardTonAmount = source.readBigNumber(); + let _forwardPayload = source.readCell(); + let _setLinker = source.readBigNumberOpt(); + let _setLinkerAddress = source.readAddressOpt(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload, setLinker: _setLinker, setLinkerAddress: _setLinkerAddress }; +} + +function storeTupleTokenTransferInternal(source: TokenTransferInternal) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeAddress(source.responseAddress); + builder.writeNumber(source.forwardTonAmount); + builder.writeSlice(source.forwardPayload); + builder.writeNumber(source.setLinker); + builder.writeAddress(source.setLinkerAddress); + return builder.build(); +} + +function dictValueParserTokenTransferInternal(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenTransferInternal(src)).endCell()); + }, + parse: (src) => { + return loadTokenTransferInternal(src.loadRef().beginParse()); + } + } +} +export type TokenNotification = { + $$type: 'TokenNotification'; + queryId: bigint; + amount: bigint; + from: Address; + forwardPayload: Cell; +} + +export function storeTokenNotification(src: TokenNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1935855772, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.from); + b_0.storeBuilder(src.forwardPayload.asBuilder()); + }; +} + +export function loadTokenNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1935855772) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _from = sc_0.loadAddress(); + let _forwardPayload = sc_0.asCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function loadTupleTokenNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _from = source.readAddress(); + let _forwardPayload = source.readCell(); + return { $$type: 'TokenNotification' as const, queryId: _queryId, amount: _amount, from: _from, forwardPayload: _forwardPayload }; +} + +function storeTupleTokenNotification(source: TokenNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.from); + builder.writeSlice(source.forwardPayload); + return builder.build(); +} + +function dictValueParserTokenNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenNotification(src.loadRef().beginParse()); + } + } +} +export type TokenBurn = { + $$type: 'TokenBurn'; + queryId: bigint; + amount: bigint; + owner: Address; + responseAddress: Address | null; +} + +export function storeTokenBurn(src: TokenBurn) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1499400124, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + b_0.storeAddress(src.responseAddress); + }; +} + +export function loadTokenBurn(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1499400124) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadMaybeAddress(); + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurn(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurn' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurn(source: TokenBurn) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurn(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurn(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurn(src.loadRef().beginParse()); + } + } +} +export type TokenBurnNotification = { + $$type: 'TokenBurnNotification'; + queryId: bigint; + amount: bigint; + owner: Address; + responseAddress: Address | null; +} + +export function storeTokenBurnNotification(src: TokenBurnNotification) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(2078119902, 32); + b_0.storeUint(src.queryId, 64); + b_0.storeCoins(src.amount); + b_0.storeAddress(src.owner); + b_0.storeAddress(src.responseAddress); + }; +} + +export function loadTokenBurnNotification(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 2078119902) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + let _amount = sc_0.loadCoins(); + let _owner = sc_0.loadAddress(); + let _responseAddress = sc_0.loadMaybeAddress(); + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function loadTupleTokenBurnNotification(source: TupleReader) { + let _queryId = source.readBigNumber(); + let _amount = source.readBigNumber(); + let _owner = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'TokenBurnNotification' as const, queryId: _queryId, amount: _amount, owner: _owner, responseAddress: _responseAddress }; +} + +function storeTupleTokenBurnNotification(source: TokenBurnNotification) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + builder.writeNumber(source.amount); + builder.writeAddress(source.owner); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserTokenBurnNotification(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenBurnNotification(src)).endCell()); + }, + parse: (src) => { + return loadTokenBurnNotification(src.loadRef().beginParse()); + } + } +} +export type TokenExcesses = { + $$type: 'TokenExcesses'; + queryId: bigint; +} + +export function storeTokenExcesses(src: TokenExcesses) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3576854235, 32); + b_0.storeUint(src.queryId, 64); + }; +} + +export function loadTokenExcesses(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3576854235) { throw Error('Invalid prefix'); } + let _queryId = sc_0.loadUintBig(64); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; +} + +function loadTupleTokenExcesses(source: TupleReader) { + let _queryId = source.readBigNumber(); + return { $$type: 'TokenExcesses' as const, queryId: _queryId }; +} + +function storeTupleTokenExcesses(source: TokenExcesses) { + let builder = new TupleBuilder(); + builder.writeNumber(source.queryId); + return builder.build(); +} + +function dictValueParserTokenExcesses(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenExcesses(src)).endCell()); + }, + parse: (src) => { + return loadTokenExcesses(src.loadRef().beginParse()); + } + } +} +export type TokenUpdateContent = { + $$type: 'TokenUpdateContent'; + content: Cell | null; +} + +export function storeTokenUpdateContent(src: TokenUpdateContent) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(201882270, 32); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + }; +} + +export function loadTokenUpdateContent(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 201882270) { throw Error('Invalid prefix'); } + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + return { $$type: 'TokenUpdateContent' as const, content: _content }; +} + +function loadTupleTokenUpdateContent(source: TupleReader) { + let _content = source.readCellOpt(); + return { $$type: 'TokenUpdateContent' as const, content: _content }; +} + +function storeTupleTokenUpdateContent(source: TokenUpdateContent) { + let builder = new TupleBuilder(); + builder.writeCell(source.content); + return builder.build(); +} + +function dictValueParserTokenUpdateContent(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeTokenUpdateContent(src)).endCell()); + }, + parse: (src) => { + return loadTokenUpdateContent(src.loadRef().beginParse()); + } + } +} +export type StakingWithdraw = { + $$type: 'StakingWithdraw'; + value: bigint; +} + +export function storeStakingWithdraw(src: StakingWithdraw) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3665837821, 32); + b_0.storeCoins(src.value); + }; +} + +export function loadStakingWithdraw(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3665837821) { throw Error('Invalid prefix'); } + let _value = sc_0.loadCoins(); + return { $$type: 'StakingWithdraw' as const, value: _value }; +} + +function loadTupleStakingWithdraw(source: TupleReader) { + let _value = source.readBigNumber(); + return { $$type: 'StakingWithdraw' as const, value: _value }; +} + +function storeTupleStakingWithdraw(source: StakingWithdraw) { + let builder = new TupleBuilder(); + builder.writeNumber(source.value); + return builder.build(); +} + +function dictValueParserStakingWithdraw(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeStakingWithdraw(src)).endCell()); + }, + parse: (src) => { + return loadStakingWithdraw(src.loadRef().beginParse()); + } + } +} +export type JettonData = { + $$type: 'JettonData'; + totalSupply: bigint; + mintable: boolean; + owner: Address; + content: Cell | null; + walletCode: Cell; +} + +export function storeJettonData(src: JettonData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.totalSupply, 257); + b_0.storeBit(src.mintable); + b_0.storeAddress(src.owner); + if (src.content !== null && src.content !== undefined) { b_0.storeBit(true).storeRef(src.content); } else { b_0.storeBit(false); } + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonData(slice: Slice) { + let sc_0 = slice; + let _totalSupply = sc_0.loadIntBig(257); + let _mintable = sc_0.loadBit(); + let _owner = sc_0.loadAddress(); + let _content = sc_0.loadBit() ? sc_0.loadRef() : null; + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function loadTupleJettonData(source: TupleReader) { + let _totalSupply = source.readBigNumber(); + let _mintable = source.readBoolean(); + let _owner = source.readAddress(); + let _content = source.readCellOpt(); + let _walletCode = source.readCell(); + return { $$type: 'JettonData' as const, totalSupply: _totalSupply, mintable: _mintable, owner: _owner, content: _content, walletCode: _walletCode }; +} + +function storeTupleJettonData(source: JettonData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.totalSupply); + builder.writeBoolean(source.mintable); + builder.writeAddress(source.owner); + builder.writeCell(source.content); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonData(src)).endCell()); + }, + parse: (src) => { + return loadJettonData(src.loadRef().beginParse()); + } + } +} +export type JettonWalletData = { + $$type: 'JettonWalletData'; + balance: bigint; + owner: Address; + master: Address; + walletCode: Cell; +} + +export function storeJettonWalletData(src: JettonWalletData) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.balance, 257); + b_0.storeAddress(src.owner); + b_0.storeAddress(src.master); + b_0.storeRef(src.walletCode); + }; +} + +export function loadJettonWalletData(slice: Slice) { + let sc_0 = slice; + let _balance = sc_0.loadIntBig(257); + let _owner = sc_0.loadAddress(); + let _master = sc_0.loadAddress(); + let _walletCode = sc_0.loadRef(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function loadTupleJettonWalletData(source: TupleReader) { + let _balance = source.readBigNumber(); + let _owner = source.readAddress(); + let _master = source.readAddress(); + let _walletCode = source.readCell(); + return { $$type: 'JettonWalletData' as const, balance: _balance, owner: _owner, master: _master, walletCode: _walletCode }; +} + +function storeTupleJettonWalletData(source: JettonWalletData) { + let builder = new TupleBuilder(); + builder.writeNumber(source.balance); + builder.writeAddress(source.owner); + builder.writeAddress(source.master); + builder.writeCell(source.walletCode); + return builder.build(); +} + +function dictValueParserJettonWalletData(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeJettonWalletData(src)).endCell()); + }, + parse: (src) => { + return loadJettonWalletData(src.loadRef().beginParse()); + } + } +} +export type SetLinkerNeighbor = { + $$type: 'SetLinkerNeighbor'; + neighbor: Address | null; +} + +export function storeSetLinkerNeighbor(src: SetLinkerNeighbor) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3019699393, 32); + b_0.storeAddress(src.neighbor); + }; +} + +export function loadSetLinkerNeighbor(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3019699393) { throw Error('Invalid prefix'); } + let _neighbor = sc_0.loadMaybeAddress(); + return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; +} + +function loadTupleSetLinkerNeighbor(source: TupleReader) { + let _neighbor = source.readAddressOpt(); + return { $$type: 'SetLinkerNeighbor' as const, neighbor: _neighbor }; +} + +function storeTupleSetLinkerNeighbor(source: SetLinkerNeighbor) { + let builder = new TupleBuilder(); + builder.writeAddress(source.neighbor); + return builder.build(); +} + +function dictValueParserSetLinkerNeighbor(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSetLinkerNeighbor(src)).endCell()); + }, + parse: (src) => { + return loadSetLinkerNeighbor(src.loadRef().beginParse()); + } + } +} +export type InitLinker = { + $$type: 'InitLinker'; + neighbor: Address | null; + walletAmount: bigint; + walletCode: Cell; + walletData: Cell; + walletAddress: Address; + responseAddress: Address | null; +} + +export function storeInitLinker(src: InitLinker) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1740669268, 32); + b_0.storeAddress(src.neighbor); + b_0.storeInt(src.walletAmount, 257); + b_0.storeRef(src.walletCode); + b_0.storeRef(src.walletData); + b_0.storeAddress(src.walletAddress); + let b_1 = new Builder(); + b_1.storeAddress(src.responseAddress); + b_0.storeRef(b_1.endCell()); + }; +} + +export function loadInitLinker(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1740669268) { throw Error('Invalid prefix'); } + let _neighbor = sc_0.loadMaybeAddress(); + let _walletAmount = sc_0.loadIntBig(257); + let _walletCode = sc_0.loadRef(); + let _walletData = sc_0.loadRef(); + let _walletAddress = sc_0.loadAddress(); + let sc_1 = sc_0.loadRef().beginParse(); + let _responseAddress = sc_1.loadMaybeAddress(); + return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress }; +} + +function loadTupleInitLinker(source: TupleReader) { + let _neighbor = source.readAddressOpt(); + let _walletAmount = source.readBigNumber(); + let _walletCode = source.readCell(); + let _walletData = source.readCell(); + let _walletAddress = source.readAddress(); + let _responseAddress = source.readAddressOpt(); + return { $$type: 'InitLinker' as const, neighbor: _neighbor, walletAmount: _walletAmount, walletCode: _walletCode, walletData: _walletData, walletAddress: _walletAddress, responseAddress: _responseAddress }; +} + +function storeTupleInitLinker(source: InitLinker) { + let builder = new TupleBuilder(); + builder.writeAddress(source.neighbor); + builder.writeNumber(source.walletAmount); + builder.writeCell(source.walletCode); + builder.writeCell(source.walletData); + builder.writeAddress(source.walletAddress); + builder.writeAddress(source.responseAddress); + return builder.build(); +} + +function dictValueParserInitLinker(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeInitLinker(src)).endCell()); + }, + parse: (src) => { + return loadInitLinker(src.loadRef().beginParse()); + } + } +} +export type ForwardToWallet = { + $$type: 'ForwardToWallet'; + body: Cell; +} + +export function storeForwardToWallet(src: ForwardToWallet) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1562223291, 32); + b_0.storeRef(src.body); + }; +} + +export function loadForwardToWallet(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1562223291) { throw Error('Invalid prefix'); } + let _body = sc_0.loadRef(); + return { $$type: 'ForwardToWallet' as const, body: _body }; +} + +function loadTupleForwardToWallet(source: TupleReader) { + let _body = source.readCell(); + return { $$type: 'ForwardToWallet' as const, body: _body }; +} + +function storeTupleForwardToWallet(source: ForwardToWallet) { + let builder = new TupleBuilder(); + builder.writeCell(source.body); + return builder.build(); +} + +function dictValueParserForwardToWallet(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeForwardToWallet(src)).endCell()); + }, + parse: (src) => { + return loadForwardToWallet(src.loadRef().beginParse()); + } + } +} +export type BlacklistWallet = { + $$type: 'BlacklistWallet'; + wallet: Address; +} + +export function storeBlacklistWallet(src: BlacklistWallet) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(43811734, 32); + b_0.storeAddress(src.wallet); + }; +} + +export function loadBlacklistWallet(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 43811734) { throw Error('Invalid prefix'); } + let _wallet = sc_0.loadAddress(); + return { $$type: 'BlacklistWallet' as const, wallet: _wallet }; +} + +function loadTupleBlacklistWallet(source: TupleReader) { + let _wallet = source.readAddress(); + return { $$type: 'BlacklistWallet' as const, wallet: _wallet }; +} + +function storeTupleBlacklistWallet(source: BlacklistWallet) { + let builder = new TupleBuilder(); + builder.writeAddress(source.wallet); + return builder.build(); +} + +function dictValueParserBlacklistWallet(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeBlacklistWallet(src)).endCell()); + }, + parse: (src) => { + return loadBlacklistWallet(src.loadRef().beginParse()); + } + } +} +export type InitiateBlacklistVote = { + $$type: 'InitiateBlacklistVote'; + adminIndex: bigint; + wallet: Address; + quorum_percent: bigint; + vote_time: bigint; +} + +export function storeInitiateBlacklistVote(src: InitiateBlacklistVote) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3909090059, 32); + b_0.storeInt(src.adminIndex, 257); + b_0.storeAddress(src.wallet); + b_0.storeInt(src.quorum_percent, 257); + let b_1 = new Builder(); + b_1.storeInt(src.vote_time, 257); + b_0.storeRef(b_1.endCell()); + }; +} + +export function loadInitiateBlacklistVote(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3909090059) { throw Error('Invalid prefix'); } + let _adminIndex = sc_0.loadIntBig(257); + let _wallet = sc_0.loadAddress(); + let _quorum_percent = sc_0.loadIntBig(257); + let sc_1 = sc_0.loadRef().beginParse(); + let _vote_time = sc_1.loadIntBig(257); + return { $$type: 'InitiateBlacklistVote' as const, adminIndex: _adminIndex, wallet: _wallet, quorum_percent: _quorum_percent, vote_time: _vote_time }; +} + +function loadTupleInitiateBlacklistVote(source: TupleReader) { + let _adminIndex = source.readBigNumber(); + let _wallet = source.readAddress(); + let _quorum_percent = source.readBigNumber(); + let _vote_time = source.readBigNumber(); + return { $$type: 'InitiateBlacklistVote' as const, adminIndex: _adminIndex, wallet: _wallet, quorum_percent: _quorum_percent, vote_time: _vote_time }; +} + +function storeTupleInitiateBlacklistVote(source: InitiateBlacklistVote) { + let builder = new TupleBuilder(); + builder.writeNumber(source.adminIndex); + builder.writeAddress(source.wallet); + builder.writeNumber(source.quorum_percent); + builder.writeNumber(source.vote_time); + return builder.build(); +} + +function dictValueParserInitiateBlacklistVote(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeInitiateBlacklistVote(src)).endCell()); + }, + parse: (src) => { + return loadInitiateBlacklistVote(src.loadRef().beginParse()); + } + } +} +export type InitiateLiquidationVote = { + $$type: 'InitiateLiquidationVote'; + adminIndex: bigint; + quorum_percent: bigint; + vote_time: bigint; +} + +export function storeInitiateLiquidationVote(src: InitiateLiquidationVote) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(301696559, 32); + b_0.storeInt(src.adminIndex, 257); + b_0.storeInt(src.quorum_percent, 257); + b_0.storeInt(src.vote_time, 257); + }; +} + +export function loadInitiateLiquidationVote(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 301696559) { throw Error('Invalid prefix'); } + let _adminIndex = sc_0.loadIntBig(257); + let _quorum_percent = sc_0.loadIntBig(257); + let _vote_time = sc_0.loadIntBig(257); + return { $$type: 'InitiateLiquidationVote' as const, adminIndex: _adminIndex, quorum_percent: _quorum_percent, vote_time: _vote_time }; +} + +function loadTupleInitiateLiquidationVote(source: TupleReader) { + let _adminIndex = source.readBigNumber(); + let _quorum_percent = source.readBigNumber(); + let _vote_time = source.readBigNumber(); + return { $$type: 'InitiateLiquidationVote' as const, adminIndex: _adminIndex, quorum_percent: _quorum_percent, vote_time: _vote_time }; +} + +function storeTupleInitiateLiquidationVote(source: InitiateLiquidationVote) { + let builder = new TupleBuilder(); + builder.writeNumber(source.adminIndex); + builder.writeNumber(source.quorum_percent); + builder.writeNumber(source.vote_time); + return builder.build(); +} + +function dictValueParserInitiateLiquidationVote(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeInitiateLiquidationVote(src)).endCell()); + }, + parse: (src) => { + return loadInitiateLiquidationVote(src.loadRef().beginParse()); + } + } +} +export type FinishVote = { + $$type: 'FinishVote'; + voteId: bigint; +} + +export function storeFinishVote(src: FinishVote) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(710362179, 32); + b_0.storeInt(src.voteId, 257); + }; +} + +export function loadFinishVote(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 710362179) { throw Error('Invalid prefix'); } + let _voteId = sc_0.loadIntBig(257); + return { $$type: 'FinishVote' as const, voteId: _voteId }; +} + +function loadTupleFinishVote(source: TupleReader) { + let _voteId = source.readBigNumber(); + return { $$type: 'FinishVote' as const, voteId: _voteId }; +} + +function storeTupleFinishVote(source: FinishVote) { + let builder = new TupleBuilder(); + builder.writeNumber(source.voteId); + return builder.build(); +} + +function dictValueParserFinishVote(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeFinishVote(src)).endCell()); + }, + parse: (src) => { + return loadFinishVote(src.loadRef().beginParse()); + } + } +} +export type VoteMsg = { + $$type: 'VoteMsg'; + voteId: bigint; + adminIndex: bigint; + vote: bigint; +} + +export function storeVoteMsg(src: VoteMsg) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1493035179, 32); + b_0.storeInt(src.voteId, 257); + b_0.storeInt(src.adminIndex, 257); + b_0.storeInt(src.vote, 257); + }; +} + +export function loadVoteMsg(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1493035179) { throw Error('Invalid prefix'); } + let _voteId = sc_0.loadIntBig(257); + let _adminIndex = sc_0.loadIntBig(257); + let _vote = sc_0.loadIntBig(257); + return { $$type: 'VoteMsg' as const, voteId: _voteId, adminIndex: _adminIndex, vote: _vote }; +} + +function loadTupleVoteMsg(source: TupleReader) { + let _voteId = source.readBigNumber(); + let _adminIndex = source.readBigNumber(); + let _vote = source.readBigNumber(); + return { $$type: 'VoteMsg' as const, voteId: _voteId, adminIndex: _adminIndex, vote: _vote }; +} + +function storeTupleVoteMsg(source: VoteMsg) { + let builder = new TupleBuilder(); + builder.writeNumber(source.voteId); + builder.writeNumber(source.adminIndex); + builder.writeNumber(source.vote); + return builder.build(); +} + +function dictValueParserVoteMsg(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeVoteMsg(src)).endCell()); + }, + parse: (src) => { + return loadVoteMsg(src.loadRef().beginParse()); + } + } +} +export type AddressList = { + $$type: 'AddressList'; + addresses: Dictionary; + length: bigint; +} + +export function storeAddressList(src: AddressList) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeDict(src.addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()); + b_0.storeInt(src.length, 257); + }; +} + +export function loadAddressList(slice: Slice) { + let sc_0 = slice; + let _addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0); + let _length = sc_0.loadIntBig(257); + return { $$type: 'AddressList' as const, addresses: _addresses, length: _length }; +} + +function loadTupleAddressList(source: TupleReader) { + let _addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt()); + let _length = source.readBigNumber(); + return { $$type: 'AddressList' as const, addresses: _addresses, length: _length }; +} + +function storeTupleAddressList(source: AddressList) { + let builder = new TupleBuilder(); + builder.writeCell(source.addresses.size > 0 ? beginCell().storeDictDirect(source.addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null); + builder.writeNumber(source.length); + return builder.build(); +} + +function dictValueParserAddressList(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeAddressList(src)).endCell()); + }, + parse: (src) => { + return loadAddressList(src.loadRef().beginParse()); + } + } +} +export type Distribution = { + $$type: 'Distribution'; + addresses: AddressList; + percents: Dictionary; +} + +export function storeDistribution(src: Distribution) { + return (builder: Builder) => { + let b_0 = builder; + b_0.store(storeAddressList(src.addresses)); + b_0.storeDict(src.percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)); + }; +} + +export function loadDistribution(slice: Slice) { + let sc_0 = slice; + let _addresses = loadAddressList(sc_0); + let _percents = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0); + return { $$type: 'Distribution' as const, addresses: _addresses, percents: _percents }; +} + +function loadTupleDistribution(source: TupleReader) { + const _addresses = loadTupleAddressList(source.readTuple()); + let _percents = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt()); + return { $$type: 'Distribution' as const, addresses: _addresses, percents: _percents }; +} + +function storeTupleDistribution(source: Distribution) { + let builder = new TupleBuilder(); + builder.writeTuple(storeTupleAddressList(source.addresses)); + builder.writeCell(source.percents.size > 0 ? beginCell().storeDictDirect(source.percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null); + return builder.build(); +} + +function dictValueParserDistribution(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeDistribution(src)).endCell()); + }, + parse: (src) => { + return loadDistribution(src.loadRef().beginParse()); + } + } +} +export type InitiateDistributionVote = { + $$type: 'InitiateDistributionVote'; + adminIndex: bigint; + quorum_percent: bigint; + vote_time: bigint; + distribution: Distribution; +} + +export function storeInitiateDistributionVote(src: InitiateDistributionVote) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(2512227654, 32); + b_0.storeInt(src.adminIndex, 257); + b_0.storeInt(src.quorum_percent, 257); + b_0.storeInt(src.vote_time, 257); + let b_1 = new Builder(); + b_1.store(storeDistribution(src.distribution)); + b_0.storeRef(b_1.endCell()); + }; +} + +export function loadInitiateDistributionVote(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 2512227654) { throw Error('Invalid prefix'); } + let _adminIndex = sc_0.loadIntBig(257); + let _quorum_percent = sc_0.loadIntBig(257); + let _vote_time = sc_0.loadIntBig(257); + let sc_1 = sc_0.loadRef().beginParse(); + let _distribution = loadDistribution(sc_1); + return { $$type: 'InitiateDistributionVote' as const, adminIndex: _adminIndex, quorum_percent: _quorum_percent, vote_time: _vote_time, distribution: _distribution }; +} + +function loadTupleInitiateDistributionVote(source: TupleReader) { + let _adminIndex = source.readBigNumber(); + let _quorum_percent = source.readBigNumber(); + let _vote_time = source.readBigNumber(); + const _distribution = loadTupleDistribution(source.readTuple()); + return { $$type: 'InitiateDistributionVote' as const, adminIndex: _adminIndex, quorum_percent: _quorum_percent, vote_time: _vote_time, distribution: _distribution }; +} + +function storeTupleInitiateDistributionVote(source: InitiateDistributionVote) { + let builder = new TupleBuilder(); + builder.writeNumber(source.adminIndex); + builder.writeNumber(source.quorum_percent); + builder.writeNumber(source.vote_time); + builder.writeTuple(storeTupleDistribution(source.distribution)); + return builder.build(); +} + +function dictValueParserInitiateDistributionVote(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeInitiateDistributionVote(src)).endCell()); + }, + parse: (src) => { + return loadInitiateDistributionVote(src.loadRef().beginParse()); + } + } +} +export type SetStakingPool = { + $$type: 'SetStakingPool'; + staking_pool: Address | null; +} + +export function storeSetStakingPool(src: SetStakingPool) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(124047688, 32); + b_0.storeAddress(src.staking_pool); + }; +} + +export function loadSetStakingPool(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 124047688) { throw Error('Invalid prefix'); } + let _staking_pool = sc_0.loadMaybeAddress(); + return { $$type: 'SetStakingPool' as const, staking_pool: _staking_pool }; +} + +function loadTupleSetStakingPool(source: TupleReader) { + let _staking_pool = source.readAddressOpt(); + return { $$type: 'SetStakingPool' as const, staking_pool: _staking_pool }; +} + +function storeTupleSetStakingPool(source: SetStakingPool) { + let builder = new TupleBuilder(); + builder.writeAddress(source.staking_pool); + return builder.build(); +} + +function dictValueParserSetStakingPool(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSetStakingPool(src)).endCell()); + }, + parse: (src) => { + return loadSetStakingPool(src.loadRef().beginParse()); + } + } +} +export type RequestLinker = { + $$type: 'RequestLinker'; + client: Address; +} + +export function storeRequestLinker(src: RequestLinker) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1512653598, 32); + b_0.storeAddress(src.client); + }; +} + +export function loadRequestLinker(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1512653598) { throw Error('Invalid prefix'); } + let _client = sc_0.loadAddress(); + return { $$type: 'RequestLinker' as const, client: _client }; +} + +function loadTupleRequestLinker(source: TupleReader) { + let _client = source.readAddress(); + return { $$type: 'RequestLinker' as const, client: _client }; +} + +function storeTupleRequestLinker(source: RequestLinker) { + let builder = new TupleBuilder(); + builder.writeAddress(source.client); + return builder.build(); +} + +function dictValueParserRequestLinker(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeRequestLinker(src)).endCell()); + }, + parse: (src) => { + return loadRequestLinker(src.loadRef().beginParse()); + } + } +} +export type Unstake = { + $$type: 'Unstake'; + amount: bigint; +} + +export function storeUnstake(src: Unstake) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3125946401, 32); + b_0.storeInt(src.amount, 257); + }; +} + +export function loadUnstake(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3125946401) { throw Error('Invalid prefix'); } + let _amount = sc_0.loadIntBig(257); + return { $$type: 'Unstake' as const, amount: _amount }; +} + +function loadTupleUnstake(source: TupleReader) { + let _amount = source.readBigNumber(); + return { $$type: 'Unstake' as const, amount: _amount }; +} + +function storeTupleUnstake(source: Unstake) { + let builder = new TupleBuilder(); + builder.writeNumber(source.amount); + return builder.build(); +} + +function dictValueParserUnstake(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeUnstake(src)).endCell()); + }, + parse: (src) => { + return loadUnstake(src.loadRef().beginParse()); + } + } +} +export type RequestUnstake = { + $$type: 'RequestUnstake'; + founderIndex: bigint; +} + +export function storeRequestUnstake(src: RequestUnstake) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3922648959, 32); + b_0.storeInt(src.founderIndex, 257); + }; +} + +export function loadRequestUnstake(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3922648959) { throw Error('Invalid prefix'); } + let _founderIndex = sc_0.loadIntBig(257); + return { $$type: 'RequestUnstake' as const, founderIndex: _founderIndex }; +} + +function loadTupleRequestUnstake(source: TupleReader) { + let _founderIndex = source.readBigNumber(); + return { $$type: 'RequestUnstake' as const, founderIndex: _founderIndex }; +} + +function storeTupleRequestUnstake(source: RequestUnstake) { + let builder = new TupleBuilder(); + builder.writeNumber(source.founderIndex); + return builder.build(); +} + +function dictValueParserRequestUnstake(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeRequestUnstake(src)).endCell()); + }, + parse: (src) => { + return loadRequestUnstake(src.loadRef().beginParse()); + } + } +} +export type CollectProfit = { + $$type: 'CollectProfit'; + adminIndex: bigint; +} + +export function storeCollectProfit(src: CollectProfit) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1368467253, 32); + b_0.storeInt(src.adminIndex, 257); + }; +} + +export function loadCollectProfit(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1368467253) { throw Error('Invalid prefix'); } + let _adminIndex = sc_0.loadIntBig(257); + return { $$type: 'CollectProfit' as const, adminIndex: _adminIndex }; +} + +function loadTupleCollectProfit(source: TupleReader) { + let _adminIndex = source.readBigNumber(); + return { $$type: 'CollectProfit' as const, adminIndex: _adminIndex }; +} + +function storeTupleCollectProfit(source: CollectProfit) { + let builder = new TupleBuilder(); + builder.writeNumber(source.adminIndex); + return builder.build(); +} + +function dictValueParserCollectProfit(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeCollectProfit(src)).endCell()); + }, + parse: (src) => { + return loadCollectProfit(src.loadRef().beginParse()); + } + } +} +export type SetOwner = { + $$type: 'SetOwner'; + owner: Address; +} + +export function storeSetOwner(src: SetOwner) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(3072093686, 32); + b_0.storeAddress(src.owner); + }; +} + +export function loadSetOwner(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 3072093686) { throw Error('Invalid prefix'); } + let _owner = sc_0.loadAddress(); + return { $$type: 'SetOwner' as const, owner: _owner }; +} + +function loadTupleSetOwner(source: TupleReader) { + let _owner = source.readAddress(); + return { $$type: 'SetOwner' as const, owner: _owner }; +} + +function storeTupleSetOwner(source: SetOwner) { + let builder = new TupleBuilder(); + builder.writeAddress(source.owner); + return builder.build(); +} + +function dictValueParserSetOwner(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeSetOwner(src)).endCell()); + }, + parse: (src) => { + return loadSetOwner(src.loadRef().beginParse()); + } + } +} +export type WithdrawalRequests = { + $$type: 'WithdrawalRequests'; + addresses: Dictionary; + amounts: Dictionary; + n_requests: bigint; +} + +export function storeWithdrawalRequests(src: WithdrawalRequests) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeDict(src.addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()); + b_0.storeDict(src.amounts, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)); + b_0.storeInt(src.n_requests, 257); + }; +} + +export function loadWithdrawalRequests(slice: Slice) { + let sc_0 = slice; + let _addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0); + let _amounts = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0); + let _n_requests = sc_0.loadIntBig(257); + return { $$type: 'WithdrawalRequests' as const, addresses: _addresses, amounts: _amounts, n_requests: _n_requests }; +} + +function loadTupleWithdrawalRequests(source: TupleReader) { + let _addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt()); + let _amounts = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt()); + let _n_requests = source.readBigNumber(); + return { $$type: 'WithdrawalRequests' as const, addresses: _addresses, amounts: _amounts, n_requests: _n_requests }; +} + +function storeTupleWithdrawalRequests(source: WithdrawalRequests) { + let builder = new TupleBuilder(); + builder.writeCell(source.addresses.size > 0 ? beginCell().storeDictDirect(source.addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null); + builder.writeCell(source.amounts.size > 0 ? beginCell().storeDictDirect(source.amounts, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null); + builder.writeNumber(source.n_requests); + return builder.build(); +} + +function dictValueParserWithdrawalRequests(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeWithdrawalRequests(src)).endCell()); + }, + parse: (src) => { + return loadWithdrawalRequests(src.loadRef().beginParse()); + } + } +} +export type Proposal = { + $$type: 'Proposal'; + type: bigint; + blacklistAddress: Address | null; + distribution_addresses: Dictionary; + distribution_addresses_length: bigint | null; + distribution_percents: Dictionary; +} + +export function storeProposal(src: Proposal) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.type, 257); + b_0.storeAddress(src.blacklistAddress); + 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)); + }; +} + +export function loadProposal(slice: Slice) { + let sc_0 = slice; + let _type = sc_0.loadIntBig(257); + let _blacklistAddress = sc_0.loadMaybeAddress(); + let _distribution_addresses = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), sc_0); + 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) { + let _type = source.readBigNumber(); + let _blacklistAddress = source.readAddressOpt(); + let _distribution_addresses = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.Address(), source.readCellOpt()); + let _distribution_addresses_length = source.readBigNumberOpt(); + 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) { + let builder = new TupleBuilder(); + builder.writeNumber(source.type); + builder.writeAddress(source.blacklistAddress); + builder.writeCell(source.distribution_addresses.size > 0 ? beginCell().storeDictDirect(source.distribution_addresses, Dictionary.Keys.BigInt(257), Dictionary.Values.Address()).endCell() : null); + builder.writeNumber(source.distribution_addresses_length); + builder.writeCell(source.distribution_percents.size > 0 ? beginCell().storeDictDirect(source.distribution_percents, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null); + return builder.build(); +} + +function dictValueParserProposal(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeProposal(src)).endCell()); + }, + parse: (src) => { + return loadProposal(src.loadRef().beginParse()); + } + } +} +export type Vote = { + $$type: 'Vote'; + id: bigint; + votes: Dictionary; + vote_end: bigint; + quorum_percent: bigint; + ended: boolean; + result: boolean | null; +} + +export function storeVote(src: Vote) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeInt(src.id, 257); + b_0.storeDict(src.votes, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)); + b_0.storeInt(src.vote_end, 257); + b_0.storeInt(src.quorum_percent, 257); + b_0.storeBit(src.ended); + if (src.result !== null && src.result !== undefined) { b_0.storeBit(true).storeBit(src.result); } else { b_0.storeBit(false); } + }; +} + +export function loadVote(slice: Slice) { + let sc_0 = slice; + let _id = sc_0.loadIntBig(257); + let _votes = Dictionary.load(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), sc_0); + let _vote_end = sc_0.loadIntBig(257); + let _quorum_percent = sc_0.loadIntBig(257); + let _ended = sc_0.loadBit(); + let _result = sc_0.loadBit() ? sc_0.loadBit() : null; + return { $$type: 'Vote' as const, id: _id, votes: _votes, vote_end: _vote_end, quorum_percent: _quorum_percent, ended: _ended, result: _result }; +} + +function loadTupleVote(source: TupleReader) { + let _id = source.readBigNumber(); + let _votes = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt()); + let _vote_end = source.readBigNumber(); + let _quorum_percent = source.readBigNumber(); + let _ended = source.readBoolean(); + let _result = source.readBooleanOpt(); + return { $$type: 'Vote' as const, id: _id, votes: _votes, vote_end: _vote_end, quorum_percent: _quorum_percent, ended: _ended, result: _result }; +} + +function storeTupleVote(source: Vote) { + let builder = new TupleBuilder(); + builder.writeNumber(source.id); + builder.writeCell(source.votes.size > 0 ? beginCell().storeDictDirect(source.votes, Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257)).endCell() : null); + builder.writeNumber(source.vote_end); + builder.writeNumber(source.quorum_percent); + builder.writeBoolean(source.ended); + builder.writeBoolean(source.result); + return builder.build(); +} + +function dictValueParserVote(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeVote(src)).endCell()); + }, + parse: (src) => { + return loadVote(src.loadRef().beginParse()); + } + } +} +export type ChangeOwner = { + $$type: 'ChangeOwner'; + newOwner: Address; +} + +export function storeChangeOwner(src: ChangeOwner) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(256331011, 32); + b_0.storeAddress(src.newOwner); + }; +} + +export function loadChangeOwner(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 256331011) { throw Error('Invalid prefix'); } + let _newOwner = sc_0.loadAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; +} + +function loadTupleChangeOwner(source: TupleReader) { + let _newOwner = source.readAddress(); + return { $$type: 'ChangeOwner' as const, newOwner: _newOwner }; +} + +function storeTupleChangeOwner(source: ChangeOwner) { + let builder = new TupleBuilder(); + builder.writeAddress(source.newOwner); + return builder.build(); +} + +function dictValueParserChangeOwner(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeChangeOwner(src)).endCell()); + }, + parse: (src) => { + return loadChangeOwner(src.loadRef().beginParse()); + } + } +} +export type Deposit = { + $$type: 'Deposit'; + amount: bigint; +} + +export function storeDeposit(src: Deposit) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(569292295, 32); + b_0.storeCoins(src.amount); + }; +} + +export function loadDeposit(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 569292295) { throw Error('Invalid prefix'); } + let _amount = sc_0.loadCoins(); + return { $$type: 'Deposit' as const, amount: _amount }; +} + +function loadTupleDeposit(source: TupleReader) { + let _amount = source.readBigNumber(); + return { $$type: 'Deposit' as const, amount: _amount }; +} + +function storeTupleDeposit(source: Deposit) { + let builder = new TupleBuilder(); + builder.writeNumber(source.amount); + return builder.build(); +} + +function dictValueParserDeposit(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeDeposit(src)).endCell()); + }, + parse: (src) => { + return loadDeposit(src.loadRef().beginParse()); + } + } +} +export type Withdraw = { + $$type: 'Withdraw'; + amount: bigint; +} + +export function storeWithdraw(src: Withdraw) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1616450832, 32); + b_0.storeInt(src.amount, 257); + }; +} + +export function loadWithdraw(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1616450832) { throw Error('Invalid prefix'); } + let _amount = sc_0.loadIntBig(257); + return { $$type: 'Withdraw' as const, amount: _amount }; +} + +function loadTupleWithdraw(source: TupleReader) { + let _amount = source.readBigNumber(); + return { $$type: 'Withdraw' as const, amount: _amount }; +} + +function storeTupleWithdraw(source: Withdraw) { + let builder = new TupleBuilder(); + builder.writeNumber(source.amount); + return builder.build(); +} + +function dictValueParserWithdraw(): DictionaryValue { + return { + serialize: (src, buidler) => { + buidler.storeRef(beginCell().store(storeWithdraw(src)).endCell()); + }, + parse: (src) => { + return loadWithdraw(src.loadRef().beginParse()); + } + } +} +async function Foundation_init(admins: Distribution, founders: AddressList, tonb: Address) { + const __init = 'te6ccgEBBgEAdQABFP8A9KQT9LzyyAsBAgFiAgMCAswEBQAnoUrcBN5EAt5EsAbeRCBqgggH4BEAAdwAhdtra2uAVkZgUINK8SiCslTAF6AECAgOeAZCMJqCoqkAF6AECAgOeAegAA54sJegACZHoACfoAQICA54BkrGZkgOZkw='; + const __code = 'te6ccgECOAEADdYAART/APSkE/S88sgLAQIBYgIDAgLMEBECASAEBQIBIAYHAgEgCgsBgblFztRNDUAfhi9ASBAQHXAFkC1AHQ9ASBAQHXAFkC9ARQMwP6QAEB9ATUMND0BPQEgQEB1wAwEIoQZxBWbBrbPICAGBuWfO1E0NQB+GL0BIEBAdcAWQLUAdD0BIEBAdcAWQL0BFAzA/pAAQH0BNQw0PQE9ASBAQHXAD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AJNTD7mK6DBTIaABoCO5kltwlryRf5Fw4uJEMH9QVIEBAVFW2zwjEDgBIG6VMFn0WjCUQTP0FeIFwP84NjQvA5aPxoEBASMC8AzbPCBu8tCAbyUkwACPFX9wgEAGIG7y0IDbPCwDBFB3bW3bPJEz4iPAATADwAKdODg4ByBu8tCAEFcGBZJfA+KRMOIzMjAB9shxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5MfwHKAMhwAcoAcAHKACRus51/AcoABCBu8tCAUATMljQDcAHKAOIkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFuszEAMJx/AcoAASBu8tCAAcyVMXABygDiyQH7AAAcyAGCCpyDlljLHwHPFskAZCBukjBt4NCBAQHXAPpAIdcLAcMAkQGSMW3iAfQE0gABlYEBAdcAkm0B4vQEVUBsFW8FAQzIVVDbPMk1AExQVoEBAc8AE/QAgQEBzwCBAQHPAMoAIW6zln8BygDKAJRwMsoA4gHmgQEBVFcAUjBBM/QMb6GUAdcAMJJbbeIgbvLQgCDAAY5OIMACjh8wgQEBVF8AUjBBM/QMb6GUAdcAMJJbbeIgbvLQgBOgjiXAAI4fgQEBVF8AUjBBM/QMb6GUAdcAMJJbbeIgbvLQgBKgAd4C4kAT4w0DpDcAPjCBAQFUXwBSMEEz9AxvoZQB1wAwkltt4iBu8tCAFKABGiBukjBt4NDbPGwWbwY5AD6BAQHXAPQEgQEB1wCBAQHXANIA0gABktIAkm0B4lVQ3xyhHA=='; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeTuple(storeTupleDistribution(admins)); + builder.writeTuple(storeTupleAddressList(founders)); + builder.writeAddress(tonb); + let __stack = builder.build(); + let codeCell = Cell.fromBoc(Buffer.from(__code, 'base64'))[0]; + let initCell = Cell.fromBoc(Buffer.from(__init, 'base64'))[0]; + let system = await ContractSystem.create(); + let executor = await ContractExecutor.create({ code: initCell, data: new Cell() }, system); + let res = await executor.get('init', __stack); + if (!res.success) { throw Error(res.error); } + if (res.exitCode !== 0 && res.exitCode !== 1) { + if (Foundation_errors[res.exitCode]) { + throw new ComputeError(Foundation_errors[res.exitCode].message, res.exitCode); + } else { + throw new ComputeError('Exit code: ' + res.exitCode, res.exitCode); + } + } + + let data = res.stack.readCell(); + return { code: codeCell, data }; +} + +const Foundation_errors: { [key: number]: { message: string } } = { + 2: { message: `Stack undeflow` }, + 3: { message: `Stack overflow` }, + 4: { message: `Integer overflow` }, + 5: { message: `Integer out of expected range` }, + 6: { message: `Invalid opcode` }, + 7: { message: `Type check error` }, + 8: { message: `Cell overflow` }, + 9: { message: `Cell underflow` }, + 10: { message: `Dictionary error` }, + 13: { message: `Out of gas error` }, + 32: { message: `Method ID not found` }, + 34: { message: `Action is invalid or not supported` }, + 37: { message: `Not enough TON` }, + 38: { message: `Not enough extra-currencies` }, + 128: { message: `Null reference exception` }, + 129: { message: `Invalid serialization prefix` }, + 130: { message: `Invalid incoming message` }, + 131: { message: `Constraints error` }, + 132: { message: `Access denied` }, + 133: { message: `Contract stopped` }, + 134: { message: `Invalid argument` }, + 135: { message: `Code of a contract was not found` }, + 136: { message: `Invalid address` }, + 4429: { message: `Invalid sender` }, + 6384: { message: `not enough money for withdraw` }, + 6873: { message: `Only an admin can initiate a vote` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 18474: { message: `only the owner can set a new owner` }, + 19362: { message: `Invalid quorum percent` }, + 29720: { message: `Invalid vote` }, + 29821: { message: `Voting requires at least 1 ton for the fees` }, + 30386: { message: `Vote already ended` }, + 32366: { message: `not enough money for deposit` }, + 34326: { message: `Vote is not finished yet` }, + 37444: { message: `Only a founder can request unstake` }, + 41207: { message: `invalid sender` }, + 42983: { message: `No profit to collect` }, + 44816: { message: `Wallet is blacklisted` }, + 46931: { message: `Invalid vote id` }, + 49606: { message: `Invalid admin index` }, + 53981: { message: `Only an admin can collect profit` }, + 56549: { message: `Only an admin can vote` }, + 61070: { message: `Invalid vote time` }, + 61265: { message: `Only the owner can trigger un-staking` }, + 62972: { message: `Invalid balance` }, +} + +export class Foundation implements Contract { + + static async init(admins: Distribution, founders: AddressList, tonb: Address) { + return await Foundation_init(admins,founders,tonb); + } + + static async fromInit(admins: Distribution, founders: AddressList, tonb: Address) { + const init = await Foundation_init(admins,founders,tonb); + const address = contractAddress(0, init); + return new Foundation(address, init); + } + + static fromAddress(address: Address) { + return new Foundation(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: Foundation_errors + }; + + private constructor(address: Address, init?: { code: Cell, data: Cell }) { + this.address = address; + this.init = init; + } + + async send(provider: ContractProvider, via: Sender, args: { value: bigint, bounce?: boolean| null | undefined }, message: FinishVote | VoteMsg | InitiateBlacklistVote | InitiateDistributionVote | InitiateLiquidationVote | Unstake | RequestUnstake | CollectProfit | null) { + + let body: Cell | null = null; + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'FinishVote') { + body = beginCell().store(storeFinishVote(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'VoteMsg') { + body = beginCell().store(storeVoteMsg(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'InitiateBlacklistVote') { + body = beginCell().store(storeInitiateBlacklistVote(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'InitiateDistributionVote') { + body = beginCell().store(storeInitiateDistributionVote(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'InitiateLiquidationVote') { + body = beginCell().store(storeInitiateLiquidationVote(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'Unstake') { + body = beginCell().store(storeUnstake(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'RequestUnstake') { + body = beginCell().store(storeRequestUnstake(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'CollectProfit') { + body = beginCell().store(storeCollectProfit(message)).endCell(); + } + if (message === null) { + body = new Cell(); + } + if (body === null) { throw new Error('Invalid message type'); } + + await provider.internal(via, { ...args, body: body }); + + } + + async getNumVotes(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('numVotes', builder.build())).stack; + let result = source.readBigNumber(); + return result; + } + + async getNthVote(provider: ContractProvider, n: bigint) { + let builder = new TupleBuilder(); + builder.writeNumber(n); + let source = (await provider.get('nthVote', builder.build())).stack; + const result_p = source.readTupleOpt(); + const result = result_p ? loadTupleVote(result_p) : null; + return result; + } + + async getAdminList(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('AdminList', builder.build())).stack; + const result = loadTupleAddressList(source); + return result; + } + + async getAdminPercents(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('AdminPercents', builder.build())).stack; + let result = Dictionary.loadDirect(Dictionary.Keys.BigInt(257), Dictionary.Values.BigInt(257), source.readCellOpt()); + return result; + } + +} \ No newline at end of file diff --git a/sources/utils/config.ts b/sources/utils/config.ts index 18202e0..e55c137 100644 --- a/sources/utils/config.ts +++ b/sources/utils/config.ts @@ -1,5 +1,5 @@ -import { TonClient, Address, WalletContractV3R2, WalletContractV4 } from "ton"; +import { TonClient, Address, WalletContractV3R2, WalletContractV4, TonClient4 } from "ton"; import { mnemonicToPrivateKey } from "ton-crypto"; import { buildOnchainMetadata } from "./helpers"; @@ -8,6 +8,10 @@ export const client = new TonClient({ apiKey: 'bb38df0c2756c66e2ab49f064e2484ec444b01244d2bd49793bd5b58f61ae3d2' }) +export const client4 = new TonClient4({ + endpoint: "https://sandbox-v4.tonhubapi.com" +}) + let mnemonics = "basic security merge opera inject core melody polar become force cool glance history order warfare consider company slim twice balcony scare shoot winner rude"; let mnemonics2 = "road learn slow crucial mixed grunt copy ribbon coyote shrimp onion pledge any tornado rebel three glimpse winner bless thunder immune february coin egg" // read more about wallet apps https://ton.org/docs/participate/wallets/apps#tonhub-test-environment diff --git a/sources/utils/interactions.ts b/sources/utils/interactions.ts index 48da8ac..302d01b 100644 --- a/sources/utils/interactions.ts +++ b/sources/utils/interactions.ts @@ -1,11 +1,13 @@ import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano, SendMode } from "ton"; import { storeDeposit, storeWithdraw, storeTokenTransfer, storeBlacklistWallet } from "../output/jetton_TONB"; import { TON } from "./helpers"; -import { wallet_data, owner, default_content, workchain } from './config'; +import { wallet_data, owner, default_content, workchain, client } from './config'; import { TONB } from "../output/jetton_TONB"; import { TONBWallet } from '../output/jetton_TONBWallet'; import { Distribution, AddressList } from '../output/jetton_TONBWallet'; import { Dictionary } from 'ton-core'; +import { PseudoStaking, storeSetOwner, storeInitiateBlacklistVote } from '../output/jetton_PseudoStaking'; +import { Foundation } from '../output/jetton_Foundation'; export async function sendMessage(wallet: any, secretKey: Buffer, msg: { value: string | bigint, to: Address, bounce?: boolean, init?: { code?: Cell, data?: Cell }, body?: any }) { let seqno: number = await wallet.getSeqno(); @@ -65,18 +67,67 @@ export async function blacklistAddress(wallet: any, secretKey: Buffer, tonb: Add await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body }); } -export async function getTONBState(tonb_content?: any) { +export async function getTONBState(tonb_content?: any, add_staking: boolean | Address = false) { if (!tonb_content) { tonb_content = default_content; } - return await TONB.init(owner, tonb_content, null); + let staking_addr: null | Address = null; + if (add_staking === true) { + staking_addr = contractAddress(workchain, await PseudoStaking.init()); + } else if (add_staking instanceof Address) { + staking_addr = add_staking; + } + return await TONB.init(owner, tonb_content, staking_addr); } -export async function getTONB(tonb_content?: any) { +export async function getTONB(owner2?: Address, tonb_content?: any, add_staking: boolean | Address = false) { if (!tonb_content) { tonb_content = default_content; } - return await TONB.fromInit(owner, tonb_content, null); + let staking_addr: null | Address = null; + if (add_staking === true) { + staking_addr = contractAddress(workchain, await PseudoStaking.init()); + } else if (add_staking instanceof Address) { + staking_addr = add_staking; + } + if (!owner2) { + owner2 = owner; + } + return await TONB.fromInit(owner2, tonb_content, staking_addr); +} + +export async function getTONBOpen(tonb_content?: any, add_staking: boolean | Address = false) { + let tonb = await getTONB(tonb_content, add_staking); + return client.open(tonb); +} + +export async function getFoundation( + tonb_address: Address, + admins?: Address[], + admin_percents?: bigint[], + founders?: Address[], + ) { + if (!admins) { + admins = [owner]; + admin_percents = [100n]; + } + if (!founders) { + founders = [owner]; + } + return await Foundation.fromInit( + createDistribution(admins, admin_percents as bigint[]), + createAddressList(founders), + tonb_address); +} + +export async function getFoundationOpen( + tonb_address: Address, + admins?: Address[], + admin_percents?: bigint[], + founders?: Address[], + ) { + let foundation = await getFoundation(tonb_address, admins, admin_percents, founders); + return client.open(foundation); } @@ -148,4 +199,22 @@ export async function getWalletAddress(master_: string | Address, owner_: string let master = typeof master_ === 'string' ? Address.parse(master_) : master_; let owner = typeof owner_ === 'string' ? Address.parse(owner_) : owner_; return contractAddress(workchain, await TONBWallet.init(master, owner)); +} + +export async function changeTONBOwner(wallet: any, secretKey: Buffer, tonb: Address, new_owner: Address) { + let msg_body_b = beginCell(); + storeSetOwner({ owner: new_owner, $$type: 'SetOwner' })(msg_body_b); + let msg_body = msg_body_b.endCell(); + let msg_value = toNano('0.11'); + await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body }); +} + +export async function createBlacklistVote( + wallet: any, secretKey: Buffer, foundation: Address, target: Address, + vote_time: bigint, adminIndex: bigint, quorum_percent: bigint = 50n) { + let msg_body_b = beginCell(); + storeInitiateBlacklistVote({ $$type: 'InitiateBlacklistVote', wallet: target, vote_time, adminIndex, quorum_percent })(msg_body_b); + let msg_body = msg_body_b.endCell(); + let msg_value = toNano('1.01'); + await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body }); } \ No newline at end of file