code-423n4 / 2022-06-putty-findings

5 stars 0 forks source link

QA Report #235

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

QA

Functions never used internally should be declared external

1. File: PuttyV2.sol#L389

function exercise(Order memory order, uint256[] calldata floorAssetTokenIds) public payable {

Magic numbers should be declared as constants

[1. File: PuttyV2.sol#L287]()

 require(order.duration < 10_000 days, "Duration too long");

2. File: PuttyV2.sol#L499

feeAmount = (order.strike * fee) / 1000;

Functions setBaseURI() and setFee() can lock Ether in contract forever.

There is no way to remove Ether from this contract if accidentally sent to these functions.

1. File: PuttyV2.sol#L228-232

function setBaseURI(string memory _baseURI) public payable onlyOwner {
    baseURI = _baseURI;

    emit NewBaseURI(_baseURI);
}

2. File: PuttyV2.sol#L240

function setFee(uint256 _fee) public payable onlyOwner {
    require(_fee < 30, "fee must be less than 3%");

    fee = _fee;

    emit NewFee(_fee);
}