1
This commit is contained in:
parent
9d44e82274
commit
49e54ac902
34
server/web3dbspider/services/events/FounderTag/transfer.js
Normal file
34
server/web3dbspider/services/events/FounderTag/transfer.js
Normal file
@ -0,0 +1,34 @@
|
||||
const log = require('j7/log');
|
||||
const bcutils = require('j7/bcutils');
|
||||
const utils = require('j7/utils');
|
||||
const bcconst = require('common/bcconst');
|
||||
const BaseEventProcess = require('../common/BaseEventProcess');
|
||||
const metaFactory = require('../../../metadata/factory');
|
||||
|
||||
class Transfer extends BaseEventProcess {
|
||||
|
||||
async start() {
|
||||
const returnValues = this.getReturnValues();
|
||||
const from = bcutils.toNormalAddress(returnValues['from']);
|
||||
const to = bcutils.toNormalAddress(returnValues['to']);
|
||||
const tokenId = returnValues['tokenId'];
|
||||
|
||||
await this.mustBeMint(to, tokenId, bcconst.BC_NFT_GOLD_BULLION);
|
||||
if (bcutils.isSysAddress(from)) {
|
||||
await this.ingameActivate(from, to, tokenId, bcconst.BC_NFT_GOLD_BULLION);
|
||||
} else {
|
||||
await this.add721NftRefresh
|
||||
(
|
||||
this.getNetId(),
|
||||
this.getContractAddress(),
|
||||
this.getContractName(),
|
||||
tokenId
|
||||
);
|
||||
}
|
||||
await this.update721NftOwner(tokenId, this.getContractAddress(), to, from);
|
||||
await this.markOk();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Transfer;
|
@ -21,6 +21,7 @@ async function init() {
|
||||
await add('CFHero.Transfer', 'CFHero/transfer');
|
||||
await add('CFHero_normal.Transfer', 'CFHero_normal/transfer');
|
||||
await add('GoldBrick.Transfer', 'GoldBrick/transfer');
|
||||
await add('FounderTag.Transfer', 'FounderTag/transfer');
|
||||
await add('NFTLock.Lock', 'NFTLock/lock');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user