Willer is a smart contract designed to facilitate the secure distribution of ERC20, ERC721, and ERC1155 tokens according to the terms of a digital will. Testators can define beneficiaries, specify their shares, set a release time, and extend the release period if necessary. Beneficiaries, in turn, can claim their allocated tokens once the release time expires.
Example: Alice bequeaths her tokens to Bob, Tim and Jane. Alice set share of ERC20 & ERC1155 tokens for Bob equal to 7 (7/(7+9) = 43.75%), Tim's share is 9 (9/(7+9) = 56.25%). Jane does not have a share of fungible tokens, but Alice bequeath all ERC721 (NFT) tokens to Jane. Alice sets the delay of the execution of the Will equal to 365 days. This means that exactly one year later, all of her tokens added to Will are able to be transferred to the beneficiaries. To execute Will any of beneficiaries needs to claim the inheritance - go to willer-ui.vercel.app/'testator's address', connect wallet, click "Execute" button and sign a transaction. After 360 days, Alice will receive a notification to extend the will by clicking the Update button (will add notifications feature soon). Alice is alive and well, she has not lost her private key and access to her wallet, so she extends her will for another 365 days.
-
Clone this repo
git clone https://github.com/DimaKush/Willer cd Willer forge install -
If you want to deploy on testnets: Create a .env file using .env.example as a template and add your environment variables.
-
To compile the contracts:
forge build
-
To deploy (example using Sepolia):
forge script script/DeployWiller.s.sol --rpc-url sepolia --broadcast
-
To run tests:
forge test
To run the full test suite with gas reporting:
forge test --gas-reportDistributed under the MIT License
[Faucet] (https://faucet.paradigm.xyz/)
"Getting Started with Brownie"
Patrick Collins tutorial on youtube