Skip to content

Remove unused using statements in GovernorCompatibilityBravo#3506

Merged
Amxx merged 1 commit into
OpenZeppelin:masterfrom
DanielVF:patch-7
Jun 27, 2022
Merged

Remove unused using statements in GovernorCompatibilityBravo#3506
Amxx merged 1 commit into
OpenZeppelin:masterfrom
DanielVF:patch-7

Conversation

@DanielVF
Copy link
Copy Markdown
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
Copy Markdown
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
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