增加升级时的地址检查
This commit is contained in:
parent
de5eb4bca8
commit
a98b70b133
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user