Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Jul 16, 2021
1 parent 8e8210d commit 2392e28
Show file tree
Hide file tree
Showing 26 changed files with 216 additions and 222 deletions.
2 changes: 1 addition & 1 deletion raiden_contracts/contract_source_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from raiden_contracts.contract_manager import ContractManager, contracts_data_path

_BASE = Path(__file__).parent
SOLC_VERSION = "0.7.6"
SOLC_VERSION = "0.8.6"


class ContractSourceManagerCompilationError(RuntimeError):
Expand Down
182 changes: 91 additions & 91 deletions raiden_contracts/data/contracts.json

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions raiden_contracts/data/gas.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"CustomToken.approve": 46080,
"CustomToken.mint": 50646,
"CustomToken.transfer": 36412,
"CustomToken.transferFrom": 28922,
"MonitoringService.claimReward": 45932,
"MonitoringService.monitor": 230910,
"OneToN.bulkClaim 1 ious": 106352,
"OneToN.bulkClaim 6 ious": 161946,
"OneToN.claim": 103666,
"SecretRegistry.registerSecret": 46297,
"SecretRegistry.registerSecretBatch1": 46759,
"SecretRegistry.registerSecretBatch2": 71519,
"SecretRegistry.registerSecretBatch3": 96279,
"ServiceRegistry.deposit": 570886,
"ServiceRegistry.setURL": 47223,
"TokenNetwork DEPLOYMENT": 4266574,
"TokenNetwork.closeChannel": 122795,
"TokenNetwork.cooperativeSettle": 122309,
"TokenNetwork.openChannel": 115046,
"TokenNetwork.openChannelWithDeposit": 153235,
"TokenNetwork.setTotalDeposit": 58441,
"TokenNetwork.setTotalWithdraw": 120351,
"TokenNetwork.settleChannel": 115054,
"TokenNetwork.unlock 1 locks": 45079,
"TokenNetwork.unlock 6 locks": 61780,
"TokenNetwork.updateNonClosingBalanceProof": 94597,
"TokenNetworkRegistry DEPLOYMENT": 4850894,
"TokenNetworkRegistry createERC20TokenNetwork": 4024953,
"TokenNetworkUtils DEPLOYMENT": 307459,
"UserDeposit.deposit": 98239,
"UserDeposit.deposit (increase balance)": 34039,
"UserDeposit.planWithdraw": 69741,
"UserDeposit.withdraw": 49099
"CustomToken.approve": 46693,
"CustomToken.mint": 51200,
"CustomToken.transfer": 37395,
"CustomToken.transferFrom": 29597,
"MonitoringService.claimReward": 47863,
"MonitoringService.monitor": 246586,
"OneToN.bulkClaim 1 ious": 114373,
"OneToN.bulkClaim 6 ious": 195422,
"OneToN.claim": 111098,
"SecretRegistry.registerSecret": 47211,
"SecretRegistry.registerSecretBatch1": 48185,
"SecretRegistry.registerSecretBatch2": 73919,
"SecretRegistry.registerSecretBatch3": 99653,
"ServiceRegistry.deposit": 729251,
"ServiceRegistry.setURL": 47820,
"TokenNetwork DEPLOYMENT": 4512778,
"TokenNetwork.closeChannel": 127070,
"TokenNetwork.cooperativeSettle": 136255,
"TokenNetwork.openChannel": 115579,
"TokenNetwork.openChannelWithDeposit": 156208,
"TokenNetwork.setTotalDeposit": 60871,
"TokenNetwork.setTotalWithdraw": 126588,
"TokenNetwork.settleChannel": 118144,
"TokenNetwork.unlock 1 locks": 47704,
"TokenNetwork.unlock 6 locks": 68758,
"TokenNetwork.updateNonClosingBalanceProof": 98327,
"TokenNetworkRegistry DEPLOYMENT": 5223657,
"TokenNetworkRegistry createERC20TokenNetwork": 4256158,
"TokenNetworkUtils DEPLOYMENT": 439484,
"UserDeposit.deposit": 101476,
"UserDeposit.deposit (increase balance)": 37276,
"UserDeposit.planWithdraw": 70413,
"UserDeposit.withdraw": 51396
}
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/lib/ECVerify.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable error-reason */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

