Der Code ist mit dem neuen Upgrade v0.5 unter Verwendung von Truffle v5.0.1 (Kern: 5.0.1) gebrochen
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;
}
Und Zuordnung als
mapping(uint => Product) product;
entfernt die öffentliche Getter-Ehrwürdigkeit, aber der Fehler kommt immer noch.
Dies ist mein vollständiger 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;
}
}
Ich habe das Problem gelöst!
Das Array deklariert productsForSale gibt auch standardmäßig einen Getter an, da es öffentlich ist, entfernen Sie es public
und es wird funktionieren
Product[] public productsForSale;
ersetzen Sie es durch
Product[] productsForSale;
struct
( Bidder
) enthält und der mit angeforderte "kostenlose" Getter public
dies nicht unterstützt.
Benutzer19510
CryptoScroller
Benutzer19510
public
aus der Erklärung von entferntproduct
, ich habe alle Zeilen gelöscht, die auf denAucSters
Vertrag verweisen (für den Sie keine Definition angegeben haben). Ich habe die sicheren mathematischen Referenzen in normale mathematische Operationen umgewandelt. Danach wurde der Code gut kompiliert.Benutzer19510
CryptoScroller
Benutzer19510
Benutzer19510
CryptoScroller