Skip to content

Commit a2c24b5

Browse files
authored
Added updateWOETHPrice Hardhat task (#2884)
1 parent 354a7a5 commit a2c24b5

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

contracts/tasks/strategy.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,27 @@ async function transferToken({ proxy, symbol, amount }) {
7373
await logTxDetails(tx, "transferToken");
7474
}
7575

76+
async function updateWOETHOraclePrice({ proxy = "BridgedWOETHStrategyProxy" }) {
77+
const signer = await getSigner();
78+
const strategy = await resolveContract(proxy, "BridgedWOETHStrategy");
79+
const lastOraclePrice = await strategy.lastOraclePrice();
80+
const newOraclePrice = await strategy
81+
.connect(signer)
82+
.callStatic.updateWOETHOraclePrice();
83+
84+
console.log(`Strategy : ${strategy.address}`);
85+
console.log(`Previous wOETH price: ${formatUnits(lastOraclePrice)} WETH`);
86+
console.log(`New wOETH price : ${formatUnits(newOraclePrice)} WETH`);
87+
88+
log(`About to call updateWOETHOraclePrice() on ${strategy.address}`);
89+
const tx = await strategy.connect(signer).updateWOETHOraclePrice();
90+
await logTxDetails(tx, "updateWOETHOraclePrice");
91+
}
92+
7693
module.exports = {
7794
getRewardTokenAddresses,
7895
setRewardTokenAddresses,
7996
checkBalance,
8097
transferToken,
98+
updateWOETHOraclePrice,
8199
};

contracts/tasks/tasks.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const {
8989
setRewardTokenAddresses,
9090
checkBalance,
9191
transferToken,
92+
updateWOETHOraclePrice,
9293
} = require("./strategy");
9394
const {
9495
validatorOperationsConfig,
@@ -1103,6 +1104,12 @@ task("setRewardTokenAddresses", "Sets the reward token of a strategy")
11031104
)
11041105
.setAction(setRewardTokenAddresses);
11051106

1107+
task(
1108+
"updateWOETHPrice",
1109+
"Update the wOETH oracle price on the Base BridgedWOETHStrategy"
1110+
)
1111+
.setAction(updateWOETHOraclePrice);
1112+
11061113
// Harvester
11071114

11081115
task("harvest", "Harvest and swap rewards for a strategy")

0 commit comments

Comments
 (0)