Skip to content

Conversation

@aalavandhan
Copy link
Member

@aalavandhan aalavandhan commented Nov 14, 2024

Cleaned up interface and added upgradability

lastAccountingTimestampSec = block.timestamp;

// User Accounting
UserTotals storage totals = userTotals[msg.sender];
Copy link

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

Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

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

LGTM

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);
Copy link
Member

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.

Copy link
Member Author

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

@aalavandhan aalavandhan merged commit 7e89473 into master Nov 20, 2024
1 check passed
@aalavandhan aalavandhan deleted the restructure branch November 20, 2024 01:56
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.

4 participants