Skip to content

Commit

Permalink
fix: deployment scripts fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siandreev committed Sep 27, 2023
1 parent 550894f commit b1a9af8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions scripts/deployWalletV5.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { Dictionary, toNano } from 'ton-core';
import { WalletId, WalletV5 } from '../wrappers/wallet-v5';
import { compile, NetworkProvider } from '@ton-community/blueprint';
import { LibraryDeployer } from '../wrappers/library-deployer';
import { getSecureRandomBytes, keyPairFromSeed } from 'ton-crypto';
import 'dotenv/config';
import { LibraryKeeper } from '../wrappers/library-keeper';
import {randomTestKey} from "ton/dist/utils/randomTestKey";

/*
DOESN'T WORK WITH TONKEEPER AND TONCONNECT. CHOOSE DEPLOY WITH MNEMONIC
DOESN'T WORK WITH TONKEEPER. CHOOSE DEPLOY WITH MNEMONIC
*/
export async function run(provider: NetworkProvider) {
const keypair = randomTestKey('v5-treasure'); // keyPairFromSeed(
//await getSecureRandomBytes(32)
//);
const keypair = keyPairFromSeed(await getSecureRandomBytes(32));
console.log('KEYPAIR PUBKEY', keypair.publicKey.toString('hex'));
console.log('KEYPAIR PRIVATE_KEY', keypair.secretKey.toString('hex'));

Expand All @@ -24,13 +20,13 @@ export async function run(provider: NetworkProvider) {
publicKey: keypair.publicKey,
extensions: Dictionary.empty()
},
LibraryKeeper.exportLibCode(await compile('wallet_v5'))
LibraryDeployer.exportLibCode(await compile('wallet_v5'))
)
);

await walletV5.sendDeploy(provider.sender(), toNano('0.1'));

await provider.waitForDeploy(walletV5.address);

console.log('ADDRESS', walletV5.address);
console.log('WALLET ADDRESS', walletV5.address);
}
2 changes: 1 addition & 1 deletion scripts/deployWalletV5WithoutLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export async function run(provider: NetworkProvider) {

await provider.waitForDeploy(walletV5.address);

console.log('ADDRESS', walletV5.address);
console.log('WALLET ADDRESS', walletV5.address);
}
4 changes: 2 additions & 2 deletions scripts/printWalletCode.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { compile } from '@ton-community/blueprint';
import { LibraryKeeper } from '../wrappers/library-keeper';
import { LibraryDeployer } from '../wrappers/library-deployer';

export async function run() {
const code = LibraryKeeper.exportLibCode(await compile('wallet_v5'));
const code = LibraryDeployer.exportLibCode(await compile('wallet_v5'));

console.log('WALLET CODE HEX', code.toBoc().toString('hex'), '\n');
console.log('WALLET CODE BASE64', code.toBoc().toString('base64'));
Expand Down

0 comments on commit b1a9af8

Please sign in to comment.