ERC721ConsecutiveMock.sol 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../../token/ERC721/extensions/ERC721Consecutive.sol";
  4. import "../../token/ERC721/extensions/ERC721Enumerable.sol";
  5. import "../../token/ERC721/extensions/ERC721Pausable.sol";
  6. import "../../token/ERC721/extensions/draft-ERC721Votes.sol";
  7. /**
  8. * @title ERC721ConsecutiveMock
  9. */
  10. contract ERC721ConsecutiveMock is ERC721Consecutive, ERC721Pausable, ERC721Votes {
  11. constructor(
  12. string memory name,
  13. string memory symbol,
  14. address[] memory delegates,
  15. address[] memory receivers,
  16. uint96[] memory amounts
  17. ) ERC721(name, symbol) EIP712(name, "1") {
  18. for (uint256 i = 0; i < delegates.length; ++i) {
  19. _delegate(delegates[i], delegates[i]);
  20. }
  21. for (uint256 i = 0; i < receivers.length; ++i) {
  22. _mintConsecutive(receivers[i], amounts[i]);
  23. }
  24. }
  25. function _ownerOf(uint256 tokenId) internal view virtual override(ERC721, ERC721Consecutive) returns (address) {
  26. return super._ownerOf(tokenId);
  27. }
  28. function _mint(address to, uint256 tokenId) internal virtual override(ERC721, ERC721Consecutive) {
  29. super._mint(to, tokenId);
  30. }
  31. function _beforeTokenTransfer(
  32. address from,
  33. address to,
  34. uint256 firstTokenId,
  35. uint256 batchSize
  36. ) internal virtual override(ERC721, ERC721Pausable) {
  37. super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
  38. }
  39. function _afterTokenTransfer(
  40. address from,
  41. address to,
  42. uint256 firstTokenId,
  43. uint256 batchSize
  44. ) internal virtual override(ERC721, ERC721Votes, ERC721Consecutive) {
  45. super._afterTokenTransfer(from, to, firstTokenId, batchSize);
  46. }
  47. }
  48. contract ERC721ConsecutiveNoConstructorMintMock is ERC721Consecutive {
  49. constructor(string memory name, string memory symbol) ERC721(name, symbol) {
  50. _mint(msg.sender, 0);
  51. }
  52. }