diff --git a/build/JettonWallet.compiled.json b/build/JettonWallet.compiled.json index 33e6125..21befa8 100644 --- a/build/JettonWallet.compiled.json +++ b/build/JettonWallet.compiled.json @@ -1 +1 @@ -{"hex":"b5ee9c7241020f01000380000114ff00f4a413f4bcf2c80b01020162050202012004030021bc508f6a2686981fd007d207d2068af81c0027bfd8176a2686981fd007d207d206899fc152098402f8d001d0d3030171b08e48135f038020d721ed44d0d303fa00fa40fa40d104d31f01840f218210178d4519ba0282107bdd97deba12b1f2f48040d721fa003012a0401303c8cb0358fa0201cf1601cf16c9ed54e0fa40fa4031fa0031f401fa0031fa00013170f83a02d31f012082100f8a7ea5ba8e85303459db3ce0330c06025c228210178d4519ba8e84325adb3ce034218210595f07bcba8e843101db3ce0135f038210d372158cbadc840ff2f0080701f2ed44d0d303fa00fa40fa40d106d33f0101fa00fa40f401d15141a15238c705f2e04926c2fff2afc882107bdd97de01cb1f5801cb3f01fa0221cf1658cf16c9c8801801cb0526cf1670fa02017158cb6accc903f839206e943081169fde718102f270f8380170f836a0811a6570f836a0bcf2b0028050fb00030903e6ed44d0d303fa00fa40fa40d107d33f0101fa005141a004fa40fa4053bac705f82a5464e070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c9f9007074c8cb02ca07cbffc9d0500cc7051bb1f2e04a09fa0021925f04e30d26d70b01c000b393306c33e30d55020b0a09002003c8cb0358fa0201cf1601cf16c9ed54007a5054a1f82fa07381040982100966018070f837b60972fb02c8801001cb055005cf1670fa027001cb6a8210d53276db01cb1f5801cb3fc9810082fb00590060c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0524cf1658fa02017158cb6accc98011fb0001f603d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40d1521ac705f2e0495115a120c2fff2aff82a54259070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e20d01fec88210178d451901cb1f500a01cb3f5008fa0223cf1601cf1626fa025007cf16c9c8801801cb055004cf1670fa024063775003cb6bccccc945372191729171e2f839206e938123399120e2216e94318128099101e25023a813a0738103a370f83ca00270f83612a00170f836a07381040982100966018070f837a0bcf2b0040e002a8050fb005803c8cb0358fa0201cf1601cf16c9ed548b4b6c49"} +{"hex":"b5ee9c7241021a010004ff000114ff00f4a413f4bcf2c80b0102016202150202ca031001f5d407434c0c05c6c2396c4d7c0e00835c87b513434c0fe803e903e9034ffc07e1874c2407e18b44134c7c06103c8608405e351466e80a0841ef765f7ae84ac7cbd201035c87e800c04a81004fe107e10817232c0d4013e809633c58073c5b2fff2c2727b55383e903e900c7e800c7d007e800c7e80004c5c3e0e80a040384d31f012082100f8a7ea5ba8e85304434db3ce033228210178d4519ba8e84325adb3ce034218210595f07bcba8e843101db3ce0135f038210d372158cbadc840ff2f005080e03f604d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40d3ff01f861d30901f862d1521bc705f2e049f82af8412b103759db3c6f223020f9007074c8cb02ca07cbff04fa40f4048050226e92323be30e0afa002020d70b009ad74bc00101c001b0f2b19130e25148a120c2fff2afc88210178d451909060700ac3001d0d31f0182100df602d6baf2b925f276d430f84128f02cf8235203bef2b7bbf2b814a00471b151a9a1f82fa07381051382100966018070f8375210b609208010fb02a1810090f80770f83658a01aa1103a09103401f801cb1f500a01cb3f5008fa0226cf1601cf1626fa0258cf16c9c8801801cb055004cf1770fa024013775003cb6bccccc945382191729171e2f839206e9381782e9120e2216e9431817ee09101e25023a813a0738104ad70f83ca00270f83612a00170f836a07381051382100966018070f837a0bcf2b05053fb0043030d04d6ed44d0d303fa00fa40fa40d3ff01f861d30901f862d107d33f0101fa005141a004fa40fa4053bac70520913b8ea030f82af84124544e30db3c6f2230f9007074c8cb02ca07cbffc9d0500bc7050ae20af2e04a09fa0021925f04e30d26d70b01c000b393306c33e30d5502090b0c0d01f6840f7f7026fa4431abfb531149461804c8cb035003fa0201cf1601cf16cbff208100cac8cb0f01cf1724f90025d7652582020134c8cb1712cb0fcb0fcbff8e2906a45c01cb0971f90400527001cbff71f90400abfb28b25304b9933434239130e220c02024c000b117e610235f033333227003cb09c922c8cb01120a0014f400f400cb00c9016f020060c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0524cf1658fa02017158cb6accc98011fb00007a5054a1f82fa07381051382100966018070f837b60972fb02c8801001cb055005cf1670fa027001cb6a8210d53276db01cb1f5801cb3fc9810082fb00590032f841f84205c8cb035004fa0258cf1601cf16cbffcb09c9ed5401baed44d0d303fa00fa40fa40d3ff01f861d30901f862d106d33f0101fa00fa40f401d15141a15238c705f2e04926c2fff2afc882107bdd97de01cb1f5801cb3f01fa0221cf1658cf16c9c8801801cb0526cf1670fa02017158cb6accc9030f007ef839206e9430811804de718102f270f8380170f836a081700870f836a0bcf2b0028050fb0003f841f84205c8cb035004fa0258cf1601cf16cbffcb09c9ed5402016611140201581213002335ce7cb819f4c1c07000fcb81a3534ffcc200011007c0a962ebcb81a600029d2cf815c08085fa0537d0f97036fd006997e9979840201201617003bbfd8176a2686981fd007d207d2069ff80fc30e98480fc316899fc152098402012018190035b8a11ed44d0d303fa00fa40fa40d3ff01f861d30901f862d15f0380035b9daced44d0d303fa00fa40fa40d3ff01f861d30901f862d15f038f439324a"} \ No newline at end of file diff --git a/contracts/jetton-minter.fc b/contracts/jetton-minter.fc index b3d50d1..5bea72b 100644 --- a/contracts/jetton-minter.fc +++ b/contracts/jetton-minter.fc @@ -10,7 +10,7 @@ global int merkle_root; ;; storage#_ total_supply:Coins admin_address:MsgAddress next_admin_address:MsgAddress jetton_wallet_code:^Cell metadata_uri:^Cell = Storage; -(int, slice, slice, cell, cell) load_data() inline { +(int, slice, slice, cell, cell) load_data() impure inline { slice ds = get_data().begin_parse(); var data = ( ds~load_coins(), ;; total_supply diff --git a/sandbox_tests/JettonWallet.spec.ts b/sandbox_tests/JettonWallet.spec.ts index 5015d71..87a522a 100644 --- a/sandbox_tests/JettonWallet.spec.ts +++ b/sandbox_tests/JettonWallet.spec.ts @@ -274,7 +274,7 @@ describe('JettonWallet', () => { // implementation detail it('should deploy', async () => { - const deployResult = await jettonMinter.sendDeploy(deployer.getSender(), toNano('10')); + const deployResult = await jettonMinter.sendDeploy(deployer.getSender(), toNano('1')); expect(deployResult.transactions).toHaveTransaction({ from: deployer.address, @@ -295,7 +295,7 @@ describe('JettonWallet', () => { let initialTotalSupply = await jettonMinter.getTotalSupply(); const deployerJettonWallet = await userWallet(deployer.address); let initialJettonBalance = toNano('1000.23'); - const mintResult = await jettonMinter.sendMint(deployer.getSender(), deployer.address, initialJettonBalance, null, null, null, toNano('0.05'), toNano('1')); + const mintResult = await jettonMinter.sendMint(deployer.getSender(), deployer.address, initialJettonBalance); const mintTx = findTransactionRequired(mintResult.transactions, { from: jettonMinter.address, diff --git a/scripts/deployJettonMinter.ts b/scripts/deployJettonMinter.ts index cbb8a8a..bf32367 100644 --- a/scripts/deployJettonMinter.ts +++ b/scripts/deployJettonMinter.ts @@ -26,4 +26,6 @@ export async function run(provider: NetworkProvider) { await compile('JettonMinter'))); await minter.sendDeploy(provider.sender(), toNano("1.5")); // send 1.5 TON + // Will display resulting contract address + await provider.waitForDeploy(minter.address); } diff --git a/wrappers/JettonMinter.ts b/wrappers/JettonMinter.ts index d0f47f0..d874c96 100644 --- a/wrappers/JettonMinter.ts +++ b/wrappers/JettonMinter.ts @@ -170,11 +170,11 @@ export class JettonMinter implements Contract { from?: Address | null, response_addr?: Address | null, customPayload?: Cell | null, - forward_ton_amount: bigint = toNano('0.05'), total_ton_amount: bigint = toNano('0.2')) { + forward_ton_amount: bigint = 1n, total_ton_amount: bigint = toNano('0.2')) { await provider.internal(via, { sendMode: SendMode.PAY_GAS_SEPARATELY, body: JettonMinter.mintMessage(to, jetton_amount, from, response_addr, customPayload, forward_ton_amount, total_ton_amount), - value: total_ton_amount, + value: total_ton_amount + toNano('0.05'), }); }