-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
FUN-1527 Add updateFromPrevious method to Functions ToS #13795
Conversation
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/interfaces/ITermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
contracts/src/v0.8/functions/dev/v1_X/accessControl/TermsOfServiceAllowList.sol
Outdated
Show resolved
Hide resolved
@@ -197,4 +201,17 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, | |||
|
|||
return blockedSenders; | |||
} | |||
|
|||
function migratePreviouslyAllowedSenders(address[] memory previousSendersToAdd) external override onlyOwner { |
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.
💭 do we want to restrict this to be run only once?
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 was thinking about something like that as well, but if the diff list gets too large it may need to be run more than once.
@@ -197,4 +201,17 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, | |||
|
|||
return blockedSenders; | |||
} | |||
|
|||
function migratePreviouslyAllowedSenders(address[] memory previousSendersToAdd) external override onlyOwner { | |||
require(s_previousToSContract != address(0), "No previous ToS contract"); |
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.
This should use a custom error, rather than a require statement.
@@ -197,4 +201,17 @@ contract TermsOfServiceAllowList is ITermsOfServiceAllowList, IAccessController, | |||
|
|||
return blockedSenders; | |||
} | |||
|
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.
Missing natspec inherit
/// @inheritdoc ITermsOfServiceAllowList |
require(s_previousToSContract != address(0), "No previous ToS contract"); | ||
IAccessController previousToSContract = IAccessController(s_previousToSContract); | ||
for (uint256 i = 0; i < previousSendersToAdd.length; ++i) { | ||
if ( |
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.
Gas golf: If you split this into a nested if statement it saves 36 gas. This is because having them together spends the gas to evaluate each of them before doing the boolean logic.
Quality Gate passedIssues Measures |
See detailed description in Jira ticket: https://smartcontract-it.atlassian.net/browse/FUN-1527