getCatAge function in kittyConnect contract returns the age of the cat as a block.timestamp if the token is not a valid token.
getCatAge function in kittyConnect contract returns the age of the cat as a block.timestamp if the token is not a valid token.
if tokenId is valid then function works as expected and returns the age of the cat.
paste this code in kittyTest.t.sol.
run this test using this command.
if tokenId is not a valid token, the function will return the age of the cat as block.timestamp and can create confusion.
Manual review
Here, we can add a require statement to check if the token exists or not before returning the age of the cat.
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.