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/ fee share #96

Merged
merged 17 commits into from
Oct 16, 2023
Merged

Feat/ fee share #96

merged 17 commits into from
Oct 16, 2023

Conversation

samparsky
Copy link
Collaborator

Add the ability to deduct fee share

Copy link
Contributor

@OisinKyne OisinKyne left a comment

Choose a reason for hiding this comment

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

LGTM, couple questions mostly for my own benefit. Biggest one is probably the licensing, we may have to GPL every contract that has a solmate dep

src/lido/ObolLidoSplit.sol Show resolved Hide resolved
src/lido/ObolLidoSplit.sol Show resolved Hide resolved
docs/audit/LidoSplit.md Outdated Show resolved Hide resolved

import "forge-std/Test.sol";
import {ObolLidoSplitFactory, ObolLidoSplit, IwstETH} from "src/lido/ObolLidoSplitFactory.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

If we depend on solmate, we probably have to make these files GPL rather than MIT, no? https://github.com/transmissions11/solmate/blob/main/LICENSE I don't believe MIT counts for copyleft

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah ok, i changed it to gpl

Comment on lines +168 to +169
vm.assume(amountToDistribute > 1 ether);
vm.assume(amountToDistribute < 10 ether);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reasoning behind these constraints?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So we don't exceed the balance of the account being impersonated.

/// @param _wstETH wstETH address
constructor(address _feeRecipient, uint256 _feeShare, ERC20 _stETH, ERC20 _wstETH) {
if (_feeShare >= PERCENTAGE_SCALE) revert Invalid_FeeShare(_feeShare);
if (_feeShare > 0 && _feeRecipient == address(0)) revert Invalid_FeeRecipient();
Copy link

Choose a reason for hiding this comment

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

Great catch! This would brick the contract because of a revert in the transfer.

Comment on lines +46 to +50
/// @notice fee address
address public immutable feeRecipient;

/// @notice fee share
uint256 public immutable feeShare;
Copy link

Choose a reason for hiding this comment

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

I assume this is an intentional decision, but of course these being immutably set on the implementation means they can't ever be updated. If you wanted the ability to change while still setting immutably on the implementation, you'd need to immutably set an address for another contract that holds and returns the fee info, and allows updates.

Copy link
Collaborator Author

@samparsky samparsky Oct 16, 2023

Choose a reason for hiding this comment

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

yes, we don't want the fee to change. Changing the fee would require a sign-off from Lido and a lot of discussions and most likely require new deployments.

Copy link
Contributor

@OisinKyne OisinKyne left a comment

Choose a reason for hiding this comment

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

LGTM

@samparsky samparsky merged commit b8ebdfd into feat/audit Oct 16, 2023
1 check passed
@samparsky samparsky deleted the feat/obol-fee-share branch October 16, 2023 20:31
@OisinKyne OisinKyne restored the feat/obol-fee-share branch January 23, 2024 12:19
@OisinKyne OisinKyne deleted the feat/obol-fee-share branch May 20, 2024 12:27
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