{"id":354273,"date":"2024-05-20T22:45:17","date_gmt":"2024-05-20T22:45:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=354273"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=354273","title":{"rendered":"<span>\u041f\u0438\u0448\u0435\u043c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0432 TON \u0438 onchain \u0442\u0435\u0441\u0442\u044b \u043a \u043d\u0435\u043c\u0443<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0434\u043b\u044f \u0441\u0435\u0442\u0438 TON(\u043e\u043d \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439), \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e onchain-\u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u042d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u0443\u0440\u0441\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0443 TON \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/romanovichim\/TonFunClessons_ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/u><\/a>.<\/p>\n<h3>\u041f\u0440\u043e TON<\/h3>\n<p>TON \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Actor_model\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0435\u043b\u044c \u0430\u043a\u0442\u043e\u0440\u0430<\/a> &#8212; \u044d\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 TON. \u0412 \u043d\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 TON \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u0431\u044b \u043e\u0431\u0449\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>op<\/code>. <code>op<\/code> &#8212; 32-\u0431\u0438\u0442\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 <code>op<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0447\u0435\u043c \u043c\u044b \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.<\/p>\n<p>\u0421\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0430\u0442-\u0431\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 internal \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e internal \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c reply.<\/p>\n<h3>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442<\/h3>\n<h4>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/h4>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib\" rel=\"noopener noreferrer nofollow\">\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 TVM (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b TON), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\"; <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434<code>recv_internal()<\/code><\/p>\n<pre><code class=\"typescript\">() recv_internal()  {  } <\/code><\/pre>\n<h4>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043c\u043e\u0433\u043b\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0441\u0435\u0442\u0438 TON?<\/p>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441  \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/tvm.pdf\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b TON &#8212; TVM<\/a>, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0441\u0447\u0435\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0446\u0435\u043f\u043e\u0447\u0435\u043a TON \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043e\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u043e 5 \u044d\u0442\u0430\u043f\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/tvm_overview?id=transactions-and-phases\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <strong>Compute phase<\/strong>. \u0410 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0447\u0442\u043e &#171;\u0432 \u0441\u0442\u0435\u043a\u0435&#187; \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/tvm_overview?id=initialization-of-tvm\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>:<\/p>\n<p>5 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430(\u0432 \u043d\u0430\u043d\u043e\u0422\u043e\u043d\u0430\u0445)<\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u043d\u043e\u0422\u043e\u043d\u0430\u0445)<\/p>\n<\/li>\n<li>\n<p>\u042f\u0447\u0435\u0439\u043a\u0430 \u0441 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043b\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u0438\u043f \u0441\u043b\u0430\u0439\u0441<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0434\u043b\u044f recv_internal \u044d\u0442\u043e 0)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"typescript\">() recv_internal(int balance, int msg_value, cell in_msg_full, slice in_msg_body)  {  } <\/code><\/pre>\n<p>\u041d\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b <code>recv_internal()<\/code>. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 <code>recv_internal()<\/code>, \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043a\u043e\u0434\u0443 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445. \u0422\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u0434 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430 \u0434\u043d\u0435 \u0441\u0442\u0435\u043a\u0430, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0435. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e  \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u044d\u0442\u043e:<\/p>\n<pre><code class=\"typescript\">() recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {  } <\/code><\/pre>\n<h4>\u0413\u0430\u0437 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h4>\n<p>\u041d\u0430\u0448\u0435\u043c\u0443 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0430\u0437 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441 \u043a\u0430\u043a\u0438\u043c msg_value \u043f\u0440\u0438\u0448\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 ( \u043c\u0435\u043d\u044c\u0448\u0435 0.01 TON) \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>return()<\/code>.<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }    } <\/code><\/pre>\n<h4>\u0414\u043e\u0441\u0442\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043d\u0430\u043c \u0435\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0443 <code>in_msg<\/code>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0443 \u0432 \u0441\u043b\u0430\u0439\u0441 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>begin_parse<\/code>:<\/p>\n<pre><code class=\"typescript\">var cs = in_msg_full.begin_parse(); <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e &#171;\u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c&#187; \u0434\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 slice. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>load_uint<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 FunC  \u043e\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e n-\u0431\u0438\u0442 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430 \u0438\u0437 \u0441\u043b\u0430\u0439\u0441\u0430, &#171;\u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c&#187; \u0444\u043b\u0430\u0433\u0438.<\/p>\n<pre><code class=\"typescript\">var flags = cs~load_uint(4); <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430 \u0444\u043b\u0430\u0433\u0430\u0445, \u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/tblkch.pdf\" rel=\"noopener noreferrer nofollow\">3.1.7<\/a>.<\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0430\u0434\u0440\u0435\u0441. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>load_msg_addr()<\/code> &#8212; \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0437 \u0441\u043b\u0430\u0439\u0441\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c MsgAddress.<\/p>\n<pre><code class=\"typescript\">slice sender_address = cs~load_msg_addr();  <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"smalltalk\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();   } <\/code><\/pre>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0421 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/messages?id=message-layout\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c &#8212; message layout<\/a>. \u041d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438\u0437 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/messages?id=sending-messages\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a>:<\/p>\n<pre><code class=\"typescript\"> var msg = begin_cell() .store_uint(0x18, 6) .store_slice(addr) .store_coins(amount) .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1) .store_slice(message_body)   .end_cell(); <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 FunC<\/a>. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#171;\u043e\u0431\u0435\u0440\u0442\u043a\u0438&#187; \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 Builder (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430). \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<ul>\n<li>\n<p><code>begin_cell()<\/code>  &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442 Builder \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u044f\u0447\u0435\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p> <code>end_cell()<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442 Cell (\u044f\u0447\u0435\u0439\u043a\u0443)<\/p>\n<\/li>\n<li>\n<p> <code>store_uint<\/code> &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 uint \u0432 Builder<\/p>\n<\/li>\n<li>\n<p> <code>store_slice<\/code> &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043b\u0430\u0439\u0441 \u0432 Builder<\/p>\n<\/li>\n<li>\n<p> <code>store_coins<\/code>&#8212; \u0437\u0434\u0435\u0441\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443  <code>store_grams<\/code> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f TonCoins. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=store_grams\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h4>Message body<\/h4>\n<p>\u0412 \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c <code>op<\/code> \u0438 \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>reply<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>slice<\/code>.<\/p>\n<pre><code class=\"typescript\">slice msg_text = \"reply\"; <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445 \u043e \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0435\u0441\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>op<\/code>, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u0442\u0438, \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435(\u0441\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f) \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e  \u0444\u043b\u0430\u0433\u0430 <code>op<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442.<\/p>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>op<\/code> \u0440\u0430\u0432\u043d\u044b\u0439 0.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();     slice msg_text = \"reply\";     cell msg = begin_cell()   .store_uint(0x18, 6)   .store_slice(sender_address)   .store_coins(100)    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)   .store_uint(0, 32)   .store_slice(msg_text)    .end_cell();  } <\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0435\u0433\u043e.<\/p>\n<h3>\u0420\u0435\u0436\u0438\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f(mode)<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f  <code>send_raw_message<\/code> \u0438\u0437 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=send_raw_message\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e msg \u043c\u044b \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043b\u0438, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f <code>mode<\/code>. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0435 \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=send_raw_message\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u041c\u044b \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435.<\/p>\n<p>\u041f\u0443\u0441\u043a\u0430\u0439 \u043d\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 100 \u043c\u043e\u043d\u0435\u0442 \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c internal message c 60 \u043c\u043e\u043d\u0435\u0442\u0430\u043c\u0438 \u0438 \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 10, \u043e\u0431\u0449\u0438\u0439 fee 3.<\/p>\n<p><code>mode = 0<\/code>  &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100+60-10 = 150 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c(10-3 = 7 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 1<\/code>  &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100+60-10-3 = 147 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c(10 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 64<\/code> &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100-10 = 90 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (60+10-3 = 67 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 65<\/code> &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100-10-3=87 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (60+10 = 70 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 128<\/code> -\u0431\u0430\u043b\u0430\u043d\u0441 (0 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (100+60-3 = 157 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c <code>mode<\/code>, \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e <a href=\"https:\/\/docs.ton.org\/develop\/smart-contracts\/messages#message-modes\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<ul>\n<li>\n<p>\u041c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 mode 0.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044e \u0437\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0437\u043d\u0430\u0447\u0438\u0442 +1.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 action phase, \u0437\u043d\u0430\u0447\u0438\u0442 +2.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <code>mode<\/code> == 3, \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442:<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();     slice msg_text = \"reply\";     cell msg = begin_cell()   .store_uint(0x18, 6)   .store_slice(sender_address)   .store_coins(100)    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)   .store_uint(0, 32)   .store_slice(msg_text)    .end_cell();    send_raw_message(msg, 3); } <\/code><\/pre>\n<h3>hexBoC<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 hexBo\u0421, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u043b\u0430.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c <code>main.fc<\/code> \u0432 <code>chatbot.fc<\/code> \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 <code>compile.ts<\/code>:<\/p>\n<pre><code class=\"typescript\">import * as fs from \"fs\"; import { readFileSync } from \"fs\"; import process from \"process\"; import { Cell } from \"ton-core\"; import { compileFunc } from \"@ton-community\/func-js\";  async function compileScript() {  const compileResult = await compileFunc({ targets: [\".\/contracts\/chatbot.fc\"],  sources: (path) => readFileSync(path).toString(\"utf8\"), });  if (compileResult.status ===\"error\") { console.log(\"Error happend\"); process.exit(1); }  const hexBoC = 'build\/main.compiled.json';  fs.writeFileSync( hexBoC, JSON.stringify({ hex: Cell.fromBoc(Buffer.from(compileResult.codeBoc,\"base64\"))[0] .toBoc() .toString(\"hex\"), })  );  console.log(\"Compiled, hexBoC:\"+hexBoC);  }  compileScript(); <\/code><\/pre>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>yarn compile<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c <code>hexBoC<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0442\u0435\u0441\u0442\u0430\u043c<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f<\/h3>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d, \u043a\u0430\u0440\u043a\u0430\u0441 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b <code>main.spec.ts<\/code> \u0438 \u0443\u0434\u0430\u043b\u0438\u043c \u043e\u0442\u0442\u0443\u0434\u0430, \u0432\u0441\u0435 \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f GET \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"typescript\">import { Cell, Address, toNano } from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { Blockchain } from \"@ton-community\/sandbox\"; import { MainContract } from \"..\/wrappers\/MainContract\"; import { send } from \"process\"; import \"@ton-community\/test-utils\";  describe(\"test tests\", () => { it(\"test of test\", async() => { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0];  const blockchain = await Blockchain.create();  const myContract = blockchain.openContract( await MainContract.createFromConfig({}, codeCell) );  const senderWallet = await blockchain.treasury(\"sender\");  const sentMessageResult = await myContract.sendInternalMessage(senderWallet.getSender(),toNano(\"0.05\"));  expect(sentMessageResult.transactions).toHaveTransaction({ from: senderWallet.address, to: myContract.address, success: true, });  }); }); <\/code><\/pre>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0432 \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u041f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u044d\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0443 <code>sentMessageResult.transactions<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 raw \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>flattenTransaction<\/code> \u0438\u0437 <code>@ton-community\/test-utils<\/code>:<\/p>\n<pre><code class=\"typescript\">import { Cell, Address, toNano } from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { Blockchain } from \"@ton-community\/sandbox\"; import { MainContract } from \"..\/wrappers\/MainContract\"; import { send } from \"process\"; import \"@ton-community\/test-utils\"; import { flattenTransaction } from \"@ton-community\/test-utils\";    describe(\"msg test\", () => { it(\"test\", async() => { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0];  const blockchain = await Blockchain.create();  const myContract = blockchain.openContract( await MainContract.createFromConfig({}, codeCell) );  const senderWallet = await blockchain.treasury(\"sender\");  const sentMessageResult = await myContract.sendInternalMessage(senderWallet.getSender(),toNano(\"0.05\"));  expect(sentMessageResult.transactions).toHaveTransaction({ from: senderWallet.address, to: myContract.address, success: true, });  const arr = sentMessageResult.transactions.map(tx => flattenTransaction(tx)); console.log(arr)   }); }); <\/code><\/pre>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u043d\u0430\u0448 \u0447\u0430\u0442-\u0431\u043e\u0442, \u0440\u0430\u0432\u043d\u043e reply.<\/p>\n<p>\u0421\u043e\u0431\u0435\u0440\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0432 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435.<\/p>\n<pre><code>let reply = beginCell().storeUint(0, 32).storeStringTail(\"reply\").endCell(); <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0435\u0441\u0442\u044c:<\/p>\n<pre><code class=\"typescript\">import { Cell, Address, toNano, beginCell } from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { Blockchain } from \"@ton-community\/sandbox\"; import { MainContract } from \"..\/wrappers\/MainContract\"; import { send } from \"process\"; import \"@ton-community\/test-utils\"; import { flattenTransaction } from \"@ton-community\/test-utils\";    describe(\"msg test\", () => { it(\"test\", async() => { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0];  const blockchain = await Blockchain.create();  const myContract = blockchain.openContract( await MainContract.createFromConfig({}, codeCell) );  const senderWallet = await blockchain.treasury(\"sender\");  const sentMessageResult = await myContract.sendInternalMessage(senderWallet.getSender(),toNano(\"0.05\"));  expect(sentMessageResult.transactions).toHaveTransaction({ from: senderWallet.address, to: myContract.address, success: true, });  \/\/const arr = sentMessageResult.transactions.map(tx => flattenTransaction(tx));  let reply = beginCell().storeUint(0, 32).storeStringTail(\"reply\").endCell();  expect(sentMessageResult.transactions).toHaveTransaction({ body: reply, from: myContract.address, to: senderWallet.address });  }); }); <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>yarn test<\/code> \u0438 \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043a\u0430\u043a \u0432 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430.<\/p>\n<h3>Onchain \u0442\u0435\u0441\u0442\u044b<\/h3>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0430\u0448\u0438\u0445 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438(\u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e). \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <code>scripts<\/code> \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>onchain.ts<\/code>, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 <code>package.json<\/code> <code>\"onchain\": \"ts-node .\/scripts\/onchain.ts\"<\/code>:<\/p>\n<pre><code>  \"scripts\": { \"compile\": \"ts-node .\/scripts\/compile.ts\", \"test\": \"yarn jest\", \"deploy\": \"yarn compile &amp;&amp; ts-node .\/scripts\/deploy.ts\", \"onchain\": \"ts-node .\/scripts\/onchain.ts\"   }, <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"typescript\">import { Cell, beginCell, contractAddress, toNano} from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { TonClient } from \"ton\";  async function onchainScript() { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0]; const dataCell = new Cell();  const address = contractAddress(0,{ code: codeCell, data: dataCell, });  console.log(\"Address: \",address)  } <\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u043d\u0430\u043c \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 QR \u043a\u043e\u0434 \u0432 \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0438 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0441\u0435\u0442\u0438.<\/p>\n<blockquote>\n<p>\u042d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0441\u0443\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443.<\/p>\n<\/blockquote>\n<p>\u0421\u043e\u0431\u0435\u0440\u0435\u043c QR \u043a\u043e\u0434, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 Tonkeeper. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e TON \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0435.<\/p>\n<pre><code class=\"typescript\">import { Cell, beginCell, contractAddress, toNano} from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { TonClient } from \"ton\"; import qs from \"qs\"; import qrcode from \"qrcode-terminal\";  async function onchainScript() { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0]; const dataCell = new Cell();  const address = contractAddress(0,{ code: codeCell, data: dataCell, });  console.log(\"Address: \",address)  let transactionLink = 'https:\/\/app.tonkeeper.com\/transfer\/' + address.toString({ testOnly: true, }) + \"?\" + qs.stringify({ text: \"Sent simple in\", amount: toNano(\"0.6\").toString(10), });  console.log(\"Transaction link:\",transactionLink);   qrcode.generate(transactionLink, {small: true }, (qr) => { console.log(qr); });  }  onchainScript(); <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e ADNL \u043e\u0442 Liteservers, \u043d\u043e \u043e ADNL \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f API TON \u0446\u0435\u043d\u0442\u0440\u0430.<\/p>\n<pre><code class=\"typescript\">const API_URL = \"https:\/\/testnet.toncenter.com\/api\/v2\" <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Http-\u043a\u043b\u0438\u0435\u043d\u0442 <a href=\"https:\/\/axios-http.com\/ru\/docs\/intro\" rel=\"noopener noreferrer nofollow\">axios<\/a>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c: <code>yarn add axios<\/code>.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Toncenter, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d getTransactions c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c limit 1, \u0442.\u0435. \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0434\u0432\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"typescript\">\/\/ axios http client \/\/ yarn add axios async function getData(url: string): Promise&lt;any> { try {   const config: AxiosRequestConfig = { url: url, method: \"get\",   };   const response: AxiosResponse = await axios(config);   \/\/console.log(response)   return response.data.result; } catch (error) {   console.error(error);   throw error; }   }  async function getTransactions(address: String) {   var transactions;   try { transactions = await getData(   `${API_URL}\/getTransactions?address=${address}&amp;limit=1` );   } catch (e) { console.error(e);   }   return transactions; } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c API, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/API\/setInterval\" rel=\"noopener noreferrer nofollow\">SetInterval<\/a>:<\/p>\n<pre><code class=\"typescript\">import { Cell, beginCell, contractAddress, toNano} from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { TonClient } from \"ton\"; import qs from \"qs\"; import qrcode from \"qrcode-terminal\"; import axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";   const API_URL = \"https:\/\/testnet.toncenter.com\/api\/v2\"  \/\/ axios http client \/\/ yarn add axios async function getData(url: string): Promise&lt;any> { try {   const config: AxiosRequestConfig = { url: url, method: \"get\",   };   const response: AxiosResponse = await axios(config);   \/\/console.log(response)   return response.data.result; } catch (error) {   console.error(error);   throw error; }   }  async function getTransactions(address: String) {   var transactions;   try { transactions = await getData(   `${API_URL}\/getTransactions?address=${address}&amp;limit=1` );   } catch (e) { console.error(e);   }   return transactions; }  async function onchainScript() { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0]; const dataCell = new Cell();  const address = contractAddress(0,{ code: codeCell, data: dataCell, });   console.log(\"Address: \",address)  let transactionLink = 'https:\/\/app.tonkeeper.com\/transfer\/' + address.toString({ testOnly: true, }) + \"?\" + qs.stringify({ text: \"Sent simple in\", amount: toNano(\"0.6\").toString(10), \/\/bin: beginCell().storeUint(1,32).endCell().toBoc({idx: false}).toString(\"base64\"), });  console.log(\"Transaction link:\",transactionLink);   qrcode.generate(transactionLink, {small: true }, (qr) => { console.log(qr); });  setInterval(async () => { const txes = await getTransactions(address.toString()); if(txes[0].in_msg.source === \"EQCj2gVRdFS0qOZnUFXdMliONgSANYXfQUDMsjd8fbTW-RuC\") {  }  },10000)   }  onchainScript(); <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e API \u043e\u0442\u0434\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e IN \u043f\u0440\u0438\u0448\u043b\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430(\u0437\u0434\u0435\u0441\u044c \u044f \u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u043b) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435(\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u043e\u0434 QR), \u0430 \u0432 OUT \u0432\u044b\u0432\u0435\u0441\u0442\u0438 c\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0434\u0430\u0442\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"typescript\">import { Cell, beginCell, contractAddress, toNano} from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { TonClient } from \"ton\"; import qs from \"qs\"; import qrcode from \"qrcode-terminal\"; import axios, { AxiosRequestConfig, AxiosResponse } from \"axios\";   const API_URL = \"https:\/\/testnet.toncenter.com\/api\/v2\"  \/\/ axios http client \/\/ yarn add axios async function getData(url: string): Promise&lt;any> { try {   const config: AxiosRequestConfig = { url: url, method: \"get\",   };   const response: AxiosResponse = await axios(config);   \/\/console.log(response)   return response.data.result; } catch (error) {   console.error(error);   throw error; }   }  async function getTransactions(address: String) {   var transactions;   try { transactions = await getData(   `${API_URL}\/getTransactions?address=${address}&amp;limit=1` );   } catch (e) { console.error(e);   }   return transactions; }  async function onchainScript() { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0]; const dataCell = new Cell();  const address = contractAddress(0,{ code: codeCell, data: dataCell, });   console.log(\"Address: \",address)  let transactionLink = 'https:\/\/app.tonkeeper.com\/transfer\/' + address.toString({ testOnly: true, }) + \"?\" + qs.stringify({ text: \"Sent simple in\", amount: toNano(\"0.6\").toString(10), \/\/bin: beginCell().storeUint(1,32).endCell().toBoc({idx: false}).toString(\"base64\"), });  console.log(\"Transaction link:\",transactionLink);   qrcode.generate(transactionLink, {small: true }, (qr) => { console.log(qr); });  setInterval(async () => { const txes = await getTransactions(address.toString()); if(txes[0].in_msg.source === \"EQCj2gVRdFS0qOZnUFXdMliONgSANYXfQUDMsjd8fbTW-RuC\") {              console.log(\"Last tx: \" + new Date(txes[0].utime * 1000))             console.log(\"IN from: \"+ txes[0].in_msg.source+\" with msg: \"+ txes[0].in_msg.message)             console.log(\"OUT from: \"+ txes[0].out_msgs[0].source +\" with msg: \"+ txes[0].out_msgs[0].message) }  },10000)   }  onchainScript(); <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>yarn onchain<\/code>, \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c QR, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0438 \u0436\u0434\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0434\u0435\u0442 \u043d\u0430\u0448\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e <a href=\"https:\/\/t.me\/ton_learn\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043d\u043e\u0432\u044b\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0442\u043c\u044b\u0432\u043e\u0447\u043d\u044b\u0435 \u0441\u0434\u0435\u043b\u043a\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u0430\u0448\u0435\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/759592\/\"> https:\/\/habr.com\/ru\/articles\/759592\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0430\u0442-\u0431\u043e\u0442 \u0434\u043b\u044f \u0441\u0435\u0442\u0438 TON(\u043e\u043d \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439), \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e onchain-\u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u042d\u0442\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u0443\u0440\u0441\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043f\u043e \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0443 TON \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/romanovichim\/TonFunClessons_ru\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/u><\/a>.<\/p>\n<h3>\u041f\u0440\u043e TON<\/h3>\n<p>TON \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Actor_model\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0435\u043b\u044c \u0430\u043a\u0442\u043e\u0440\u0430<\/a> &#8212; \u044d\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0435\u0436\u0438\u0442 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 TON. \u0412 \u043d\u0435\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>\u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 TON \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0430\u043a \u0431\u044b \u043e\u0431\u0449\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>op<\/code>. <code>op<\/code> &#8212; 32-\u0431\u0438\u0442\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 <code>op<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0447\u0435\u043c \u043c\u044b \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0438 \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f.<\/p>\n<p>\u0421\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0447\u0430\u0442-\u0431\u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 internal \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e internal \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c reply.<\/p>\n<h3>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442<\/h3>\n<h4>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/h4>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib\" rel=\"noopener noreferrer nofollow\">\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 TVM (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b TON), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\"; <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434<code>recv_internal()<\/code><\/p>\n<pre><code class=\"typescript\">() recv_internal()  {  } <\/code><\/pre>\n<h4>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 &#8212; \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043c\u043e\u0433\u043b\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0441\u0435\u0442\u0438 TON?<\/p>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441  \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/tvm.pdf\" rel=\"noopener noreferrer nofollow\">\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b TON &#8212; TVM<\/a>, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0441\u0447\u0435\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0446\u0435\u043f\u043e\u0447\u0435\u043a TON \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043e\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u043e 5 \u044d\u0442\u0430\u043f\u043e\u0432. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/tvm_overview?id=transactions-and-phases\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <strong>Compute phase<\/strong>. \u0410 \u0435\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435, \u0447\u0442\u043e &#171;\u0432 \u0441\u0442\u0435\u043a\u0435&#187; \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439, \u0432\u044b\u0437\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/tvm_overview?id=initialization-of-tvm\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>:<\/p>\n<p>5 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430(\u0432 \u043d\u0430\u043d\u043e\u0422\u043e\u043d\u0430\u0445)<\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u043d\u043e\u0422\u043e\u043d\u0430\u0445)<\/p>\n<\/li>\n<li>\n<p>\u042f\u0447\u0435\u0439\u043a\u0430 \u0441 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043b\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u0438\u043f \u0441\u043b\u0430\u0439\u0441<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0434\u043b\u044f recv_internal \u044d\u0442\u043e 0)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"typescript\">() recv_internal(int balance, int msg_value, cell in_msg_full, slice in_msg_body)  {  } <\/code><\/pre>\n<p>\u041d\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b <code>recv_internal()<\/code>. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 <code>recv_internal()<\/code>, \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043a\u043e\u0434\u0443 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437 \u043d\u0438\u0445. \u0422\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043e\u0434 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430 \u0434\u043d\u0435 \u0441\u0442\u0435\u043a\u0430, \u0442\u0430\u043a \u0438 \u043d\u0435 \u0442\u0440\u043e\u043d\u0443\u0442\u044b\u0435. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e  \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u044d\u0442\u043e:<\/p>\n<pre><code class=\"typescript\">() recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {  } <\/code><\/pre>\n<h4>\u0413\u0430\u0437 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h4>\n<p>\u041d\u0430\u0448\u0435\u043c\u0443 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0430\u0437 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441 \u043a\u0430\u043a\u0438\u043c msg_value \u043f\u0440\u0438\u0448\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 ( \u043c\u0435\u043d\u044c\u0448\u0435 0.01 TON) \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>return()<\/code>.<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }    } <\/code><\/pre>\n<h4>\u0414\u043e\u0441\u0442\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0442\u043e\u0433\u043e, \u043a\u0442\u043e \u043d\u0430\u043c \u0435\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0443 <code>in_msg<\/code>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u044f\u0447\u0435\u0439\u043a\u0443 \u0432 \u0441\u043b\u0430\u0439\u0441 c \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>begin_parse<\/code>:<\/p>\n<pre><code class=\"typescript\">var cs = in_msg_full.begin_parse(); <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e &#171;\u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c&#187; \u0434\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 slice. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>load_uint<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 FunC  \u043e\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e n-\u0431\u0438\u0442 \u0431\u0435\u0437 \u0437\u043d\u0430\u043a\u0430 \u0438\u0437 \u0441\u043b\u0430\u0439\u0441\u0430, &#171;\u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c&#187; \u0444\u043b\u0430\u0433\u0438.<\/p>\n<pre><code class=\"typescript\">var flags = cs~load_uint(4); <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430 \u0444\u043b\u0430\u0433\u0430\u0445, \u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/tblkch.pdf\" rel=\"noopener noreferrer nofollow\">3.1.7<\/a>.<\/p>\n<p>\u041d\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0430\u0434\u0440\u0435\u0441. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>load_msg_addr()<\/code> &#8212; \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0437 \u0441\u043b\u0430\u0439\u0441\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u043c MsgAddress.<\/p>\n<pre><code class=\"typescript\">slice sender_address = cs~load_msg_addr();  <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"smalltalk\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();   } <\/code><\/pre>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h4>\n<p>\u0421 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/messages?id=message-layout\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c &#8212; message layout<\/a>. \u041d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438\u0437 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/smart-contracts\/messages?id=sending-messages\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a>:<\/p>\n<pre><code class=\"typescript\"> var msg = begin_cell() .store_uint(0x18, 6) .store_slice(addr) .store_coins(amount) .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1) .store_slice(message_body)   .end_cell(); <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 FunC<\/a>. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#171;\u043e\u0431\u0435\u0440\u0442\u043a\u0438&#187; \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 Builder (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u044f\u0447\u0435\u0435\u043a \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430). \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<ul>\n<li>\n<p><code>begin_cell()<\/code>  &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442 Builder \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0439 \u044f\u0447\u0435\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p> <code>end_cell()<\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0441\u0442 Cell (\u044f\u0447\u0435\u0439\u043a\u0443)<\/p>\n<\/li>\n<li>\n<p> <code>store_uint<\/code> &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 uint \u0432 Builder<\/p>\n<\/li>\n<li>\n<p> <code>store_slice<\/code> &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0441\u043b\u0430\u0439\u0441 \u0432 Builder<\/p>\n<\/li>\n<li>\n<p> <code>store_coins<\/code>&#8212; \u0437\u0434\u0435\u0441\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443  <code>store_grams<\/code> &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f TonCoins. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=store_grams\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h4>Message body<\/h4>\n<p>\u0412 \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c <code>op<\/code> \u0438 \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>reply<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>slice<\/code>.<\/p>\n<pre><code class=\"typescript\">slice msg_text = \"reply\"; <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445 \u043e \u0442\u0435\u043b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0435\u0441\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>op<\/code>, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u0442\u0438, \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u044b \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435(\u0441\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u0442\u0435\u043b\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f) \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e  \u0444\u043b\u0430\u0433\u0430 <code>op<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442.<\/p>\n<p>\u041f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <code>op<\/code> \u0440\u0430\u0432\u043d\u044b\u0439 0.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();     slice msg_text = \"reply\";     cell msg = begin_cell()   .store_uint(0x18, 6)   .store_slice(sender_address)   .store_coins(100)    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)   .store_uint(0, 32)   .store_slice(msg_text)    .end_cell();  } <\/code><\/pre>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0435\u0433\u043e.<\/p>\n<h3>\u0420\u0435\u0436\u0438\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f(mode)<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f  <code>send_raw_message<\/code> \u0438\u0437 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=send_raw_message\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e msg \u043c\u044b \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043b\u0438, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f <code>mode<\/code>. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0435 \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/ton-blockchain.github.io\/docs\/#\/func\/stdlib?id=send_raw_message\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u041c\u044b \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435.<\/p>\n<p>\u041f\u0443\u0441\u043a\u0430\u0439 \u043d\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 100 \u043c\u043e\u043d\u0435\u0442 \u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c internal message c 60 \u043c\u043e\u043d\u0435\u0442\u0430\u043c\u0438 \u0438 \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 10, \u043e\u0431\u0449\u0438\u0439 fee 3.<\/p>\n<p><code>mode = 0<\/code>  &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100+60-10 = 150 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c(10-3 = 7 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 1<\/code>  &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100+60-10-3 = 147 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c(10 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 64<\/code> &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100-10 = 90 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (60+10-3 = 67 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 65<\/code> &#8212; \u0431\u0430\u043b\u0430\u043d\u0441 (100-10-3=87 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (60+10 = 70 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p> <code>mode = 128<\/code> -\u0431\u0430\u043b\u0430\u043d\u0441 (0 \u043c\u043e\u043d\u0435\u0442), \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c (100+60-3 = 157 \u043c\u043e\u043d\u0435\u0442)<\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c <code>mode<\/code>, \u043f\u043e\u0439\u0434\u0435\u043c \u043f\u043e <a href=\"https:\/\/docs.ton.org\/develop\/smart-contracts\/messages#message-modes\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>:<\/p>\n<ul>\n<li>\n<p>\u041c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 mode 0.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0438\u0441\u0441\u0438\u044e \u0437\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0437\u043d\u0430\u0447\u0438\u0442 +1.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 action phase, \u0437\u043d\u0430\u0447\u0438\u0442 +2.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <code>mode<\/code> == 3, \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442:<\/p>\n<pre><code class=\"typescript\">#include \"imports\/stdlib.fc\";  () recv_internal(int msg_value, cell in_msg, slice in_msg_body) impure {    if (msg_value &lt; 10000000) { ;; 10000000 nanoton == 0.01 TON return ();   }      slice cs = in_msg.begin_parse();   int flags = cs~load_uint(4);    slice sender_address = cs~load_msg_addr();     slice msg_text = \"reply\";     cell msg = begin_cell()   .store_uint(0x18, 6)   .store_slice(sender_address)   .store_coins(100)    .store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)   .store_uint(0, 32)   .store_slice(msg_text)    .end_cell();    send_raw_message(msg, 3); } <\/code><\/pre>\n<h3>hexBoC<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043d\u0443\u0436\u043d\u043e \u0435\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 hexBo\u0421, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u043b\u0430.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c <code>main.fc<\/code> \u0432 <code>chatbot.fc<\/code> \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0430\u0448 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442.<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u0440\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 <code>compile.ts<\/code>:<\/p>\n<pre><code class=\"typescript\">import * as fs from \"fs\"; import { readFileSync } from \"fs\"; import process from \"process\"; import { Cell } from \"ton-core\"; import { compileFunc } from \"@ton-community\/func-js\";  async function compileScript() {  const compileResult = await compileFunc({ targets: [\".\/contracts\/chatbot.fc\"],  sources: (path) => readFileSync(path).toString(\"utf8\"), });  if (compileResult.status ===\"error\") { console.log(\"Error happend\"); process.exit(1); }  const hexBoC = 'build\/main.compiled.json';  fs.writeFileSync( hexBoC, JSON.stringify({ hex: Cell.fromBoc(Buffer.from(compileResult.codeBoc,\"base64\"))[0] .toBoc() .toString(\"hex\"), })  );  console.log(\"Compiled, hexBoC:\"+hexBoC);  }  compileScript(); <\/code><\/pre>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>yarn compile<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c <code>hexBoC<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0442\u0435\u0441\u0442\u0430\u043c<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0435\u0441\u0442\u044c \u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f<\/h3>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d, \u043a\u0430\u0440\u043a\u0430\u0441 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c, \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b <code>main.spec.ts<\/code> \u0438 \u0443\u0434\u0430\u043b\u0438\u043c \u043e\u0442\u0442\u0443\u0434\u0430, \u0432\u0441\u0435 \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f GET \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code class=\"typescript\">import { Cell, Address, toNano } from \"ton-core\"; import { hex } from \"..\/build\/main.compiled.json\"; import { Blockchain } from \"@ton-community\/sandbox\"; import { MainContract } from \"..\/wrappers\/MainContract\"; import { send } from \"process\"; import \"@ton-community\/test-utils\";  describe(\"test tests\", () => { it(\"test of test\", async() => { const codeCell = Cell.fromBoc(Buffer.from(hex,\"hex\"))[0];  const blockchain = await Blockchain.create();  const myContract = blockchain.openContract( await MainContract.createFromConfig({}, codeCell) );  const senderWallet = await<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-354273","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354273"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354273\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}