In buyPolicy() we have 4 array params which are all compared if they are equal to each other except the _assets array.
Validate that all the arguments have the same length so you do not get unexpected errors if they don't.
function buyPolicy(
address[] memory _assets, //@audit this param is not checked against the others
address[] memory _protocols,
uint256[] memory _coverageAmount,
uint256[] memory _coverageDuration,
uint256 _policyPriceInUSDC,
uint256 _signedTime,
address _premiumCurrency,
bytes32 r,
bytes32 s,
uint8 v
) external payable whenNotPaused nonReentrant {
uint256 len = _protocols.length;
require(len > 0, "UnoRe: no policy");
require(len == _coverageAmount.length, "UnoRe: no match protocolIds with coverageAmount");
require(len == _coverageDuration.length, "UnoRe: no match protocolIds with coverageDuration");
In
buyPolicy()
we have 4 array params which are all compared if they are equal to each other except the_assets
array. Validate that all the arguments have the same length so you do not get unexpected errors if they don't.