Skip to content

Instantly share code, notes, and snippets.

@mcchan1
Created January 17, 2020 21:40
Show Gist options
  • Save mcchan1/86512da86bec9a2e9ecd2bdb74164784 to your computer and use it in GitHub Desktop.
Save mcchan1/86512da86bec9a2e9ecd2bdb74164784 to your computer and use it in GitHub Desktop.
admin extension LAO
///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