40,000 USDC
View results
Submission Details
Severity: medium

AT INITIALLY STATE NOT UPDATED BY THE BUYER IT IS MUST AND SHOULD UPDATED TO STATE IS CREATED

Summary

At firstly State not set to Created by the buyer when there is no state created not any Action perform so in constructor we need to update the stare as created.

Vulnerability Details

there is no initial state update in the contract without this con't perform any operations so we need to update it in the constructor it indicates that when the Escrow is created then State is Also Created.

Impact

Not perform any Actions without Any state is created. In all functions they checked that when the state is created then only perform Actions But buyer Con't initial it any where so they con't Perform any Actions

Tools Used

Manual Review

Recommendations

update the State value in constructor
constructor(
uint256 price,
IERC20 tokenContract,
address buyer,
address seller,
address arbiter,
uint256 arbiterFee
) {
if (address(tokenContract) == address(0)) revert Escrow__TokenZeroAddress();
if (buyer == address(0)) revert Escrow__BuyerZeroAddress();
if (seller == address(0)) revert Escrow__SellerZeroAddress();
if (arbiterFee >= price) revert Escrow__FeeExceedsPrice(price, arbiterFee);
if (tokenContract.balanceOf(address(this)) < price) revert Escrow__MustDeployWithTokenBalance();
i_price = price;
i_tokenContract = tokenContract;
i_buyer = buyer;
i_seller = seller;
i_arbiter = arbiter;
i_arbiterFee = arbiterFee;
++ s_state = State.Created;
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.