Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masaun/retirement-certificate-nft-associated-ticket
This is the smart contract that associate Retirement Certificate NFTs with special tickets that includes special privilege as "Retirement Certificate NFT-associated Ticket" (ERC-1155). Random Number generated via Chainlink VRF is associated with each Retirement Certificate NFT-associated Tickets as kind of serial number of tickets in order to avoid that fraud tickets are used in secondry market.
https://github.com/masaun/retirement-certificate-nft-associated-ticket
chainlink-vrf erc1155 ethersjs hardhat solidity typechain
Last synced: 26 days ago
JSON representation
This is the smart contract that associate Retirement Certificate NFTs with special tickets that includes special privilege as "Retirement Certificate NFT-associated Ticket" (ERC-1155). Random Number generated via Chainlink VRF is associated with each Retirement Certificate NFT-associated Tickets as kind of serial number of tickets in order to avoid that fraud tickets are used in secondry market.
- Host: GitHub
- URL: https://github.com/masaun/retirement-certificate-nft-associated-ticket
- Owner: masaun
- License: mit
- Created: 2022-06-29T10:24:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-04T00:49:19.000Z (over 2 years ago)
- Last Synced: 2024-10-18T18:38:46.211Z (3 months ago)
- Topics: chainlink-vrf, erc1155, ethersjs, hardhat, solidity, typechain
- Language: TypeScript
- Homepage:
- Size: 1.11 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Retirement Certificate NFT-associated Ticket 🎫
## Overview
- This is the smart contract that associate Retirement Certificate NFTs with special tickets that includes special privilege as `"Retirement Certificate NFT-associated Ticket"`
- ERC-1155 type of NFT is used for this Retirement Certificate NFT-associated Ticket.- This ticket is in order to incentivize people who try to offset carbons as individual climate action and increase these people in the Voluntary Carbon Market (VCM).
- For example of individual climate action, people calculate carbon that they are emitted when they travel to foreign countries and they try to offset its carbon calculated with $BCT tokens on Toucan Protocol.
https://medium.com/@ToucanProtocol/how-to-retire-nature-based-carbon-credits-with-toucan-7f69d4474a8a- Retirement Certificate NFT are minted via existing ReFi protocols such as Toucan Protocol when user offset carbon with carbon reference tokens (eg. $BCT Token of Toncan Protocol).
- An example of Retirement Certificate NFT (=ERC-721) that is minted via Toucan Protocol: https://polygonscan.com/token/0x5e377f16e4ec6001652befd737341a28889af002
- NOTE: This time, I use mock of Retirement Certificate NFT instead of Toucan Protocol's one above because of limitation of time to implement this smart contract. Ideally, Retirement Certificate NFT on ReFi protocols (such as Toucan Protocol) is better in the future.
- Random Number generated via Chainlink VRF is associated with each Retirement Certificate NFT-associated Tickets as kind of serial number of tickets in order to avoid that fraud tickets are used in secondry market. (It's also in order to prevent being manipulated by any single entity including oracle operators, miners, users, or smart contract developers)
- Random Number is called via Chainlink VRF and saved as a metadata in the RetirementCertificateNFTAssociatedTicket.sol
- Retirement Certificate NFT-associated Ticket holders are able to access special contents, events, etc as privilege. (This is like `"Retirement NFT-associated Ticket-gated access"` )
- In this repo, `"Retirement NFT-associated Ticket-gated access"` is tested by using `accessSpecialContent()` method defined in the mock of RetirementCertificateNFTAssociatedTicketGatedService contract.
https://github.com/masaun/retirement-certificate-NFT-associated-ticket/blob/main/contracts/mock/MockRetirementNFTAssociatedTicketGatedService.sol#L35-L37
## Use case of Retirement Certificate NFT-associated Ticket
- Ticket sales of professional sports teams
- Retirement Certificate NFT-associated Ticket gated access
- eg). Only Retirement Certificate NFT-associated Ticket holders can access special space or events in their home stadium.
- Ticket sales of music concerts
- Retirement Certificate NFT-associated Ticket gated access
- eg). Only Retirement Certificate NFT-associated Ticket holders can access special space or events in their music concert hall.
## Workflow
- Diagram of workflow
![diagram-of-workflow_retirement-certificate-NFT-associated-ticket](https://user-images.githubusercontent.com/19357502/179401593-9db1b279-bfc3-4b7b-a438-842cbd1c3838.jpeg)
## Installation
- Write `.env` by referencing `.env.example`
- Then, adding `.env` to the root directory.
- Install modules
```
yarn
```
- Compile smart contracts
```
yarn compile
```
- Generate typescript files of smart contracts for Typechain
```
yarn typechain
```
## Test (Mainnet-forking test)
- Scenario test
```
yarn test-scenario:retirement-certificate-NFT-associated-ticket
```
- Unit test
```
yarn test-unit:retirement-certificate-NFT-associated-ticket
```
## Demo (of Scenario test)
- This is the demo of Scenario test above:
https://youtu.be/nEVJD2Eqhd4
## Deployment files (for using `hardhat-deploy` module)
- https://github.com/masaun/retirement-certificate-NFT-associated-ticket/tree/main/deploy
## Technical Stack
- Solidity
- ethers.js (v5)
- Hardhat
- Modules:
- hardhat-deploy, etc
- TypeChain
## References
- Chainlink:
- Chainlink Documentation: https://docs.chain.link/
- Chainlink VRF: https://docs.chain.link/docs/chainlink-vrf/
- Chainlink prize in the Sustainable Blockchain Hackathon. (Best Use Of Chainlink In A Sustainability Project)
https://gitcoin.co/issue/29019
- Toucan Protocol:
- Retirement on Verra: https://docs.toucan.earth/protocol/bridge/carbon-bridge/retire-on-verra
- Workflow of Carbon Pools: https://docs.toucan.earth/protocol/pool/key-concepts
- How to retire nature-based carbon credits with Toucan
https://medium.com/@ToucanProtocol/how-to-retire-nature-based-carbon-credits-with-toucan-7f69d4474a8a
- Example of Carbon Retirement Certificate (for ETH Amsterdam)
https://medium.com/@ToucanProtocol/toucan-offset-ethamsterdam-emissions-506df8223c84
https://blog.toucan.earth/content/files/2022/05/Certificate_ETHAms_220429-1400.pdf
- KlimaDAO
- The offsetting page (as retirement aggregator): https://app.klimadao.finance/#/offset
- Retirement Aggregator Contracts: https://docs.klimadao.finance/references/developers/retirement-aggregator-contracts
- Polygon goes carbon neutral via KlimaDAO - The Green Manifesto in action: https://www.klimadao.finance/blog/ polygon-goes-carbon-neutral-via-klimadao
- Mark Cuban is placing $150K of carbon offsets on the blockchain every month: https://www.banklesstimes.com/news/2021/11/16/mark-cuban-is-placing-150k-of-carbon-offsets-on-the-blockchain-every-month/
- Mark Cuban says he is locking $50K in tokenized carbon offsets every 10 days
https://cointelegraph.com/news/mark-cuban-says-he-is-locking-50k-in-tokenized-carbon-offsets-every-10-days- The Voluntary Carbon Market (VCM)
https://docs.toucan.earth/protocol/introduction/carbon-markets