Lock up your ETH for a set duration to force you into saving, while allowing you to bypass the timelock if a group of your trusted friends (keyholders) vote to permit you to bypass in the case of an emergency or unexpected event.
The docs below will teach you how to configure and deploy your own instance of the TimeLockMultiSigVault
contract.
- Rename
.env.example
to.env
- Set
KEYHOLDER_LIMIT
to the number of keyholders you wish to have (ex:2
) - Set
TIMELOCK_SECONDS
to the number of seconds you would like your to deposit to be unwithdrawable (ex:2628000
) - Set
GWEI_GAS_PRICE
to the price of gas in GWEI to deploy your contract with (use the fast price from ethgasstation.info) - Set
INFURA_KEY
to an Infura project ID (more info here) - Set
ETHERSCAN_API_KEY
to an Etherscan API key (get one here) - Set
PRIVATE_KEY
to your private key (more info here)
- Run
npm run deploy-mainnet
to deploy to the mainnet & verify the contract on Etherscan automatically (Changemainnet
tokovan
orropsten
to deploy to those testnets respectively).
Your contract will now start deploying! Get the contract address by copying it from the command output from truffle:
-
Once the transaction has confirmed, it's time to add your keyholders.
- Call the contract's
addKeyholder
method with the address of each person you wish to add as keyholder until you've reached theKEYHOLDER_LIMIT
you set.
You should now be able to send ether to your contract and it will be locked up for the TIMELOCK_SECONDS
amount you set!
-
If you want to check to see how much you can withdraw at a certian time call
getWithdrawableAmount
which will return the max amount you can withdraw at the current time (factoring in the timelock). -
Once the timelock has expired on any of your deposits you can call
withdraw
to withdraw all unlocked funds! -
You can also tell your keyholders to call
allowMaxAmountTimelockBypass
orallowAmountTimelockBypass(uint256 amount)
to allow you to bypass the limit.- Once all of your keyholders have called one of those methods, call
withdrawMaxWithTimelockBypass
orwithdrawAmountWithTimelockBypass(uint256 amount)
respectively to get withdraw your ETH!
- Once all of your keyholders have called one of those methods, call