Each task can also be an NFT. i.e unique task id and task details.
Each reward can also be an nft. Non transferable
Each point reward can be an erc20 token. Non transferable.
Nft itself may or maynot be transferable.
- Deploy community profile nft
- contains link to task details
- also contains other details of the community.
- Mapping of tasks? => for now lets assume everything data is in ipfs
- user fetches tasks & comm details from the contract (ipfs hash)
- get all details from ipfs
- user mints profile nft and onchain profile is created. (profile image may or may not be a placeholder. If it is a placeholder, a separate task can be later created to claim actual nft profile image. The contract will still be the same).
- User does task.
- User requests task data from a data oracle. oracle generates an attestation of the data and sends it to the user.
- User submits the attested task data to corresponding Task Verifier Contract. (each task will have a separate verifier contract. This way anytime something new needs to be processed, it can be isolated into a separate contract.).
- Task Verifier Contract verifies the data attestation from Claim Issuers Contract(contains a list of verified claim issuers. Only attestations from those issuers are valid. Similar to claim issuer role) contract. Then the required condition is checked for provided data.
- After verification Reward Distributor contract is called to issue reward to the user for that task. If it is a token back reward, token is transfered to the user. If it is a mint nft transaction, nft can be minted to the user. (if nft reward is on different chain, transaction will be briged via an oracle). If it is points, value can be incremented to the user profile id. If asset reward, asset can be minted to the user profile id. Points and asset rewards are tied to the profile nft. Nft and tokens are tied directly to the user address.
- user calls get token uri to get Profile nft. This function will call NFT Render contract that will aggregate all the user points, user assets and generate an html and return the html data. Each nft template type will have a different NFt Render contract.
- If attestation is required, oracles can generate attestation for the corresponding data. the generated attestation will be stored onchain with confirmations from other oracle.
Community Contract (unique contract for Community)
- Profile NFT
- keeps track of all the NFT holders i.e community members.