aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-08-01 04:24:53 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-08-17 08:31:21 +0800
commit1d70724bcf8ee594317274d26b033e69937aacf0 (patch)
tree00dc247a87d530e2e9408184648284cae3f1441b /packages/contracts
parent77c87cd0097dfc49749052059d7628f1c9072ea5 (diff)
downloaddexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar.gz
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar.bz2
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar.lz
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar.xz
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.tar.zst
dexon-sol-tools-1d70724bcf8ee594317274d26b033e69937aacf0.zip
Fix DummyERC721Receiver
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol64
1 files changed, 32 insertions, 32 deletions
diff --git a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol b/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
index a29ef078f..ac95e47bd 100644
--- a/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
+++ b/packages/contracts/src/2.0.0/test/DummyERC721Receiver/DummyERC721Receiver.sol
@@ -1,26 +1,19 @@
/*
-The MIT License (MIT)
-Copyright (c) 2016 Smart Contract Solutions, Inc.
+ Copyright 2018 ZeroEx Intl.
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
pragma solidity 0.4.24;
@@ -37,32 +30,39 @@ contract DummyERC721Receiver is
bytes4 constant internal ERC721_RECEIVED = bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
event TokenReceived(
+ address operator,
address from,
uint256 tokenId,
bytes data
);
- /**
- * @notice Handle the receipt of an NFT
- * @dev The ERC721 smart contract calls this function on the recipient
- * after a `safetransfer`. This function MAY throw to revert and reject the
- * transfer. This function MUST use 50,000 gas or less. Return of other
- * than the magic value MUST result in the transaction being reverted.
- * Note: the contract address is always the message sender.
- * @param _from The sending address
- * @param _tokenId The NFT identifier which is being transfered
- * @param _data Additional data with no specified format
- * @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`
- */
+ /// @notice Handle the receipt of an NFT
+ /// @dev The ERC721 smart contract calls this function on the recipient
+ /// after a `transfer`. This function MAY throw to revert and reject the
+ /// transfer. Return of other than the magic value MUST result in the
+ /// transaction being reverted.
+ /// Note: the contract address is always the message sender.
+ /// @param _operator The address which called `safeTransferFrom` function
+ /// @param _from The address which previously owned the token
+ /// @param _tokenId The NFT identifier which is being transferred
+ /// @param _data Additional data with no specified format
+ /// @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
+ /// unless throwing
function onERC721Received(
+ address _operator,
address _from,
uint256 _tokenId,
bytes _data
)
- public
+ external
returns (bytes4)
{
- emit TokenReceived(_from, _tokenId, _data);
+ emit TokenReceived(
+ _operator,
+ _from,
+ _tokenId,
+ _data
+ );
return ERC721_RECEIVED;
}
}