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

checkPccBurned logic is inverse of ensjs #88

Open
shrugs opened this issue Jan 9, 2025 · 0 comments
Open

checkPccBurned logic is inverse of ensjs #88

shrugs opened this issue Jan 9, 2025 · 0 comments

Comments

@shrugs
Copy link

shrugs commented Jan 9, 2025

the subgraph's definition of checkPccBurned is the inverse logic of that of ensjs — this tells me that the method is named incorrectly, though the indexing logic may be correct, still. it seems that the logic as written reads as "update expiry if PCC is SET", since the subgraph's checkPccBurned util return true if the PCC flag is enabled on the fuses.

for context, the subgraph's definition is this:

https://github.com/ensdomains/ens-subgraph/blob/master/src/nameWrapper.ts#L63C1-L65C2

function checkPccBurned(fuses: i32): boolean {
  return (fuses & PARENT_CANNOT_CONTROL) == PARENT_CANNOT_CONTROL;
}

and ensjs's is this

https://github.com/ensdomains/ensjs/blob/main/packages/ensjs/src/utils/fuses.ts#L384-L385

export const checkPccBurned = (fuses: bigint) =>
  (fuses & ParentFuses.PARENT_CANNOT_CONTROL) === 0n

if the indexing logic is correct i'd propose a rename of this function to isPccSet or refactoring to use ensjs's utility and invert its response to achieve the same indexing logic. if the indexing logic is incorrect because of this, i'd propose refactoring to use ensjs's utility and not inverting its response.

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

No branches or pull requests

1 participant