1155芯片mint时增加验证
This commit is contained in:
parent
3ce7cd2de6
commit
c8c67ff227
@ -22,9 +22,14 @@ interface IMintableERC1155 is IERC1155 {
|
||||
) external;
|
||||
}
|
||||
|
||||
interface IBurnableERC721 is IERC721 {
|
||||
function burn(address owner, uint256 tokenId) external;
|
||||
}
|
||||
|
||||
|
||||
contract BEChipFactory is Ownable, Initializable, HasSignature {
|
||||
IMintableERC1155 public chip;
|
||||
IBurnableERC721 public chipOld;
|
||||
|
||||
address public executor;
|
||||
|
||||
@ -59,7 +64,8 @@ contract BEChipFactory is Ownable, Initializable, HasSignature {
|
||||
address to,
|
||||
uint256[] memory ids
|
||||
) external onlyOwner {
|
||||
require(to != address(0), "to address can not be zero");
|
||||
require(to != address(0), "BEChipFactory: to address can not be zero");
|
||||
require(ids.length > 0, "BEChipFactory: ids cannot be empty");
|
||||
uint256[] memory amounts = new uint256[](ids.length);
|
||||
uint256 len = ids.length;
|
||||
for (uint256 i = 0; i < len; ++i) {
|
||||
@ -74,6 +80,11 @@ contract BEChipFactory is Ownable, Initializable, HasSignature {
|
||||
uint256 saltNonce,
|
||||
bytes calldata signature
|
||||
) external{
|
||||
require(ids.length > 0, "BEChipFactory: ids cannot be empty");
|
||||
require(
|
||||
!usedSignatures[signature],
|
||||
"BEChipFactory: signature used. please send another transaction with new signature"
|
||||
);
|
||||
address to = _msgSender();
|
||||
bytes32 criteriaMessageHash = getMessageHash(
|
||||
to,
|
||||
|
Loading…
x
Reference in New Issue
Block a user