diff --git a/contracts/chip1155/BEChipFactory.sol b/contracts/chip1155/BEChipFactory.sol index 432d86d..dd59f74 100644 --- a/contracts/chip1155/BEChipFactory.sol +++ b/contracts/chip1155/BEChipFactory.sol @@ -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,