-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path14_set_deposit_parameters.ts
38 lines (29 loc) · 1.3 KB
/
14_set_deposit_parameters.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type { HardhatRuntimeEnvironment } from "hardhat/types"
import type { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, ethers, getNamedAccounts } = hre
const { execute, read } = deployments
const { deployer } = await getNamedAccounts()
deployments.log("setting initial deposit parameters")
const depositTreasuryFeeDivisor = ethers.BigNumber.from("0")
// We set the deposit reveal ahead period to 8 months and two weeks, assuming
// 1 month = 30 days. That gives 254 days which translates to
// 254 * 24 * 60 * 60 = 21945600 seconds
const depositRevealAheadPeriod = ethers.BigNumber.from("21945600")
// Fetch the current values of other deposit parameters to keep them unchanged.
const depositParameters = await read("Bridge", "depositParameters")
await execute(
"Bridge",
{ from: deployer, log: true, waitConfirmations: 1 },
"updateDepositParameters",
depositParameters.depositDustThreshold,
depositTreasuryFeeDivisor,
depositParameters.depositTxMaxFee,
depositRevealAheadPeriod
)
}
export default func
func.tags = ["SetDepositParameters"]
func.dependencies = ["Bridge"]
func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
hre.network.name !== "mainnet"