Closed coszio closed 2 years ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
solana-grants | ✅ Ready (Inspect) | Visit Preview | Aug 6, 2022 at 2:02AM (UTC) |
Great suggestion, I'll make sure to do that when merging with your PR
@coszio is attempting to deploy a commit to the Solana Team on Vercel.
A member of the Team first needs to authorize it.
Just merged the changes from #23 which is already on main, which required some refactoring work on the anchor side, and a lot of it on the tests side.
Did not review app yet btw
./src/transactions/index.ts:3:31
--
13:33:29.618 | Type error: Cannot find module '../../../target/types/grants_program' or its corresponding type declarations.
13:33:29.618 |
13:33:29.619 | 1 \| import * as anchor from "@project-serum/anchor";
13:33:29.619 | 2 \| import { Program } from "@project-serum/anchor";
13:33:29.619 | > 3 \| import { GrantsProgram } from "../../../target/types/grants_program";
I noticed your test suite doesn't seem to want to run on my local setup:
ts-mocha -p ./tsconfig.json -t 1000000 tests/suites/donations.test.ts tests/suites/grants.test.ts
0 passing (0ms)
^ nvm got it. Assuming you just run anchor test
and not anchor run test
at all
Type error: Property 'metadata' does not exist on type '{ version: string; name: string; instructions: { name: string; accounts: { name: string; isMut: boolean; isSigner: boolean; }[]; args: { name: string; type: string; }[]; }[]; accounts: { name: string; type: { kind: string; fields: ({ ...; } | { ...; })[]; }; }[]; types: { ...; }[]; errors: { ...; }[]; }'.
Context
When donating to a grant (either from a user or from a matcher) we want to deposit the money into the grant account first before releasing it to the grant creator. Once an arbitrary constrain has been cleared (e.g. a deadline has passed), the money will be transferred to the grant creator, else, the grant can be cancelled and the money be refunded to each donor.
Implementation
A
Donation
will be a PDA derived from a grant and a user, so a user can only have one escrow account per grant to avoid multiple escrow accounts. Users should be able to donate again, which will increase the funds of theGrant
account.Another
Link
account will be created along each donation, which will be derived from the grant + donation_count of it to be able to track all current donations related to the grant.To cancel a donation requires that the grant it relates to has already been cancelled.
Action Items:
Donation
structDonation
creationDonation
account per grantGrant
release (give the money to the receiver)Donation
cancellation (return the money to the donor)Donation
s related to a grant can be queried without prior knowledge of the users who donated