raiden icon indicating copy to clipboard operation
raiden copied to clipboard

Make sure that proxies have checks for all `assert()` and `require()` in TokenNetworkRegistry

Open pirapira opened this issue 6 years ago • 9 comments

This is a part of #4763.

pirapira avatar Sep 09 '19 14:09 pirapira

The TokenNetworkRegistry version to go through is this: https://github.com/raiden-network/raiden-contracts/blob/7c1f1da47ae1b02c00f6388bb7be341c3fed3160/raiden_contracts/data/source/raiden/TokenNetworkRegistry.sol

pirapira avatar Sep 09 '19 14:09 pirapira

Does the client ever call the constructor of TokenNetworkRegistry? Asked https://ethereum.stackexchange.com/questions/74800/does-the-raiden-client-ever-deploy-tokennetworkregistry.

pirapira avatar Sep 09 '19 14:09 pirapira

createERC20TokenNetwork() has a modifier canCreateTokenNetwork.

https://github.com/raiden-network/raiden-contracts/blob/7c1f1da47ae1b02c00f6388bb7be341c3fed3160/raiden_contracts/data/source/raiden/TokenNetworkRegistry.sol#L76

Is this accounted in the proxy? No https://github.com/raiden-network/raiden/issues/4795

pirapira avatar Sep 09 '19 14:09 pirapira

Suspended till I understand the norm. https://github.com/raiden-network/raiden/issues/4828

pirapira avatar Sep 11 '19 11:09 pirapira

Also stuck on https://github.com/raiden-network/raiden/issues/4829

pirapira avatar Sep 11 '19 11:09 pirapira

Also stuck on https://github.com/raiden-network/raiden/issues/4830

pirapira avatar Sep 11 '19 11:09 pirapira

createERC20TokenNetwork() calls the constructor of TokenNetwork. The constructor has

  • [ ] a check that the token address is not zero https://github.com/raiden-network/raiden/issues/4875
  • [ ] a check that the secret registry address is not zero https://github.com/raiden-network/raiden/issues/4882
  • [ ] a check that the deprecation executor address is not zero https://github.com/raiden-network/raiden/issues/4884
  • [ ] a check that the chain_id is not zero #4886
  • [ ] a check that the settlement_timeout_min is not zero https://github.com/raiden-network/raiden/issues/4888
  • [ ] a check that the settlement_timeout_max is more than the settlement_timeout_min https://github.com/raiden-network/raiden/issues/4889
    • [x] why cannot they be equal? https://github.com/raiden-network/raiden-contracts/issues/1225
  • [ ] token address has nonempty code
  • [ ] secret registry address has nonempty code
  • [ ] channel_participant_deposit_limit is not zero
  • [ ] token_network_deposit_limit is not zero
  • [ ] token_network_deposit_limit is at least channel_participant_deposit_limit
  • [ ] token.total_supply is not zero

pirapira avatar Sep 13 '19 22:09 pirapira

I've unassigned myself because I have some bottleneck work in the smart contracts.

pirapira avatar Sep 24 '19 16:09 pirapira

Now that we have revert error messages, I would prefer to rely on the errors from the contract call in most cases rather then relying on correctly duplicating the logic.

karlb avatar Nov 18 '21 13:11 karlb