Skip to content

Fix contract vulnerabilities#3

Open
peterblockman wants to merge 7 commits intootcmarsbase:masterfrom
peterblockman:master
Open

Fix contract vulnerabilities#3
peterblockman wants to merge 7 commits intootcmarsbase:masterfrom
peterblockman:master

Conversation

@peterblockman
Copy link

@peterblockman peterblockman commented Apr 30, 2023

  1. To prevent loops external manipulation, limit the number of bids that can be created.
  2. Enhance the reentrancy guard in closeExpiredOffer and cancelOffer in MarsbaseExchange. Add MarsBaseExchangeAttackMock and security test
  3. Validate _nextOfferId in setNextOfferId to ensure that the nextOfferId won't overwrite the current active offer.
  4. Introduce maximumFee and perform safe-range validation for feeAlice and feeBob. Make SCALE a constant.
  5. Add receive() external payable {} to make MarsbaseExchange and MarsbaseBestBid being able to receive ETH
  6. Use fixed pragma version 0.8.19 which is the latest version
  7. Use prettier and solhint to format the code. Format .sol files: yarn prettier-sol, .js files: yarn prettier-js

peterblockman and others added 7 commits April 29, 2023 17:19
Introduce maxBidsCount in MarsbaseBestBid and MarsbaseMarketplace

Introduce maxMinimumOrderTokensLength in MarsbaseExchange

Add new unit tests
Add maximumFee and check if the sum of feeAlice and feeBob <= maximumFee

Add unit tests
…cancelOffer

Add MarsBaseExchangeAttackMock to test reentrancy attacks

Add receive function to MarsbaseExchange and MarsbaseBestBid to enable receiving ETH

Add new and modify current unit tests
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

Successfully merging this pull request may close these issues.

2 participants