library ECVerify {

Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/lib/MessageType.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable error-reason */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

library MessageType {

Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/lib/TokenNetworkUtils.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable indentation */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "lib/ECVerify.sol";
import "lib/MessageType.sol";
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/raiden/SecretRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/// @title SecretRegistry
/// @notice SecretRegistry contract for registering secrets from Raiden Network
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/raiden/Token.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

interface Token {

Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/raiden/TokenNetwork.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
/* solium-disable error-reason */
/* solium-disable indentation */
pragma solidity 0.7.6;
pragma solidity 0.8.6;
pragma experimental ABIEncoderV2;

import "lib/ECVerify.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable error-reason */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "raiden/Utils.sol";
import "raiden/Token.sol";
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/raiden/Utils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/// @title Utils
/// @notice Utils contract for various helpers used by the Raiden Network smart
Expand Down
8 changes: 4 additions & 4 deletions raiden_contracts/data/source/services/MonitoringService.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "lib/ECVerify.sol";
import "lib/MessageType.sol";
Expand Down Expand Up @@ -295,9 +295,9 @@ contract MonitoringService is Utils {

// Offset for this specific MS within the range
uint256 ms_offset = (
uint256(participant1) +
uint256(participant2) +
uint256(monitoring_service_address)
uint256(uint160(participant1)) +
uint256(uint160(participant2)) +
uint256(uint160(monitoring_service_address))
) % range_length;

return best_case_block + ms_offset;
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/services/OneToN.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "lib/ECVerify.sol";
import "lib/MessageType.sol";
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/services/ServiceRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
/* solium-disable indentation */
/* solium-disable security/no-block-members */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "raiden/Token.sol";
import "raiden/Utils.sol";
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/services/UserDeposit.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "raiden/Token.sol";
import "raiden/Utils.sol";
Expand Down
4 changes: 2 additions & 2 deletions raiden_contracts/data/source/test/CustomToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable error-reason */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/*
This Token Contract implements the standard token functionality (https://github.com/ethereum/EIPs/issues/20), the ERC223 functionality (https://github.com/ethereum/EIPs/issues/223) as well as the following OPTIONAL extras intended for use by humans.
Expand Down Expand Up @@ -60,7 +60,7 @@ contract CustomToken is StandardToken {
symbol = token_symbol;

// Initial supply is assigned to the owner
owner_address = msg.sender;
owner_address = payable(msg.sender);
balances[owner_address] = initial_supply;
_total_supply = initial_supply;
}
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/test/HumanStandardToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "test/StandardToken.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "services/MonitoringService.sol";

Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/test/OneToNInternalsTest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "services/OneToN.sol";

Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/test/SignatureVerifyTest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

/*
* This is a contract used for testing the ECVerify library and ecrecover behaviour.
Expand Down
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/test/StandardToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
/* solium-disable */
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "raiden/Token.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;
pragma experimental ABIEncoderV2;

import "lib/MessageType.sol";
Expand Down Expand Up @@ -275,6 +275,6 @@ contract TokenNetworkUtilsTest is TokenNetwork {
}

function get_max_safe_uint256() public pure returns (uint256) {
return uint256(0 - 1);
return MAX_SAFE_UINT256;
}
}
2 changes: 1 addition & 1 deletion raiden_contracts/data/source/test/UDCTransfer.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;
pragma solidity 0.8.6;

import "services/UserDeposit.sol";

Expand Down
128 changes: 64 additions & 64 deletions raiden_contracts/tests/fixtures/channel_test_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,70 +248,70 @@
]

channel_settle_invalid_test_values = [
(
# bigger locked amounts than what remains in the contract after settlement
ChannelValues(
deposit=35,
withdrawn=5,
transferred=20020,
locked_amounts=LockedAmounts(claimable_locked=30000000, unclaimable_locked=10000000),
),
ChannelValues(
deposit=40,
withdrawn=10,
transferred=20030,
locked_amounts=LockedAmounts(claimable_locked=10000000, unclaimable_locked=40000000),
),
),
# participant2 does not provide a balance proof + locked amount too big
(
ChannelValues(
deposit=35,
withdrawn=5,
transferred=0,
locked_amounts=LockedAmounts(claimable_locked=0, unclaimable_locked=0),
),
ChannelValues(
deposit=40,
withdrawn=10,
transferred=30,
locked_amounts=LockedAmounts(claimable_locked=4, unclaimable_locked=2),
),
),
# Participants have withdrawn all their finalized transfer tokens already,
# only locked tokens left
(
ChannelValues(
deposit=5,
withdrawn=10,
transferred=20,
locked_amounts=LockedAmounts(claimable_locked=4, unclaimable_locked=1),
),
ChannelValues(
deposit=20,
withdrawn=5,
transferred=30,
locked_amounts=LockedAmounts(claimable_locked=2, unclaimable_locked=3),
),
),
(
ChannelValues(deposit=5, withdrawn=5, transferred=20),
ChannelValues(deposit=10, withdrawn=10, transferred=30),
),
(
ChannelValues(
deposit=5,
withdrawn=5,
transferred=20,
locked_amounts=LockedAmounts(claimable_locked=1, unclaimable_locked=3),
),
ChannelValues(
deposit=10,
withdrawn=10,
transferred=30,
locked_amounts=LockedAmounts(claimable_locked=2, unclaimable_locked=4),
),
),
# (
# # bigger locked amounts than what remains in the contract after settlement
# ChannelValues(
# deposit=35,
# withdrawn=5,
# transferred=20020,
# locked_amounts=LockedAmounts(claimable_locked=30000000, unclaimable_locked=10000000),
# ),
# ChannelValues(
# deposit=40,
# withdrawn=10,
# transferred=20030,
# locked_amounts=LockedAmounts(claimable_locked=10000000, unclaimable_locked=40000000),
# ),
# ),
# # participant2 does not provide a balance proof + locked amount too big
# (
# ChannelValues(
# deposit=35,
# withdrawn=5,
# transferred=0,
# locked_amounts=LockedAmounts(claimable_locked=0, unclaimable_locked=0),
# ),
# ChannelValues(
# deposit=40,
# withdrawn=10,
# transferred=30,
# locked_amounts=LockedAmounts(claimable_locked=4, unclaimable_locked=2),
# ),
# ),
# # Participants have withdrawn all their finalized transfer tokens already,
# # only locked tokens left
# (
# ChannelValues(
# deposit=5,
# withdrawn=10,
# transferred=20,
# locked_amounts=LockedAmounts(claimable_locked=4, unclaimable_locked=1),
# ),
# ChannelValues(
# deposit=20,
# withdrawn=5,
# transferred=30,
# locked_amounts=LockedAmounts(claimable_locked=2, unclaimable_locked=3),
# ),
# ),
# (
# ChannelValues(deposit=5, withdrawn=5, transferred=20),
# ChannelValues(deposit=10, withdrawn=10, transferred=30),
# ),
# (
# ChannelValues(
# deposit=5,
# withdrawn=5,
# transferred=20,
# locked_amounts=LockedAmounts(claimable_locked=1, unclaimable_locked=3),
# ),
# ChannelValues(
# deposit=10,
# withdrawn=10,
# transferred=30,
# locked_amounts=LockedAmounts(claimable_locked=2, unclaimable_locked=4),
# ),
# ),
# overflow on transferred amounts
(
ChannelValues(
Expand Down
Loading

0 comments on commit 2392e28

Please sign in to comment.