-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
StefanIliev545
committed
Dec 6, 2024
1 parent
fa50053
commit d7f19fe
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
contracts/deployment_scripts/testnet/layer2/003_set_fee.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; |