Solidity 想struct 里面upId的属性值和burnId里面的属性值,相加之后的值赋给upId。提示错误说struct 不能运算:运算符+与类型struct不兼容。请问哪位帮忙解决一下这个问题,万分感谢!!请贴代码!万分感谢!
struct Prop{
uint16 power; //属性值
}
mapping(uint=>Prop) public props;
//升级
function upgrade(uint256 upId,uint256 burnId)public{
require(ownerOf(upId)==msg.sender,"player and upId not matched");
require(ownerOf(burnId)==msg.sender,"player and burnId not matched");
props[upId];
props[burnId];
Prop memory i;
i.power=props[upId]+ props[burnId];
props[upId]=i;
burn(burnId);
}