Is there a way to save the value of the public state variable highestBid
in Solidity using JavaScript? I'm currently getting an undefined
result and need help with this.
TS:
async getHighestBid() {
this.smartAuction.setProvider(this.provider);
let result = await this.smartAuction.deployed().
then(function(contract: { highestBid: { call: () => Promise<any>; }; }) {contract.highestBid.call().
then(function(v) {return v})});
console.log(result);
}
Sol:
contract SmartAuction {
address payable public beneficiary;
uint public auctionEnd;
address public highestBidder;
uint public highestBid;
mapping(address => uint) private pendingReturns;
bool private ended;
...
}