-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# This check will never be true. | ||
it is called only by `_adjustVotingPower()` and it makes done checks for `address()` | ||
|
||
## Finding | ||
``` | ||
File: main/contracts/party/PartyGovernance.sol | ||
if (newDelegate == address(0) || oldDelegate == address(0)) { | ||
``` | ||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/party/PartyGovernance.sol#L931 | ||
|
||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/Crowdfund.sol#L464 | ||
|
||
# Check then update | ||
it better to update the state after the check is `CrowdfundLifecycle.Active` or not | ||
|
||
## Finding | ||
``` | ||
File: /main/contracts/crowdfund/Crowdfund.sol | ||
totalContributions += amount; | ||
``` | ||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/Crowdfund.sol#L411 | ||
|
||
# Invoke `finalize()` directly | ||
Is it better to invoke `finalize()` here? there is no need to wait for intel someone to invoke it directly | ||
|
||
## Finding | ||
``` | ||
File: /main/contracts/crowdfund/AuctionCrowdfund.sol | ||
if (market.isFinalized(auctionId_)) { | ||
revert AuctionFinalizedError(auctionId_); | ||
} | ||
// Only bid if we are not already the highest bidder. | ||
if (market.getCurrentHighestBidder(auctionId_) == address(this)) { | ||
revert AlreadyHighestBidderError(); | ||
} | ||
// Get the minimum necessary bid to be the highest bidder. | ||
uint96 bidAmount = market.getMinimumBid(auctionId_).safeCastUint256ToUint96(); | ||
// Make sure the bid is less than the maximum bid. | ||
if (bidAmount > maximumBid) { | ||
revert ExceedsMaximumBidError(bidAmount, maximumBid); | ||
} | ||
``` | ||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/AuctionCrowdfund.sol#L162-L164 | ||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/AuctionCrowdfund.sol#L172-L174 | ||
|
||
# A void creat failed `AuctionCrowdfund` | ||
after this check you need to check if the current bid is `curntBid > maximumBid` if there is no bidder yet you need to check The minimum price for the first bid, starting the auction `reservePrice > maximumBid` | ||
|
||
## Finding | ||
``` | ||
File: /main/contracts/crowdfund/AuctionCrowdfund.sol | ||
if (!market.auctionIdMatchesToken( | ||
opts.auctionId, | ||
address(opts.nftContract), | ||
opts.nftTokenId)) | ||
{ | ||
revert InvalidAuctionIdError(); | ||
} | ||
``` | ||
https://github.com/PartyDAO/party-contracts-c4/blob/main/contracts/crowdfund/AuctionCrowdfund.sol#L134-L140 |