This commit is contained in:
aozhiwei 2024-07-18 14:54:57 +08:00
parent 9d44e82274
commit 49e54ac902
2 changed files with 35 additions and 0 deletions

View 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;

View File

@ -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');
}