New answers tagged

0

It's because when the Auction contract reads the users; it only gets data types of array and not the names you have used in Resigtry contract. Understand it like this; uint => (address, int16, int8, uint, bool, int, address) So Auction contract can not lookup Address. Solution: You can use (address userAddress,,,,,,) = r.users(i); if(bid ==userAddress) { ...


0

Deep down, you don't interact with the mapping. The public modifier does several things, one of those things is generate a "free" view function. You would get the same effect by removing public and instead, explicitly writing a view function like this: function patient_db(uint index) public view returns(string memory name, string memory blood) { ...


0

You cannot create a mapping (or a struct containing a mapping) in memory. So, convert your code from this: contract Campaign { struct Request { string description; uint value; address recipient; bool complete; uint approvalCount; mapping(address => bool) approvals; } Request[] public requests; ...


0

Just an update - the v2 encoder is the default encoder from Solidity 0.8 and up (see docs), meaning that you have the ability to pass in structs by default. To summarize the details in the other answers here (and this answer) and docs, from 0.6 and up the v2 encoder was no longer considered experimental, and could be invoked using: pragma abicoderv2; For ...


Top 50 recent answers are included