_heartbeat
parameter in the requestMintWeatherNFT()
The requestMintWeatherNFT()
function allows users to specify a _heartbeat
parameter, which dictates the minimum time interval (in seconds) between automated weather updates for the minted NFT via Chainlink Keepers (Automation). This parameter is intended to control the frequency and associated costs of keeping the NFT's weather data fresh. However, there are no validation checks on the _heartbeat
value provided by the user. This absence of restrictions allows users to set arbitrarily low or high values, leading to potential issues for both the protocol's operational costs and the utility of the minted NFTs.
Likelihood: High
The _heartbeat
parameter is a direct input from the user in the requestMintWeatherNFT
function, which can be set to any arbitrary uint256
value.
The contract's logic lacks any require
statements or other validation mechanisms to enforce a reasonable or safe range for the _heartbeat
parameter.
Impact: High
Excessive LINK Drain / Denial of Service: Setting _heartbeat
to a very low value (e.g., 1 second) or zero would cause the NFT to be almost continuously eligible for updates. Each performUpkeep
call triggers a Chainlink Functions request, consuming LINK from the contract's subscription. This can quickly deplete the contract owner's LINK funds, leading to a denial of service for all NFTs that rely on automated updates.
Stale Data / Reduced Utility: Setting _heartbeat
to an impractically high value (e.g., type(uint256).max
or many years) would result in the NFT's weather data rarely, if ever, being updated automatically. This significantly reduces the utility and accuracy of the "live weather" feature of the NFT, diminishing its value proposition for users.
Implement explicit require
statements in the requestMintWeatherNFT()
function to enforce a sensible minimum and maximum value for the _heartbeat
parameter. This prevents users from setting values that could either exhaust contract funds or render the NFT's dynamic feature useless.
This is informational. It is user's responsibility to provide correct input arguments. If the user provides incorrect arguments, it will lead to incorrect results, lost funds or failed transaction.
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.