-
Notifications
You must be signed in to change notification settings - Fork 38
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
Showing
34 changed files
with
435 additions
and
136 deletions.
There are no files selected for viewing
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
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
39 changes: 39 additions & 0 deletions
39
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,39 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import { Receipt } from 'hardhat-deploy/dist/types'; | ||
import { network } from 'hardhat'; | ||
|
||
/* | ||
This script sets the fee for the message bus to prevent spam. | ||
*/ | ||
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(32*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']; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.