Rearranged preconditions in ERC721 proxy

This commit is contained in:
Greg Hysen
2018-04-12 16:08:00 -07:00
committed by Amir Bandeali
parent cb27fe17cd
commit 37cfeed0f5

View File

@@ -45,14 +45,14 @@ contract ERC721Proxy is
// No work to do if amount is zero
if (amount == 0) return;
// There exists only 1 of each token.
require(amount == 1);
// Decode metadata
address token;
uint256 tokenId;
(token, tokenId) = decodeMetadata(assetMetadata);
// There exists only 1 of each token.
require(amount == 1);
// Either succeeds or throws.
ERC721Token(token).transferFrom(from, to, tokenId);
}