Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved some ERC721 internal shenanigans #1450

Merged
merged 2 commits into from
Oct 18, 2018

Conversation

nventuro
Copy link
Contributor

_addTokenTo, _removeTokenFrom and _clearApproval are all internal, but shouldn't be directly called from derived contracts, since they are incomplete (they don't emit events, because they lack the required context to know which ones to emit). I made _clearApproval private, since it shouldn't generally be required, and left the other two as-is with a comment, since internal is required for EC721Enumerable.

@nventuro nventuro added this to the v2.0 milestone Oct 18, 2018
@nventuro nventuro requested a review from come-maiz October 18, 2018 21:19
Copy link
Contributor

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo a few times. Other thatn that, +1. Privatize all the things! Except the real ones.

/**
* @dev Internal function to add a token ID to the list of a given address
* Note that this function is left internal to make ERC721Enumerable possible, but is not
* intended to be calld by custom derived contracts: in particular, it emits no Transfer event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: calld

@@ -288,6 +277,8 @@ contract ERC721 is ERC165, IERC721 {

/**
* @dev Internal function to remove a token ID from the list of a given address
* Note that this function is left internal to make ERC721Enumerable possible, but is not
* intended to be calld by custom derived contracts: in particular, it emits no Transfer event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: calld

@@ -72,6 +72,8 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {

/**
* @dev Internal function to add a token ID to the list of a given address
* This function is internal due to language limitations, see the note in ERC721.sol.
* It is not intended to be calld by custom derived contracts: in particular, it emits no Transfer event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: calld

@@ -84,6 +86,8 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {

/**
* @dev Internal function to remove a token ID from the list of a given address
* This function is internal due to language limitations, see the note in ERC721.sol.
* It is not intended to be calld by custom derived contracts: in particular, it emits no Transfer event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: calld

@nventuro nventuro merged commit 8204f6a into OpenZeppelin:master Oct 18, 2018
@nventuro nventuro deleted the 721-approval branch October 18, 2018 22:07
come-maiz pushed a commit that referenced this pull request Oct 21, 2018
* Made _clearApproval private, added clarifying comments in _addTokenTo and _removeTokenFrom.

* Added approval information.

(cherry picked from commit 8204f6a)
vittominacori added a commit to vittominacori/zeppelin-solidity that referenced this pull request Nov 21, 2018
…lidity into feature/token-recover

* 'master' of https://github.com/vittominacori/zeppelin-solidity: (98 commits)
  Renamed roles private variables to adhere to code style. (OpenZeppelin#1507)
  Remove extraneous quantity check, fixes OpenZeppelin#1454 (OpenZeppelin#1455)
  Remove redundant require statements (OpenZeppelin#1409)
  Add the step to delete the build dir to the RELEASE notes (OpenZeppelin#1467)
  add an address typecast to this per issue OpenZeppelin#1457 (OpenZeppelin#1471)
  add improvement in simpletoken example OpenZeppelin#1458 (OpenZeppelin#1473)
  SafeMath Test Coverage Improved (OpenZeppelin#1477)
  The beneficiary parameter of claimRefund is replaced with refundee (OpenZeppelin#1481)
  fix ERC20.sol#L174 and ERC20.sol#L187 should be casted to an address type. (OpenZeppelin#1470)
  Fix/add comment erc721 burnable OpenZeppelin#1464 (OpenZeppelin#1469)
  Release v2.0.0
  Release candidate v2.0.0-rc.4
  Improved some ERC721 internal shenanigans (OpenZeppelin#1450)
  Add warning about trading tokens before refundable crowdsale goal is met (OpenZeppelin#1452)
  Crowdsale.buyTokens is now nonReentrant. (OpenZeppelin#1438)
  InitialRate must be strictly larger than finalRate. (OpenZeppelin#1441)
  Fixed how allowance crowdsale checks remaining tokens. (OpenZeppelin#1449)
  Deleted unnecessary import. (OpenZeppelin#1437)
  Made SampleCrowdsale a bit clearer. (OpenZeppelin#1448)
  Now setting the finalized flag before doing finalization to prevent possbile reentrancy issues. (OpenZeppelin#1447)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants