1
This commit is contained in:
parent
4c98412cc2
commit
62c5d98479
34
server/web3dbspider/services/events/GoldBrick/transfer.js
Normal file
34
server/web3dbspider/services/events/GoldBrick/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 = 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;
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user