想两个NFT的属性值,相加之后的值赋给需要升级的NFT,再销毁另外一个nft。
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=需要升级的NFT属性值+需要销毁的NFT属性值;
props[upId]=i;
burn(burnId);
}
提示struct 数组不能运算,请问哪位大神知道怎么解决吗?先谢谢了!!