Commit 93d990c6 by Francisco Giordano Committed by Hadrien Croubois

Optimize constructor of ERC777 (#2551)

(cherry picked from commit 62af16b9)
parent 3dfd02b4
...@@ -16,6 +16,7 @@ ...@@ -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
......
...@@ -65,8 +65,8 @@ contract ERC777 is Context, IERC777, IERC20 { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment