Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation switch for Bug Bounty release #275

Merged

Conversation

loredanacirstea
Copy link
Contributor

fixes #263

To be merged after #270

@LefterisJP
Copy link
Contributor

reviewing

administrator = _administrator;
}

function setSafetyDeprecationSwitch(bool status) onlyAdmin public {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more like a toggleSafetyDeprecationSwitch() function. Seems that it can toggle between true and false values for the switch. If we keep with this behaviour use toggle in the name.

But also from what I understood from our conversation we want this to be set only once and to not be settable again. Once it's deprecated that's a final action which should not be undoable.

Let's discuss this also offline.

}

/// @notice Deploy a new TokenNetwork contract for the Token deployed at
/// `_token_address`.
/// @param _token_address Ethereum address of an already deployed token, to
/// be used in the new TokenNetwork contract.
function createERC20TokenNetwork(address _token_address)
onlyAdmin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a different idea about how this should be done.
The idea would be to allow only one token network to exist instead of allowing only the administrator to deploy one.

The end result would indeed be the same but would at least agree with our limitations and give less power to the administrator.

})
assert token_network.functions.safety_deprecation_switch().call() is True

# Now we cannot deposit in existent channels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: /s/existent/existing both here and in the rest of the tests below

source ref

This is intended as a temporary safety measure for the Bug Bounty release:

- added `deprecation_executor` role to `TokenNetworkRegistry`
- only the `deprecation_executor` can create new `TokenNetwork` contracts
- the `deprecation_executor` is inherited by the `TokenNetwork` contract
- the `deprecation_executor` can switch off the `TokenNetwork`, stopping the creation of new channels and stopping new channel deposits
- added tests

- setting the deprecation switch + edge cases
- making sure channels cannot be opened and deposits cannot be made after the deprecation switch is set to `True`
@@ -16,11 +16,20 @@ contract TokenNetworkRegistry is Utils {
uint256 public settlement_timeout_min;
uint256 public settlement_timeout_max;

// Only for the limited Bug Bounty release
address public deprecation_executor;
bool public bug_bounty_token_network_created = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to token_network_created or if you want to include the release name use red_eyes.

@@ -16,11 +16,20 @@ contract TokenNetworkRegistry is Utils {
uint256 public settlement_timeout_min;
uint256 public settlement_timeout_max;

// Only for the limited Bug Bounty release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add red eyes here to make it clear for which release it is.

@loredanacirstea loredanacirstea merged commit 9b24c8e into raiden-network:master Sep 20, 2018
@loredanacirstea loredanacirstea deleted the deprecation-switch branch September 20, 2018 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the deprecation switch for Red Eyes
2 participants