From 69697f902fd9428a339f9ee952e126d6de2009d4 Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Thu, 5 Sep 2024 11:33:32 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20deploy:=20fix=20provider=20ratio?= =?UTF-8?q?=20and=20add=20setter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/Staking.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deploy/Staking.ts b/deploy/Staking.ts index 1500cae2..1535659e 100644 --- a/deploy/Staking.ts +++ b/deploy/Staking.ts @@ -1,6 +1,7 @@ import type { DeployFunction } from "hardhat-deploy/types"; import type { Market, StakedEXA } from "../types"; import transferOwnership from "./.utils/transferOwnership"; +import executeOrPropose from "./.utils/executeOrPropose"; import multisigPropose from "./.utils/multisigPropose"; import validateUpgrade from "./.utils/validateUpgrade"; import grantRole from "./.utils/grantRole"; @@ -25,6 +26,8 @@ const func: DeployFunction = async ({ getNamedAccounts(), ]); + const providerRatio = parseUnits(String(staking.providerRatio)); + await validateUpgrade("stEXA", { contract: "StakedEXA", envKey: "STAKED_EXA" }, async (name, opts) => deploy(name, { ...opts, @@ -47,7 +50,7 @@ const func: DeployFunction = async ({ provider: treasury, savings, duration: staking.duration, - providerRatio: parseUnits(String(staking.penaltyThreshold)), + providerRatio, }, ], }, @@ -60,6 +63,10 @@ const func: DeployFunction = async ({ const stEXA = await getContract("stEXA", await getSigner(deployer)); + if ((await stEXA.providerRatio()) !== providerRatio) { + await executeOrPropose(stEXA, "setProviderRatio", [providerRatio]); + } + if (pauser) await grantRole(stEXA, await stEXA.EMERGENCY_ADMIN_ROLE(), pauser.address); await grantRole(stEXA, await stEXA.PAUSER_ROLE(), multisig); await transferOwnership(stEXA, deployer, timelock);