Skip to content

Commit

Permalink
Initialize subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
bashybaranaba committed Jan 5, 2025
1 parent f20dcb3 commit 04fa98d
Show file tree
Hide file tree
Showing 17 changed files with 582 additions and 3,690 deletions.
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,38 @@ node_modules

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337

# Graph CLI generated artifacts
build/
generated/

# Dependency directories
node_modules/
jspm_packages/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# dotenv environment variables file
.env

# Testing
coverage
coverage.json

# Typechain
typechain
typechain-types

# Hardhat files
cache
File renamed without changes.
161 changes: 32 additions & 129 deletions graph/abraham/abis/Abraham.json → abraham-ai/abis/Abraham.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,80 +167,6 @@
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "listingId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "creationId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "seller",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "pricePerPraise",
"type": "uint256"
}
],
"name": "PraiseListed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "listingId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "creationId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "buyer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "totalCost",
"type": "uint256"
}
],
"name": "PraiseSold",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -348,6 +274,12 @@
"internalType": "uint256",
"name": "mannaRefunded",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "unpraiseCost",
"type": "uint256"
}
],
"name": "Unpraised",
Expand Down Expand Up @@ -412,16 +344,6 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "listingId", "type": "uint256" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "buyPraise",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "creationCount",
Expand Down Expand Up @@ -474,33 +396,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPraiseListings",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "creationId",
"type": "uint256"
},
{ "internalType": "address", "name": "seller", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{
"internalType": "uint256",
"name": "pricePerPraise",
"type": "uint256"
}
],
"internalType": "struct Abraham.PraiseListing[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "creationId", "type": "uint256" },
Expand All @@ -520,22 +415,11 @@
},
{
"inputs": [],
"name": "initUnpraisePrice",
"name": "initUnpraiseCost",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "creationId", "type": "uint256" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{ "internalType": "uint256", "name": "pricePerPraise", "type": "uint256" }
],
"name": "listPraiseForSale",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
Expand Down Expand Up @@ -569,13 +453,14 @@
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "praiseListings",
"inputs": [
{ "internalType": "uint256", "name": "", "type": "uint256" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"name": "praiseStacks",
"outputs": [
{ "internalType": "uint256", "name": "creationId", "type": "uint256" },
{ "internalType": "address", "name": "seller", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{ "internalType": "uint256", "name": "pricePerPraise", "type": "uint256" }
{ "internalType": "address", "name": "user", "type": "address" },
{ "internalType": "uint256", "name": "pricePaid", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
Expand All @@ -596,6 +481,24 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "newPrice", "type": "uint256" }
],
"name": "setInitPraisePrice",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "newCost", "type": "uint256" }
],
"name": "setInitUnpraiseCost",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions abraham-ai/networks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"base-sepolia": {
"Abraham": {
"address": "0x3017258EB67f816F9504c7e0d41665022166d66E",
"startBlock": 20170925
}
}
}
10 changes: 5 additions & 5 deletions graph/abraham/package.json → abraham-ai/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "abraham",
"name": "abraham-ai",
"license": "UNLICENSED",
"scripts": {
"codegen": "graph codegen",
"build": "graph build",
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ abraham",
"create-local": "graph create --node http://localhost:8020/ abraham",
"remove-local": "graph remove --node http://localhost:8020/ abraham",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 abraham",
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ abraham-ai",
"create-local": "graph create --node http://localhost:8020/ abraham-ai",
"remove-local": "graph remove --node http://localhost:8020/ abraham-ai",
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 abraham-ai",
"test": "graph test"
},
"dependencies": {
Expand Down
36 changes: 1 addition & 35 deletions graph/abraham/schema.graphql → abraham-ai/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ type ConvictionUpdated @entity(immutable: true) {
transactionHash: Bytes!
}

type Creation @entity {
id: ID!
creationId: BigInt!
metadataUri: String!
totalStaked: BigInt!
praisePool: BigInt!
conviction: BigInt!
createdAt: BigInt!
updatedAt: BigInt!
}

type CreationAdded @entity(immutable: true) {
id: Bytes!
creationId: BigInt! # uint256
Expand All @@ -55,30 +44,6 @@ type OwnershipTransferred @entity(immutable: true) {
transactionHash: Bytes!
}

type PraiseListed @entity(immutable: true) {
id: Bytes!
listingId: BigInt! # uint256
creationId: BigInt! # uint256
seller: Bytes! # address
amount: BigInt! # uint256
pricePerPraise: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type PraiseSold @entity(immutable: true) {
id: Bytes!
listingId: BigInt! # uint256
creationId: BigInt! # uint256
buyer: Bytes! # address
amount: BigInt! # uint256
totalCost: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type Praised @entity(immutable: true) {
id: Bytes!
creationId: BigInt! # uint256
Expand Down Expand Up @@ -116,6 +81,7 @@ type Unpraised @entity(immutable: true) {
user: Bytes! # address
unitsUnpraised: BigInt! # uint256
mannaRefunded: BigInt! # uint256
unpraiseCost: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
Expand Down
Loading

0 comments on commit 04fa98d

Please sign in to comment.