Coder Social home page Coder Social logo

Comments (11)

0xhiroshi avatar 0xhiroshi commented on July 28, 2024 1

https://github.com/LooksRare/contracts-infiltration/pull/150

from 2023-10-looksrare-judging.

mstpr avatar mstpr commented on July 28, 2024 1

Escalate

This issue is invalid. Agent ID is either 0 or already set a value. If the agent ID is 0 the OR here does the correct thing by setting the ID of the uninitialized agent. If the agent ID is already set then the or here does not have any impact.

Only use case
1- Say the agent ID in storage is 0 and we need to set it to 200

0 OR 200 = 200

Unnecessary assembly operation
2- Say the agent ID in storage is 60 and we need to set it to 60
60 or 60 = 60

this is unnecessary because lastAgentId is always equal to the last 16 bits of the agent ID. Doing an OR operation is unnecessary for the agent that already has initialized ID. As stated above, it only useful when the agentId is 0.

Regarding to this part:
lastAgentCurrentValue := and(lastAgentCurrentValue, not(AGENT__STATUS_OFFSET))
this part is completely unnecessary because we are 100% sure that the lastAgents status is indeed ACTIVE which is 00000000

you can comment this line in the code and run tests, nothing will change.

from 2023-10-looksrare-judging.

nevillehuang avatar nevillehuang commented on July 28, 2024 1

Agreed, suggestion to make this issue invalid since gas findings are not accepted based on sherlock rules.

from 2023-10-looksrare-judging.

sherlock-admin2 avatar sherlock-admin2 commented on July 28, 2024

Escalate

This issue is invalid. Agent ID is either 0 or already set a value. If the agent ID is 0 the OR here does the correct thing by setting the ID of the uninitialized agent. If the agent ID is already set then the or here does not have any impact.

Only use case
1- Say the agent ID in storage is 0 and we need to set it to 200

0 OR 200 = 200

Unnecessary assembly operation
2- Say the agent ID in storage is 60 and we need to set it to 60
60 or 60 = 60

this is unnecessary because lastAgentId is always equal to the last 16 bits of the agent ID. Doing an OR operation is unnecessary for the agent that already has initialized ID. As stated above, it only useful when the agentId is 0.

Regarding to this part:
lastAgentCurrentValue := and(lastAgentCurrentValue, not(AGENT__STATUS_OFFSET))
this part is completely unnecessary because we are 100% sure that the lastAgents status is indeed ACTIVE which is 00000000

you can comment this line in the code and run tests, nothing will change.

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

from 2023-10-looksrare-judging.

0xhiroshi avatar 0xhiroshi commented on July 28, 2024

https://github.com/LooksRare/contracts-infiltration/pull/175

from 2023-10-looksrare-judging.

nevillehuang avatar nevillehuang commented on July 28, 2024

Agree with escalation, seems like issue is invalid. Any thoughts @0xhiroshi given u implemented a fix?

from 2023-10-looksrare-judging.

0xhiroshi avatar 0xhiroshi commented on July 28, 2024

Agree with escalation, seems like issue is invalid. Any thoughts @0xhiroshi given u implemented a fix?

It is still an issue, but the severity should be lowered as it only wastes gas instead of breaking the game

from 2023-10-looksrare-judging.

Evert0x avatar Evert0x commented on July 28, 2024

Will accept escalation and make invalid as submitter agreed to low/invalid in DMs.

from 2023-10-looksrare-judging.

Czar102 avatar Czar102 commented on July 28, 2024

Result:
Low
Unique

Submitter agreed to low/invalid in DMs.

from 2023-10-looksrare-judging.

sherlock-admin2 avatar sherlock-admin2 commented on July 28, 2024

Escalations have been resolved successfully!

Escalation status:

from 2023-10-looksrare-judging.

SergeKireev avatar SergeKireev commented on July 28, 2024

Fix LGTM

from 2023-10-looksrare-judging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.