-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com-spicysquid168:alpaca-finance/xALPAC…
…A-contract
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
deploy/exec/xalpaca-v2-rewarder/config/force-set-reward-debt.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,43 @@ | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { ethers, upgrades } from "hardhat"; | ||
import { XALPACAv2Rewarder, XALPACAv2Rewarder__factory } from "../../../../typechain"; | ||
import { ConfigEntity } from "../../../entities"; | ||
import { getDeployer } from "../../../../utils/deployer-helper"; | ||
import { BigNumber } from "ethers"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
/* | ||
░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ | ||
░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ | ||
░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ | ||
░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ | ||
░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ | ||
░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ | ||
Check all variables below before execute the deployment script | ||
*/ | ||
const REWARDER = "PYTH"; | ||
|
||
const user = "0xd09fA948296E54D1Ab73A0497C16403A08A84732"; | ||
const newRewardDebt = 524935147; | ||
|
||
const deployer = await getDeployer(); | ||
const config = ConfigEntity.getConfig(); | ||
|
||
const rewarder = config.xALPACAv2Rewarders.find((rw) => rw.name === REWARDER); | ||
console.log(rewarder); | ||
if (!rewarder) { | ||
console.log(`>> ${REWARDER} Rewarder not found`); | ||
return; | ||
} | ||
console.log( | ||
`>> Setting ${newRewardDebt} as a new reward debt for ${user} at Rewarder ${rewarder.name} at ${rewarder.address}` | ||
); | ||
const rewarderAsDeployer = XALPACAv2Rewarder__factory.connect(rewarder.address, deployer); | ||
|
||
await rewarderAsDeployer.forceSetUserRewardDebt(user, newRewardDebt); | ||
console.log(`✅ Done`); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["RewarderForceSetRewardDebt"]; |
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