// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract modifierWithArg {
struct employee {
uint emp_id;
string emp_name;
uint age;
}
employee e;
modifier isExperienced(uint exp) {
require(exp >= 5, “Must have a minimum of 5 years of experience”);
_;
}
function enterDetails(uint _empid, string memory _empname, uint _age) public isExperienced(2) {
e.emp_id = _empid;
e.emp_name = _empname;
e.age = _age;
}
}
Please follow and like us: