-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
transferCalls[1] = RumpelModule.Call({ | ||
safe: ISafe(v.userAdd), | ||
to: MAINNET_LRT2, | ||
data: abi.encodeWithSelector(ERC20.transfer.selector, owners[0], v.stakingRewards), |
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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
No description provided.