diff --git a/contracts/EvolveProxy.sol b/contracts/EvolveProxy.sol index 19e469f..b121f5a 100644 --- a/contracts/EvolveProxy.sol +++ b/contracts/EvolveProxy.sol @@ -58,6 +58,12 @@ contract EvolveProxy is Ownable, Initializable, HasSignature { tokenIds[0] > 0 && tokenIds[1] > 0, "EvolveProxy: hero to evolve and burn can not be 0" ); + + require( + tokenIds[0] != tokenIds[1], + "EvolveProxy: hero to evolve and burn can not be same" + ); + require( hero.ownerOf(tokenIds[0]) == msg.sender, "EvolveProxy: not owner of this hero now" @@ -97,6 +103,11 @@ contract EvolveProxy is Ownable, Initializable, HasSignature { "EvolveProxy: equip to evolve and burn can not be 0" ); + require( + tokenIds[0] != tokenIds[1], + "EvolveProxy: equip to evolve and burn can not be same" + ); + require( equip.ownerOf(tokenIds[0]) == msg.sender, "EvolveProxy: current address is not owner of this equip now" diff --git a/contracts/HasSignature.sol b/contracts/HasSignature.sol index 9bbd1cf..fd49534 100644 --- a/contracts/HasSignature.sol +++ b/contracts/HasSignature.sol @@ -92,7 +92,7 @@ contract HasSignature { address signer, bytes32 structHash, bytes memory signature - ) external view{ + ) public view{ bytes32 digest = _hashTypedDataV4(structHash); address recovered = ECDSA.recover(digest, signature); require(recovered == signer, "[BE] invalid signature"); @@ -103,7 +103,7 @@ contract HasSignature { address signer, bytes32 hash, bytes memory signature - ) external pure { + ) public pure { require(signature.length == 65, "[BE] invalid signature length"); bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash( hash