From e92870261315451f7d55a2bede88dde0cdc51807 Mon Sep 17 00:00:00 2001 From: ennucore Date: Fri, 3 Feb 2023 17:18:36 +0100 Subject: [PATCH] Deposit works (with tests) --- package.json | 5 +- sources/jetton.deploy.ts | 2 +- sources/jetton.tact | 14 +- sources/jetton_trait.tact | 151 ++ sources/output/jetton_Linker.abi | 1 + sources/output/jetton_Linker.code.boc | Bin 0 -> 316 bytes sources/output/jetton_Linker.code.fc | 133 ++ sources/output/jetton_Linker.code.fif | 185 ++ sources/output/jetton_Linker.code.rev.fif | 179 ++ sources/output/jetton_Linker.init.boc | Bin 0 -> 107 bytes sources/output/jetton_Linker.init.fc | 55 + sources/output/jetton_Linker.init.fif | 69 + sources/output/jetton_Linker.init.rev.fif | 58 + sources/output/jetton_Linker.md | 81 + sources/output/jetton_Linker.pkg | 1 + sources/output/jetton_Linker.ts | 1024 ++++++++++ sources/output/jetton_TONB.abi | 1 + sources/output/jetton_TONB.code.boc | Bin 0 -> 1506 bytes sources/output/jetton_TONB.code.fc | 489 +++++ sources/output/jetton_TONB.code.fif | 819 ++++++++ sources/output/jetton_TONB.code.rev.fif | 1653 +++++++++++++++++ sources/output/jetton_TONB.init.boc | Bin 0 -> 145 bytes sources/output/jetton_TONB.init.fc | 54 + sources/output/jetton_TONB.init.fif | 88 + sources/output/jetton_TONB.init.rev.fif | 96 + sources/output/jetton_TONB.md | 88 + sources/output/jetton_TONB.pkg | 1 + sources/output/jetton_TONB.ts | 1058 +++++++++++ sources/output/jetton_TONBWallet.abi | 1 + sources/output/jetton_TONBWallet.code.boc | Bin 0 -> 1324 bytes sources/output/jetton_TONBWallet.code.fc | 437 +++++ sources/output/jetton_TONBWallet.code.fif | 774 ++++++++ sources/output/jetton_TONBWallet.code.rev.fif | 860 +++++++++ sources/output/jetton_TONBWallet.init.boc | Bin 0 -> 72 bytes sources/output/jetton_TONBWallet.init.fc | 37 + sources/output/jetton_TONBWallet.init.fif | 40 + sources/output/jetton_TONBWallet.init.rev.fif | 26 + sources/output/jetton_TONBWallet.md | 83 + sources/output/jetton_TONBWallet.pkg | 1 + sources/output/jetton_TONBWallet.ts | 1037 +++++++++++ sources/staking.tact | 31 + .../tests/__snapshots__/jetton.spec.ts.snap | 66 +- sources/tests/jetton.spec.ts | 25 +- sources/tests/scenario.ts | 9 +- sources/utils/interactions.ts | 49 +- sources/utils/rmlogs.sh | 2 +- yarn.lock | 26 + 47 files changed, 9760 insertions(+), 49 deletions(-) create mode 100644 sources/jetton_trait.tact create mode 100644 sources/output/jetton_Linker.abi create mode 100644 sources/output/jetton_Linker.code.boc create mode 100644 sources/output/jetton_Linker.code.fc create mode 100644 sources/output/jetton_Linker.code.fif create mode 100644 sources/output/jetton_Linker.code.rev.fif create mode 100644 sources/output/jetton_Linker.init.boc create mode 100644 sources/output/jetton_Linker.init.fc create mode 100644 sources/output/jetton_Linker.init.fif create mode 100644 sources/output/jetton_Linker.init.rev.fif create mode 100644 sources/output/jetton_Linker.md create mode 100644 sources/output/jetton_Linker.pkg create mode 100644 sources/output/jetton_Linker.ts create mode 100644 sources/output/jetton_TONB.abi create mode 100644 sources/output/jetton_TONB.code.boc create mode 100644 sources/output/jetton_TONB.code.fc create mode 100644 sources/output/jetton_TONB.code.fif create mode 100644 sources/output/jetton_TONB.code.rev.fif create mode 100644 sources/output/jetton_TONB.init.boc create mode 100644 sources/output/jetton_TONB.init.fc create mode 100644 sources/output/jetton_TONB.init.fif create mode 100644 sources/output/jetton_TONB.init.rev.fif create mode 100644 sources/output/jetton_TONB.md create mode 100644 sources/output/jetton_TONB.pkg create mode 100644 sources/output/jetton_TONB.ts create mode 100644 sources/output/jetton_TONBWallet.abi create mode 100644 sources/output/jetton_TONBWallet.code.boc create mode 100644 sources/output/jetton_TONBWallet.code.fc create mode 100644 sources/output/jetton_TONBWallet.code.fif create mode 100644 sources/output/jetton_TONBWallet.code.rev.fif create mode 100644 sources/output/jetton_TONBWallet.init.boc create mode 100644 sources/output/jetton_TONBWallet.init.fc create mode 100644 sources/output/jetton_TONBWallet.init.fif create mode 100644 sources/output/jetton_TONBWallet.init.rev.fif create mode 100644 sources/output/jetton_TONBWallet.md create mode 100644 sources/output/jetton_TONBWallet.pkg create mode 100644 sources/output/jetton_TONBWallet.ts create mode 100644 sources/staking.tact mode change 100644 => 100755 sources/utils/rmlogs.sh diff --git a/package.json b/package.json index ec8da0f..eac4c40 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,18 @@ "author": "Alex Golev ", "license": "MIT", "scripts": { - "build": "tact --config tact.config.json", + "build": "tact --config tact.config.json && sources/utils/rmlogs.sh", "test": "jest", "deploy": "ts-node sources/jetton.deploy.ts" }, "dependencies": { "@aws-crypto/sha256-js": "^3.0.0", + "@types/bn.js": "^5.1.1", "@types/jest": "^29.2.4", "@types/node": "^18.11.14", "@types/qs": "^6.9.7", + "bigint-buffer": "^1.1.5", + "bn.js": "^5.2.0", "build": "^0.1.4", "jest": "^29.3.1", "prando": "^6.0.1", diff --git a/sources/jetton.deploy.ts b/sources/jetton.deploy.ts index 056d92d..7e6d8a0 100644 --- a/sources/jetton.deploy.ts +++ b/sources/jetton.deploy.ts @@ -20,7 +20,7 @@ import {client, wallet_data, workchain, owner, jettonParams, default_content} fr let destination_address = contractAddress(workchain, init); - let deployAmount = toNano('0.5'); + let deployAmount = toNano('0.2'); let supply = 500; let amount = BigInt(supply * Math.pow(10, 9)); diff --git a/sources/jetton.tact b/sources/jetton.tact index e8eb80a..7517827 100644 --- a/sources/jetton.tact +++ b/sources/jetton.tact @@ -3,21 +3,16 @@ import "./messages"; import "./wallet"; import "./linker"; import "./jetton_trait"; +import "./staking"; message Deposit { - amount: Int; + amount: Int as coins; } message Withdraw { amount: Int; } -struct WithdrawalRequests { - addresses: map[Int]Address; - amounts: map[Int]Int; - n_requests: Int; -} - const gas_consumption: Int = ton("0.01"); const withdraw_gas_consumption: Int = ton("0.05"); @@ -25,7 +20,7 @@ const deposit_gas_consumption: Int = ton("0.05"); -contract TONB with Jetton { +contract TONB with TONBTrait { totalSupply: Int as coins; owner: Address; @@ -34,6 +29,7 @@ contract TONB with Jetton { first_linker: Address?; last_linker: Address?; n_linkers: Int = 0; + staking_pool: Address?; init(owner: Address, content: Cell?) { self.totalSupply = 0; @@ -48,6 +44,8 @@ contract TONB with Jetton { self.mint(ctx.sender, msg.amount, ctx.sender); } + receive() {} + receive(msg: Withdraw) { let ctx: Context = context(); require(ctx.value >= withdraw_gas_consumption, "not enough money for withdraw"); diff --git a/sources/jetton_trait.tact b/sources/jetton_trait.tact new file mode 100644 index 0000000..17f2a20 --- /dev/null +++ b/sources/jetton_trait.tact @@ -0,0 +1,151 @@ + +import "@stdlib/ownable"; +import "./wallet"; +import "./linker"; + + +@interface("org.ton.jetton.master") +trait TONBTrait with Ownable { + + // + // Storage + // + + totalSupply: Int; + mintable: Bool; + owner: Address; + content: Cell?; + first_linker: Address?; + last_linker: Address?; + n_linkers: Int = 0; + + + // + // Receivers + // + + receive(msg: TokenUpdateContent) { + + // Allow changing content only by owner + self.requireOwner(); + + // Update content + self.content = msg.content; + } + + receive(msg: TokenBurnNotification) { + + // Check wallet + self.requireWallet(msg.owner); + + // Update supply + self.totalSupply = self.totalSupply - msg.amount; + + // Cashback + if (msg.responseAddress != null) { + send(SendParameters{ + to: msg.responseAddress!!, + value: 0, + bounce: false, + mode: SendRemainingValue + SendIgnoreErrors, + body: TokenExcesses{ + queryId: msg.queryId + }.toCell() + }); + } + } + + + // + // Get Methods + // + + get fun get_wallet_address(owner: Address): Address { + let winit: StateInit = self.getJettonWalletInit(owner); + return contractAddress(winit); + } + + get fun get_jetton_data(): JettonData { + let code: Cell = self.getJettonWalletInit(myAddress()).code; + return JettonData{ + totalSupply: self.totalSupply, + mintable: self.mintable, + owner: self.owner, + content: self.content, + walletCode: code + }; + } + + // + // Private Methods + // + + fun mint(to: Address, amount: Int, responseAddress: Address?) { + + // Update total supply + self.totalSupply = self.totalSupply + amount; + + // Create message + let winit: StateInit = self.getJettonWalletInit(to); + let walletAddress: Address = contractAddress(winit); + // let linker_init: StateInit = initOf Linker(self.n_linkers, walletAddress); + // let linker_address: Address = contractAddress(linker_init); + // send(SendParameters{ + // to: linker_address, + // value: 0, + // bounce: false, + // body: SetLinkerNeighbor{ + // neighbor: self.last_linker + // }.toCell(), + // code: linker_init.code, + // data: linker_init.data + // }); + send(SendParameters{ + to: walletAddress, + value: ton("0.2"), + bounce: false, + body: TokenTransferInternal{ + amount: amount, + queryId: 0, + from: myAddress(), + responseAddress: responseAddress, + forwardTonAmount: 0, + forwardPayload: emptySlice() + }.toCell(), + code: winit.code, + data: winit.data + }); + + } + + fun burn(from: Address, amount: Int, responseAddress: Address?) { + + // Create message + let winit: StateInit = self.getJettonWalletInit(from); + let walletAddress: Address = contractAddress(winit); + send(SendParameters{ + to: walletAddress, + value: 0, + bounce: false, + mode: SendRemainingValue, + body: TokenBurn{ + amount: amount, + queryId: 0, + responseAddress: responseAddress, + owner: from + }.toCell(), + code: winit.code, + data: winit.data + }); + } + + fun requireWallet(owner: Address) { + let ctx: Context = context(); + let winit: StateInit = self.getJettonWalletInit(owner); + require(contractAddress(winit) == ctx.sender, "Invalid sender"); + } + + virtual fun getJettonWalletInit(address: Address): StateInit { + return initOf TONBWallet(myAddress(), address); + } +} \ No newline at end of file diff --git a/sources/output/jetton_Linker.abi b/sources/output/jetton_Linker.abi new file mode 100644 index 0000000..dde4a39 --- /dev/null +++ b/sources/output/jetton_Linker.abi @@ -0,0 +1 @@ +{"name":"Linker","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":"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":"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":"InitLinker","header":1161642861,"fields":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"SetLinkerNeighbor","header":3019699393,"fields":[{"name":"neighbor","type":{"kind":"simple","type":"address","optional":true}}]},{"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":"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":"SetLinkerNeighbor"}}],"getters":[],"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"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"32366":{"message":"not enough money for deposit"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_Linker.code.boc b/sources/output/jetton_Linker.code.boc new file mode 100644 index 0000000000000000000000000000000000000000..295da6bbed02f913032fac62f632fca62c46f56f GIT binary patch literal 316 zcmdn`ZcY&+6E`CRqX7e>$bW_}ON77d`E-Jtk%=*hiJ6J%3=1oR@51uMEDv_xsM-}7 z^Uap?M)8`dTxMrk9$K%-iV8dNGtG5*T=efpM~a!dZ#VMo@)P*8vXN~^#J>+>Z8Ide zd)pXzy8m>y3-DiJ6lylEP(REe(siFjpmqN9WxQ8v%5FYTyZNxAaS>;GL*C8jjP27{ zMA+Cl802>)e`vbrv7Je2R*GjI_tTe*VsBk8Tw(l?blWCJgp= 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 SetLinkerNeighbor message + if (op == 3019699393) { + var self = __gen_load_Linker(); + var msg = in_msg~__gen_read_SetLinkerNeighbor(); + self~$__gen_Linker_receive_SetLinkerNeighbor(msg); + __gen_store_Linker(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://QmT79j24zg2Re4mVCSdgbcXVAfBwfhsZveFUwQHpdgYjCU"; +} \ No newline at end of file diff --git a/sources/output/jetton_Linker.code.fif b/sources/output/jetton_Linker.code.fif new file mode 100644 index 0000000..39bbc43 --- /dev/null +++ b/sources/output/jetton_Linker.code.fif @@ -0,0 +1,185 @@ +PROGRAM{ + DECLPROC __tact_context_get + DECLPROC __tact_verify_address + DECLPROC __tact_load_address + DECLPROC __tact_load_address_opt + DECLPROC __tact_store_address + DECLPROC __tact_store_address_opt + DECLPROC __tact_address_eq + DECLPROC __gen_read_SetLinkerNeighbor + DECLPROC __gen_write_Linker + DECLPROC __gen_read_Linker + DECLPROC __gen_load_Linker + DECLPROC __gen_store_Linker + DECLPROC $__gen_Linker_receive_SetLinkerNeighbor + DECLPROC recv_internal + 113617 DECLMETHOD supported_interfaces + DECLPROC get_abi_ipfs + DECLGLOBVAR __tact_context + DECLGLOBVAR __tact_context_sys + __tact_context_get PROCINLINE:<{ + __tact_context GETGLOB + 4 UNTUPLE + }> + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __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_address_eq PROCINLINE:<{ + SDEQ + }> + __gen_read_SetLinkerNeighbor PROCREF:<{ + 32 LDU + SWAP + 3019699393 PUSHINT + EQUAL + 129 THROWIFNOT + __tact_load_address_opt INLINECALLDICT + }> + __gen_write_Linker PROCREF:<{ + s3 s4 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + NEWC + ROT + __tact_store_address_opt INLINECALLDICT + ENDC + SWAP + STREF + }> + __gen_read_Linker PROCREF:<{ + 257 PUSHINT + LDIX + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + SWAP + LDREF + SWAP + CTOS + __tact_load_address_opt INLINECALLDICT + NIP + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_load_Linker PROCREF:<{ + c4 PUSH + CTOS + LDREF + SWAP + __tact_context_sys SETGLOB + __gen_read_Linker INLINECALLDICT + 1 4 BLKDROP2 + }> + __gen_store_Linker PROCREF:<{ + NEWC + __tact_context_sys GETGLOB + SWAP + STREF + 4 -ROLL + __gen_write_Linker INLINECALLDICT + ENDC + c4 POP + }> + $__gen_Linker_receive_SetLinkerNeighbor PROC:<{ + NIP + __tact_context_get INLINECALLDICT + 2DROP + 4429 PUSHINT + s2 POP + s4 PUSH + __tact_address_eq INLINECALLDICT + THROWANYIFNOT + }> + 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 + }> + 3019699393 PUSHINT + EQUAL + IFJMP:<{ + __gen_load_Linker INLINECALLDICT + s0 s4 XCHG + __gen_read_SetLinkerNeighbor INLINECALLDICT + NIP + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_Linker_receive_SetLinkerNeighbor CALLDICT + __gen_store_Linker INLINECALLDICT + }> + DROP + 130 THROW + }> + supported_interfaces PROC:<{ + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + }> + get_abi_ipfs PROC:<{ + x{697066733a2f2f516d5437396a32347a67325265346d564353646762635856416642776668735a76654655775148706467596a4355} PUSHSLICE + }> +}END>c diff --git a/sources/output/jetton_Linker.code.rev.fif b/sources/output/jetton_Linker.code.rev.fif new file mode 100644 index 0000000..48648ea --- /dev/null +++ b/sources/output/jetton_Linker.code.rev.fif @@ -0,0 +1,179 @@ +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 + 3019699393 PUSHINT + EQUAL + <{ + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 4 BLKDROP2 + }> CALLREF + s0 s4 XCHG + <{ + 32 LDU + s0 s1 XCHG + 3019699393 PUSHINT + EQUAL + 129 THROWIFNOT + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + }> CALLREF + s1 POP + s3 s4 XCHG + s1 s3 s0 XCHG3 + 13 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 4 1 BLKSWAP + <{ + s3 s4 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + NEWC + ROT + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 POP + 130 THROW + + 13: + s1 POP + 1 GETGLOBVAR + 4 UNTUPLE + 2DROP + 4429 PUSHINT + s2 POP + s4 PUSH + SDEQ + THROWANYIFNOT + + 113617: + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_Linker.init.boc b/sources/output/jetton_Linker.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..27077edb4f87b9870e92e96e943d2313760c0856 GIT binary patch literal 107 zcmdn`ZcY&+BReBQ0t2JSe}*qhgum?hbb_0ai7|W#`6q}=fxNm@}?RTFrH?dbYASyi3nugNyak( DSi&Tp literal 0 HcmV?d00001 diff --git a/sources/output/jetton_Linker.init.fc b/sources/output/jetton_Linker.init.fc new file mode 100644 index 0000000..829066d --- /dev/null +++ b/sources/output/jetton_Linker.init.fc @@ -0,0 +1,55 @@ +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_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); + } +} + +builder __gen_write_Linker(builder build_0, (int, slice, slice, slice) v) inline_ref { + var (v'index, v'master, v'owner, v'neighbor) = v; + build_0 = build_0.store_int(v'index, 257); + build_0 = __tact_store_address(build_0, v'master); + build_0 = __tact_store_address_opt(build_0, v'owner); + var build_1 = begin_cell(); + build_1 = __tact_store_address_opt(build_1, v'neighbor); + build_0 = store_ref(build_0, build_1.end_cell()); + return build_0; +} + +cell $__gen_Linker_init(cell sys', int $index, slice $owner) { + var (($self'index, $self'master, $self'owner, $self'neighbor)) = (null(), null(), null(), null()); + $self'index = $index; + $self'owner = $owner; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + $self'master = $ctx'sender; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_Linker(b', ($self'index, $self'master, $self'owner, $self'neighbor)); + return b'.end_cell(); +} + +cell init(cell sys', int $$index, slice $$owner) method_id { + int $index = $$index; + slice $owner = $$owner; + return $__gen_Linker_init(sys', $index, $owner); +} + +() main() { +} \ No newline at end of file diff --git a/sources/output/jetton_Linker.init.fif b/sources/output/jetton_Linker.init.fif new file mode 100644 index 0000000..28b6f77 --- /dev/null +++ b/sources/output/jetton_Linker.init.fif @@ -0,0 +1,69 @@ +PROGRAM{ + DECLPROC __tact_context_get + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __tact_store_address_opt + DECLPROC __gen_write_Linker + DECLPROC $__gen_Linker_init + 107886 DECLMETHOD init + DECLPROC main + DECLGLOBVAR __tact_context + DECLGLOBVAR __tact_context_sys + __tact_context_get PROCINLINE:<{ + __tact_context GETGLOB + 4 UNTUPLE + }> + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __tact_store_address_opt PROCINLINE:<{ + DUP + ISNULL + IF:<{ + DROP + 0 PUSHINT + SWAP + 2 STU + }>ELSE<{ + __tact_store_address INLINECALLDICT + }> + }> + __gen_write_Linker PROCREF:<{ + s3 s4 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + NEWC + ROT + __tact_store_address_opt INLINECALLDICT + ENDC + SWAP + STREF + }> + $__gen_Linker_init PROC:<{ + PUSHNULL + __tact_context_get INLINECALLDICT + s2 s3 XCHG + 3 BLKDROP + s0 s4 XCHG + NEWC + STREF + s4 s4 s4 XCHG3 + __gen_write_Linker INLINECALLDICT + ENDC + }> + init PROC:<{ + $__gen_Linker_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_Linker.init.rev.fif b/sources/output/jetton_Linker.init.rev.fif new file mode 100644 index 0000000..1c9798f --- /dev/null +++ b/sources/output/jetton_Linker.init.rev.fif @@ -0,0 +1,58 @@ +SETCP0 +(:methods + recv_internal: + + 6: + PUSHNULL + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + s0 s4 XCHG + NEWC + STREF + s4 s4 s4 XCHG3 + <{ + s3 s4 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + NEWC + ROT + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + + 107886: + 6 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_Linker.md b/sources/output/jetton_Linker.md new file mode 100644 index 0000000..db0d284 --- /dev/null +++ b/sources/output/jetton_Linker.md @@ -0,0 +1,81 @@ +# TACT Compilation Report +Contract: Linker +BOC Size: 316 bytes + +# Types +Total Types: 18 + +## 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 = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder}` + +## 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}` + +## 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}` + +## InitLinker +TLB: `init_linker#453d436d owner:address = InitLinker` +Signature: `InitLinker{owner:address}` + +## SetLinkerNeighbor +TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` +Signature: `SetLinkerNeighbor{neighbor:Maybe address}` + +## WithdrawalRequests +TLB: `_ addresses:dict amounts:dict n_requests:int257 = WithdrawalRequests` +Signature: `WithdrawalRequests{addresses:dict,amounts:dict,n_requests:int257}` + +## 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: 0 diff --git a/sources/output/jetton_Linker.pkg b/sources/output/jetton_Linker.pkg new file mode 100644 index 0000000..cb1e68f --- /dev/null +++ b/sources/output/jetton_Linker.pkg @@ -0,0 +1 @@ +{"name":"Linker","code":"te6ccgECCwEAATAAART/APSkE/S88sgLAQIBYgIDAgLMBAUATaF3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwOL24EOuk4Q/KmBBrhY/vAWhpgYC42GAAyL/IuHEA/SARKDM3gnwwgUit8EEIWf56YN1Hx22eAm2eGIgaIJh4Bu2ecBh5YEFAYHCAAfumPwgt5ItwIimmRJjgvl6QEW7UTQ1AH4Yts8bBQJADbTHwGCELP89MG68uCB+kAh1wsBwwCRAZIxbeIBGMj4QgHMVTDbPMntVAoAWoEBAdcA+kABAfpAIdcLAcMAkQGSMW3iAdQB0PpAIdcLAcMAkQGSMW3iMRRDMABQUDSBAQHPAAHPFgEgbpUwcAHLAZLPFuLIWCBulTBwAcsBks8W4skBzA==","abi":"{\"name\":\"Linker\",\"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\":\"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\":\"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\":\"InitLinker\",\"header\":1161642861,\"fields\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"SetLinkerNeighbor\",\"header\":3019699393,\"fields\":[{\"name\":\"neighbor\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"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\":\"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\":\"SetLinkerNeighbor\"}}],\"getters\":[],\"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\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"32366\":{\"message\":\"not enough money for deposit\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBwEAYAABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4A0AAdQBI2m34QW8kECNfAwTIzERE2zzJgYAUFA0gQEBzwABzxYBIG6VMHABywGSzxbiyFggbpUwcAHLAZLPFuLJAcw=","args":[{"name":"index","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}],"deployment":{"kind":"system-cell","system":"te6cckECDQEAAToAAQHAAQEFodSXAgEU/wD0pBP0vPLICwMCAWIFBABNoXejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzAgLMBwYAH7pj8ILeSLcCIppkSY4L5ekDi9uBDrpOEPypgQa4WP7wFoaYGAuNhgAMi/yLhxAP0gESgzN4J8MIFIrfBBCFn+emDdR8dtngJtnhiIGiCYeAbtnnAYeWBBQLCggBGMj4QgHMVTDbPMntVAkAUFA0gQEBzwABzxYBIG6VMHABywGSzxbiyFggbpUwcAHLAZLPFuLJAcwANtMfAYIQs/z0wbry4IH6QCHXCwHDAJEBkjFt4gEW7UTQ1AH4Yts8bBQMAFqBAQHXAPpAAQH6QCHXCwHDAJEBkjFt4gHUAdD6QCHXCwHDAJEBkjFt4jEUQzD4eYav"}},"compiler":{"name":"tact","version":"0.8.11"}} \ No newline at end of file diff --git a/sources/output/jetton_Linker.ts b/sources/output/jetton_Linker.ts new file mode 100644 index 0000000..c23d421 --- /dev/null +++ b/sources/output/jetton_Linker.ts @@ -0,0 +1,1024 @@ +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; +} + +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()); + }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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); + 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 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 InitLinker = { + $$type: 'InitLinker'; + owner: Address; +} + +export function storeInitLinker(src: InitLinker) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1161642861, 32); + b_0.storeAddress(src.owner); + }; +} + +export function loadInitLinker(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } + let _owner = sc_0.loadAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function loadTupleInitLinker(source: TupleReader) { + let _owner = source.readAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function storeTupleInitLinker(source: InitLinker) { + let builder = new TupleBuilder(); + builder.writeAddress(source.owner); + 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 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 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 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 Linker_init(index: bigint, owner: Address) { + const __init = 'te6ccgEBBwEAYAABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4A0AAdQBI2m34QW8kECNfAwTIzERE2zzJgYAUFA0gQEBzwABzxYBIG6VMHABywGSzxbiyFggbpUwcAHLAZLPFuLJAcw='; + const __code = 'te6ccgECCwEAATAAART/APSkE/S88sgLAQIBYgIDAgLMBAUATaF3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwOL24EOuk4Q/KmBBrhY/vAWhpgYC42GAAyL/IuHEA/SARKDM3gnwwgUit8EEIWf56YN1Hx22eAm2eGIgaIJh4Bu2ecBh5YEFAYHCAAfumPwgt5ItwIimmRJjgvl6QEW7UTQ1AH4Yts8bBQJADbTHwGCELP89MG68uCB+kAh1wsBwwCRAZIxbeIBGMj4QgHMVTDbPMntVAoAWoEBAdcA+kABAfpAIdcLAcMAkQGSMW3iAdQB0PpAIdcLAcMAkQGSMW3iMRRDMABQUDSBAQHPAAHPFgEgbpUwcAHLAZLPFuLIWCBulTBwAcsBks8W4skBzA=='; + const __system = 'te6cckECDQEAAToAAQHAAQEFodSXAgEU/wD0pBP0vPLICwMCAWIFBABNoXejBOC52Hq6WVz2PQnYc6yVCjbNBOE7rGpaVsj5ZkWnXlv74sRzAgLMBwYAH7pj8ILeSLcCIppkSY4L5ekDi9uBDrpOEPypgQa4WP7wFoaYGAuNhgAMi/yLhxAP0gESgzN4J8MIFIrfBBCFn+emDdR8dtngJtnhiIGiCYeAbtnnAYeWBBQLCggBGMj4QgHMVTDbPMntVAkAUFA0gQEBzwABzxYBIG6VMHABywGSzxbiyFggbpUwcAHLAZLPFuLJAcwANtMfAYIQs/z0wbry4IH6QCHXCwHDAJEBkjFt4gEW7UTQ1AH4Yts8bBQMAFqBAQHXAPpAAQH6QCHXCwHDAJEBkjFt4gHUAdD6QCHXCwHDAJEBkjFt4jEUQzD4eYav'; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeNumber(index); + builder.writeAddress(owner); + 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 (Linker_errors[res.exitCode]) { + throw new ComputeError(Linker_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 Linker_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` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 32366: { message: `not enough money for deposit` }, + 62972: { message: `Invalid balance` }, +} + +export class Linker implements Contract { + + static async init(index: bigint, owner: Address) { + return await Linker_init(index,owner); + } + + static async fromInit(index: bigint, owner: Address) { + const init = await Linker_init(index,owner); + const address = contractAddress(0, init); + return new Linker(address, init); + } + + static fromAddress(address: Address) { + return new Linker(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: Linker_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: SetLinkerNeighbor) { + + let body: Cell | null = null; + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'SetLinkerNeighbor') { + body = beginCell().store(storeSetLinkerNeighbor(message)).endCell(); + } + if (body === null) { throw new Error('Invalid message type'); } + + await provider.internal(via, { ...args, body: body }); + + } + +} \ No newline at end of file diff --git a/sources/output/jetton_TONB.abi b/sources/output/jetton_TONB.abi new file mode 100644 index 0000000..0c152a0 --- /dev/null +++ b/sources/output/jetton_TONB.abi @@ -0,0 +1 @@ +{"name":"TONB","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":"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":"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":"InitLinker","header":1161642861,"fields":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"SetLinkerNeighbor","header":3019699393,"fields":[{"name":"neighbor","type":{"kind":"simple","type":"address","optional":true}}]},{"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":"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":"Deposit"}},{"receiver":"internal","message":{"kind":"empty"}},{"receiver":"internal","message":{"kind":"typed","type":"Withdraw"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenUpdateContent"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenBurnNotification"}}],"getters":[{"name":"get_wallet_address","arguments":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}],"returnType":{"kind":"simple","type":"address","optional":false}},{"name":"get_jetton_data","arguments":[],"returnType":{"kind":"simple","type":"JettonData","optional":false}},{"name":"owner","arguments":[],"returnType":{"kind":"simple","type":"address","optional":false}}],"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"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"32366":{"message":"not enough money for deposit"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_TONB.code.boc b/sources/output/jetton_TONB.code.boc new file mode 100644 index 0000000000000000000000000000000000000000..41e813fbb1c2ea12277de6d0da51c4d1517bbb14 GIT binary patch literal 1506 zcmZuxZA?>V6h7znBDWvt3;m)};Uc2W&(fkpy}$*FGDOmBYH*O)sLT9;jxb$}Hm-C{ z&_u&9q6sLHh|3l+Zi>2)ikHbYN;@w>99im?2IsbzL0Dt3X_mRSRTo+Oai4qM^YJ|I zIXU-UpFG=u%qE1S9|3jG;7OPEi7zs!Mh15>3WgbClNjV@B~#F(P%zKKl)lB2KmFdg z-^gG&r)02NrH0mS802{yLhp#`Sk904?Mcvw``-O zD!uY(m;cI5zj0-qt>qOuxeQ+q z&jWui3q2%z@hSlir66wKUwJj$WfFO{-WzV_Znc zBL~U*WE&|X`6ZUAypUkjnb^|iGp~zUDVv8J{`t%=y+*ys01Fec334jih&ToaD-zCx z4t0(Iwv3+Ki{q#$ZEi~_=95dLjU0QayOo);QC>?#@)*-iXqd1Mk79IZNT^Gn3zZ47 zgd!!oR~&73W_f0UAA@u`GqdQ{uD4T*&!&)Pr7%B-!s0h5EXbv>a1kU~txizn^Pm(s zfpfwpv!THZ4N|Q{ANppm*{nxItJ(eHc(pO|EV7@c#Y>h_SZQINTFqjEdkabpZd&L* zg&%%<3jT4Qg@!gR)a|e7{&QE$c^b6Fqwzya^vn6`s+?{M;Qlt>94)|N?ggHf|Ph}94owQ3^K83;} z3aeIAc(VXf1Z9Z#abeIFsi;YglOT`p>Gtf=*SeHr0{4LTGO;PQnJZFpF3y`$!rB{I zPV(BN8**wjtM$%ttaB;#WzIFYi_P@TwHw$p@9ejiR0xS`Gf(uyPSZuNJ$YJYGs^6= zL}&3S+0^^x;dQ7P-0GmqxE88B#CW32x?MMU0_c&e#xq?xGd+oAV1GddT)2 z$v#I?AWIu4ei40jzi5ZWB88GtSW`r5{46&n-FFH~$!UK_^l_uiSN$7YxAY~QFz;p9 z|5ra9BV8iaG}a%6rE$N8-_d?N?CJCIE4{v3CZ8%k$+8U;HkQ+UeVMdD(7c)y2BW@K zP;a)=A5*Is#t+!}1Bv+z#OL$ar`BbDUXjuLu%FVPH+YV literal 0 HcmV?d00001 diff --git a/sources/output/jetton_TONB.code.fc b/sources/output/jetton_TONB.code.fc new file mode 100644 index 0000000..12a7539 --- /dev/null +++ b/sources/output/jetton_TONB.code.fc @@ -0,0 +1,489 @@ +forall X -> X __tact_not_null(X x) { throw_if(128, null?(x)); return x; } + +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); + } +} + +slice __tact_create_address(int chain, int hash) inline { + var b = begin_cell(); + b = b.store_uint(2, 2); + b = b.store_uint(0, 1); + b = b.store_int(chain, 8); + b = b.store_uint(hash, 256); + return b.end_cell().begin_parse(); +} + +slice __tact_compute_contract_address(int chain, cell code, cell data) inline { + var b = begin_cell(); + b = b.store_uint(0, 2); + b = b.store_uint(3, 2); + b = b.store_uint(0, 1); + b = b.store_ref(code); + b = b.store_ref(data); + var hash = cell_hash(b.end_cell()); + return __tact_create_address(chain, hash); +} + +int __tact_address_eq(slice a, slice b) inline { + return equal_slice_bits(a, b); +} + +cell __tact_dict_set_code(cell dict, int id, cell code) inline { + return udict_set_ref(dict, 16, id, code); +} + +cell __tact_dict_get_code(cell dict, int id) inline { + var (data, ok) = udict_get_ref?(dict, 16, id); + throw_unless(135, ok); + return data; +} + +builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref { + var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v; + build_0 = store_uint(build_0, 395134233, 32); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); + build_0 = __tact_store_address(build_0, v'from); + build_0 = __tact_store_address_opt(build_0, v'responseAddress); + build_0 = build_0.store_coins(v'forwardTonAmount); + build_0 = build_0.store_slice(v'forwardPayload); + return build_0; +} + +cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref { + return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); +} + +builder __gen_write_TokenBurn(builder build_0, (int, int, slice, slice) v) inline_ref { + var (v'queryId, v'amount, v'owner, v'responseAddress) = v; + build_0 = store_uint(build_0, 1499400124, 32); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address_opt(build_0, v'responseAddress); + return build_0; +} + +cell __gen_writecell_TokenBurn((int, int, slice, slice) v) inline_ref { + return __gen_write_TokenBurn(begin_cell(), v).end_cell(); +} + +(slice, ((int, int, slice, slice))) __gen_read_TokenBurnNotification(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 2078119902); + var v'queryId = sc_0~load_uint(64); + var v'amount = sc_0~load_coins(); + var v'owner = sc_0~__tact_load_address(); + var v'responseAddress = sc_0~__tact_load_address_opt(); + return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress)); +} + +builder __gen_write_TokenExcesses(builder build_0, (int) v) inline_ref { + var (v'queryId) = v; + build_0 = store_uint(build_0, 3576854235, 32); + build_0 = build_0.store_uint(v'queryId, 64); + return build_0; +} + +cell __gen_writecell_TokenExcesses((int) v) inline_ref { + return __gen_write_TokenExcesses(begin_cell(), v).end_cell(); +} + +(slice, ((cell))) __gen_read_TokenUpdateContent(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 201882270); + var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null(); + return (sc_0, (v'content)); +} + +(slice, ((int))) __gen_read_Deposit(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 569292295); + var v'amount = sc_0~load_coins(); + return (sc_0, (v'amount)); +} + +(slice, ((int))) __gen_read_Withdraw(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 1616450832); + var v'amount = sc_0~load_int(257); + return (sc_0, (v'amount)); +} + +builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { + var (v'balance, v'owner, v'master) = v; + build_0 = build_0.store_int(v'balance, 257); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address(build_0, v'master); + return build_0; +} + +builder __gen_write_TONB(builder build_0, (int, slice, cell, int, slice, slice, int, slice) v) inline_ref { + var (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool) = v; + build_0 = build_0.store_coins(v'totalSupply); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1); + build_0 = build_0.store_int(v'mintable, 1); + build_0 = __tact_store_address_opt(build_0, v'first_linker); + build_0 = __tact_store_address_opt(build_0, v'last_linker); + var build_1 = begin_cell(); + build_1 = build_1.store_int(v'n_linkers, 257); + build_1 = __tact_store_address_opt(build_1, v'staking_pool); + build_0 = store_ref(build_0, build_1.end_cell()); + return build_0; +} + +(slice, ((int, slice, cell, int, slice, slice, int, slice))) __gen_read_TONB(slice sc_0) inline_ref { + var v'totalSupply = sc_0~load_coins(); + var v'owner = sc_0~__tact_load_address(); + var v'content = sc_0~load_int(1) ? sc_0~load_ref() : null(); + var v'mintable = sc_0~load_int(1); + var v'first_linker = sc_0~__tact_load_address_opt(); + var v'last_linker = sc_0~__tact_load_address_opt(); + slice sc_1 = sc_0~load_ref().begin_parse(); + var v'n_linkers = sc_1~load_int(257); + var v'staking_pool = sc_1~__tact_load_address_opt(); + return (sc_0, (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool)); +} + +_ __gen_StateInit_get_code((cell, cell) v) inline { + var (v'code, v'data) = v; + return v'code; +} + +_ __gen_Context_get_sender((int, slice, int, slice) v) inline { + var (v'bounced, v'sender, v'value, v'raw) = v; + return v'sender; +} + +(int, int, slice, cell, cell) __gen_JettonData_to_external(((int, int, slice, cell, cell)) v) { + var (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode) = v; + return (v'totalSupply, v'mintable, v'owner, v'content, v'walletCode); +} + +(int, slice, cell, int, slice, slice, int, slice) __gen_load_TONB() inline_ref { + slice sc = get_data().begin_parse(); + __tact_context_sys = sc~load_ref(); + return sc~__gen_read_TONB(); +} + +() __gen_store_TONB((int, slice, cell, int, slice, slice, int, slice) v) impure inline_ref { + builder b = begin_cell(); + b = b.store_ref(__tact_context_sys); + b = __gen_write_TONB(b, v); + set_data(b.end_cell()); +} + +cell $emptyCell() impure { + return end_cell(begin_cell()); +} + +slice $__gen_Cell_asSlice(cell $self) impure { + var ($self) = $self; + return begin_parse($self); +} + +slice $emptySlice() impure { + return $__gen_Cell_asSlice($emptyCell()); +} + +slice $contractAddress((cell, cell) $s) impure { + var (($s'code, $s'data)) = $s; + return __tact_compute_contract_address(0, $s'code, $s'data); +} + +() $send((int, slice, int, int, cell, cell, cell) $params) impure { + 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); +} + +cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { + var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); + $self'balance = 0; + $self'owner = $owner; + $self'master = $master; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); + return b'.end_cell(); +} + +(cell, cell) $__gen_TONBWallet_init_child(cell sys', slice $master, slice $owner) { + slice sc' = sys'.begin_parse(); + cell source = sc'~load_dict(); + cell contracts = new_dict(); + + ;; Contract Code: TONBWallet + cell mine = __tact_dict_get_code(source, 24708); + contracts = __tact_dict_set_code(contracts, 24708, mine); + cell sys = begin_cell().store_dict(contracts).end_cell(); + return (mine, $__gen_TONBWallet_init(sys, $master, $owner)); +} + +((int, slice, cell, int, slice, slice, int, slice), (cell, cell)) $__gen_TONB_getJettonWalletInit((int, slice, cell, int, slice, slice, int, slice) $self, slice $address) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), $__gen_TONBWallet_init_child(__tact_context_sys, my_address(), $address)); +} + +slice $__gen_TONB_get_wallet_address((int, slice, cell, int, slice, slice, int, slice) $self, slice $owner) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($owner); + return $contractAddress(($winit'code, $winit'data)); +} + +_ $__gen_get_get_wallet_address(slice $$owner) method_id(103289) { + slice $owner = $$owner; + var self = __gen_load_TONB(); + var res = $__gen_TONB_get_wallet_address(self, $owner); + return res; +} + +(int, int, slice, cell, cell) $__gen_TONB_get_jetton_data((int, slice, cell, int, slice, slice, int, slice) $self) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + cell $code = __gen_StateInit_get_code(($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit(my_address())); + return ($self'totalSupply, $self'mintable, $self'owner, $self'content, $code); +} + +_ $__gen_get_get_jetton_data() method_id(106029) { + var self = __gen_load_TONB(); + var res = $__gen_TONB_get_jetton_data(self); + return __gen_JettonData_to_external(res); +} + +((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_mint((int, slice, cell, int, slice, slice, int, slice) $self, slice $to, int $amount, slice $responseAddress) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + $self'totalSupply = ($self'totalSupply + $amount); + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($to); + slice $walletAddress = $contractAddress(($winit'code, $winit'data)); + $send((false, $walletAddress, 200000000, 0, __gen_writecell_TokenTransferInternal((0, $amount, my_address(), $responseAddress, 0, $emptySlice())), $winit'code, $winit'data)); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_burn((int, slice, cell, int, slice, slice, int, slice) $self, slice $from, int $amount, slice $responseAddress) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($from); + slice $walletAddress = $contractAddress(($winit'code, $winit'data)); + $send((false, $walletAddress, 0, 64, __gen_writecell_TokenBurn((0, $amount, $from, $responseAddress)), $winit'code, $winit'data)); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_requireWallet((int, slice, cell, int, slice, slice, int, slice) $self, slice $owner) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + var ($winit'code, $winit'data) = ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_getJettonWalletInit($owner); + throw_unless(4429, __tact_address_eq($contractAddress(($winit'code, $winit'data)), $ctx'sender)); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +((int, slice, cell, int, slice, slice, int, slice), ()) $__gen_TONB_requireOwner((int, slice, cell, int, slice, slice, int, slice) $self) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + throw_unless(132, __tact_address_eq(__gen_Context_get_sender(__tact_context_get()), $self'owner)); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +slice $__gen_TONB_owner((int, slice, cell, int, slice, slice, int, slice) $self) impure { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = $self; + return $self'owner; +} + +_ $__gen_get_owner() method_id(83229) { + var self = __gen_load_TONB(); + var res = $__gen_TONB_owner(self); + return res; +} + +(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_Deposit((int, slice, cell, int, slice, slice, int, slice) $self, (int) $msg) impure { + var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; + var ($msg'amount) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(32366, ($ctx'value >= 50000000)); + ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_mint($ctx'sender, $msg'amount, $ctx'sender); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive((int, slice, cell, int, slice, slice, int, slice) $self) impure { + var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_Withdraw((int, slice, cell, int, slice, slice, int, slice) $self, (int) $msg) impure { + var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; + var ($msg'amount) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(6384, ($ctx'value >= 50000000)); + ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_burn($ctx'sender, $msg'amount, $ctx'sender); + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_TokenUpdateContent((int, slice, cell, int, slice, slice, int, slice) $self, (cell) $msg) impure { + var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; + var ($msg'content) = $msg; + ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireOwner(); + $self'content = $msg'content; + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + +(((int, slice, cell, int, slice, slice, int, slice)), ()) $__gen_TONB_receive_TokenBurnNotification((int, slice, cell, int, slice, slice, int, slice) $self, (int, int, slice, slice) $msg) impure { + var ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool) = $self; + var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; + ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)~$__gen_TONB_requireWallet($msg'owner); + $self'totalSupply = ($self'totalSupply - $msg'amount); + if ((~ null?($msg'responseAddress))) { + $send((false, __tact_not_null($msg'responseAddress), 0, (64 + 2), __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); + } + return (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool), ()); +} + + +() 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 Deposit message + if (op == 569292295) { + var self = __gen_load_TONB(); + var msg = in_msg~__gen_read_Deposit(); + self~$__gen_TONB_receive_Deposit(msg); + __gen_store_TONB(self); + return (); + } + + ;; Receive empty message + if ((op == 0) & (slice_bits(in_msg) <= 32)) { + var self = __gen_load_TONB(); + self~$__gen_TONB_receive(); + __gen_store_TONB(self); + return (); + } + + ;; Receive Withdraw message + if (op == 1616450832) { + var self = __gen_load_TONB(); + var msg = in_msg~__gen_read_Withdraw(); + self~$__gen_TONB_receive_Withdraw(msg); + __gen_store_TONB(self); + return (); + } + + ;; Receive TokenUpdateContent message + if (op == 201882270) { + var self = __gen_load_TONB(); + var msg = in_msg~__gen_read_TokenUpdateContent(); + self~$__gen_TONB_receive_TokenUpdateContent(msg); + __gen_store_TONB(self); + return (); + } + + ;; Receive TokenBurnNotification message + if (op == 2078119902) { + var self = __gen_load_TONB(); + var msg = in_msg~__gen_read_TokenBurnNotification(); + self~$__gen_TONB_receive_TokenBurnNotification(msg); + __gen_store_TONB(self); + return (); + } + + throw(130); +} + +_ supported_interfaces() method_id { + return ( + "org.ton.introspection.v0"H >> 128, + "org.ton.abi.ipfs.v0"H >> 128, + "org.ton.jetton.master"H >> 128, + "org.ton.ownable"H >> 128 + ); +} + +_ get_abi_ipfs() { + return "ipfs://Qma6JYPtEyX4isBJUUKdLJZsPe3r5ig6X7NFfzn7hBBCFC"; +} \ No newline at end of file diff --git a/sources/output/jetton_TONB.code.fif b/sources/output/jetton_TONB.code.fif new file mode 100644 index 0000000..d769bec --- /dev/null +++ b/sources/output/jetton_TONB.code.fif @@ -0,0 +1,819 @@ +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_create_address + DECLPROC __tact_compute_contract_address + DECLPROC __tact_address_eq + DECLPROC __tact_dict_set_code + DECLPROC __tact_dict_get_code + DECLPROC __gen_write_TokenTransferInternal + DECLPROC __gen_writecell_TokenTransferInternal + DECLPROC __gen_write_TokenBurn + DECLPROC __gen_writecell_TokenBurn + DECLPROC __gen_read_TokenBurnNotification + DECLPROC __gen_write_TokenExcesses + DECLPROC __gen_writecell_TokenExcesses + DECLPROC __gen_read_TokenUpdateContent + DECLPROC __gen_read_Deposit + DECLPROC __gen_read_Withdraw + DECLPROC __gen_write_TONBWallet + DECLPROC __gen_write_TONB + DECLPROC __gen_read_TONB + DECLPROC __gen_StateInit_get_code + DECLPROC __gen_Context_get_sender + DECLPROC __gen_JettonData_to_external + DECLPROC __gen_load_TONB + DECLPROC __gen_store_TONB + DECLPROC $emptyCell + DECLPROC $__gen_Cell_asSlice + DECLPROC $emptySlice + DECLPROC $contractAddress + DECLPROC $send + DECLPROC $__gen_TONBWallet_init + DECLPROC $__gen_TONBWallet_init_child + DECLPROC $__gen_TONB_getJettonWalletInit + DECLPROC $__gen_TONB_get_wallet_address + 103289 DECLMETHOD $__gen_get_get_wallet_address + DECLPROC $__gen_TONB_get_jetton_data + 106029 DECLMETHOD $__gen_get_get_jetton_data + DECLPROC $__gen_TONB_mint + DECLPROC $__gen_TONB_burn + DECLPROC $__gen_TONB_requireWallet + DECLPROC $__gen_TONB_requireOwner + DECLPROC $__gen_TONB_owner + 83229 DECLMETHOD $__gen_get_owner + DECLPROC $__gen_TONB_receive_Deposit + DECLPROC $__gen_TONB_receive + DECLPROC $__gen_TONB_receive_Withdraw + DECLPROC $__gen_TONB_receive_TokenUpdateContent + DECLPROC $__gen_TONB_receive_TokenBurnNotification + DECLPROC recv_internal + 113617 DECLMETHOD supported_interfaces + DECLPROC get_abi_ipfs + DECLGLOBVAR __tact_context + DECLGLOBVAR __tact_context_sys + __tact_not_null PROC:<{ + 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_create_address PROCINLINE:<{ + NEWC + 2 PUSHINT + SWAP + 2 STU + 0 PUSHINT + SWAP + 1 STU + s1 s2 XCHG + 8 STI + 256 STU + ENDC + CTOS + }> + __tact_compute_contract_address PROCINLINE:<{ + NEWC + 0 PUSHINT + SWAP + 2 STU + 3 PUSHINT + SWAP + 2 STU + 0 PUSHINT + SWAP + 1 STU + s1 s2 XCHG + STREF + STREF + ENDC + HASHCU + __tact_create_address INLINECALLDICT + }> + __tact_address_eq PROCINLINE:<{ + SDEQ + }> + __tact_dict_set_code PROCINLINE:<{ + s0 s2 XCHG + 16 PUSHINT + DICTUSETREF + }> + __tact_dict_get_code PROCINLINE:<{ + SWAP + 16 PUSHINT + DICTUGETREF + NULLSWAPIFNOT + 135 THROWIFNOT + }> + __gen_write_TokenTransferInternal PROCREF:<{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + SWAP + STGRAMS + SWAP + STSLICER + }> + __gen_writecell_TokenTransferInternal PROCREF:<{ + NEWC + 6 -ROLL + __gen_write_TokenTransferInternal INLINECALLDICT + ENDC + }> + __gen_write_TokenBurn PROCREF:<{ + 1499400124 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + SWAP + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + }> + __gen_writecell_TokenBurn PROCREF:<{ + NEWC + 4 -ROLL + __gen_write_TokenBurn INLINECALLDICT + ENDC + }> + __gen_read_TokenBurnNotification PROCREF:<{ + 32 LDU + SWAP + 2078119902 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_write_TokenExcesses PROCREF:<{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> + __gen_writecell_TokenExcesses PROCREF:<{ + NEWC + SWAP + __gen_write_TokenExcesses INLINECALLDICT + ENDC + }> + __gen_read_TokenUpdateContent PROCREF:<{ + 32 LDU + SWAP + 201882270 PUSHINT + EQUAL + 129 THROWIFNOT + 1 LDI + SWAP + IF:<{ + LDREF + }>ELSE<{ + PUSHNULL + SWAP + }> + SWAP + }> + __gen_read_Deposit PROCREF:<{ + 32 LDU + SWAP + 569292295 PUSHINT + EQUAL + 129 THROWIFNOT + LDGRAMS + SWAP + }> + __gen_read_Withdraw PROCREF:<{ + 32 LDU + SWAP + 1616450832 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDIX + SWAP + }> + __gen_write_TONBWallet PROCREF:<{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + }> + __gen_write_TONB PROCREF:<{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + __tact_store_address INLINECALLDICT + s3 PUSH + ISNULL + NOT + IF:<{ + TRUE + SWAP + 1 STI + s1 s3 XCHG + STREF + }>ELSE<{ + s3 POP + FALSE + s0 s3 XCHG2 + 1 STI + }> + 1 STI + SWAP + __tact_store_address_opt INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + SWAP + __tact_store_address_opt INLINECALLDICT + ENDC + SWAP + STREF + }> + __gen_read_TONB PROCREF:<{ + LDGRAMS + __tact_load_address INLINECALLDICT + SWAP + 1 LDI + SWAP + IF:<{ + LDREF + }>ELSE<{ + PUSHNULL + SWAP + }> + 1 LDI + __tact_load_address_opt INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + SWAP + LDREF + SWAP + CTOS + 257 PUSHINT + LDIX + __tact_load_address_opt INLINECALLDICT + NIP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> + __gen_StateInit_get_code PROCINLINE:<{ + DROP + }> + __gen_Context_get_sender PROCINLINE:<{ + s2 s3 XCHG + 3 BLKDROP + }> + __gen_JettonData_to_external PROC:<{ + }> + __gen_load_TONB PROCREF:<{ + c4 PUSH + CTOS + LDREF + SWAP + __tact_context_sys SETGLOB + __gen_read_TONB INLINECALLDICT + 1 8 BLKDROP2 + }> + __gen_store_TONB PROCREF:<{ + NEWC + __tact_context_sys GETGLOB + SWAP + STREF + 8 -ROLL + __gen_write_TONB INLINECALLDICT + ENDC + c4 POP + }> + $emptyCell PROC:<{ + NEWC + ENDC + }> + $__gen_Cell_asSlice PROC:<{ + CTOS + }> + $emptySlice PROC:<{ + $emptyCell CALLDICT + $__gen_Cell_asSlice CALLDICT + }> + $contractAddress PROC:<{ + 0 PUSHINT + -ROT + __tact_compute_contract_address INLINECALLDICT + }> + $send PROC:<{ + 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 CALLDICT + 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 CALLDICT + 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 CALLDICT + SWAP + STREF + }>ELSE<{ + NIP + FALSE + __tact_store_bool INLINECALLDICT + }> + ENDC + SWAP + SENDRAWMSG + }> + $__gen_TONBWallet_init PROC:<{ + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + __gen_write_TONBWallet INLINECALLDICT + ENDC + }> + $__gen_TONBWallet_init_child PROC:<{ + s0 s2 XCHG + CTOS + LDDICT + DROP + NEWDICT + SWAP + 24708 PUSHINT + __tact_dict_get_code INLINECALLDICT + SWAP + 24708 PUSHINT + s2 PUSH + __tact_dict_set_code INLINECALLDICT + NEWC + STDICT + ENDC + s0 s0 s3 XCHG3 + $__gen_TONBWallet_init CALLDICT + }> + $__gen_TONB_getJettonWalletInit PROC:<{ + __tact_context_sys GETGLOB + MYADDR + ROT + $__gen_TONBWallet_init_child CALLDICT + }> + $__gen_TONB_get_wallet_address PROC:<{ + $__gen_TONB_getJettonWalletInit CALLDICT + 8 2 BLKDROP2 + $contractAddress CALLDICT + }> + $__gen_get_get_wallet_address PROC:<{ + __gen_load_TONB INLINECALLDICT + 8 ROLL + $__gen_TONB_get_wallet_address CALLDICT + }> + $__gen_TONB_get_jetton_data PROC:<{ + MYADDR + $__gen_TONB_getJettonWalletInit CALLDICT + 4 2 BLKDROP2 + __gen_StateInit_get_code INLINECALLDICT + s3 s3 s0 XCHG3 + }> + $__gen_get_get_jetton_data PROC:<{ + __gen_load_TONB INLINECALLDICT + $__gen_TONB_get_jetton_data CALLDICT + __gen_JettonData_to_external CALLDICT + }> + $__gen_TONB_mint PROC:<{ + s10 s1 XCPU + ADD + 8 2 BLKSWAP + $__gen_TONB_getJettonWalletInit CALLDICT + 2DUP + $contractAddress CALLDICT + FALSE + 200000000 PUSHINT + 0 PUSHINT + DUP + MYADDR + OVER + $emptySlice CALLDICT + s3 s5 XCHG + s4 18 s() XCHG + s2 s3 XCHG + s2 19 s() XCHG + __gen_writecell_TokenTransferInternal INLINECALLDICT + s5 s6 s0 XCHG3 + s4 s14 XCHG + s3 s13 XCHG + s0 s14 s13 XCHG3 + $send CALLDICT + 2 6 BLKSWAP + }> + $__gen_TONB_burn PROC:<{ + s7 s10 XCHG + s6 s9 XCHG + s5 s8 XCHG + s4 s10 XCHG + s3 s9 XCHG + s8 s10 s9 XCHG3 + s8 PUSH + $__gen_TONB_getJettonWalletInit CALLDICT + 2DUP + $contractAddress CALLDICT + FALSE + 0 PUSHINT + 64 PUSHINT + s1 s0 s2 PUXC2 + s2 17 s() XCHG + s0 16 s() XCHG + s1 s15 XCHG + __gen_writecell_TokenBurn INLINECALLDICT + s6 s13 XCHG + s1 s5 XCHG + s4 s14 XCHG + s3 s12 XCHG + s12 s2 XCHG2 + $send CALLDICT + s4 s7 XCHG + 3 4 BLKSWAP + }> + $__gen_TONB_requireWallet PROC:<{ + __tact_context_get INLINECALLDICT + s2 s3 XCHG + 3 BLKDROP + 9 -ROLL + $__gen_TONB_getJettonWalletInit CALLDICT + SWAP + 4429 PUSHINT + s0 s2 XCHG + $contractAddress CALLDICT + s0 s10 XCHG2 + __tact_address_eq INLINECALLDICT + s1 s9 XCHG + THROWANYIFNOT + 7 ROLL + }> + $__gen_TONB_requireOwner PROC:<{ + __tact_context_get INLINECALLDICT + __gen_Context_get_sender INLINECALLDICT + s7 PUSH + __tact_address_eq INLINECALLDICT + 132 THROWIFNOT + }> + $__gen_TONB_owner PROC:<{ + s6 s7 XCHG + 7 BLKDROP + }> + $__gen_get_owner PROC:<{ + __gen_load_TONB INLINECALLDICT + $__gen_TONB_owner CALLDICT + }> + $__gen_TONB_receive_Deposit PROC:<{ + __tact_context_get INLINECALLDICT + DROP + 32366 PUSHINT + s3 POP + 50000000 PUSHINT + GEQ + s1 s2 XCHG + THROWANYIFNOT + TUCK + $__gen_TONB_mint CALLDICT + }> + $__gen_TONB_receive PROC:<{ + }> + $__gen_TONB_receive_Withdraw PROC:<{ + __tact_context_get INLINECALLDICT + DROP + 6384 PUSHINT + s3 POP + 50000000 PUSHINT + GEQ + s1 s2 XCHG + THROWANYIFNOT + TUCK + $__gen_TONB_burn CALLDICT + }> + $__gen_TONB_receive_TokenUpdateContent PROC:<{ + 8 -ROLL + $__gen_TONB_requireOwner CALLDICT + s5 POP + s6 s7 XCHG + s5 s6 XCHG + 4 ROLL + }> + $__gen_TONB_receive_TokenBurnNotification PROC:<{ + s8 s11 XCHG + s7 s10 XCHG + s6 s9 XCHG + s5 s11 XCHG + s4 s10 XCHG + s3 s9 XCHG + s11 s10 s10 XCHG3 + $__gen_TONB_requireWallet CALLDICT + s7 s10 XCHG2 + SUB + s8 PUSH + ISNULL + NOT + IF:<{ + FALSE + s0 s9 XCHG + __tact_not_null CALLDICT + 0 PUSHINT + 66 PUSHINT + s0 s10 XCHG + __gen_writecell_TokenExcesses INLINECALLDICT + s4 s11 XCHG + s1 s3 s0 XCHG3 + s1 s10 XCHG + PUSHNULL + PUSHNULL + $send CALLDICT + }>ELSE<{ + s7 POP + s7 POP + }> + s5 s7 XCHG + s3 s6 XCHG + s5 s1 s3 XCHG3 + s4 s2 XCHG2 + }> + 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 + 569292295 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_TONB INLINECALLDICT + s0 s8 XCHG + __gen_read_Deposit INLINECALLDICT + NIP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_TONB_receive_Deposit CALLDICT + __gen_store_TONB INLINECALLDICT + }> + DUP + 0 EQINT + s2 PUSH + SBITS + 33 LESSINT + AND + IFJMP:<{ + 2DROP + __gen_load_TONB INLINECALLDICT + $__gen_TONB_receive CALLDICT + __gen_store_TONB INLINECALLDICT + }> + DUP + 1616450832 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_TONB INLINECALLDICT + s0 s8 XCHG + __gen_read_Withdraw INLINECALLDICT + NIP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_TONB_receive_Withdraw CALLDICT + __gen_store_TONB INLINECALLDICT + }> + DUP + 201882270 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_TONB INLINECALLDICT + s0 s8 XCHG + __gen_read_TokenUpdateContent INLINECALLDICT + NIP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + $__gen_TONB_receive_TokenUpdateContent CALLDICT + __gen_store_TONB INLINECALLDICT + }> + 2078119902 PUSHINT + EQUAL + IFJMP:<{ + __gen_load_TONB INLINECALLDICT + s0 s8 XCHG + __gen_read_TokenBurnNotification INLINECALLDICT + s4 POP + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + 3 ROLL + $__gen_TONB_receive_TokenBurnNotification CALLDICT + __gen_store_TONB INLINECALLDICT + }> + DROP + 130 THROW + }> + supported_interfaces PROC:<{ + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + 258390863389042349688353801369539695109 PUSHINT + 86142586315491086060343270784266291122 PUSHINT + }> + get_abi_ipfs PROC:<{ + x{697066733a2f2f516d61364a595074457958346973424a55554b644c4a5a73506533723569673658374e46667a6e37684242434643} PUSHSLICE + }> +}END>c diff --git a/sources/output/jetton_TONB.code.rev.fif b/sources/output/jetton_TONB.code.rev.fif new file mode 100644 index 0000000..32c2d5b --- /dev/null +++ b/sources/output/jetton_TONB.code.rev.fif @@ -0,0 +1,1653 @@ +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 + 569292295 PUSHINT + EQUAL + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + s0 s8 XCHG + <{ + 32 LDU + s0 s1 XCHG + 569292295 PUSHINT + EQUAL + 129 THROWIFNOT + LDGRAMS + s0 s1 XCHG + }> CALLREF + s1 POP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + 47 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 8 1 BLKSWAP + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 PUSH + 0 EQINT + s2 PUSH + SBITS + 33 LESSINT + AND + <{ + 2DROP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + 48 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 8 1 BLKSWAP + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 PUSH + 1616450832 PUSHINT + EQUAL + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + s0 s8 XCHG + <{ + 32 LDU + s0 s1 XCHG + 1616450832 PUSHINT + EQUAL + 129 THROWIFNOT + 257 PUSHINT + LDI + s0 s1 XCHG + }> CALLREF + s1 POP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + 49 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 8 1 BLKSWAP + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> IFJMPREF + s0 PUSH + 201882270 PUSHINT + EQUAL + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + s0 s8 XCHG + <{ + 32 LDU + s0 s1 XCHG + 201882270 PUSHINT + EQUAL + 129 THROWIFNOT + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + s0 s1 XCHG + }> CALLREF + s1 POP + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + s3 s4 XCHG + s1 s3 s0 XCHG3 + 50 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 8 1 BLKSWAP + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + 2078119902 PUSHINT + EQUAL + <{ + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + s0 s8 XCHG + <{ + 32 LDU + s0 s1 XCHG + 2078119902 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + s4 POP + s10 s11 XCHG + s9 s10 XCHG + s8 s9 XCHG + s7 s8 XCHG + s6 s7 XCHG + s5 s6 XCHG + s4 s5 XCHG + 1 3 BLKSWAP + 51 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 8 1 BLKSWAP + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 POP + 130 THROW + + 1: + s0 PUSH + ISNULL + 128 THROWIF + + 29: + + 32: + NEWC + ENDC + + 33: + CTOS + + 34: + 32 CALLDICT + 33 CALLDICT + + 35: + 0 PUSHINT + ROTREV + NEWC + 0 PUSHINT + s0 s1 XCHG + 2 STU + 3 PUSHINT + s0 s1 XCHG + 2 STU + 0 PUSHINT + s0 s1 XCHG + 1 STU + s1 s2 XCHG + STREF + STREF + ENDC + HASHCU + NEWC + 2 PUSHINT + s0 s1 XCHG + 2 STU + 0 PUSHINT + s0 s1 XCHG + 1 STU + s1 s2 XCHG + 8 STI + 256 STU + ENDC + CTOS + + 36: + 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 + 1 CALLDICT + 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 + 1 CALLDICT + 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 + 1 CALLDICT + s0 s1 XCHG + STREF + }> IFREFELSEREF + ENDC + s0 s1 XCHG + SENDRAWMSG + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI + + 37: + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + + 38: + s0 s2 XCHG + CTOS + LDDICT + s0 POP + PUSHNULL + s0 s1 XCHG + 24708 PUSHINT + s0 s1 XCHG + 16 PUSHINT + DICTUGETREF + NULLSWAPIFNOT + 135 THROWIFNOT + s0 s1 XCHG + 24708 PUSHINT + s2 PUSH + s0 s2 XCHG + 16 PUSHINT + DICTUSETREF + NEWC + STDICT + ENDC + s0 s0 s3 XCHG3 + 37 CALLDICT + + 39: + 2 GETGLOBVAR + MYADDR + ROT + 38 CALLDICT + + 40: + 39 CALLDICT + 8 2 BLKDROP2 + 35 CALLDICT + + 41: + MYADDR + 39 CALLDICT + 4 2 BLKDROP2 + s0 POP + s3 s3 s0 XCHG3 + + 42: + s10 s1 XCPU + ADD + 8 2 BLKSWAP + 39 CALLDICT + 2DUP + 35 CALLDICT + 0 PUSHINT + 200000000 PUSHINT + 0 PUSHINT + s0 PUSH + MYADDR + s1 PUSH + 34 CALLDICT + s3 s5 XCHG + s0 s4 XCHG + s0 s18 XCHG + s0 s4 XCHG + s2 s3 XCHG + s0 s2 XCHG + s0 s19 XCHG + s0 s2 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF + s5 s6 s0 XCHG3 + s4 s14 XCHG + s3 s13 XCHG + s0 s14 s13 XCHG3 + 36 CALLDICT + 2 6 BLKSWAP + + 43: + s7 s10 XCHG + s6 s9 XCHG + s5 s8 XCHG + s4 s10 XCHG + s3 s9 XCHG + s8 s10 s9 XCHG3 + s8 PUSH + 39 CALLDICT + 2DUP + 35 CALLDICT + 0 PUSHINT + 0 PUSHINT + 64 PUSHINT + 1 0 2 PUXC2 + s0 s2 XCHG + s0 s17 XCHG + s0 s2 XCHG + s0 s16 XCHG + s1 s15 XCHG + <{ + NEWC + 4 1 BLKSWAP + <{ + 1499400124 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + s6 s13 XCHG + s1 s5 XCHG + s4 s14 XCHG + s3 s12 XCHG + s12 s2 XCHG2 + 36 CALLDICT + s4 s7 XCHG + 3 4 BLKSWAP + + 44: + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + 9 1 BLKSWAP + 39 CALLDICT + s0 s1 XCHG + 4429 PUSHINT + s0 s2 XCHG + 35 CALLDICT + s0 s10 XCHG2 + SDEQ + s1 s9 XCHG + THROWANYIFNOT + 1 7 BLKSWAP + + 45: + 1 GETGLOBVAR + 4 UNTUPLE + s2 s3 XCHG + 3 BLKDROP + s7 PUSH + SDEQ + 132 THROWIFNOT + + 46: + s6 s7 XCHG + 7 BLKDROP + + 47: + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + 32366 PUSHINT + s3 POP + 50000000 PUSHINT + GEQ + s1 s2 XCHG + THROWANYIFNOT + TUCK + 42 CALLDICT + + 48: + + 49: + 1 GETGLOBVAR + 4 UNTUPLE + s0 POP + 6384 PUSHINT + s3 POP + 50000000 PUSHINT + GEQ + s1 s2 XCHG + THROWANYIFNOT + TUCK + 43 CALLDICT + + 50: + 8 1 BLKSWAP + 45 CALLDICT + s5 POP + s6 s7 XCHG + s5 s6 XCHG + 1 4 BLKSWAP + + 51: + s8 s11 XCHG + s7 s10 XCHG + s6 s9 XCHG + s5 s11 XCHG + s4 s10 XCHG + s3 s9 XCHG + s11 s10 s10 XCHG3 + 44 CALLDICT + s7 s10 XCHG2 + SUB + s8 PUSH + ISNULL + NOT + <{ + 0 PUSHINT + s0 s9 XCHG + 1 CALLDICT + 0 PUSHINT + 66 PUSHINT + s0 s10 XCHG + <{ + NEWC + s0 s1 XCHG + <{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> CALLREF + ENDC + }> CALLREF + s4 s11 XCHG + s1 s3 s0 XCHG3 + s1 s10 XCHG + PUSHNULL + PUSHNULL + 36 CALLDICT + }> PUSHCONT + <{ + s7 POP + s7 POP + }> PUSHCONT + IFELSE + s5 s7 XCHG + s3 s6 XCHG + s5 s1 s3 XCHG3 + s4 s2 XCHG2 + + owner: + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + 46 CALLDICT + + get_wallet_address: + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + 1 8 BLKSWAP + 40 CALLDICT + + get_jetton_data: + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + 1 LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDREF + s0 s1 XCHG + CTOS + 257 PUSHINT + LDI + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 POP + s2 s8 XCHG + s2 s7 XCHG + s2 s6 XCHG + s2 s5 XCHG + s2 s4 XCHG + s2 s3 XCHG + }> CALLREF + 1 8 BLKDROP2 + }> CALLREF + 41 CALLDICT + 29 CALLDICT + + 113617: + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + 258390863389042349688353801369539695109 PUSHINT + 86142586315491086060343270784266291122 PUSHINT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_TONB.init.boc b/sources/output/jetton_TONB.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..765b1ac6b89aef5c19f3e7e964f874e58242aa58 GIT binary patch literal 145 zcmdn`ZcY&+BReBQ8v~=re}*qhgum?hbb_0ai7|mOxh14Y3L5h4CLpVinHW(BnWVhUhAFQ%Ngd0IW=DF)#)(~JuOm`^c0I>o@K ekT=z!fblfrr1N5rP&iB{8W|bSqbfMbcm@E#sx?sn literal 0 HcmV?d00001 diff --git a/sources/output/jetton_TONB.init.fc b/sources/output/jetton_TONB.init.fc new file mode 100644 index 0000000..5e3b4a7 --- /dev/null +++ b/sources/output/jetton_TONB.init.fc @@ -0,0 +1,54 @@ +() __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; +} + +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); + } +} + +builder __gen_write_TONB(builder build_0, (int, slice, cell, int, slice, slice, int, slice) v) inline_ref { + var (v'totalSupply, v'owner, v'content, v'mintable, v'first_linker, v'last_linker, v'n_linkers, v'staking_pool) = v; + build_0 = build_0.store_coins(v'totalSupply); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = ~ null?(v'content) ? build_0.store_int(true, 1).store_ref(v'content) : build_0.store_int(false, 1); + build_0 = build_0.store_int(v'mintable, 1); + build_0 = __tact_store_address_opt(build_0, v'first_linker); + build_0 = __tact_store_address_opt(build_0, v'last_linker); + var build_1 = begin_cell(); + build_1 = build_1.store_int(v'n_linkers, 257); + build_1 = __tact_store_address_opt(build_1, v'staking_pool); + build_0 = store_ref(build_0, build_1.end_cell()); + return build_0; +} + +cell $__gen_TONB_init(cell sys', slice $owner, cell $content) { + var (($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)) = (null(), null(), null(), null(), null(), null(), 0, null()); + $self'totalSupply = 0; + $self'owner = $owner; + $self'mintable = true; + $self'content = $content; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_TONB(b', ($self'totalSupply, $self'owner, $self'content, $self'mintable, $self'first_linker, $self'last_linker, $self'n_linkers, $self'staking_pool)); + return b'.end_cell(); +} + +cell init(cell sys', slice $$owner, cell $$content) method_id { + slice $owner = $$owner; + cell $content = $$content; + return $__gen_TONB_init(sys', $owner, $content); +} + +() main() { +} \ No newline at end of file diff --git a/sources/output/jetton_TONB.init.fif b/sources/output/jetton_TONB.init.fif new file mode 100644 index 0000000..a758673 --- /dev/null +++ b/sources/output/jetton_TONB.init.fif @@ -0,0 +1,88 @@ +PROGRAM{ + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __tact_store_address_opt + DECLPROC __gen_write_TONB + DECLPROC $__gen_TONB_init + 107886 DECLMETHOD init + DECLPROC main + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __tact_store_address_opt PROCINLINE:<{ + DUP + ISNULL + IF:<{ + DROP + 0 PUSHINT + SWAP + 2 STU + }>ELSE<{ + __tact_store_address INLINECALLDICT + }> + }> + __gen_write_TONB PROCREF:<{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + __tact_store_address INLINECALLDICT + s3 PUSH + ISNULL + NOT + IF:<{ + TRUE + SWAP + 1 STI + s1 s3 XCHG + STREF + }>ELSE<{ + s3 POP + FALSE + s0 s3 XCHG2 + 1 STI + }> + 1 STI + SWAP + __tact_store_address_opt INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + SWAP + __tact_store_address_opt INLINECALLDICT + ENDC + SWAP + STREF + }> + $__gen_TONB_init PROC:<{ + PUSHNULL + PUSHNULL + 0 PUSHINT + PUSHNULL + OVER + TRUE + s0 s8 XCHG + NEWC + STREF + s0 s8 XCHG + s4 s7 s4 XCHG3 + s1 s6 XCHG + s1 s5 XCHG + s1 s3 XCHG + __gen_write_TONB INLINECALLDICT + ENDC + }> + init PROC:<{ + $__gen_TONB_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_TONB.init.rev.fif b/sources/output/jetton_TONB.init.rev.fif new file mode 100644 index 0000000..048a6ff --- /dev/null +++ b/sources/output/jetton_TONB.init.rev.fif @@ -0,0 +1,96 @@ +SETCP0 +(:methods + recv_internal: + + 5: + PUSHNULL + PUSHNULL + 0 PUSHINT + PUSHNULL + s1 PUSH + -1 PUSHINT + s0 s8 XCHG + NEWC + STREF + s0 s8 XCHG + s4 s7 s4 XCHG3 + s1 s6 XCHG + s1 s5 XCHG + s1 s3 XCHG + <{ + s8 s7 XCHG2 + STGRAMS + s0 s5 XCHG2 + STSLICER + s3 PUSH + ISNULL + NOT + <{ + -1 PUSHINT + s0 s1 XCHG + 1 STI + s1 s3 XCHG + STREF + }> PUSHCONT + <{ + s3 POP + 0 PUSHINT + s0 s3 XCHG2 + 1 STI + }> PUSHCONT + IFELSE + 1 STI + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s2 XCHG + NEWC + 257 PUSHINT + STIX + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + ENDC + s0 s1 XCHG + STREF + }> CALLREF + ENDC + + 107886: + 5 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_TONB.md b/sources/output/jetton_TONB.md new file mode 100644 index 0000000..cd3c657 --- /dev/null +++ b/sources/output/jetton_TONB.md @@ -0,0 +1,88 @@ +# TACT Compilation Report +Contract: TONB +BOC Size: 1506 bytes + +# Types +Total Types: 18 + +## 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 = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder}` + +## 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}` + +## 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}` + +## InitLinker +TLB: `init_linker#453d436d owner:address = InitLinker` +Signature: `InitLinker{owner:address}` + +## SetLinkerNeighbor +TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` +Signature: `SetLinkerNeighbor{neighbor:Maybe address}` + +## WithdrawalRequests +TLB: `_ addresses:dict amounts:dict n_requests:int257 = WithdrawalRequests` +Signature: `WithdrawalRequests{addresses:dict,amounts:dict,n_requests:int257}` + +## 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: 3 + +## get_wallet_address +Argument: owner + +## get_jetton_data + +## owner diff --git a/sources/output/jetton_TONB.pkg b/sources/output/jetton_TONB.pkg new file mode 100644 index 0000000..b188049 --- /dev/null +++ b/sources/output/jetton_TONB.pkg @@ -0,0 +1 @@ +{"name":"TONB","code":"te6ccgECSwEABdYAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAGBwIBIAwNAgEgHB0BDb4o7tnngXQXAgFICAkCAVgKCwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQARGtvO2eKoP4FEAXARGvFu2eeBT4DsAXAgHODg8AA6bABKkcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKRW+AgghAh7rYHuo+XMNs8CNs8MRB4EGcQVhBFEDRBMPAv2zzgIMAAItdJwSGwgFxAZEQALCBu8tCAgACDTHwGCECHutge68uCB+gABBDiPB1vbPPAw2zzgIIIQYFkVELrjAiCCEAwIep66FxkSEwMuMNs8CNs8MRB4EGcQVhBFEDRBMPAx2zwXFBkEQo+XMNs8CNs8MRB4EGcQVhBFEDRBMPAy2zzgghB73ZfeuhcVGRYAJtMfAYIQYFkVELry4IGBAQHXAAEALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBA0KPmts8CNs8NBCrEJoQiRB4EGcQVhBFVQLwM9s84DDywIIXGBkBFu1E0NQB+GLbPGwYGgBM0x8BghB73ZfeuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVXDbPMntVBsApPoA+kABAdIAAZHUkm0B4tIA+kAh1wsBwwCRAZIxbeIB+kAh1wsBwwCRAZIxbeIB1AHQgQEB1wD6QCHXCwHDAJEBkjFt4jEQKBAnECYQJRAkECMAmlCH+gJQBc8WI26zln8BygATzJYzcFADygDiygABIG6VMHABywGSzxbiASBulTBwAcsBks8W4gLIgQEBzwABIG6VMHABywGSzxbiyQHMAgEgHh8CAWJDRAIBICAhAgEgMTICASAiIwIBICgpAgEgJCUCASAmJwAFMjJgAAM0IAAJPAg8CGAASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAgEgKisCASAvMAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPABUATMljQDcAHKAOIkbrOafwHKAATwAVAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICwtARMcAPIzEMT2zzJgLgASfwHKAAHwAQHMAAoxcAHKAAAaUCOBAQHPAAHPFgHPFgBNALQ9AQwbQGBYIQBgBD0D2+h8uCHAYFghCICgBD0F8j0AMlAA/AlgAA8+EL4KFjwJoAIBIDM0AgEgPT4CASA1NgIBIDc4AA08CdsgvAjgABM+CjwJ2xCMEMwgAWUUaGgVXHwJ1zwI3CCEAvrwgBwIPgoIfAiEDUEERIEECMCERMC2zxFYBBOED1A7fAkVRWA5AWMEHoQaRBYEEoQOUipKPAnXPAjcHCAQFRBEwIREQIREB/bPBBtFRBOEDxQwvAkEEdVI4DsBDMhVUNs8yToAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgEMyFUw2zzJPABAghBZXwe8UAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuICASA/QAIBIEFCADk+EFvJBAjXwNVgPAnAYERTQLwI1AKxwUZ8vRVBoAAdPhBbyQQI18DJ8cF8uCEgAAkEGdfB4AArPhBbyQwgX5uM4IK+vCAvhLy9GbwKoAIBIEVGAgEgR0gAASAAKz4QW8kMIEY8DOCCvrwgL4S8vRm8CuAAFxVcPAtNRBnEFZVA4AFvBCLEHoQaRBbEEoQOUuq8CxQeqEobrOOk3AJ8AFwgEIK2zwQS0EwGm1t8CSSNzfiEFcQNkUTUEKBJAQrIAds8yUoAFoIQ1TJ221jLH8s/","abi":"{\"name\":\"TONB\",\"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\":\"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\":\"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\":\"InitLinker\",\"header\":1161642861,\"fields\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"SetLinkerNeighbor\",\"header\":3019699393,\"fields\":[{\"name\":\"neighbor\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"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\":\"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\":\"Deposit\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"empty\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"Withdraw\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenUpdateContent\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenBurnNotification\"}}],\"getters\":[{\"name\":\"get_wallet_address\",\"arguments\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}],\"returnType\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"get_jetton_data\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"JettonData\",\"optional\":false}},{\"name\":\"owner\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}],\"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\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"32366\":{\"message\":\"not enough money for deposit\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBwEAhgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBJWW1tcG0hfwjIzAhEdBYVE9s8yYGAJpQh/oCUAXPFiNus5Z/AcoAE8yWM3BQA8oA4soAASBulTBwAcsBks8W4gEgbpUwcAHLAZLPFuICyIEBAc8AASBulTBwAcsBks8W4skBzA==","args":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}},{"name":"content","type":{"kind":"simple","type":"cell","optional":true}}],"deployment":{"kind":"system-cell","system":"te6cckECfAEACqEAAQHAAQIBIEcCAQW+QJwDART/APSkE/S88sgLBAIBYgwFAgEgCwYCAUgIBwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQAgFYCgkBEa8W7Z54FPgOwEUBEa287Z4qg/gUQEUBDb4o7tnngXRFAgLKNg0CASAVDgIBYhIPAgEgERABbwQixB6EGkQWxBKEDlLqvAsUHqhKG6zjpNwCfABcIBCCts8EEtBMBptbfAkkjc34hBXEDZFE1BCgWAAXFVw8C01EGcQVlUDgAgEgFBMAKz4QW8kMIEY8DOCCvrwgL4S8vRm8CuAAASACASAnFgIBIB4XAgEgGxgCASAaGQArPhBbyQwgX5uM4IK+vCAvhLy9GbwKoAAJBBnXweACASAdHAAdPhBbyQQI18DJ8cF8uCEgADk+EFvJBAjXwNVgPAnAYERTQLwI1AKxwUZ8vRVBoAIBICQfAgEgIyABYwQehBpEFgQShA5SKko8Cdc8CNwcIBAVEETAhERAhEQH9s8EG0VEE4QPFDC8CQQR1UjgIQEMyFUw2zzJIgBAghBZXwe8UAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuIBZRRoaBVcfAnXPAjcIIQC+vCAHAg+Cgh8CIQNQQREgQQIwIREwLbPEVgEE4QPUDt8CRVFYGACASAmJQATPgo8CdsQjBDMIAANPAnbILwI4AIBIC8oAgEgLCkCASArKgAPPhC+ChY8CaAATQC0PQEMG0BgWCEAYAQ9A9vofLghwGBYIQiAoAQ9BfI9ADJQAPwJYAIBIC1lAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AFQBMyWNANwAcoA4iRus5p/AcoABPABUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgLmoAEn8BygAB8AEBzAIBIDMwAgEgMjEASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAAk8CDwIYAIBIDU0AAM0IAAFMjJgAgEgODcAA6bAAgHOOjkACwgbvLQgIASpHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECkVvgIIIQIe62B7qPlzDbPAjbPDEQeBBnEFYQRRA0QTDwL9s84CDAACLXScEhsIEVEQjsEOI8HW9s88DDbPOAgghBgWRUQuuMCIIIQDAh6nrpFQkA8BEKPlzDbPAjbPDEQeBBnEFYQRRA0QTDwMts84IIQe92X3rpFP0I9A0KPmts8CNs8NBCrEJoQiRB4EGcQVhBFVQLwM9s84DDywIJFPkIATNMfAYIQe92X3rry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iFEMwAC7THwGCEAwIep668uCB0gABkdSSbQHiAQMuMNs8CNs8MRB4EGcQVhBFEDRBMPAx2zxFQUIAJtMfAYIQYFkVELry4IGBAQHXAAEBGMj4QgHMVXDbPMntVEMAmlCH+gJQBc8WI26zln8BygATzJYzcFADygDiygABIG6VMHABywGSzxbiASBulTBwAcsBks8W4gLIgQEBzwABIG6VMHABywGSzxbiyQHMACDTHwGCECHutge68uCB+gABARbtRNDUAfhi2zxsGEYApPoA+kABAdIAAZHUkm0B4tIA+kAh1wsBwwCRAZIxbeIB+kAh1wsBwwCRAZIxbeIB1AHQgQEB1wD6QCHXCwHDAJEBkjFt4jEQKBAnECYQJRAkECMBBb8EJEgBFP8A9KQT9LzyyAtJAgFiTUoCASBMSwBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcARG/2BbZ54E3gPR6AgLKbU4CAUhcTwIBSFFQAE9IAg1yHTH9M/MfoAMIE1UiKCEBeNRRm6A4IQe92X3roTsRLy9BOgAoAgEgVVIBmRb+EFvJIERTVM4xwVTSMcFsfL0UYShggD1/CHC//L0QzBSOfAjgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZts8VBMEUDNtbfAigUwEMyFUw2zzJVABAghB73ZfeUAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuID8T4QW8kUyrHBbOOEvhCU7jwJQGBEU0C8CEkxwXy9N5RyKCCAPX8IcL/8vQh+CdvECGhggiYloBmtgihggiYloCgoSbCAI6hUE1DMPAjUjCgGqFwcChIE1B02zwoEEZDE1BVbW3wIlAFlhB9UIlfCOIlbrMiwgCw4w+BaV1YABDVbASJwBvACcATbPBBHQzAXbW3wIlgBCsgB2zzJWQAWghDVMnbbWMsfyz8BDMhVMNs8yVsALIIQc2LQnFAFyx8Tyz8B+gIBzxYBzxYCASBmXQIBIGNeAgEgYl8BuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoGABDMhVUNs8yWEAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgAPPhCUxLwJTCACASBlZABNALQ9AQwbQGBYIQBgBD0D2+h8uCHAYFghCICgBD0F8j0AMlAA/AkgARMcAPIzEMT2zzJgeQIBIGxnAgEgaWgAJRsMfoAMXHXIfoAMfoAMKcDqwCAC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCBragAKMXABygAAEn8BygAB8AIBzABLVwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgCASBvbgADp0ACAWJxcAALQgbvLQgIBIlHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECjwkw2zxVAvAq2zzgIIIQD4p+pbrjAiCCEBeNRRm6h6eHZyBDaPkTDbPAPbPDYQeBBnVQTwKNs84IIQWV8HvLp6dXhzAy6PkNs8A9s8NBBWEEVVAvAp2zzgMPLAgnp0eABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAAWNMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAUVUVFEMwAyIw2zwD2zw3EIkQeFUF8CfbPHp3eABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUg2zzJ7VR5ABpQI4EBAc8AAc8WAc8WARbtRNDUAfhi2zxsE3sAHIEBAdcA+kABAfpAAUMw0t7Ftw=="}},"compiler":{"name":"tact","version":"0.8.11"}} \ No newline at end of file diff --git a/sources/output/jetton_TONB.ts b/sources/output/jetton_TONB.ts new file mode 100644 index 0000000..02dd3b6 --- /dev/null +++ b/sources/output/jetton_TONB.ts @@ -0,0 +1,1058 @@ +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; +} + +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()); + }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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); + 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 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 InitLinker = { + $$type: 'InitLinker'; + owner: Address; +} + +export function storeInitLinker(src: InitLinker) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1161642861, 32); + b_0.storeAddress(src.owner); + }; +} + +export function loadInitLinker(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } + let _owner = sc_0.loadAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function loadTupleInitLinker(source: TupleReader) { + let _owner = source.readAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function storeTupleInitLinker(source: InitLinker) { + let builder = new TupleBuilder(); + builder.writeAddress(source.owner); + 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 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 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 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 TONB_init(owner: Address, content: Cell | null) { + const __init = 'te6ccgEBBwEAhgABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AsAAdQBJWW1tcG0hfwjIzAhEdBYVE9s8yYGAJpQh/oCUAXPFiNus5Z/AcoAE8yWM3BQA8oA4soAASBulTBwAcsBks8W4gEgbpUwcAHLAZLPFuICyIEBAc8AASBulTBwAcsBks8W4skBzA=='; + const __code = 'te6ccgECSwEABdYAART/APSkE/S88sgLAQIBYgIDAgLKBAUCASAGBwIBIAwNAgEgHB0BDb4o7tnngXQXAgFICAkCAVgKCwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQARGtvO2eKoP4FEAXARGvFu2eeBT4DsAXAgHODg8AA6bABKkcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKRW+AgghAh7rYHuo+XMNs8CNs8MRB4EGcQVhBFEDRBMPAv2zzgIMAAItdJwSGwgFxAZEQALCBu8tCAgACDTHwGCECHutge68uCB+gABBDiPB1vbPPAw2zzgIIIQYFkVELrjAiCCEAwIep66FxkSEwMuMNs8CNs8MRB4EGcQVhBFEDRBMPAx2zwXFBkEQo+XMNs8CNs8MRB4EGcQVhBFEDRBMPAy2zzgghB73ZfeuhcVGRYAJtMfAYIQYFkVELry4IGBAQHXAAEALtMfAYIQDAh6nrry4IHSAAGR1JJtAeIBA0KPmts8CNs8NBCrEJoQiRB4EGcQVhBFVQLwM9s84DDywIIXGBkBFu1E0NQB+GLbPGwYGgBM0x8BghB73ZfeuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVXDbPMntVBsApPoA+kABAdIAAZHUkm0B4tIA+kAh1wsBwwCRAZIxbeIB+kAh1wsBwwCRAZIxbeIB1AHQgQEB1wD6QCHXCwHDAJEBkjFt4jEQKBAnECYQJRAkECMAmlCH+gJQBc8WI26zln8BygATzJYzcFADygDiygABIG6VMHABywGSzxbiASBulTBwAcsBks8W4gLIgQEBzwABIG6VMHABywGSzxbiyQHMAgEgHh8CAWJDRAIBICAhAgEgMTICASAiIwIBICgpAgEgJCUCASAmJwAFMjJgAAM0IAAJPAg8CGAASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAgEgKisCASAvMAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPABUATMljQDcAHKAOIkbrOafwHKAATwAVAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICwtARMcAPIzEMT2zzJgLgASfwHKAAHwAQHMAAoxcAHKAAAaUCOBAQHPAAHPFgHPFgBNALQ9AQwbQGBYIQBgBD0D2+h8uCHAYFghCICgBD0F8j0AMlAA/AlgAA8+EL4KFjwJoAIBIDM0AgEgPT4CASA1NgIBIDc4AA08CdsgvAjgABM+CjwJ2xCMEMwgAWUUaGgVXHwJ1zwI3CCEAvrwgBwIPgoIfAiEDUEERIEECMCERMC2zxFYBBOED1A7fAkVRWA5AWMEHoQaRBYEEoQOUipKPAnXPAjcHCAQFRBEwIREQIREB/bPBBtFRBOEDxQwvAkEEdVI4DsBDMhVUNs8yToAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgEMyFUw2zzJPABAghBZXwe8UAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuICASA/QAIBIEFCADk+EFvJBAjXwNVgPAnAYERTQLwI1AKxwUZ8vRVBoAAdPhBbyQQI18DJ8cF8uCEgAAkEGdfB4AArPhBbyQwgX5uM4IK+vCAvhLy9GbwKoAIBIEVGAgEgR0gAASAAKz4QW8kMIEY8DOCCvrwgL4S8vRm8CuAAFxVcPAtNRBnEFZVA4AFvBCLEHoQaRBbEEoQOUuq8CxQeqEobrOOk3AJ8AFwgEIK2zwQS0EwGm1t8CSSNzfiEFcQNkUTUEKBJAQrIAds8yUoAFoIQ1TJ221jLH8s/'; + const __system = 'te6cckECfAEACqEAAQHAAQIBIEcCAQW+QJwDART/APSkE/S88sgLBAIBYgwFAgEgCwYCAUgIBwCVt3owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThhMiKTJr7fJFy9sM7TqukCwTggZzq084r86ShYDrC3EyPZQAgFYCgkBEa8W7Z54FPgOwEUBEa287Z4qg/gUQEUBDb4o7tnngXRFAgLKNg0CASAVDgIBYhIPAgEgERABbwQixB6EGkQWxBKEDlLqvAsUHqhKG6zjpNwCfABcIBCCts8EEtBMBptbfAkkjc34hBXEDZFE1BCgWAAXFVw8C01EGcQVlUDgAgEgFBMAKz4QW8kMIEY8DOCCvrwgL4S8vRm8CuAAASACASAnFgIBIB4XAgEgGxgCASAaGQArPhBbyQwgX5uM4IK+vCAvhLy9GbwKoAAJBBnXweACASAdHAAdPhBbyQQI18DJ8cF8uCEgADk+EFvJBAjXwNVgPAnAYERTQLwI1AKxwUZ8vRVBoAIBICQfAgEgIyABYwQehBpEFgQShA5SKko8Cdc8CNwcIBAVEETAhERAhEQH9s8EG0VEE4QPFDC8CQQR1UjgIQEMyFUw2zzJIgBAghBZXwe8UAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuIBZRRoaBVcfAnXPAjcIIQC+vCAHAg+Cgh8CIQNQQREgQQIwIREwLbPEVgEE4QPUDt8CRVFYGACASAmJQATPgo8CdsQjBDMIAANPAnbILwI4AIBIC8oAgEgLCkCASArKgAPPhC+ChY8CaAATQC0PQEMG0BgWCEAYAQ9A9vofLghwGBYIQiAoAQ9BfI9ADJQAPwJYAIBIC1lAvcyHEBygFQBwHKAHABygJQBc8WUAP6AnABymgjbrMlbrOxjkZ/AcoAyHABygBwAcoAJG6zmn8BygAE8AFQBMyWNANwAcoA4iRus5p/AcoABPABUATMljQDcAHKAOJwAcoAAn8BygACyVjMlzMzAXABygDiIW6z4w/JAfsAgLmoAEn8BygAB8AEBzAIBIDMwAgEgMjEASxwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgAAk8CDwIYAIBIDU0AAM0IAAFMjJgAgEgODcAA6bAAgHOOjkACwgbvLQgIASpHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECkVvgIIIQIe62B7qPlzDbPAjbPDEQeBBnEFYQRRA0QTDwL9s84CDAACLXScEhsIEVEQjsEOI8HW9s88DDbPOAgghBgWRUQuuMCIIIQDAh6nrpFQkA8BEKPlzDbPAjbPDEQeBBnEFYQRRA0QTDwMts84IIQe92X3rpFP0I9A0KPmts8CNs8NBCrEJoQiRB4EGcQVhBFVQLwM9s84DDywIJFPkIATNMfAYIQe92X3rry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iFEMwAC7THwGCEAwIep668uCB0gABkdSSbQHiAQMuMNs8CNs8MRB4EGcQVhBFEDRBMPAx2zxFQUIAJtMfAYIQYFkVELry4IGBAQHXAAEBGMj4QgHMVXDbPMntVEMAmlCH+gJQBc8WI26zln8BygATzJYzcFADygDiygABIG6VMHABywGSzxbiASBulTBwAcsBks8W4gLIgQEBzwABIG6VMHABywGSzxbiyQHMACDTHwGCECHutge68uCB+gABARbtRNDUAfhi2zxsGEYApPoA+kABAdIAAZHUkm0B4tIA+kAh1wsBwwCRAZIxbeIB+kAh1wsBwwCRAZIxbeIB1AHQgQEB1wD6QCHXCwHDAJEBkjFt4jEQKBAnECYQJRAkECMBBb8EJEgBFP8A9KQT9LzyyAtJAgFiTUoCASBMSwBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcARG/2BbZ54E3gPR6AgLKbU4CAUhcTwIBSFFQAE9IAg1yHTH9M/MfoAMIE1UiKCEBeNRRm6A4IQe92X3roTsRLy9BOgAoAgEgVVIBmRb+EFvJIERTVM4xwVTSMcFsfL0UYShggD1/CHC//L0QzBSOfAjgT67AYIJMS0AoIIImJaAoBK88vR/cAOAQFQzZts8VBMEUDNtbfAigUwEMyFUw2zzJVABAghB73ZfeUAXLHxPLPwH6AgHPFgEgbpUwcAHLAZLPFuID8T4QW8kUyrHBbOOEvhCU7jwJQGBEU0C8CEkxwXy9N5RyKCCAPX8IcL/8vQh+CdvECGhggiYloBmtgihggiYloCgoSbCAI6hUE1DMPAjUjCgGqFwcChIE1B02zwoEEZDE1BVbW3wIlAFlhB9UIlfCOIlbrMiwgCw4w+BaV1YABDVbASJwBvACcATbPBBHQzAXbW3wIlgBCsgB2zzJWQAWghDVMnbbWMsfyz8BDMhVMNs8yVsALIIQc2LQnFAFyx8Tyz8B+gIBzxYBzxYCASBmXQIBIGNeAgEgYl8BuRsIvhBbySBEU1TO8cF8vRRt6GCAPX8IcL/8vRDMFI88CNxJMIAkjBy3oE+uwKoggkxLQCgggiYloCgErzy9PhCVCBk8CVc8CF/UHZwgEArVEw5GNs8EFYQNFnwIoGABDMhVUNs8yWEAToIQF41FGVAHyx8Vyz9QA/oCAc8WASBulTBwAcsBks8W4gH6AgHPFgAPPhCUxLwJTCACASBlZABNALQ9AQwbQGBYIQBgBD0D2+h8uCHAYFghCICgBD0F8j0AMlAA/AkgARMcAPIzEMT2zzJgeQIBIGxnAgEgaWgAJRsMfoAMXHXIfoAMfoAMKcDqwCAC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCBragAKMXABygAAEn8BygAB8AIBzABLVwWchwAcsBcwHLAXABywASzMzJ+QDIcgHLAXABywASygfL/8nQgCASBvbgADp0ACAWJxcAALQgbvLQgIBIlHAh10nCH5UwINcLH94C0NMDAXGwwAGRf5Fw4gH6QCJQZm8E+GECjwkw2zxVAvAq2zzgIIIQD4p+pbrjAiCCEBeNRRm6h6eHZyBDaPkTDbPAPbPDYQeBBnVQTwKNs84IIQWV8HvLp6dXhzAy6PkNs8A9s8NBBWEEVVAvAp2zzgMPLAgnp0eABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzAAWNMfAYIQF41FGbry4IHTP/oA+kABAfpAIdcLAcMAkQGSMW3iAfoAUVUVFEMwAyIw2zwD2zw3EIkQeFUF8CfbPHp3eABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwARjI+EIBzFUg2zzJ7VR5ABpQI4EBAc8AAc8WAc8WARbtRNDUAfhi2zxsE3sAHIEBAdcA+kABAfpAAUMw0t7Ftw=='; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeAddress(owner); + builder.writeCell(content); + 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 (TONB_errors[res.exitCode]) { + throw new ComputeError(TONB_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 TONB_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` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 32366: { message: `not enough money for deposit` }, + 62972: { message: `Invalid balance` }, +} + +export class TONB implements Contract { + + static async init(owner: Address, content: Cell | null) { + return await TONB_init(owner,content); + } + + static async fromInit(owner: Address, content: Cell | null) { + const init = await TONB_init(owner,content); + const address = contractAddress(0, init); + return new TONB(address, init); + } + + static fromAddress(address: Address) { + return new TONB(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: TONB_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: Deposit | null | Withdraw | TokenUpdateContent | TokenBurnNotification) { + + let body: Cell | null = null; + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'Deposit') { + body = beginCell().store(storeDeposit(message)).endCell(); + } + if (message === null) { + body = new Cell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'Withdraw') { + body = beginCell().store(storeWithdraw(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenUpdateContent') { + body = beginCell().store(storeTokenUpdateContent(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurnNotification') { + body = beginCell().store(storeTokenBurnNotification(message)).endCell(); + } + if (body === null) { throw new Error('Invalid message type'); } + + await provider.internal(via, { ...args, body: body }); + + } + + async getGetWalletAddress(provider: ContractProvider, owner: Address) { + let builder = new TupleBuilder(); + builder.writeAddress(owner); + let source = (await provider.get('get_wallet_address', builder.build())).stack; + let result = source.readAddress(); + return result; + } + + async getGetJettonData(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('get_jetton_data', builder.build())).stack; + const result = loadTupleJettonData(source); + return result; + } + + async getOwner(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('owner', builder.build())).stack; + let result = source.readAddress(); + return result; + } + +} \ No newline at end of file diff --git a/sources/output/jetton_TONBWallet.abi b/sources/output/jetton_TONBWallet.abi new file mode 100644 index 0000000..52eec52 --- /dev/null +++ b/sources/output/jetton_TONBWallet.abi @@ -0,0 +1 @@ +{"name":"TONBWallet","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":"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":"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":"InitLinker","header":1161642861,"fields":[{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}]},{"name":"SetLinkerNeighbor","header":3019699393,"fields":[{"name":"neighbor","type":{"kind":"simple","type":"address","optional":true}}]},{"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":"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":"TokenTransfer"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenTransferInternal"}},{"receiver":"internal","message":{"kind":"typed","type":"TokenBurn"}}],"getters":[{"name":"get_wallet_data","arguments":[],"returnType":{"kind":"simple","type":"JettonWalletData","optional":false}}],"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"},"13650":{"message":"Invalid bounced message"},"16059":{"message":"Invalid value"},"32366":{"message":"not enough money for deposit"},"62972":{"message":"Invalid balance"}}} \ No newline at end of file diff --git a/sources/output/jetton_TONBWallet.code.boc b/sources/output/jetton_TONBWallet.code.boc new file mode 100644 index 0000000000000000000000000000000000000000..46d95d0dfe8d30157c3991a6c926837cb731ea9a GIT binary patch literal 1324 zcmaJ=4NMzl82-NN6|SYgmFv$K#a_!8hr(zJ0?`Ay!Q9ADy3h_xNmejSO+af=gArM2 zh!bV6ZL`7qe#`#b@d`&ieqczXIBnB@H zUGJbAH)`g8u4}xulvXo&*2r)z#aajM&1S}GH1Z@7NR;1|$I;4@SZdUP zQ2CoA6M8T9+(knccKX~TMySB@sd@7mjhaxwrr_RVy<$of3u1Oe-OeNko?64PJdVvH z+sP&qKa|F?;y4P=?d)F1bIB(1SrZ;&ICj=SKD|GB@Vq#lB0>EXC3KMSZ?}AOesQ+- zO3?~f(L=bRS6z*Pqo5o1XdC9>WdOT_Jq>Vf1?)W_lS+y;pej-)KfE*Xf9g=WDV)vQ z*4Y(dmqYF&cbc$JI%1(&^f<%`6qMa6xfF!UwH#YdNkCboZ-n1}@mb+LnRGB~?0JJs*^REKllGWRWyF6vu6bn-(WHA&QB7gfLF zMHa1e&%B2Q2?yZ>fFTU}flzBjKH{oUBeNwHQVOt`O^*E@&{s#L&& z7x1{7&0ncJ=tS7vcmaR00O$;0RX~Hyh7_b+0Kk9@Ef8NwI>!bDWiHoCfr-0$ZIm7Z^n*mH7LAkVv@!I?JVc9t8zY{xgxM#ab}$i# zVM_b$DZNI@;Ae?o2NTs>tq>;Q!Q|Y45Epli1*K+lGvS1FZAzoM@|*m2bDy{0o{>K~ zn~}K<9+j X __tact_not_null(X x) { throw_if(128, null?(x)); return x; } + +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); + } +} + +slice __tact_create_address(int chain, int hash) inline { + var b = begin_cell(); + b = b.store_uint(2, 2); + b = b.store_uint(0, 1); + b = b.store_int(chain, 8); + b = b.store_uint(hash, 256); + return b.end_cell().begin_parse(); +} + +slice __tact_compute_contract_address(int chain, cell code, cell data) inline { + var b = begin_cell(); + b = b.store_uint(0, 2); + b = b.store_uint(3, 2); + b = b.store_uint(0, 1); + b = b.store_ref(code); + b = b.store_ref(data); + var hash = cell_hash(b.end_cell()); + return __tact_create_address(chain, hash); +} + +int __tact_address_eq(slice a, slice b) inline { + return equal_slice_bits(a, b); +} + +int __tact_address_neq(slice a, slice b) inline { + return ~ equal_slice_bits(a, b); +} + +cell __tact_dict_set_code(cell dict, int id, cell code) inline { + return udict_set_ref(dict, 16, id, code); +} + +cell __tact_dict_get_code(cell dict, int id) inline { + var (data, ok) = udict_get_ref?(dict, 16, id); + throw_unless(135, ok); + return data; +} + +(slice, ((int, int, slice, slice, cell, int, slice))) __gen_read_TokenTransfer(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 260734629); + var v'queryId = sc_0~load_uint(64); + var v'amount = sc_0~load_coins(); + var v'destination = sc_0~__tact_load_address(); + var v'responseDestination = sc_0~__tact_load_address_opt(); + var v'customPayload = sc_0~load_int(1) ? sc_0~load_ref() : null(); + var v'forwardTonAmount = sc_0~load_coins(); + var v'forwardPayload = sc_0; + return (sc_0, (v'queryId, v'amount, v'destination, v'responseDestination, v'customPayload, v'forwardTonAmount, v'forwardPayload)); +} + +builder __gen_write_TokenTransferInternal(builder build_0, (int, int, slice, slice, int, slice) v) inline_ref { + var (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload) = v; + build_0 = store_uint(build_0, 395134233, 32); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); + build_0 = __tact_store_address(build_0, v'from); + build_0 = __tact_store_address_opt(build_0, v'responseAddress); + build_0 = build_0.store_coins(v'forwardTonAmount); + build_0 = build_0.store_slice(v'forwardPayload); + return build_0; +} + +cell __gen_writecell_TokenTransferInternal((int, int, slice, slice, int, slice) v) inline_ref { + return __gen_write_TokenTransferInternal(begin_cell(), v).end_cell(); +} + +(slice, ((int, int, slice, slice, int, slice))) __gen_read_TokenTransferInternal(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 395134233); + var v'queryId = sc_0~load_uint(64); + var v'amount = sc_0~load_coins(); + var v'from = sc_0~__tact_load_address(); + var v'responseAddress = sc_0~__tact_load_address_opt(); + var v'forwardTonAmount = sc_0~load_coins(); + var v'forwardPayload = sc_0; + return (sc_0, (v'queryId, v'amount, v'from, v'responseAddress, v'forwardTonAmount, v'forwardPayload)); +} + +builder __gen_write_TokenNotification(builder build_0, (int, int, slice, slice) v) inline_ref { + var (v'queryId, v'amount, v'from, v'forwardPayload) = v; + build_0 = store_uint(build_0, 1935855772, 32); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); + build_0 = __tact_store_address(build_0, v'from); + build_0 = build_0.store_slice(v'forwardPayload); + return build_0; +} + +cell __gen_writecell_TokenNotification((int, int, slice, slice) v) inline_ref { + return __gen_write_TokenNotification(begin_cell(), v).end_cell(); +} + +(slice, ((int, int, slice, slice))) __gen_read_TokenBurn(slice sc_0) inline_ref { + throw_unless(129, sc_0~load_uint(32) == 1499400124); + var v'queryId = sc_0~load_uint(64); + var v'amount = sc_0~load_coins(); + var v'owner = sc_0~__tact_load_address(); + var v'responseAddress = sc_0~__tact_load_address_opt(); + return (sc_0, (v'queryId, v'amount, v'owner, v'responseAddress)); +} + +builder __gen_write_TokenBurnNotification(builder build_0, (int, int, slice, slice) v) inline_ref { + var (v'queryId, v'amount, v'owner, v'responseAddress) = v; + build_0 = store_uint(build_0, 2078119902, 32); + build_0 = build_0.store_uint(v'queryId, 64); + build_0 = build_0.store_coins(v'amount); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address_opt(build_0, v'responseAddress); + return build_0; +} + +cell __gen_writecell_TokenBurnNotification((int, int, slice, slice) v) inline_ref { + return __gen_write_TokenBurnNotification(begin_cell(), v).end_cell(); +} + +builder __gen_write_TokenExcesses(builder build_0, (int) v) inline_ref { + var (v'queryId) = v; + build_0 = store_uint(build_0, 3576854235, 32); + build_0 = build_0.store_uint(v'queryId, 64); + return build_0; +} + +cell __gen_writecell_TokenExcesses((int) v) inline_ref { + return __gen_write_TokenExcesses(begin_cell(), v).end_cell(); +} + +builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { + var (v'balance, v'owner, v'master) = v; + build_0 = build_0.store_int(v'balance, 257); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address(build_0, v'master); + return build_0; +} + +(slice, ((int, slice, slice))) __gen_read_TONBWallet(slice sc_0) inline_ref { + var v'balance = sc_0~load_int(257); + var v'owner = sc_0~__tact_load_address(); + var v'master = sc_0~__tact_load_address(); + return (sc_0, (v'balance, v'owner, v'master)); +} + +_ __gen_StateInit_get_code((cell, cell) v) inline { + var (v'code, v'data) = v; + return v'code; +} + +(int, slice, slice, cell) __gen_JettonWalletData_to_external(((int, slice, slice, cell)) v) { + var (v'balance, v'owner, v'master, v'walletCode) = v; + return (v'balance, v'owner, v'master, v'walletCode); +} + +(int, slice, slice) __gen_load_TONBWallet() inline_ref { + slice sc = get_data().begin_parse(); + __tact_context_sys = sc~load_ref(); + return sc~__gen_read_TONBWallet(); +} + +() __gen_store_TONBWallet((int, slice, slice) v) impure inline_ref { + builder b = begin_cell(); + b = b.store_ref(__tact_context_sys); + b = __gen_write_TONBWallet(b, v); + set_data(b.end_cell()); +} + +slice $contractAddress((cell, cell) $s) impure { + var (($s'code, $s'data)) = $s; + return __tact_compute_contract_address(0, $s'code, $s'data); +} + +() $send((int, slice, int, int, cell, cell, cell) $params) impure { + 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_Context_readForwardFee((int, slice, int, slice) $self) impure { + var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self; + var (($self'bounced, $self'sender, $self'value, $self'raw)) = $self; + slice $sc = $self'raw; + $sc~load_coins(); + $sc~skip_bits(1); + $sc~load_coins(); + return (($sc~load_coins() * 3) / 2); +} + +cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { + var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); + $self'balance = 0; + $self'owner = $owner; + $self'master = $master; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); + return b'.end_cell(); +} + +(cell, cell) $__gen_TONBWallet_init_child(cell sys', slice $master, slice $owner) { + slice sc' = sys'.begin_parse(); + cell source = sc'~load_dict(); + cell contracts = new_dict(); + + ;; Contract Code: TONBWallet + cell mine = __tact_dict_get_code(source, 24708); + contracts = __tact_dict_set_code(contracts, 24708, mine); + cell sys = begin_cell().store_dict(contracts).end_cell(); + return (mine, $__gen_TONBWallet_init(sys, $master, $owner)); +} + +(int, slice, slice, cell) $__gen_TONBWallet_get_wallet_data((int, slice, slice) $self) impure { + var (($self'balance, $self'owner, $self'master)) = $self; + return ($self'balance, $self'owner, $self'master, __gen_StateInit_get_code($__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $self'owner))); +} + +_ $__gen_get_get_wallet_data() method_id(97026) { + var self = __gen_load_TONBWallet(); + var res = $__gen_TONBWallet_get_wallet_data(self); + return __gen_JettonWalletData_to_external(res); +} + +(((int, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransfer((int, slice, slice) $self, (int, int, slice, slice, cell, int, slice) $msg) impure { + var ($self'balance, $self'owner, $self'master) = $self; + var ($msg'queryId, $msg'amount, $msg'destination, $msg'responseDestination, $msg'customPayload, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(4429, __tact_address_eq($ctx'sender, $self'owner)); + $self'balance = ($self'balance - $msg'amount); + throw_unless(62972, ($self'balance >= 0)); + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + int $fwdCount = 1; + if (($msg'forwardTonAmount > 0)) { + $fwdCount = 2; + } + throw_unless(16059, ($ctx'value > ((($fwdCount * $fwdFee) + (2 * 10000000)) + 10000000))); + var ($init'code, $init'data) = $__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $msg'destination); + slice $walletAddress = $contractAddress(($init'code, $init'data)); + $send((true, $walletAddress, 0, 64, __gen_writecell_TokenTransferInternal(($msg'queryId, $msg'amount, $self'owner, $self'owner, $msg'forwardTonAmount, $msg'forwardPayload)), $init'code, $init'data)); + return (($self'balance, $self'owner, $self'master), ()); +} + +(((int, slice, slice)), ()) $__gen_TONBWallet_receive_TokenTransferInternal((int, slice, slice) $self, (int, int, slice, slice, int, slice) $msg) impure { + var ($self'balance, $self'owner, $self'master) = $self; + var ($msg'queryId, $msg'amount, $msg'from, $msg'responseAddress, $msg'forwardTonAmount, $msg'forwardPayload) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + if (__tact_address_neq($ctx'sender, $self'master)) { + var ($sinit'code, $sinit'data) = $__gen_TONBWallet_init_child(__tact_context_sys, $self'master, $msg'from); + throw_unless(4429, __tact_address_eq($contractAddress(($sinit'code, $sinit'data)), $ctx'sender)); + } + $self'balance = ($self'balance + $msg'amount); + throw_unless(62972, ($self'balance >= 0)); + int $msgValue = $ctx'value; + int $tonBalanceBeforeMsg = (__tact_my_balance() - $msgValue); + int $storageFee = (10000000 - min($tonBalanceBeforeMsg, 10000000)); + $msgValue = ($msgValue - ($storageFee + 10000000)); + if (($msg'forwardTonAmount > 0)) { + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + $msgValue = ($msgValue - ($msg'forwardTonAmount + $fwdFee)); + $send((false, $self'owner, $msg'forwardTonAmount, 0, __gen_writecell_TokenNotification(($msg'queryId, $msg'amount, $msg'from, $msg'forwardPayload)), null(), null())); + } + if (((~ null?($msg'responseAddress)) & ($msgValue > 0))) { + $send((false, __tact_not_null($msg'responseAddress), $msgValue, 0, __gen_writecell_TokenExcesses(($msg'queryId)), null(), null())); + } + return (($self'balance, $self'owner, $self'master), ()); +} + +(((int, slice, slice)), ()) $__gen_TONBWallet_receive_TokenBurn((int, slice, slice) $self, (int, int, slice, slice) $msg) impure { + var ($self'balance, $self'owner, $self'master) = $self; + var ($msg'queryId, $msg'amount, $msg'owner, $msg'responseAddress) = $msg; + var ($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw) = __tact_context_get(); + throw_unless(4429, (__tact_address_eq($ctx'sender, $self'owner) | __tact_address_eq($ctx'sender, $self'master))); + $self'balance = ($self'balance - $msg'amount); + throw_unless(62972, ($self'balance >= 0)); + int $fwdFee = $__gen_Context_readForwardFee(($ctx'bounced, $ctx'sender, $ctx'value, $ctx'raw)); + throw_unless(16059, ($ctx'value > (($fwdFee + (2 * 10000000)) + 10000000))); + $send((true, $self'master, 0, 64, __gen_writecell_TokenBurnNotification(($msg'queryId, $msg'amount, $self'owner, $self'owner)), null(), null())); + return (($self'balance, $self'owner, $self'master), ()); +} + +((int, slice, slice), ()) $__gen_TONBWallet_receive_bounced((int, slice, slice) $self, slice $msg) impure { + var ($self'balance, $self'owner, $self'master) = $self; + $msg~skip_bits(32); + int $op = $msg~load_uint(32); + int $queryId = $msg~load_uint(64); + int $jettonAmount = $msg~load_coins(); + throw_unless(13650, (($op == 395134233) | ($op == 2078119902))); + $self'balance = ($self'balance + $jettonAmount); + return (($self'balance, $self'owner, $self'master), ()); +} + + +() 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) { + var self = __gen_load_TONBWallet(); + self~$__gen_TONBWallet_receive_bounced(in_msg); + __gen_store_TONBWallet(self); + return (); + } + + ;; Receive TokenTransfer message + if (op == 260734629) { + var self = __gen_load_TONBWallet(); + var msg = in_msg~__gen_read_TokenTransfer(); + self~$__gen_TONBWallet_receive_TokenTransfer(msg); + __gen_store_TONBWallet(self); + return (); + } + + ;; Receive TokenTransferInternal message + if (op == 395134233) { + var self = __gen_load_TONBWallet(); + var msg = in_msg~__gen_read_TokenTransferInternal(); + self~$__gen_TONBWallet_receive_TokenTransferInternal(msg); + __gen_store_TONBWallet(self); + return (); + } + + ;; Receive TokenBurn message + if (op == 1499400124) { + var self = __gen_load_TONBWallet(); + var msg = in_msg~__gen_read_TokenBurn(); + self~$__gen_TONBWallet_receive_TokenBurn(msg); + __gen_store_TONBWallet(self); + return (); + } + + throw(130); +} + +_ supported_interfaces() method_id { + return ( + "org.ton.introspection.v0"H >> 128, + "org.ton.abi.ipfs.v0"H >> 128, + "org.ton.jetton.wallet"H >> 128 + ); +} + +_ get_abi_ipfs() { + return "ipfs://QmdeQibxp6Bp8gtTKCziJsCfzaEpbxC4zCEomnBb1nCyer"; +} \ No newline at end of file diff --git a/sources/output/jetton_TONBWallet.code.fif b/sources/output/jetton_TONBWallet.code.fif new file mode 100644 index 0000000..994d75d --- /dev/null +++ b/sources/output/jetton_TONBWallet.code.fif @@ -0,0 +1,774 @@ +PROGRAM{ + DECLPROC __tact_my_balance + 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_create_address + DECLPROC __tact_compute_contract_address + DECLPROC __tact_address_eq + DECLPROC __tact_address_neq + DECLPROC __tact_dict_set_code + DECLPROC __tact_dict_get_code + DECLPROC __gen_read_TokenTransfer + DECLPROC __gen_write_TokenTransferInternal + DECLPROC __gen_writecell_TokenTransferInternal + DECLPROC __gen_read_TokenTransferInternal + DECLPROC __gen_write_TokenNotification + DECLPROC __gen_writecell_TokenNotification + DECLPROC __gen_read_TokenBurn + DECLPROC __gen_write_TokenBurnNotification + DECLPROC __gen_writecell_TokenBurnNotification + DECLPROC __gen_write_TokenExcesses + DECLPROC __gen_writecell_TokenExcesses + DECLPROC __gen_write_TONBWallet + DECLPROC __gen_read_TONBWallet + DECLPROC __gen_StateInit_get_code + DECLPROC __gen_JettonWalletData_to_external + DECLPROC __gen_load_TONBWallet + DECLPROC __gen_store_TONBWallet + DECLPROC $contractAddress + DECLPROC $send + DECLPROC $__gen_Context_readForwardFee + DECLPROC $__gen_TONBWallet_init + DECLPROC $__gen_TONBWallet_init_child + DECLPROC $__gen_TONBWallet_get_wallet_data + 97026 DECLMETHOD $__gen_get_get_wallet_data + DECLPROC $__gen_TONBWallet_receive_TokenTransfer + DECLPROC $__gen_TONBWallet_receive_TokenTransferInternal + DECLPROC $__gen_TONBWallet_receive_TokenBurn + DECLPROC $__gen_TONBWallet_receive_bounced + DECLPROC recv_internal + 113617 DECLMETHOD supported_interfaces + DECLPROC get_abi_ipfs + DECLGLOBVAR __tact_context + DECLGLOBVAR __tact_context_sys + __tact_my_balance PROCINLINE:<{ + BALANCE + FIRST + }> + __tact_not_null PROC:<{ + 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_create_address PROCINLINE:<{ + NEWC + 2 PUSHINT + SWAP + 2 STU + 0 PUSHINT + SWAP + 1 STU + s1 s2 XCHG + 8 STI + 256 STU + ENDC + CTOS + }> + __tact_compute_contract_address PROCINLINE:<{ + NEWC + 0 PUSHINT + SWAP + 2 STU + 3 PUSHINT + SWAP + 2 STU + 0 PUSHINT + SWAP + 1 STU + s1 s2 XCHG + STREF + STREF + ENDC + HASHCU + __tact_create_address INLINECALLDICT + }> + __tact_address_eq PROCINLINE:<{ + SDEQ + }> + __tact_address_neq PROCINLINE:<{ + SDEQ + NOT + }> + __tact_dict_set_code PROCINLINE:<{ + s0 s2 XCHG + 16 PUSHINT + DICTUSETREF + }> + __tact_dict_get_code PROCINLINE:<{ + SWAP + 16 PUSHINT + DICTUGETREF + NULLSWAPIFNOT + 135 THROWIFNOT + }> + __gen_read_TokenTransfer PROCREF:<{ + 32 LDU + SWAP + 260734629 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + SWAP + 1 LDI + SWAP + IF:<{ + LDREF + }>ELSE<{ + PUSHNULL + SWAP + }> + LDGRAMS + s6 s6 XCPU + s1 s6 XCHG + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_write_TokenTransferInternal PROCREF:<{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + SWAP + STGRAMS + SWAP + STSLICER + }> + __gen_writecell_TokenTransferInternal PROCREF:<{ + NEWC + 6 -ROLL + __gen_write_TokenTransferInternal INLINECALLDICT + ENDC + }> + __gen_read_TokenTransferInternal PROCREF:<{ + 32 LDU + SWAP + 395134233 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + SWAP + LDGRAMS + s5 s5 XCPU + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_write_TokenNotification PROCREF:<{ + 1935855772 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + SWAP + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + SWAP + STSLICER + }> + __gen_writecell_TokenNotification PROCREF:<{ + NEWC + 4 -ROLL + __gen_write_TokenNotification INLINECALLDICT + ENDC + }> + __gen_read_TokenBurn PROCREF:<{ + 32 LDU + SWAP + 1499400124 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address_opt INLINECALLDICT + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> + __gen_write_TokenBurnNotification PROCREF:<{ + 2078119902 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + SWAP + STGRAMS + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address_opt INLINECALLDICT + }> + __gen_writecell_TokenBurnNotification PROCREF:<{ + NEWC + 4 -ROLL + __gen_write_TokenBurnNotification INLINECALLDICT + ENDC + }> + __gen_write_TokenExcesses PROCREF:<{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> + __gen_writecell_TokenExcesses PROCREF:<{ + NEWC + SWAP + __gen_write_TokenExcesses INLINECALLDICT + ENDC + }> + __gen_write_TONBWallet PROCREF:<{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + }> + __gen_read_TONBWallet PROCREF:<{ + 257 PUSHINT + LDIX + __tact_load_address INLINECALLDICT + SWAP + __tact_load_address INLINECALLDICT + s3 s3 s0 XCHG3 + }> + __gen_StateInit_get_code PROCINLINE:<{ + DROP + }> + __gen_JettonWalletData_to_external PROC:<{ + }> + __gen_load_TONBWallet PROCREF:<{ + c4 PUSH + CTOS + LDREF + SWAP + __tact_context_sys SETGLOB + __gen_read_TONBWallet INLINECALLDICT + 1 3 BLKDROP2 + }> + __gen_store_TONBWallet PROCREF:<{ + NEWC + __tact_context_sys GETGLOB + SWAP + STREF + 3 -ROLL + __gen_write_TONBWallet INLINECALLDICT + ENDC + c4 POP + }> + $contractAddress PROC:<{ + 0 PUSHINT + -ROT + __tact_compute_contract_address INLINECALLDICT + }> + $send PROC:<{ + 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 CALLDICT + 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 CALLDICT + 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 CALLDICT + SWAP + STREF + }>ELSE<{ + NIP + FALSE + __tact_store_bool INLINECALLDICT + }> + ENDC + SWAP + SENDRAWMSG + }> + $__gen_Context_readForwardFee PROC:<{ + 3 1 BLKDROP2 + LDGRAMS + NIP + 1 PUSHINT + SDSKIPFIRST + LDGRAMS + NIP + LDGRAMS + DROP + 3 MULCONST + 1 RSHIFT# + }> + $__gen_TONBWallet_init PROC:<{ + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + __gen_write_TONBWallet INLINECALLDICT + ENDC + }> + $__gen_TONBWallet_init_child PROC:<{ + s0 s2 XCHG + CTOS + LDDICT + DROP + NEWDICT + SWAP + 24708 PUSHINT + __tact_dict_get_code INLINECALLDICT + SWAP + 24708 PUSHINT + s2 PUSH + __tact_dict_set_code INLINECALLDICT + NEWC + STDICT + ENDC + s0 s0 s3 XCHG3 + $__gen_TONBWallet_init CALLDICT + }> + $__gen_TONBWallet_get_wallet_data PROC:<{ + __tact_context_sys GETGLOB + s1 s2 PUSH2 + $__gen_TONBWallet_init_child CALLDICT + __gen_StateInit_get_code INLINECALLDICT + }> + $__gen_get_get_wallet_data PROC:<{ + __gen_load_TONBWallet INLINECALLDICT + $__gen_TONBWallet_get_wallet_data CALLDICT + __gen_JettonWalletData_to_external CALLDICT + }> + $__gen_TONBWallet_receive_TokenTransfer PROC:<{ + 2 2 BLKDROP2 + __tact_context_get INLINECALLDICT + 4429 PUSHINT + s3 s11 PUSH2 + __tact_address_eq INLINECALLDICT + THROWANYIFNOT + s11 s7 XCPU + SUB + 62972 PUSHINT + OVER + -1 GTINT + THROWANYIFNOT + s3 s3 s0 XCHG3 + s3 s11 PUXC + $__gen_Context_readForwardFee CALLDICT + 1 PUSHINT + s4 PUSH + 0 GTINT + IF:<{ + DROP + 2 PUSHINT + }> + 16059 PUSHINT + s0 s2 XCHG + MUL + 20000000 PUSHINT + ADD + 10000000 PUSHINT + ADD + s1 s2 XCHG + GREATER + THROWANYIFNOT + __tact_context_sys GETGLOB + s0 s6 s3 XCPUXC + $__gen_TONBWallet_init_child CALLDICT + 2DUP + $contractAddress CALLDICT + TRUE + s7 s6 XCHG2 + 0 PUSHINT + 64 PUSHINT + s11 PUSH + s12 s2 s8 PUXC2 + s1 s8 XCHG + __gen_writecell_TokenTransferInternal INLINECALLDICT + s5 s6 XCHG + s3 s4 XCHG + -ROT + $send CALLDICT + }> + $__gen_TONBWallet_receive_TokenTransferInternal PROC:<{ + __tact_context_get INLINECALLDICT + s2 s10 PUSH2 + __tact_address_neq INLINECALLDICT + IF:<{ + __tact_context_sys GETGLOB + s11 s8 PUSH2 + $__gen_TONBWallet_init_child CALLDICT + SWAP + 4429 PUSHINT + s0 s2 XCHG + $contractAddress CALLDICT + s4 PUSH + __tact_address_eq INLINECALLDICT + THROWANYIFNOT + }> + s12 s8 XCPU + ADD + 62972 PUSHINT + OVER + -1 GTINT + THROWANYIFNOT + OVER + __tact_my_balance INLINECALLDICT + OVER + SUB + 10000000 PUSHINT + TUCK + MIN + SUB + 10000000 PUSHINT + ADD + SUB + s6 PUSH + 0 GTINT + IF:<{ + s4 s13 XCHG2 + s3 s3 s0 XCHG3 + $__gen_Context_readForwardFee CALLDICT + s3 s(-1) PUXC + ADD + s1 s10 XCHG + SUB + FALSE + 0 PUSHINT + s8 PUSH + s8 s1 s3 XCHG3 + s7 s4 XCHG2 + __gen_writecell_TokenNotification INLINECALLDICT + s8 PUSH + s4 s6 XCHG + s3 s1 s3 XCHG3 + s5 s5 XCHG2 + PUSHNULL + PUSHNULL + $send CALLDICT + s0 s5 XCHG2 + }>ELSE<{ + s7 s13 XCHG + s8 s9 XCHG2 + 8 BLKDROP + }> + s5 PUSH + ISNULL + NOT + s2 PUSH + 0 GTINT + AND + IF:<{ + FALSE + s0 s6 XCHG + __tact_not_null CALLDICT + 0 PUSHINT + s0 s4 XCHG + __gen_writecell_TokenExcesses INLINECALLDICT + s4 s7 XCHG + s3 s3 s0 XCHG3 + s1 s7 XCHG + PUSHNULL + PUSHNULL + $send CALLDICT + }>ELSE<{ + s5 POP + 2DROP + }> + }> + $__gen_TONBWallet_receive_TokenBurn PROC:<{ + 2DROP + __tact_context_get INLINECALLDICT + 4429 PUSHINT + s3 s8 PUSH2 + __tact_address_eq INLINECALLDICT + s4 s8 PUSH2 + __tact_address_eq INLINECALLDICT + OR + THROWANYIFNOT + s8 s4 XCPU + SUB + 62972 PUSHINT + OVER + -1 GTINT + THROWANYIFNOT + s3 s3 s0 XCHG3 + s3 s8 PUXC + $__gen_Context_readForwardFee CALLDICT + 16059 PUSHINT + SWAP + 20000000 PUSHINT + ADD + 10000000 PUSHINT + ADD + s1 s2 XCHG + GREATER + THROWANYIFNOT + TRUE + 0 PUSHINT + s0 s3 XCHG + 64 PUSHINT + s3 s6 s6 XCPU2 + __gen_writecell_TokenBurnNotification INLINECALLDICT + s3 s0 s4 XC2PU + s3 s3 XCHG2 + PUSHNULL + PUSHNULL + $send CALLDICT + }> + $__gen_TONBWallet_receive_bounced PROC:<{ + 32 PUSHINT + SDSKIPFIRST + 32 LDU + 64 LDU + NIP + LDGRAMS + DROP + 13650 PUSHINT + s2 PUSH + 395134233 PUSHINT + EQUAL + s0 s3 XCHG + 2078119902 PUSHINT + EQUAL + s1 s3 XCHG + OR + s1 s2 XCHG + THROWANYIFNOT + s1 s3 XCHG + ADD + s0 s2 XCHG + }> + 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:<{ + DROP + __gen_load_TONBWallet INLINECALLDICT + 3 ROLL + $__gen_TONBWallet_receive_bounced CALLDICT + __gen_store_TONBWallet INLINECALLDICT + }> + DUP + 260734629 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_TONBWallet INLINECALLDICT + s0 s3 XCHG + __gen_read_TokenTransfer INLINECALLDICT + s7 POP + s8 s9 XCHG + s7 s8 XCHG + 6 ROLL + $__gen_TONBWallet_receive_TokenTransfer CALLDICT + __gen_store_TONBWallet INLINECALLDICT + }> + DUP + 395134233 PUSHINT + EQUAL + IFJMP:<{ + DROP + __gen_load_TONBWallet INLINECALLDICT + s0 s3 XCHG + __gen_read_TokenTransferInternal INLINECALLDICT + s6 POP + s7 s8 XCHG + s6 s7 XCHG + 5 ROLL + $__gen_TONBWallet_receive_TokenTransferInternal CALLDICT + __gen_store_TONBWallet INLINECALLDICT + }> + 1499400124 PUSHINT + EQUAL + IFJMP:<{ + __gen_load_TONBWallet INLINECALLDICT + s0 s3 XCHG + __gen_read_TokenBurn INLINECALLDICT + s4 POP + s5 s6 XCHG + s4 s5 XCHG + 3 ROLL + $__gen_TONBWallet_receive_TokenBurn CALLDICT + __gen_store_TONBWallet INLINECALLDICT + }> + DROP + 130 THROW + }> + supported_interfaces PROC:<{ + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + 209778528950190195973528115415557644819 PUSHINT + }> + get_abi_ipfs PROC:<{ + x{697066733a2f2f516d64655169627870364270386774544b437a694a7343667a614570627843347a43456f6d6e4262316e43796572} PUSHSLICE + }> +}END>c diff --git a/sources/output/jetton_TONBWallet.code.rev.fif b/sources/output/jetton_TONBWallet.code.rev.fif new file mode 100644 index 0000000..aed9176 --- /dev/null +++ b/sources/output/jetton_TONBWallet.code.rev.fif @@ -0,0 +1,860 @@ +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 + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + 1 3 BLKSWAP + 42 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 PUSH + 260734629 PUSHINT + EQUAL + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG + <{ + 32 LDU + s0 s1 XCHG + 260734629 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + 1 LDI + s0 s1 XCHG + <{ + LDREF + }> PUSHCONT + <{ + PUSHNULL + s0 s1 XCHG + }> PUSHCONT + IFELSE + LDGRAMS + s6 s6 XCPU + s1 s6 XCHG + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + s7 POP + s8 s9 XCHG + s7 s8 XCHG + 1 6 BLKSWAP + 39 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> IFJMPREF + s0 PUSH + 395134233 PUSHINT + EQUAL + <{ + s0 POP + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG + <{ + 32 LDU + s0 s1 XCHG + 395134233 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s0 s1 XCHG + LDGRAMS + s5 s5 XCPU + s1 s5 XCHG + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + s6 POP + s7 s8 XCHG + s6 s7 XCHG + 1 5 BLKSWAP + 40 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + 1499400124 PUSHINT + EQUAL + <{ + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + s0 s3 XCHG + <{ + 32 LDU + s0 s1 XCHG + 1499400124 PUSHINT + EQUAL + 129 THROWIFNOT + 64 LDU + LDGRAMS + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s1 PUSH + 2 PLDU + 0 NEQINT + <{ + s0 s1 XCHG + }> PUSHCONT + <{ + s1 POP + PUSHNULL + }> PUSHCONT + IFELSE + s1 s4 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + s4 POP + s5 s6 XCHG + s4 s5 XCHG + 1 3 BLKSWAP + 41 CALLDICT + <{ + NEWC + 2 GETGLOBVAR + s0 s1 XCHG + STREF + 3 1 BLKSWAP + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + c4 POP + }> CALLREF + }> PUSHCONT + IFJMP + s0 POP + 130 THROW + + 2: + s0 PUSH + ISNULL + 128 THROWIF + + 30: + + 33: + 0 PUSHINT + ROTREV + NEWC + 0 PUSHINT + s0 s1 XCHG + 2 STU + 3 PUSHINT + s0 s1 XCHG + 2 STU + 0 PUSHINT + s0 s1 XCHG + 1 STU + s1 s2 XCHG + STREF + STREF + ENDC + HASHCU + NEWC + 2 PUSHINT + s0 s1 XCHG + 2 STU + 0 PUSHINT + s0 s1 XCHG + 1 STU + s1 s2 XCHG + 8 STI + 256 STU + ENDC + CTOS + + 34: + 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 + 2 CALLDICT + 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 + 2 CALLDICT + 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 + 2 CALLDICT + s0 s1 XCHG + STREF + }> IFREFELSEREF + ENDC + s0 s1 XCHG + SENDRAWMSG + s1 POP + 0 PUSHINT + s0 s1 XCHG + 1 STI + + 35: + 3 1 BLKDROP2 + LDGRAMS + s1 POP + 1 PUSHINT + SDSKIPFIRST + LDGRAMS + s1 POP + LDGRAMS + s0 POP + 3 MULCONST + 1 RSHIFT + + 36: + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + + 37: + s0 s2 XCHG + CTOS + LDDICT + s0 POP + PUSHNULL + s0 s1 XCHG + 24708 PUSHINT + s0 s1 XCHG + 16 PUSHINT + DICTUGETREF + NULLSWAPIFNOT + 135 THROWIFNOT + s0 s1 XCHG + 24708 PUSHINT + s2 PUSH + s0 s2 XCHG + 16 PUSHINT + DICTUSETREF + NEWC + STDICT + ENDC + s0 s0 s3 XCHG3 + 36 CALLDICT + + 38: + 2 GETGLOBVAR + s1 s2 PUSH2 + 37 CALLDICT + s0 POP + + 39: + 2 2 BLKDROP2 + 1 GETGLOBVAR + 4 UNTUPLE + 4429 PUSHINT + s3 s11 PUSH2 + SDEQ + THROWANYIFNOT + s11 s7 XCPU + SUB + 62972 PUSHINT + s1 PUSH + -1 GTINT + THROWANYIFNOT + s3 s3 s0 XCHG3 + s3 s11 PUXC + 35 CALLDICT + 1 PUSHINT + s4 PUSH + 0 GTINT + <{ + s0 POP + 2 PUSHINT + }> PUSHCONT + IF + 16059 PUSHINT + s0 s2 XCHG + MUL + 20000000 PUSHINT + ADD + 10000000 PUSHINT + ADD + s1 s2 XCHG + GREATER + THROWANYIFNOT + 2 GETGLOBVAR + 0 6 3 XCPUXC + 37 CALLDICT + 2DUP + 33 CALLDICT + -1 PUSHINT + s7 s6 XCHG2 + 0 PUSHINT + 64 PUSHINT + s11 PUSH + 12 2 8 PUXC2 + s1 s8 XCHG + <{ + NEWC + 6 1 BLKSWAP + <{ + 395134233 PUSHINT + s0 s7 XCHG2 + 32 STU + s1 s5 XCHG + 64 STU + s0 s3 XCHG2 + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF + s5 s6 XCHG + s3 s4 XCHG + ROTREV + 34 CALLDICT + + 40: + 1 GETGLOBVAR + 4 UNTUPLE + s2 s10 PUSH2 + SDEQ + NOT + <{ + 2 GETGLOBVAR + s11 s8 PUSH2 + 37 CALLDICT + s0 s1 XCHG + 4429 PUSHINT + s0 s2 XCHG + 33 CALLDICT + s4 PUSH + SDEQ + THROWANYIFNOT + }> PUSHCONT + IF + s12 s8 XCPU + ADD + 62972 PUSHINT + s1 PUSH + -1 GTINT + THROWANYIFNOT + s1 PUSH + BALANCE + 0 INDEX + s1 PUSH + SUB + 10000000 PUSHINT + TUCK + MIN + SUB + 10000000 PUSHINT + ADD + SUB + s6 PUSH + 0 GTINT + <{ + s4 s13 XCHG2 + s3 s3 s0 XCHG3 + 35 CALLDICT + s3 s-1 PUXC + ADD + s1 s10 XCHG + SUB + 0 PUSHINT + 0 PUSHINT + s8 PUSH + s8 s1 s3 XCHG3 + s7 s4 XCHG2 + <{ + NEWC + 4 1 BLKSWAP + <{ + 1935855772 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + }> CALLREF + s8 PUSH + s4 s6 XCHG + s3 s1 s3 XCHG3 + s5 s5 XCHG2 + PUSHNULL + PUSHNULL + 34 CALLDICT + s0 s5 XCHG2 + }> PUSHCONT + <{ + s7 s13 XCHG + s8 s9 XCHG2 + 8 BLKDROP + }> PUSHCONT + IFELSE + s5 PUSH + ISNULL + NOT + s2 PUSH + 0 GTINT + AND + <{ + 0 PUSHINT + s0 s6 XCHG + 2 CALLDICT + 0 PUSHINT + s0 s4 XCHG + <{ + NEWC + s0 s1 XCHG + <{ + 3576854235 PUSHINT + ROT + 32 STU + 64 STU + }> CALLREF + ENDC + }> CALLREF + s4 s7 XCHG + s3 s3 s0 XCHG3 + s1 s7 XCHG + PUSHNULL + PUSHNULL + 34 CALLDICT + }> IFREFELSEREF + s5 POP + 2DROP + + 41: + 2DROP + 1 GETGLOBVAR + 4 UNTUPLE + 4429 PUSHINT + s3 s8 PUSH2 + SDEQ + s4 s8 PUSH2 + SDEQ + OR + THROWANYIFNOT + s8 s4 XCPU + SUB + 62972 PUSHINT + s1 PUSH + -1 GTINT + THROWANYIFNOT + s3 s3 s0 XCHG3 + s3 s8 PUXC + 35 CALLDICT + 16059 PUSHINT + s0 s1 XCHG + 20000000 PUSHINT + ADD + 10000000 PUSHINT + ADD + s1 s2 XCHG + GREATER + THROWANYIFNOT + -1 PUSHINT + 0 PUSHINT + s0 s3 XCHG + 64 PUSHINT + 3 6 6 XCPU2 + <{ + NEWC + 4 1 BLKSWAP + <{ + 2078119902 PUSHINT + s0 s5 XCHG2 + 32 STU + s1 s3 XCHG + 64 STU + s0 s1 XCHG + STGRAMS + s0 s1 XCHG + STSLICER + s0 s1 XCHG + s0 PUSH + ISNULL + <{ + s0 POP + 0 PUSHINT + s0 s1 XCHG + 2 STU + }> PUSHCONT + <{ + STSLICER + }> PUSHCONT + IFELSE + }> CALLREF + ENDC + }> CALLREF + 3 0 4 XC2PU + s3 s3 XCHG2 + PUSHNULL + PUSHNULL + 34 CALLDICT + + 42: + 32 PUSHINT + SDSKIPFIRST + 32 LDU + 64 LDU + s1 POP + LDGRAMS + s0 POP + 13650 PUSHINT + s2 PUSH + 395134233 PUSHINT + EQUAL + s0 s3 XCHG + 2078119902 PUSHINT + EQUAL + s1 s3 XCHG + OR + s1 s2 XCHG + THROWANYIFNOT + s1 s3 XCHG + ADD + s0 s2 XCHG + + get_wallet_data: + <{ + c4 PUSH + CTOS + LDREF + s0 s1 XCHG + 2 SETGLOBVAR + <{ + 257 PUSHINT + LDI + LDMSGADDR + s0 s1 XCHG + s0 s1 XCHG + LDMSGADDR + s0 s1 XCHG + s3 s3 s0 XCHG3 + }> CALLREF + 1 3 BLKDROP2 + }> CALLREF + 38 CALLDICT + 30 CALLDICT + + 113617: + 123515602279859691144772641439386770278 PUSHINT + 209801025412363888721030803524359905849 PUSHINT + 209778528950190195973528115415557644819 PUSHINT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_TONBWallet.init.boc b/sources/output/jetton_TONBWallet.init.boc new file mode 100644 index 0000000000000000000000000000000000000000..18cd0d9ca423d58fadfdc02374a47b8cdfe17e72 GIT binary patch literal 72 zcmdn`ZcY&+BReC5Ed!&-e}*qhgum?hbb_0ai7| literal 0 HcmV?d00001 diff --git a/sources/output/jetton_TONBWallet.init.fc b/sources/output/jetton_TONBWallet.init.fc new file mode 100644 index 0000000..cebd72e --- /dev/null +++ b/sources/output/jetton_TONBWallet.init.fc @@ -0,0 +1,37 @@ +() __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; +} + +builder __gen_write_TONBWallet(builder build_0, (int, slice, slice) v) inline_ref { + var (v'balance, v'owner, v'master) = v; + build_0 = build_0.store_int(v'balance, 257); + build_0 = __tact_store_address(build_0, v'owner); + build_0 = __tact_store_address(build_0, v'master); + return build_0; +} + +cell $__gen_TONBWallet_init(cell sys', slice $master, slice $owner) { + var (($self'balance, $self'owner, $self'master)) = (null(), null(), null()); + $self'balance = 0; + $self'owner = $owner; + $self'master = $master; + var b' = begin_cell(); + b' = b'.store_ref(sys'); + b' = __gen_write_TONBWallet(b', ($self'balance, $self'owner, $self'master)); + return b'.end_cell(); +} + +cell init(cell sys', slice $$master, slice $$owner) method_id { + slice $master = $$master; + slice $owner = $$owner; + return $__gen_TONBWallet_init(sys', $master, $owner); +} + +() main() { +} \ No newline at end of file diff --git a/sources/output/jetton_TONBWallet.init.fif b/sources/output/jetton_TONBWallet.init.fif new file mode 100644 index 0000000..77355bf --- /dev/null +++ b/sources/output/jetton_TONBWallet.init.fif @@ -0,0 +1,40 @@ +PROGRAM{ + DECLPROC __tact_verify_address + DECLPROC __tact_store_address + DECLPROC __gen_write_TONBWallet + DECLPROC $__gen_TONBWallet_init + 107886 DECLMETHOD init + DECLPROC main + __tact_verify_address PROCINLINE:<{ + SBITS + 267 PUSHINT + NEQ + 136 THROWIFNOT + }> + __tact_store_address PROCINLINE:<{ + STSLICER + }> + __gen_write_TONBWallet PROCREF:<{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + SWAP + __tact_store_address INLINECALLDICT + SWAP + __tact_store_address INLINECALLDICT + }> + $__gen_TONBWallet_init PROC:<{ + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + __gen_write_TONBWallet INLINECALLDICT + ENDC + }> + init PROC:<{ + $__gen_TONBWallet_init CALLDICT + }> + main PROC:<{ + }> +}END>c diff --git a/sources/output/jetton_TONBWallet.init.rev.fif b/sources/output/jetton_TONBWallet.init.rev.fif new file mode 100644 index 0000000..b3909c3 --- /dev/null +++ b/sources/output/jetton_TONBWallet.init.rev.fif @@ -0,0 +1,26 @@ +SETCP0 +(:methods + recv_internal: + + 4: + 0 PUSHINT + s0 s3 XCHG + NEWC + STREF + s3 s1 s3 XCHG3 + <{ + s2 s3 XCHG2 + 257 PUSHINT + STIX + s0 s1 XCHG + STSLICER + s0 s1 XCHG + STSLICER + }> CALLREF + ENDC + + 107886: + 4 CALLDICT +) 19 DICTPUSHCONST +DICTIGETJMPZ +11 THROWARG diff --git a/sources/output/jetton_TONBWallet.md b/sources/output/jetton_TONBWallet.md new file mode 100644 index 0000000..66d26a2 --- /dev/null +++ b/sources/output/jetton_TONBWallet.md @@ -0,0 +1,83 @@ +# TACT Compilation Report +Contract: TONBWallet +BOC Size: 1324 bytes + +# Types +Total Types: 18 + +## 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 = TokenTransferInternal` +Signature: `TokenTransferInternal{queryId:uint64,amount:coins,from:address,responseAddress:Maybe address,forwardTonAmount:coins,forwardPayload:remainder}` + +## 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}` + +## 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}` + +## InitLinker +TLB: `init_linker#453d436d owner:address = InitLinker` +Signature: `InitLinker{owner:address}` + +## SetLinkerNeighbor +TLB: `set_linker_neighbor#b3fcf4c1 neighbor:Maybe address = SetLinkerNeighbor` +Signature: `SetLinkerNeighbor{neighbor:Maybe address}` + +## WithdrawalRequests +TLB: `_ addresses:dict amounts:dict n_requests:int257 = WithdrawalRequests` +Signature: `WithdrawalRequests{addresses:dict,amounts:dict,n_requests:int257}` + +## 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: 1 + +## get_wallet_data diff --git a/sources/output/jetton_TONBWallet.pkg b/sources/output/jetton_TONBWallet.pkg new file mode 100644 index 0000000..bf81c1b --- /dev/null +++ b/sources/output/jetton_TONBWallet.pkg @@ -0,0 +1 @@ +{"name":"TONBWallet","code":"te6ccgECNAEABSAAART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQLwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyIw2zwD2zw3EIkQeFUF8CfbPBEOEwQ2j5Ew2zwD2zw2EHgQZ1UE8CjbPOCCEFlfB7y6EQ8TEABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAFjTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMAMuj5DbPAPbPDQQVhBFVQLwKds84DDywIIREhMBFu1E0NQB+GLbPGwTFABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVSDbPMntVCMAHIEBAdcA+kABAfpAAUMwAgEgFxgCAUgoKQIBIBkaAgEgHyAAS1cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAgEgGxwC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCAdHgAlGwx+gAxcdch+gAx+gAwpwOrAIAASfwHKAAHwAgHMAAoxcAHKAAIBICEiAgEgJCUBExwA8jMQxPbPMmAjAE0AtD0BDBtAYFghAGAEPQPb6Hy4IcBgWCEIgKAEPQXyPQAyUAD8CSAAGlAjgQEBzwABzxYBzxYADz4QlMS8CUwgAbkbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAjcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAlXPAhf1B2cIBAK1RMORjbPBBWEDRZ8CKAmAQzIVVDbPMknAE6CEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxYCASAqKwBPSAINch0x/TPzH6ADCBNVIighAXjUUZugOCEHvdl966E7ES8vQToAKAPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4CwtLgGZFv4QW8kgRFNUzjHBVNIxwWx8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAyAQzIVTDbPMkvASJwBvACcATbPBBHQzAXbW3wIjAABDVbACyCEHNi0JxQBcsfE8s/AfoCAc8WAc8WAQrIAds8yTEAFoIQ1TJ221jLH8s/AQzIVTDbPMkzAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4g==","abi":"{\"name\":\"TONBWallet\",\"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\":\"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\":\"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\":\"InitLinker\",\"header\":1161642861,\"fields\":[{\"name\":\"owner\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}}]},{\"name\":\"SetLinkerNeighbor\",\"header\":3019699393,\"fields\":[{\"name\":\"neighbor\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":true}}]},{\"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\":\"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\":\"TokenTransfer\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenTransferInternal\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TokenBurn\"}}],\"getters\":[{\"name\":\"get_wallet_data\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"JettonWalletData\",\"optional\":false}}],\"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\"},\"13650\":{\"message\":\"Invalid bounced message\"},\"16059\":{\"message\":\"Invalid value\"},\"32366\":{\"message\":\"not enough money for deposit\"},\"62972\":{\"message\":\"Invalid balance\"}}}","init":{"code":"te6ccgEBBwEAPQABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBE9OAHkZiGJ7Z5kwGABpQI4EBAc8AAc8WAc8W","args":[{"name":"master","type":{"kind":"simple","type":"address","optional":false}},{"name":"owner","type":{"kind":"simple","type":"address","optional":false}}],"deployment":{"kind":"system-cell","system":"te6cckECNgEABSoAAQHAAQEFoMEJAgEU/wD0pBP0vPLICwMCAWIHBAIBIAYFAHG93owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThO6PAB8tmwHk/kHVks1lEJwBEb/YFtnngTeA9DQCAsonCAIBSBYJAgFICwoAT0gCDXIdMf0z8x+gAwgTVSIoIQF41FGboDghB73ZfeuhOxEvL0E6ACgCASAPDAGZFv4QW8kgRFNUzjHBVNIxwWx8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKANAQzIVTDbPMkOAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4gPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4BQREAAENVsBInAG8AJwBNs8EEdDMBdtbfAiEgEKyAHbPMkTABaCENUydttYyx/LPwEMyFUw2zzJFQAsghBzYtCcUAXLHxPLPwH6AgHPFgHPFgIBICAXAgEgHRgCASAcGQG5Gwi+EFvJIERTVM7xwXy9FG3oYIA9fwhwv/y9EMwUjzwI3EkwgCSMHLegT67AqiCCTEtAKCCCJiWgKASvPL0+EJUIGTwJVzwIX9QdnCAQCtUTDkY2zwQVhA0WfAigGgEMyFVQ2zzJGwBOghAXjUUZUAfLHxXLP1AD+gIBzxYBIG6VMHABywGSzxbiAfoCAc8WAA8+EJTEvAlMIAIBIB8eAE0AtD0BDBtAYFghAGAEPQPb6Hy4IcBgWCEIgKAEPQXyPQAyUAD8CSABExwA8jMQxPbPMmAzAgEgJiECASAjIgAlGwx+gAxcdch+gAx+gAwpwOrAIAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPACUATMljQDcAHKAOIkbrOafwHKAATwAlAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICUkAAoxcAHKAAASfwHKAAHwAgHMAEtXBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydCAIBICkoAAOnQAIBYisqAAtCBu8tCAgEiUcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKPCTDbPFUC8CrbPOAgghAPin6luuMCIIIQF41FGbqDQyMCwENo+RMNs8A9s8NhB4EGdVBPAo2zzgghBZXwe8ujQvMi0DLo+Q2zwD2zw0EFYQRVUC8CnbPOAw8sCCNC4yAEzTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMABY0x8BghAXjUUZuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB+gBRVRUUQzADIjDbPAPbPDcQiRB4VQXwJ9s8NDEyAGzTHwGCEA+KfqW68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gHSAAGR1JJtAeL6AFFmFhUUQzABGMj4QgHMVSDbPMntVDMAGlAjgQEBzwABzxYBzxYBFu1E0NQB+GLbPGwTNQAcgQEB1wD6QAEB+kABQzCAxrR7"}},"compiler":{"name":"tact","version":"0.8.11"}} \ No newline at end of file diff --git a/sources/output/jetton_TONBWallet.ts b/sources/output/jetton_TONBWallet.ts new file mode 100644 index 0000000..bab03d1 --- /dev/null +++ b/sources/output/jetton_TONBWallet.ts @@ -0,0 +1,1037 @@ +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; +} + +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()); + }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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(); + return { $$type: 'TokenTransferInternal' as const, queryId: _queryId, amount: _amount, from: _from, responseAddress: _responseAddress, forwardTonAmount: _forwardTonAmount, forwardPayload: _forwardPayload }; +} + +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); + 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 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 InitLinker = { + $$type: 'InitLinker'; + owner: Address; +} + +export function storeInitLinker(src: InitLinker) { + return (builder: Builder) => { + let b_0 = builder; + b_0.storeUint(1161642861, 32); + b_0.storeAddress(src.owner); + }; +} + +export function loadInitLinker(slice: Slice) { + let sc_0 = slice; + if (sc_0.loadUint(32) !== 1161642861) { throw Error('Invalid prefix'); } + let _owner = sc_0.loadAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function loadTupleInitLinker(source: TupleReader) { + let _owner = source.readAddress(); + return { $$type: 'InitLinker' as const, owner: _owner }; +} + +function storeTupleInitLinker(source: InitLinker) { + let builder = new TupleBuilder(); + builder.writeAddress(source.owner); + 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 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 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 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 TONBWallet_init(master: Address, owner: Address) { + const __init = 'te6ccgEBBwEAPQABFP8A9KQT9LzyyAsBAgFiAgMCAs0EBQAJoUrd4AkAAdQBE9OAHkZiGJ7Z5kwGABpQI4EBAc8AAc8WAc8W'; + const __code = 'te6ccgECNAEABSAAART/APSkE/S88sgLAQIBYgIDAgLKBgcCASAEBQERv9gW2eeBN4D0EQBxvd6ME4LnYerpZXPY9CdhzrJUKNs0E4TusalpWyPlmRadeW/vixHME4TujwAfLZsB5P5B1ZLNZRCcAgEgCAkCAUgVFgIBYgoLAAOnQASJRwIddJwh+VMCDXCx/eAtDTAwFxsMABkX+RcOIB+kAiUGZvBPhhAo8JMNs8VQLwKts84CCCEA+KfqW64wIgghAXjUUZuoERMMDQALQgbvLQgIAyIw2zwD2zw3EIkQeFUF8CfbPBEOEwQ2j5Ew2zwD2zw2EHgQZ1UE8CjbPOCCEFlfB7y6EQ8TEABs0x8BghAPin6luvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB0gABkdSSbQHi+gBRZhYVFEMwAFjTHwGCEBeNRRm68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gH6AFFVFRRDMAMuj5DbPAPbPDQQVhBFVQLwKds84DDywIIREhMBFu1E0NQB+GLbPGwTFABM0x8BghBZXwe8uvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIUQzABGMj4QgHMVSDbPMntVCMAHIEBAdcA+kABAfpAAUMwAgEgFxgCAUgoKQIBIBkaAgEgHyAAS1cFnIcAHLAXMBywFwAcsAEszMyfkAyHIBywFwAcsAEsoHy//J0IAgEgGxwC9zIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GORn8BygDIcAHKAHABygAkbrOafwHKAATwAlAEzJY0A3ABygDiJG6zmn8BygAE8AJQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrPjD8kB+wCAdHgAlGwx+gAxcdch+gAx+gAwpwOrAIAASfwHKAAHwAgHMAAoxcAHKAAIBICEiAgEgJCUBExwA8jMQxPbPMmAjAE0AtD0BDBtAYFghAGAEPQPb6Hy4IcBgWCEIgKAEPQXyPQAyUAD8CSAAGlAjgQEBzwABzxYBzxYADz4QlMS8CUwgAbkbCL4QW8kgRFNUzvHBfL0UbehggD1/CHC//L0QzBSPPAjcSTCAJIwct6BPrsCqIIJMS0AoIIImJaAoBK88vT4QlQgZPAlXPAhf1B2cIBAK1RMORjbPBBWEDRZ8CKAmAQzIVVDbPMknAE6CEBeNRRlQB8sfFcs/UAP6AgHPFgEgbpUwcAHLAZLPFuIB+gIBzxYCASAqKwBPSAINch0x/TPzH6ADCBNVIighAXjUUZugOCEHvdl966E7ES8vQToAKAPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4CwtLgGZFv4QW8kgRFNUzjHBVNIxwWx8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKAyAQzIVTDbPMkvASJwBvACcATbPBBHQzAXbW3wIjAABDVbACyCEHNi0JxQBcsfE8s/AfoCAc8WAc8WAQrIAds8yTEAFoIQ1TJ221jLH8s/AQzIVTDbPMkzAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4g=='; + const __system = 'te6cckECNgEABSoAAQHAAQEFoMEJAgEU/wD0pBP0vPLICwMCAWIHBAIBIAYFAHG93owTgudh6ullc9j0J2HOslQo2zQThO6xqWlbI+WZFp15b++LEcwThO6PAB8tmwHk/kHVks1lEJwBEb/YFtnngTeA9DQCAsonCAIBSBYJAgFICwoAT0gCDXIdMf0z8x+gAwgTVSIoIQF41FGboDghB73ZfeuhOxEvL0E6ACgCASAPDAGZFv4QW8kgRFNUzjHBVNIxwWx8vRRhKGCAPX8IcL/8vRDMFI58COBPrsBggkxLQCgggiYloCgErzy9H9wA4BAVDNm2zxUEwRQM21t8CKANAQzIVTDbPMkOAECCEHvdl95QBcsfE8s/AfoCAc8WASBulTBwAcsBks8W4gPxPhBbyRTKscFs44S+EJTuPAlAYERTQLwISTHBfL03lHIoIIA9fwhwv/y9CH4J28QIaGCCJiWgGa2CKGCCJiWgKChJsIAjqFQTUMw8CNSMKAaoXBwKEgTUHTbPCgQRkMTUFVtbfAiUAWWEH1QiV8I4iVusyLCALDjD4BQREAAENVsBInAG8AJwBNs8EEdDMBdtbfAiEgEKyAHbPMkTABaCENUydttYyx/LPwEMyFUw2zzJFQAsghBzYtCcUAXLHxPLPwH6AgHPFgHPFgIBICAXAgEgHRgCASAcGQG5Gwi+EFvJIERTVM7xwXy9FG3oYIA9fwhwv/y9EMwUjzwI3EkwgCSMHLegT67AqiCCTEtAKCCCJiWgKASvPL0+EJUIGTwJVzwIX9QdnCAQCtUTDkY2zwQVhA0WfAigGgEMyFVQ2zzJGwBOghAXjUUZUAfLHxXLP1AD+gIBzxYBIG6VMHABywGSzxbiAfoCAc8WAA8+EJTEvAlMIAIBIB8eAE0AtD0BDBtAYFghAGAEPQPb6Hy4IcBgWCEIgKAEPQXyPQAyUAD8CSABExwA8jMQxPbPMmAzAgEgJiECASAjIgAlGwx+gAxcdch+gAx+gAwpwOrAIAL3MhxAcoBUAcBygBwAcoCUAXPFlAD+gJwAcpoI26zJW6zsY5GfwHKAMhwAcoAcAHKACRus5p/AcoABPACUATMljQDcAHKAOIkbrOafwHKAATwAlAEzJY0A3ABygDicAHKAAJ/AcoAAslYzJczMwFwAcoA4iFus+MPyQH7AICUkAAoxcAHKAAASfwHKAAHwAgHMAEtXBZyHABywFzAcsBcAHLABLMzMn5AMhyAcsBcAHLABLKB8v/ydCAIBICkoAAOnQAIBYisqAAtCBu8tCAgEiUcCHXScIflTAg1wsf3gLQ0wMBcbDAAZF/kXDiAfpAIlBmbwT4YQKPCTDbPFUC8CrbPOAgghAPin6luuMCIIIQF41FGbqDQyMCwENo+RMNs8A9s8NhB4EGdVBPAo2zzgghBZXwe8ujQvMi0DLo+Q2zwD2zw0EFYQRVUC8CnbPOAw8sCCNC4yAEzTHwGCEFlfB7y68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4hRDMABY0x8BghAXjUUZuvLggdM/+gD6QAEB+kAh1wsBwwCRAZIxbeIB+gBRVRUUQzADIjDbPAPbPDcQiRB4VQXwJ9s8NDEyAGzTHwGCEA+KfqW68uCB0z/6APpAAQH6QCHXCwHDAJEBkjFt4gHSAAGR1JJtAeL6AFFmFhUUQzABGMj4QgHMVSDbPMntVDMAGlAjgQEBzwABzxYBzxYBFu1E0NQB+GLbPGwTNQAcgQEB1wD6QAEB+kABQzCAxrR7'; + let systemCell = Cell.fromBase64(__system); + let builder = new TupleBuilder(); + builder.writeCell(systemCell); + builder.writeAddress(master); + builder.writeAddress(owner); + 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 (TONBWallet_errors[res.exitCode]) { + throw new ComputeError(TONBWallet_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 TONBWallet_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` }, + 13650: { message: `Invalid bounced message` }, + 16059: { message: `Invalid value` }, + 32366: { message: `not enough money for deposit` }, + 62972: { message: `Invalid balance` }, +} + +export class TONBWallet implements Contract { + + static async init(master: Address, owner: Address) { + return await TONBWallet_init(master,owner); + } + + static async fromInit(master: Address, owner: Address) { + const init = await TONBWallet_init(master,owner); + const address = contractAddress(0, init); + return new TONBWallet(address, init); + } + + static fromAddress(address: Address) { + return new TONBWallet(address); + } + + readonly address: Address; + readonly init?: { code: Cell, data: Cell }; + readonly abi: ContractABI = { + errors: TONBWallet_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: TokenTransfer | TokenTransferInternal | TokenBurn) { + + let body: Cell | null = null; + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransfer') { + body = beginCell().store(storeTokenTransfer(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenTransferInternal') { + body = beginCell().store(storeTokenTransferInternal(message)).endCell(); + } + if (message && typeof message === 'object' && !(message instanceof Slice) && message.$$type === 'TokenBurn') { + body = beginCell().store(storeTokenBurn(message)).endCell(); + } + if (body === null) { throw new Error('Invalid message type'); } + + await provider.internal(via, { ...args, body: body }); + + } + + async getGetWalletData(provider: ContractProvider) { + let builder = new TupleBuilder(); + let source = (await provider.get('get_wallet_data', builder.build())).stack; + const result = loadTupleJettonWalletData(source); + return result; + } + +} \ No newline at end of file diff --git a/sources/staking.tact b/sources/staking.tact new file mode 100644 index 0000000..49d0031 --- /dev/null +++ b/sources/staking.tact @@ -0,0 +1,31 @@ +fun stakingDepositMessage(value: Int, pool: Address): SendParameters { + return SendParameters{ + to: pool, + value: value, + body: beginCell().storeSlice("Deposit".asSlice()).endCell() + }; +} + +fun stakingWithdrawMessage(value: Int, pool: Address): SendParameters { + return SendParameters{ + to: pool, + value: ton("0.05"), + body: beginCell().storeUint(3665837821, 32).storeCoins(value).endCell() + }; +} + +struct WithdrawalRequests { + addresses: map[Int]Address; + amounts: map[Int]Int; + n_requests: Int; +} + +fun withdrawalSum(requests: WithdrawalRequests): Int { + let sum: Int = 0; + let i: Int = 0; + while(i < requests.n_requests) { + sum = sum + requests.amounts.get(i)!!; + i = i + 1; + } + return sum; +} \ No newline at end of file diff --git a/sources/tests/__snapshots__/jetton.spec.ts.snap b/sources/tests/__snapshots__/jetton.spec.ts.snap index 779a3ec..67a4fc4 100644 --- a/sources/tests/__snapshots__/jetton.spec.ts.snap +++ b/sources/tests/__snapshots__/jetton.spec.ts.snap @@ -8,22 +8,78 @@ exports[`jetton should deploy 1`] = ` { "message": { "body": { - "cell": "x{8999B1640000000000000000000000000000000000000000000000000001C6BF526340004_}", + "cell": "x{21EEB60743B9ACA00}", "type": "cell", }, "bounce": true, "from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P", - "to": "kQCrEWck7tGRuwnumilB-HRzp2v-IxRzWG4Lw0mP_VYl72fg", + "to": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", "type": "internal", - "value": 1000000000n, + "value": 1100000000n, }, "type": "received", }, { - "gasUsed": 22165n, + "gasUsed": 22607n, "type": "processed", }, + { + "messages": [ + { + "body": { + "cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}", + "type": "cell", + }, + "bounce": false, + "from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", + "to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU", + "type": "internal", + "value": 182761000n, + }, + ], + "type": "sent", + }, ] `; -exports[`jetton should deploy 2`] = `[]`; +exports[`jetton should deploy and deposit the correct sub of money 1`] = ` +[ + { + "type": "deploy", + }, + { + "message": { + "body": { + "cell": "x{21EEB60743B9ACA00}", + "type": "cell", + }, + "bounce": true, + "from": "kQAI-3FJVc_ywSuY4vq0bYrzR7S4Och4y7bTU_i5yLOB3A6P", + "to": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", + "type": "internal", + "value": 1100000000n, + }, + "type": "received", + }, + { + "gasUsed": 22607n, + "type": "processed", + }, + { + "messages": [ + { + "body": { + "cell": "x{178D4519000000000000000043B9ACA00800B66EA225DB439C1FCC201A2CE8DF9F8E2922936DDEFAE3733D777E936B49F73300023EDC525573FCB04AE638BEAD1B62BCD1ED2E0E721E32EDB4D4FE2E722CE07702_}", + "type": "cell", + }, + "bounce": false, + "from": "kQBbN1ES7aHOD-YQDRZ0b8_HFJFJtu99cbmeu79JtaT7mbCh", + "to": "kQBUyXAApVkXHsyW_DjETpmWFHRLXdFHz5XELjf5v7e3oluU", + "type": "internal", + "value": 182761000n, + }, + ], + "type": "sent", + }, +] +`; diff --git a/sources/tests/jetton.spec.ts b/sources/tests/jetton.spec.ts index 20124ec..a018025 100644 --- a/sources/tests/jetton.spec.ts +++ b/sources/tests/jetton.spec.ts @@ -1,36 +1,35 @@ -import { toNano, beginCell } from "ton"; +import { toNano, Address } from "ton"; import { ContractSystem } from "ton-emulator"; import {TONB} from '../output/jetton_TONB'; import { default_content } from '../utils/config'; import { TONBWallet } from '../output/jetton_TONBWallet'; + + describe('jetton', () => { - it('should deploy', async () => { + it('should deploy and deposit the correct sum of money', async () => { // Create jetton let system = await ContractSystem.create(); let owner = system.treasure('owner'); - let contract = system.open(await TONB.fromInit(owner.address, default_content)); let tracker = system.track(contract.address); let wallet_contract = system.open(await TONBWallet.fromInit(contract.address, owner.address)); - let wallet_tracker = system.track(wallet_contract.address); // Mint - let res1 = await contract.send(owner, { value: toNano(1) }, { $$type: 'Deposit', amount: toNano(1000000) }); - let res = await system.run(); - console.log(res1) - console.log(res) - expect(tracker.events()).toMatchSnapshot(); - expect(wallet_tracker.events()).toMatchSnapshot(); - console.log(await wallet_contract.getGetWalletData()); + await contract.send(owner, { value: toNano('1.1') }, { $$type: 'Deposit', amount: toNano('1') }); + await system.run(); + let events = tracker.events(); + expect(events).toMatchSnapshot(); + let addr = Address.parse((events[3] as any).messages[0].to); + let wallet_contract_2 = system.contract(addr); + let wdata = (await wallet_contract_2.get(97026, [])) as any; + expect(wdata.stack.items[0].value).toEqual(1000000000n); // Check owner expect((await contract.getOwner()).toString()).toEqual(owner.address.toString()); // Data let data = await contract.getGetJettonData(); - // console.warn(data); - console.log(tracker.events()) }); }); \ No newline at end of file diff --git a/sources/tests/scenario.ts b/sources/tests/scenario.ts index 61cf494..4f8a10e 100644 --- a/sources/tests/scenario.ts +++ b/sources/tests/scenario.ts @@ -1,10 +1,11 @@ -import { deployTONB, deposit, withdraw } from "../utils/interactions"; -import { wallet_data } from '../utils/config'; +import { deployTONB, deposit, withdraw, getTONB } from "../utils/interactions"; +import { wallet_data, client } from '../utils/config'; import { randomAddress, TON } from '../utils/helpers'; +import { toNano } from 'ton'; (async () => { let {my_wallet, secretKey} = await wallet_data(); let tonb_addr = await deployTONB(); - await deposit(my_wallet, secretKey, 1 * TON(), tonb_addr); - await withdraw(my_wallet, secretKey, 0.5 * TON(), tonb_addr); + // await deposit(my_wallet, secretKey, toNano('0.6'), tonb_addr); + await withdraw(my_wallet, secretKey, 0.45 * TON(), tonb_addr); })(); diff --git a/sources/utils/interactions.ts b/sources/utils/interactions.ts index c397c80..c925940 100644 --- a/sources/utils/interactions.ts +++ b/sources/utils/interactions.ts @@ -1,14 +1,16 @@ -import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano } from "ton"; +import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano, SendMode } from "ton"; import { storeDeposit, storeWithdraw } from "../output/jetton_TONB"; import { TON } from "./helpers"; import { wallet_data, owner, default_content, workchain } from './config'; -import {TONB} from "../output/jetton_TONB"; +import { TONB } from "../output/jetton_TONB"; import { TONBWallet } from '../output/jetton_TONBWallet'; -export async function sendMessage(wallet: any, secretKey: Buffer, msg: {value: string | bigint, to: Address, bounce?: boolean, init?: {code?: Cell, data?: Cell}, body?: any}) { +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(); return await wallet.sendTransfer({ seqno, + sendMode: SendMode.PAY_GAS_SEPARATLY + SendMode.IGNORE_ERRORS, + secretKey, messages: [internal(msg)] }); @@ -20,8 +22,9 @@ export async function deposit(wallet: any, secretKey: Buffer, value_: bigint | n let msg_body_b = beginCell(); storeDeposit({amount: value as bigint, $$type: 'Deposit'})(msg_body_b); let msg_body = msg_body_b.endCell(); - let msg_value = value as bigint + BigInt(0.1 * TON()); - let res = await sendMessage(wallet, secretKey, {value: msg_value, to: tonb, body: msg_body}); + // let msg_body = msg_body_b.storeUint(0x8999b164, 32).storeUint(value, 257).endCell(); + let msg_value = value as bigint + toNano('0.1'); + let res = await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body }); console.log(res); console.log('======deposit message sent ======'); } @@ -29,25 +32,36 @@ export async function deposit(wallet: any, secretKey: Buffer, value_: bigint | n export async function withdraw(wallet: any, secretKey: Buffer, value_: bigint | number, tonb: Address) { let value = BigInt(value_); let msg_body_b = beginCell(); - storeWithdraw({amount: value as bigint, $$type: 'Withdraw'})(msg_body_b); + storeWithdraw({ amount: value as bigint, $$type: 'Withdraw' })(msg_body_b); let msg_body = msg_body_b.endCell(); - let msg_value = BigInt(0.1 * TON()); - await sendMessage(wallet, secretKey, {value: msg_value, to: tonb, body: msg_body}); + let msg_value = toNano('0.05'); + await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body }); +} + +export async function getTONBState(tonb_content?: any) { + if (!tonb_content) { + tonb_content = default_content; + } + return await TONB.init(owner, tonb_content); } -export async function deployTONB(tonb_content?: any) { +export async function getTONB(tonb_content?: any) { if (!tonb_content) { tonb_content = default_content; } - let {my_wallet, secretKey, keyPair} = await wallet_data(); + return await TONB.fromInit(owner, tonb_content); +} + +export async function deployTONB(tonb_content?: any, cancel: boolean = false) { + let { my_wallet, secretKey, keyPair } = await wallet_data(); // Get deployment wallet balance let balance: bigint = await my_wallet.getBalance(); + let init = await getTONBState(tonb_content); // Compute init data for deployment - let init = await TONB.init(owner, tonb_content); let destination_address = contractAddress(workchain, init); - let deployAmount = toNano('0.5'); + let deployAmount = toNano('0.1'); let supply = 500; let amount = BigInt(supply * Math.pow(10, 9)); @@ -59,6 +73,9 @@ export async function deployTONB(tonb_content?: any) { console.log('🛠️Preparing new outgoing massage from deployment wallet. Seqno = ', seqno, ', wallet = ', my_wallet.address); console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON'); // console.log('Totally supply for deployed Token = ', supply, ', amount = ', amount.toString()); + if (cancel) { + return destination_address; + } let res = await my_wallet.sendTransfer({ seqno, secretKey, @@ -66,17 +83,17 @@ export async function deployTONB(tonb_content?: any) { value: deployAmount, to: destination_address, init: { - code : init.code, - data : init.data + code: init.code, + data: init.data } })] }); console.log('======deployment message sent to ', destination_address, ' ======'); - console.log(res); + // console.log(res); return destination_address; } -export async function getAddress(master_: string | Address, owner_: string | Address) { +export async function getWalletAddress(master_: string | Address, owner_: string | Address) { 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)); diff --git a/sources/utils/rmlogs.sh b/sources/utils/rmlogs.sh old mode 100644 new mode 100755 index e96e50c..8f42fba --- a/sources/utils/rmlogs.sh +++ b/sources/utils/rmlogs.sh @@ -1,3 +1,3 @@ -#!/bin/hash +#!/bin/bash for file in $(find sources/output -type f); do sed -i 's/,\ {\ logs:\ res.vmLogs\ }//g' $file; done for file in $(find sources/output -type f); do sed -i 's/stringtoreplace//g' $file; done \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a44b4de..889bb89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -756,6 +756,13 @@ dependencies: "@babel/types" "^7.3.0" +"@types/bn.js@^5.1.1": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + "@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz" @@ -990,6 +997,20 @@ base64-js@^1.3.1: resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + bl@^5.0.0: version "5.1.0" resolved "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz" @@ -1483,6 +1504,11 @@ fecha@^4.2.0: resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw== +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz"