Compare commits

..

2 Commits

Author SHA1 Message Date
5a64eb2e14 Release v2.0.1 2019-02-26 16:41:00 -03:00
2648206394 Merge pull request #1647 from nventuro/safeerc20-bugfix
Fix SafeERC20.safeApprove bug

(cherry picked from commit 3111291b4a)
2019-02-26 16:36:17 -03:00
5 changed files with 8 additions and 8 deletions

View File

@ -24,7 +24,7 @@ contract ERC20FailingMock {
}
contract ERC20SucceedingMock {
uint256 private _allowance;
mapping (address => uint256) private _allowances;
function transfer(address, uint256) public returns (bool) {
return true;
@ -39,11 +39,11 @@ contract ERC20SucceedingMock {
}
function setAllowance(uint256 allowance_) public {
_allowance = allowance_;
_allowances[msg.sender] = allowance_;
}
function allowance(address, address) public view returns (uint256) {
return _allowance;
function allowance(address owner, address) public view returns (uint256) {
return _allowances[owner];
}
}

View File

@ -44,7 +44,7 @@ library SafeERC20 {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require((value == 0) || (token.allowance(msg.sender, spender) == 0));
require((value == 0) || (token.allowance(address(this), spender) == 0));
require(token.approve(spender, value));
}

View File

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

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "openzeppelin-solidity",
"version": "2.0.0",
"version": "2.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "openzeppelin-solidity",
"version": "2.0.0",
"version": "2.0.1",
"description": "Secure Smart Contract library for Solidity",
"files": [
"build",