Skip to content

Commit

Permalink
Add status timpestamps (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Feb 27, 2024
1 parent cafca3a commit 1a4e5b3
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 152 deletions.
288 changes: 144 additions & 144 deletions packages/local_db/seed.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,151 +127,151 @@
}
},
"grants": {
"g9EmnJROMeqydxP1BGSx": {
"askAmount": 0.25,
"builder": "0x55fF7E28e7cd43C104dC89Aa69285E0E6EBa064e",
"title": "Buidl Guild English Auction",
"description": "English auction platform where users can create an auction on NFTs.",
"link": "https://app.buidlguidl.com/build/g9EmnJROMeqydxP1BGSx",
"status": "completed",
"timestamp": 1706627065000
},
"fhiWGoHrfdGM2iuFZTGT": {
"askAmount": 0.25,
"builder": "0x2F142f9F52af0845B7b8b1353E349Ca1Cb8EFE92",
"title": "15 Puzzle",
"description": "The famous sliding puzzle with 15 squares. Base starter writes your moves to the blockchain.",
"link": "https://app.buidlguidl.com/build/fhiWGoHrfdGM2iuFZTGT",
"status": "completed",
"timestamp": 1706656049000
},
"EkbuyFm9gYwn27nja7m3": {
"askAmount": 0.25,
"builder": "0x2b30efBA367D669c9cd7723587346a79b67A42DB",
"title": "0xPoker",
"description": "A Commit and Reveal Poker Game! Live on the Optimism chain =) Took inspiration from the RockPaperScissors",
"link": "https://app.buidlguidl.com/build/EkbuyFm9gYwn27nja7m3",
"status": "completed",
"timestamp": 1706690199000
},
"MINVRoKfXZOgO6nsxUp0": {
"askAmount": 0.25,
"builder": "0x5D70E3b540f58beCd10B74f6c0958b31e3190DA7",
"title": "Duel - Bet dApp",
"description": "This dApp allows users to make bets on the future price of Ethereum (ETH). Users can: - Create bets: Choose a future date and ETH price, and stake an amount of ETH. - Resolve bets: When the chosen date arrives, bets can be finalized according to the ETH price at the target date. - Win or lose: If the ETH price is above the chosen price when the bet is chosen as \"Higher\", the user wins the bet and receives the staked ETH plus winnings. I will be glad to hear your feedbacks. Have fun!\n",
"link": "https://app.buidlguidl.com/build/MINVRoKfXZOgO6nsxUp0",
"status": "completed",
"timestamp": 1706815801000
},
"nLsqcBkuoNb8nWVAuJg0": {
"askAmount": 0.25,
"builder": "0x1CeF0e6072810013487f7632350f9336AD6CADAD",
"title": "Public Good supportUs",
"description": "Decentralized public goods funding application. Campaign owners can set funds needed",
"link": "https://app.buidlguidl.com/build/nLsqcBkuoNb8nWVAuJg0",
"status": "completed",
"timestamp": 1706860595000
},
"BeyVyZuAvbFnUWjVbJ7U": {
"askAmount": 0.25,
"builder": "0xC6e64eBeFaFaB3d646adadca5D93A7c44f62544f",
"title": "ZeroTrust Accounts",
"description": "ZeroTrust Accounts will provide a decentralized, secure, and self-sovereign approach to Ethereum smart contract accounts",
"link": "https://app.buidlguidl.com/build/BeyVyZuAvbFnUWjVbJ7U",
"status": "completed",
"timestamp": 1706892428000
},
"6JZBiYsLbfZ06SrQGyGz": {
"askAmount": 0.25,
"builder": "0x3b529ac4F8dc0C40Fec0f1192029755275A0c3Cd",
"title": "Event Management Dapp",
"description": "An app to create, manage, and sell tickets for events and buy them along with many functionalities",
"link": "https://app.buidlguidl.com/build/6JZBiYsLbfZ06SrQGyGz",
"status": "completed",
"timestamp": 1706940527000
},
"ItKedxWVEaX9OcCrphMu": {
"askAmount": 0.25,
"builder": "0xbE7fD3889C01F032184544DC0005F0d47daCcf09",
"title": "Switch Dapp",
"description": "Switch is a web app for sending deferred transactions. The user has a simple UI for setting a transaction which will be triggered and excecuted later based on speficied: 1) Time delay or 2) On-chain variable output. Implements Chainlink Functions and Automation.",
"link": "https://app.buidlguidl.com/build/ItKedxWVEaX9OcCrphMu",
"status": "completed",
"timestamp": 1707065464000
},
"ZW4MfCMCU209bKP8Va8M": {
"askAmount": 0.25,
"builder": "0x8757F328371E571308C1271BD82B91882253FDd1",
"title": "D-Auction Platform",
"description": "Decentralized Auction Platform named D-Auction is a smart contract-based solution for conducting decentralized auctions of non-fungible tokens (NFTs). This platform allows users to create auctions for their NFTs, participate in bidding, and claim ownership of the NFTs upon winning the auctions",
"link": "https://app.buidlguidl.com/build/ZW4MfCMCU209bKP8Va8M",
"status": "completed",
"timestamp": 1707065465000
},
"i2ChwolQO0qR1Qbp0qCQ": {
"askAmount": 0.25,
"builder": "0xdDE7B987A01717EEfCcA1Dc5280c164E2cCD133e",
"title": "DEGEN-STATION",
"description": "Degen Station is a raffle contract that allows for any individual to stake a certain amount of Eth with hopes of winning the grand prize which is 96% of the total stakes in the contract. Winners of each batch are also rewarded with an nft which. The is also a in built point system which is expected to tract users usage so that can be rewarded with the protocol tokens when it goes life.",
"link": "https://app.buidlguidl.com/build/i2ChwolQO0qR1Qbp0qCQ",
"status": "completed",
"timestamp": 1705910401000
},
"UeQnRI5ISO93XHYcVTRj": {
"askAmount": 0.25,
"builder": "0x38D9cFf58D233AF0B9c1434EEDE012009D23c971",
"title": "External Contract UI",
"description": "A tool to improve the developer experience on scaffold-eth 2 by providing a tool to interact with external contract addresses",
"link": "https://app.buidlguidl.com/build/UeQnRI5ISO93XHYcVTRj",
"status": "completed",
"timestamp": 1705910402000
},
"nEjaQfkyzMgt3vcbAqLd": {
"askAmount": 0.25,
"builder": "0x63191383EDbd8531C442868d87555f1EA2f6ad4E",
"title": "Querying Smart Contract Parameters From TheGraph",
"description": "Basic understanding of the \ud83d\udea9 Challenge #3: The Graph with basic explanations that are going to be helpful for the newcomers.",
"link": "https://app.buidlguidl.com/build/nEjaQfkyzMgt3vcbAqLd",
"status": "completed",
"timestamp": 1705910403000
},
"AuyB2d2IydtOEvePeyNN": {
"askAmount": 0.25,
"builder": "0xFC7BC662fA06137F769366A46B19924371E880bd",
"title": "\ud83e\udd57 Food Mart",
"description": "An online restaurant food application that enables wallet integration, with images stored on IPFS. Additionally, the web app provides the option to view the calorie count per serving for each dish.",
"link": "https://app.buidlguidl.com/build/AuyB2d2IydtOEvePeyNN",
"status": "completed",
"timestamp": 1705910404000
},
"H7AtTDtQOQ0h6wRT1A0G": {
"askAmount": 0.25,
"builder": "0xfbCE2693FBEd73E3D464d662235DC5ADC5454C01",
"title": "Revolution Roulette",
"description": "On chain russian roulette with unique items as powerups. Settle minor bets with some fun on optimism \ud83d\ude0e",
"link": "https://app.buidlguidl.com/build/H7AtTDtQOQ0h6wRT1A0G",
"status": "completed",
"timestamp": 1705910405000
},
"xQ7KIxSjvUqOVjPUl3R2": {
"askAmount": 0.25,
"builder": "0xC863DFEE737C803c93aF4b6b27029294f6a56eB5",
"title": "Scaffold-XOC",
"description": "The open-source frontend for the first decentralized stablecoin pegged to the Mexican Peso ($MXN). This dapp is La Dao's playground to grow DeFi in Mexico",
"link": "https://app.buidlguidl.com/build/xQ7KIxSjvUqOVjPUl3R2",
"status": "completed",
"timestamp": 1705910406000
},
"LQane0FtluzI8l3kwQGL": {
"askAmount": 0.25,
"builder": "0x5638Bf706056d01b2DaB817915244B3E21a56FE8",
"title": "Voting App",
"description": "A polling app that allows users to create polls, vote, and view the results on topics that matter to them. Built with solidity and nextjs, it features transparent voting mechanisms and real-time results visualization.",
"link": "https://app.buidlguidl.com/build/LQane0FtluzI8l3kwQGL",
"status": "completed",
"timestamp": 1705910407000
}
"g9EmnJROMeqydxP1BGSx": {
"askAmount": 0.25,
"builder": "0x55fF7E28e7cd43C104dC89Aa69285E0E6EBa064e",
"title": "Buidl Guild English Auction",
"description": "English auction platform where users can create an auction on NFTs.",
"link": "https://app.buidlguidl.com/build/g9EmnJROMeqydxP1BGSx",
"status": "completed",
"completedAt": 1706627065000
},
"fhiWGoHrfdGM2iuFZTGT": {
"askAmount": 0.25,
"builder": "0x2F142f9F52af0845B7b8b1353E349Ca1Cb8EFE92",
"title": "15 Puzzle",
"description": "The famous sliding puzzle with 15 squares. Base starter writes your moves to the blockchain.",
"link": "https://app.buidlguidl.com/build/fhiWGoHrfdGM2iuFZTGT",
"status": "completed",
"completedAt": 1706656049000
},
"EkbuyFm9gYwn27nja7m3": {
"askAmount": 0.25,
"builder": "0x2b30efBA367D669c9cd7723587346a79b67A42DB",
"title": "0xPoker",
"description": "A Commit and Reveal Poker Game! Live on the Optimism chain =) Took inspiration from the RockPaperScissors",
"link": "https://app.buidlguidl.com/build/EkbuyFm9gYwn27nja7m3",
"status": "completed",
"completedAt": 1706690199000
},
"MINVRoKfXZOgO6nsxUp0": {
"askAmount": 0.25,
"builder": "0x5D70E3b540f58beCd10B74f6c0958b31e3190DA7",
"title": "Duel - Bet dApp",
"description": "This dApp allows users to make bets on the future price of Ethereum (ETH). Users can: - Create bets: Choose a future date and ETH price, and stake an amount of ETH. - Resolve bets: When the chosen date arrives, bets can be finalized according to the ETH price at the target date. - Win or lose: If the ETH price is above the chosen price when the bet is chosen as \"Higher\", the user wins the bet and receives the staked ETH plus winnings. I will be glad to hear your feedbacks. Have fun!\n",
"link": "https://app.buidlguidl.com/build/MINVRoKfXZOgO6nsxUp0",
"status": "completed",
"completedAt": 1706815801000
},
"nLsqcBkuoNb8nWVAuJg0": {
"askAmount": 0.25,
"builder": "0x1CeF0e6072810013487f7632350f9336AD6CADAD",
"title": "Public Good supportUs",
"description": "Decentralized public goods funding application. Campaign owners can set funds needed",
"link": "https://app.buidlguidl.com/build/nLsqcBkuoNb8nWVAuJg0",
"status": "completed",
"completedAt": 1706860595000
},
"BeyVyZuAvbFnUWjVbJ7U": {
"askAmount": 0.25,
"builder": "0xC6e64eBeFaFaB3d646adadca5D93A7c44f62544f",
"title": "ZeroTrust Accounts",
"description": "ZeroTrust Accounts will provide a decentralized, secure, and self-sovereign approach to Ethereum smart contract accounts",
"link": "https://app.buidlguidl.com/build/BeyVyZuAvbFnUWjVbJ7U",
"status": "completed",
"completedAt": 1706892428000
},
"6JZBiYsLbfZ06SrQGyGz": {
"askAmount": 0.25,
"builder": "0x3b529ac4F8dc0C40Fec0f1192029755275A0c3Cd",
"title": "Event Management Dapp",
"description": "An app to create, manage, and sell tickets for events and buy them along with many functionalities",
"link": "https://app.buidlguidl.com/build/6JZBiYsLbfZ06SrQGyGz",
"status": "completed",
"completedAt": 1706940527000
},
"ItKedxWVEaX9OcCrphMu": {
"askAmount": 0.25,
"builder": "0xbE7fD3889C01F032184544DC0005F0d47daCcf09",
"title": "Switch Dapp",
"description": "Switch is a web app for sending deferred transactions. The user has a simple UI for setting a transaction which will be triggered and excecuted later based on speficied: 1) Time delay or 2) On-chain variable output. Implements Chainlink Functions and Automation.",
"link": "https://app.buidlguidl.com/build/ItKedxWVEaX9OcCrphMu",
"status": "completed",
"completedAt": 1707065464000
},
"ZW4MfCMCU209bKP8Va8M": {
"askAmount": 0.25,
"builder": "0x8757F328371E571308C1271BD82B91882253FDd1",
"title": "D-Auction Platform",
"description": "Decentralized Auction Platform named D-Auction is a smart contract-based solution for conducting decentralized auctions of non-fungible tokens (NFTs). This platform allows users to create auctions for their NFTs, participate in bidding, and claim ownership of the NFTs upon winning the auctions",
"link": "https://app.buidlguidl.com/build/ZW4MfCMCU209bKP8Va8M",
"status": "completed",
"completedAt": 1707065465000
},
"i2ChwolQO0qR1Qbp0qCQ": {
"askAmount": 0.25,
"builder": "0xdDE7B987A01717EEfCcA1Dc5280c164E2cCD133e",
"title": "DEGEN-STATION",
"description": "Degen Station is a raffle contract that allows for any individual to stake a certain amount of Eth with hopes of winning the grand prize which is 96% of the total stakes in the contract. Winners of each batch are also rewarded with an nft which. The is also a in built point system which is expected to tract users usage so that can be rewarded with the protocol tokens when it goes life.",
"link": "https://app.buidlguidl.com/build/i2ChwolQO0qR1Qbp0qCQ",
"status": "completed",
"completedAt": 1705910401000
},
"UeQnRI5ISO93XHYcVTRj": {
"askAmount": 0.25,
"builder": "0x38D9cFf58D233AF0B9c1434EEDE012009D23c971",
"title": "External Contract UI",
"description": "A tool to improve the developer experience on scaffold-eth 2 by providing a tool to interact with external contract addresses",
"link": "https://app.buidlguidl.com/build/UeQnRI5ISO93XHYcVTRj",
"status": "completed",
"completedAt": 1705910402000
},
"nEjaQfkyzMgt3vcbAqLd": {
"askAmount": 0.25,
"builder": "0x63191383EDbd8531C442868d87555f1EA2f6ad4E",
"title": "Querying Smart Contract Parameters From TheGraph",
"description": "Basic understanding of the \ud83d\udea9 Challenge #3: The Graph with basic explanations that are going to be helpful for the newcomers.",
"link": "https://app.buidlguidl.com/build/nEjaQfkyzMgt3vcbAqLd",
"status": "completed",
"completedAt": 1705910403000
},
"AuyB2d2IydtOEvePeyNN": {
"askAmount": 0.25,
"builder": "0xFC7BC662fA06137F769366A46B19924371E880bd",
"title": "\ud83e\udd57 Food Mart",
"description": "An online restaurant food application that enables wallet integration, with images stored on IPFS. Additionally, the web app provides the option to view the calorie count per serving for each dish.",
"link": "https://app.buidlguidl.com/build/AuyB2d2IydtOEvePeyNN",
"status": "completed",
"completedAt": 1705910404000
},
"H7AtTDtQOQ0h6wRT1A0G": {
"askAmount": 0.25,
"builder": "0xfbCE2693FBEd73E3D464d662235DC5ADC5454C01",
"title": "Revolution Roulette",
"description": "On chain russian roulette with unique items as powerups. Settle minor bets with some fun on optimism \ud83d\ude0e",
"link": "https://app.buidlguidl.com/build/H7AtTDtQOQ0h6wRT1A0G",
"status": "completed",
"completedAt": 1705910405000
},
"xQ7KIxSjvUqOVjPUl3R2": {
"askAmount": 0.25,
"builder": "0xC863DFEE737C803c93aF4b6b27029294f6a56eB5",
"title": "Scaffold-XOC",
"description": "The open-source frontend for the first decentralized stablecoin pegged to the Mexican Peso ($MXN). This dapp is La Dao's playground to grow DeFi in Mexico",
"link": "https://app.buidlguidl.com/build/xQ7KIxSjvUqOVjPUl3R2",
"status": "completed",
"completedAt": 1705910406000
},
"LQane0FtluzI8l3kwQGL": {
"askAmount": 0.25,
"builder": "0x5638Bf706056d01b2DaB817915244B3E21a56FE8",
"title": "Voting App",
"description": "A polling app that allows users to create polls, vote, and view the results on topics that matter to them. Built with solidity and nextjs, it features transparent voting mechanisms and real-time results visualization.",
"link": "https://app.buidlguidl.com/build/LQane0FtluzI8l3kwQGL",
"status": "completed",
"completedAt": 1705910407000
}
},
"events": [
{
"type": "build.submit",
Expand Down
7 changes: 6 additions & 1 deletion packages/nextjs/app/_components/CompletedGrants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Address } from "~~/components/scaffold-eth";
import { getAllCompletedGrants } from "~~/services/database/grants";
import { GrantData } from "~~/services/database/schema";

const CompletedGrantCard = ({ title, description, askAmount, builder, link }: GrantData) => {
const CompletedGrantCard = ({ title, description, askAmount, builder, link, completedAt }: GrantData) => {
return (
<div className="w-72 md:w-[300px] bg-primary min-h-full rounded-2xl overflow-hidden shadow-lg p-4 space-y-4">
<div className="h-44 w-full bg-secondary rounded-xl relative">
Expand All @@ -15,6 +15,11 @@ const CompletedGrantCard = ({ title, description, askAmount, builder, link }: Gr
>
Learn more
</a>
{completedAt && (
<p className="badge bg-base-200 absolute top-4 left-4 rounded-2xl m-0">
{new Date(completedAt).toLocaleDateString()}
</p>
)}
<p className="m-0 absolute bottom-4 left-4 text-lg">{title}</p>
</div>
<div className="flex flex-col gap-2 px-3">
Expand Down
8 changes: 8 additions & 0 deletions packages/nextjs/app/api/grants/[grantId]/review/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ import { recoverTypedDataAddress } from "viem";
import { reviewGrant } from "~~/services/database/grants";
import { findUserByAddress } from "~~/services/database/users";
import { EIP_712_DOMAIN, EIP_712_TYPES__REVIEW_GRANT } from "~~/utils/eip712";
import { PROPOSAL_STATUS } from "~~/utils/grants";

export async function POST(req: NextRequest, { params }: { params: { grantId: string } }) {
const { grantId } = params;
const { signature, signer, action } = await req.json();

// Validate action is valid
const validActions = Object.values(PROPOSAL_STATUS);
if (!validActions.includes(action)) {
console.error("Invalid action", action);
return NextResponse.json({ error: "Invalid action" }, { status: 400 });
}

// Validate Signature
const recoveredAddress = await recoverTypedDataAddress({
domain: EIP_712_DOMAIN,
Expand Down
Loading

0 comments on commit 1a4e5b3

Please sign in to comment.