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

Confusing day limit mapping #17

Open
joshuahannan opened this issue Apr 25, 2018 · 1 comment
Open

Confusing day limit mapping #17

joshuahannan opened this issue Apr 25, 2018 · 1 comment

Comments

@joshuahannan
Copy link

WalletMainLib’s currentSpend mapping associates addresses to a uint256 array of length two. The address key corresponds to the address of an ERC20 token, or 0x0 if the “token” in question is ether. The first member of the array represents the day timestamp of the day whose expenditure is being accounted for, and the second member represents the amount of tokens spent on that day.
Even though this is well documented in the code, using an array of length two makes the code non declarative and difficult to understand. Despite the documentation being in place, it is only present in one place of the code and forces the programmer to remember this rather non trivial implementation. An example of this difficulty can be found in WalletMainLib, lines 209 and 210.

@joshuahannan
Copy link
Author

I don't think this is necessary to fix. The contract already abstracts this away

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

No branches or pull requests

1 participant