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

fix abi decode #1892

Merged
merged 1 commit into from
May 5, 2023
Merged

fix abi decode #1892

merged 1 commit into from
May 5, 2023

Conversation

daog1
Copy link
Contributor

@daog1 daog1 commented May 5, 2023

In the decode function of ethabi 4.0, there is validate_list_like_param, and the type can only be, isinstance(param, (list, tuple)), so an error will be reported when reading the key of the map.

validate_list_like_param fuction

def validate_list_like_param(param: Any, param_name: str) -> None:
    if not isinstance(param, (list, tuple)):
        raise TypeError(
            f"The `{param_name}` value type must be one of list or tuple. "
            f"Got {type(param)}"
        )
slot = keccak(encode([key_type, "uint256"], [key, decode("uint256", slot)]))
# changed to
slot = keccak(encode([key_type, "uint256"], [key, decode(["uint256"], slot)[0]]))

@daog1 daog1 requested a review from 0xalpharush as a code owner May 5, 2023 04:50
@CLAassistant
Copy link

CLAassistant commented May 5, 2023

CLA assistant check
All committers have signed the CLA.

@0xalpharush 0xalpharush changed the base branch from master to dev May 5, 2023 12:52
@0xalpharush
Copy link
Contributor

0xalpharush commented May 5, 2023

Thanks @daog1 ! We should follow up with a test so we don't miss these sort of breaking changes

@0xalpharush 0xalpharush merged commit 507795b into crytic:dev May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants