-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Automate the transfer of any ERC20 token rewarding - MEED-3206 - …
…Meeds-io/MIPs#118 (#3) This change will automate the transfer of any ERC20 token rewarding.
- Loading branch information
1 parent
4cd0070
commit 92bc140
Showing
15 changed files
with
310 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
gamification-evm-services/src/main/java/io/meeds/gamification/evm/plugin/EvmEventPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
package io.meeds.gamification.evm.plugin; | ||
|
||
import io.meeds.gamification.plugin.EventPlugin; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static io.meeds.gamification.evm.utils.Utils.*; | ||
|
||
public class EvmEventPlugin extends EventPlugin{ | ||
public static final String EVENT_TYPE = "evm"; | ||
|
||
@Override | ||
public String getEventType() { | ||
return EVENT_TYPE; | ||
} | ||
|
||
public List<String> getTriggers() { | ||
return List.of(HOLD_TOKEN_EVENT); | ||
} | ||
|
||
@Override | ||
public boolean isValidEvent(Map<String, String> eventProperties, String triggerDetails) { | ||
String desiredContractAddress = eventProperties.get(CONTRACT_ADDRESS); | ||
Map<String, String> triggerDetailsMop = stringToMap(triggerDetails); | ||
return desiredContractAddress != null && desiredContractAddress.equals(triggerDetailsMop.get(CONTRACT_ADDRESS)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
gamification-evm-webapp/src/main/resources/locale/addon/Gamification_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
gamification.event.title.holdtoken=EVM: Hold Token | ||
gamification.event.title.holdToken=EVM: Hold Token | ||
gamification.event.form.contractAddress=Contract address | ||
gamification.event.detail.invalidContractAddress.error=Please enter a valis contract address | ||
|
||
gamification.admin.evm.label.description=Listen to any smart contract transaction on Ethereum Virtual Machine blockchains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.