
Apes Legacy
Apes Legacy is a dApp that enables BAYC, MAYC and BAKC assets inheritance.
Demo
About
## Enabling Inheritance of BAYC, MAYC and BAKC - **Apes Legacy** enables BAYC, MAYC and BAKC **inheritance**. ## How it works - An **Ape holder** (BAYC, MAYC or BAKC) may set a **beneficiary** wallet address as of a **deadline** for *one of their tokens* or *for all of them.* - The **beneficiary** will be able to **claim** the Ape(s) after reach the **deadline**. - The **registrant** may **change** the **beneficiary** and/or the **deadline** as many times as desired. - The **registrant** may change the **beneficiary** to the *zero address* or the **deadline** to zero to **cancel** any previous register *for tokenId* or *for all of them*. - The **registrant** may opt-in to receive notifications about deadline expiration. - **Rachel** wants to send all her Apes to her son when she is 60 and retire on a desert island with no Internet connection. Just set the date of her 60th birthday as `deadline`, the address of her son as `beneficiary` and... *Done!* - **Alice** has a daughter. Alice wants to send her Ape to her daughter when she is 16 years old. Just set the daughter's address as `beneficiary` and the date of her sixteen as `deadline`. *Done!* - **Bob** wants to hold their Apes until the end 💎, then send them to his caretaker. Just set the caretaker's address as `beneficiary` and for the `deadline` he set January, 1st. Every December Bob updates the `deadline` to the next year. *Done!* - **David** has no descendants, but he wants to send their Apes to his nephews and nieces when they are 14 years old. Just choose a `tokenId` for each one, and set each `deadline` to the birthday of its corresponding `beneficiary`. *Done!* - The **mechanism** is not like the real world **inheritance.** It is *decentralized, fast, easy, cheap, no paperwork, no third parties, infallible, immutable, flexible, trusted...* So, **better**. - Also, the mechanism could be used as a way to add a secondary wallet to manage Apes for sec purposes, maybe a **recovery** after lost the keys for the main wallet.
How it's made
Last month I presented my final project for Alchemy University, Inheritas, a platform to enable web3 asset inheritance supporting ERC20, ERC721 and ERC1155. While working on it, I discovered something interesting, at least to me. My dApp could be made obsolete with a few lines of code added to the standards. My idea was to create and present these extensions at this hackathon (my first one), but seeing that ApeCoin was one of the sponsors, I couldn't resist to create a dedicated dApp to enable BAYC, MAYC and BAKC inheritance. ## Technical details - The contract stores the **state** of the inheritance registry using 2 *mappings*. The first stores the `beneficiary` of a `tokenId` of an specific holder. The second stores the `deadline` in the same way. Both are using *MaxUint256* as `tokenId` to represent the *forAll* registry. - The **register/unregister flow** consists on update these *mappings*. - The **claim token(s) flow** consists on *transfer* the token(s) after check these *mappings*. - The service includes a **notification system** to help the registrants like Bob not to miss the extension of the claim date. This system uses the **Push protocol** and **Polybase**. - Yeah, I know, this is nothing complex, but that's all!. ## Push Notifications - The registrant may set the notifications ON/OFF to start/stop receiving notifications trough the Push Protocol. - The registrant may set the desired days to be notified before reach the claim date. A notification will be sent daily. - This mechanism should help registrants to remember that they need to extend their claim date. - To receive the notifications the registrants should download the Push App in their smartphones. - The ShowRunners framework will send the notifications to the required users. To know about users and deadlines the framework is using the getSubscribers function and fetching data from Polybase, a decentralized database. - Relevant Push files are `frontend/components/NotifyComponent.jsx` and `showrunners/src/showrunners/jvaleska/*`. ## Polybase - The decentralized database is in charge of store the necessary data to manage the notifications trough the Push Protocol. - Polybase requires the registrant's signature to create/update/delete their data from the database. Your keys, your data. - The registrant may change the number of days to be notified before reach the claim date without problem. - The registrant is in charge to update the claim date stored in Polybase whenever he/she changes this date in the blockchain. - The previous feature could be done automatically at the moment of register an Ape to the service. Separated for simplicity. - The registrant may delete their data from the database to stop receiving notifications in the future. - Relevant Polybase files are polybase.schema, ```frontend/components/NotifyComponent.jsx` and `showrunners/src/showrunners/jvaleska/jvaleskaChannel.ts`. ## Goerli Contracts - [Inherit Apes BAYC contract](https://goerli.etherscan.io/address/0x7CD10B154BC11Dd0Dd2f51435D4802F8bCAF35b5) - [Inherit Apes MAYC contract](https://goerli.etherscan.io/address/0xe667745d7551c01B96b143C350E49C2C4816573f) - [Inherit Apes BAKC contract](https://goerli.etherscan.io/address/0xA73CB0f4A8e4e4501157D5673373221DD2cBEd33) - [Using AlphaToken contract as BAYC.](https://goerli.etherscan.io/address/0xF40299b626ef6E197F5d9DE9315076CAB788B6Ef) - [Using BetaToken contract as MAYC.](https://goerli.etherscan.io/address/0x3f228cBceC3aD130c45D21664f2C7f5b23130d23) - [Using GammaToken contract as BAKC.](https://goerli.etherscan.io/address/0xd60d682764Ee04e54707Bee7B564DC65b31884D0) - [Using M20 contract as Ape Coin.](https://goerli.etherscan.io/address/0x328507DC29C95c170B56a1b3A758eB7a9E73455c)