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

Refactor #22

Merged
merged 10 commits into from
Nov 20, 2024
Merged

Refactor #22

merged 10 commits into from
Nov 20, 2024

Conversation

aalavandhan
Copy link
Member

@aalavandhan aalavandhan commented Nov 14, 2024

Cleaned up interface and added upgradability

contracts/ITokenGeyser.sol Outdated Show resolved Hide resolved
contracts/TokenGeyser.sol Show resolved Hide resolved
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

@@ -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);
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.

3 participants