Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// ERC721
// Invalidate cache
const args = decodedLog.args as ERC721TokenApprovalEventArgs;
const tokenAssetData = assetDataUtils.encodeERC721AssetData(decodedLog.address, args._tokenId);
this._deleteLazyStoreProxyAllowance(tokenAssetData, args._owner);
// Revalidate orders
const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker(
args._owner,
tokenAssetData,
);
await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
break;
}
}
case ERC20TokenEvents.Transfer:
case ERC721TokenEvents.Transfer: {
// ERC20 and ERC721 Transfer events have the same name so we need to distinguish them by args
if (decodedLog.args._value !== undefined) {
// ERC20
// Invalidate cache
const args = decodedLog.args as ERC20TokenTransferEventArgs;
const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address);
this._deleteLazyStoreBalance(tokenAssetData, args._from);
this._deleteLazyStoreBalance(tokenAssetData, args._to);
// Revalidate orders
const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker(
args._from,
tokenAssetData,
);
await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
break;
} else {