Compare commits

..

No commits in common. "dev-0.5.6" and "v0.5.3-beta.1+build.6d7792110d1c24466af63be15d84fe08cb86e443" have entirely different histories.

9 changed files with 10 additions and 49 deletions

View File

@ -208,9 +208,8 @@ and the lower 64 bits represents the decimals part, each consecutive
lesser bit halving the value of the previous bit.
For example, The byte value `00000000 00000002 a0000000 00000000`,
representing a zero-stripped binary value of $10.101$. This translates
to the (base 10) decimal value $2.625$. The decimal part is calculated
as, from left to right: $(1 * 0.5) + (0 * 0.25) + (1 * 0.125)$.
representing a zero-stripped binary value of $10.101$, translates to the
(base 10) decimal value $2.625$.
#### Calculating the demurrage parameter

View File

@ -105,7 +105,7 @@ The initial @emph{Sink Address}. The address may be altered as long as the @code
The @emph{input parameter} to the contract is a 128-bit positive fixed-point number, where the most significant 64 bits represent the integer part, and the lower 64 bits represents the decimals part, each consecutive lesser bit halving the value of the previous bit.
For example, The byte value @code{00000000 00000002 a0000000 00000000}, representing a zero-stripped binary value of @math{10.101}. This translates to the (base 10) decimal value @math{2.625}. The decimal part is calculated as, from left to right: @math{(1 * 0.5) + (0 * 0.25) + (1 * 0.125)}.
For example, The byte value @code{00000000 00000002 a0000000 00000000}, representing a zero-stripped binary value of @math{10.101}, translates to the (base 10) decimal value @math{2.625}.
@subsubsection Calculating the demurrage parameter

View File

@ -1,7 +1,3 @@
- 0.5.5
* Make allowance method public
- 0.5.4
* Add Transfer() event emission to sweep() in contract
- 0.5.3
* Add texinfo documentation
* Add man page for publish tool

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]
name = erc20-demurrage-token
version = 0.5.6
version = 0.5.3
description = ERC20 token with redistributed continual demurrage
author = Louis Holbrook
author_email = dev@holbrook.no

View File

@ -308,30 +308,6 @@ class TestBasic(TestDemurrageDefault):
self.assertEqual(r['status'], 1)
def test_approve_max(self):
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
(tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], int.from_bytes(b'\xff' * 32, byteorder='big'))
self.rpc.do(o)
o = receipt(tx_hash)
r = self.rpc.do(o)
self.assertEqual(r['status'], 1)
(tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], 0)
self.rpc.do(o)
o = receipt(tx_hash)
r = self.rpc.do(o)
self.assertEqual(r['status'], 1)
self.backend.time_travel(self.start_time + (60 * 60 * 24 * 365 * 10))
c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
(tx_hash, o) = c.approve(self.address, self.accounts[0], self.accounts[1], int.from_bytes(b'\xff' * 32, byteorder='big'))
self.rpc.do(o)
o = receipt(tx_hash)
r = self.rpc.do(o)
self.assertEqual(r['status'], 1)
def test_transfer_from(self):
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
c = DemurrageToken(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)

View File

@ -6,8 +6,6 @@ import "aux/ABDKMath64x64.sol";
contract DemurrageTokenSingleNocap {
uint256 constant VALUE_LIMIT = 1 << 63;
struct redistributionItem {
uint32 period;
uint72 value;
@ -75,7 +73,7 @@ contract DemurrageTokenSingleNocap {
mapping (address => bool) minter;
// Storage for ERC20 approve/transferFrom methods
mapping (address => mapping (address => uint256 ) ) public allowance; // holder -> spender -> amount (amount is subject to demurrage)
mapping (address => mapping (address => uint256 ) ) allowance; // holder -> spender -> amount (amount is subject to demurrage)
// Address to send unallocated redistribution tokens
address public sinkAddress;
@ -255,7 +253,7 @@ contract DemurrageTokenSingleNocap {
// Implements Writer
function isWriter(address _minter) public view returns(bool) {
return minter[_minter] || _minter == owner;
return minter[_minter];
}
/// Implements ERC20
@ -317,7 +315,6 @@ contract DemurrageTokenSingleNocap {
v = account[msg.sender];
account[msg.sender] = 0;
account[_account] += v;
emit Transfer(msg.sender, _account, v);
return v;
}
@ -599,14 +596,7 @@ contract DemurrageTokenSingleNocap {
changePeriod();
// dex code will attempt uint256max approve, but contract cannot handle that size
// truncate to biggest possible value
if (_value <= VALUE_LIMIT) {
baseValue = toBaseAmount(_value);
} else {
baseValue = VALUE_LIMIT;
}
baseValue = toBaseAmount(_value);
allowance[msg.sender][_spender] = baseValue;
emit Approval(msg.sender, _spender, _value);
return true;