Remove dead contract code in default distribution (single)

This commit is contained in:
nolash 2021-06-07 09:36:31 +02:00
parent fb8d1e548c
commit 32ae98d581
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
7 changed files with 6 additions and 19 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -166,8 +166,6 @@ class DemurrageTokenSimulation:
return v * (10 ** self.decimals)
def mint(self, recipient, value):
self.__check_limit()
nonce_oracle = RPCNonceOracle(self.accounts[0], conn=self.rpc)

View File

@ -18,6 +18,7 @@ done
modes=(SingleCap SingleNocap)
for m in ${modes[@]}; do
ERC20_DEMURRAGE_TOKEN_TEST_MODE=$m python tests/test_single.py
ERC20_DEMURRAGE_TOKEN_TEST_MODE=$m python tests/test_redistribution_unit.py
done
modes=(MultiCap MultiNocap)

View File

@ -127,11 +127,13 @@ class TestRedistribution(TestDemurrageUnit):
supply = c.parse_total_supply(r)
expected_balance = int(supply * (self.tax_level / 1000000))
expected_balance_tolerance = 1
o = c.balance_of(self.address, self.sink_address, sender_address=self.accounts[0])
r = self.rpc.do(o)
balance = c.parse_balance_of(r)
self.assertEqual(balance, expected_balance)
self.assertGreaterEqual(balance, expected_balance - expected_balance_tolerance)
self.assertLessEqual(balance, expected_balance)
if __name__ == '__main__':

View File

@ -267,18 +267,11 @@ contract DemurrageTokenSingleCap {
// Returns the amount sent to the sink address
function applyDefaultRedistribution(bytes32 _redistribution) private returns (uint256) {
uint256 redistributionSupply;
uint256 redistributionPeriod;
uint256 unit;
uint256 truncatedResult;
redistributionSupply = toRedistributionSupply(_redistribution);
unit = (redistributionSupply * taxLevel) / 1000000;
truncatedResult = (unit * 1000000) / taxLevel;
if (truncatedResult < redistributionSupply) {
redistributionPeriod = toRedistributionPeriod(_redistribution); // since we reuse period here, can possibly be optimized by passing period instead
}
increaseBaseBalance(sinkAddress, unit / ppmDivider);
return unit;

View File

@ -262,18 +262,11 @@ contract DemurrageTokenSingleNocap {
// Returns the amount sent to the sink address
function applyDefaultRedistribution(bytes32 _redistribution) private returns (uint256) {
uint256 redistributionSupply;
uint256 redistributionPeriod;
uint256 unit;
uint256 truncatedResult;
redistributionSupply = toRedistributionSupply(_redistribution);
unit = (redistributionSupply * taxLevel) / 1000000;
truncatedResult = (unit * 1000000) / taxLevel;
if (truncatedResult < redistributionSupply) {
redistributionPeriod = toRedistributionPeriod(_redistribution); // since we reuse period here, can possibly be optimized by passing period instead
}
increaseBaseBalance(sinkAddress, unit / ppmDivider);
return unit;