diff --git a/deployed/80001.json b/deployed/80001.json index 96a2736..aaeef7b 100644 --- a/deployed/80001.json +++ b/deployed/80001.json @@ -63,7 +63,7 @@ "address": "0x265A242Bcf4CFd9021A666B427e2d4dce2F5eF54" }, "RewardFacet": { - "address": "0x79a414D9778F5b2353943a9E6b6e3B3026ec932B", - "startBlock": 38765629 + "startBlock": 40828433, + "address": "0xaCC7A3782DFb20c0e08b58D3420662B9805D76AE" } } \ No newline at end of file diff --git a/src/facet/RewardsFacet.sol b/src/facet/RewardsFacet.sol index 258dc96..b3a06ab 100644 --- a/src/facet/RewardsFacet.sol +++ b/src/facet/RewardsFacet.sol @@ -9,6 +9,7 @@ import {Multicall} from "@solidstate/contracts/utils/Multicall.sol"; interface NFT { function mintTo(address to, string memory tokenURI) external; + function batchMintTo(address to, uint256 quantity, string memory baseURI) external; function transferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external returns (address); } @@ -27,7 +28,7 @@ bytes32 constant MINTER_ROLE = bytes32(uint256(1)); contract RewardsFacet is Multicall, SafeOwnable { event TokenMinted(address token, address to, uint256 amount, bytes32 id, string uri); event TokenTransferred(address token, address to, uint256 amount, bytes32 id, string uri); - event BadgeMinted(address token, address to, bytes32 id, string uri); + event BadgeMinted(address token, uint256 quantity, address to, bytes32 id, string uri); event BadgeTransferred(address token, address to, uint256 tokenId, bytes32 id, string uri); error RewardsFacet_NotAuthorized(); @@ -54,15 +55,20 @@ contract RewardsFacet is Multicall, SafeOwnable { emit TokenTransferred(_token, _to, _amount, _id, _uri); } - function mintERC721(address _token, address _to, string calldata _tokenURI, bytes32 _id, string calldata _uri) - public - { + function mintERC721( + address _token, + address _to, + uint256 _quantity, + string calldata _baseURI, + bytes32 _id, + string calldata _uri + ) public { if (!_canMint(_token)) { revert RewardsFacet_NotAuthorized(); } - NFT(_token).mintTo(_to, _tokenURI); - emit BadgeMinted(_token, _to, _id, _uri); + NFT(_token).batchMintTo(_to, _quantity, _baseURI); + emit BadgeMinted(_token, _quantity, _to, _id, _uri); } function transferERC721(