From bee57f93d30b6b6c6a6599bdd0adbeaa5eedecd8 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 17 Oct 2023 12:34:03 +0100 Subject: [PATCH 1/2] All functions in RewardFacet now accept and emit an activityType --- src/facet/RewardsFacet.sol | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/facet/RewardsFacet.sol b/src/facet/RewardsFacet.sol index b3a06ab..96296c2 100644 --- a/src/facet/RewardsFacet.sol +++ b/src/facet/RewardsFacet.sol @@ -26,33 +26,40 @@ bytes32 constant ADMIN_ROLE = bytes32(uint256(0)); 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, uint256 quantity, address to, bytes32 id, string uri); - event BadgeTransferred(address token, address to, uint256 tokenId, bytes32 id, string uri); + event TokenMinted(address token, address to, uint256 amount, bytes32 id, bytes32 activityType, string uri); + event TokenTransferred(address token, address to, uint256 amount, bytes32 id, bytes32 activityType, string uri); + event BadgeMinted(address token, uint256 quantity, address to, bytes32 id, bytes32 activityType, string uri); + event BadgeTransferred(address token, address to, uint256 tokenId, bytes32 id, bytes32 activityType, string uri); error RewardsFacet_NotAuthorized(); error RewardsFacet_InsufficientBalance(); - function mintERC20(address _token, address _to, uint256 _amount, bytes32 _id, string calldata _uri) public { + function mintERC20( + address _token, + address _to, + uint256 _amount, + bytes32 _id, + bytes32 _activityType, + string calldata _uri + ) public { if (!_canMint(_token)) { revert RewardsFacet_NotAuthorized(); } Token(_token).mintTo(_to, _amount); - emit TokenMinted(_token, _to, _amount, _id, _uri); + emit TokenMinted(_token, _to, _amount, _id, _activityType, _uri); } function transferERC20( - address _holder, address _token, address _to, uint256 _amount, bytes32 _id, + bytes32 _activityType, string calldata _uri ) public { Token(_token).transferFrom(msg.sender, _to, _amount); - emit TokenTransferred(_token, _to, _amount, _id, _uri); + emit TokenTransferred(_token, _to, _amount, _id, _activityType, _uri); } function mintERC721( @@ -61,6 +68,7 @@ contract RewardsFacet is Multicall, SafeOwnable { uint256 _quantity, string calldata _baseURI, bytes32 _id, + bytes32 _activityType, string calldata _uri ) public { if (!_canMint(_token)) { @@ -68,19 +76,19 @@ contract RewardsFacet is Multicall, SafeOwnable { } NFT(_token).batchMintTo(_to, _quantity, _baseURI); - emit BadgeMinted(_token, _quantity, _to, _id, _uri); + emit BadgeMinted(_token, _quantity, _to, _id, _activityType, _uri); } function transferERC721( address _token, - address _holder, address _to, uint256 _tokenId, bytes32 _id, + bytes32 _activityType, string calldata _uri ) public { NFT(_token).transferFrom(msg.sender, _to, _tokenId); - emit BadgeTransferred(_token, _to, _tokenId, _id, _uri); + emit BadgeTransferred(_token, _to, _tokenId, _id, _activityType, _uri); } function _canMint(address _token) internal virtual returns (bool) { From 429f688e89af6b60abaf8856bbcc904f64049cb7 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 17 Oct 2023 12:38:56 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=80=20Deployment:=20Mumbai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployed/80001.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployed/80001.json b/deployed/80001.json index aaeef7b..259aefa 100644 --- a/deployed/80001.json +++ b/deployed/80001.json @@ -63,7 +63,7 @@ "address": "0x265A242Bcf4CFd9021A666B427e2d4dce2F5eF54" }, "RewardFacet": { - "startBlock": 40828433, - "address": "0xaCC7A3782DFb20c0e08b58D3420662B9805D76AE" + "startBlock": 41305071, + "address": "0x3866CCBb73B96c4eA2c60CD513691382c91fFfe4" } } \ No newline at end of file