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

Add deposit limit to UserDeposit #585

Closed
pirapira opened this issue Feb 19, 2019 · 2 comments · Fixed by #678
Closed

Add deposit limit to UserDeposit #585

pirapira opened this issue Feb 19, 2019 · 2 comments · Fixed by #678
Milestone

Comments

@pirapira
Copy link
Contributor

This issue keeps track of adding a deposit limit to the UserDeposit. Until some concrete number is decided (https://github.com/raiden-network/team/issues/333), we can set up an arbitrary number (something like 12345678 looks temporary.)

@pirapira pirapira added this to the Ithaca milestone Feb 19, 2019
@pirapira
Copy link
Contributor Author

pirapira commented Mar 1, 2019

  • the limit should be configurable at the deployment time.

@pirapira
Copy link
Contributor Author

pirapira commented Mar 5, 2019

I have to choose how to keep track of the total balance of UserDeposit.

Options

Token balance of the contract when token.balanceOf(address(this)) is too big, new deposits are declined.

A storage variable a new storage variable whole_balance will be increased and decreased in deposit() and withdraw functions. When whole_balance is too big, new deposits are declined.


Comparison

  • Token balance of the contract can be manipulated by an attacker. An attacker can always send some amount of tokens to the contract, and stop all deposits.
  • A storage variable requires some careful coding.
    • but the amount of careful coding is small.

Conclusion

I'll maintain a storage variable.

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 a pull request may close this issue.

1 participant