Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New func #12

Merged
merged 14 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
axios in prog
  • Loading branch information
shaharyakir committed Jun 15, 2022
commit 6f500e49af2aceb81ccf85c833c059e8c9097135
12 changes: 6 additions & 6 deletions build/_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
// The script assumes that it is running from the repo root, and the directories are organized this way:
// ./build/ - directory for build artifacts (mycontract.compiled.json) and deploy init data scripts (mycontract.deploy.ts)
// ./.env - config file with DEPLOYER_MNEMONIC - secret mnemonic of deploying wallet (will be created if not found)

import axios from "axios";
import axios from "ton/node_modules/axios";
import axios2 from "axios";
import axiosThrottle from "axios-request-throttle";
axiosThrottle.use(axios, { requestsPerSecond: 0.5 }); // required since toncenter jsonRPC limits to 1 req/sec without API key

axiosThrottle.use(axios2, { requestsPerSecond: 0.5 }); // required since toncenter jsonRPC limits to 1 req/sec without API key
import dotenv from "dotenv";
dotenv.config();

import fs from "fs";
import path from "path";
import glob from "fast-glob";
import { Address, Cell, CellMessage, CommonMessageInfo, fromNano, InternalMessage, StateInit, toNano } from "ton";
import { TonClient, WalletContract, WalletV3R2Source, contractAddress, SendMode } from "ton";
import { Address, Cell, CellMessage, CommonMessageInfo, contractAddress, fromNano, InternalMessage, SendMode, StateInit, toNano, TonClient, WalletContract, WalletV3R2Source } from "ton";
import { mnemonicNew, mnemonicToWalletKey } from "ton-crypto";

async function main() {
Expand All @@ -30,7 +29,8 @@ async function main() {
}

// initialize globals
const client = new TonClient({ endpoint: `https://${process.env.TESTNET ? "testnet." : ""}toncenter.com/api/v2/jsonRPC` });
// const client = new TonClient({ endpoint: `https://${process.env.TESTNET ? "testnet." : ""}toncenter.com/api/v2/jsonRPC` });
const client = new TonClient({ endpoint: "https://testnet.toncenter.com/api/v2/jsonRPC" });
const deployerWalletType = "org.ton.wallets.v3.r2"; // also see WalletV3R2Source class used below
const newContractFunding = toNano(0.02); // this will be (almost in full) the balance of a new deployed contract and allow it to pay rent
const workchain = 0; // normally 0, only special contracts should be deployed to masterchain (-1)
Expand Down
10 changes: 8 additions & 2 deletions build/jetton-minter.deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,17 @@ export function parseOnChainData(contentCell: Cell): {
}

// return the init Cell of the contract storage (according to load_data() contract method)
export function initData(owner: Address, data: { [s in JettonMetaDataKeys]?: string | undefined }) {
export function initData() {
const owner = Address.parse("EQD4gS-Nj2Gjr2FYtg-s3fXUvjzKbzHGZ5_1Xe_V0-GCp0p2");
return beginCell()
.storeCoins(0)
.storeAddress(owner)
.storeRef(buildOnChainData(data))
.storeRef(
buildOnChainData({
name: "MyJetton",
symbol: "JET1"
})
)
.storeRef(JETTON_WALLET_CODE)
.endCell();
}
Expand Down
Loading