-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from 2077-Collective/main
Updates from 2077 idea board
- Loading branch information
Showing
14 changed files
with
6,970 additions
and
5,625 deletions.
There are no files selected for viewing
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,29 @@ | ||
--- | ||
name: Idea | ||
about: Suggest an idea benefiting Ethereum | ||
title: '' | ||
labels: idea, open | ||
assignees: '' | ||
|
||
--- | ||
|
||
## User story | ||
|
||
As X I want to X, so I can X. | ||
|
||
## Solution | ||
|
||
|
||
## How does it benefit the Ethereum ecosystem? | ||
|
||
|
||
### Why does this not exist yet? | ||
|
||
|
||
## Tasks | ||
|
||
- [ ] | ||
- [ ] | ||
- [ ] | ||
|
||
## Notes |
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 |
---|---|---|
|
@@ -32,3 +32,6 @@ yarn-error.log* | |
|
||
# vercel | ||
.vercel | ||
|
||
#env | ||
.env* |
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
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,11 +1,18 @@ | ||
import { ethers } from "ethers"; | ||
import { useQuery } from "react-query"; | ||
// import { useQuery } from "react-query"; | ||
import { useContractRead } from "wagmi"; | ||
|
||
import * as betterBounty from "../../../utils/solidity/BetterBounty.json"; | ||
|
||
const { data, isError, isLoading } = useContractRead({ | ||
addressOrName: process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS as string, | ||
contractInterface: betterBounty.abi, | ||
functionName: "bountyCount", | ||
}); | ||
export function useGetBountyQuery() { | ||
return useContractRead({ | ||
addressOrName: process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS as string, | ||
contractInterface: betterBounty.abi, | ||
functionName: "bountyCount", | ||
}); | ||
} | ||
|
||
// const { data, isError, isLoading } = useContractRead({ | ||
// addressOrName: process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS as string, | ||
// contractInterface: betterBounty.abi, | ||
// functionName: "bountyCount", | ||
// }); |
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,16 +1,26 @@ | ||
import * as betterBounty from "../../../utils/solidity/BetterBounty.json"; | ||
import { useContractRead } from "wagmi"; | ||
|
||
export default async function getBounty(bountyId: string) { | ||
const chain = localStorage.getItem("wallet-chain"); | ||
if (chain === "near") return; | ||
|
||
const bounty = await useContractRead({ | ||
export function useGetBounty(bountyId: string) { | ||
const { data, isError, isLoading } = useContractRead({ | ||
addressOrName: process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS as string, | ||
contractInterface: betterBounty.abi, | ||
functionName: "getBountyById", | ||
args: bountyId, | ||
args: [bountyId], | ||
}); | ||
|
||
|
||
return { data, isError, isLoading }; | ||
} | ||
|
||
export function getBounty(bountyId: string) { | ||
const chain = localStorage.getItem("wallet-chain"); | ||
if (chain === "near") return null; | ||
|
||
// This function can't directly use the hook, but it can be used to prepare data for the hook | ||
return { | ||
addressOrName: process.env.NEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS as string, | ||
contractInterface: betterBounty.abi, | ||
functionName: "getBountyById", | ||
args: [bountyId], | ||
}; | ||
} |
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
Oops, something went wrong.