Given the below code, can I use a variable defined in a modifier (ie _organization
), in my function? It's not compiling now but wondering if there is any way to do this?
modifier onlyCEOOrCOO {
Organization memory _organization = organizations[addressToOrgId[msg.sender]];
require(
msg.sender == _organization.cooAddress ||
msg.sender == _organization.ceoAddress
);
_;
}
function something () external onlyCEOOrCOO {
// is _organization available here?
// If I had used storage instead of memory can I update _organization here?
}