-
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.
Set message bus fee in a deployment script for testnet. (#2190)
* Setting the fee. Extended the contract addresses endpoint. * adding script. * Reenabled 001 and fixed 002 * Exposed fee getters. * Testnet starting up. * Slight refactor. * Attempt 2. * Change the fees. * Set upgrader from proper place. * Fix for linter. * Fix for linter error. * made it a flat fee. * Addressed PR review. --------- Co-authored-by: StefanIliev545 <[email protected]>
- Loading branch information
1 parent
fec1c49
commit ff717b7
Showing
27 changed files
with
271 additions
and
95 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.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
35 changes: 33 additions & 2 deletions
35
contracts/generated/MerkleTreeMessageBus/MerkleTreeMessageBus.go
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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