pragma solidity ^0.8.0;
contract Contract1 {
struct User {
bool isValid;
uint value;
}
mapping(address => User) public party;
}
contract Contract2 {
Contract1 c1;
constructor (address addr) {
c1 = Contract1(addr);
}
modifier requireDeposit(address _eventAddress) {
(bool isValid,) = c1.party(_eventAddress);
require(isValid == true, "Not a valid user!");
_;
}
function updateField(address _eventAddress) public {
// I want to update the field value of _eventAddress.
c1.party(_eventAddress).value = 35;
}
}
I want updateField() function of Contract2 to update the value field of User struct from Contract1.