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

Simplify withdraw and withdrawAll by sending the funds directly to withdrawalRecipient #2

Open
cleanunicorn opened this issue Aug 8, 2022 · 0 comments

Comments

@cleanunicorn
Copy link
Member

cleanunicorn commented Aug 8, 2022

Description

/**
* @dev Throws if withdrawalRecipient is invalid
*
* @param _withdrawalRecipient withdrawalRecipient passed by caller
*/
modifier isValidRecipient(address _withdrawalRecipient) {
require(
withdrawalRecipient == _withdrawalRecipient,
"Invalid Recipient"
);
_;
}

There's only 1 valid account that funds can be sent to. Thus, the argument _withdrawalRecipient is not required.

function withdraw(address _withdrawalRecipient, uint256 _amount)

function withdraw(address _withdrawalRecipient, uint256 _amount)

Recommendation

Remove modifiers, send directly to _withdrawalRecipient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant