@@ -113,7 +113,7 @@ import {
113113} from "../utils/constants" ;
114114import { Address , BigInt , log , Bytes } from "@graphprotocol/graph-ts" ;
115115
116- import { /*Parcel,*/ Parcel , TokenCommitment } from "../../generated/schema" ;
116+ import { Parcel , TokenCommitment } from "../../generated/schema" ;
117117
118118import { updatePermissionsFromBitmap } from "../utils/decimals" ;
119119import * as erc7589 from "./erc-7589" ;
@@ -606,6 +606,8 @@ export function handleERC721ListingAdd(event: ERC721ListingAdd): void {
606606 listing . parcel = event . params . erc721TokenId . toString ( ) ;
607607 let parcel = Parcel . load ( event . params . erc721TokenId . toString ( ) ) ! ;
608608 parcel . activeListing = event . params . listingId ;
609+ parcel . save ( ) ;
610+
609611 listing . fudBoost = parcel . fudBoost ;
610612 listing . fomoBoost = parcel . fomoBoost ;
611613 listing . alphaBoost = parcel . alphaBoost ;
@@ -689,21 +691,21 @@ export function handleERC721ExecutedListing(
689691
690692 //Parcel -- update number of times traded
691693
692- // let parcel = getOrCreateParcel(
693- // event.params.erc721TokenId,
694- // event.params.buyer,
695- // event.params.erc721TokenAddress
696- // );
697- // parcel.timesTraded = parcel.timesTraded.plus(BIGINT_ONE);
698- // parcel.activeListing = null;
699- // // add to historical prices
700- // let historicalPrices = parcel.historicalPrices;
701- // if (historicalPrices == null) {
702- // historicalPrices = new Array();
703- // }
704- // historicalPrices.push(event.params.priceInWei);
705- // parcel.historicalPrices = historicalPrices;
706- // parcel.save();
694+ let parcel = getOrCreateParcel (
695+ event . params . erc721TokenId ,
696+ event . params . buyer ,
697+ event . params . erc721TokenAddress
698+ ) ;
699+ parcel . timesTraded = parcel . timesTraded . plus ( BIGINT_ONE ) ;
700+ parcel . activeListing = null ;
701+ // add to historical prices
702+ let historicalPrices = parcel . historicalPrices ;
703+ if ( historicalPrices == null ) {
704+ historicalPrices = new Array ( ) ;
705+ }
706+ historicalPrices . push ( event . params . priceInWei ) ;
707+ parcel . historicalPrices = historicalPrices ;
708+ parcel . save ( ) ;
707709 }
708710
709711 let stats = getStatisticEntity ( ) ;
@@ -734,14 +736,14 @@ export function handleERC721ListingCancelled(
734736 gotchi . locked = false ;
735737 gotchi . save ( ) ;
736738 } else if ( listing . category . equals ( BigInt . fromI32 ( 4 ) ) ) {
737- // let parcel = getOrCreateParcel(
738- // listing.tokenId,
739- // listing.seller,
740- // Address.fromString(listing.erc721TokenAddress.toHexString()),
741- // false
742- // );
743- // parcel.activeListing = null;
744- // parcel.save();
739+ let parcel = getOrCreateParcel (
740+ listing . tokenId ,
741+ listing . seller ,
742+ Address . fromString ( listing . erc721TokenAddress . toHexString ( ) ) ,
743+ false
744+ ) ;
745+ parcel . activeListing = null ;
746+ parcel . save ( ) ;
745747 }
746748
747749 listing . cancelled = true ;
0 commit comments