Skip to content

Commit

Permalink
adding script.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanIliev545 committed Dec 6, 2024
1 parent fa50053 commit d7f19fe
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions contracts/deployment_scripts/testnet/layer2/003_set_fee.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import {DeployFunction} from 'hardhat-deploy/types';
import { Receipt } from 'hardhat-deploy/dist/types';
import { network } from 'hardhat';

/*
This script deploys the ZenTestnet contract on the l2 and whitelists it.
*/


const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const l2Network = hre;

const l2Accounts = await l2Network.getNamedAccounts();

const networkConfig = await l2Network.network.provider.request({
method: "net_config",
});

const signer = await l2Network.ethers.getSigner(l2Accounts.deployer);
const fees = await l2Network.ethers.getContractAt(
'Fees',
networkConfig["PublicSystemContracts"]["Fees"],
signer
);

const owner = await fees.owner();
console.log(`Owner = ${owner}`);
console.log(`Signer = ${l2Accounts.deployer}`);

const tx = await fees.setMessageFee(10000);
const receipt =await tx.wait();

if (receipt.status != 1) {
throw new Error("Failed to set message fee");
}
console.log(`Fee set at ${receipt.hash}`);
}
export default func;
func.tags = ['SetFees', 'SetFees_deploy'];
func.dependencies = ['ZenBase'];

0 comments on commit d7f19fe

Please sign in to comment.