code-423n4 / 2022-07-fractional-findings

0 stars 0 forks source link

QA Report #620

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
  1. missing indexed

1) File : uint256 _amount

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/interfaces/IBuyout.sol#L65

2) File : uint256 _amount

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/interfaces/IBuyout.sol#L69

3) File : address _vault

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/interfaces/IBuyout.sol#L74

  1. Actual code was not the same as comment

since fractionDeposit was not declared in the code as well the code was used depositAmount , so it can be changed instead.

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Buyout.sol#L25

/// - buyoutPrice = (ethDeposit * 100) / (100 - ((fractionDeposit * 100) / totalSupply))

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Buyout.sol#L86-L87

        uint256 buyoutPrice = (msg.value * 100) /
            (100 - ((depositAmount * 100) / totalSupply));
  1. Unnecessary Comment

This can be deleted instead since it was unnecessary to the code

1.) Vault.sol Line.37

    // prettier-ignore
  1. Instead of using number it can be set as constant

1)

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/FERC1155.sol#L247

        royaltyAmount = (_salePrice * royaltyPercent[_id]) / 100;

2)

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Buyout.sol#L86-L87

        uint256 buyoutPrice = (msg.value * 100) /
            (100 - ((depositAmount * 100) / totalSupply));

3)

https://github.com/code-423n4/2022-07-fractional/blob/e2c5a962a94106f9495eb96769d7f60f7d5b14c9/src/modules/Buyout.sol#L209-L211

            (tokenBalance * 1000) /
                IVaultRegistry(registry).totalSupply(_vault) >
            500