Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
d3ef93a9
Unverified
Commit
d3ef93a9
authored
Jun 05, 2020
by
Nicolás Venturo
Committed by
GitHub
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate SafeERC20.safeApprove (#2268)
* Deprecate SafeERC20.safeApprove * Add changelog entry
parent
47a7a575
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
CHANGELOG.md
CHANGELOG.md
+3
-0
SafeERC20.sol
contracts/token/ERC20/SafeERC20.sol
+7
-0
No files found.
CHANGELOG.md
View file @
d3ef93a9
...
...
@@ -10,6 +10,9 @@
*
`AccessControl`
: added a
`RoleAdminChanged`
event to
`_setAdminRole`
. (
[
#2214
](
https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2214
)
)
*
Made all
`public`
functions in the token preset contracts
`virtual`
. (
[
#2257
](
https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2257
)
)
### Deprecations
*
`SafeERC20`
: deprecated
`safeApprove`
. (
[
#2268
](
https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2268
)
)
## 3.0.1 (2020-04-27)
### Bugfixes
...
...
contracts/token/ERC20/SafeERC20.sol
View file @
d3ef93a9
...
...
@@ -27,6 +27,13 @@ library SafeERC20 {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment