Update balanceOf function documentation#1521
Update balanceOf function documentation#1521red-swan wants to merge 1 commit intoVectorized:mainfrom
Conversation
Clarify behavior of balanceOf function regarding token existence and execution.
|
Long term, the best option would be to rename the function. When But agree in the short term this comment is a good addition. |
|
@Schereo , I'm johnny-come-lately here. Without any evidence to support my gut here, I thought the whole idea with SafeTransferLib was to have an optimized version of the Solmate SafeTransferLib but maybe weaken some assumptions here and there to achieve it. If parity with that interface is the goal, I think you're stuck with the names they choose, no? |
|
@red-swan Without knowing the full reasoning behind the naming, I do not think it is related to Solmate's interface. The latest Solmate |
Description
Clarify behavior of balanceOf function regarding token existence and execution. Currently it only describes returning zero if the token called does not exist but that is misleading for developers because it will also return zero if the address reverts during its execution or if the address returns less than 32 bytes. This PR adds those to the description of the function.
Checklist
Ensure you completed all of the steps below before submitting your pull request:
forge fmt?forge test?Pull requests with an incomplete checklist will be thrown out.