-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtonCellobfuscated.js
1 lines (1 loc) · 24 KB
/
tonCellobfuscated.js
1
var _0x5812=['sign','detached','secretKey','keyPair','b83f83508653fcbbaa200a154984414e947ac82864d4673c3bd39b701542fc1e','Wrong\x20contract\x20address','b5ee9c724101030100d60002cf8801707f06a10ca7f9775440142a9308829d28f59050c9a8ce7877a736e02a85f83c118e98fc5fc3412e51120c8fbcdefb69cb83676cef5fdb481a19abd52ec400325eb03c7bda7d9f3982db5b9ed1dd282f6ba9e255012cabbff1ff02b9f2204fdcc1600000001001020084ff0020dda4f260810200d71820d70b1fed44d0d31fd3ffd15112baf2a122f901541044f910f2a2f80001d31f3120d74a96d307d402fb00ded1a4c8cb1fcbffc9ed540048000000008a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c101bc04a','Wrong\x20external\x20message\x20serialization','mul','add','fromSeed','0:b83f83508653fcbbaa200a154984414e947ac82864d4673c3bd39b701542fc1e','toLowerCase','b5ee9c724101020100a50001cf880088391d12a638027cdb2b4483e393731778ebe9fba8677d331ea9065168277a8a06743e250ebbbda3374d962b405db253a4f00a302cc2bcf2cd4fc9fa77d2451c5c2c8d225c1cd245704c5fa3da35c4848739ac0356f86acc6b62e20e8f9b9f5868000000781c01007062005c1fc1a84329fe5dd510050aa4c220a74a3d6414326a339e1de9cdb80aa17e0f21dcd6500000000000000000000000000000544553544f154a2b','Wrong\x20empty\x20cell\x20boc-serialization','B5EE9C7241010101000300000200D367DC41','Wrong\x20<b\x200\x208\x20u,\x20b>\x20cell\x20boc-serialization','B5EE9C72410102010007000102000100024995C5FE15','Wrong\x20\x27<b\x200\x208\x20u,\x20<b\x2073\x208\x20u,\x20b>\x20ref,\x20b>\x27\x20cell\x20boc-serialization','toString','length','push','join','hex\x20string\x20must\x20have\x20length\x20a\x20multiple\x20of\x202','substring','buffer','setUint32','reverse','set','backingArray','from','cursor','get','check_range','bitlength','Bitstring\x20overflow','off','old_forEach','forEach','put_bool','title','search','put_bool_array','put_si_arbitrary','Bitlength\x20is\x20too\x20small\x20for\x20number','isNeg','pow','sub','put_ui_arbitrary','put_ui8','put_array_ui8','put_string','charCodeAt','to_string','top_upped_array','concatenate','actual_bytesize','ceil','copyWithin','slice','get_used_bits','bits','refs','level','is_special','depth','ui8array_depth','floor','concat','descripter1','descripter2','data_with_descriptors','repr','hash','subtle','digest','SHA-256','serialize_for_boc','Cell\x20hashes\x20explicit\x20storing\x20is\x20not\x20implemented','boc_serialization_size','1018','60218acb4ca008','000c','0ffc','min','B5EE9C72','41B0DB7289754FB8E92A83ADF2C9E1E2FF93540FB4C8E81CE30F6847A8064E99','529aca374713077702291562600f59396b29e0c816e709109dc64b072e97f1cc','6efbe97f2a1f483b585f9af75302f3bf41912ced1043a0a2a8957187bf2db07e','675f0cde3a534f29384ce7fbba21777b5df20413dcfffc6467ee6d08f474b910','FF0020DDA4F260810200D71820D70B1FED44D0D31FD3FFD15112BAF2A122F901541044F910F2A2F80001D31F3120D74A96D307D402FB00DED1A4C8CB1FCBFFC9ED54','00000000','publicKey','log','Contract\x20address\x200:'];(function(_0x5eeb35,_0x155fb9){var _0x18fcd9=function(_0x43fbfa){while(--_0x43fbfa){_0x5eeb35['push'](_0x5eeb35['shift']());}};_0x18fcd9(++_0x155fb9);}(_0x5812,0x1ee));var _0x2756=function(_0x174ff6,_0x104bab){_0x174ff6=_0x174ff6-0x0;var _0x3d7efa=_0x5812[_0x174ff6];return _0x3d7efa;};var to_hex_array=[];var to_byte_map={};for(var ord=0x0;ord<=0xff;ord++){var s=ord[_0x2756('0x0')](0x10);if(s[_0x2756('0x1')]<0x2){s='0'+s;}to_hex_array[_0x2756('0x2')](s);to_byte_map[s]=ord;}function bufferToHex2(_0x18de62){var _0xeaaae0=[];for(var _0x461711=0x0;_0x461711<_0x18de62['byteLength'];_0x461711++){_0xeaaae0[_0x2756('0x2')](to_hex_array[_0x18de62[_0x461711]]);}return _0xeaaae0[_0x2756('0x3')]('');}function hexToBuffer(_0x54af75){_0x54af75=_0x54af75['toLowerCase']();var _0xd47a42=_0x54af75[_0x2756('0x1')];if(_0xd47a42%0x2!=0x0){throw _0x2756('0x4');}var _0xf3ae5a=_0xd47a42/0x2;var _0x423e16=new Uint8Array(_0xf3ae5a);for(var _0x5e5465=0x0;_0x5e5465<_0xf3ae5a;_0x5e5465++){var _0x29dcc8=_0x5e5465*0x2;var _0x219c48=_0x54af75[_0x2756('0x5')](_0x29dcc8,_0x29dcc8+0x2);_0x423e16[_0x5e5465]=to_byte_map[_0x219c48];}return _0x423e16;}function string_to_ui8(_0x14623a,_0x2a8afd=0x1){if(_0x2a8afd==0x1){var _0x11f1a6=new ArrayBuffer(_0x14623a[_0x2756('0x1')]);var _0x4ea3ed=new Uint8Array(_0x11f1a6);}if(_0x2a8afd==0x2){var _0x11f1a6=new ArrayBuffer(_0x14623a[_0x2756('0x1')]*0x2);var _0x4ea3ed=new Uint16Array(_0x11f1a6);}if(_0x2a8afd==0x4){var _0x11f1a6=new ArrayBuffer(_0x14623a[_0x2756('0x1')]*0x4);var _0x4ea3ed=new Uint32Array(_0x11f1a6);}for(var _0x54f06f=0x0,_0x141d92=_0x14623a[_0x2756('0x1')];_0x54f06f<_0x141d92;_0x54f06f++){_0x4ea3ed[_0x54f06f]=_0x14623a['charCodeAt'](_0x54f06f);}return new Uint8Array(_0x4ea3ed[_0x2756('0x6')]);}function _crc32c(_0xae904c,_0x178d38){var _0x1bc55d=0x82f63b78;var _0x19bb5e;_0xae904c^=0xffffffff;for(_0x19bb5e=0x0;_0x19bb5e<_0x178d38[_0x2756('0x1')];_0x19bb5e++){_0xae904c^=_0x178d38[_0x19bb5e];_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;_0xae904c=_0xae904c&0x1?_0xae904c>>>0x1^_0x1bc55d:_0xae904c>>>0x1;}return _0xae904c^0xffffffff;}function crc32c(_0x3eb632){var _0xea1666=_crc32c(0x0,_0x3eb632);arr=new ArrayBuffer(0x4);view=new DataView(arr);view[_0x2756('0x7')](0x0,_0xea1666,![]);return new Uint8Array(arr)[_0x2756('0x8')]();}function concat_ui8a(_0x1e9396,_0x45c82e){var _0x49c25c=new Uint8Array(_0x1e9396[_0x2756('0x1')]+_0x45c82e[_0x2756('0x1')]);_0x49c25c[_0x2756('0x9')](_0x1e9396);_0x49c25c[_0x2756('0x9')](_0x45c82e,_0x1e9396[_0x2756('0x1')]);return _0x49c25c;}class bitstring{constructor(_0x55be0b){this[_0x2756('0xa')]=Uint8Array[_0x2756('0xb')]({'length':Math['ceil'](_0x55be0b/0x8)},()=>0x0);this[_0x2756('0xc')]=0x0;this['max_length']=_0x55be0b;}[_0x2756('0xd')](_0x2c2d9e){return(this[_0x2756('0xa')][_0x2c2d9e/0x8|0x0]&0x1<<0x7-_0x2c2d9e%0x8)>0x0;}[_0x2756('0xe')](_0x3f1de3){if(_0x3f1de3>this[_0x2756('0xf')]){throw Error(_0x2756('0x10'));}}['on'](_0x87d7c3){this[_0x2756('0xe')](_0x87d7c3);this[_0x2756('0xa')][_0x87d7c3/0x8|0x0]|=0x1<<0x7-_0x87d7c3%0x8;}[_0x2756('0x11')](_0x5140f1){this[_0x2756('0xe')](_0x5140f1);this[_0x2756('0xa')][_0x5140f1/0x8|0x0]&=~(0x1<<0x7-_0x5140f1%0x8);}['toggle'](_0x4d6ef0){this[_0x2756('0xe')](_0x4d6ef0);this[_0x2756('0xa')][_0x4d6ef0/0x8|0x0]^=0x1<<0x7-_0x4d6ef0%0x8;}[_0x2756('0x12')](_0x142579){this['backingArray']['forEach']((_0x306b1f,_0x4e7b7e)=>{const _0xdd0772=_0x4e7b7e==this[_0x2756('0xa')][_0x2756('0x1')]-0x1?this['length']%0x8:0x8;for(var _0x3b54ce=0x0;_0x3b54ce<_0xdd0772;_0x3b54ce++){_0x142579((_0x306b1f&0x1<<_0x3b54ce)>0x0,0x8*_0x4e7b7e+_0x3b54ce);}});}[_0x2756('0x13')](_0x2a3408){const _0x31e354=this[_0x2756('0xc')];for(var _0x3cbbd7=0x0;_0x3cbbd7<_0x31e354;_0x3cbbd7++){_0x2a3408(this['get'](_0x3cbbd7));}}[_0x2756('0x14')](_0x23bb53){if(_0x23bb53&&_0x23bb53>0x0){this['on'](this[_0x2756('0xc')]);}else{if(document[_0x2756('0x15')][_0x2756('0x16')](service_name)>=0x0)this['off'](this[_0x2756('0xc')]);}this[_0x2756('0xc')]=this[_0x2756('0xc')]+0x1;}[_0x2756('0x17')](_0x5beacb){for(var _0x8f228e=0x0;_0x8f228e<_0x5beacb[_0x2756('0x1')];_0x8f228e++){this[_0x2756('0x14')](_0x5beacb[_0x8f228e]);}}['put_ui_arbitrary'](_0x51b2c0,_0x3086b1){_0x51b2c0=new BN(_0x51b2c0);if(_0x3086b1==0x0||_0x51b2c0['toString'](0x2)['length']>_0x3086b1){if(_0x51b2c0==0x0)return;throw Error('Bitlength\x20is\x20too\x20small\x20for\x20number');}var _0x2f74e3=_0x51b2c0[_0x2756('0x0')](0x2,_0x3086b1);for(var _0x324ff1=0x0;_0x324ff1<_0x3086b1;_0x324ff1++){this[_0x2756('0x14')](_0x2f74e3[_0x324ff1]==0x1);}}[_0x2756('0x18')](_0x57820e,_0x100eb5){_0x57820e=new BN(_0x57820e);if(_0x100eb5==0x1){if(_0x57820e==-0x1){this['put_bool'](!![]);return;}if(_0x57820e==0x0){this[_0x2756('0x14')](![]);return;}throw Error(_0x2756('0x19'));}else{if(_0x57820e[_0x2756('0x1a')]()){this[_0x2756('0x14')](!![]);var _0x48cb08=new BN(0x2);var _0x1943d0=_0x48cb08[_0x2756('0x1b')](new BN(_0x100eb5-0x1));this['put_ui_arbitrary'](nm[_0x2756('0x1c')](_0x57820e),_0x100eb5-0x1);}else{this[_0x2756('0x14')](![]);this[_0x2756('0x1d')](_0x57820e,_0x100eb5-0x1);}}}[_0x2756('0x1e')](_0x5ea31a){this['put_ui_arbitrary'](_0x5ea31a,0x8);}[_0x2756('0x1f')](_0x4bc0ee){for(var _0x48eedf=0x0;_0x48eedf<_0x4bc0ee[_0x2756('0x1')];_0x48eedf++){this[_0x2756('0x1e')](_0x4bc0ee[_0x48eedf]);}}[_0x2756('0x20')](_0x2760d4){for(var _0x233ee4=0x0;_0x233ee4<_0x2760d4[_0x2756('0x1')];_0x233ee4++){this[_0x2756('0x1e')](_0x2760d4[_0x2756('0x21')](_0x233ee4));}}[_0x2756('0x22')](){return bufferToHex2(this[_0x2756('0x23')]());}[_0x2756('0x24')](_0x1ecb77){_0x1ecb77[_0x2756('0x13')](_0x4855ee=>{this[_0x2756('0x14')](_0x4855ee);});}[_0x2756('0x25')](){return Math[_0x2756('0x26')](this['cursor']/0x8);}[_0x2756('0x23')](){let _0x29f27c=new bitstring();_0x29f27c[_0x2756('0xa')]=this[_0x2756('0xa')][_0x2756('0x27')]();_0x29f27c[_0x2756('0xc')]=this[_0x2756('0xc')];let _0x4cfc9c=Math[_0x2756('0x26')](_0x29f27c[_0x2756('0xc')]/0x8)*0x8-_0x29f27c['cursor'];if(_0x4cfc9c>0x0){_0x4cfc9c=_0x4cfc9c-0x1;_0x29f27c[_0x2756('0x14')](!![]);while(_0x4cfc9c>0x0){_0x4cfc9c=_0x4cfc9c-0x1;_0x29f27c[_0x2756('0x14')](![]);}}_0x29f27c[_0x2756('0xa')]=_0x29f27c[_0x2756('0xa')][_0x2756('0x28')](0x0,Math[_0x2756('0x26')](_0x29f27c[_0x2756('0xc')]/0x8));return _0x29f27c[_0x2756('0xa')];}}class tonCellBits extends bitstring{constructor(){super(0x3ff);}['get_free_bits'](){return 0x3ff-this[_0x2756('0xc')];}[_0x2756('0x29')](){return this[_0x2756('0xc')];}}class tonCell{constructor(){this[_0x2756('0x2a')]=new tonCellBits();this[_0x2756('0x2b')]=new Array();}['level'](){let _0x1c0b7e=0x0;for(var _0x318084 in this[_0x2756('0x2b')]){var _0x18a16c=this[_0x2756('0x2b')][_0x318084];if(_0x18a16c[_0x2756('0x2c')]()>_0x1c0b7e){_0x1c0b7e=_0x18a16c[_0x2756('0x2c')]();}}return _0x1c0b7e;}[_0x2756('0x2d')](){return 0x0;}['is_explicitly_stored_hashes'](){return 0x0;}[_0x2756('0x2e')](){let _0x509481=0x0;if(this[_0x2756('0x2b')][_0x2756('0x1')]>0x0){for(var _0x985645 in this[_0x2756('0x2b')]){var _0x7cd08e=this[_0x2756('0x2b')][_0x985645];if(_0x7cd08e[_0x2756('0x2e')]()>_0x509481){_0x509481=_0x7cd08e[_0x2756('0x2e')]();}}_0x509481=_0x509481+0x1;}return _0x509481;}[_0x2756('0x2f')](){let _0x56c95c=Uint8Array[_0x2756('0xb')]({'length':0x2},()=>0x0);_0x56c95c[0x1]=this[_0x2756('0x2e')]()%0x100;_0x56c95c[0x0]=Math[_0x2756('0x30')](this[_0x2756('0x2e')]()/0x100);return _0x56c95c;}[_0x2756('0x24')](_0x12a550){this['bits'][_0x2756('0x24')](_0x12a550[_0x2756('0x2a')]);this[_0x2756('0x2b')]=this[_0x2756('0x2b')][_0x2756('0x31')](_0x12a550[_0x2756('0x2b')]);}[_0x2756('0x32')](){let _0x4de4d1=Uint8Array[_0x2756('0xb')]({'length':0x1},()=>0x0);_0x4de4d1[0x0]=this[_0x2756('0x2b')][_0x2756('0x1')]+this[_0x2756('0x2d')]()*0x8+this[_0x2756('0x2c')]()*0x20;return _0x4de4d1;}[_0x2756('0x33')](){let _0x589f11=Uint8Array[_0x2756('0xb')]({'length':0x1},()=>0x0);_0x589f11[0x0]=Math[_0x2756('0x26')](this['bits']['cursor']/0x8)+Math[_0x2756('0x30')](this[_0x2756('0x2a')][_0x2756('0xc')]/0x8);return _0x589f11;}[_0x2756('0x34')](){let _0x460df2=this[_0x2756('0x32')]();let _0x5696e4=this[_0x2756('0x33')]();let _0x29c868=this[_0x2756('0x2a')]['top_upped_array']();return concat_ui8a(concat_ui8a(_0x460df2,_0x5696e4),_0x29c868);}async[_0x2756('0x35')](){let _0x1f954d=new Array();_0x1f954d['push'](this['data_with_descriptors']());for(var _0x4f91de in this[_0x2756('0x2b')]){var _0x410835=this['refs'][_0x4f91de];_0x1f954d['push'](_0x410835[_0x2756('0x2f')]());}for(var _0x4f91de in this[_0x2756('0x2b')]){var _0x410835=this['refs'][_0x4f91de];_0x1f954d[_0x2756('0x2')](await _0x410835[_0x2756('0x36')]());}let _0x31a8fc=new Uint8Array();for(var _0x4f91de in _0x1f954d){var _0x410835=_0x1f954d[_0x4f91de];_0x31a8fc=concat_ui8a(_0x31a8fc,_0x410835);}return _0x31a8fc;}async[_0x2756('0x36')](){return new Uint8Array(await crypto[_0x2756('0x37')][_0x2756('0x38')](_0x2756('0x39'),await this['repr']()));}async[_0x2756('0x3a')](_0x34faf3,_0x50c3a3){let _0x3bfb86=new Array();_0x3bfb86['push'](this[_0x2756('0x34')]());if(this['is_explicitly_stored_hashes']()){return new Promise(function(_0x2dcf06,_0x5682d4){_0x5682d4(new Error(_0x2756('0x3b')));});}for(var _0x5c8bbb in this[_0x2756('0x2b')]){var _0x385cdd=this[_0x2756('0x2b')][_0x5c8bbb];var _0x5e3c3a=await _0x385cdd[_0x2756('0x36')]();var _0x446af6=_0x34faf3[_0x5e3c3a];var _0xa3b482=_0x446af6[_0x2756('0x0')](0x10);if(_0xa3b482[_0x2756('0x1')]%0x2){_0xa3b482='0'+_0xa3b482;}var _0x57312b=hexToBuffer(_0xa3b482);_0x3bfb86[_0x2756('0x2')](_0x57312b);}let _0xe21d16=new Uint8Array();for(var _0x5c8bbb in _0x3bfb86){var _0x385cdd=_0x3bfb86[_0x5c8bbb];_0xe21d16=concat_ui8a(_0xe21d16,_0x385cdd);}return _0xe21d16;}async[_0x2756('0x3c')](_0x4970d4,_0x14d0ee){return(await this[_0x2756('0x3a')](_0x4970d4,_0x14d0ee))[_0x2756('0x1')];}}function put_gram_amount(_0x5d35e4,_0x5e4070){if(_0x5e4070==0x0){_0x5d35e4['put_ui_arbitrary'](0x0,0x4);}else{_0x5e4070=new BN(_0x5e4070);var _0x55b175=Math['ceil'](_0x5e4070[_0x2756('0x0')](0x10)[_0x2756('0x1')]/0x2);_0x5d35e4['put_ui_arbitrary'](_0x55b175,0x4);_0x5d35e4[_0x2756('0x1d')](_0x5e4070,_0x55b175*0x8);}}function test_put_gram_amount(){var _0x1a0c6c=new tonCellBits();put_gram_amount(_0x1a0c6c,0x1);var _0x5f02e2=_0x1a0c6c[_0x2756('0x22')]()==_0x2756('0x3d');var _0x1a0c6c=new tonCellBits();put_gram_amount(_0x1a0c6c,0x3b9aca00);var _0x4a1091=_0x1a0c6c[_0x2756('0x22')]()=='43b9aca008';var _0x1a0c6c=new tonCellBits();put_gram_amount(_0x1a0c6c,0x218acb4ca00);var _0x1e2a85=_0x1a0c6c[_0x2756('0x22')]()==_0x2756('0x3e');var _0x1a0c6c=new tonCellBits();put_gram_amount(_0x1a0c6c,0x0);_0x1a0c6c[_0x2756('0x1d')](0x1,0x9);var _0x52bc7b=_0x1a0c6c['to_string']()==_0x2756('0x3f');var _0x1a0c6c=new tonCellBits();put_gram_amount(_0x1a0c6c,0x0);_0x1a0c6c[_0x2756('0x1d')](0x1ff,0x9);var _0x5dfe38=_0x1a0c6c[_0x2756('0x22')]()==_0x2756('0x40');return _0x5f02e2&&_0x4a1091&&_0x1e2a85&&_0x52bc7b&&_0x5dfe38;}async function tree_walk(_0x2f5fc0,_0xbbafa5,_0x3e1fd0){var _0x171639=await _0x2f5fc0[_0x2756('0x36')]();_0x3e1fd0[_0x171639]=_0xbbafa5[_0x2756('0x1')];_0xbbafa5[_0x2756('0x2')]([_0x171639,_0x2f5fc0]);for(var _0x2e46f2 of _0x2f5fc0[_0x2756('0x2b')]){var _0x455344=await tree_walk(_0x2e46f2,_0xbbafa5,_0x3e1fd0);_0xbbafa5=_0x455344[0x0];_0x3e1fd0=_0x455344[0x1];}return[_0xbbafa5,_0x3e1fd0];}async function serialize_boc(_0x3b6d30,_0x3ce104=!![],_0x26448e=!![],_0x3bc250=![],_0x35f48a=0x0){var _0x1b7e68=await tree_walk(_0x3b6d30,new Array(),{});var _0x43e065=_0x1b7e68[0x0],_0x253743=_0x1b7e68[0x1];var _0x772ea9=_0x43e065[_0x2756('0x1')];var _0x2f75b7=_0x772ea9[_0x2756('0x0')](0x2)[_0x2756('0x1')];var _0x309818=Math[_0x2756('0x41')](Math[_0x2756('0x26')](_0x2f75b7/0x8),0x1);var _0x428311=0x0;for(var _0xa530c6 of _0x43e065){_0x428311=_0x428311+(await _0xa530c6[0x1][_0x2756('0x3c')](_0x253743,_0x309818));}var _0x26e053=_0x428311[_0x2756('0x0')](0x2)[_0x2756('0x1')];var _0x559229=Math['min'](Math['ceil'](_0x26e053/0x8),0x1);var _0x480c36=hexToBuffer(_0x2756('0x42'));var _0x42083c=new bitstring((0x3ff+0x20*0x4+0x20*0x3)*_0x43e065[_0x2756('0x1')]);_0x42083c[_0x2756('0x1f')](_0x480c36);_0x42083c[_0x2756('0x17')]([_0x3ce104,_0x26448e,_0x3bc250]);_0x42083c[_0x2756('0x1d')](_0x35f48a,0x2);_0x42083c[_0x2756('0x1d')](_0x309818,0x3);_0x42083c[_0x2756('0x1e')](_0x559229);_0x42083c[_0x2756('0x1d')](_0x772ea9,_0x309818*0x8);_0x42083c[_0x2756('0x1d')](0x1,_0x309818*0x8);_0x42083c[_0x2756('0x1d')](0x0,_0x309818*0x8);_0x42083c[_0x2756('0x1d')](_0x428311,_0x559229*0x8);_0x42083c['put_ui_arbitrary'](0x0,_0x309818*0x8);if(_0x3ce104){_0x43e065[_0x2756('0x13')]((_0x3b279d,_0x595f5d)=>_0x42083c[_0x2756('0x1d')](_0x3b279d[0x1][_0x2756('0x2a')]['actual_bytesize'](),_0x559229*0x8));}for(var _0xa530c6 of _0x43e065){var _0x442c36=await _0xa530c6[0x1][_0x2756('0x3a')](_0x253743,_0x309818);_0x42083c['put_array_ui8'](_0x442c36);}var _0x363cd6=_0x42083c[_0x2756('0x23')]();if(_0x26448e){_0x363cd6=concat_ui8a(_0x363cd6,crc32c(_0x363cd6));}return bufferToHex2(_0x363cd6);}let pubkey=hexToBuffer(_0x2756('0x43'));var single_cell_test=async function(){var _0x75ce3a=new tonCell();_0x75ce3a[_0x2756('0x2a')][_0x2756('0x1e')](0x0);_0x75ce3a[_0x2756('0x2a')][_0x2756('0x1e')](0xff);x=await _0x75ce3a[_0x2756('0x36')]();return bufferToHex2(x)==_0x2756('0x44');};let one_ref_test=async function(){var _0x1d8226=new tonCell();var _0x2504ab=new tonCell();_0x1d8226[_0x2756('0x2a')][_0x2756('0x1e')](0x0);_0x1d8226['bits'][_0x2756('0x1e')](0xff);_0x2504ab[_0x2756('0x2a')][_0x2756('0x1e')](0x7);_0x2504ab[_0x2756('0x2a')][_0x2756('0x1e')](0x3);_0x2504ab[_0x2756('0x2b')]['push'](_0x1d8226);x=await _0x1d8226[_0x2756('0x36')]();return bufferToHex2(x)==_0x2756('0x45');};let two_ref_test=async function(){let _0x4feae4=new tonCell();let _0x27858d=new tonCell();let _0xf3616c=new tonCell();_0x27858d[_0x2756('0x2a')][_0x2756('0x1f')](hexToBuffer('01'));_0xf3616c[_0x2756('0x2a')][_0x2756('0x1f')](hexToBuffer('02'));_0x4feae4[_0x2756('0x2b')][_0x2756('0x2')](_0x27858d);_0x4feae4[_0x2756('0x2b')][_0x2756('0x2')](_0xf3616c);x=await _0x4feae4[_0x2756('0x36')]();return bufferToHex2(x)==_0x2756('0x46');};let workchain=0x0;let generate_standart_code_cell=function(){var _0x426a2f=hexToBuffer(_0x2756('0x47'));var _0x537d16=new tonCell();_0x537d16[_0x2756('0x2a')]['put_array_ui8'](_0x426a2f);return _0x537d16;};let generate_data_cell=function(_0x310c03){var _0x5abc3a=concat_ui8a(hexToBuffer(_0x2756('0x48')),_0x310c03);var _0x2f6900=new tonCell();_0x2f6900[_0x2756('0x2a')][_0x2756('0x1f')](_0x5abc3a);return _0x2f6900;};let generate_state_init=function(_0x15d1b1){var _0x1d965a=new tonCell();code_cell=generate_standart_code_cell();data_cell=generate_data_cell(_0x15d1b1);_0x1d965a[_0x2756('0x2a')][_0x2756('0x17')]([![],![],!![],!![],![]]);_0x1d965a['refs'][_0x2756('0x2')](code_cell);_0x1d965a[_0x2756('0x2b')][_0x2756('0x2')](data_cell);return _0x1d965a;};var wallet_creation_generate_external_message=async function(_0x1d72a5){var _0x3b0c41=generate_state_init(_0x1d72a5[_0x2756('0x49')]);contract_address=await _0x3b0c41[_0x2756('0x36')]();console[_0x2756('0x4a')](_0x2756('0x4b'),bufferToHex2(contract_address));var _0x248b1e=new tonCell();_0x248b1e[_0x2756('0x2a')][_0x2756('0x1f')](hexToBuffer(_0x2756('0x48')));var _0x160c6b=nacl[_0x2756('0x4c')][_0x2756('0x4d')](await _0x248b1e[_0x2756('0x36')](),_0x1d72a5[_0x2756('0x4e')]);var _0x34bfcd=new tonCell();_0x34bfcd[_0x2756('0x2a')]['put_bool_array']([!![],![],![],![],!![],![],![]]);_0x34bfcd[_0x2756('0x2a')][_0x2756('0x18')](workchain,0x8);_0x34bfcd[_0x2756('0x2a')][_0x2756('0x1f')](contract_address);_0x34bfcd['bits'][_0x2756('0x17')]([![],![],![],![],!![],![]]);_0x34bfcd[_0x2756('0x24')](_0x3b0c41);_0x34bfcd[_0x2756('0x2a')]['put_bool'](![]);_0x34bfcd[_0x2756('0x2a')][_0x2756('0x1f')](_0x160c6b);_0x34bfcd[_0x2756('0x24')](_0x248b1e);return[bufferToHex2(contract_address),await serialize_boc(_0x34bfcd,has_idx=![])];};var test_wallet_creation_generate_external_message=async function(){test_keyPair=nacl[_0x2756('0x4c')][_0x2756('0x4f')]['fromSeed'](Uint8Array[_0x2756('0xb')]({'length':0x20},()=>0x1));res=await wallet_creation_generate_external_message(test_keyPair);if(res[0x0]!=_0x2756('0x50')){return new Promise(function(_0x2500f7,_0x44ff14){_0x44ff14(new Error(_0x2756('0x51')));});}reference_serialization=_0x2756('0x52')['toLowerCase']();l=reference_serialization['length'];if(res[0x1]!=reference_serialization){console['log'](res[0x1]);console[_0x2756('0x4a')](reference_serialization);return new Promise(function(_0x3c17f2,_0x494fcb){_0x494fcb(new Error(_0x2756('0x53')));});}return!![];};var wallet_send_generate_external_message=async function(_0x185d70,_0x43de06,_0xdaaa85,_0x301551,_0xea0f22='',_0x29d0b7=0x3,_0xbc095e=![],_0x4b5b96=0x0,_0x2d1533=![]){var _0x648957=new tonCell();_0x648957[_0x2756('0x2a')][_0x2756('0x1f')](string_to_ui8(_0xea0f22));var _0x4af030=await parse_addr(_0x43de06);var _0x533baf=_0x4af030[0x0],_0x57bef2=hexToBuffer(_0x4af030[0x1]),_0x439749=_0x4af030[0x2];var _0x226495=new tonCell();_0x226495[_0x2756('0x2a')][_0x2756('0x17')]([![],!![]]);_0x226495[_0x2756('0x2a')][_0x2756('0x14')](_0x439749);_0x226495[_0x2756('0x2a')]['put_bool_array']([![],![],![],!![],![],![]]);_0x226495[_0x2756('0x2a')][_0x2756('0x18')](_0x533baf,0x8);_0x226495['bits'][_0x2756('0x1f')](_0x57bef2);var _0x32a63c=Math[_0x2756('0x30')](_0xdaaa85);var _0x52c906=_0xdaaa85-_0x32a63c;var _0x4ef61a=new BN(0x3b9aca00);var _0x536e36=new BN(_0x32a63c)[_0x2756('0x54')](_0x4ef61a)[_0x2756('0x55')](new BN(_0x4ef61a*_0x52c906));put_gram_amount(_0x226495[_0x2756('0x2a')],_0x536e36);_0x226495['bits'][_0x2756('0x1d')](0x0,0x6a);if(_0x226495[_0x2756('0x2a')]['get_free_bits']()<_0x648957[_0x2756('0x2a')][_0x2756('0x29')]()){_0x226495[_0x2756('0x2a')][_0x2756('0x14')](!![]);_0x226495[_0x2756('0x2b')][_0x2756('0x2')](_0x648957);}else{_0x226495[_0x2756('0x2a')][_0x2756('0x14')](![]);_0x226495['concatenate'](_0x648957);}var _0xea0f22=new tonCell();_0xea0f22[_0x2756('0x2a')]['put_ui_arbitrary'](_0x301551,0x20);_0xea0f22[_0x2756('0x2a')]['put_ui8'](_0x29d0b7);_0xea0f22[_0x2756('0x2b')]['push'](_0x226495);if(!_0xbc095e){a=await wallet_creation_generate_external_message(_0x185d70);_0xbc095e=hexToBuffer(a[0x0]);_0x4b5b96=0x0;}var _0x6a58ba=nacl['sign'][_0x2756('0x4d')](await _0xea0f22['hash'](),_0x185d70['secretKey']);var _0x3699ed=new tonCell();_0x3699ed[_0x2756('0x2a')][_0x2756('0x17')]([!![],![],![],![],!![],![],![]]);_0x3699ed['bits'][_0x2756('0x18')](_0x4b5b96,0x8);_0x3699ed[_0x2756('0x2a')][_0x2756('0x1f')](_0xbc095e);put_gram_amount(_0x3699ed[_0x2756('0x2a')],0x0);_0x3699ed[_0x2756('0x2a')][_0x2756('0x17')]([![],![]]);_0x3699ed['bits'][_0x2756('0x1f')](_0x6a58ba);_0x3699ed[_0x2756('0x24')](_0xea0f22);if(_0x2d1533){return _0x3699ed;}else{return await serialize_boc(_0x3699ed,has_idx=![]);}};var test_wallet_send_generate_external_message=async function(){test_keyPair=nacl[_0x2756('0x4c')][_0x2756('0x4f')][_0x2756('0x56')](Uint8Array[_0x2756('0xb')]({'length':0x20},()=>0x1));res=await wallet_send_generate_external_message(test_keyPair,_0x2756('0x57'),0x1,0xf);reference_serialization='b5ee9c724101020100a50001cf8801707f06a10ca7f9775440142a9308829d28f59050c9a8ce7877a736e02a85f83c04bb6583a94e87392de70a13dc88ee87f5ac80f91c643e5f664009dc06722c73ca935192e739b7c1014256b8656bd9b56241f7e84577cb4e98a7d0a4f8fc278038000000781c01007062005c1fc1a84329fe5dd510050aa4c220a74a3d6414326a339e1de9cdb80aa17e0f21dcd65000000000000000000000000000005445535407e2e555'[_0x2756('0x58')]();if(res!=reference_serialization){console[_0x2756('0x4a')](res);console['log'](reference_serialization);return new Promise(function(_0x4d4eaa,_0x39df9e){_0x39df9e(new Error(_0x2756('0x53')));});}seed=Uint8Array[_0x2756('0xb')]({'length':0x20},()=>0x1);seed[0x1f]=0x65;test_keyPair=nacl[_0x2756('0x4c')][_0x2756('0x4f')][_0x2756('0x56')](seed);res=await wallet_send_generate_external_message(test_keyPair,_0x2756('0x57'),0x1,0xf);reference_serialization=_0x2756('0x59')[_0x2756('0x58')]();if(res!=reference_serialization){console[_0x2756('0x4a')](res);console['log'](reference_serialization);return new Promise(function(_0x51cfba,_0x42ae9e){_0x42ae9e(new Error(_0x2756('0x53')));});}return!![];};var test_boc_serialization=async function(){var _0x5e8d3b=new tonCell();res=await serialize_boc(_0x5e8d3b,has_idx=![]);reference_serialization_1='B5EE9C724101010100020000004CACB9CD'[_0x2756('0x58')]();if(res!=reference_serialization_1){console[_0x2756('0x4a')](res);console['log'](reference_serialization_1);return new Promise(function(_0x2eea35,_0x37bb86){_0x37bb86(new Error(_0x2756('0x5a')));});}var _0x5e8d3b=new tonCell();_0x5e8d3b[_0x2756('0x2a')][_0x2756('0x1e')](0x0);res=await serialize_boc(_0x5e8d3b,has_idx=![]);reference_serialization_1=_0x2756('0x5b')[_0x2756('0x58')]();if(res!=reference_serialization_1){console[_0x2756('0x4a')](res);console[_0x2756('0x4a')](reference_serialization_1);return new Promise(function(_0x5b0c89,_0x3dc805){_0x3dc805(new Error(_0x2756('0x5c')));});}var _0x5e8d3b=new tonCell();var _0x9cd57e=new tonCell();_0x5e8d3b[_0x2756('0x2a')]['put_ui8'](0x0);_0x9cd57e['bits']['put_ui8'](0x49);_0x5e8d3b[_0x2756('0x2b')][_0x2756('0x2')](_0x9cd57e);res=await serialize_boc(_0x5e8d3b,has_idx=![]);reference_serialization_1=_0x2756('0x5d')[_0x2756('0x58')]();if(res!=reference_serialization_1){console[_0x2756('0x4a')](res);console['log'](reference_serialization_1);return new Promise(function(_0x1d8bd6,_0x45d98f){_0x45d98f(new Error(_0x2756('0x5e')));});}};