ERROR send and transfer are only available for objects of type address payable , not address

You need to mark the request.recipient as payable payable(request.recipient).transfer(request.value); From the docs page Solidity v0.8.0 Breaking Changes: The global variables tx.origin and msg.sender have the type address instead of address payable. One can convert them into address payable by using an explicit conversion, i.e., payable(tx.origin) or payable(msg.sender).

How to generate a random number in solidity?

Solidity contracts are deterministic. Anyone who figures out how your contract produces randomness can anticipate its results and use this information to exploit your application. One option is to produce randomness off-chain (where it cannot be predicted) and use it in your smart contract. Chainlink VRF is an easy-to-implement solution for using random data in … Read more

How can I return an array of struct in solidity?

As you mentioned, this is not yet supported in Solidity. The powers that be are planning on changing it so you can, but for now, you have to retrieve the number of elements and then retrieve the decomposed struct as a tuple. function getBidCount(bytes32 name) public constant returns (uint) { return highestBidder[name].length; } function getBid(bytes32 … Read more