You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: