CErc20Delegator
pads return value bytes
#39
Labels
quirk
This issue discloses a quirk in the protocol
CErc20Delegator
pads return value bytes
#39
When upgrading the cToken contracts between
cDAI
andcUSDT
, there was an attempt to shave some gas off the delegator contract, by inlining some assembly to perform delegate calls on the delegatee contract. However, the assembly inadvertently appends extra bytes to the ABI-encoded return value, which still decode properly in the EVM and other tools, but can lead to apparent issues for systems which use less robust ABI-decoding logic.There would be no harm in switching back to the
cDAI
version of theCErc20Delegator
contract. The extra bytes could also be trimmed with more assembly, though this also introduces new (obscure) code to be audited.The text was updated successfully, but these errors were encountered: