-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4779c85
commit 947bbfc
Showing
8 changed files
with
45 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"network": "polygon-amoy", | ||
"startBlock": 9668200, | ||
"address": "0xC80DB01aeDAD5F6E3088c75F60E52f579Cf1D3Cb", | ||
"sideviewsActivatedBlock": 9672225 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"coreAddress": "0x87C969d083189927049f8fF3747703FB9f7a8AEd", | ||
"coreStartBlock": 16665803, | ||
"network": "base-sepolia" | ||
"network": "base-sepolia", | ||
"sideviewsActivatedBlock": 16665803 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"coreAddress": "0x1F0eb9099b9c398323dcf2F133dFdAD9dE7cF994", | ||
"coreStartBlock": 4273, | ||
"address": "0x1F0eb9099b9c398323dcf2F133dFdAD9dE7cF994", | ||
"startBlock": 4273, | ||
"network": "geist-polter" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
import { Address, BigInt } from "@graphprotocol/graph-ts"; | ||
import { Contract } from "../generated/Contract/Contract"; | ||
import { Aavegotchi } from "../generated/schema"; | ||
import {AAVEGOTCHI_DIAMOND} from "./constants"; | ||
|
||
export function updateSvg(gotchi: BigInt): Aavegotchi | null { | ||
let contract = Contract.bind(Address.fromString(AAVEGOTCHI_DIAMOND)) | ||
let svg = contract.try_getAavegotchiSvg(gotchi); | ||
if(svg.reverted) { | ||
return null; // just skip | ||
} | ||
let contract = Contract.bind( | ||
Address.fromString(process.env.AAVEGOTCHI_DIAMOND as string) | ||
); | ||
let svg = contract.try_getAavegotchiSvg(gotchi); | ||
if (svg.reverted) { | ||
return null; // just skip | ||
} | ||
|
||
let gotchiEntity = getOrCreateAavegotchi(gotchi); | ||
gotchiEntity.svg = svg.value; | ||
return gotchiEntity; | ||
let gotchiEntity = getOrCreateAavegotchi(gotchi); | ||
gotchiEntity.svg = svg.value; | ||
return gotchiEntity; | ||
} | ||
|
||
export function updateSideViews(gotchi: BigInt): Aavegotchi | null { | ||
let contract = Contract.bind(Address.fromString(AAVEGOTCHI_DIAMOND)) | ||
let svgs = contract.try_getAavegotchiSideSvgs(gotchi); | ||
let contract = Contract.bind( | ||
Address.fromString(process.env.AAVEGOTCHI_DIAMOND as string) | ||
); | ||
let svgs = contract.try_getAavegotchiSideSvgs(gotchi); | ||
|
||
if(svgs.reverted) { | ||
return null; // just skip | ||
} | ||
let gotchiEntity = getOrCreateAavegotchi(gotchi); | ||
let svgsValue = svgs.value; | ||
gotchiEntity.svg = svgsValue[0]; | ||
gotchiEntity.left = svgsValue[1]; | ||
gotchiEntity.right = svgsValue[2]; | ||
gotchiEntity.back = svgsValue[3]; | ||
return gotchiEntity | ||
if (svgs.reverted) { | ||
return null; // just skip | ||
} | ||
let gotchiEntity = getOrCreateAavegotchi(gotchi); | ||
let svgsValue = svgs.value; | ||
gotchiEntity.svg = svgsValue[0]; | ||
gotchiEntity.left = svgsValue[1]; | ||
gotchiEntity.right = svgsValue[2]; | ||
gotchiEntity.back = svgsValue[3]; | ||
return gotchiEntity; | ||
} | ||
|
||
export function getOrCreateAavegotchi(gotchi: BigInt): Aavegotchi { | ||
let gotchiEntity = Aavegotchi.load(gotchi.toString()) | ||
if(!gotchiEntity) { | ||
gotchiEntity = new Aavegotchi(gotchi.toString()) | ||
} | ||
let gotchiEntity = Aavegotchi.load(gotchi.toString()); | ||
if (!gotchiEntity) { | ||
gotchiEntity = new Aavegotchi(gotchi.toString()); | ||
} | ||
|
||
return gotchiEntity as Aavegotchi; | ||
return gotchiEntity as Aavegotchi; | ||
} |