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

external-function #19

Open
code423n4 opened this issue Jun 14, 2021 · 3 comments
Open

external-function #19

code423n4 opened this issue Jun 14, 2021 · 3 comments

Comments

@code423n4
Copy link
Contributor

Handle

heiho1

Vulnerability details

Impact

RCMarket#tokenURI(uint256) is declared external in the IRCMarket interface but is declared public in the RCMarket implementation. This is inconsistent and affect the gas behavior of the function: https://gus-tavo-guim.medium.com/public-vs-external-functions-in-solidity-b46bcf0ba3ac

Proof of Concept

https://github.com/code-423n4/2021-06-realitycards/blob/86a816abb058cc0ed9b6f5c4a8ad146f22b8034c/contracts/interfaces/IRCMarket.sol#L27

https://github.com/code-423n4/2021-06-realitycards/blob/86a816abb058cc0ed9b6f5c4a8ad146f22b8034c/contracts/RCMarket.sol#L344

https://github.com/code-423n4/2021-06-realitycards/blob/86a816abb058cc0ed9b6f5c4a8ad146f22b8034c/contracts/RCMarket.sol#L344

Tools Used

Slither

Recommended Mitigation Steps

Mark the implementation method as external.

@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels Jun 14, 2021
code423n4 added a commit that referenced this issue Jun 14, 2021
@Splidge
Copy link
Collaborator

Splidge commented Jun 14, 2021

I believe this to only be a Gas optimization problem as suggested in the impact and so the severity should be reduced.

@Splidge
Copy link
Collaborator

Splidge commented Jun 21, 2021

fixed here

@dmvt
Copy link
Collaborator

dmvt commented Jul 10, 2021

I agree... I fail to see the risk and the warden has not provided reasoning for making this medium. Downgrading to G

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants