修正一个碎片mint错误的bug
This commit is contained in:
parent
4bfcaa9c6c
commit
6575db4c44
@ -146,7 +146,7 @@ contract MinterFactory is Ownable, Initializable, HasSignature {
|
||||
ids.length == amounts.length,
|
||||
"MinterFactory: ids and amounts length mismatch"
|
||||
);
|
||||
mint1155NFTBatch(to, ids, amounts, chip);
|
||||
mint1155NFTBatch(to, ids, amounts, shard);
|
||||
}
|
||||
|
||||
function mint721ByUser(
|
||||
|
@ -36,9 +36,31 @@ contract UserMinterFactory is Ownable, Initializable {
|
||||
uint256 startTime,
|
||||
uint256 saltNonce,
|
||||
bytes calldata signature
|
||||
) external {
|
||||
) external returns (bool success){
|
||||
address to = _msgSender();
|
||||
factory.mint721ByUser(to, tokenId, startTime, saltNonce, signature, hero);
|
||||
try factory.mint721ByUser(to, tokenId, startTime, saltNonce, signature, hero) {
|
||||
return true;
|
||||
} catch Error(string memory reason) {
|
||||
bytes memory by;
|
||||
factory.ignoreSignature(signature);
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
by
|
||||
);
|
||||
return false;
|
||||
} catch (bytes memory lowLevelData) {
|
||||
string memory reason;
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
lowLevelData
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,9 +71,31 @@ contract UserMinterFactory is Ownable, Initializable {
|
||||
uint256 startTime,
|
||||
uint256 saltNonce,
|
||||
bytes calldata signature
|
||||
) external {
|
||||
) external returns (bool success){
|
||||
address to = _msgSender();
|
||||
factory.mint721ByUser(to, tokenId, startTime, saltNonce, signature, equip);
|
||||
try factory.mint721ByUser(to, tokenId, startTime, saltNonce, signature, equip) {
|
||||
return true;
|
||||
} catch Error(string memory reason) {
|
||||
bytes memory by;
|
||||
factory.ignoreSignature(signature);
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
by
|
||||
);
|
||||
return false;
|
||||
} catch (bytes memory lowLevelData) {
|
||||
string memory reason;
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
lowLevelData
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,9 +146,31 @@ contract UserMinterFactory is Ownable, Initializable {
|
||||
uint256 startTime,
|
||||
uint256 saltNonce,
|
||||
bytes calldata signature
|
||||
) external {
|
||||
) external returns (bool success){
|
||||
address to = _msgSender();
|
||||
factory.mint1155BatchByUser(to, ids, amounts, startTime, saltNonce, signature, shard);
|
||||
try factory.mint1155BatchByUser(to, ids, amounts, startTime, saltNonce, signature, shard) {
|
||||
return true;
|
||||
} catch Error(string memory reason) {
|
||||
bytes memory by;
|
||||
factory.ignoreSignature(signature);
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
by
|
||||
);
|
||||
return false;
|
||||
} catch (bytes memory lowLevelData) {
|
||||
string memory reason;
|
||||
emit TokenMintFail(
|
||||
to,
|
||||
signature,
|
||||
reason,
|
||||
lowLevelData
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user