开箱子时增加一些简单判断
This commit is contained in:
parent
a068fda5da
commit
a1984c873d
@ -73,11 +73,19 @@ contract MysteryBoxProxy is Ownable, Initializable, HasSignature {
|
||||
uint256 saltNonce,
|
||||
bytes calldata signature
|
||||
) external {
|
||||
require(
|
||||
ids.length == 3,
|
||||
"MysteryBoxProxy: amount of token id mismatch"
|
||||
);
|
||||
require(
|
||||
!usedSignatures[signature],
|
||||
"MysteryBoxProxy: signature used. please send another transaction with new signature"
|
||||
);
|
||||
address owner = msg.sender;
|
||||
require(
|
||||
box.ownerOf(boxId) == owner,
|
||||
"MysteryBoxProxy: only owner can open this box"
|
||||
);
|
||||
bytes32 criteriaMessageHash = getMessageHash(
|
||||
boxId,
|
||||
ids[0],
|
||||
@ -89,7 +97,7 @@ contract MysteryBoxProxy is Ownable, Initializable, HasSignature {
|
||||
// open box
|
||||
box.burn(owner, boxId);
|
||||
usedSignatures[signature] = true;
|
||||
|
||||
|
||||
uint256[3] memory results = [ids[0], 0, 0];
|
||||
uint8[3] memory types = [TYPE_HERO, TYPE_NONE, TYPE_NONE];
|
||||
mint721WithType(owner, ids[0], types[0]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user