From 819f0951e4ac92dd2899e1b95f3ed818f524675d Mon Sep 17 00:00:00 2001 From: szotov Date: Sat, 9 Feb 2019 16:58:09 +0300 Subject: [PATCH 1/9] solidity contracts 0.4.25 -> 0.5.3, updates openzeppelin contracts --- nucypher/blockchain/eth/constants.py | 2 +- .../eth/sol/source/contracts/Issuer.sol | 22 +- .../eth/sol/source/contracts/MinersEscrow.sol | 56 ++--- .../sol/source/contracts/NuCypherToken.sol | 17 +- .../sol/source/contracts/PolicyManager.sol | 30 +-- .../eth/sol/source/contracts/Seeder.sol | 13 +- .../eth/sol/source/contracts/UserEscrow.sol | 24 +-- .../sol/source/contracts/UserEscrowProxy.sol | 11 +- .../source/contracts/lib/AdditionalMath.sol | 2 +- .../sol/source/contracts/proxy/Dispatcher.sol | 40 ++-- .../source/contracts/proxy/Upgradeable.sol | 16 +- .../eth/sol/source/zeppelin/math/Math.sol | 36 ++-- .../eth/sol/source/zeppelin/math/SafeMath.sol | 90 ++++---- .../sol/source/zeppelin/ownership/Ownable.sol | 83 ++++--- .../zeppelin/token/ERC20/BasicToken.sol | 52 ----- .../zeppelin/token/ERC20/BurnableToken.sol | 29 --- .../zeppelin/token/ERC20/DetailedERC20.sol | 16 -- .../sol/source/zeppelin/token/ERC20/ERC20.sol | 203 +++++++++++++++++- .../zeppelin/token/ERC20/ERC20Basic.sol | 14 -- .../zeppelin/token/ERC20/ERC20Detailed.sol | 44 ++++ .../source/zeppelin/token/ERC20/IERC20.sol | 24 +++ .../source/zeppelin/token/ERC20/SafeERC20.sol | 41 ++-- .../zeppelin/token/ERC20/StandardToken.sol | 100 --------- .../eth/contracts/contracts/IssuerTestSet.sol | 4 +- .../contracts/MinersEscrowTestSet.sol | 4 +- .../contracts/PolicyManagerTestSet.sol | 4 +- .../contracts/ReceiveApprovalMethodMock.sol | 4 +- .../contracts/contracts/UserEscrowTestSet.sol | 8 +- .../contracts/proxy/ContracV2Bad.sol | 6 +- .../contracts/proxy/ContractInterface.sol | 6 +- .../contracts/contracts/proxy/ContractV1.sol | 42 ++-- .../contracts/contracts/proxy/ContractV2.sol | 37 ++-- .../contracts/contracts/proxy/ContractV3.sol | 4 +- .../main/miners_escrow/test_miners_escrow.py | 4 +- .../eth/contracts/main/token/test_token.py | 27 ++- 35 files changed, 625 insertions(+), 490 deletions(-) delete mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BasicToken.sol delete mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BurnableToken.sol delete mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/DetailedERC20.sol delete mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Basic.sol create mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Detailed.sol create mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/IERC20.sol delete mode 100644 nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/StandardToken.sol diff --git a/nucypher/blockchain/eth/constants.py b/nucypher/blockchain/eth/constants.py index b6c8b6853..41754dfd2 100644 --- a/nucypher/blockchain/eth/constants.py +++ b/nucypher/blockchain/eth/constants.py @@ -17,7 +17,7 @@ along with nucypher. If not, see . """Nucypher Token and Miner constants.""" ONE_YEAR_IN_SECONDS = 31540000 -NUCYPHER_GAS_LIMIT = 5000000 # TODO: move elsewhere? +NUCYPHER_GAS_LIMIT = 6000000 # TODO: move elsewhere? # # Dispatcher diff --git a/nucypher/blockchain/eth/sol/source/contracts/Issuer.sol b/nucypher/blockchain/eth/sol/source/contracts/Issuer.sol index 5cf969f07..ac262fca2 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/Issuer.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/Issuer.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "contracts/NuCypherToken.sol"; @@ -56,7 +56,7 @@ contract Issuer is Upgradeable { ) public { - require(address(_token) != 0x0 && + require(address(_token) != address(0) && _miningCoefficient != 0 && _hoursPerPeriod != 0 && _lockedPeriodsCoefficient != 0 && @@ -115,10 +115,10 @@ contract Issuer is Upgradeable { internal returns (uint256 amount) { uint256 currentSupply = _period <= lastMintedPeriod ? - Math.min256(currentSupply1, currentSupply2) : - Math.max256(currentSupply1, currentSupply2); + Math.min(currentSupply1, currentSupply2) : + Math.max(currentSupply1, currentSupply2); if (currentSupply == totalSupply) { - return; + return 0; } //totalSupply * lockedValue * (k1 + allLockedPeriods) / (totalLockedValue * k2) - @@ -158,15 +158,15 @@ contract Issuer is Upgradeable { } function verifyState(address _testTarget) public onlyOwner { - require(address(delegateGet(_testTarget, "token()")) == address(token)); - require(uint256(delegateGet(_testTarget, "miningCoefficient()")) == miningCoefficient); - require(uint256(delegateGet(_testTarget, "lockedPeriodsCoefficient()")) == lockedPeriodsCoefficient); + require(address(uint160(delegateGet(_testTarget, "token()"))) == address(token)); + require(delegateGet(_testTarget, "miningCoefficient()") == miningCoefficient); + require(delegateGet(_testTarget, "lockedPeriodsCoefficient()") == lockedPeriodsCoefficient); require(uint32(delegateGet(_testTarget, "secondsPerPeriod()")) == secondsPerPeriod); require(uint16(delegateGet(_testTarget, "rewardedPeriods()")) == rewardedPeriods); require(uint16(delegateGet(_testTarget, "lastMintedPeriod()")) == lastMintedPeriod); - require(uint256(delegateGet(_testTarget, "currentSupply1()")) == currentSupply1); - require(uint256(delegateGet(_testTarget, "currentSupply2()")) == currentSupply2); - require(uint256(delegateGet(_testTarget, "totalSupply()")) == totalSupply); + require(delegateGet(_testTarget, "currentSupply1()") == currentSupply1); + require(delegateGet(_testTarget, "currentSupply2()") == currentSupply2); + require(delegateGet(_testTarget, "totalSupply()") == totalSupply); } function finishUpgrade(address _target) public onlyOwner { diff --git a/nucypher/blockchain/eth/sol/source/contracts/MinersEscrow.sol b/nucypher/blockchain/eth/sol/source/contracts/MinersEscrow.sol index 717d991a9..e24ed484b 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/MinersEscrow.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/MinersEscrow.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "zeppelin/token/ERC20/SafeERC20.sol"; @@ -208,7 +208,7 @@ contract MinersEscrow is Issuer { * @param _values Amount of tokens to deposit for each miner * @param _periods Amount of periods during which tokens will be locked for each miner **/ - function preDeposit(address[] _miners, uint256[] _values, uint16[] _periods) + function preDeposit(address[] memory _miners, uint256[] memory _values, uint16[] memory _periods) public isInitialized { require(_miners.length != 0 && @@ -256,13 +256,13 @@ contract MinersEscrow is Issuer { * @param _from Miner * @param _value Amount of tokens to deposit * @param _tokenContract Token contract address - * @notice (param _extraData) Amount of periods during which tokens will be locked + * @param _extraData Amount of periods during which tokens will be locked **/ function receiveApproval( address _from, uint256 _value, address _tokenContract, - bytes /* _extraData */ + bytes calldata _extraData ) external { @@ -390,7 +390,7 @@ contract MinersEscrow is Issuer { MinerInfo storage info = minerInfo[msg.sender]; // the max locked tokens in most cases will be in the current period // but when the miner stakes more then we should use the next period - uint256 lockedTokens = Math.max256(getLockedTokens(msg.sender, 1), + uint256 lockedTokens = Math.max(getLockedTokens(msg.sender, 1), getLockedTokens(msg.sender, 0)); require(_value <= token.balanceOf(address(this)) && _value <= info.value.sub(lockedTokens)); @@ -606,8 +606,8 @@ contract MinersEscrow is Issuer { * the last values in the resulting array will be zeros addresses. * The length of this array is always equal to the number of points. **/ - function sample(uint256[] _points, uint16 _periods) - external view returns (address[] result) + function sample(uint256[] calldata _points, uint16 _periods) + external view returns (address[] memory result) { require(_periods > 0 && _points.length > 0); uint16 currentPeriod = getCurrentPeriod(); @@ -646,7 +646,7 @@ contract MinersEscrow is Issuer { * @notice Set policy manager address **/ function setPolicyManager(PolicyManagerInterface _policyManager) external onlyOwner { - require(address(policyManager) == 0x0 && + require(address(policyManager) == address(0) && _policyManager.escrow() == address(this)); policyManager = _policyManager; } @@ -703,10 +703,10 @@ contract MinersEscrow is Issuer { /** * @dev Get MinerInfo structure by delegatecall **/ - function delegateGetMinerInfo(address _target, address _miner) + function delegateGetMinerInfo(address _target, bytes32 _miner) internal returns (MinerInfo memory result) { - bytes32 memoryAddress = delegateGetData(_target, "minerInfo(address)", 1, bytes32(_miner), 0); + bytes32 memoryAddress = delegateGetData(_target, "minerInfo(address)", 1, _miner, 0); assembly { result := memoryAddress } @@ -715,11 +715,11 @@ contract MinersEscrow is Issuer { /** * @dev Get StakeInfo structure by delegatecall **/ - function delegateGetStakeInfo(address _target, address _miner, uint256 _index) + function delegateGetStakeInfo(address _target, bytes32 _miner, uint256 _index) internal returns (StakeInfo memory result) { bytes32 memoryAddress = delegateGetData( - _target, "getStakeInfo(address,uint256)", 2, bytes32(_miner), bytes32(_index)); + _target, "getStakeInfo(address,uint256)", 2, _miner, bytes32(_index)); assembly { result := memoryAddress } @@ -728,11 +728,11 @@ contract MinersEscrow is Issuer { /** * @dev Get Downtime structure by delegatecall **/ - function delegateGetPastDowntime(address _target, address _miner, uint256 _index) + function delegateGetPastDowntime(address _target, bytes32 _miner, uint256 _index) internal returns (Downtime memory result) { bytes32 memoryAddress = delegateGetData( - _target, "getPastDowntime(address,uint256)", 2, bytes32(_miner), bytes32(_index)); + _target, "getPastDowntime(address,uint256)", 2, _miner, bytes32(_index)); assembly { result := memoryAddress } @@ -742,41 +742,41 @@ contract MinersEscrow is Issuer { super.verifyState(_testTarget); require(uint16(delegateGet(_testTarget, "minLockedPeriods()")) == minLockedPeriods); - require(uint256(delegateGet(_testTarget, "minAllowableLockedTokens()")) == + require(delegateGet(_testTarget, "minAllowableLockedTokens()") == minAllowableLockedTokens); - require(uint256(delegateGet(_testTarget, "maxAllowableLockedTokens()")) == + require(delegateGet(_testTarget, "maxAllowableLockedTokens()") == maxAllowableLockedTokens); - require(address(delegateGet(_testTarget, "policyManager()")) == address(policyManager)); - require(uint256(delegateGet(_testTarget, "lockedPerPeriod(uint16)", - bytes32(RESERVED_PERIOD))) == lockedPerPeriod[RESERVED_PERIOD]); + require(address(uint160(delegateGet(_testTarget, "policyManager()"))) == address(policyManager)); + require(delegateGet(_testTarget, "lockedPerPeriod(uint16)", + bytes32(bytes2(RESERVED_PERIOD))) == lockedPerPeriod[RESERVED_PERIOD]); - require(uint256(delegateGet(_testTarget, "getMinersLength()")) == miners.length); + require(delegateGet(_testTarget, "getMinersLength()") == miners.length); if (miners.length == 0) { return; } address minerAddress = miners[0]; - bytes32 miner = bytes32(minerAddress); - require(address(delegateGet(_testTarget, "miners(uint256)", 0)) == minerAddress); + require(address(uint160(delegateGet(_testTarget, "miners(uint256)", 0))) == minerAddress); MinerInfo storage info = minerInfo[minerAddress]; - MinerInfo memory infoToCheck = delegateGetMinerInfo(_testTarget, minerAddress); + bytes32 miner = bytes32(uint256(minerAddress)); + MinerInfo memory infoToCheck = delegateGetMinerInfo(_testTarget, miner); require(infoToCheck.value == info.value && infoToCheck.confirmedPeriod1 == info.confirmedPeriod1 && infoToCheck.confirmedPeriod2 == info.confirmedPeriod2 && infoToCheck.lastActivePeriod == info.lastActivePeriod); - require(uint256(delegateGet(_testTarget, "getPastDowntimeLength(address)", miner)) == + require(delegateGet(_testTarget, "getPastDowntimeLength(address)", miner) == info.pastDowntime.length); - for (i = 0; i < info.pastDowntime.length && i < MAX_CHECKED_VALUES; i++) { + for (uint256 i = 0; i < info.pastDowntime.length && i < MAX_CHECKED_VALUES; i++) { Downtime storage downtime = info.pastDowntime[i]; - Downtime memory downtimeToCheck = delegateGetPastDowntime(_testTarget, minerAddress, i); + Downtime memory downtimeToCheck = delegateGetPastDowntime(_testTarget, miner, i); require(downtimeToCheck.startPeriod == downtime.startPeriod && downtimeToCheck.endPeriod == downtime.endPeriod); } - require(uint256(delegateGet(_testTarget, "getStakesLength(address)", miner)) == info.stakes.length); + require(delegateGet(_testTarget, "getStakesLength(address)", miner) == info.stakes.length); for (uint256 i = 0; i < info.stakes.length && i < MAX_CHECKED_VALUES; i++) { StakeInfo storage stakeInfo = info.stakes[i]; - StakeInfo memory stakeInfoToCheck = delegateGetStakeInfo(_testTarget, minerAddress, i); + StakeInfo memory stakeInfoToCheck = delegateGetStakeInfo(_testTarget, miner, i); require(stakeInfoToCheck.firstPeriod == stakeInfo.firstPeriod && stakeInfoToCheck.lastPeriod == stakeInfo.lastPeriod && stakeInfoToCheck.periods == stakeInfo.periods && diff --git a/nucypher/blockchain/eth/sol/source/contracts/NuCypherToken.sol b/nucypher/blockchain/eth/sol/source/contracts/NuCypherToken.sol index ee1ba82e1..c6fa15be2 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/NuCypherToken.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/NuCypherToken.sol @@ -1,9 +1,8 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; -import "zeppelin/token/ERC20/BurnableToken.sol"; -import "zeppelin/token/ERC20/StandardToken.sol"; -import "zeppelin/token/ERC20/DetailedERC20.sol"; +import "zeppelin/token/ERC20/ERC20.sol"; +import "zeppelin/token/ERC20/ERC20Detailed.sol"; /** @@ -11,16 +10,14 @@ import "zeppelin/token/ERC20/DetailedERC20.sol"; * @notice ERC20 token which can be burned by their owners * @dev Optional approveAndCall() functionality to notify a contract if an approve() has occurred. **/ -contract NuCypherToken is StandardToken, DetailedERC20('NuCypher', 'NU', 18), BurnableToken { +contract NuCypherToken is ERC20, ERC20Detailed('NuCypher', 'NU', 18) { /** * @notice Set amount of tokens * @param _initialAmount Initial amount of tokens **/ constructor (uint256 _initialAmount) public { - balances[msg.sender] = _initialAmount; - totalSupply_ = _initialAmount; - emit Transfer(0x0, msg.sender, _initialAmount); + _mint(msg.sender, _initialAmount); } /** @@ -29,7 +26,7 @@ contract NuCypherToken is StandardToken, DetailedERC20('NuCypher', 'NU', 18), Bu * @dev call the receiveApproval function on the contract you want to be notified. * receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) **/ - function approveAndCall(address _spender, uint256 _value, bytes _extraData) + function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) { approve(_spender, _value); @@ -52,6 +49,6 @@ contract TokenRecipient { * @param _tokenContract Address of the token contract * @param _extraData Extra data **/ - function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) external; + function receiveApproval(address _from, uint256 _value, address _tokenContract, bytes calldata _extraData) external; } diff --git a/nucypher/blockchain/eth/sol/source/contracts/PolicyManager.sol b/nucypher/blockchain/eth/sol/source/contracts/PolicyManager.sol index e8e63befa..c96089517 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/PolicyManager.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/PolicyManager.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "zeppelin/token/ERC20/SafeERC20.sol"; @@ -80,7 +80,7 @@ contract PolicyManager is Upgradeable { } bytes16 constant RESERVED_POLICY_ID = bytes16(0); - address constant RESERVED_NODE = 0x0; + address constant RESERVED_NODE = address(0); MinersEscrow public escrow; uint32 public secondsPerPeriod; @@ -92,7 +92,7 @@ contract PolicyManager is Upgradeable { * @param _escrow Escrow contract **/ constructor(MinersEscrow _escrow) public { - require(address(_escrow) != 0x0); + require(address(_escrow) != address(0)); escrow = _escrow; secondsPerPeriod = escrow.secondsPerPeriod(); } @@ -145,7 +145,7 @@ contract PolicyManager is Upgradeable { bytes16 _policyId, uint16 _numberOfPeriods, uint256 _firstPartialReward, - address[] _nodes + address[] memory _nodes ) public payable { @@ -210,7 +210,7 @@ contract PolicyManager is Upgradeable { * @notice Withdraw reward by node * @param _recipient Recipient of the reward **/ - function withdraw(address _recipient) public returns (uint256) { + function withdraw(address payable _recipient) public returns (uint256) { NodeInfo storage node = nodes[msg.sender]; uint256 reward = node.reward; require(reward != 0); @@ -264,7 +264,7 @@ contract PolicyManager is Upgradeable { if (lastActivePeriod < _policy.startPeriod - 1) { refundValue = _policy.firstPartialReward; } else if (_arrangement.indexOfDowntimePeriods < length) { - (startPeriod, endPeriod) = escrow.getPastDowntime( + (uint16 startPeriod, uint16 endPeriod) = escrow.getPastDowntime( _arrangement.node, _arrangement.indexOfDowntimePeriods); if (_policy.startPeriod > startPeriod && _policy.startPeriod - 1 <= endPeriod) { refundValue = _policy.firstPartialReward; @@ -288,7 +288,8 @@ contract PolicyManager is Upgradeable { require(policy.client == msg.sender && !policy.disabled); uint16 endPeriod = policy.lastPeriod.add16(1); uint256 numberOfActive = policy.arrangements.length; - for (uint256 i = 0; i < policy.arrangements.length; i++) { + uint256 i = 0; + for (; i < policy.arrangements.length; i++) { ArrangementInfo storage arrangement = policy.arrangements[i]; address node = arrangement.node; if (node == RESERVED_NODE || _node != RESERVED_NODE && _node != node) { @@ -345,7 +346,8 @@ contract PolicyManager is Upgradeable { { Policy storage policy = policies[_policyId]; require(msg.sender == policy.client && !policy.disabled); - for (uint256 i = 0; i < policy.arrangements.length; i++) { + uint256 i = 0; + for (; i < policy.arrangements.length; i++) { ArrangementInfo storage arrangement = policy.arrangements[i]; if (arrangement.node == RESERVED_NODE || _node != RESERVED_NODE && _node != arrangement.node) { continue; @@ -491,14 +493,14 @@ contract PolicyManager is Upgradeable { function delegateGetNodeInfo(address _target, address _node) internal returns (NodeInfo memory result) { - bytes32 memoryAddress = delegateGetData(_target, "nodes(address)", 1, bytes32(_node), 0); + bytes32 memoryAddress = delegateGetData(_target, "nodes(address)", 1, bytes32(uint256(_node)), 0); assembly { result := memoryAddress } } function verifyState(address _testTarget) public onlyOwner { - require(address(delegateGet(_testTarget, "escrow()")) == address(escrow)); + require(address(uint160(delegateGet(_testTarget, "escrow()"))) == address(escrow)); require(uint32(delegateGet(_testTarget, "secondsPerPeriod()")) == secondsPerPeriod); Policy storage policy = policies[RESERVED_POLICY_ID]; Policy memory policyToCheck = delegateGetPolicy(_testTarget, RESERVED_POLICY_ID); @@ -509,8 +511,8 @@ contract PolicyManager is Upgradeable { policyToCheck.lastPeriod == policy.lastPeriod && policyToCheck.disabled == policy.disabled); - require(uint256(delegateGet(_testTarget, "getArrangementsLength(bytes16)", - RESERVED_POLICY_ID)) == policy.arrangements.length); + require(delegateGet(_testTarget, "getArrangementsLength(bytes16)", + RESERVED_POLICY_ID) == policy.arrangements.length); ArrangementInfo storage arrangement = policy.arrangements[0]; ArrangementInfo memory arrangementToCheck = delegateGetArrangementInfo( _testTarget, RESERVED_POLICY_ID, 0); @@ -526,7 +528,7 @@ contract PolicyManager is Upgradeable { nodeInfoToCheck.minRewardRate == nodeInfo.minRewardRate); require(int256(delegateGet(_testTarget, "getNodeRewardDelta(address,uint16)", - bytes32(RESERVED_NODE), 11)) == nodeInfo.rewardDelta[11]); + bytes32(bytes20(RESERVED_NODE)), bytes32(uint256(11)))) == nodeInfo.rewardDelta[11]); } function finishUpgrade(address _target) public onlyOwner { @@ -535,7 +537,7 @@ contract PolicyManager is Upgradeable { secondsPerPeriod = policyManager.secondsPerPeriod(); // Create fake Policy and NodeInfo to use them in verifyState(address) Policy storage policy = policies[RESERVED_POLICY_ID]; - policy.client = owner; + policy.client = owner(); policy.startPeriod = 1; policy.lastPeriod = 2; policy.rewardRate = 3; diff --git a/nucypher/blockchain/eth/sol/source/contracts/Seeder.sol b/nucypher/blockchain/eth/sol/source/contracts/Seeder.sol index 5c3ed9786..68f1bbb76 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/Seeder.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/Seeder.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "zeppelin/ownership/Ownable.sol"; @@ -40,12 +40,13 @@ contract Seeder is Ownable { * @param _ip IPv4 address of the seed node * @param _port TCP port of the seed node **/ - function enroll(address _seed, string _ip, uint16 _port) public onlyOwner { + function enroll(address _seed, string memory _ip, uint16 _port) public onlyOwner { seeds[_seed] = SeedInfo(_ip, _port); - for (uint256 i = 0; i < seedArray.length; i++) { + uint256 i = 0; + for (; i < seedArray.length; i++) { address currentSeed = seedArray[i]; - if (currentSeed == 0x0) { + if (currentSeed == address(0)) { seedArray[i] = _seed; break; } else if (currentSeed == _seed) { @@ -61,8 +62,8 @@ contract Seeder is Ownable { * @param _ip Updated IPv4 address of the existing seed node * @param _port Updated TCP port of the existing seed node **/ - function refresh(string _ip, uint16 _port) public { - SeedInfo seed = seeds[msg.sender]; + function refresh(string memory _ip, uint16 _port) public { + SeedInfo storage seed = seeds[msg.sender]; require(seed.port != 0); seed.ip = _ip; seed.port = _port; diff --git a/nucypher/blockchain/eth/sol/source/contracts/UserEscrow.sol b/nucypher/blockchain/eth/sol/source/contracts/UserEscrow.sol index 0ea6bcae6..2ecd9b656 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/UserEscrow.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/UserEscrow.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "zeppelin/ownership/Ownable.sol"; @@ -20,7 +20,7 @@ contract UserEscrowLibraryLinker is Ownable { * @param _newSecretHash Secret hash (keccak256) **/ constructor(address _target, bytes32 _newSecretHash) public { - require(_target != 0x0); + require(_target != address(0)); target = _target; secretHash = _newSecretHash; } @@ -31,8 +31,8 @@ contract UserEscrowLibraryLinker is Ownable { * @param _secret Secret for proof of contract owning * @param _newSecretHash New secret hash (keccak256) **/ - function upgrade(address _target, bytes _secret, bytes32 _newSecretHash) public onlyOwner { - require(_target != 0x0); + function upgrade(address _target, bytes memory _secret, bytes32 _newSecretHash) public onlyOwner { + require(_target != address(0)); require(keccak256(_secret) == secretHash && _newSecretHash != secretHash); target = _target; secretHash = _newSecretHash; @@ -64,7 +64,7 @@ contract UserEscrow is Ownable { * @param _token Token contract **/ constructor(UserEscrowLibraryLinker _linker, NuCypherToken _token) public { - require(address(_token) != 0x0 && address(_linker) != 0x0); + require(address(_token) != address(0) && address(_linker) != address(0)); linker = _linker; token = _token; } @@ -98,8 +98,8 @@ contract UserEscrow is Ownable { **/ function withdrawTokens(uint256 _value) public onlyOwner { require(token.balanceOf(address(this)).sub(getLockedTokens()) >= _value); - token.safeTransfer(owner, _value); - emit TokensWithdrawn(owner, _value); + token.safeTransfer(msg.sender, _value); + emit TokensWithdrawn(msg.sender, _value); } /** @@ -108,17 +108,17 @@ contract UserEscrow is Ownable { function withdrawETH() public onlyOwner { uint256 balance = address(this).balance; require(balance != 0); - owner.transfer(balance); - emit ETHWithdrawn(owner, balance); + msg.sender.transfer(balance); + emit ETHWithdrawn(msg.sender, balance); } /** * @dev Fallback function send all requests to the target proxy contract **/ - function () public payable onlyOwner { + function () external payable onlyOwner { address libraryTarget = linker.target(); - require(libraryTarget != 0x0); - bool callSuccess = libraryTarget.delegatecall(msg.data); + require(libraryTarget != address(0)); + (bool callSuccess,) = libraryTarget.delegatecall(msg.data); if (callSuccess) { assembly { returndatacopy(0x0, 0x0, returndatasize) diff --git a/nucypher/blockchain/eth/sol/source/contracts/UserEscrowProxy.sol b/nucypher/blockchain/eth/sol/source/contracts/UserEscrowProxy.sol index 00440d7f7..d30679f11 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/UserEscrowProxy.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/UserEscrowProxy.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "./UserEscrow.sol"; @@ -40,9 +40,9 @@ contract UserEscrowProxy { ) public { - require(address(_token) != 0x0 && - address(_escrow) != 0x0 && - address(_policyManager) != 0x0); + require(address(_token) != address(0) && + address(_escrow) != address(0) && + address(_policyManager) != address(0)); token = _token; escrow = _escrow; policyManager = _policyManager; @@ -53,7 +53,8 @@ contract UserEscrowProxy { * @dev Assume that `this` is the UserEscrow contract **/ function getStateContract() internal view returns (UserEscrowProxy) { - UserEscrowLibraryLinker linker = UserEscrow(address(this)).linker(); + address payable userEscrowAddress = address(bytes20(address(this))); + UserEscrowLibraryLinker linker = UserEscrow(userEscrowAddress).linker(); return UserEscrowProxy(linker.target()); } diff --git a/nucypher/blockchain/eth/sol/source/contracts/lib/AdditionalMath.sol b/nucypher/blockchain/eth/sol/source/contracts/lib/AdditionalMath.sol index c3a42efe0..cba683812 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/lib/AdditionalMath.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/lib/AdditionalMath.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "zeppelin/math/SafeMath.sol"; diff --git a/nucypher/blockchain/eth/sol/source/contracts/proxy/Dispatcher.sol b/nucypher/blockchain/eth/sol/source/contracts/proxy/Dispatcher.sol index c8f21f143..bdf768421 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/proxy/Dispatcher.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/proxy/Dispatcher.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; import "./Upgradeable.sol"; @@ -19,11 +19,12 @@ contract Dispatcher is Upgradeable { * @param _newSecretHash Secret hash (keccak256) **/ constructor(address _target, bytes32 _newSecretHash) public { - require(_target != 0x0); + require(_target != address(0)); target = _target; secretHash = _newSecretHash; - require(target.delegatecall(bytes4(keccak256("finishUpgrade(address)")), target)); - emit Upgraded(0x0, _target, msg.sender); + (bool callSuccess,) = target.delegatecall(abi.encodeWithSignature("finishUpgrade(address)", target)); + require(callSuccess); + emit Upgraded(address(0), _target, msg.sender); } /** @@ -32,23 +33,24 @@ contract Dispatcher is Upgradeable { * @param _secret Secret for proof of contract owning * @param _newSecretHash New secret hash (keccak256) **/ - function upgrade(address _target, bytes _secret, bytes32 _newSecretHash) public onlyOwner { + function upgrade(address _target, bytes memory _secret, bytes32 _newSecretHash) public onlyOwner { require(keccak256(_secret) == secretHash && _newSecretHash != secretHash); verifyState(_target); verifyUpgradeableState(target, _target); previousTarget = target; target = _target; secretHash = _newSecretHash; - require(target.delegatecall(bytes4(keccak256("finishUpgrade(address)")), target)); + (bool callSuccess,) = target.delegatecall(abi.encodeWithSignature("finishUpgrade(address)", target)); + require(callSuccess); emit Upgraded(previousTarget, _target, msg.sender); } function verifyState(address _testTarget) public onlyOwner { //checks equivalence accessing target through new contract and current storage - require(address(delegateGet(_testTarget, "owner()")) == owner); - require(address(delegateGet(_testTarget, "target()")) == target); - require(address(delegateGet(_testTarget, "previousTarget()")) == previousTarget); - require(delegateGet(_testTarget, "secretHash()") == secretHash); + require(address(uint160(delegateGet(_testTarget, "owner()"))) == owner()); + require(address(uint160(delegateGet(_testTarget, "target()"))) == target); + require(address(uint160(delegateGet(_testTarget, "previousTarget()"))) == previousTarget); + require(bytes32(delegateGet(_testTarget, "secretHash()")) == secretHash); } /** @@ -57,22 +59,24 @@ contract Dispatcher is Upgradeable { * @param _secret Secret for proof of contract owning * @param _newSecretHash New secret hash (keccak256) **/ - function rollback(bytes _secret, bytes32 _newSecretHash) public onlyOwner { - require(previousTarget != 0x0); + function rollback(bytes memory _secret, bytes32 _newSecretHash) public onlyOwner { + require(previousTarget != address(0)); require(keccak256(_secret) == secretHash && _newSecretHash != secretHash); emit RolledBack(target, previousTarget, msg.sender); verifyUpgradeableState(previousTarget, target); target = previousTarget; - previousTarget = 0x0; + previousTarget = address(0); secretHash = _newSecretHash; - require(target.delegatecall(bytes4(keccak256("finishUpgrade(address)")), target)); + (bool callSuccess,) = target.delegatecall(abi.encodeWithSignature("finishUpgrade(address)", target)); + require(callSuccess); } /** * @dev Call verifyState method for Upgradeable contract **/ function verifyUpgradeableState(address _from, address _to) internal { - require(_from.delegatecall(bytes4(keccak256("verifyState(address)")), _to)); + (bool callSuccess,) = _from.delegatecall(abi.encodeWithSignature("verifyState(address)", _to)); + require(callSuccess); } function finishUpgrade(address) public {} @@ -81,9 +85,9 @@ contract Dispatcher is Upgradeable { * @dev Fallback function send all requests to the target contract. * If contract not exists then result will be unpredictable (see DELEGATECALL) **/ - function () public payable { - assert(target != 0x0); - bool callSuccess = target.delegatecall(msg.data); + function () external payable { + assert(target != address(0)); + (bool callSuccess,) = target.delegatecall(msg.data); if (callSuccess) { assembly { returndatacopy(0x0, 0x0, returndatasize) diff --git a/nucypher/blockchain/eth/sol/source/contracts/proxy/Upgradeable.sol b/nucypher/blockchain/eth/sol/source/contracts/proxy/Upgradeable.sol index ac2beafe1..0b49c04bb 100644 --- a/nucypher/blockchain/eth/sol/source/contracts/proxy/Upgradeable.sol +++ b/nucypher/blockchain/eth/sol/source/contracts/proxy/Upgradeable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; import "zeppelin/ownership/Ownable.sol"; @@ -53,7 +53,7 @@ contract Upgradeable is Ownable { **/ function delegateGetData( address _target, - string _signature, + string memory _signature, uint8 _numberOfArguments, bytes32 _argument1, bytes32 _argument2 @@ -85,8 +85,8 @@ contract Upgradeable is Ownable { * @dev Call "getter" without parameters. * Result should not exceed 32 bytes **/ - function delegateGet(address _target, string _signature) - internal returns (bytes32 result) + function delegateGet(address _target, string memory _signature) + internal returns (uint256 result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 0, 0, 0); assembly { @@ -98,8 +98,8 @@ contract Upgradeable is Ownable { * @dev Call "getter" with one parameter. * Result should not exceed 32 bytes **/ - function delegateGet(address _target, string _signature, bytes32 _argument) - internal returns (bytes32 result) + function delegateGet(address _target, string memory _signature, bytes32 _argument) + internal returns (uint256 result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 1, _argument, 0); assembly { @@ -113,11 +113,11 @@ contract Upgradeable is Ownable { **/ function delegateGet( address _target, - string _signature, + string memory _signature, bytes32 _argument1, bytes32 _argument2 ) - internal returns (bytes32 result) + internal returns (uint256 result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 2, _argument1, _argument2); assembly { diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/math/Math.sol b/nucypher/blockchain/eth/sol/source/zeppelin/math/Math.sol index c0f2db20a..1794e4f84 100644 --- a/nucypher/blockchain/eth/sol/source/zeppelin/math/Math.sol +++ b/nucypher/blockchain/eth/sol/source/zeppelin/math/Math.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; /** @@ -6,19 +6,27 @@ pragma solidity ^0.4.23; * @dev Assorted math operations */ library Math { - function max64(uint64 a, uint64 b) internal pure returns (uint64) { - return a >= b ? a : b; - } + /** + * @dev Returns the largest of two numbers. + */ + function max(uint256 a, uint256 b) internal pure returns (uint256) { + return a >= b ? a : b; + } - function min64(uint64 a, uint64 b) internal pure returns (uint64) { - return a < b ? a : b; - } + /** + * @dev Returns the smallest of two numbers. + */ + function min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } - function max256(uint256 a, uint256 b) internal pure returns (uint256) { - return a >= b ? a : b; - } - - function min256(uint256 a, uint256 b) internal pure returns (uint256) { - return a < b ? a : b; - } + /** + * @dev Calculates the average of two numbers. Since these are integers, + * averages of an even and odd number cannot be represented, and will be + * rounded down. + */ + function average(uint256 a, uint256 b) internal pure returns (uint256) { + // (a + b) / 2 can overflow, so we distribute + return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); + } } diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/math/SafeMath.sol b/nucypher/blockchain/eth/sol/source/zeppelin/math/SafeMath.sol index 8d0f1bba5..a37b80e42 100644 --- a/nucypher/blockchain/eth/sol/source/zeppelin/math/SafeMath.sol +++ b/nucypher/blockchain/eth/sol/source/zeppelin/math/SafeMath.sol @@ -1,48 +1,66 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; /** * @title SafeMath - * @dev Math operations with safety checks that throw on error + * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { + /** + * @dev Multiplies two unsigned integers, reverts on overflow. + */ + function mul(uint256 a, uint256 b) internal pure returns (uint256) { + // Gas optimization: this is cheaper than requiring 'a' not being zero, but the + // benefit is lost if 'b' is also tested. + // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 + if (a == 0) { + return 0; + } - /** - * @dev Multiplies two numbers, throws on overflow. - */ - function mul(uint256 a, uint256 b) internal pure returns (uint256) { - if (a == 0) { - return 0; + uint256 c = a * b; + require(c / a == b); + + return c; } - uint256 c = a * b; - assert(c / a == b); - return c; - } - /** - * @dev Integer division of two numbers, truncating the quotient. - */ - function div(uint256 a, uint256 b) internal pure returns (uint256) { - // assert(b > 0); // Solidity automatically throws when dividing by 0 - uint256 c = a / b; - // assert(a == b * c + a % b); // There is no case in which this doesn't hold - return c; - } + /** + * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. + */ + function div(uint256 a, uint256 b) internal pure returns (uint256) { + // Solidity only automatically asserts when dividing by 0 + require(b > 0); + uint256 c = a / b; + // assert(a == b * c + a % b); // There is no case in which this doesn't hold - /** - * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). - */ - function sub(uint256 a, uint256 b) internal pure returns (uint256) { - assert(b <= a); - return a - b; - } + return c; + } - /** - * @dev Adds two numbers, throws on overflow. - */ - function add(uint256 a, uint256 b) internal pure returns (uint256) { - uint256 c = a + b; - assert(c >= a); - return c; - } + /** + * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). + */ + function sub(uint256 a, uint256 b) internal pure returns (uint256) { + require(b <= a); + uint256 c = a - b; + + return c; + } + + /** + * @dev Adds two unsigned integers, reverts on overflow. + */ + function add(uint256 a, uint256 b) internal pure returns (uint256) { + uint256 c = a + b; + require(c >= a); + + return c; + } + + /** + * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), + * reverts when dividing by zero. + */ + function mod(uint256 a, uint256 b) internal pure returns (uint256) { + require(b != 0); + return a % b; + } } diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/ownership/Ownable.sol b/nucypher/blockchain/eth/sol/source/zeppelin/ownership/Ownable.sol index 0423278da..93d3f19c6 100644 --- a/nucypher/blockchain/eth/sol/source/zeppelin/ownership/Ownable.sol +++ b/nucypher/blockchain/eth/sol/source/zeppelin/ownership/Ownable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; /** @@ -7,36 +7,67 @@ pragma solidity ^0.4.23; * functions, this simplifies the implementation of "user permissions". */ contract Ownable { - address public owner; + address private _owner; + event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); - event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + constructor () internal { + _owner = msg.sender; + emit OwnershipTransferred(address(0), _owner); + } + /** + * @return the address of the owner. + */ + function owner() public view returns (address) { + return _owner; + } - /** - * @dev The Ownable constructor sets the original `owner` of the contract to the sender - * account. - */ - constructor() public { - owner = msg.sender; - } + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + require(isOwner()); + _; + } - /** - * @dev Throws if called by any account other than the owner. - */ - modifier onlyOwner() { - require(msg.sender == owner); - _; - } + /** + * @return true if `msg.sender` is the owner of the contract. + */ + function isOwner() public view returns (bool) { + return msg.sender == _owner; + } - /** - * @dev Allows the current owner to transfer control of the contract to a newOwner. - * @param newOwner The address to transfer ownership to. - */ - function transferOwnership(address newOwner) public onlyOwner { - require(newOwner != address(0)); - emit OwnershipTransferred(owner, newOwner); - owner = newOwner; - } + /** + * @dev Allows the current owner to relinquish control of the contract. + * @notice Renouncing to ownership will leave the contract without an owner. + * It will not be possible to call the functions with the `onlyOwner` + * modifier anymore. + */ + function renounceOwnership() public onlyOwner { + emit OwnershipTransferred(_owner, address(0)); + _owner = address(0); + } + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) public onlyOwner { + _transferOwnership(newOwner); + } + + /** + * @dev Transfers control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function _transferOwnership(address newOwner) internal { + require(newOwner != address(0)); + emit OwnershipTransferred(_owner, newOwner); + _owner = newOwner; + } } diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BasicToken.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BasicToken.sol deleted file mode 100644 index 4fca44ac2..000000000 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BasicToken.sol +++ /dev/null @@ -1,52 +0,0 @@ -pragma solidity ^0.4.23; - - -import "./ERC20Basic.sol"; -import "../../math/SafeMath.sol"; - - -/** - * @title Basic token - * @dev Basic version of StandardToken, with no allowances. - */ -contract BasicToken is ERC20Basic { - using SafeMath for uint256; - - mapping(address => uint256) balances; - - uint256 totalSupply_; - - /** - * @dev total number of tokens in existence - */ - function totalSupply() public view returns (uint256) { - return totalSupply_; - } - - /** - * @dev transfer token for a specified address - * @param _to The address to transfer to. - * @param _value The amount to be transferred. - */ - function transfer(address _to, uint256 _value) public returns (bool) { - require(_to != address(0)); - require(_value <= balances[msg.sender]); - - // SafeMath.sub will throw if there is not enough balance. - balances[msg.sender] = balances[msg.sender].sub(_value); - balances[_to] = balances[_to].add(_value); - - emit Transfer(msg.sender, _to, _value); - return true; - } - - /** - * @dev Gets the balance of the specified address. - * @param _owner The address to query the the balance of. - * @return An uint256 representing the amount owned by the passed address. - */ - function balanceOf(address _owner) public view returns (uint256 balance) { - return balances[_owner]; - } - -} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BurnableToken.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BurnableToken.sol deleted file mode 100644 index 8afd420e0..000000000 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/BurnableToken.sol +++ /dev/null @@ -1,29 +0,0 @@ -pragma solidity ^0.4.23; - -import "./BasicToken.sol"; - - -/** - * @title Burnable Token - * @dev Token that can be irreversibly burned (destroyed). - */ -contract BurnableToken is BasicToken { - - event Burn(address indexed burner, uint256 value); - - /** - * @dev Burns a specific amount of tokens. - * @param _value The amount of token to be burned. - */ - function burn(uint256 _value) public { - require(_value <= balances[msg.sender]); - // no need to require value <= totalSupply, since that would imply the - // sender's balance is greater than the totalSupply, which *should* be an assertion failure - - address burner = msg.sender; - balances[burner] = balances[burner].sub(_value); - totalSupply_ = totalSupply_.sub(_value); - emit Burn(burner, _value); - emit Transfer(burner, address(0), _value); - } -} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/DetailedERC20.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/DetailedERC20.sol deleted file mode 100644 index 749d96071..000000000 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/DetailedERC20.sol +++ /dev/null @@ -1,16 +0,0 @@ -pragma solidity ^0.4.23; - -import "./ERC20.sol"; - - -contract DetailedERC20 is ERC20 { - string public name; - string public symbol; - uint8 public decimals; - - constructor(string _name, string _symbol, uint8 _decimals) public { - name = _name; - symbol = _symbol; - decimals = _decimals; - } -} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20.sol index d99d1dbf7..3e377e043 100644 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20.sol +++ b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20.sol @@ -1,15 +1,200 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; -import "./ERC20Basic.sol"; + +import "./IERC20.sol"; +import "../../math/SafeMath.sol"; /** - * @title ERC20 interface - * @dev see https://github.com/ethereum/EIPs/issues/20 + * @title Standard ERC20 token + * + * @dev Implementation of the basic standard token. + * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md + * Originally based on code by FirstBlood: + * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol + * + * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for + * all accounts just by listening to said events. Note that this isn't required by the specification, and other + * compliant implementations may not do it. */ -contract ERC20 is ERC20Basic { - function allowance(address owner, address spender) public view returns (uint256); - function transferFrom(address from, address to, uint256 value) public returns (bool); - function approve(address spender, uint256 value) public returns (bool); - event Approval(address indexed owner, address indexed spender, uint256 value); +contract ERC20 is IERC20 { + using SafeMath for uint256; + + mapping (address => uint256) private _balances; + + mapping (address => mapping (address => uint256)) private _allowed; + + uint256 private _totalSupply; + + /** + * @dev Total number of tokens in existence + */ + function totalSupply() public view returns (uint256) { + return _totalSupply; + } + + /** + * @dev Gets the balance of the specified address. + * @param owner The address to query the balance of. + * @return An uint256 representing the amount owned by the passed address. + */ + function balanceOf(address owner) public view returns (uint256) { + return _balances[owner]; + } + + /** + * @dev Function to check the amount of tokens that an owner allowed to a spender. + * @param owner address The address which owns the funds. + * @param spender address The address which will spend the funds. + * @return A uint256 specifying the amount of tokens still available for the spender. + */ + function allowance(address owner, address spender) public view returns (uint256) { + return _allowed[owner][spender]; + } + + /** + * @dev Transfer token for a specified address + * @param to The address to transfer to. + * @param value The amount to be transferred. + */ + function transfer(address to, uint256 value) public returns (bool) { + _transfer(msg.sender, to, value); + return true; + } + + /** + * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. + * Beware that changing an allowance with this method brings the risk that someone may use both the old + * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this + * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * @param spender The address which will spend the funds. + * @param value The amount of tokens to be spent. + */ + function approve(address spender, uint256 value) public returns (bool) { + + // To change the approve amount you first have to reduce the addresses` + // allowance to zero by calling `approve(_spender, 0)` if it is not + // already 0 to mitigate the race condition described here: + // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + require(value == 0 || _allowed[msg.sender][spender] == 0); + + _approve(msg.sender, spender, value); + return true; + } + + /** + * @dev Transfer tokens from one address to another. + * Note that while this function emits an Approval event, this is not required as per the specification, + * and other compliant implementations may not emit the event. + * @param from address The address which you want to send tokens from + * @param to address The address which you want to transfer to + * @param value uint256 the amount of tokens to be transferred + */ + function transferFrom(address from, address to, uint256 value) public returns (bool) { + _transfer(from, to, value); + _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); + return true; + } + + /** + * @dev Increase the amount of tokens that an owner allowed to a spender. + * approve should be called when allowed_[_spender] == 0. To increment + * allowed value is better to use this function to avoid 2 calls (and wait until + * the first transaction is mined) + * From MonolithDAO Token.sol + * Emits an Approval event. + * @param spender The address which will spend the funds. + * @param addedValue The amount of tokens to increase the allowance by. + */ + function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { + _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); + return true; + } + + /** + * @dev Decrease the amount of tokens that an owner allowed to a spender. + * approve should be called when allowed_[_spender] == 0. To decrement + * allowed value is better to use this function to avoid 2 calls (and wait until + * the first transaction is mined) + * From MonolithDAO Token.sol + * Emits an Approval event. + * @param spender The address which will spend the funds. + * @param subtractedValue The amount of tokens to decrease the allowance by. + */ + function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { + _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); + return true; + } + + /** + * @dev Transfer token for a specified addresses + * @param from The address to transfer from. + * @param to The address to transfer to. + * @param value The amount to be transferred. + */ + function _transfer(address from, address to, uint256 value) internal { + require(to != address(0)); + + _balances[from] = _balances[from].sub(value); + _balances[to] = _balances[to].add(value); + emit Transfer(from, to, value); + } + + /** + * @dev Internal function that mints an amount of the token and assigns it to + * an account. This encapsulates the modification of balances such that the + * proper events are emitted. + * @param account The account that will receive the created tokens. + * @param value The amount that will be created. + */ + function _mint(address account, uint256 value) internal { + require(account != address(0)); + + _totalSupply = _totalSupply.add(value); + _balances[account] = _balances[account].add(value); + emit Transfer(address(0), account, value); + } + + /** + * @dev Internal function that burns an amount of the token of a given + * account. + * @param account The account whose tokens will be burnt. + * @param value The amount that will be burnt. + */ + function _burn(address account, uint256 value) internal { + require(account != address(0)); + + _totalSupply = _totalSupply.sub(value); + _balances[account] = _balances[account].sub(value); + emit Transfer(account, address(0), value); + } + + /** + * @dev Approve an address to spend another addresses' tokens. + * @param owner The address that owns the tokens. + * @param spender The address that will spend the tokens. + * @param value The number of tokens that can be spent. + */ + function _approve(address owner, address spender, uint256 value) internal { + require(spender != address(0)); + require(owner != address(0)); + + _allowed[owner][spender] = value; + emit Approval(owner, spender, value); + } + + /** + * @dev Internal function that burns an amount of the token of a given + * account, deducting from the sender's allowance for said account. Uses the + * internal burn function. + * Emits an Approval event (reflecting the reduced allowance). + * @param account The account whose tokens will be burnt. + * @param value The amount that will be burnt. + */ + function _burnFrom(address account, uint256 value) internal { + _burn(account, value); + _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); + } + } diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Basic.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Basic.sol deleted file mode 100644 index 4f02de19e..000000000 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Basic.sol +++ /dev/null @@ -1,14 +0,0 @@ -pragma solidity ^0.4.23; - - -/** - * @title ERC20Basic - * @dev Simpler version of ERC20 interface - * @dev see https://github.com/ethereum/EIPs/issues/179 - */ -contract ERC20Basic { - function totalSupply() public view returns (uint256); - function balanceOf(address who) public view returns (uint256); - function transfer(address to, uint256 value) public returns (bool); - event Transfer(address indexed from, address indexed to, uint256 value); -} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Detailed.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Detailed.sol new file mode 100644 index 000000000..8530ef1a7 --- /dev/null +++ b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/ERC20Detailed.sol @@ -0,0 +1,44 @@ +pragma solidity ^0.5.3; + + +import "./IERC20.sol"; + + +/** + * @title ERC20Detailed token + * @dev The decimals are only for visualization purposes. + * All the operations are done using the smallest and indivisible token unit, + * just as on Ethereum all the operations are done in wei. + */ +contract ERC20Detailed is IERC20 { + string private _name; + string private _symbol; + uint8 private _decimals; + + constructor (string memory name, string memory symbol, uint8 decimals) public { + _name = name; + _symbol = symbol; + _decimals = decimals; + } + + /** + * @return the name of the token. + */ + function name() public view returns (string memory) { + return _name; + } + + /** + * @return the symbol of the token. + */ + function symbol() public view returns (string memory) { + return _symbol; + } + + /** + * @return the number of decimals of the token. + */ + function decimals() public view returns (uint8) { + return _decimals; + } +} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/IERC20.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/IERC20.sol new file mode 100644 index 000000000..e557f69cd --- /dev/null +++ b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/IERC20.sol @@ -0,0 +1,24 @@ +pragma solidity ^0.5.3; + + +/** + * @title ERC20 interface + * @dev see https://github.com/ethereum/EIPs/issues/20 + */ +interface IERC20 { + function transfer(address to, uint256 value) external returns (bool); + + function approve(address spender, uint256 value) external returns (bool); + + function transferFrom(address from, address to, uint256 value) external returns (bool); + + function totalSupply() external view returns (uint256); + + function balanceOf(address who) external view returns (uint256); + + function allowance(address owner, address spender) external view returns (uint256); + + event Transfer(address indexed from, address indexed to, uint256 value); + + event Approval(address indexed owner, address indexed spender, uint256 value); +} diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/SafeERC20.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/SafeERC20.sol index c4bf17018..11ed40e34 100644 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/SafeERC20.sol +++ b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/SafeERC20.sol @@ -1,7 +1,8 @@ -pragma solidity ^0.4.23; +pragma solidity ^0.5.3; -import "./ERC20Basic.sol"; -import "./ERC20.sol"; + +import "./IERC20.sol"; +import "../../math/SafeMath.sol"; /** @@ -11,15 +12,31 @@ import "./ERC20.sol"; * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { - function safeTransfer(ERC20Basic token, address to, uint256 value) internal { - assert(token.transfer(to, value)); - } + using SafeMath for uint256; - function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { - assert(token.transferFrom(from, to, value)); - } + function safeTransfer(IERC20 token, address to, uint256 value) internal { + require(token.transfer(to, value)); + } - function safeApprove(ERC20 token, address spender, uint256 value) internal { - assert(token.approve(spender, value)); - } + function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { + require(token.transferFrom(from, to, value)); + } + + function safeApprove(IERC20 token, address spender, uint256 value) internal { + // safeApprove should only be called when setting an initial allowance, + // or when resetting it to zero. To increase and decrease it, use + // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' + require((value == 0) || (token.allowance(msg.sender, spender) == 0)); + require(token.approve(spender, value)); + } + + function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).add(value); + require(token.approve(spender, newAllowance)); + } + + function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { + uint256 newAllowance = token.allowance(address(this), spender).sub(value); + require(token.approve(spender, newAllowance)); + } } diff --git a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/StandardToken.sol b/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/StandardToken.sol deleted file mode 100644 index 096ec25b8..000000000 --- a/nucypher/blockchain/eth/sol/source/zeppelin/token/ERC20/StandardToken.sol +++ /dev/null @@ -1,100 +0,0 @@ -pragma solidity ^0.4.23; - -import "./BasicToken.sol"; -import "./ERC20.sol"; - - -/** - * @title Standard ERC20 token - * - * @dev Implementation of the basic standard token. - * @dev https://github.com/ethereum/EIPs/issues/20 - * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol - */ -contract StandardToken is ERC20, BasicToken { - - mapping (address => mapping (address => uint256)) internal allowed; - - - /** - * @dev Transfer tokens from one address to another - * @param _from address The address which you want to send tokens from - * @param _to address The address which you want to transfer to - * @param _value uint256 the amount of tokens to be transferred - */ - function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { - require(_to != address(0)); - require(_value <= balances[_from]); - require(_value <= allowed[_from][msg.sender]); - - balances[_from] = balances[_from].sub(_value); - balances[_to] = balances[_to].add(_value); - allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); - emit Transfer(_from, _to, _value); - return true; - } - - /** - * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. - * - * Beware that changing an allowance with this method brings the risk that someone may use both the old - * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this - * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: - * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 - * @param _spender The address which will spend the funds. - * @param _value The amount of tokens to be spent. - */ - function approve(address _spender, uint256 _value) public returns (bool) { - allowed[msg.sender][_spender] = _value; - emit Approval(msg.sender, _spender, _value); - return true; - } - - /** - * @dev Function to check the amount of tokens that an owner allowed to a spender. - * @param _owner address The address which owns the funds. - * @param _spender address The address which will spend the funds. - * @return A uint256 specifying the amount of tokens still available for the spender. - */ - function allowance(address _owner, address _spender) public view returns (uint256) { - return allowed[_owner][_spender]; - } - - /** - * @dev Increase the amount of tokens that an owner allowed to a spender. - * - * approve should be called when allowed[_spender] == 0. To increment - * allowed value is better to use this function to avoid 2 calls (and wait until - * the first transaction is mined) - * From MonolithDAO Token.sol - * @param _spender The address which will spend the funds. - * @param _addedValue The amount of tokens to increase the allowance by. - */ - function increaseApproval(address _spender, uint _addedValue) public returns (bool) { - allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); - emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); - return true; - } - - /** - * @dev Decrease the amount of tokens that an owner allowed to a spender. - * - * approve should be called when allowed[_spender] == 0. To decrement - * allowed value is better to use this function to avoid 2 calls (and wait until - * the first transaction is mined) - * From MonolithDAO Token.sol - * @param _spender The address which will spend the funds. - * @param _subtractedValue The amount of tokens to decrease the allowance by. - */ - function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { - uint oldValue = allowed[msg.sender][_spender]; - if (_subtractedValue > oldValue) { - allowed[msg.sender][_spender] = 0; - } else { - allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); - } - emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); - return true; - } - -} diff --git a/tests/blockchain/eth/contracts/contracts/IssuerTestSet.sol b/tests/blockchain/eth/contracts/contracts/IssuerTestSet.sol index 605d4f742..d306d4063 100644 --- a/tests/blockchain/eth/contracts/contracts/IssuerTestSet.sol +++ b/tests/blockchain/eth/contracts/contracts/IssuerTestSet.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "contracts/Issuer.sol"; @@ -100,7 +100,7 @@ contract IssuerV2Mock is Issuer { function verifyState(address _testTarget) public onlyOwner { super.verifyState(_testTarget); - require(uint256(delegateGet(_testTarget, "valueToCheck()")) == valueToCheck); + require(delegateGet(_testTarget, "valueToCheck()") == valueToCheck); } } diff --git a/tests/blockchain/eth/contracts/contracts/MinersEscrowTestSet.sol b/tests/blockchain/eth/contracts/contracts/MinersEscrowTestSet.sol index 413ad641b..1ed2c32c7 100644 --- a/tests/blockchain/eth/contracts/contracts/MinersEscrowTestSet.sol +++ b/tests/blockchain/eth/contracts/contracts/MinersEscrowTestSet.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "contracts/MinersEscrow.sol"; @@ -80,7 +80,7 @@ contract MinersEscrowV2Mock is MinersEscrow { function verifyState(address _testTarget) public onlyOwner { super.verifyState(_testTarget); - require(uint256(delegateGet(_testTarget, "valueToCheck()")) == valueToCheck); + require(delegateGet(_testTarget, "valueToCheck()") == valueToCheck); } function finishUpgrade(address _target) public onlyOwner { diff --git a/tests/blockchain/eth/contracts/contracts/PolicyManagerTestSet.sol b/tests/blockchain/eth/contracts/contracts/PolicyManagerTestSet.sol index 49b540a81..4a66f2c54 100644 --- a/tests/blockchain/eth/contracts/contracts/PolicyManagerTestSet.sol +++ b/tests/blockchain/eth/contracts/contracts/PolicyManagerTestSet.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "contracts/PolicyManager.sol"; @@ -36,7 +36,7 @@ contract PolicyManagerV2Mock is PolicyManager { function verifyState(address _testTarget) public onlyOwner { super.verifyState(_testTarget); - require(uint256(delegateGet(_testTarget, "valueToCheck()")) == valueToCheck); + require(delegateGet(_testTarget, "valueToCheck()") == valueToCheck); } } diff --git a/tests/blockchain/eth/contracts/contracts/ReceiveApprovalMethodMock.sol b/tests/blockchain/eth/contracts/contracts/ReceiveApprovalMethodMock.sol index 485ffb3fd..faad9bf62 100644 --- a/tests/blockchain/eth/contracts/contracts/ReceiveApprovalMethodMock.sol +++ b/tests/blockchain/eth/contracts/contracts/ReceiveApprovalMethodMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; /** @@ -15,7 +15,7 @@ contract ReceiveApprovalMethodMock { address _from, uint256 _value, address _tokenContract, - bytes _extraData + bytes calldata _extraData ) external { diff --git a/tests/blockchain/eth/contracts/contracts/UserEscrowTestSet.sol b/tests/blockchain/eth/contracts/contracts/UserEscrowTestSet.sol index 6aec91966..8c34cc569 100644 --- a/tests/blockchain/eth/contracts/contracts/UserEscrowTestSet.sol +++ b/tests/blockchain/eth/contracts/contracts/UserEscrowTestSet.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "contracts/NuCypherToken.sol"; @@ -71,7 +71,7 @@ contract PolicyManagerForUserEscrowMock { uint256 public minRewardRate; - function withdraw(address _recipient) public returns (uint256) { + function withdraw(address payable _recipient) public returns (uint256) { uint256 value = address(this).balance; require(value > 0); _recipient.transfer(value); @@ -86,7 +86,7 @@ contract PolicyManagerForUserEscrowMock { minRewardRate = _minRewardRate; } - function () public payable {} + function () external payable {} } @@ -109,7 +109,7 @@ contract UserEscrowLibraryMockV1 { **/ contract UserEscrowLibraryMockV2 { - function () public payable { + function () external payable { // can only use with ETH require(msg.value > 0); } diff --git a/tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol index 394b420bb..b33a03b11 100644 --- a/tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol +++ b/tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "./ContractInterface.sol"; @@ -38,8 +38,8 @@ contract ContractV2Bad is ContractInterface, Upgradeable { return storageValue; } - function setDynamicallySizedValue(string) public {} - function getDynamicallySizedValue() public view returns (string) {} + function setDynamicallySizedValue(string memory) public {} + function getDynamicallySizedValue() public view returns (string memory) {} function pushArrayValue(uint) public {} function getArrayValue(uint _index) public view returns (uint) { diff --git a/tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol index 0f10c38f8..8135bf865 100644 --- a/tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol +++ b/tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; // Note we don't need to use this interface (although it is advised if it's unlikely it will change). // We can cast the UpgradableContractProxy as the specific implementations eg ContractV1.sol or ContractV2.sol. @@ -13,8 +13,8 @@ contract ContractInterface { function setStorageValue(uint _value) public; function getStorageValue() public view returns (uint); - function setDynamicallySizedValue(string _dynamicValue) public; - function getDynamicallySizedValue() public view returns (string); + function setDynamicallySizedValue(string memory _dynamicValue) public; + function getDynamicallySizedValue() public view returns (string memory); function pushArrayValue(uint _value) public; function getArrayValue(uint _index) public view returns (uint); diff --git a/tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol index 488875efa..e88a837ef 100644 --- a/tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol +++ b/tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "./ContractInterface.sol"; @@ -56,10 +56,10 @@ contract ContractV1 is ContractInterface, Upgradeable { return storageValue; } - function setDynamicallySizedValue(string _dynamicValue) public { + function setDynamicallySizedValue(string memory _dynamicValue) public { dynamicallySizedValue = _dynamicValue; } - function getDynamicallySizedValue() public view returns (string) { + function getDynamicallySizedValue() public view returns (string memory) { return dynamicallySizedValue; } @@ -125,50 +125,50 @@ contract ContractV1 is ContractInterface, Upgradeable { } function verifyState(address _testTarget) public onlyOwner { - require(uint(delegateGet(_testTarget, "storageValue()")) == storageValue); + require(delegateGet(_testTarget, "storageValue()") == storageValue); bytes memory value = delegateGetBytes(_testTarget, "dynamicallySizedValue()"); require(value.length == bytes(dynamicallySizedValue).length && keccak256(value) == keccak256(bytes(dynamicallySizedValue))); require(uint(delegateGet(_testTarget, "getArrayValueLength()")) == arrayValues.length); for (uint i = 0; i < arrayValues.length; i++) { - require(uint(delegateGet(_testTarget, "getArrayValue(uint256)", bytes32(i))) == + require(delegateGet(_testTarget, "getArrayValue(uint256)", bytes32(i)) == arrayValues[i]); } - for (i = 0; i < mappingIndices.length; i++) { + for (uint i = 0; i < mappingIndices.length; i++) { uint256 index = mappingIndices[i]; - require(uint(delegateGet(_testTarget, "getMappingValue(uint256)", bytes32(index))) == + require(delegateGet(_testTarget, "getMappingValue(uint256)", bytes32(index)) == mappingValues[index]); } - require(uint(delegateGet(_testTarget, "getStructureLength1()")) == arrayStructures.length); - for (i = 0; i < arrayStructures.length; i++) { + require(delegateGet(_testTarget, "getStructureLength1()") == arrayStructures.length); + for (uint i = 0; i < arrayStructures.length; i++) { Structure1 memory structure1 = delegateGetStructure1(_testTarget, "arrayStructures(uint256)", bytes32(i)); require(structure1.value == arrayStructures[i].value); - require(uint(delegateGet(_testTarget, "getStructureArrayLength1(uint256)", bytes32(i))) == + require(delegateGet(_testTarget, "getStructureArrayLength1(uint256)", bytes32(i)) == arrayStructures[i].arrayValues.length); for (uint j = 0; j < arrayStructures[i].arrayValues.length; j++) { - require(uint(delegateGet( - _testTarget, "getStructureArrayValue1(uint256,uint256)", bytes32(i), bytes32(j))) == + require(delegateGet( + _testTarget, "getStructureArrayValue1(uint256,uint256)", bytes32(i), bytes32(j)) == arrayStructures[i].arrayValues[j]); } } - require(uint(delegateGet(_testTarget, "getStructureLength2()")) == mappingStructuresLength); - for (i = 0; i < mappingStructuresLength; i++) { + require(delegateGet(_testTarget, "getStructureLength2()") == mappingStructuresLength); + for (uint i = 0; i < mappingStructuresLength; i++) { Structure2 memory structure2 = delegateGetStructure2(_testTarget, "mappingStructures(uint256)", bytes32(i)); require(structure2.value == mappingStructures[i].value); - require(uint(delegateGet(_testTarget, "getStructureArrayLength2(uint256)", bytes32(i))) == + require(delegateGet(_testTarget, "getStructureArrayLength2(uint256)", bytes32(i)) == mappingStructures[i].arrayValues.length); - for (j = 0; j < mappingStructures[i].arrayValues.length; j++) { - require(uint(delegateGet( - _testTarget, "getStructureArrayValue2(uint256,uint256)", bytes32(i), bytes32(j))) == + for (uint j = 0; j < mappingStructures[i].arrayValues.length; j++) { + require(delegateGet( + _testTarget, "getStructureArrayValue2(uint256,uint256)", bytes32(i), bytes32(j)) == mappingStructures[i].arrayValues[j]); } } } - function delegateGetStructure1(address _target, string _signature, bytes32 _argument) + function delegateGetStructure1(address _target, string memory _signature, bytes32 _argument) internal returns (Structure1 memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 1, _argument, 0); @@ -177,7 +177,7 @@ contract ContractV1 is ContractInterface, Upgradeable { } } - function delegateGetStructure2(address _target, string _signature, bytes32 _argument) + function delegateGetStructure2(address _target, string memory _signature, bytes32 _argument) internal returns (Structure2 memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 1, _argument, 0); @@ -186,7 +186,7 @@ contract ContractV1 is ContractInterface, Upgradeable { } } - function delegateGetBytes(address _target, string _signature) + function delegateGetBytes(address _target, string memory _signature) internal returns (bytes memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 0, 0, 0); diff --git a/tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol index 9085a2e25..919abec50 100644 --- a/tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol +++ b/tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "./ContractInterface.sol"; @@ -50,10 +50,10 @@ contract ContractV2 is ContractInterface, Upgradeable { return storageValue; } - function setDynamicallySizedValue(string _dynamicValue) public { + function setDynamicallySizedValue(string memory _dynamicValue) public { dynamicallySizedValue = _dynamicValue; } - function getDynamicallySizedValue() public view returns (string) { + function getDynamicallySizedValue() public view returns (string memory) { return dynamicallySizedValue; } @@ -125,33 +125,32 @@ contract ContractV2 is ContractInterface, Upgradeable { return mappingStructures[_index].valueToCheck; } - function getStructure1ArrayValues(uint _index) public view returns (uint[]) { + function getStructure1ArrayValues(uint _index) public view returns (uint[] memory) { return arrayStructures[_index].arrayValues; } - function getStructure2ArrayValues(uint _index) public view returns (uint[]) { + function getStructure2ArrayValues(uint _index) public view returns (uint[] memory) { return mappingStructures[_index].arrayValues; } function verifyState(address _testTarget) public onlyOwner { - require(uint(delegateGet(_testTarget, "storageValue()")) == storageValue); + require(delegateGet(_testTarget, "storageValue()") == storageValue); bytes memory value = delegateGetBytes(_testTarget, "dynamicallySizedValue()"); require(value.length == bytes(dynamicallySizedValue).length && keccak256(value) == keccak256(bytes(dynamicallySizedValue))); - require(uint(delegateGet(_testTarget, "getArrayValueLength()")) == arrayValues.length); + require(delegateGet(_testTarget, "getArrayValueLength()") == arrayValues.length); for (uint i = 0; i < arrayValues.length; i++) { - require( - uint(delegateGet(_testTarget, "getArrayValue(uint256)", bytes32(i))) == arrayValues[i]); + require(delegateGet(_testTarget, "getArrayValue(uint256)", bytes32(i)) == arrayValues[i]); } - for (i = 0; i < mappingIndices.length; i++) { + for (uint i = 0; i < mappingIndices.length; i++) { uint index = mappingIndices[i]; - require(uint(delegateGet(_testTarget, "getMappingValue(uint256)", bytes32(index))) == + require(delegateGet(_testTarget, "getMappingValue(uint256)", bytes32(index)) == mappingValues[index]); } require(uint(delegateGet(_testTarget, "getStructureLength1()")) == arrayStructures.length); - for (i = 0; i < arrayStructures.length; i++) { + for (uint i = 0; i < arrayStructures.length; i++) { Structure1 memory structure1 = delegateGetStructure1(_testTarget, "arrayStructures(uint256)", bytes32(i)); require(structure1.value == arrayStructures[i].value); @@ -163,14 +162,14 @@ contract ContractV2 is ContractInterface, Upgradeable { } require(uint(delegateGet(_testTarget, "getStructureLength2()")) == mappingStructuresLength); - for (i = 0; i < mappingStructuresLength; i++) { + for (uint i = 0; i < mappingStructuresLength; i++) { Structure2 memory structure2 = delegateGetStructure2(_testTarget, "mappingStructures(uint256)", bytes32(i)); require(structure2.value == mappingStructures[i].value); require(structure2.valueToCheck == mappingStructures[i].valueToCheck); - values = delegateGetArray(_testTarget, "getStructure2ArrayValues(uint256)", bytes32(i)); + bytes32[] memory values = delegateGetArray(_testTarget, "getStructure2ArrayValues(uint256)", bytes32(i)); require(values.length == mappingStructures[i].arrayValues.length); - for (j = 0; j < mappingStructures[i].arrayValues.length; j++) { + for (uint j = 0; j < mappingStructures[i].arrayValues.length; j++) { require(uint(values[j]) == mappingStructures[i].arrayValues[j]); } } @@ -178,7 +177,7 @@ contract ContractV2 is ContractInterface, Upgradeable { require(uint(delegateGet(_testTarget, "storageValueToCheck()")) == storageValueToCheck); } - function delegateGetStructure1(address _target, string _signature, bytes32 _argument) + function delegateGetStructure1(address _target, string memory _signature, bytes32 _argument) internal returns (Structure1 memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 1, _argument, 0); @@ -187,7 +186,7 @@ contract ContractV2 is ContractInterface, Upgradeable { } } - function delegateGetStructure2(address _target, string _signature, bytes32 _argument) + function delegateGetStructure2(address _target, string memory _signature, bytes32 _argument) internal returns (Structure2 memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 1, _argument, 0); @@ -198,7 +197,7 @@ contract ContractV2 is ContractInterface, Upgradeable { } } - function delegateGetBytes(address _target, string _signature) + function delegateGetBytes(address _target, string memory _signature) internal returns (bytes memory result) { bytes32 memoryAddress = delegateGetData(_target, _signature, 0, 0, 0); @@ -212,7 +211,7 @@ contract ContractV2 is ContractInterface, Upgradeable { **/ function delegateGetArray( address _target, - string _signature, + string memory _signature, bytes32 _argument ) public returns (bytes32[] memory result) diff --git a/tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol index a98594d8e..159fbd7ac 100644 --- a/tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol +++ b/tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.3; import "./ContractV2.sol"; @@ -20,6 +20,6 @@ contract ContractV3 is ContractV2 { function verifyState(address _testTarget) public onlyOwner { super.verifyState(_testTarget); - require(uint(delegateGet(_testTarget, "anotherStorageValue()")) == anotherStorageValue); + require(delegateGet(_testTarget, "anotherStorageValue()") == anotherStorageValue); } } diff --git a/tests/blockchain/eth/contracts/main/miners_escrow/test_miners_escrow.py b/tests/blockchain/eth/contracts/main/miners_escrow/test_miners_escrow.py index 183ac0190..7eb36df38 100644 --- a/tests/blockchain/eth/contracts/main/miners_escrow/test_miners_escrow.py +++ b/tests/blockchain/eth/contracts/main/miners_escrow/test_miners_escrow.py @@ -49,9 +49,9 @@ def test_staking(testerchain, token, escrow_contract): assert 10000 == token.functions.balanceOf(ursula2).call() # Ursula and Ursula(2) give Escrow rights to transfer - tx = token.functions.approve(escrow.address, 1100).transact({'from': ursula1}) + tx = token.functions.approve(escrow.address, 1000).transact({'from': ursula1}) testerchain.wait_for_receipt(tx) - assert 1100 == token.functions.allowance(ursula1, escrow.address).call() + assert 1000 == token.functions.allowance(ursula1, escrow.address).call() tx = token.functions.approve(escrow.address, 500).transact({'from': ursula2}) testerchain.wait_for_receipt(tx) assert 500 == token.functions.allowance(ursula2, escrow.address).call() diff --git a/tests/blockchain/eth/contracts/main/token/test_token.py b/tests/blockchain/eth/contracts/main/token/test_token.py index 012495494..bcef893fe 100644 --- a/tests/blockchain/eth/contracts/main/token/test_token.py +++ b/tests/blockchain/eth/contracts/main/token/test_token.py @@ -62,12 +62,6 @@ def test_create_token(testerchain): testerchain.wait_for_receipt(tx) assert 10 == token.functions.balanceOf(token.address).call() - # Can burn own tokens - tx = token.functions.burn(1).transact({'from': account2}) - testerchain.wait_for_receipt(tx) - assert 9 == token.functions.balanceOf(account2).call() - assert 10 ** 9 - 1 == token.functions.totalSupply().call() - @pytest.mark.slow() def test_approve_and_call(testerchain): @@ -104,3 +98,24 @@ def test_approve_and_call(testerchain): assert 25 == mock.functions.value().call() assert token.address == mock.functions.tokenContract().call() assert 111 == testerchain.interface.w3.toInt(mock.functions.extraData().call()) + + # Can't approve non zero value + with pytest.raises((TransactionFailed, ValueError)): + tx = token.functions.approve(account1, 100).transact({'from': creator}) + testerchain.wait_for_receipt(tx) + assert 50 == token.functions.allowance(creator, account1).call() + # Change to zero value and set new one + tx = token.functions.approve(account1, 0).transact({'from': creator}) + testerchain.wait_for_receipt(tx) + assert 0 == token.functions.allowance(creator, account1).call() + tx = token.functions.approve(account1, 100).transact({'from': creator}) + testerchain.wait_for_receipt(tx) + assert 100 == token.functions.allowance(creator, account1).call() + + # Decrease value + tx = token.functions.decreaseAllowance(account1, 60).transact({'from': creator}) + testerchain.wait_for_receipt(tx) + assert 40 == token.functions.allowance(creator, account1).call() + tx = token.functions.increaseAllowance(account1, 10).transact({'from': creator}) + testerchain.wait_for_receipt(tx) + assert 50 == token.functions.allowance(creator, account1).call() From 17abb00b27affbd17ad009285507c4a3a97062fe Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 13:50:49 -0700 Subject: [PATCH 2/9] Update dependency lock to use solidity compiler 0.5.0+ via nucypher py-solc fork --- Pipfile | 2 +- Pipfile.lock | 84 +++++++++++++++++++++----------------------- dev-requirements.txt | 10 +++--- requirements.txt | 6 ++-- 4 files changed, 49 insertions(+), 53 deletions(-) diff --git a/Pipfile b/Pipfile index e29bfd787..f99890bb8 100644 --- a/Pipfile +++ b/Pipfile @@ -23,7 +23,6 @@ flask = "*" # Third-Party Ethereum py-evm = "*" eth-tester = "*" -py-solc = "*" web3 = "*" # CLI / Configuration sentry-sdk = "==0.5.2" @@ -55,6 +54,7 @@ recommonmark = "*" sphinx_rtd_theme = "*" # CLI nucypher = {editable = true,path = "."} +py-solc = {git = "https://github.com/nucypher/py-solc.git"} [scripts] install-solc = "scripts/install_solc.sh" diff --git a/Pipfile.lock b/Pipfile.lock index c611aea33..d5a4b9ed3 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a11c65b39162767f7dc15b1a4dcab32a814d61bf682f21e3f55984a2f3b5413e" + "sha256": "7b156c055c7cca1c092d2f2aedf9b61b43d20b59eab08d28a04bf713c66959f2" }, "pipfile-spec": 6, "requires": { @@ -68,18 +68,18 @@ }, "boto3": { "hashes": [ - "sha256:d494043f4fa833c14ca553dd27dc9fd714390215783ff88d2b5597dbc801e779", - "sha256:ff4f0d48b7f6e7fcc3503597e1225c8413d83a43afbf3940f9fcb5a019f3c327" + "sha256:428c6d535f373a7203ed7ec687bb826b88e62de7befc3816e0aacd305f7572a2", + "sha256:4a693170c79b4275d8bb6884e9930c82e6bb4e303597ca545f288333db77c6a7" ], "index": "pypi", - "version": "==1.9.90" + "version": "==1.9.91" }, "botocore": { "hashes": [ - "sha256:5a3dd9fe7cc5a5dab62016108180c58444e9025a3edd7b4b76b3573db1fcebe4", - "sha256:c6d4ffcf6c152b3224f16d59f92d938a7375c8b185bb08165a001e9bc59f95cc" + "sha256:4ca7da7128915d7ac149e12f8a3efeb4e590793189cabe0bcd3c3eee5b84f656", + "sha256:bd788c6ebae55db17d9cc125fa3817fddb20d3fc8bd15791995d82c466238a3b" ], - "version": "==1.12.90" + "version": "==1.12.91" }, "bytestring-splitter": { "hashes": [ @@ -519,7 +519,6 @@ "sha256:82095bdac661072f48cf2daf8a96bdb625674330d92b225be26043e8d3ef8c9a", "sha256:9ec0bc36ef22a9b0f5642e7846999c4485fa2fa562a61897aeb0a4ca53d60153" ], - "index": "pypi", "version": "==3.2.0" }, "pyasn1": { @@ -765,10 +764,10 @@ }, "sqlalchemy": { "hashes": [ - "sha256:c08cee353acaa05dd4ddf8ae0b0844ae779ed88e0b0784a2c9e0c0f9118eb64c" + "sha256:7dede29f121071da9873e7b8c98091874617858e790dc364ffaab4b09d81216c" ], "index": "pypi", - "version": "==1.3.0b2" + "version": "==1.3.0b3" }, "toolz": { "hashes": [ @@ -1030,18 +1029,18 @@ }, "boto3": { "hashes": [ - "sha256:d494043f4fa833c14ca553dd27dc9fd714390215783ff88d2b5597dbc801e779", - "sha256:ff4f0d48b7f6e7fcc3503597e1225c8413d83a43afbf3940f9fcb5a019f3c327" + "sha256:428c6d535f373a7203ed7ec687bb826b88e62de7befc3816e0aacd305f7572a2", + "sha256:4a693170c79b4275d8bb6884e9930c82e6bb4e303597ca545f288333db77c6a7" ], "index": "pypi", - "version": "==1.9.90" + "version": "==1.9.91" }, "botocore": { "hashes": [ - "sha256:5a3dd9fe7cc5a5dab62016108180c58444e9025a3edd7b4b76b3573db1fcebe4", - "sha256:c6d4ffcf6c152b3224f16d59f92d938a7375c8b185bb08165a001e9bc59f95cc" + "sha256:4ca7da7128915d7ac149e12f8a3efeb4e590793189cabe0bcd3c3eee5b84f656", + "sha256:bd788c6ebae55db17d9cc125fa3817fddb20d3fc8bd15791995d82c466238a3b" ], - "version": "==1.12.90" + "version": "==1.12.91" }, "bumpversion": { "hashes": [ @@ -1548,11 +1547,11 @@ }, "mypy": { "hashes": [ - "sha256:986a7f97808a865405c5fd98fae5ebfa963c31520a56c783df159e9a81e41b3e", - "sha256:cc5df73cc11d35655a8c364f45d07b13c8db82c000def4bd7721be13356533b4" + "sha256:308c274eb8482fbf16006f549137ddc0d69e5a589465e37b99c4564414363ca7", + "sha256:e80fd6af34614a0e898a57f14296d0dacb584648f0339c2e000ddbf0f4cc2f8d" ], "index": "pypi", - "version": "==0.660" + "version": "==0.670" }, "mypy-extensions": { "hashes": [ @@ -1674,7 +1673,6 @@ "sha256:82095bdac661072f48cf2daf8a96bdb625674330d92b225be26043e8d3ef8c9a", "sha256:9ec0bc36ef22a9b0f5642e7846999c4485fa2fa562a61897aeb0a4ca53d60153" ], - "index": "pypi", "version": "==3.2.0" }, "pyaml": { @@ -2055,10 +2053,10 @@ }, "sqlalchemy": { "hashes": [ - "sha256:c08cee353acaa05dd4ddf8ae0b0844ae779ed88e0b0784a2c9e0c0f9118eb64c" + "sha256:7dede29f121071da9873e7b8c98091874617858e790dc364ffaab4b09d81216c" ], "index": "pypi", - "version": "==1.3.0b2" + "version": "==1.3.0b3" }, "toolz": { "hashes": [ @@ -2088,29 +2086,27 @@ }, "typed-ast": { "hashes": [ - "sha256:023625bfa9359e29bd6e24cac2a4503495b49761d48a5f1e38333fc4ac4d93fe", - "sha256:07591f7a5fdff50e2e566c4c1e9df545c75d21e27d98d18cb405727ed0ef329c", - "sha256:153e526b0f4ffbfada72d0bb5ffe8574ba02803d2f3a9c605c8cf99dfedd72a2", - "sha256:3ad2bdcd46a4a1518d7376e9f5016d17718a9ed3c6a3f09203d832f6c165de4a", - "sha256:3ea98c84df53ada97ee1c5159bb3bc784bd734231235a1ede14c8ae0775049f7", - "sha256:51a7141ccd076fa561af107cfb7a8b6d06a008d92451a1ac7e73149d18e9a827", - "sha256:52c93cd10e6c24e7ac97e8615da9f224fd75c61770515cb323316c30830ddb33", - "sha256:6344c84baeda3d7b33e157f0b292e4dd53d05ddb57a63f738178c01cac4635c9", - "sha256:64699ca1b3bd5070bdeb043e6d43bc1d0cebe08008548f4a6bee782b0ecce032", - "sha256:74903f2e56bbffe29282ef8a5487d207d10be0f8513b41aff787d954a4cf91c9", - "sha256:7891710dba83c29ee2bd51ecaa82f60f6bede40271af781110c08be134207bf2", - "sha256:91976c56224e26c256a0de0f76d2004ab885a29423737684b4f7ebdd2f46dde2", - "sha256:9bad678a576ecc71f25eba9f1e3fd8d01c28c12a2834850b458428b3e855f062", - "sha256:b4726339a4c180a8b6ad9d8b50d2b6dc247e1b79b38fe2290549c98e82e4fd15", - "sha256:ba36f6aa3f8933edf94ea35826daf92cbb3ec248b89eccdc053d4a815d285357", - "sha256:bbc96bde544fd19e9ef168e4dfa5c3dfe704bfa78128fa76f361d64d6b0f731a", - "sha256:c0c927f1e44469056f7f2dada266c79b577da378bbde3f6d2ada726d131e4824", - "sha256:c0f9a3708008aa59f560fa1bd22385e05b79b8e38e0721a15a8402b089243442", - "sha256:f0bf6f36ff9c5643004171f11d2fdc745aa3953c5aacf2536a0685db9ceb3fb1", - "sha256:f5be39a0146be663cbf210a4d95c3c58b2d7df7b043c9047c5448e358f0550a2", - "sha256:fcd198bf19d9213e5cbf2cde2b9ef20a9856e716f76f9476157f90ae6de06cc6" + "sha256:035a54ede6ce1380599b2ce57844c6554666522e376bd111eb940fbc7c3dad23", + "sha256:037c35f2741ce3a9ac0d55abfcd119133cbd821fffa4461397718287092d9d15", + "sha256:049feae7e9f180b64efacbdc36b3af64a00393a47be22fa9cb6794e68d4e73d3", + "sha256:19228f7940beafc1ba21a6e8e070e0b0bfd1457902a3a81709762b8b9039b88d", + "sha256:2ea681e91e3550a30c2265d2916f40a5f5d89b59469a20f3bad7d07adee0f7a6", + "sha256:3a6b0a78af298d82323660df5497bcea0f0a4a25a0b003afd0ce5af049bd1f60", + "sha256:5385da8f3b801014504df0852bf83524599df890387a3c2b17b7caa3d78b1773", + "sha256:606d8afa07eef77280c2bf84335e24390055b478392e1975f96286d99d0cb424", + "sha256:69245b5b23bbf7fb242c9f8f08493e9ecd7711f063259aefffaeb90595d62287", + "sha256:6f6d839ab09830d59b7fa8fb6917023d8cb5498ee1f1dbd82d37db78eb76bc99", + "sha256:730888475f5ac0e37c1de4bd05eeb799fdb742697867f524dc8a4cd74bcecc23", + "sha256:9819b5162ffc121b9e334923c685b0d0826154e41dfe70b2ede2ce29034c71d8", + "sha256:9e60ef9426efab601dd9aa120e4ff560f4461cf8442e9c0a2b92548d52800699", + "sha256:af5fbdde0690c7da68e841d7fc2632345d570768ea7406a9434446d7b33b0ee1", + "sha256:b64efdbdf3bbb1377562c179f167f3bf301251411eb5ac77dec6b7d32bcda463", + "sha256:bac5f444c118aeb456fac1b0b5d14c6a71ea2a42069b09c176f75e9bd4c186f6", + "sha256:bda9068aafb73859491e13b99b682bd299c1b5fd50644d697533775828a28ee0", + "sha256:d659517ca116e6750101a1326107d3479028c5191f0ecee3c7203c50f5b915b0", + "sha256:eddd3fb1f3e0f82e5915a899285a39ee34ce18fd25d89582bc89fc9fb16cd2c6" ], - "version": "==1.2.0" + "version": "==1.3.1" }, "tzlocal": { "hashes": [ diff --git a/dev-requirements.txt b/dev-requirements.txt index 72b9e3510..814ba7495 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -14,9 +14,9 @@ automat==0.7.0 aws-xray-sdk==0.95 babel==2.6.0 bcrypt==3.1.6 -boto3==1.9.90 +boto3==1.9.91 boto==2.49.0 -botocore==1.12.90 +botocore==1.12.91 bumpversion==0.5.3 bytestring-splitter==1.0.0a4 certifi==2018.11.29 @@ -73,7 +73,7 @@ more-itertools==5.0.0 moto==1.3.7 msgpack-python==0.5.6 mypy-extensions==0.4.1 -mypy==0.660 +mypy==0.670 packaging==19.0 paramiko==2.4.2 parsimonious==0.8.1 @@ -129,12 +129,12 @@ snowballstemmer==1.2.1 sphinx-rtd-theme==0.4.2 sphinx==1.8.4 sphinxcontrib-websupport==1.1.0 -sqlalchemy==1.3.0b2 +sqlalchemy==1.3.0b3 toolz==0.9.0 trie==1.3.8 twisted==18.9.0 txaio==18.8.1 -typed-ast==1.2.0 +typed-ast==1.3.1 tzlocal==2.0.0b1 umbral==0.1.3a0 urllib3==1.24.1 ; python_version >= '3.4' diff --git a/requirements.txt b/requirements.txt index 778b3f73b..0905e376f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,8 +6,8 @@ attrdict==2.0.1 attrs==18.2.0 autobahn==19.1.1 automat==0.7.0 -boto3==1.9.90 -botocore==1.12.90 +boto3==1.9.91 +botocore==1.12.91 bytestring-splitter==1.0.0a4 certifi==2018.11.29 cffi==1.11.5 @@ -80,7 +80,7 @@ sentry-sdk==0.5.2 service-identity==18.1.0 six==1.12.0 snaptime==0.2.4 -sqlalchemy==1.3.0b2 +sqlalchemy==1.3.0b3 toolz==0.9.0 trie==1.3.8 twisted==18.9.0 From 172df807dd2aba5fadb77dd74fbd7c13b829ae42 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 13:51:29 -0700 Subject: [PATCH 3/9] Install solidity v0.5.3 by default --- scripts/install_solc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_solc.sh b/scripts/install_solc.sh index 6d7c8114e..cf6b13056 100755 --- a/scripts/install_solc.sh +++ b/scripts/install_solc.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -SOLC_VER="0.4.25" +SOLC_VER="0.5.3" SOL_BIN_PATH="$(pipenv --venv)/bin/solc" echo "Downloading solidity compiler binary to: ${SOL_BIN_PATH}" From 2e0e9b0e41ab3a8d010e8815b7161e2cb18e9353 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 14:47:11 -0700 Subject: [PATCH 4/9] Update default solc version within nucypher codebase --- nucypher/blockchain/eth/sol/compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nucypher/blockchain/eth/sol/compile.py b/nucypher/blockchain/eth/sol/compile.py index 0749efd8e..60b16cce5 100644 --- a/nucypher/blockchain/eth/sol/compile.py +++ b/nucypher/blockchain/eth/sol/compile.py @@ -30,7 +30,7 @@ class SolidityCompiler: # TODO: Integrate with config classes - __default_version = 'v0.4.24' + __default_version = 'v0.5.3' __default_configuration_path = os.path.join(dirname(abspath(__file__)), './compiler.json') __default_sol_binary_path = shutil.which('solc') @@ -46,7 +46,7 @@ class SolidityCompiler: configuration_path: str = None, chain_name: str = None, source_dir: str = None, - test_contract_dir: str= None + test_contract_dir: str = None ) -> None: self.log = Logger('solidity-compiler') From 89237c450e6839a295b0f42f6b1e55da64e84299 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 19:42:24 -0700 Subject: [PATCH 5/9] Update dependency locks to utilize EOL py-solc releases --- Pipfile | 2 +- Pipfile.lock | 582 +------------------------------------------ dev-requirements.txt | 69 +---- requirements.txt | 1 - 4 files changed, 7 insertions(+), 647 deletions(-) diff --git a/Pipfile b/Pipfile index f99890bb8..b9e998de7 100644 --- a/Pipfile +++ b/Pipfile @@ -46,6 +46,7 @@ mypy = "*" coverage = "*" python-coveralls = "*" # Deployment +py-solc = {editable = true,git = "https://github.com/nucypher/py-solc.git",ref = "v5.0.0-eol.0"} ansible = "*" bumpversion = "*" # Documentation @@ -54,7 +55,6 @@ recommonmark = "*" sphinx_rtd_theme = "*" # CLI nucypher = {editable = true,path = "."} -py-solc = {git = "https://github.com/nucypher/py-solc.git"} [scripts] install-solc = "scripts/install_solc.sh" diff --git a/Pipfile.lock b/Pipfile.lock index d5a4b9ed3..36678d295 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7b156c055c7cca1c092d2f2aedf9b61b43d20b59eab08d28a04bf713c66959f2" + "sha256": "9bb4a7b66763db366f0d4d2bc032708dde7485a0f94eb04f608163851b02de21" }, "pipfile-spec": 6, "requires": { @@ -515,11 +515,8 @@ "version": "==2.0.1" }, "py-solc": { - "hashes": [ - "sha256:82095bdac661072f48cf2daf8a96bdb625674330d92b225be26043e8d3ef8c9a", - "sha256:9ec0bc36ef22a9b0f5642e7846999c4485fa2fa562a61897aeb0a4ca53d60153" - ], - "version": "==3.2.0" + "git": "https://github.com/nucypher/py-solc.git", + "ref": "391b8da1a6bac5816877197bda25527c6b0b8c15" }, "pyasn1": { "hashes": [ @@ -925,21 +922,6 @@ ], "version": "==1.5" }, - "appdirs": { - "hashes": [ - "sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92", - "sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e" - ], - "index": "pypi", - "version": "==1.4.3" - }, - "argh": { - "hashes": [ - "sha256:a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3", - "sha256:e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65" - ], - "version": "==0.26.2" - }, "asn1crypto": { "hashes": [ "sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87", @@ -954,13 +936,6 @@ ], "version": "==1.3.0" }, - "attrdict": { - "hashes": [ - "sha256:35c90698b55c683946091177177a9e9c0713a0860f0e049febd72649ccd77b70", - "sha256:9432e3498c74ff7e1b20b3d93b45d766b71cbffa90923496f82c4ae38b92be34" - ], - "version": "==2.0.1" - }, "attrs": { "hashes": [ "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", @@ -968,20 +943,6 @@ ], "version": "==18.2.0" }, - "autobahn": { - "hashes": [ - "sha256:598037a4064fc4bee4acf63e8c27f3d94c15bf37a5e51d560f03850eced79c6d", - "sha256:aebbadb700c13792a2967c79002855d1153b9ec8f2949d169e908388699596ff" - ], - "version": "==19.1.1" - }, - "automat": { - "hashes": [ - "sha256:cbd78b83fa2d81fe2a4d23d258e1661dd7493c9a50ee2f1a5b2cac61c1793b0e", - "sha256:fdccab66b68498af9ecfa1fa43693abe546014dd25cf28543cbe9d1334916a58" - ], - "version": "==0.7.0" - }, "aws-xray-sdk": { "hashes": [ "sha256:72791618feb22eaff2e628462b0d58f398ce8c1bacfa989b7679817ab1fad60c", @@ -1050,14 +1011,6 @@ "index": "pypi", "version": "==0.5.3" }, - "bytestring-splitter": { - "hashes": [ - "sha256:708f70a171fbd5d28f8374e18b8fe00d931bdc908069611cb866397a8fbb34e5", - "sha256:a681e2fc5a6bd8b083ce740fc4353b34492af63d0891e59c05cd0300f79f91d8" - ], - "index": "pypi", - "version": "==1.0.0a4" - }, "certifi": { "hashes": [ "sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7", @@ -1109,22 +1062,6 @@ ], "version": "==3.0.4" }, - "click": { - "hashes": [ - "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", - "sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7" - ], - "index": "pypi", - "version": "==7.0" - }, - "colorama": { - "hashes": [ - "sha256:05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", - "sha256:f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48" - ], - "index": "pypi", - "version": "==0.4.1" - }, "commonmark": { "hashes": [ "sha256:9f6dda7876b2bb88dd784440166f4bc8e56cb2b2551264051123bacb0b6c1d8a", @@ -1132,21 +1069,6 @@ ], "version": "==0.8.1" }, - "constant-sorrow": { - "hashes": [ - "sha256:0ab5ddacde6484e986703a523b721517b7230e395d2bfddea5eced7153acbf9c", - "sha256:8ff487bbc15d4ddcae7f0f745c56494f4267e90b20b19102d81b390803e14ded" - ], - "index": "pypi", - "version": "==0.1.0a8" - }, - "constantly": { - "hashes": [ - "sha256:586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35", - "sha256:dd2fa9d6b1a51a83f0d7dd76293d734046aa176e384bf6e33b7e44880eb37c5d" - ], - "version": "==15.1.0" - }, "coverage": { "hashes": [ "sha256:00d464797a236f654337181af72b4baea3d35d056ca480e45e9163bb5df496b8", @@ -1195,20 +1117,6 @@ "index": "pypi", "version": "==2.5" }, - "cytoolz": { - "hashes": [ - "sha256:84cc06fa40aa310f2df79dd440fc5f84c3e20f01f9f7783fc9c38d0a11ba00e5" - ], - "markers": "implementation_name == 'cpython'", - "version": "==0.9.0.1" - }, - "dateparser": { - "hashes": [ - "sha256:940828183c937bcec530753211b70f673c0a9aab831e43273489b310538dff86", - "sha256:b452ef8b36cd78ae86a50721794bc674aa3994e19b570f7ba92810f4e0a2ae03" - ], - "version": "==0.7.0" - }, "decorator": { "hashes": [ "sha256:33cd704aea07b4c28b3eb2c97d288a06918275dac0ecebdaf1bc8a48d98adb9e", @@ -1245,88 +1153,6 @@ ], "version": "==0.13" }, - "eth-abi": { - "hashes": [ - "sha256:1aa7186cc12d6ed704b18ab3c446f271cdb66ef23473940dbd6d037d47559f75", - "sha256:2c7d1119da879cb74cc917d744a7e18bbf34a1e478a0e5eccf7f13ece192a735" - ], - "version": "==2.0.0b5" - }, - "eth-account": { - "hashes": [ - "sha256:3b5b1735db5736c9bb59786256edb0e18ea912f0a3d835611abb0266aa71c0d1", - "sha256:63d782e7d0db455d13b5d6f18df790895072fde49ed00f1c176ae11dfa87251b" - ], - "version": "==0.3.0" - }, - "eth-bloom": { - "hashes": [ - "sha256:7946722121f40d76aba2a148afe5edde714d119c7d698ddd0ef4d5a1197c3765", - "sha256:89d415710af1480683226e95805519f7c79b7244a3ca8d5287684301c7cee3de" - ], - "version": "==1.0.3" - }, - "eth-hash": { - "extras": [ - "pycryptodome", - "pysha3" - ], - "hashes": [ - "sha256:1b9cb34dd3cd99c85c2bd6a1420ceae39a2eee8bf080efd264bcda8be3edecc8", - "sha256:499dc02d098f69856d1a6dd005529c16174157d4fb2a9fe20c41f69e39f8f176" - ], - "version": "==0.2.0" - }, - "eth-keyfile": { - "hashes": [ - "sha256:70d734af17efdf929a90bb95375f43522be4ed80c3b9e0a8bca575fb11cd1159", - "sha256:939540efb503380bc30d926833e6a12b22c6750de80feef3720d79e5a79de47d" - ], - "version": "==0.5.1" - }, - "eth-keys": { - "hashes": [ - "sha256:18f2b30fe54ad9ff8a4517459012dfff1608f558d5ff24646c50e19fa5ec9183", - "sha256:993e61f146a9b228b8762082230afdf516c1ac3f6bbcdd2a09a4823ff8106d49" - ], - "version": "==0.2.1" - }, - "eth-rlp": { - "hashes": [ - "sha256:05d8456981d85e16a9afa57f2f2c3356af5d1c49499cc8512cfcdc034b90dde5", - "sha256:a94744c207ea731a7266bd0894179dc6e51a6a8965316000c8e823b5d7e07694" - ], - "version": "==0.1.2" - }, - "eth-tester": { - "hashes": [ - "sha256:1ebe506fb25550c966f59a8ab1f6e8de0c01c062d6e3caf141f410ec02a34c5b", - "sha256:5b7309609b9d642b6843951024e8602c3ef065abbc54f43c92520b86ff79c603" - ], - "index": "pypi", - "version": "==0.1.0b37" - }, - "eth-typing": { - "hashes": [ - "sha256:321a40a22ecdb7f5f184f9b1a315f50498ef4bac7ef6068e7ceda931dffd74d2", - "sha256:9e4712e6fa74a58b1c1aa181e2269a21b8241c7c261eec887cbdecb40f438e9d" - ], - "version": "==2.0.0" - }, - "eth-utils": { - "hashes": [ - "sha256:76f7797d3ed67821dbc92931f5b7e6b4bccdd5d3407b316bd1df882f2b55c28f", - "sha256:f11f046fef99e63f2cfe7663531c9a13ed0be6c01879f1a6151dc104eeebdfcf" - ], - "version": "==1.4.1" - }, - "ethpm": { - "hashes": [ - "sha256:571c631dbe46af1f408bd898585946accb8e35018ea9a94ff70fff86632add14", - "sha256:6e8ffff980fbc48b8fc411c897aab274323e1b20e09182bcdb58d34d519cebba" - ], - "version": "==0.1.4a10" - }, "execnet": { "hashes": [ "sha256:a7a84d5fa07a089186a329528f127c9d73b9de57f1a1131b82bb5320ee651f6a", @@ -1334,14 +1160,6 @@ ], "version": "==1.5.0" }, - "flask": { - "hashes": [ - "sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48", - "sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05" - ], - "index": "pypi", - "version": "==1.0.2" - }, "future": { "hashes": [ "sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8" @@ -1372,34 +1190,6 @@ ], "version": "==0.4.15" }, - "hendrix": { - "hashes": [ - "sha256:2173ef4b733a6e1c08af02a57f0f8fe1adbb40a3d32ffbfd6ef86b4558413ade", - "sha256:3eb78742383569276a1aec174a9ea92995dea177f0aa4173272b4a2a0c2e385b" - ], - "index": "pypi", - "version": "==3.2.2" - }, - "hexbytes": { - "hashes": [ - "sha256:27cc227ae95fc20d44325ac0329a0293d656a05230da079650705030c7d7a819", - "sha256:67e5608cb4a14d0a4ced058e595bb1f70c207ef2b5219fdc82af10e54bcf38de" - ], - "version": "==0.1.0" - }, - "humanize": { - "hashes": [ - "sha256:a43f57115831ac7c70de098e6ac46ac13be00d69abbf60bdcac251344785bb19" - ], - "version": "==0.5.1" - }, - "hyperlink": { - "hashes": [ - "sha256:98da4218a56b448c7ec7d2655cb339af1f7d751cf541469bb4fc28c4a4245b34", - "sha256:f01b4ff744f14bc5d0a22a6b9f1525ab7d6312cb0ff967f59414bbac52f0a306" - ], - "version": "==18.0.0" - }, "idna": { "hashes": [ "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", @@ -1414,27 +1204,6 @@ ], "version": "==1.1.0" }, - "incremental": { - "hashes": [ - "sha256:717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f", - "sha256:7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3" - ], - "version": "==17.5.0" - }, - "ipfsapi": { - "hashes": [ - "sha256:45820cc8605894e78ad42b558f4627dc9dabb22dc86830f451a4648d28d669d5", - "sha256:f2e7cc0c3f1f3b96730638072ab41ca76e1860a8b91fc5f815f66af886019f8e" - ], - "version": "==0.4.3" - }, - "itsdangerous": { - "hashes": [ - "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19", - "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749" - ], - "version": "==1.1.0" - }, "jinja2": { "hashes": [ "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", @@ -1462,19 +1231,6 @@ ], "version": "==1.1" }, - "jsonschema": { - "hashes": [ - "sha256:000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08", - "sha256:6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02" - ], - "version": "==2.6.0" - }, - "lru-dict": { - "hashes": [ - "sha256:365457660e3d05b76f1aba3e0f7fedbfcd6528e97c5115a351ddd0db488354cc" - ], - "version": "==1.1.6" - }, "markupsafe": { "hashes": [ "sha256:048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432", @@ -1508,14 +1264,6 @@ ], "version": "==1.1.0" }, - "maya": { - "hashes": [ - "sha256:7f53e06d5a123613dce7c270cbc647643a6942590dba7a19ec36194d0338c3f4", - "sha256:fa90d8c6c9a730a7f740dec6e1c7d3da8ca10159e40bb843e4e72772f5e3a9a3" - ], - "index": "pypi", - "version": "==0.6.1" - }, "mock": { "hashes": [ "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", @@ -1539,12 +1287,6 @@ "index": "pypi", "version": "==1.3.7" }, - "msgpack-python": { - "hashes": [ - "sha256:378cc8a6d3545b532dfd149da715abae4fda2a3adb6d74e525d0d5e51f46909b" - ], - "version": "==0.5.6" - }, "mypy": { "hashes": [ "sha256:308c274eb8482fbf16006f549137ddc0d69e5a589465e37b99c4564414363ca7", @@ -1578,18 +1320,6 @@ ], "version": "==2.4.2" }, - "parsimonious": { - "hashes": [ - "sha256:3add338892d580e0cb3b1a39e4a1b427ff9f687858fdd61097053742391a9f6b" - ], - "version": "==0.8.1" - }, - "pathtools": { - "hashes": [ - "sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0" - ], - "version": "==0.1.2" - }, "pbr": { "hashes": [ "sha256:a7953f66e1f82e4b061f43096a4bcc058f7d3d41de9b94ac871770e8bdd831a2", @@ -1597,18 +1327,6 @@ ], "version": "==5.1.2" }, - "pendulum": { - "hashes": [ - "sha256:0f43d963b27e92b04047ce8352e4c277db99f20d0b513df7d0ceafe674a2f727", - "sha256:14e60d26d7400980123dbb6e3f2a90b70d7c18c63742ffe5bd6d6a643f8c6ef1", - "sha256:5035a4e17504814a679f138374269cc7cc514aeac7ba6d9dc020abc224f25dbc", - "sha256:8c0b3d655c1e9205d4dacf42fffc929cde3b19b5fb544a7f7561e6896eb8a000", - "sha256:bfc7b33ae193a204ec0bec12ad0d2d3300cd7e51d91d992da525ba3b28f0d265", - "sha256:cd70b75800439794e1ad8dbfa24838845e171918df81fa98b68d0d5a6f9b8bf2", - "sha256:cf535d36c063575d4752af36df928882b2e0e31541b4482c97d63752785f9fcb" - ], - "version": "==2.0.4" - }, "pluggy": { "hashes": [ "sha256:8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616", @@ -1616,29 +1334,6 @@ ], "version": "==0.8.1" }, - "protobuf": { - "hashes": [ - "sha256:1a53984ed9b84b6d30e8301d840a3eb86c74f2dab38f16fd45ee294ed0519384", - "sha256:3a6367a839e4c770d1fbac05570c339eb496ffcc352b1ec5eb07988187fc86ce", - "sha256:44eb7cfa05b700fe918f454ef28eecae011bcaa716ef81d898a7ea31e41e2c82", - "sha256:5465c3d36274a61e10f0fa8758c0fecb198b3a7f5a1b62e4e3883139df37cf81", - "sha256:657a1b43332014ce65c54555f766469fd73a72782d27e4cf3e7f82cf2e659c2a", - "sha256:8a41020d490d3502a2e288cd9ff7f1a0e72b7d36b217044e2af34453eab86499", - "sha256:95eeba09efbeb0743f14f9dc00d12e3affcd463b3b655fa8fe6c1e5248b05ce9", - "sha256:98032e9c31f71d21ff116fd29051310d128d3faa4739c598f212a83fe7042917", - "sha256:a7d9cbdc0b4a5192ea2520b12ec7b4987cbae3e1d27a5ae61951b93d52c3b1c7", - "sha256:bab6534369b147f256997a868a79e335db4907aff6b0df8e24ee0900c886961f", - "sha256:d4b5d2d07d9f784c3422e9e6e2321d22825186369886e9f8a917704de6cb6a7e", - "sha256:d8ed41b5ddc589b5aae64018fc8daabcec4ece7653b41a22c49b3c87361c3d2c", - "sha256:dd7f7a847e0f5bae3c1770e9c28d8f7007f33581cd151c65dc79234592653e81", - "sha256:e231d76482a5b959dd227b4cc0389b5f398b3ba1a0107a39c4d253b191f40703", - "sha256:e3b467f88f4db8ecf876f3a5c66dd085c03c54d4dca0064cf21e3d1088e61967", - "sha256:ef22c0a6fa5006795b46d0298f784cc4e21028367c1796cfad496d104986e219", - "sha256:f19db9112b6b87332c56b15e7aed1d5157fdc4b2c92404e3402d62516f39e73d", - "sha256:fcdaa58e54acebfbbc2325c07524fbf53abe6ccf6a0b21416c2024aa02d55cf3" - ], - "version": "==3.7.0rc2" - }, "py": { "hashes": [ "sha256:bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694", @@ -1646,34 +1341,9 @@ ], "version": "==1.7.0" }, - "py-ecc": { - "hashes": [ - "sha256:67577529be4839cfc1a6ded58942ef1fb146d70d12bfcf2c202c35ced47fc1c6", - "sha256:96d14264962efc52fb359c5e62f8d697c76489156b167ebc5ea7a7a12bb59749" - ], - "version": "==1.4.7" - }, - "py-evm": { - "hashes": [ - "sha256:3fe15579fdad78f0b5fadf01cf91bd01fe89fb12df593320211a54f327bb465d", - "sha256:e474ae793743eec8cb1ade7119c3a1fdd1152070bfcf71233587d4e31046ba57" - ], - "index": "pypi", - "version": "==0.2.0a39" - }, - "py-geth": { - "hashes": [ - "sha256:2da4ae79e1d769c9cbfc5e86c746b05281899615349f1a79a043d6d2ff647247", - "sha256:b10cc4e4b64296478158c009f650eeac9817112694ac824dab85ba27dfece3b8" - ], - "version": "==2.0.1" - }, "py-solc": { - "hashes": [ - "sha256:82095bdac661072f48cf2daf8a96bdb625674330d92b225be26043e8d3ef8c9a", - "sha256:9ec0bc36ef22a9b0f5642e7846999c4485fa2fa562a61897aeb0a4ca53d60153" - ], - "version": "==3.2.0" + "git": "https://github.com/nucypher/py-solc.git", + "ref": "391b8da1a6bac5816877197bda25527c6b0b8c15" }, "pyaml": { "hashes": [ @@ -1689,19 +1359,6 @@ ], "version": "==0.4.5" }, - "pyasn1-modules": { - "hashes": [ - "sha256:79580acf813e3b7d6e69783884e6e83ac94bf4617b36a135b85c599d8a818a7b", - "sha256:a52090e8c5841ebbf08ae455146792d9ef3e8445b21055d3a3b7ed9c712b7c7c" - ], - "version": "==0.2.4" - }, - "pychalk": { - "hashes": [ - "sha256:f763275f6fa68835a30d22c2449f73724d569f33532a031d26e32edc604e7e39" - ], - "version": "==2.0.1" - }, "pycparser": { "hashes": [ "sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3" @@ -1741,12 +1398,6 @@ ], "version": "==3.7.3" }, - "pyethash": { - "hashes": [ - "sha256:ff66319ce26b9d77df1f610942634dac9742e216f2c27b051c0a2c2dec9c2818" - ], - "version": "==0.1.27" - }, "pygments": { "hashes": [ "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a", @@ -1754,13 +1405,6 @@ ], "version": "==2.3.1" }, - "pyhamcrest": { - "hashes": [ - "sha256:6b672c02fdf7470df9674ab82263841ce8333fb143f32f021f6cb26f0e512420", - "sha256:8ffaa0a53da57e89de14ced7185ac746227a8894dbd5a3c718bf05ddbd1d56cd" - ], - "version": "==1.9.0" - }, "pynacl": { "hashes": [ "sha256:05c26f93964373fc0abe332676cb6735f0ecad27711035b9472751faa8521255", @@ -1785,14 +1429,6 @@ ], "version": "==1.3.0" }, - "pyopenssl": { - "hashes": [ - "sha256:aeca66338f6de19d1aa46ed634c3b9ae519a64b458f8468aec688e7e3c20f200", - "sha256:c727930ad54b10fc157015014b666f2d8b41f70c0d03e83ab67624fd3dd5d1e6" - ], - "index": "pypi", - "version": "==19.0.0" - }, "pyparsing": { "hashes": [ "sha256:66c9268862641abcac4a96ba74506e594c884e3f57690a696d21ad8210ed667a", @@ -1800,33 +1436,6 @@ ], "version": "==2.3.1" }, - "pysha3": { - "hashes": [ - "sha256:0060a66be16665d90c432f55a0ba1f6480590cfb7d2ad389e688a399183474f0", - "sha256:11a2ba7a2e1d9669d0052fc8fb30f5661caed5512586ecbeeaf6bf9478ab5c48", - "sha256:386998ee83e313b6911327174e088021f9f2061cbfa1651b97629b761e9ef5c4", - "sha256:41be70b06c8775a9e4d4eeb52f2f6a3f356f17539a54eac61f43a29e42fd453d", - "sha256:4416f16b0f1605c25f627966f76873e432971824778b369bd9ce1bb63d6566d9", - "sha256:571a246308a7b63f15f5aa9651f99cf30f2a6acba18eddf28f1510935968b603", - "sha256:59111c08b8f34495575d12e5f2ce3bafb98bea470bc81e70c8b6df99aef0dd2f", - "sha256:5ec8da7c5c70a53b5fa99094af3ba8d343955b212bc346a0d25f6ff75853999f", - "sha256:684cb01d87ed6ff466c135f1c83e7e4042d0fc668fa20619f581e6add1d38d77", - "sha256:68c3a60a39f9179b263d29e221c1bd6e01353178b14323c39cc70593c30f21c5", - "sha256:6e6a84efb7856f5d760ee55cd2b446972cb7b835676065f6c4f694913ea8f8d9", - "sha256:827b308dc025efe9b6b7bae36c2e09ed0118a81f792d888548188e97b9bf9a3d", - "sha256:93abd775dac570cb9951c4e423bcb2bc6303a9d1dc0dc2b7afa2dd401d195b24", - "sha256:9c778fa8b161dc9348dc5cc361e94d54aa5ff18413788f4641f6600d4893a608", - "sha256:9fdd28884c5d0b4edfed269b12badfa07f1c89dbc5c9c66dd279833894a9896b", - "sha256:c7c2adcc43836223680ebdf91f1d3373543dc32747c182c8ca2e02d1b69ce030", - "sha256:c93a2676e6588abcfaecb73eb14485c81c63b94fca2000a811a7b4fb5937b8e8", - "sha256:cd5c961b603bd2e6c2b5ef9976f3238a561c58569945d4165efb9b9383b050ef", - "sha256:f9046d59b3e72aa84f6dae83a040bd1184ebd7fef4e822d38186a8158c89e3cf", - "sha256:fd7e66999060d079e9c0e8893e78d8017dad4f59721f6fe0be6307cd32127a07", - "sha256:fe988e73f2ce6d947220624f04d467faf05f1bbdbc64b0a201296bb3af92739e" - ], - "index": "pypi", - "version": "==1.0.2" - }, "pytest": { "hashes": [ "sha256:f689bf2fc18c4585403348dd56f47d87780bf217c53ed9ae7a3e2d7faa45f8e9", @@ -1843,13 +1452,6 @@ "index": "pypi", "version": "==2.5.1" }, - "pytest-ethereum": { - "hashes": [ - "sha256:0767a536ab0330d05a3282a03511f8e6d2de98f880fec7d49b115b2d43d746e8", - "sha256:1bd0415d5e7176e62b19ebec9fec73aefdf4d7766dbf928b6b644fe27b269b3f" - ], - "version": "==0.1.3a6" - }, "pytest-forked": { "hashes": [ "sha256:260d03fbd38d5ce41a657759e8d19bc7c8cfa6d0dcfa36c0bc9742d33bc30742", @@ -1918,13 +1520,6 @@ ], "version": "==2018.9" }, - "pytzdata": { - "hashes": [ - "sha256:9626e42fd9df77b16aedbd909d1e5fda839be47966adb7089b990f3452c45dd8", - "sha256:dddaaf4f1717820a6fdcac94057e03c1a15b3829a44d9eaf19988917977db408" - ], - "version": "==2018.9" - }, "pyyaml": { "hashes": [ "sha256:254bf6fda2b7c651837acb2c718e213df29d531eebf00edb54743d10bcb694eb", @@ -1943,20 +1538,6 @@ "index": "pypi", "version": "==0.5.0" }, - "regex": { - "hashes": [ - "sha256:017bf6f893db109dc5f82b902019f6fe089e605af5e1f0f6f7271f936b411eb4", - "sha256:0969fdb610435d7f49dc5518f7642d7b1319ef19f0c3f1bd4d972afbb9877aa7", - "sha256:3679f269790c87bd04e003e60e098b1be5392f17c48d28c2a3b9d16b3dcbca2a", - "sha256:37150aee3411f38d08733edb5f3faa656f96ddae00ee7713e01d7423f0f72815", - "sha256:4a1a1d963f462c13722b34ef1f82c4707091b0a3fb9b5fd79b6670c38b734095", - "sha256:5da76d468d048fb163bcaedd5c0832a3ab95da1034598a6c673bf999ae61f259", - "sha256:72dda5123ee45cde10031576710ca0c4972757c94a60b75023a45d8069da34ca", - "sha256:7f40b720b81f6614a34a8857d2417fbe619734629f9d0627e2cc9e493979401d", - "sha256:a22a11e9dd6e46529dc4409bd6c449f3e7525aa4b0d5e9b23363302cfe4db8e4" - ], - "version": "==2019.2.7" - }, "requests": { "hashes": [ "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", @@ -1972,13 +1553,6 @@ ], "version": "==0.10.5" }, - "rlp": { - "hashes": [ - "sha256:0505fd53278cb4a3ea6baf1b658357ac209bdcdd1b316ac90050c40f669ceacc", - "sha256:ebe80a03c50e3d6aac47f44ddd45048bb99e411203cd764f5da1330e6d83821c" - ], - "version": "==1.1.0" - }, "s3transfer": { "hashes": [ "sha256:7b9ad3213bff7d357f888e0fab5101b56fa1a0548ee77d121c3a3dbfbef4cb2e", @@ -1993,21 +1567,6 @@ ], "version": "==2.6.0" }, - "sentry-sdk": { - "hashes": [ - "sha256:d4eb77414e21258943cdd7ea4aa216e2d994d38700d747d5d3da943edd414b58", - "sha256:e77795ca8bafbcf4a19d9c2fcd99f9cb68a9623e5f853a0758084a8b025e6c87" - ], - "index": "pypi", - "version": "==0.5.2" - }, - "service-identity": { - "hashes": [ - "sha256:001c0707759cb3de7e49c078a7c0c9cd12594161d3bf06b9c254fdcb1a60dc36", - "sha256:0858a54aabc5b459d1aafa8a518ed2081a285087f349fe3e55197989232e2e2d" - ], - "version": "==18.1.0" - }, "six": { "hashes": [ "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", @@ -2015,12 +1574,6 @@ ], "version": "==1.12.0" }, - "snaptime": { - "hashes": [ - "sha256:e3f1eb89043d58d30721ab98cb65023f1a4c2740e3b197704298b163c92d508b" - ], - "version": "==0.2.4" - }, "snowballstemmer": { "hashes": [ "sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128", @@ -2051,39 +1604,6 @@ ], "version": "==1.1.0" }, - "sqlalchemy": { - "hashes": [ - "sha256:7dede29f121071da9873e7b8c98091874617858e790dc364ffaab4b09d81216c" - ], - "index": "pypi", - "version": "==1.3.0b3" - }, - "toolz": { - "hashes": [ - "sha256:929f0a7ea7f61c178bd951bdae93920515d3fbdbafc8e6caf82d752b9b3b31c9" - ], - "version": "==0.9.0" - }, - "trie": { - "hashes": [ - "sha256:028949f9c7d14c6635dc331ecd00fa760e6688c8926cc2fcafd044260b1211b5", - "sha256:8c76b26d18619dbc70badfe3abe8a8065f4ec5e8048193349bcad5779e26fc62" - ], - "version": "==1.3.8" - }, - "twisted": { - "hashes": [ - "sha256:294be2c6bf84ae776df2fc98e7af7d6537e1c5e60a46d33c3ce2a197677da395" - ], - "version": "==18.9.0" - }, - "txaio": { - "hashes": [ - "sha256:67e360ac73b12c52058219bb5f8b3ed4105d2636707a36a7cdafb56fe06db7fe", - "sha256:b6b235d432cc58ffe111b43e337db71a5caa5d3eaa88f0eacf60b431c7626ef5" - ], - "version": "==18.8.1" - }, "typed-ast": { "hashes": [ "sha256:035a54ede6ce1380599b2ce57844c6554666522e376bd111eb940fbc7c3dad23", @@ -2108,21 +1628,6 @@ ], "version": "==1.3.1" }, - "tzlocal": { - "hashes": [ - "sha256:27d58a0958dc884d208cdaf45ef5892bf2a57d21d9611f2ac45e51f1973e8cab", - "sha256:f124f198e5d86b3538b140883472beaa82d2c0efc0cd9694dfdbe39079e22e69" - ], - "version": "==2.0.0b1" - }, - "umbral": { - "hashes": [ - "sha256:64b0302117e63c212e94005ee6a981da53f40ff643aca215263ad4059ed0c885", - "sha256:8a1b23fafaafb07438f98ee112949818a6941d377c305f8b8598f52c4831b0c4" - ], - "index": "pypi", - "version": "==0.1.3a0" - }, "urllib3": { "hashes": [ "sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", @@ -2131,23 +1636,6 @@ "markers": "python_version >= '3.4'", "version": "==1.24.1" }, - "watchdog": { - "hashes": [ - "sha256:965f658d0732de3188211932aeb0bb457587f04f63ab4c1e33eab878e9de961d" - ], - "version": "==0.9.0" - }, - "web3": { - "extras": [ - "tester" - ], - "hashes": [ - "sha256:e076f7e005ff39a58f45772d262a928ccb207732606c04a9e0a41040734089ac", - "sha256:f7f6e80624848b72077457f4f8fee932e8c585ee78467c5283a1e4ee4a9da90b" - ], - "index": "pypi", - "version": "==5.0.0a4" - }, "websocket-client": { "hashes": [ "sha256:8c8bf2d4f800c3ed952df206b18c28f7070d9e3dcbd6ca6291127574f57ee786", @@ -2155,32 +1643,6 @@ ], "version": "==0.54.0" }, - "websockets": { - "hashes": [ - "sha256:04b42a1b57096ffa5627d6a78ea1ff7fad3bc2c0331ffc17bc32a4024da7fea0", - "sha256:08e3c3e0535befa4f0c4443824496c03ecc25062debbcf895874f8a0b4c97c9f", - "sha256:10d89d4326045bf5e15e83e9867c85d686b612822e4d8f149cf4840aab5f46e0", - "sha256:232fac8a1978fc1dead4b1c2fa27c7756750fb393eb4ac52f6bc87ba7242b2fa", - "sha256:4bf4c8097440eff22bc78ec76fe2a865a6e658b6977a504679aaf08f02c121da", - "sha256:51642ea3a00772d1e48fb0c492f0d3ae3b6474f34d20eca005a83f8c9c06c561", - "sha256:55d86102282a636e195dad68aaaf85b81d0bef449d7e2ef2ff79ac450bb25d53", - "sha256:564d2675682bd497b59907d2205031acbf7d3fadf8c763b689b9ede20300b215", - "sha256:5d13bf5197a92149dc0badcc2b699267ff65a867029f465accfca8abab95f412", - "sha256:5eda665f6789edb9b57b57a159b9c55482cbe5b046d7db458948370554b16439", - "sha256:5edb2524d4032be4564c65dc4f9d01e79fe8fad5f966e5b552f4e5164fef0885", - "sha256:79691794288bc51e2a3b8de2bc0272ca8355d0b8503077ea57c0716e840ebaef", - "sha256:7fcc8681e9981b9b511cdee7c580d5b005f3bb86b65bde2188e04a29f1d63317", - "sha256:8e447e05ec88b1b408a4c9cde85aa6f4b04f06aa874b9f0b8e8319faf51b1fee", - "sha256:90ea6b3e7787620bb295a4ae050d2811c807d65b1486749414f78cfd6fb61489", - "sha256:9e13239952694b8b831088431d15f771beace10edfcf9ef230cefea14f18508f", - "sha256:d40f081187f7b54d7a99d8a5c782eaa4edc335a057aa54c85059272ed826dc09", - "sha256:e1df1a58ed2468c7b7ce9a2f9752a32ad08eac2bcd56318625c3647c2cd2da6f", - "sha256:e98d0cec437097f09c7834a11c69d79fe6241729b23f656cfc227e93294fc242", - "sha256:f8d59627702d2ff27cb495ca1abdea8bd8d581de425c56e93bff6517134e0a9b", - "sha256:fc30cdf2e949a2225b012a7911d1d031df3d23e99b7eda7dfc982dc4a860dae9" - ], - "version": "==7.0" - }, "werkzeug": { "hashes": [ "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c", @@ -2200,40 +1662,6 @@ "sha256:add07d92089ff611badec526912747cf87afd4f9447af6661aca074eeaf32615" ], "version": "==0.11.0" - }, - "zope.interface": { - "hashes": [ - "sha256:086707e0f413ff8800d9c4bc26e174f7ee4c9c8b0302fbad68d083071822316c", - "sha256:1157b1ec2a1f5bf45668421e3955c60c610e31913cc695b407a574efdbae1f7b", - "sha256:11ebddf765bff3bbe8dbce10c86884d87f90ed66ee410a7e6c392086e2c63d02", - "sha256:14b242d53f6f35c2d07aa2c0e13ccb710392bcd203e1b82a1828d216f6f6b11f", - "sha256:1b3d0dcabc7c90b470e59e38a9acaa361be43b3a6ea644c0063951964717f0e5", - "sha256:20a12ab46a7e72b89ce0671e7d7a6c3c1ca2c2766ac98112f78c5bddaa6e4375", - "sha256:298f82c0ab1b182bd1f34f347ea97dde0fffb9ecf850ecf7f8904b8442a07487", - "sha256:2f6175722da6f23dbfc76c26c241b67b020e1e83ec7fe93c9e5d3dd18667ada2", - "sha256:3b877de633a0f6d81b600624ff9137312d8b1d0f517064dfc39999352ab659f0", - "sha256:4265681e77f5ac5bac0905812b828c9fe1ce80c6f3e3f8574acfb5643aeabc5b", - "sha256:550695c4e7313555549aa1cdb978dc9413d61307531f123558e438871a883d63", - "sha256:5f4d42baed3a14c290a078e2696c5f565501abde1b2f3f1a1c0a94fbf6fbcc39", - "sha256:62dd71dbed8cc6a18379700701d959307823b3b2451bdc018594c48956ace745", - "sha256:7040547e5b882349c0a2cc9b50674b1745db551f330746af434aad4f09fba2cc", - "sha256:7e099fde2cce8b29434684f82977db4e24f0efa8b0508179fce1602d103296a2", - "sha256:7e5c9a5012b2b33e87980cee7d1c82412b2ebabcb5862d53413ba1a2cfde23aa", - "sha256:81295629128f929e73be4ccfdd943a0906e5fe3cdb0d43ff1e5144d16fbb52b1", - "sha256:95cc574b0b83b85be9917d37cd2fad0ce5a0d21b024e1a5804d044aabea636fc", - "sha256:968d5c5702da15c5bf8e4a6e4b67a4d92164e334e9c0b6acf080106678230b98", - "sha256:9e998ba87df77a85c7bed53240a7257afe51a07ee6bc3445a0bf841886da0b97", - "sha256:a0c39e2535a7e9c195af956610dba5a1073071d2d85e9d2e5d789463f63e52ab", - "sha256:a15e75d284178afe529a536b0e8b28b7e107ef39626a7809b4ee64ff3abc9127", - "sha256:a6a6ff82f5f9b9702478035d8f6fb6903885653bff7ec3a1e011edc9b1a7168d", - "sha256:b639f72b95389620c1f881d94739c614d385406ab1d6926a9ffe1c8abbea23fe", - "sha256:bad44274b151d46619a7567010f7cde23a908c6faa84b97598fd2f474a0c6891", - "sha256:bbcef00d09a30948756c5968863316c949d9cedbc7aabac5e8f0ffbdb632e5f1", - "sha256:d788a3999014ddf416f2dc454efa4a5dbeda657c6aba031cf363741273804c6b", - "sha256:eed88ae03e1ef3a75a0e96a55a99d7937ed03e53d0cffc2451c208db445a2966", - "sha256:f99451f3a579e73b5dd58b1b08d1179791d49084371d9a47baad3b22417f0317" - ], - "version": "==4.6.0" } } } diff --git a/dev-requirements.txt b/dev-requirements.txt index 814ba7495..ea065e447 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,16 +1,10 @@ -i https://pypi.python.org/simple --e . alabaster==0.7.12 ansible==2.7.7 apipkg==1.5 -appdirs==1.4.3 -argh==0.26.2 asn1crypto==0.24.0 atomicwrites==1.3.0 -attrdict==2.0.1 attrs==18.2.0 -autobahn==19.1.1 -automat==0.7.0 aws-xray-sdk==0.95 babel==2.6.0 bcrypt==3.1.6 @@ -18,90 +12,46 @@ boto3==1.9.91 boto==2.49.0 botocore==1.12.91 bumpversion==0.5.3 -bytestring-splitter==1.0.0a4 certifi==2018.11.29 cffi==1.11.5 chardet==3.0.4 -click==7.0 -colorama==0.4.1 commonmark==0.8.1 -constant-sorrow==0.1.0a8 -constantly==15.1.0 coverage==4.0.3 cryptography==2.5 -cytoolz==0.9.0.1 ; implementation_name == 'cpython' -dateparser==0.7.0 decorator==4.3.2 docker-pycreds==0.4.0 docker==3.7.0 docutils==0.14 ecdsa==0.13 -eth-abi==2.0.0b5 -eth-account==0.3.0 -eth-bloom==1.0.3 -eth-hash[pycryptodome,pysha3]==0.2.0 -eth-keyfile==0.5.1 -eth-keys==0.2.1 -eth-rlp==0.1.2 -eth-tester==0.1.0b37 -eth-typing==2.0.0 -eth-utils==1.4.1 -ethpm==0.1.4a10 execnet==1.5.0 -flask==1.0.2 future==0.17.1 +-e git://github.com/nucypher/py-solc.git@v5.0.0-eol.0#egg=py-solc greenlet==0.4.15 -hendrix==3.2.2 -hexbytes==0.1.0 -humanize==0.5.1 -hyperlink==18.0.0 idna==2.8 imagesize==1.1.0 -incremental==17.5.0 -ipfsapi==0.4.3 -itsdangerous==1.1.0 jinja2==2.10 jmespath==0.9.3 jsondiff==1.1.1 jsonpickle==1.1 -jsonschema==2.6.0 -lru-dict==1.1.6 markupsafe==1.1.0 -maya==0.6.1 mock==2.0.0 more-itertools==5.0.0 moto==1.3.7 -msgpack-python==0.5.6 mypy-extensions==0.4.1 mypy==0.670 packaging==19.0 paramiko==2.4.2 -parsimonious==0.8.1 -pathtools==0.1.2 pbr==5.1.2 -pendulum==2.0.4 pluggy==0.8.1 -protobuf==3.7.0rc2 -py-ecc==1.4.7 -py-evm==0.2.0a39 -py-geth==2.0.1 -py-solc==3.2.0 py==1.7.0 pyaml==18.11.0 -pyasn1-modules==0.2.4 pyasn1==0.4.5 -pychalk==2.0.1 pycparser==2.19 pycryptodome==3.7.3 -pyethash==0.1.27 pygments==2.3.1 -pyhamcrest==1.9.0 pynacl==1.3.0 -pyopenssl==19.0.0 pyparsing==2.3.1 -pysha3==1.0.2 pytest-cov==2.5.1 -pytest-ethereum==0.1.3a6 pytest-forked==1.0.1 pytest-mock==1.10.1 pytest-mypy==0.3.2 @@ -112,37 +62,20 @@ python-coveralls==2.9.1 python-dateutil==2.8.0 ; python_version >= '2.7' python-jose==2.0.2 pytz==2018.9 -pytzdata==2018.9 pyyaml==4.2b4 recommonmark==0.5.0 -regex==2019.2.7 requests==2.21.0 responses==0.10.5 -rlp==1.1.0 s3transfer==0.2.0 semantic-version==2.6.0 -sentry-sdk==0.5.2 -service-identity==18.1.0 six==1.12.0 -snaptime==0.2.4 snowballstemmer==1.2.1 sphinx-rtd-theme==0.4.2 sphinx==1.8.4 sphinxcontrib-websupport==1.1.0 -sqlalchemy==1.3.0b3 -toolz==0.9.0 -trie==1.3.8 -twisted==18.9.0 -txaio==18.8.1 typed-ast==1.3.1 -tzlocal==2.0.0b1 -umbral==0.1.3a0 urllib3==1.24.1 ; python_version >= '3.4' -watchdog==0.9.0 -web3[tester]==5.0.0a4 websocket-client==0.54.0 -websockets==7.0 werkzeug==0.14.1 wrapt==1.11.1 xmltodict==0.11.0 -zope.interface==4.6.0 diff --git a/requirements.txt b/requirements.txt index 0905e376f..a30219b61 100644 --- a/requirements.txt +++ b/requirements.txt @@ -55,7 +55,6 @@ protobuf==3.7.0rc2 py-ecc==1.4.7 py-evm==0.2.0a39 py-geth==2.0.1 -py-solc==3.2.0 pyasn1-modules==0.2.4 pyasn1==0.4.5 pychalk==2.0.1 From 1ac4d276ff6a056b920e809c591d13298c6933ac Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 22:42:33 -0700 Subject: [PATCH 6/9] Install deps with pipenv sync --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a7d175c93..3b9e23b3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -247,7 +247,7 @@ commands: - checkout - run: name: Install Python Dependencies with Pipenv - command: pipenv install --three --dev --pre + command: pipenv sync --dev - run: name: Install Solidity Compiler (Pipenv Entrypoint) command: pipenv run install-solc From 20e8bd2eb96b53296cd3a11256c918b259fb9be3 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sat, 9 Feb 2019 22:48:47 -0700 Subject: [PATCH 7/9] Remove ethpm as a pinned package since it is poiting to py-solc on PYPI instead of nucypher --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a30219b61..816893a0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,7 +30,6 @@ eth-rlp==0.1.2 eth-tester==0.1.0b37 eth-typing==2.0.0 eth-utils==1.4.1 -ethpm==0.1.4a10 flask==1.0.2 hendrix==3.2.2 hexbytes==0.1.0 From e6bf2820eadafc7c98169c4a81d0242653193e42 Mon Sep 17 00:00:00 2001 From: "Kieran R. Prasch" Date: Sun, 10 Feb 2019 09:39:48 -0700 Subject: [PATCH 8/9] Forcibly uninstall ethpm --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b9e23b3c..2af3ff8d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -247,7 +247,9 @@ commands: - checkout - run: name: Install Python Dependencies with Pipenv - command: pipenv sync --dev + command: | + pipenv sync --dev + pipenv uninstall --skip-lock ethpm - run: name: Install Solidity Compiler (Pipenv Entrypoint) command: pipenv run install-solc From d8e637c7dba519519d442053e775f336634f5746 Mon Sep 17 00:00:00 2001 From: szotov Date: Tue, 12 Feb 2019 17:39:07 +0300 Subject: [PATCH 9/9] Fix escrow agent test --- tests/blockchain/eth/entities/agents/test_miner_escrow_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/blockchain/eth/entities/agents/test_miner_escrow_agent.py b/tests/blockchain/eth/entities/agents/test_miner_escrow_agent.py index bfc06bbe5..695e1ff95 100644 --- a/tests/blockchain/eth/entities/agents/test_miner_escrow_agent.py +++ b/tests/blockchain/eth/entities/agents/test_miner_escrow_agent.py @@ -46,7 +46,7 @@ def test_deposit_tokens(testerchain, three_agents): # Check the receipt for the contract address success code receipt = testerchain.wait_for_receipt(txhash) assert receipt['status'] == 1, "Transaction Rejected" - assert receipt['logs'][1]['address'] == agent.contract_address + assert receipt['logs'][2]['address'] == agent.contract_address testerchain.time_travel(periods=1) assert agent.get_locked_tokens(miner_address=someone) == MIN_ALLOWED_LOCKED