For some reason the my solidity compiler did not include many fields in the contract.json file. Most importantly I miss the data field. The first field I get is abi.
Here is my contract:
pragma solidity 0.8.9;
import "./HederaTokenService.sol";
import "./IHederaTokenService.sol";
import './MintAssociateTransferHTS.sol';
contract Crowdsale {
bool public icoCompleted;
uint256 public icoStartTime;
uint256 public icoEndTime;
int64 public tokenRate;
address public tokenAddress;
uint256 public fundingGoal;
address payable public owner;
MintAssoTransHTS public tokenService;
modifier whenIcoCompleted {
require(icoCompleted);
_;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
constructor(uint256 _icoStart, uint256 _icoEnd, int64 _tokenRate, address _tokenAddress, uint256 _fundingGoal) {
require(_icoStart != 0 &&
_icoEnd != 0 &&
_icoStart < _icoEnd &&
_tokenRate != 0 &&
_tokenAddress != address(0) &&
_fundingGoal != 0);
icoStartTime = _icoStart;
icoEndTime = _icoEnd;
tokenRate = _tokenRate;
tokenAddress = _tokenAddress;
fundingGoal = _fundingGoal;
owner = payable(msg.sender);
tokenService=new MintAssoTransHTS(tokenAddress);
}
fallback () external payable {
buy();
}
function buy() public payable {
int64 tokensToBuy;
tokensToBuy = int64(uint64(msg.value))*tokenRate;
tokenService.tokenTransfer(msg.sender,msg.sender,tokensToBuy);
}
receive() external payable whenIcoCompleted {
owner.transfer(address(this).balance);
}
}