Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: etherfi claim script #51

Merged
merged 2 commits into from
Feb 19, 2025
Merged

feat: etherfi claim script #51

merged 2 commits into from
Feb 19, 2025

Conversation

stevenvaleri
Copy link
Contributor

No description provided.

transferCalls[1] = RumpelModule.Call({
safe: ISafe(v.userAdd),
to: MAINNET_LRT2,
data: abi.encodeWithSelector(ERC20.transfer.selector, owners[0], v.stakingRewards),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if v.stakingRewards == 0 don't make this tx

Copy link
Contributor

@jparklev jparklev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion and a question, but nothing blocking! Nice one

Will review https://github.com/sense-finance/rumpel-root-vercel/pull/145/files now

// Overrides for wallets who have already claimed king
// Note the amount they've previously claimed and remove it from their staked rewards
// https://etherscan.io/tx/0xa7cb70a54384efcc0d265157e20331f94dd998c28f0e961435193220ccd9d2f4
uint256 public USER_OVERRIDE_PREV_TRANSFER_1 = 19386471377007458; // wallet = 0xce2f33c58f7aF3338a9D4Bd7baAf6F4a01E1Ea30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could get these same values just-in-time by checking cumulativeClaimed on the lrt2Claim contract, right?
Screenshot 2025-02-17 at 3 49 24 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think this would work combined with a validation that the rumpel wallet balance is zero, to confirm it was both claimed and removed from the wallet, and that the amount we calculate and transfer will result in a 0 king balance in the rumpel wallet.

revert("ERROR: Current Root not expected");
}

while (true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh so, from a quick look at the rewards json, is it that in HistoricalRewards the order of the array varies (seems like staking and point awards switch between index 0 and 1?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - for that reason, the code iterates the array entries until it finds the entry with the desired root.

// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity =0.8.24;

import {Script, console} from "forge-std/Script.sol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: doesn't matter at all but could remove console import

@jparklev jparklev merged commit 389083c into main Feb 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants