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

CErc20Delegator pads return value bytes #39

Open
jflatow opened this issue Jul 14, 2020 · 0 comments
Open

CErc20Delegator pads return value bytes #39

jflatow opened this issue Jul 14, 2020 · 0 comments
Labels
quirk This issue discloses a quirk in the protocol

Comments

@jflatow
Copy link
Contributor

jflatow commented Jul 14, 2020

When upgrading the cToken contracts between cDAI and cUSDT, 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 the CErc20Delegator contract. The extra bytes could also be trimmed with more assembly, though this also introduces new (obscure) code to be audited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quirk This issue discloses a quirk in the protocol
Projects
None yet
Development

No branches or pull requests

1 participant