Skip to content

Commit

Permalink
Merge pull request #10 from Ton-Dynasty/testnest
Browse files Browse the repository at this point in the history
Testnest
  • Loading branch information
alan890104 authored May 2, 2024
2 parents 376b8f1 + 68539a0 commit 4e4910f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/messages.tact
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const ACC_PRECISION: Int = pow(10, 20); // Precision for the accumulated rewar
const ZERO_ADDRESS: Address = address("0QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACkT");
const FEE_PERCENT_FOR_DEV: Int = 3; // 0.3% of the reward will be given to the ThunderMint
const MIN_GAS_FEE: Int = ton("0.05"); // Minimum gas fee for calling send ton
const GAS_CONSUMPTION: Int = ton("0.0059");
const GAS_CONSUMPTION: Int = ton("0.0065");
const KITCHEN_FEE: Int = ton("0.03"); // Fee for the Kitchen

// ERROR CODES
Expand Down
4 changes: 2 additions & 2 deletions deployments/deployment.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"USDT": "EQBqSpvo4S87mX9tjHaG4zhYZeORhVhMapBJpnMZ64jhrEQK",
"AirdropFactory": "EQCKrD4mAxJ40TDCuylk2B2bTpCJVslwdE4MEWaMHa6f1x_1",
"Kitchen": "EQA_J5QUlFMNEc722BQ4U6WTlEBFZSPifBR462ESP53Ne6pw",
"MasterChef": "kQClkxTgnUsBtZKRSnmesa01vdGKorlFnc0rcsLghJZdcahP",
"Kitchen": "EQD_-V48IcbuLG52M_H-_R5teyXwHiY9wSxw0mppk5KHYAKN",
"MasterChef": "EQDV4lbPOghYwTQFgD4V7k8oT_gKT_O3e-Eycy3HdvcGUsml",
"RewardJettonMaster": "kQDw2ioGUN5SHRV97e-U2b6vVHdYW4rH4d8oNl1vT_oU9Lfl",
"MerkleDistributor": {
"seed": "38435217033760998392163658086743783990464893960025036024613934316511459962221",
Expand Down
1 change: 0 additions & 1 deletion scripts/buildJettonMasterChef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export async function run(provider: NetworkProvider) {
$$type: 'BuildJettonMasterChef',
owner: provider.sender().address!!,
seed: seed,
thunderMintJettonWallet: senderUSDTWallet.address, // owner jettonWallet
mcRewardJettonWallet: masterchefUSDTWallet.address,
metaData: beginCell().storeStringTail('httpppp').endCell(),
deadline: deadline,
Expand Down
24 changes: 24 additions & 0 deletions scripts/redeem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { toNano, Address, beginCell } from '@ton/core';
import { JettonMasterChef } from '../wrappers/JettonMasterChef';
import { NetworkProvider } from '@ton/blueprint';
import { loadDeployment } from '../utils/helper';
import { JettonMinter } from '../wrappers/JettonMinter';
import { JettonWallet } from '../wrappers/RealJettonWallet';

export async function run(provider: NetworkProvider) {
const deployment = await loadDeployment();

const masterchef = provider.open(JettonMasterChef.fromAddress(Address.parse(deployment.MasterChef)));
const rewardTokenMasterAddress = Address.parse(deployment.RewardJettonMaster);
const rewardTokenMaster = provider.open(JettonMinter.createFromAddress(rewardTokenMasterAddress));
const masterchefUSDTWalletAddress = await rewardTokenMaster.getWalletAddress(masterchef.address);
const masterchefUSDTWallet = provider.open(JettonWallet.createFromAddress(masterchefUSDTWalletAddress));

await masterchef.send(
provider.sender(),
{
value: toNano('0.5'),
},
'Redeem',
);
}
7 changes: 4 additions & 3 deletions scripts/userDeposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ export async function run(provider: NetworkProvider) {
const senderUSDTWalletAddress = await rewardTokenMaster.getWalletAddress(provider.sender().address!!);
const senderUSDTWallet = provider.open(JettonWallet.createFromAddress(senderUSDTWalletAddress));
let depositAmount = 50n * 10n ** 9n;
let forwardAmount = toNano('0.05');
let forwardAmount = toNano('0.2');
await senderUSDTWallet.sendTransfer(
provider.sender(),
toNano('0.1'),
toNano('0.5'),
depositAmount,
masterchef.address,
provider.sender().address!!,
null,
forwardAmount,
beginCell().endCell(),
null,
);

}

0 comments on commit 4e4910f

Please sign in to comment.