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
d20d03c1
Commit
d20d03c1
authored
Jul 20, 2018
by
Amir Bandeali
Committed by
Nicolás Venturo
Jul 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant modifiers from safeTransferFrom (#1029) (#1030)
parent
ebd4b5e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
21 deletions
+1
-21
ERC721BasicToken.sol
contracts/token/ERC721/ERC721BasicToken.sol
+1
-21
No files found.
contracts/token/ERC721/ERC721BasicToken.sol
View file @
d20d03c1
...
@@ -32,24 +32,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
...
@@ -32,24 +32,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
// Mapping from owner to operator approvals
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) internal operatorApprovals;
mapping (address => mapping (address => bool)) internal operatorApprovals;
/**
* @dev Guarantees msg.sender is owner of the given token
* @param _tokenId uint256 ID of the token to validate its ownership belongs to msg.sender
*/
modifier onlyOwnerOf(uint256 _tokenId) {
require(ownerOf(_tokenId) == msg.sender);
_;
}
/**
* @dev Checks msg.sender can transfer a token, by being owner, approved, or operator
* @param _tokenId uint256 ID of the token to validate
*/
modifier canTransfer(uint256 _tokenId) {
require(isApprovedOrOwner(msg.sender, _tokenId));
_;
}
constructor()
constructor()
public
public
{
{
...
@@ -158,8 +140,8 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
...
@@ -158,8 +140,8 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
uint256 _tokenId
uint256 _tokenId
)
)
public
public
canTransfer(_tokenId)
{
{
require(isApprovedOrOwner(msg.sender, _tokenId));
require(_from != address(0));
require(_from != address(0));
require(_to != address(0));
require(_to != address(0));
...
@@ -188,7 +170,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
...
@@ -188,7 +170,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
uint256 _tokenId
uint256 _tokenId
)
)
public
public
canTransfer(_tokenId)
{
{
// solium-disable-next-line arg-overflow
// solium-disable-next-line arg-overflow
safeTransferFrom(_from, _to, _tokenId, "");
safeTransferFrom(_from, _to, _tokenId, "");
...
@@ -213,7 +194,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
...
@@ -213,7 +194,6 @@ contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {
bytes _data
bytes _data
)
)
public
public
canTransfer(_tokenId)
{
{
transferFrom(_from, _to, _tokenId);
transferFrom(_from, _to, _tokenId);
// solium-disable-next-line arg-overflow
// solium-disable-next-line arg-overflow
...
...
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