Ship function of LibShipping.sol doesn't work as expected.
Ship()
function uses getBeansFromPoints()
function:
getBeansFromPoints()
function is implemented as:
The problem is getBeansFromPoints()
function doesn't return anything and it just updates the input memory arrays. This does nothing as in the ship()
function, getBeansFromPoints(shipmentAmounts, shipmentPlans, totalPoints, remainingBeansToShip);
doesn't reference anything. Thus nothing gets updated in the ship()
function.
shipmentsAmounts[]
doesn't get updated and will be 0. Thus, the ship()
function won't work as expected and may revert which is a major problem as this is the only function to distribute beans across all active shipping routes.
Manual Analysis
Return shipmentAmounts memory
in getBeansFromPoints()
function and use that return value in ship()
function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.