Development Progress: Smart Timelock Wallet Contract
$EGL holders, today we are happy to announce the deployment and startup of our initial Smart TimeLock Wallet smart contract!
¡Spoiler alert from our Whitepaper!
As you see during the last weeks we were working on the testnet to test our code that we made for lock tokens for a specified amount of time. This time locked vault is more than a simple timelock. It works as a smart lockable wallet. This means that each user can own a private smart clock wallet that is transferable between users but only the owner of the wallet can retrieve the tokens when the lock is released.
The code is directly derived from the OpenZeppelin smart lock that is a well known and secure standard code on blockchain. Our additions were just to add the capacity to hold multiple tokens, hold tokens that are earned by stacking pools, farms or other reflection mechanisms that the token can have, like $SAFEMOON reflection for example, without losing the profits during the time that the tokens where on the smart lockable wallet.
Capacity to work as a normal wallet
Our time lock wallet is just a holder like anyone. The only difference is that it is a smart wallet contract that has a method to return the assets to the holder. In the future, every user using the EaglerFly Finance Dapp can create its own smart lockable wallet contract that locks all of his tokens on it. The smart lockable wallet is personal, each user will have a smart lock wallet address, and you can only extract the assets when the lock is open at the defined time when the deposit is made. This wallet can not be used for trading or other activities.
Internally the wallet is just a smart contract and an address like anyone. The only difference is that the wallet has a list of tokens that has been sent to it and the timestamp ( see Unix epoch on Google ) that the tokens with the given address can be released.
Capacity to extend the lock time
Sometimes it is necessary to extend the lock time that you want to put the assets on your wallet or you want to send more tokens to the wallet and extend the time.
In such a case EagleFly smart wallets provide a method that the user can use to just extend the time and/or deposit more tokens on it.
The lock time can be never reduced or forced to be unlocked.
You can see in the code that the released time is required to be in the future and is required to be equal or longer than the current time and there is no way to reduce it.
Every time that someone deposits tokens on the Smart Lockable Wallet it is mandatory to extend the time of the tokens to avoid changing the new time.
During this process TimeLockUpdate and Deposit events are emitted to debug the behavior of the wallet and what is doing the user with it. For example:
Here you can see that we made a deposit of 10 thousand $EGL tokens that were locked until 1623599970. That is Sunday, June 13, 2021 3:59:30 PM.
Capacity to release the tokens
Only when the lock gets unlocked at the specified time the user can release and retrieve part of the tokens or all.
In general there is only two methods to release the tokens:
- Partial release to extract a specific amount of tokens
- Release all of the tokens that the Smart Lockable wallet holds.
Both methods require that the current time of the block, defined internally by the blockchain, is less than the lock release time. This ensures that nobody can release the tokens before the lock is released. For example, after locking the tokens until Sunday, June 13, 2021 3:59:30 PM the user tries to release and withdraw the tokens at 11:16:10 AM and the lock fails.
After a few hours the user tries to unlock and withdraw the tokens again at 07:12:55 without problems, remember that the tokens where locked until 03:59:30 PM.
Limitations
Like all of the methods, our smart lockable wallets have limitations. Some of these are due to architectural decisions or have been deliberately done:
- Only one release time can be set per token address.
- If someone sends tokens to a smart wallet that is owned by another user it will lose these tokens and the owner of the smart wallet will have the capacity to retrieve them when the lock gets open.
- There is no way to emergency unlock the tokens or reduce lock time. This is made intentionally to avoid that someone uses our system to scam users and make fraud.
- The tokens inside the Smart Lockable Wallet are property of the owner of the Smart Lockable Wallet, nobody can withdraw them.
Finally
To test these we deployed a few Smart Lockable Wallets, one for devs and one for marketing, to the mainnet and we sent the Liquidity Tokens and the tokens for the Dev’s and Marketing Wallets.
- Liquidity Pool tokens locked 1 year until Thursday, June 17, 2021
- Dev Wallet tokens locked 6 months until Saturday, January 1, 2022
- Marketing Wallet tokens locked 3 months until Friday, October 1, 2021
We encourage the community to check the transactions and the code that is audited. TimeLockVauls are self-identified on the code as TimeLockEagleFly and TimeLockMktEagleFly to demonstrate that we trust what we do and we trust that nobody, including us, can steal these tokens, scam or rug and put them into the market.