Created
January 17, 2020 21:40
-
-
Save mcchan1/86512da86bec9a2e9ecd2bdb74164784 to your computer and use it in GitHub Desktop.
admin extension LAO
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
///LAO - ADD ON, only ADMIN can withdraw the admin fee of .5% every 90 days. | |
uint256 public dueDate = now + paymentPeriod; | |
uint256 paymentPeriod = 90 days; //every quarter. | |
function withdrawAdminFee (address escrowAddress) public onlyWhitelisted { | |
//require > 90 days (dueDate) have passed since last withdrawal | |
require (now >= dueDate, "90 days have not passed"); | |
//update and increment dueDate by 1 paymentPeriod | |
dueDate = dueDate.add(paymentPeriod); | |
//withdraw adminFee from guildBank of .05% every 90 days | |
require( | |
guildBank.withdraw(escrowAddress, 1, 200, approvedTokens), | |
"withdrawal of tokens from guildBank failed" | |
); | |
//emit Event | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment