Skip to content

Instantly share code, notes, and snippets.

@0xAnonymous
Created November 11, 2020 12:47
Show Gist options
  • Save 0xAnonymous/cad820de0683e580b27c69aab6cbf009 to your computer and use it in GitHub Desktop.
Save 0xAnonymous/cad820de0683e580b27c69aab6cbf009 to your computer and use it in GitHub Desktop.
contract MoneySupplyTax is Coin {
address taxCollector;
uint taxRate;
mapping(address => uint) taxDeclared;
function enforceTax(address _account) internal {
uint undeclared = taxrate**(block.timestamp - taxDeclared[_account]);
balanceOf[_account] *= undeclared;
if(_account == taxCollector) balanceOf[_account] += totalSupply - totalSupply*undeclared;
taxDeclared[_account] = block.timestamp;
}
function payment(address _to, uint _amount) public {
enforceTax(msg.sender);
enforceTax(_to);
transfer(_to, _amount);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment