consider this as an smart contract which check your eligiblity and i am creating multiple instances of the contract. require validation is done. but how can i make that minimum age value dynamic in the require statement. If user passed 30 age as minimum then in require error it should be "Minimum age should be 30 years". i dont want to hardcode that minimum age in reuqire, how can i achieve that?
contract checkMyEligibility {
uint requiredAge;
constructor(uint _requiredAge) {
requiredAge = _requiredAge;
}
function checkAge(uint _age) public view {
require(_age > requiredAge, "Minimum age should be 20 years");
/*
// like below line.
require(_age > requiredAge,"Minimum age should be ${requiredAge} years");
*/
}
}