Commit 943b3e37 by github-actions

Merge upstream openzeppelin-contracts into upstream-patched

parents d438fa08 0a905d67
......@@ -229,7 +229,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata {
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
......
......@@ -25,7 +25,7 @@ library Math {
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
// (a + b) / 2 can overflow, so we distribute.
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
......@@ -175,10 +175,6 @@ library SafeMath {
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
......
......@@ -9,7 +9,7 @@ A token is a _representation of something in the blockchain_. This something can
Much of the confusion surrounding tokens comes from two concepts getting mixed up: _token contracts_ and the actual _tokens_.
A _token contract_ is simply an Ethereum smart contract. "Sending tokens" actually means "calling a method on a smart contract that someone wrote and deployed". At the end of the day, a token contract is not much more a mapping of addresses to balances, plus some methods to add and subtract from those balances.
A _token contract_ is simply an Ethereum smart contract. "Sending tokens" actually means "calling a method on a smart contract that someone wrote and deployed". At the end of the day, a token contract is not much more than a mapping of addresses to balances, plus some methods to add and subtract from those balances.
It is these balances that represent the _tokens_ themselves. Someone "has tokens" when their balance in the token contract is non-zero. That's it! These balances could be considered money, experience points in a game, deeds of ownership, or voting rights, and each of these tokens would be stored in different token contracts.
......
......@@ -41,7 +41,7 @@
"solidity-coverage": "^0.7.11",
"solidity-docgen": "^0.5.3",
"web3": "^1.3.0",
"yargs": "^16.2.0"
"yargs": "^17.0.0"
}
},
"node_modules/@babel/code-frame": {
......@@ -1909,14 +1909,14 @@
}
},
"node_modules/@truffle/contract": {
"version": "4.3.14",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.14.tgz",
"integrity": "sha512-F/IogCpQetrx8BBtKhfA4zo5pBpnMEscmiDGw4qQ+tUPZxam1KAOiTZ3srYoyxK8wHw/136Wn4CzzX2StgFaKQ==",
"version": "4.3.15",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.15.tgz",
"integrity": "sha512-PHM6tCF/GB3r/t5YbeXagtg9XPtjFgbc5YnRcXs8m2Cp2hXFeU91n1dxmIkBVJklia+tWGqLuVxvMqI88tcWbw==",
"dev": true,
"dependencies": {
"@truffle/blockchain-utils": "^0.0.29",
"@truffle/contract-schema": "^3.4.0",
"@truffle/debug-utils": "^5.0.14",
"@truffle/debug-utils": "^5.0.15",
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"bignumber.js": "^7.2.1",
......@@ -1947,9 +1947,9 @@
"dev": true
},
"node_modules/@truffle/contract/node_modules/@truffle/codec": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.4.tgz",
"integrity": "sha512-h8M8LKORuvtd3X+VdLH//Ql6HS9jw977vHGuRPYqlFkTvvdLEjzsg4PFnxMvusnus6AWtRclbAfSOiojT6JcMg==",
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.5.tgz",
"integrity": "sha512-M8YR8hKxXTypgg8g8iD/rUkkWgS89/NqkLAR+ZpZIzO3PZ5pkiIysO2VkWeqJid8hVDM4O4Eswgt2ISrQzsVRg==",
"dev": true,
"dependencies": {
"big.js": "^5.2.2",
......@@ -1966,12 +1966,12 @@
}
},
"node_modules/@truffle/contract/node_modules/@truffle/debug-utils": {
"version": "5.0.14",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.14.tgz",
"integrity": "sha512-f5N+OafG3X9h5eJ+oQ4No+Qu7mmasEUx38EclRVY3VyKIoAObZGMSDy5hev5QEHFMtgV20I+DAypRN0+A5Fb5Q==",
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.15.tgz",
"integrity": "sha512-G5y+0Xx+IM6C9b8Vjm6bl73wIjB1/2qtVKnBlhbKfgxNpRgxFvXE/jeSkCPYpcnF3CsGign0dsIyZj59tMqE5A==",
"dev": true,
"dependencies": {
"@truffle/codec": "^0.10.4",
"@truffle/codec": "^0.10.5",
"@trufflesuite/chromafi": "^2.2.2",
"bn.js": "^5.1.3",
"chalk": "^2.4.2",
......@@ -11790,6 +11790,15 @@
"node": ">=6"
}
},
"node_modules/mocha/node_modules/ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/mocha/node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
......@@ -11824,6 +11833,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mocha/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/mocha/node_modules/js-yaml": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
......@@ -11887,6 +11905,32 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mocha/node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/mocha/node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/mocha/node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
......@@ -11917,6 +11961,24 @@
"node": ">= 8"
}
},
"node_modules/mocha/node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dev": true,
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/mock-fs": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz",
......@@ -17346,9 +17408,9 @@
"dev": true
},
"node_modules/yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.0.tgz",
"integrity": "sha512-gbtedDPfBgG40iLbaRXhqYJycUYqFVZQLIxl1cG5Ez/xZL/47TetSYzPSIixkWa36GKHr9D/o/oSG1vHXF4zTw==",
"dev": true,
"dependencies": {
"cliui": "^7.0.2",
......@@ -17360,7 +17422,7 @@
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=10"
"node": ">=12"
}
},
"node_modules/yargs-parser": {
......@@ -18923,14 +18985,14 @@
}
},
"@truffle/contract": {
"version": "4.3.14",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.14.tgz",
"integrity": "sha512-F/IogCpQetrx8BBtKhfA4zo5pBpnMEscmiDGw4qQ+tUPZxam1KAOiTZ3srYoyxK8wHw/136Wn4CzzX2StgFaKQ==",
"version": "4.3.15",
"resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.3.15.tgz",
"integrity": "sha512-PHM6tCF/GB3r/t5YbeXagtg9XPtjFgbc5YnRcXs8m2Cp2hXFeU91n1dxmIkBVJklia+tWGqLuVxvMqI88tcWbw==",
"dev": true,
"requires": {
"@truffle/blockchain-utils": "^0.0.29",
"@truffle/contract-schema": "^3.4.0",
"@truffle/debug-utils": "^5.0.14",
"@truffle/debug-utils": "^5.0.15",
"@truffle/error": "^0.0.13",
"@truffle/interface-adapter": "^0.4.22",
"bignumber.js": "^7.2.1",
......@@ -18950,9 +19012,9 @@
"dev": true
},
"@truffle/codec": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.4.tgz",
"integrity": "sha512-h8M8LKORuvtd3X+VdLH//Ql6HS9jw977vHGuRPYqlFkTvvdLEjzsg4PFnxMvusnus6AWtRclbAfSOiojT6JcMg==",
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.10.5.tgz",
"integrity": "sha512-M8YR8hKxXTypgg8g8iD/rUkkWgS89/NqkLAR+ZpZIzO3PZ5pkiIysO2VkWeqJid8hVDM4O4Eswgt2ISrQzsVRg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
......@@ -18969,12 +19031,12 @@
}
},
"@truffle/debug-utils": {
"version": "5.0.14",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.14.tgz",
"integrity": "sha512-f5N+OafG3X9h5eJ+oQ4No+Qu7mmasEUx38EclRVY3VyKIoAObZGMSDy5hev5QEHFMtgV20I+DAypRN0+A5Fb5Q==",
"version": "5.0.15",
"resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-5.0.15.tgz",
"integrity": "sha512-G5y+0Xx+IM6C9b8Vjm6bl73wIjB1/2qtVKnBlhbKfgxNpRgxFvXE/jeSkCPYpcnF3CsGign0dsIyZj59tMqE5A==",
"dev": true,
"requires": {
"@truffle/codec": "^0.10.4",
"@truffle/codec": "^0.10.5",
"@trufflesuite/chromafi": "^2.2.2",
"bn.js": "^5.1.3",
"chalk": "^2.4.2",
......@@ -26895,6 +26957,12 @@
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
"dev": true
},
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"dev": true
},
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
......@@ -26917,6 +26985,12 @@
"path-exists": "^4.0.0"
}
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"js-yaml": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz",
......@@ -26959,6 +27033,26 @@
"p-limit": "^3.0.2"
}
},
"string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
},
"supports-color": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
......@@ -26976,6 +27070,21 @@
"requires": {
"isexe": "^2.0.0"
}
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
}
}
},
......@@ -31385,9 +31494,9 @@
"dev": true
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"version": "17.0.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.0.tgz",
"integrity": "sha512-gbtedDPfBgG40iLbaRXhqYJycUYqFVZQLIxl1cG5Ez/xZL/47TetSYzPSIixkWa36GKHr9D/o/oSG1vHXF4zTw==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
......@@ -78,6 +78,6 @@
"solidity-coverage": "^0.7.11",
"solidity-docgen": "^0.5.3",
"web3": "^1.3.0",
"yargs": "^16.2.0"
"yargs": "^17.0.0"
}
}
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