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

Can declare __NFTXEligibility_init_bytes external to save gas #110

Closed
code423n4 opened this issue May 12, 2021 · 1 comment
Closed

Can declare __NFTXEligibility_init_bytes external to save gas #110

code423n4 opened this issue May 12, 2021 · 1 comment
Labels
bug Something isn't working Confirmed duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

Handle

shw

Vulnerability details

Impact

The function __NFTXEligibility_init_bytes in the contract NFTXEligibility can be declared external to save gas. Contracts that inherit NFTXEligibility and override __NFTXEligibility_init_bytes, i.e., the NFTX*Eligibility ones, can also be declared external. Please refer to the following links as details.

Proof of Concept

Referenced code:
NFTXEligibility.sol#L13
NFTXDeferEligibility.sol#L32-L37
NFTXListEligibility.sol#L28-L33
NFTXMintRequestEligibility.sol#L58-L68
NFTXRangeEligibility.sol#L44-L54
(NFTXUniqueEligibility.sol#L47-L57)[https://github.com/code-423n4/2021-05-nftx/blob/main/nftx-protocol-v2/contracts/solidity/eligibility/NFTXUniqueEligibility.sol#L47-L57]

Please refer to the files 500.js, 500-original.png, and 500-changed.png in the following link.
PoC: Link to PoC

Tools Used

None

Recommended Mitigation Steps

Change public to external and bytes memory to bytes calldata.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels May 12, 2021
code423n4 added a commit that referenced this issue May 12, 2021
@0xKiwi 0xKiwi added Confirmed duplicate This issue or pull request already exists labels May 21, 2021
@0xKiwi 0xKiwi closed this as completed May 21, 2021
@cemozerr
Copy link
Collaborator

Duplicate of #64

@cemozerr cemozerr marked this as a duplicate of #64 May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Confirmed duplicate This issue or pull request already exists G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

3 participants