The code is broken with the new upgrade v0.5, using Truffle v5.0.1 (core: 5.0.1)
struct Bidder {
address bidders_address;
uint productId;
uint bidValue;
}
struct Product {
uint productId;
uint bidStartPrice;
uint32 bidStartTime;
Bidder latestBid;
string productName;
bool isAvailable;
uint32 bidSession;
}
And mapping as
mapping(uint => Product) product;
removed the public getter venerability but still, the error is coming.
This is my full code :
pragma solidity >=0.4.21 <0.6.0;
import "./AucSters.sol";
import "../libraries/SafeMath.sol";
contract BiddingContract {
using SafeMath for uint;
address admin;
AucSters public tokenContract;
uint256 public tokenPrice;
uint256 public tokensSold;
//structs
struct Seller {
uint256 sellerId;
string sellerName;
bool isValidSeller;
}
struct Bidder {
address bidders_address;
uint productId;
uint bidValue;
}
struct Product {
uint productId;
uint bidStartPrice;
uint32 bidStartTime;
Bidder latestBid;
string productName;
bool isAvailable;
uint32 bidSession;
}
mapping(address => Seller) registeredSeller;
mapping(uint => address) public productIdToOwner;
mapping(address => uint) public productCount;
mapping(uint => Product) product;
mapping(address => mapping(uint => uint)) public latestBidStore;
//ARRAYS
address[] public regSellers;
Product[] public productsForSale;
address[] public bidders;
constructor(AucSters _tokenContract, uint _tokenPrice) public {
//Assign an admin
admin = msg.sender;
// token Contract
tokenContract = _tokenContract;
//Token price
tokenPrice = _tokenPrice;
}
}
public
from the declaration ofproduct
, I deleted all the lines that reference theAucSters
contract (which you didn't provide a definition for). I converted the safe math references to normal math operations. After that, the code compiled fine. – user19510 Jan 23 '19 at 3:24