i use the solidity version pragma solidity 0.8.6;
i have a this struct :
struct Request {
string description;
uint256 value;
address recipient;
bool complete;
uint256 approvalCount;
mapping(address => bool) approvals;
}
and when I need to create instance for that struct it show me this error :
Struct containing a (nested) mapping cannot be constructed
Request memory newRequest = Request({
description: description,
value: value,
recipient: recipient,
complete: false,
approvalCount: 0
});
and it show me this error when I need to transfer :
request.recipient.transfer(request.value);
"send" and "transfer" are only available for objects of type "address payable", not "address".
whats the problem ? how can I solve this problem ?