Optimize constructor of ERC777 (#2551)

This commit is contained in:
Francisco Giordano
2021-03-02 17:29:05 -03:00
committed by GitHub
parent ba1d773176
commit 62af16b9f2
2 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@
* Overall reorganisation of the contract folder to improve clarity and discoverability. ([#2503](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2503)) * Overall reorganisation of the contract folder to improve clarity and discoverability. ([#2503](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2503))
* `ERC20Capped`: optimize gas usage of by enforcing te check directly in `_mint`. ([#2524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2524)) * `ERC20Capped`: optimize gas usage of by enforcing te check directly in `_mint`. ([#2524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2524))
* Rename `UpgradeableProxy` to `ERC1967Proxy`. ([#2547](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2547)) * Rename `UpgradeableProxy` to `ERC1967Proxy`. ([#2547](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2547))
* `ERC777`: Optimize the gas costs of the constructor. ([#2551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2551))
### How to upgrade from 3.x ### How to upgrade from 3.x

View File

@ -65,8 +65,8 @@ contract ERC777 is Context, IERC777, IERC20 {
_symbol = symbol_; _symbol = symbol_;
_defaultOperatorsArray = defaultOperators_; _defaultOperatorsArray = defaultOperators_;
for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) { for (uint256 i = 0; i < defaultOperators_.length; i++) {
_defaultOperators[_defaultOperatorsArray[i]] = true; _defaultOperators[defaultOperators_[i]] = true;
} }
// register interfaces // register interfaces