1
This commit is contained in:
parent
eb682da7ff
commit
0f4e6cc563
@ -16,14 +16,17 @@ class Transfer extends BaseEventProcess {
|
|||||||
if (bcutils.isSysAddress(from)) {
|
if (bcutils.isSysAddress(from)) {
|
||||||
const airDropMeta = metaFactory.getAirDrop(tokenId);
|
const airDropMeta = metaFactory.getAirDrop(tokenId);
|
||||||
if (airDropMeta) {
|
if (airDropMeta) {
|
||||||
await this.mint721Nft(
|
const exists = await this.exists721Nft(tokenId, this.getContractAddress());
|
||||||
to,
|
if (!exists) {
|
||||||
tokenId,
|
await this.mint721Nft(
|
||||||
airDropMeta['item_id'],
|
to,
|
||||||
bcconst.BC_NFT_HERO,
|
tokenId,
|
||||||
this.getContractAddress(),
|
airDropMeta['item_id'],
|
||||||
this.getBlockNumber()
|
bcconst.BC_NFT_HERO,
|
||||||
);
|
this.getContractAddress(),
|
||||||
|
this.getBlockNumber()
|
||||||
|
);
|
||||||
|
}
|
||||||
await this.apiMint(airDropMeta);
|
await this.apiMint(airDropMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,23 @@ class BaseEventProcess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async exists721Nft(tokenId, contractAddress) {
|
||||||
|
const logHead = this.genLogHead(' exists721Nft ');
|
||||||
|
const {err, row} = await this.bcNftDbConn(
|
||||||
|
'ormSelectOne',
|
||||||
|
't_nft',
|
||||||
|
[
|
||||||
|
['net_id', this.getNetId()],
|
||||||
|
['contract_address', contractAddress],
|
||||||
|
['token_id', tokenId],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
if (err) {
|
||||||
|
this.throwError(logHead + err);
|
||||||
|
}
|
||||||
|
return row ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
async mint721Nft(address, tokenId, itemId, tokenType,
|
async mint721Nft(address, tokenId, itemId, tokenType,
|
||||||
contractAddress, blockNumber) {
|
contractAddress, blockNumber) {
|
||||||
const logHead = this.genLogHead(' mint721Nft ');
|
const logHead = this.genLogHead(' mint721Nft ');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user