Skip to content

Commit 4fefcca

Browse files
committed
fix: update fake sepolia contracts
1 parent 6cb138c commit 4fefcca

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

config/baseSepolia.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"coreStartBlock": 24920240,
44
"realmAddress": "0xb674fD8E82967d53Bd4513c25DB61943504884aA",
55
"realmStartBlock": 25528181,
6-
"fakeCardAddress": "0xfcf69c08d6AbE469Bd2D55926d83d50B9c502485",
7-
"fakeCardStartBlock": 25536651,
8-
"fakeGotchisAddress": "0x5b12F03201b4260B8976114Cc549435FFF5eb9aE",
9-
"fakeGotchisStartBlock": 25536675,
6+
"fakeCardAddress": "0xB60175D86f6Ab871A9aefD3e350a9c5E939F4D3B",
7+
"fakeCardStartBlock": 25710591,
8+
"fakeGotchisAddress": "0xfE565a266760D5b23FE241D1eb6F52eeba8882E7",
9+
"fakeGotchisStartBlock": 25710614,
1010
"wearableAddress": "0x83FAaC162062524e041dFB43681B0d958eD49Acb",
1111
"wearableStartBlock": 24920321,
1212
"network": "base-sepolia"

src/mappings/diamond.ts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ import {
113113
} from "../utils/constants";
114114
import { 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

118118
import { updatePermissionsFromBitmap } from "../utils/decimals";
119119
import * 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;

subgraph.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ dataSources:
205205
name: FAKEGotchisCardDiamond
206206
network: "base-sepolia"
207207
source:
208-
address: "0xfcf69c08d6AbE469Bd2D55926d83d50B9c502485"
208+
address: "0xB60175D86f6Ab871A9aefD3e350a9c5E939F4D3B"
209209
abi: IERC1155
210-
startBlock: 25536651
210+
startBlock: 25710591
211211
mapping:
212212
kind: ethereum/events
213213
apiVersion: 0.0.6
@@ -231,9 +231,9 @@ dataSources:
231231
name: FAKEGotchisNFTDiamond
232232
network: "base-sepolia"
233233
source:
234-
address: "0x5b12F03201b4260B8976114Cc549435FFF5eb9aE"
234+
address: "0xfE565a266760D5b23FE241D1eb6F52eeba8882E7"
235235
abi: IERC721
236-
startBlock: 25536675
236+
startBlock: 25710614
237237
mapping:
238238
kind: ethereum/events
239239
apiVersion: 0.0.6

0 commit comments

Comments
 (0)