Prevent non-owner from changing seal, bump deps

This commit is contained in:
lash 2024-08-15 12:36:25 +01:00
parent a40385a5a0
commit 8c09ff266e
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
7 changed files with 19 additions and 11 deletions

View File

@ -1,3 +1,5 @@
- 0.5.6
* Truncate approve maxuint value to tolerable value for contract.
- 0.5.5 - 0.5.5
* Make allowance method public * Make allowance method public
- 0.5.4 - 0.5.4

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,5 +1,9 @@
chainlib-eth~=0.4.11 #chainlib-eth~=0.4.11
chainlib~=0.4.12 #chainlib~=0.4.12
eth-erc20~=0.7.0 #eth-erc20~=0.7.0
funga-eth~=0.6.0 #funga-eth~=0.6.0
chainlib-eth~=0.6.1
chainlib~=0.5.0
eth-erc20~=0.9.0
funga-eth~=0.8.0
dexif~=0.0.2 dexif~=0.0.2

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
name = erc20-demurrage-token name = erc20-demurrage-token
version = 0.5.6 version = 0.5.7
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

@ -1,2 +1,3 @@
eth_tester==0.5.0b3 eth_tester==0.10.0b4
py-evm==0.3.0a20 py-evm==0.10.0b4
rlp==3.0.0

View File

@ -165,6 +165,7 @@ contract DemurrageTokenSingleNocap {
} }
function seal(uint256 _state) public returns(uint256) { function seal(uint256 _state) public returns(uint256) {
require(msg.sender == owner);
require(_state < 16, 'ERR_INVALID_STATE'); require(_state < 16, 'ERR_INVALID_STATE');
require(_state & sealState == 0, 'ERR_ALREADY_LOCKED'); require(_state & sealState == 0, 'ERR_ALREADY_LOCKED');
sealState |= _state; sealState |= _state;
@ -599,8 +600,8 @@ contract DemurrageTokenSingleNocap {
changePeriod(); changePeriod();
// dex code will attempt uint256max approve, but contract cannot handle that size // dex code will attempt uint256max approve, but basevalue calc is only valid up to a maximum of 2^63-1
// truncate to biggest possible value // skip the base value calc for higher values
if (_value <= VALUE_LIMIT) { if (_value <= VALUE_LIMIT) {
baseValue = toBaseAmount(_value); baseValue = toBaseAmount(_value);
} else { } else {