Skip to content

Commit

Permalink
Updated Harvester Defender Action
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Feb 4, 2025
1 parent bededf7 commit db5b054
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
26 changes: 26 additions & 0 deletions contracts/abi/harvester.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,32 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_strategy",
"type": "address"
}
],
"name": "harvestAndTransfer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "_strategies",
"type": "address[]"
}
],
"name": "harvestAndTransfer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "isGovernor",
Expand Down
10 changes: 5 additions & 5 deletions contracts/scripts/defender-actions/harvest.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const handler = async (event) => {
const networkName = network.chainId === 1 ? "mainnet" : "holesky";
log(`Network: ${networkName} with chain id (${network.chainId})`);

const harvesterAddress = addresses[networkName].OETHHarvesterProxy;
log(`Resolved OETH Harvester address to ${harvesterAddress}`);
const harvesterAddress = addresses[networkName].OETHHarvesterSimpleProxy;
log(`Resolved OETH Harvester Simple address to ${harvesterAddress}`);
const harvester = new ethers.Contract(harvesterAddress, harvesterAbi, signer);

const firstNativeStakingProxyAddress =
Expand Down Expand Up @@ -79,11 +79,11 @@ const harvest = async (
) {
const tx1 = await harvester
.connect(signer)
.harvestAndSwap(nativeStakingProxyAddress);
await logTxDetails(tx1, `${stratDesc} harvestAndSwap`);
.harvestAndTransfer(nativeStakingProxyAddress);
await logTxDetails(tx1, `${stratDesc} harvestAndTransfer`);
} else {
log(
`Skipping ${stratDesc} harvestAndSwap due to low consensus and execution rewards`
`Skipping ${stratDesc} harvestAndTransfer due to low consensus and execution rewards`
);
}
};
Expand Down
2 changes: 2 additions & 0 deletions contracts/utils/addresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ addresses.mainnet.FraxETHRedeemStrategy =
"0x95A8e45afCfBfEDd4A1d41836ED1897f3Ef40A9e";
addresses.mainnet.OETHHarvesterProxy =
"0x0D017aFA83EAce9F10A8EC5B6E13941664A6785C";
// TODO add after deployment
addresses.mainnet.OETHHarvesterSimpleProxy = "";
addresses.mainnet.BalancerRETHStrategy =
"0x49109629aC1deB03F2e9b2fe2aC4a623E0e7dfDC";
// OETH Tokens
Expand Down

0 comments on commit db5b054

Please sign in to comment.