Eliminate solidity compiler warnings

This commit is contained in:
lash 2023-03-19 09:23:51 +00:00
parent 50405b5cf6
commit 1d93ece13e
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 11 additions and 11 deletions

View File

@ -1,3 +1,5 @@
- 0.4.1
* Eliminate solidity compiler warnings
- 0.4.0 - 0.4.0
* Rename taxLevel to decayLevel in contract * Rename taxLevel to decayLevel in contract
* Add sweep contract method to fully empty one account into another * Add sweep contract method to fully empty one account into another

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = erc20-demurrage-token name = erc20-demurrage-token
version = 0.4.0 version = 0.4.1
description = ERC20 token with redistributed continual demurrage description = ERC20 token with redistributed continual demurrage
author = Louis Holbrook author = Louis Holbrook
author_email = dev@holbrook.no author_email = dev@holbrook.no

View File

@ -242,7 +242,6 @@ contract DemurrageTokenSingleNocap {
int128 baseBalance; int128 baseBalance;
int128 currentDemurragedAmount; int128 currentDemurragedAmount;
uint256 periodCount; uint256 periodCount;
uint8 expiryState;
baseBalance = ABDKMath64x64.fromUInt(baseBalanceOf(_account)); baseBalance = ABDKMath64x64.fromUInt(baseBalanceOf(_account));
@ -260,7 +259,6 @@ contract DemurrageTokenSingleNocap {
/// Increases base balance for a single account /// Increases base balance for a single account
function increaseBaseBalance(address _account, uint256 _delta) private returns (bool) { function increaseBaseBalance(address _account, uint256 _delta) private returns (bool) {
uint256 oldBalance; uint256 oldBalance;
uint256 newBalance;
uint256 workAccount; uint256 workAccount;
workAccount = uint256(account[_account]); workAccount = uint256(account[_account]);
@ -277,7 +275,6 @@ contract DemurrageTokenSingleNocap {
/// Decreases base balance for a single account /// Decreases base balance for a single account
function decreaseBaseBalance(address _account, uint256 _delta) private returns (bool) { function decreaseBaseBalance(address _account, uint256 _delta) private returns (bool) {
uint256 oldBalance; uint256 oldBalance;
uint256 newBalance;
uint256 workAccount; uint256 workAccount;
workAccount = uint256(account[_account]); workAccount = uint256(account[_account]);
@ -327,6 +324,7 @@ contract DemurrageTokenSingleNocap {
function toRedistribution(uint256 _participants, int128 _demurrageModifier, uint256 _value, uint256 _period) public pure returns(redistributionItem memory) { function toRedistribution(uint256 _participants, int128 _demurrageModifier, uint256 _value, uint256 _period) public pure returns(redistributionItem memory) {
redistributionItem memory redistribution; redistributionItem memory redistribution;
_participants;
redistribution.period = uint32(_period); redistribution.period = uint32(_period);
redistribution.value = uint72(_value); redistribution.value = uint72(_value);
redistribution.demurrage = uint64(uint128(_demurrageModifier) & 0xffffffffffffffff); redistribution.demurrage = uint64(uint128(_demurrageModifier) & 0xffffffffffffffff);
@ -392,7 +390,7 @@ contract DemurrageTokenSingleNocap {
return lastRedistribution; return lastRedistribution;
} }
function getDistribution(uint256 _supply, int128 _demurrageAmount) public view returns (uint256) { function getDistribution(uint256 _supply, int128 _demurrageAmount) public pure returns (uint256) {
int128 difference; int128 difference;
difference = ABDKMath64x64.mul(ABDKMath64x64.fromUInt(_supply), ABDKMath64x64.sub(ABDKMath64x64.fromUInt(1), _demurrageAmount)); difference = ABDKMath64x64.mul(ABDKMath64x64.fromUInt(_supply), ABDKMath64x64.sub(ABDKMath64x64.fromUInt(1), _demurrageAmount));
@ -400,7 +398,7 @@ contract DemurrageTokenSingleNocap {
} }
function getDistributionFromRedistribution(redistributionItem memory _redistribution) public returns (uint256) { function getDistributionFromRedistribution(redistributionItem memory _redistribution) public pure returns (uint256) {
uint256 redistributionSupply; uint256 redistributionSupply;
int128 redistributionDemurrage; int128 redistributionDemurrage;
@ -643,8 +641,6 @@ contract DemurrageTokenSingleNocap {
// ERC20 transfer backend for transfer, transferFrom // ERC20 transfer backend for transfer, transferFrom
function transferBase(address _from, address _to, uint256 _value) private returns (bool) { function transferBase(address _from, address _to, uint256 _value) private returns (bool) {
uint256 period;
decreaseBaseBalance(_from, _value); decreaseBaseBalance(_from, _value);
increaseBaseBalance(_to, _value); increaseBaseBalance(_to, _value);
@ -655,6 +651,7 @@ contract DemurrageTokenSingleNocap {
function transferOwnership(address _newOwner) public returns (bool) { function transferOwnership(address _newOwner) public returns (bool) {
require(msg.sender == owner); require(msg.sender == owner);
newOwner = _newOwner; newOwner = _newOwner;
return true;
} }
// Implements OwnedAccepter // Implements OwnedAccepter
@ -666,6 +663,7 @@ contract DemurrageTokenSingleNocap {
owner = newOwner; owner = newOwner;
newOwner = address(0); newOwner = address(0);
emit OwnershipTransferred(oldOwner, owner); emit OwnershipTransferred(oldOwner, owner);
return true;
} }
// Explicitly and irretrievably burn tokens // Explicitly and irretrievably burn tokens