I'm trying to implement a simple card game. Actually, everything is working fine. Until I tried to move from 0.4.0 to 0.4.22. Any idea what is going wrong? Thanks a lot. And here the code:
pragma solidity ^0.4.22;
import "./InterfaceCardToDefense.sol";
contract CardToDefense is InterfaceCardToDefense{
mapping(int => mapping (int => int)) public AttackPosition2Defense;
mapping(int => string) public CardType2String;
mapping(int => string) public AttackType2String;
mapping(int => string) public Position2String;
function setAttackPositionToDefense(int attack, int position, int defense) public {
AttackPosition2Defense[attack][position] = defense;
}
function setCardType2String(int _id, string name) public {
CardType2String[_id] = name;
}
function setAttackType2String(int _id, string name) public {
AttackType2String[_id]= name;
}
function setPosition2String(int _id, string name) public {
Position2String[_id]= name;
}
}
PS: Getting this error message through truffle test. Right now even the original version doesn't work. Maybe it is unrelated to the pragma statement. Still a bit confusing
Deploying CardToDefense... ... 0x86f3f37d18cff4bcc9b91da5ce63c923eca5567243c52d84018d6f612f94db0d Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: The contract code couldn't be stored, please check your gas amount.
PPS: Just found out. If the interface is removed the contract can be deployed. Any Idea what that might be? Here is the interface:
contract InterfaceCardToDefense {
function AttackPosition2Defense(int, int) public returns(int);
}
I suspect that the interface is somehow wrong.