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

Remove unused using statements in GovernorCompatibilityBravo #3506

Merged
merged 1 commit into from
Jun 27, 2022

Conversation

DanielVF
Copy link
Contributor

@DanielVF DanielVF commented Jun 24, 2022

The two using statements in GovernorCompatibilityBravo.sol are not used inside the contract, and cannot affect anything upstream or downstream of them via inheritance. They should be safe to remove.

using Counters for Counters.Counter;
using Timers for Timers.BlockNumber;

Since Solidity 0.7.0 using statements no longer affect downstream contracts in inheritance hierarchy:

using A for B only affects the contract it is mentioned in. Previously, the effect was inherited. Now, you have to repeat the using statement in all derived contracts that make use of the feature.

GovernorCompatibilityBravo.sol contains two `using` statements which are not used inside that contract.

```javascript
using Counters for Counters.Counter;
using Timers for Timers.BlockNumber;
```

[Since Solidity 0.7.0](https://docs.soliditylang.org/en/latest/070-breaking-changes.html#functions-and-events), `using` statements no longer affect downstream contracts in inheritance hierarchy.

> `using A for B` only affects the contract it is mentioned in. Previously, the effect was inherited. Now, you have to repeat the `using` statement in all derived contracts that make use of the feature.

Since these statements are not used inside this contract, and cannot affect anything upstream or downstream of them inheritance, they should be safe to remove.
@Amxx
Copy link
Collaborator

Amxx commented Jun 27, 2022

Thank you @DanielVF for finding tat and openning that PR

@Amxx Amxx merged commit e8c60f9 into OpenZeppelin:master Jun 27, 2022
@Amxx Amxx added this to the 4.8 milestone Jun 27, 2022
@Amxx Amxx mentioned this pull request Jun 27, 2022
ronhuafeng added a commit to ronhuafeng/openzeppelin-contracts that referenced this pull request Sep 9, 2022
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.

2 participants