在solid中未声明的标识符



我是新手。我从编译上面的代码得到了一个错误。"Udeclared identifer"

你能帮我这个忙吗?
function addNewRecord(
uint256 _clinicId,
uint256 _patientId,
string memory _condition,
string memory _description,
string memory _allergies,
string memory _document
) public onlyClinic {   --> error is here "onlyClinic"
require(patients[_patientId].id != 0, "The patient does not exist");
Record memory rec = Record(
recordId,
_hospitalId,
_patientId,
_condition,
_description,
_allergies,
_document
);
records[recordId] = rec;
patients[_patientId].records.push(recordId);
recordId++;
}

modifier onlyClinic() {
uint256 _id = clinicToId[msg.sender];
require(
_id != 0 && clinics[_id].id != 0,
"Only clinics are allowed"
);
_;
}

修饰符是写在函数之前还是之后?修饰符需要在函数之前创建

相关内容

  • 没有找到相关文章

最新更新