-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cairo template fix + readme + init db fun
- Loading branch information
Showing
15 changed files
with
280 additions
and
95 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 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
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,67 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("BACKEND_DATABASE_URL") | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
email String @unique | ||
starknetAddress String? @unique | ||
kakarotAddress String? | ||
nostrAddress String? | ||
role Role @default(USER) | ||
posts Post[] | ||
profile Profile? | ||
Faction Faction[] | ||
} | ||
|
||
model Profile { | ||
id Int @id @default(autoincrement()) | ||
bio String | ||
user User @relation(fields: [userId], references: [id]) | ||
userId Int @unique | ||
} | ||
|
||
model Post { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
eventId String? | ||
published Boolean @default(false) | ||
author User @relation(fields: [authorId], references: [id]) | ||
authorId Int | ||
categories Category[] | ||
} | ||
|
||
model Category { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
posts Post[] | ||
} | ||
|
||
enum Role { | ||
USER | ||
ADMIN | ||
} | ||
|
||
model Canvas { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
} | ||
|
||
model Quest { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
} | ||
|
||
model Faction { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
members User[] | ||
} |
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 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
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 @@ | ||
pub mod quests; |
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,3 @@ | ||
pub mod quests { | ||
pub mod tap; | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ pub mod types { | |
pub mod jediswap_types; | ||
pub mod keys_types; | ||
pub mod launchpad_types; | ||
pub mod tap_types; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { | ||
provider, | ||
} from "../utils/starknet"; | ||
import { Account,} from "starknet"; | ||
import dotenv from "dotenv"; | ||
import { prepareAndConnectContract } from "../utils/contract"; | ||
import { createTapQuests } from "../utils/tap"; | ||
|
||
dotenv.config(); | ||
|
||
export const deployTapQuest= async () => { | ||
console.log("deployTapQuest") | ||
|
||
let tapContract:any|undefined; | ||
let tap; | ||
let tap_address: string | undefined; | ||
const privateKey0 = process.env.DEV_PK as string; | ||
const accountAddress0 = process.env.DEV_PUBLIC_KEY as string; | ||
const account = new Account(provider, accountAddress0, privateKey0, "1"); | ||
const chainId = await provider.getChainId() | ||
if (process.env.IS_DEPLOY_CONTRACT == "true") { | ||
let tapContract = await createTapQuests(); | ||
console.log("tap address", tapContract?.contract_address) | ||
if (tapContract?.contract_address) { | ||
tap_address = tapContract?.contract_address | ||
tap = await prepareAndConnectContract(tap_address ?? tapContract?.contract_address, account) | ||
} | ||
|
||
} else { | ||
|
||
} | ||
|
||
/** TODO script to save constants address */ | ||
|
||
return { | ||
tapContract, tap_address, tap | ||
} | ||
} | ||
|
||
deployTapQuest() |
Oops, something went wrong.