Last active
March 18, 2022 11:37
-
-
Save blutarche/d5c03e3d291aa300d82efab0f9136819 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function: Deposit | |
parameters: Amount, Deadline | |
code: | |
- Check if function Caller transfer asset to this contract by at least the Amount. | |
- if not, reject transaction | |
- Increase function Caller's balance by Amount. | |
- Lock this chunk of asset with the deadline. | |
function: Withdraw | |
parameters: Amount | |
code: | |
- Check if function Caller's balance is at least Amount | |
- if not, reject transaction | |
- Check if there's at least an Amount worth of assets unlocked by this time. | |
- if not, reject transaction | |
- Re-calculate locked assets. | |
- Decrease function Caller's balance by Amount. | |
- Transfer an Amount of asset to function Caller. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment