Closed ainhoa-a closed 1 year ago
The FVM guarantees that this address will exist. Checking if it exists before calling is unnecessary and a waste of gas.
@Stebalien I know! But this was raised by the auditors!
Feel free to reject suggestions by the auditors. They're just that, notices and suggestions. In fact, they can even be dangerous (see https://github.com/Zondax/filecoin-solidity/issues/345).
Basically, auditors look for parts of your code that may be dangerous and/or may not behave as you intend. However, at the end of the day, you likely know much more about Filecoin, your code-base, and your users/product.
Please verify that CALL_ACTOR_ADDRESS or CALL_ACTOR_ID exist before applying delegatecall.
When a non-existing target address is passed to delegatecall it will return true even though the call was not performed.
The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.
Delegatecalls are used in utils/Actor.sol to perform callByAddress and callByID to invoke actors:
utils/Actor.sol
If CALL_ACTOR_ADDRESS or CALL_ACTOR_ID does not exist it will cause delegatecall to succeed. As a result of this, the API functions that does not expect any data to be returned will still succeed!
:link: zboto Link