Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Use resource ID for token address (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansermino committed Apr 22, 2020
1 parent a6b3f3d commit 03a3bb6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contracts/handlers/ERC721Handler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,12 @@ contract ERC721Handler is IDepositHandler, ERC721Safe {
}

bytes20 recipientAddress;
bytes20 tokenAddress;

assembly {
recipientAddress := mload(add(destinationRecipientAddress, 0x20))
tokenAddress := mload(add(data, 0x4B))
}

address tokenAddress = _resourceIDToTokenContractAddress[resourceID];
require(isWhitelisted(address(tokenAddress)), "provided tokenAddress is not whitelisted");


Expand All @@ -282,11 +281,11 @@ contract ERC721Handler is IDepositHandler, ERC721Safe {

if (uint8(resourceID[31]) == chainID) {
// token is from same chain
releaseERC721(address(tokenAddress), address(this), address(recipientAddress), tokenID);
releaseERC721(tokenAddress, address(this), address(recipientAddress), tokenID);
} else {
// token is not from chain

ERC721Mintable erc721 = ERC721Mintable(address(tokenAddress));
ERC721Mintable erc721 = ERC721Mintable(tokenAddress);
erc721.safeMint(address(recipientAddress), tokenID, metaData);
}

Expand Down

0 comments on commit 03a3bb6

Please sign in to comment.