rps-project/scripts/4.changeServiceAddress.ts
2024-09-10 11:46:05 +03:00

20 lines
792 B
TypeScript

import { Address, toNano } from '@ton/core';
import { MainBalance } from '../wrappers/MainBalance';
import { compile, NetworkProvider } from '@ton/blueprint';
import contractConfig from '../config/contract.config';
import { getMainBalanceContract } from './utils';
export async function run(provider: NetworkProvider) {
const ui = provider.ui();
const mainBalance = await getMainBalanceContract(provider);
ui.write(`prev service address: ${await mainBalance.getServiceAddress()}`);
await mainBalance.sendChangeServiceAddress(
provider.sender(),
Address.parse(contractConfig.script.newServiceAddress),
Address.parse(contractConfig.init.tokenAddress)
);
ui.write(`current service address: ${contractConfig.script.newServiceAddress}`);
}