This commit is contained in:
aozhiwei 2024-06-18 11:39:46 +08:00
parent 4c98412cc2
commit 62c5d98479
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 = returnValues['from'];
const to = returnValues['to'];
const tokenId = returnValues['tokenId'];
await this.mustBeMint(to, tokenId, bcconst.BC_NFT_GOLD_BULLION);
if (bcutils.isSysAddress(from)) {
await this.ingameActivate(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

@ -19,6 +19,7 @@ async function add(clsName, modName) {
async function init() {
await add('CFHero.Transfer', 'CFHero/transfer');
await add('GoldBrick.Transfer', 'GoldBrick/transfer');
}
function getEventHandle(eventProc) {