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

Solsig indexed #75

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Solsig indexed #75

merged 3 commits into from
Aug 27, 2024

Conversation

peterbroadhurst
Copy link
Contributor

After all the work in #71, I ended up missing one of the most important distinguishing things the feature was meant to help with 🤦

The ABI signature of an event is identical for ERC-20/ERC-721, but some of the fields are indexed. I'd missed including that.

In PR chain with #73

Signed-off-by: Peter Broadhurst <[email protected]>
Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments

pkg/abi/abi.go Outdated Show resolved Hide resolved
@@ -66,7 +66,7 @@ type TypeComponent interface {
DecodeABIData(d []byte, offset int) (*ComponentValue, error)
DecodeABIDataCtx(ctx context.Context, d []byte, offest int) (*ComponentValue, error)

SolidityParamDef(inFunction bool) (solDef string, structDefs []string) // gives a string that can be used to define this param in solidity
SolidityParamDef(isFunction, isEvent bool) (solDef string, structDefs []string) // gives a string that can be used to define this param in solidity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand they are mutuality exclusive, feels like this should be an enum as it's either one or the other

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok - moving interface to enum and refactoring

if isRef && inFunction {
paramDef = fmt.Sprintf("%s memory", paramDef)
if isRef && isFunction {
paramDef += " memory"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change from sprintF to +=?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just felt more readable

Signed-off-by: Peter Broadhurst <[email protected]>
Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for making those changes @peterbroadhurst , looks a lot nearer to me now!

@EnriqueL8 EnriqueL8 merged commit e43c6db into main Aug 27, 2024
2 checks passed
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.

2 participants