-
Notifications
You must be signed in to change notification settings - Fork 465
[contracts] Refactor token implementations #933
Conversation
4356b9b
to
f343c3f
Compare
7de76ae
to
428c8a4
Compare
76f6e1e
to
649b16c
Compare
expect(log.args._to).to.be.equal(to); | ||
expect(log.args._tokenId).to.be.bignumber.equal(tokenId); | ||
}); | ||
it('should transfer the token is spender is individually approved', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
const newOwner = await token.ownerOf.callAsync(tokenId); | ||
expect(newOwner).to.be.equal(to); | ||
const transferLog = txReceipt.logs[0] as LogWithDecodedArgs<DummyERC721TokenTransferEventArgs>; | ||
const receiverLog = txReceipt.logs[1] as LogWithDecodedArgs<InvalidERC721ReceiverTokenReceivedEventArgs>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be DummyERC721Receiver...
. Guessing their Events are the same but since this is a valid test might make sense to use that type.
/// @param _spender The address of the account able to transfer the tokens | ||
/// @param _value The amount of wei to be approved for transfer | ||
/// @return Whether the approval was successful or not | ||
/// @return Always true if enough call has enough gas to complete execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always true if the call has enough gas to complete execution
/// @dev `msg.sender` approves `_spender` to spend `_value` tokens | ||
/// @param _spender The address of the account able to transfer the tokens | ||
/// @param _value The amount of wei to be approved for transfer | ||
/// @return Always true if enough call has enough gas to complete execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enough enough
external | ||
{ | ||
require( | ||
_value <= 10000000000000000000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe expose this so it's readable programatically (if it does change)
_; | ||
/// @notice Transfers the ownership of an NFT from one address to another address | ||
/// @dev Throws unless `msg.sender` is the current owner, an authorized | ||
/// perator, or the approved address for this NFT. Throws if `_from` is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operator
/// Reverts if the given token ID already exists | ||
/// @param _to Address of the beneficiary that will own the minted token | ||
/// @param _tokenId ID of the token to be minted by the msg.sender | ||
function _mint(address _to, uint256 _tokenId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we expose a public mintable function for testnets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have DummyERC721Token
. Maybe I should just drop the onlyOwner
modifiers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to remove onlyOwner
from mint
but leave it on burn
.
5e9dd81
to
aa5a97e
Compare
…ate between events with same function signature
aa5a97e
to
87689f6
Compare
87689f6
to
e35788e
Compare
Description
Testing instructions
Types of changes
Checklist:
[WIP]
if it is a work in progress.[sol-cov] Fixed bug
.