diff --git a/examples/output/wallet_Wallet.abi b/examples/output/wallet_Wallet.abi index 0d37b713a..17401215c 100644 --- a/examples/output/wallet_Wallet.abi +++ b/examples/output/wallet_Wallet.abi @@ -1 +1 @@ -{"name":"Wallet","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":"Transfer","header":null,"fields":[{"name":"seqno","type":{"kind":"simple","type":"uint","optional":false,"format":32}},{"name":"mode","type":{"kind":"simple","type":"uint","optional":false,"format":8}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"TransferMessage","header":123,"fields":[{"name":"signature","type":{"kind":"simple","type":"slice","optional":false}},{"name":"transfer","type":{"kind":"simple","type":"Transfer","optional":false}}]}],"receivers":[{"receiver":"internal","message":{"kind":"text","text":"Deploy"}},{"receiver":"internal","message":{"kind":"typed","type":"TransferMessage"}},{"receiver":"internal","message":{"kind":"any"}},{"receiver":"internal","message":{"kind":"empty"}},{"receiver":"internal","message":{"kind":"text","text":"notify"}},{"receiver":"internal","message":{"kind":"text","text":"Слава Україні"}},{"receiver":"internal","message":{"kind":"text","text":"duplicate"}}],"getters":[{"name":"publicKey","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"walletId","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"seqno","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}}],"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"},"137":{"message":"Masterchain support is not enabled for this contract"},"17654":{"message":"Invalid seqno"},"48401":{"message":"Invalid signature"}},"interfaces":["org.ton.introspection.v0","org.ton.abi.ipfs.v0","org.ton.deploy.lazy.v0","org.ton.chain.workchain.v0"]} \ No newline at end of file +{"name":"Wallet","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":"Transfer","header":null,"fields":[{"name":"seqno","type":{"kind":"simple","type":"uint","optional":false,"format":32}},{"name":"mode","type":{"kind":"simple","type":"uint","optional":false,"format":8}},{"name":"to","type":{"kind":"simple","type":"address","optional":false}},{"name":"amount","type":{"kind":"simple","type":"uint","optional":false,"format":"coins"}},{"name":"body","type":{"kind":"simple","type":"cell","optional":true}}]},{"name":"TransferMessage","header":123,"fields":[{"name":"signature","type":{"kind":"simple","type":"slice","optional":false}},{"name":"transfer","type":{"kind":"simple","type":"Transfer","optional":false}}]}],"receivers":[{"receiver":"internal","message":{"kind":"text","text":"Deploy"}},{"receiver":"internal","message":{"kind":"typed","type":"TransferMessage"}},{"receiver":"internal","message":{"kind":"any"}},{"receiver":"internal","message":{"kind":"empty"}},{"receiver":"internal","message":{"kind":"text","text":"notify"}},{"receiver":"internal","message":{"kind":"text","text":"你好ж"}},{"receiver":"internal","message":{"kind":"text","text":"duplicate"}}],"getters":[{"name":"publicKey","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"walletId","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"seqno","arguments":[],"returnType":{"kind":"simple","type":"int","optional":false,"format":257}}],"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"},"137":{"message":"Masterchain support is not enabled for this contract"},"17654":{"message":"Invalid seqno"},"48401":{"message":"Invalid signature"}},"interfaces":["org.ton.introspection.v0","org.ton.abi.ipfs.v0","org.ton.deploy.lazy.v0","org.ton.chain.workchain.v0"]} \ No newline at end of file diff --git a/examples/output/wallet_Wallet.code.fc b/examples/output/wallet_Wallet.code.fc index 76b2beec0..0fb2d57c5 100644 --- a/examples/output/wallet_Wallet.code.fc +++ b/examples/output/wallet_Wallet.code.fc @@ -133,72 +133,72 @@ _ lazy_deployment_completed() method_id { ((int, int, int), int) $Wallet$_contract_router_internal((int, int, int) self, int msg_bounced, slice in_msg) impure inline_ref { ;; Handle bounced messages if (msg_bounced) { - + ;; Skip 0xFFFFFFFF in_msg~skip_bits(32); - + ;; Fallback bounce receiver self~$Wallet$_receive_bounce(in_msg); - + return (self, true); } - + ;; Parse incoming message int op = 0; if (slice_bits(in_msg) >= 32) { op = in_msg.preload_uint(32); } - - + + ;; Receive TransferMessage message if (op == 123) { var msg = in_msg~$TransferMessage$_load(); self~$Wallet$_internal_binary_TransferMessage(msg); return (self, true); } - + ;; Receive empty message if ((op == 0) & (slice_bits(in_msg) <= 32)) { self~%$Wallet$_internal_empty(); return (self, true); } - + ;; Text Receivers if (op == 0) { var text_op = slice_hash(in_msg); - + ;; Receive "Deploy" message if (text_op == 0x85d288384c0043458b02803cb22059f68803c553c3656344346468dac961f246) { self~$Wallet$_internal_text_85d288384c0043458b02803cb22059f68803c553c3656344346468dac961f246(); return (self, true); } - + ;; Receive "notify" message if (text_op == 0x0e235726108b5700d0369dd7167f6affb806a7e04059375dd0e0fb24971e72b2) { self~$Wallet$_internal_text_0e235726108b5700d0369dd7167f6affb806a7e04059375dd0e0fb24971e72b2(); return (self, true); } - - ;; Receive "Слава Україні" message + + ;; Receive "你好ж" message if (text_op == 0x269468fd4da0f5e0715746736242eba0fad9d28dafc7733bea9e7c6448889439) { self~$Wallet$_internal_text_269468fd4da0f5e0715746736242eba0fad9d28dafc7733bea9e7c6448889439(); return (self, true); } - + ;; Receive "duplicate" message if (text_op == 0x9ca0f1855174e32e8fd378df56a6e4f6c40e4dfcb6090e49812f7b1e26214bf9) { self~$Wallet$_internal_text_9ca0f1855174e32e8fd378df56a6e4f6c40e4dfcb6090e49812f7b1e26214bf9(); return (self, true); } } - + ;; Receiver fallback self~$Wallet$_internal_any(in_msg); return (self, true); } () recv_internal(int msg_value, cell in_msg_cell, slice in_msg) impure { - + ;; Context var cs = in_msg_cell.begin_parse(); var msg_flags = cs~load_uint(4); @@ -206,16 +206,16 @@ _ lazy_deployment_completed() method_id { slice msg_sender_addr = __tact_verify_address(cs~load_msg_addr()); __tact_context = (msg_bounced, msg_sender_addr, msg_value, cs); __tact_context_sender = msg_sender_addr; - + ;; Load contract data var self = $Wallet$_contract_load(); - + ;; Handle operation int handled = self~$Wallet$_contract_router_internal(msg_bounced, in_msg); - + ;; Throw if not handled throw_unless(130, handled); - + ;; Persist state $Wallet$_contract_store(self); } diff --git a/examples/output/wallet_Wallet.pkg b/examples/output/wallet_Wallet.pkg index 12ca99247..acceb4934 100644 --- a/examples/output/wallet_Wallet.pkg +++ b/examples/output/wallet_Wallet.pkg @@ -1 +1 @@ -{"name":"Wallet","code":"te6ccgECGQEAA84AART/APSkE/S88sgLAQIBYgIDAqbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBQI8sfy//LP8ntVBYEAgEgCgsC9u2i7fsBloAg1yEwf+BwIddJwh+VMCDXCx/eIMB7jsIw0x8BwHvy4IHUAdAB0x/TB/pAASDXS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":"{\"name\":\"Wallet\",\"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\":\"Transfer\",\"header\":null,\"fields\":[{\"name\":\"seqno\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":32}},{\"name\":\"mode\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":8}},{\"name\":\"to\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"TransferMessage\",\"header\":123,\"fields\":[{\"name\":\"signature\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false}},{\"name\":\"transfer\",\"type\":{\"kind\":\"simple\",\"type\":\"Transfer\",\"optional\":false}}]}],\"receivers\":[{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"Deploy\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TransferMessage\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"any\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"empty\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"notify\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"Слава Україні\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"duplicate\"}}],\"getters\":[{\"name\":\"publicKey\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"walletId\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"seqno\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}],\"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\"},\"137\":{\"message\":\"Masterchain support is not enabled for this contract\"},\"17654\":{\"message\":\"Invalid seqno\"},\"48401\":{\"message\":\"Invalid signature\"}},\"interfaces\":[\"org.ton.introspection.v0\",\"org.ton.abi.ipfs.v0\",\"org.ton.deploy.lazy.v0\",\"org.ton.chain.workchain.v0\"]}","init":{"kind":"direct","args":[{"name":"key","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"walletId","type":{"kind":"simple","type":"int","optional":false,"format":257}}],"prefix":{"bits":1,"value":0},"deployment":{"kind":"system-cell","system":"te6cckECGwEAA9gAAQHAAQEFoHL9AgEU/wD0pBP0vPLICwMCAWISBAIBIA0FAgEgDAYCAUgIBwB1sm7jQ1aXBmczovL1FtUWhOUzFuQ05FRzRRSHRYMkxZN1RxdlU3WjExRXVQOEJXZ2dlZ0dqcGtGYkOCACAWIKCQAPpX3aiaGkAAMCD6SVtnm2eNhjGQsAAiAAlbu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcJ2XTlqzTstzOg6WbZRm6KSAIBahAOAhGwfjbPNs8bDGAZDwACIQIRsyX2zzbPGwxgGREAAiICptAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zzy4ILI+EMBzH8BygBVIFAjyx/L/8s/ye1UGRMC9u2i7fsBloAg1yEwf+BwIddJwh+VMCDXCx/eIMB7jsIw0x8BwHvy4IHUAdAB0x/TB/pAASDXSYEBC7ry4Igg1wsKII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ZlKCkgewogICAgICAgIHNlbGYuc2Vxbm8gPSBzZWxmLnNlcW5vICsgMTsKICAgIH0KCiAgICByZWNlaXZlKCJub3RpZnkiKSB7CiAgICAgICAgc2VsZi5zZXFubyA9IHNlbGYuc2Vxbm8gKyAxOwogICAgfQoKICAgIHJlY2VpdmUoItCh0LvQsNCy0LAg0KPQutGA0LDRl9C90ZYiKSB7CiAgICAgICAgc2VsZi5zZXFubyA9IHNlbGYuc2Vxbm8gKyAxOwogICAgfQoKICAgIHJlY2VpdmUoImR1cGxpY2F0ZSIpIHsKICAgICAgICAvLyBDcmVhdGUgbmV3IHdhbGxldAogICAgICAgIGxldCB3YWxsZXRJbml0OiBTdGF0ZUluaXQgPSBpbml0T2YgV2FsbGV0KHNlbGYua2V5LCBzZWxmLndhbGxldElkICsgMSk7CiAgICB9CgogICAgYm91bmNlZChtc2c6IFNsaWNlKSB7CiAgICAgICAgLy8gVE9ETzogSGFuZGxlCiAgICB9IAoKICAgIGdldCBmdW4gcHVibGljS2V5KCk6IEludCB7CiAgICAgICAgcmV0dXJuIHNlbGYua2V5OwogICAgfQoKICAgIGdldCBmdW4gd2FsbGV0SWQoKTogSW50IHsKICAgICAgICByZXR1cm4gc2VsZi53YWxsZXRJZDsKICAgIH0KCiAgICBnZXQgZnVuIHNlcW5vKCk6IEludCB7CiAgICAgICAgcmV0dXJuIHNlbGYuc2Vxbm87CiAgICB9Cn0="},"compiler":{"name":"tact","version":"invalid","parameters":"{\"entrypoint\":\"./examples/wallet.tact\",\"options\":{}}"}} \ No newline at end of file +{"name":"Wallet","code":"te6ccgECGQEAA84AART/APSkE/S88sgLAQIBYgIDAqbQAdDTAwFxsKMB+kABINdJgQELuvLgiCDXCwoggQT/uvLQiYMJuvLgiFRQUwNvBPhhAvhi2zxVEts88uCCyPhDAcx/AcoAVSBQI8sfy//LP8ntVBYEAgEgCgsC9u2i7fsBloAg1yEwf+BwIddJwh+VMCDXCx/eIMB7jsIw0x8BwHvy4IHUAdAB0x/T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EcFk=","abi":"{\"name\":\"Wallet\",\"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\":\"Transfer\",\"header\":null,\"fields\":[{\"name\":\"seqno\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":32}},{\"name\":\"mode\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":8}},{\"name\":\"to\",\"type\":{\"kind\":\"simple\",\"type\":\"address\",\"optional\":false}},{\"name\":\"amount\",\"type\":{\"kind\":\"simple\",\"type\":\"uint\",\"optional\":false,\"format\":\"coins\"}},{\"name\":\"body\",\"type\":{\"kind\":\"simple\",\"type\":\"cell\",\"optional\":true}}]},{\"name\":\"TransferMessage\",\"header\":123,\"fields\":[{\"name\":\"signature\",\"type\":{\"kind\":\"simple\",\"type\":\"slice\",\"optional\":false}},{\"name\":\"transfer\",\"type\":{\"kind\":\"simple\",\"type\":\"Transfer\",\"optional\":false}}]}],\"receivers\":[{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"Deploy\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"typed\",\"type\":\"TransferMessage\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"any\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"empty\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"notify\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"你好ж\"}},{\"receiver\":\"internal\",\"message\":{\"kind\":\"text\",\"text\":\"duplicate\"}}],\"getters\":[{\"name\":\"publicKey\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"walletId\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}},{\"name\":\"seqno\",\"arguments\":[],\"returnType\":{\"kind\":\"simple\",\"type\":\"int\",\"optional\":false,\"format\":257}}],\"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\"},\"137\":{\"message\":\"Masterchain support is not enabled for this contract\"},\"17654\":{\"message\":\"Invalid seqno\"},\"48401\":{\"message\":\"Invalid signature\"}},\"interfaces\":[\"org.ton.introspection.v0\",\"org.ton.abi.ipfs.v0\",\"org.ton.deploy.lazy.v0\",\"org.ton.chain.workchain.v0\"]}","init":{"kind":"direct","args":[{"name":"key","type":{"kind":"simple","type":"int","optional":false,"format":257}},{"name":"walletId","type":{"kind":"simple","type":"int","optional":false,"format":257}}],"prefix":{"bits":1,"value":0},"deployment":{"kind":"system-cell","system":"te6cckECGwEAA9gAAQHAAQEFoHL9AgEU/wD0pBP0vPLICwMCAWISBAIBIA0FAgEgDAYCAUgIBwB1sm7jQ1aXBmczovL1FtUWhOUzFuQ05FRzRRSHRYMkxZN1RxdlU3WjExRXVQOEJXZ2dlZ0dqcGtGYkOCACAWIKCQAPpX3aiaGkAAMCD6SVtnm2eNhjGQsAAiAAlbu9GCcFzsPV0srnsehOw51kqFG2aCcJ3WNS0rZHyzItOvLf3xYjmCcCBVwBuAZ2OUzlg6rkclssOCcJ2XTlqzTstzOg6WbZRm6KSAIBahAOAhGwfjbPNs8bDGAZDwACIQIRsyX2zzbPGwxgGREAAiICptAB0NMDAXGwowH6QAEg10mBAQu68uCIINcLCiCBBP+68tCJgwm68uCIVFBTA28E+GEC+GLbPFUS2zzy4ILI+EMBzH8BygBVIFAjyx/L/8s/ye1UGRMC9u2i7fsBloAg1yEwf+BwIddJwh+VMCDXCx/eIMB7jsIw0x8BwHvy4IHUAdAB0x/TB/pAASDXSYEBC7ry4Igg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ZWNlaXZlKCkgewogICAgICAgIHNlbGYuc2Vxbm8gPSBzZWxmLnNlcW5vICsgMTsKICAgIH0KCiAgICByZWNlaXZlKCJub3RpZnkiKSB7CiAgICAgICAgc2VsZi5zZXFubyA9IHNlbGYuc2Vxbm8gKyAxOwogICAgfQoKICAgIHJlY2VpdmUoItCh0LvQsNCy0LAg0KPQutGA0LDRl9C90ZYiKSB7CiAgICAgICAgc2VsZi5zZXFubyA9IHNlbGYuc2Vxbm8gKyAxOwogICAgfQoKICAgIHJlY2VpdmUoImR1cGxpY2F0ZSIpIHsKICAgICAgICAvLyBDcmVhdGUgbmV3IHdhbGxldAogICAgICAgIGxldCB3YWxsZXRJbml0OiBTdGF0ZUluaXQgPSBpbml0T2YgV2FsbGV0KHNlbGYua2V5LCBzZWxmLndhbGxldElkICsgMSk7CiAgICB9CgogICAgYm91bmNlZChtc2c6IFNsaWNlKSB7CiAgICAgICAgLy8gVE9ETzogSGFuZGxlCiAgICB9IAoKICAgIGdldCBmdW4gcHVibGljS2V5KCk6IEludCB7CiAgICAgICAgcmV0dXJuIHNlbGYua2V5OwogICAgfQoKICAgIGdldCBmdW4gd2FsbGV0SWQoKTogSW50IHsKICAgICAgICByZXR1cm4gc2VsZi53YWxsZXRJZDsKICAgIH0KCiAgICBnZXQgZnVuIHNlcW5vKCk6IEludCB7CiAgICAgICAgcmV0dXJuIHNlbGYuc2Vxbm87CiAgICB9Cn0="},"compiler":{"name":"tact","version":"invalid","parameters":"{\"entrypoint\":\"./examples/wallet.tact\",\"options\":{}}"}} \ No newline at end of file diff --git a/examples/output/wallet_Wallet.ts b/examples/output/wallet_Wallet.ts index 9286725ea..edd5ffe8a 100644 --- a/examples/output/wallet_Wallet.ts +++ b/examples/output/wallet_Wallet.ts @@ -1,18 +1,18 @@ -import { +import { Cell, - Slice, - Address, - Builder, - beginCell, - ComputeError, - TupleItem, - TupleReader, - Dictionary, - contractAddress, - ContractProvider, - Sender, - Contract, - ContractABI, + Slice, + Address, + Builder, + beginCell, + ComputeError, + TupleItem, + TupleReader, + Dictionary, + contractAddress, + ContractProvider, + Sender, + Contract, + ContractABI, ABIType, ABIGetter, ABIReceiver, @@ -371,27 +371,27 @@ const Wallet_receivers: ABIReceiver[] = [ {"receiver":"internal","message":{"kind":"any"}}, {"receiver":"internal","message":{"kind":"empty"}}, {"receiver":"internal","message":{"kind":"text","text":"notify"}}, - {"receiver":"internal","message":{"kind":"text","text":"Слава Україні"}}, + {"receiver":"internal","message":{"kind":"text","text":"你好ж"}}, {"receiver":"internal","message":{"kind":"text","text":"duplicate"}}, ] export class Wallet implements Contract { - + static async init(key: bigint, walletId: bigint) { return await Wallet_init(key, walletId); } - + static async fromInit(key: bigint, walletId: bigint) { const init = await Wallet_init(key, walletId); const address = contractAddress(0, init); return new Wallet(address, init); } - + static fromAddress(address: Address) { return new Wallet(address); } - - readonly address: Address; + + readonly address: Address; readonly init?: { code: Cell, data: Cell }; readonly abi: ContractABI = { types: Wallet_types, @@ -399,14 +399,14 @@ export class Wallet implements Contract { receivers: Wallet_receivers, errors: Wallet_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: 'Deploy' | TransferMessage | Slice | null | 'notify' | 'Слава Україні' | 'duplicate') { - + + async send(provider: ContractProvider, via: Sender, args: { value: bigint, bounce?: boolean| null | undefined }, message: 'Deploy' | TransferMessage | Slice | null | 'notify' | '你好ж' | 'duplicate') { + let body: Cell | null = null; if (message === 'Deploy') { body = beginCell().storeUint(0, 32).storeStringTail(message).endCell(); @@ -423,37 +423,37 @@ export class Wallet implements Contract { if (message === 'notify') { body = beginCell().storeUint(0, 32).storeStringTail(message).endCell(); } - if (message === 'Слава Україні') { + if (message === '你好ж') { body = beginCell().storeUint(0, 32).storeStringTail(message).endCell(); } if (message === 'duplicate') { body = beginCell().storeUint(0, 32).storeStringTail(message).endCell(); } if (body === null) { throw new Error('Invalid message type'); } - + await provider.internal(via, { ...args, body: body }); - + } - + async getPublicKey(provider: ContractProvider) { let builder = new TupleBuilder(); let source = (await provider.get('publicKey', builder.build())).stack; let result = source.readBigNumber(); return result; } - + async getWalletId(provider: ContractProvider) { let builder = new TupleBuilder(); let source = (await provider.get('walletId', builder.build())).stack; let result = source.readBigNumber(); return result; } - + async getSeqno(provider: ContractProvider) { let builder = new TupleBuilder(); let source = (await provider.get('seqno', builder.build())).stack; let result = source.readBigNumber(); return result; } - + } \ No newline at end of file diff --git a/examples/wallet.tact b/examples/wallet.tact index 92dd0c78a..5513c6983 100644 --- a/examples/wallet.tact +++ b/examples/wallet.tact @@ -12,11 +12,11 @@ message(123) TransferMessage { } contract Wallet { - + seqno: Int as uint32 = 0; key: Int as uint256; walletId: Int as uint64; - + init(key: Int, walletId: Int) { self.key = key; self.walletId = walletId; @@ -24,7 +24,7 @@ contract Wallet { receive("Deploy") { // Do nothing - } + } receive(msg: TransferMessage) { @@ -52,7 +52,7 @@ contract Wallet { self.seqno = self.seqno + 1; } - receive("Слава Україні") { + receive("你好ж") { self.seqno = self.seqno + 1; } @@ -63,7 +63,7 @@ contract Wallet { bounced(msg: Slice) { // TODO: Handle - } + } get fun publicKey(): Int { return self.key;