Merge branch 'release-v2.3.0'

pull/1776/head
Nicolás Venturo 6 years ago
commit a83f680a63
  1. 2
      CHANGELOG.md
  2. 31
      contracts/token/ERC777/ERC777.sol
  3. 2
      contracts/token/ERC777/IERC777.sol
  4. 2
      ethpm.json
  5. 39
      package-lock.json
  6. 4
      package.json
  7. 2
      scripts/release/release.sh

@ -1,6 +1,6 @@
# Changelog
## 2.3.0 (unreleased)
## 2.3.0 (2019-05-27)
### New features:
* `ERC1820`: added support for interacting with the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) registry contract (`IERC1820Registry`), as well as base contracts that can be registered as implementers there. ([#1677](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1677))

@ -122,7 +122,7 @@ contract ERC777 is IERC777, IERC20 {
}
/**
* @dev Returns the amount of tokens owned by an account (`owner`).
* @dev Returns the amount of tokens owned by an account (`tokenHolder`).
*/
function balanceOf(address tokenHolder) public view returns (uint256) {
return _balances[tokenHolder];
@ -252,8 +252,8 @@ contract ERC777 is IERC777, IERC20 {
* not have allowance, and accounts with allowance may not be operators
* themselves.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
function allowance(address holder, address spender) public view returns (uint256) {
return _allowances[holder][spender];
}
/**
@ -262,7 +262,8 @@ contract ERC777 is IERC777, IERC20 {
* Note that accounts cannot have allowance issued by their operators.
*/
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
address holder = msg.sender;
_approve(holder, spender, value);
return true;
}
@ -275,18 +276,18 @@ contract ERC777 is IERC777, IERC20 {
*
* Emits `Sent` and `Transfer` events.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) {
function transferFrom(address holder, address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
require(sender != address(0), "ERC777: transfer from the zero address");
require(holder != address(0), "ERC777: transfer from the zero address");
address operator = msg.sender;
address spender = msg.sender;
_callTokensToSend(operator, sender, recipient, amount, "", "");
_callTokensToSend(spender, holder, recipient, amount, "", "");
_move(operator, sender, recipient, amount, "", "");
_approve(sender, operator, _allowances[sender][operator].sub(amount));
_move(spender, holder, recipient, amount, "", "");
_approve(holder, spender, _allowances[holder][spender].sub(amount));
_callTokensReceived(operator, sender, recipient, amount, "", "", false);
_callTokensReceived(spender, holder, recipient, amount, "", "", false);
return true;
}
@ -406,14 +407,14 @@ contract ERC777 is IERC777, IERC20 {
emit Transfer(from, to, amount);
}
function _approve(address owner, address spender, uint256 value) private {
function _approve(address holder, address spender, uint256 value) private {
// TODO: restore this require statement if this function becomes internal, or is called at a new callsite. It is
// currently unnecessary.
//require(owner != address(0), "ERC777: approve from the zero address");
//require(holder != address(0), "ERC777: approve from the zero address");
require(spender != address(0), "ERC777: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
_allowances[holder][spender] = value;
emit Approval(holder, spender, value);
}
/**

@ -59,7 +59,7 @@ interface IERC777 {
function send(address recipient, uint256 amount, bytes calldata data) external;
/**
* @dev Destoys `amount` tokens from the caller's account, reducing the
* @dev Destroys `amount` tokens from the caller's account, reducing the
* total supply.
*
* If a send hook is registered for the caller, the corresponding function

@ -1,6 +1,6 @@
{
"package_name": "zeppelin",
"version": "2.2.0",
"version": "2.3.0",
"description": "Secure Smart Contract library for Solidity",
"authors": [
"OpenZeppelin Community <maintainers@openzeppelin.org>"

39
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "openzeppelin-solidity",
"version": "2.2.0",
"version": "2.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -922,9 +922,9 @@
},
"dependencies": {
"core-js": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.2.tgz",
"integrity": "sha512-3poRGjbu56leCtZCZCzCgQ7GcKOflDFnjWIepaPFUsM0IXUBrne10sl3aa2Bkcz3+FjRdIxBe9dAMhIJmEnQNA==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.3.tgz",
"integrity": "sha512-PWZ+ZfuaKf178BIAg+CRsljwjIMRV8MY00CbZczkR6Zk5LfkSkjGoaab3+bqRQWVITNZxQB7TFYz+CFcyuamvA==",
"dev": true
}
}
@ -3346,20 +3346,20 @@
"dev": true
},
"core-js": {
"version": "2.6.8",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.8.tgz",
"integrity": "sha512-RWlREFU74TEkdXzyl1bka66O3kYp8jeTXrvJZDzVVMH8AiHUSOFpL1yfhQJ+wHocAm1m+4971W1PPzfLuCv1vg==",
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
"integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==",
"dev": true
},
"core-js-compat": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.1.2.tgz",
"integrity": "sha512-X0Ch5f6itrHxhg5HSJucX6nNLNAGr+jq+biBh6nPGc3YAWz2a8p/ZIZY8cUkDzSRNG54omAuu3hoEF8qZbu/6Q==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.1.3.tgz",
"integrity": "sha512-EP018pVhgwsKHz3YoN1hTq49aRe+h017Kjz0NQz3nXV0cCRMvH3fLQl+vEPGr4r4J5sk4sU3tUC7U1aqTCeJeA==",
"dev": true,
"requires": {
"browserslist": "^4.6.0",
"core-js-pure": "3.1.2",
"semver": "^6.0.0"
"core-js-pure": "3.1.3",
"semver": "^6.1.0"
},
"dependencies": {
"semver": {
@ -3371,9 +3371,9 @@
}
},
"core-js-pure": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.2.tgz",
"integrity": "sha512-5ckIdBF26B3ldK9PM177y2ZcATP2oweam9RskHSoqfZCrJ2As6wVg8zJ1zTriFsZf6clj/N1ThDFRGaomMsh9w==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.1.3.tgz",
"integrity": "sha512-k3JWTrcQBKqjkjI0bkfXS0lbpWPxYuHWfMMjC1VDmzU4Q58IwSbuXSo99YO/hUHlw/EB4AlfA2PVxOGkrIq6dA==",
"dev": true
},
"core-util-is": {
@ -5712,11 +5712,6 @@
"pkg-dir": "^3.0.0"
},
"dependencies": {
"@types/node": {
"version": "10.14.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.7.tgz",
"integrity": "sha512-on4MmIDgHXiuJDELPk1NFaKVUxxCFr37tm8E9yN6rAiF5Pzp/9bBfBHkoexqRiY+hk/Z04EJU9kKEb59YqJ82A=="
},
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
@ -10014,8 +10009,8 @@
}
},
"openzeppelin-docsite": {
"version": "github:OpenZeppelin/openzeppelin-docsite#22388b7a891a6fcdd333efef9e4f7f584ae5b826",
"from": "github:OpenZeppelin/openzeppelin-docsite#22388b7a891a6fcdd333efef9e4f7f584ae5b826",
"version": "github:OpenZeppelin/openzeppelin-docsite#ee1df82d52ad3df4337b20392627975091f8d5b3",
"from": "github:OpenZeppelin/openzeppelin-docsite#ee1df82d52ad3df4337b20392627975091f8d5b3",
"dev": true,
"requires": {
"docusaurus": "1.7.2",

@ -1,6 +1,6 @@
{
"name": "openzeppelin-solidity",
"version": "2.2.0",
"version": "2.3.0",
"description": "Secure Smart Contract library for Solidity",
"files": [
"build",
@ -59,7 +59,7 @@
"ganache-cli-coverage": "https://github.com/frangio/ganache-cli/releases/download/v6.4.1-coverage/ganache-cli-coverage-6.4.1.tgz",
"micromatch": "^4.0.2",
"nodemon": "^1.19.0",
"openzeppelin-docsite": "github:OpenZeppelin/openzeppelin-docsite#22388b7a891a6fcdd333efef9e4f7f584ae5b826",
"openzeppelin-docsite": "github:OpenZeppelin/openzeppelin-docsite#ee1df82d52ad3df4337b20392627975091f8d5b3",
"openzeppelin-test-helpers": "^0.4",
"solhint": "^1.5.0",
"solidity-coverage": "github:rotcivegaf/solidity-coverage#5875f5b7bc74d447f3312c9c0e9fc7814b482477",

@ -88,7 +88,7 @@ elif [[ "$*" == "rc" ]]; then
assert_current_branch "$(current_release_branch)"
# Bumps rc number, commits and tags
npm version prelease
npm version prerelease
push_and_publish next

Loading…
Cancel
Save