mirror of
git://holbrook.no/erc20-demurrage-token
synced 2024-12-22 03:57:31 +01:00
Use base amount on minting
This commit is contained in:
parent
3f0516d4bc
commit
9b538d0e47
@ -147,7 +147,7 @@ class Test(unittest.TestCase):
|
|||||||
r = self.w3.eth.getTransactionReceipt(tx_hash)
|
r = self.w3.eth.getTransactionReceipt(tx_hash)
|
||||||
# No cheating!
|
# No cheating!
|
||||||
self.contract.functions.transfer(self.w3.eth.accounts[3], spend_amount).transact({'from': self.w3.eth.accounts[3]})
|
self.contract.functions.transfer(self.w3.eth.accounts[3], spend_amount).transact({'from': self.w3.eth.accounts[3]})
|
||||||
# Cheapskate!
|
# No cheapskating!
|
||||||
self.contract.functions.transfer(external_address, spend_amount-1).transact({'from': self.w3.eth.accounts[4]})
|
self.contract.functions.transfer(external_address, spend_amount-1).transact({'from': self.w3.eth.accounts[4]})
|
||||||
|
|
||||||
self.assertEqual(r.status, 1)
|
self.assertEqual(r.status, 1)
|
||||||
|
@ -117,12 +117,15 @@ contract RedistributedDemurrageToken {
|
|||||||
// Creates new tokens out of thin air, and allocates them to the given address
|
// Creates new tokens out of thin air, and allocates them to the given address
|
||||||
// Triggers tax
|
// Triggers tax
|
||||||
function mintTo(address _beneficiary, uint256 _amount) external returns (bool) {
|
function mintTo(address _beneficiary, uint256 _amount) external returns (bool) {
|
||||||
|
uint256 baseAmount;
|
||||||
|
|
||||||
require(minter[msg.sender]);
|
require(minter[msg.sender]);
|
||||||
|
|
||||||
applyDemurrage();
|
applyDemurrage();
|
||||||
changePeriod();
|
changePeriod();
|
||||||
|
baseAmount = _amount;
|
||||||
totalSupply += _amount;
|
totalSupply += _amount;
|
||||||
increaseBaseBalance(_beneficiary, _amount);
|
increaseBaseBalance(_beneficiary, baseAmount);
|
||||||
emit Mint(msg.sender, _beneficiary, _amount);
|
emit Mint(msg.sender, _beneficiary, _amount);
|
||||||
saveRedistributionSupply();
|
saveRedistributionSupply();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user