Smart Contract Audit Report
Frank Inu is building a new marketplace for selling tokens and NFTs.
For this audit, we reviewed the project team's NFTSwap contract at commit 69b3b5b095906b43f128d06e1c03f58ea966ac8b on the team's GitHub repository.
Please ensure trust in the team prior to investing as they have some control in the ecosystem.
Date: April 13th, 2022.
Finding #1 - NFTSwap - HighDescription: There does not exist a function to withdraw funds from the contract.
Risk/Impact: Funds collected as fees will be stuck in the contract.
Recommendation: The team should implement a function that allows the owner to withdraw funds from the contract.
Resolution: The team has not yet addressed this issue.
Finding #2 - NFTSwap - InformationalDescription: The contract is implemented using Solidity v0.8.0 which is protected against overflow/underflow errors.
Recommendation: The SafeMath library can be removed for additional gas savings.
- This contract implements a marketplace for listing and buying NFTs and ERC20 tokens.
- Users can list any amount of NFTs or tokens for any price at any time.
- Listings have an associated expiry date that is provided at the time of listing.
- Users can remove their listing at any time before the expiry date.
- Users can buy active listings of tokens or NFTs for their listed price at any time.
- A fee is taken on every sale and stored in the contract.
- NFTs and tokens listed are kept by the lister until a buyer pays for them.
- When a user buys an NFT or token, the contract transfers it from the seller to the buyer.
- The contract must be given the allowance to transfer the listed NFT or tokens in order to sell them.
- In the event that the address receiving an NFT is a contract, the contract must have implemented the onERC721Received() or onERC1155Received() function in order to successfully receive the NFT.
- The Owner can set the fee amount to any value up to 99.99%.
- The contract utilizes reentrancy protection to prevent against reentrancy attacks in applicable functions.
- As the contract is implemented with Solidity v0.8.0, it is safe from any possible overflows/underflows.
|Arbitrary Jump/Storage Write||N/A||PASS|
|Centralization of Control||The Owner can set the fee amount to any value up to 99.99%.||WARNING|
|Delegate Call to Untrusted Contract||N/A||PASS|
|Dependence on Predictable Variables||N/A||PASS|
|Improper Authorization Scheme||N/A||PASS|
|Outdated Compiler Version||N/A||PASS|
|Overall Contract Safety||PASS|
($) = payable function # = non-constant function Int = Internal Ext = External Pub = Public + [Lib] SafeMath - [Int] tryAdd - [Int] trySub - [Int] tryMul - [Int] tryDiv - [Int] tryMod - [Int] add - [Int] sub - [Int] mul - [Int] div - [Int] mod - [Int] sub - [Int] div - [Int] mod + [Int] IPropertyValidator - [Ext] validateProperty + [Int] IERC20 - [Ext] totalSupply - [Ext] balanceOf - [Ext] decimals - [Ext] transfer # - [Ext] allowance - [Ext] approve # - [Ext] transferFrom # + [Lib] Orders - [Int] getTokenHash - [Int] getNFTListingHash - [Int] getTokenListingHash + Context - [Int] _msgSender - [Int] _msgData + Ownable (Context) - [Pub]
# - [Pub] owner - [Pub] renounceOwnership # - modifiers: onlyOwner - [Pub] transferOwnership # - modifiers: onlyOwner - [Int] _transferOwnership # + [Int] IERC721 - [Ext] safeTransferFrom # - [Ext] safeTransferFrom # - [Ext] approve # - [Ext] setApprovalForAll # - [Ext] balanceOf - [Ext] transferFrom # - [Ext] ownerOf - [Ext] getApproved - [Ext] isApprovedForAll + [Int] IERC1155 - [Ext] safeTransferFrom # - [Ext] safeBatchTransferFrom # - [Ext] setApprovalForAll # - [Ext] isApprovedForAll - [Ext] balanceOf - [Ext] balanceOfBatch + NFTSwap (Ownable) - [Pub] # - [Ext] ($) - [Ext] ($) - [Ext] getFee - [Ext] calculateNFTListingHash - [Ext] calculateTokenListingHash - [Ext] getAllTokenListings - [Ext] getNFTListing - [Ext] getTokenListing - [Prv] _takeFee - [Ext] createNFTSellOrder # - [Ext] cancelNFTSellOrder # - [Ext] cancelOTCSellOrder # - [Ext] createOTCSellOrder # - [Ext] setFee # - modifiers: onlyOwner - [Prv] _createOTCSellOrder # - [Ext] submitOTCBuyOrder ($) - modifiers: exchangeInProgress - [Prv] _submitOTCBuyOrder # - [Ext] submitNFTBuyOrder ($) - modifiers: exchangeInProgress - [Prv] _createNFTSellOrder # - [Prv] _submitNFTBuyOrder # - [Prv] _buy20 # - [Prv] _buy721 # - [Prv] _buy1155 #
About Solidity Finance
Solidity Finance was founded in 2020 and quickly grew to have one of the most experienced and well-equipped smart contract auditing teams in the industry. Our team has conducted 1000+ solidity smart contract audits covering all major project types and protocols, securing a total of over $50 billion U.S. dollars in on-chain value across 1500 projects!.
Our firm is well-reputed in the community and is trusted as a top smart contract auditing company for the review of solidity code, no matter how complex. Our team of experienced solidity smart contract auditors performs audits for tokens, NFTs, crowdsales, marketplaces, gambling games, financial protocols, and more!
Contact us today to get a free quote for a smart contract audit of your project!
What is a Solidity Audit?
Typically, a smart contract audit is a comprehensive review process designed to discover logical errors, security vulnerabilities, and optimization opportunities within code. A Solidity Audit takes this a step further by verifying economic logic to ensure the stability of smart contracts and highlighting privileged functionality to create a report that is easy to understand for developers and community members alike.
How Do I Interpret the Findings?
Each of our Findings will be labeled with a Severity level. We always recommend the team resolve High, Medium, and Low severity findings prior to deploying the code to the mainnet. Here is a breakdown on what each Severity level means for the project:
- High severity indicates that the issue puts a large number of users' funds at risk and has a high probability of exploitation, or the smart contract contains serious logical issues which can prevent the code from operating as intended.
- Medium severity issues are those which place at least some users' funds at risk and has a medium to high probability of exploitation.
- Low severity issues have a relatively minor risk association; these issues have a low probability of occurring or may have a minimal impact.
- Informational issues pose no immediate risk, but inform the project team of opportunities for gas optimizations and following smart contract security best practices.