-
Notifications
You must be signed in to change notification settings - Fork 57
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
Refactor #22
Refactor #22
Conversation
contracts/TokenGeyser.sol
Outdated
lastAccountingTimestampSec = block.timestamp; | ||
|
||
// User Accounting | ||
UserTotals storage totals = userTotals[msg.sender]; |
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: consider renaming totals
to something like user
. current naming is a little awkward later on when calculating totalUserRewards
using totals.stakingShareSeconds
as user's values, and totalStakingShareSeconds
as total
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.
LGTM
@@ -9,7 +9,7 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |||
interface ITokenGeyser { | |||
function stake(uint256 amount) external; | |||
function unstake(uint256 amount) external returns (uint256); | |||
function totalStakedFor(address addr) external view returns (uint256); | |||
function totalStakedBy(address addr) external view returns (uint256); |
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.
I like the name change, but flagging that it would mean changes for the frontend. Assuming it would need to be smart enough to know which contract version it's talking to on the backend.
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.
Right. I think for the new frontend we shouldn't expect backward compatibility with OG v1
Cleaned up interface and added upgradability