{"id":22356769,"url":"https://github.com/scale-it/near-grant-protocol","last_synced_at":"2025-03-26T13:16:39.994Z","repository":{"id":206280151,"uuid":"716224879","full_name":"scale-it/near-grant-protocol","owner":"scale-it","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-17T11:54:17.000Z","size":114,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T14:41:34.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://devpost.com/software/grant-596m4y","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scale-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T17:33:48.000Z","updated_at":"2023-11-17T11:54:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"778a4317-3a63-485d-b2e5-96f530b435c9","html_url":"https://github.com/scale-it/near-grant-protocol","commit_stats":null,"previous_names":["scale-it/near-grant-protocol"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-it%2Fnear-grant-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-it%2Fnear-grant-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-it%2Fnear-grant-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-it%2Fnear-grant-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scale-it","download_url":"https://codeload.github.com/scale-it/near-grant-protocol/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245659048,"owners_count":20651526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T14:11:56.636Z","updated_at":"2025-03-26T13:16:39.961Z","avatar_url":"https://github.com/scale-it.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NEAR Grant Protocol\n\nThis project was initiated during the NEARCon 2023 hackathon. [Submission](https://devpost.com/software/grant-596m4y).\n\nToken used to distribute grants in the ecosystem and incentivize the grant recivers to reinvest withing the ecosystem.\nThe grant is first wrapped and packed into the `grant token` and then distributed to the grant recivers. If they want to unwrap the tokens they would only receive 80% of the original value. If they spend it with the verified service providers, they on the other hand can unwrap the 100% of the original value. The difference so lets say the 20% should go back to the grant provider.\n\n## Why using MT token?\n\nWe need to distinguish tokens by granter:\n\n- granter should be able to withdraw his tokens without being a subject of the penalty\n- our long term goal is to use measure token velocity by granter\n- each token has it's underlying value, and if we introduce more levels of penalty, we end up with tracking problems (people sending to each other grant tokens from different grants)\n- token per granter allows us to easily measure performance of granter and grantee\n- opportunity to test and work with the Multi Token template and had more hands on experience for MT standard we want to finalize.\n\n## Example of the flow\n\nLet's define the addresses we will use in the example:\n\n```bash\n# the grant token protocol we created and deployed, ready to use\nCTR=grant-protocol.testnet\n# a FT with self-mint function\nFT=test-token.cheddar.testnet\n\n# Some fake accounts\nGRANTER=grant-provider.testnet\nGRANTEE=grant-reciver.testnet\n```\n\nSome FT require prior registration. Our Multi Fungible Token also requires storage registration:\n\n```bash\nnear call $FT storage_deposit '{}' --accountId $GRANTER --deposit 0.05\nnear call $FT storage_deposit '{}' --accountId $GRANTEE --deposit 0.05\nnear call $FT storage_deposit '{\"account_id\": \"'$CTR'\"}' --accountId $GRANTER --deposit 0.05\n\nnear call $CTR storage_deposit '{}' --accountId $GRANTER --deposit 0.05\nnear call $CTR storage_deposit '{}' --accountId $GRANTEE --deposit 0.05\n```\n\nNow the granter can create his grantToken by supplying FT to the protocol. It will wrap the FT into a MT.\n\n```bash\nnear call $FT ft_transfer_call '{\"receiver_id\": \"'$CTR'\", \"amount\": \"200000000000000000000000\", \"msg\": \"\"}'  --accountId $GRANTER --depositYocto 1 --gas 300000000000000\n```\n\nOnce the granter has his grantTokens, he can distribute them:\n\n```bash\nnear call $CTR mt_transfer '{\"receiver_id\": \"'$GRANTEE'\", \"token_id\": \"1\", \"amount\": \"10000000000000000000000\"}' --accountId $GRANTER --depositYocto 1\n```\n\nThe grant receiver then can immediately unwrap the token calling. This will cost him a 20% penalty:\n\n```bash\nnear call $CTR unwrap '{\"token_id\": \"1\", amount: \"10000000000000000000000\"}' --accountId $GRANTEE\n```\n\nOtherwise, to keep 100% value, the grantee can spend it in the ecosystem, by sending it to any whitelisted service provider.\n\n```bash\nnear call $CTR storage_deposit '{}' --accountId design-studio.testnet --deposit 0.05\n\nnear call $CTR mt_transfer '{\"receiver_id\": \"design-studio.testnet\", \"token_id\": \"1\", \"amount\": \"10000000000000000000000\"}' --accountId $GRANTEE --depositYocto 1\n```\n\nWhitelisted accounts can call `unwrap` and get 100% of the underlying value.\n\nService provider can\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-it%2Fnear-grant-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscale-it%2Fnear-grant-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-it%2Fnear-grant-protocol/lists"}