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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "./DeFiPlexGovernanceTokenContract.sol"; | |
import "./IDeFiPlexGovernanceContract.sol"; | |
/** | |
* @title DeFiPlexGovernanceContract | |
* @dev This contract manages governance proposals for DeFiPlex platform. |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
/** | |
* @title DeFiPlexGovernanceTokenContract | |
* @dev Implementation of a governance token allowing holders to vote on proposals. | |
*/ |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract PlexTokenERC20Contract is ERC20Burnable, Ownable { | |
uint256 private constant INITIAL_SUPPLY = 1000000 * 10 ** 18; // 1,000,000 tokens with 18 decimals | |
constructor(address initialOwner) ERC20("Plex Token", "PLEX") Ownable(initialOwner) { |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "./IDeFiPlexLendingPoolContract.sol"; | |
import "./IDeFiPlexGovernanceContract.sol"; | |
import "./IDeFiPlexStakingContract.sol"; |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "./IDeFiPlexStakingContract.sol"; | |
/** | |
* @title DeFiPlex Staking Contract |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "./IEventChainContract.sol"; | |
import "./IEventChainEventManagerContract.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
/** | |
* @title EventChainEventManagerContract | |
* @dev This contract manages the creation and organization of events. It allows event organizers |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "./IEventChainContract.sol"; | |
/** |
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
from airflow.utils.decorators import apply_defaults | |
import jwt | |
from operators.base_web3_custom_operator import BaseWeb3CustomOperator | |
from datetime import datetime, timedelta, timezone | |
class VerifyVoiceIdOperator(BaseWeb3CustomOperator): | |
""" | |
An operator to verify a user's voice ID using a Smart Contract on the Ethereum blockchain. | |
Inherits: |
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
from operators.base_custom_operator import BaseCustomOperator | |
from airflow.utils.decorators import apply_defaults | |
from qdrant_client import QdrantClient | |
class FindMostSimilarVoiceOperator(BaseCustomOperator): | |
""" | |
Custom Airflow operator to find the most similar voice based on audio embeddings. | |
This operator searches for the most similar voice in a given collection using audio embeddings | |
generated from an input audio file. It connects to a QDrant server to perform the search. |
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
from datetime import datetime | |
from airflow import DAG | |
import importlib | |
import os | |
# Define default arguments for the DAG | |
default_args = { | |
'owner': 'airflow', | |
'start_date': datetime(2023, 1, 1), | |
'retries': 1, |
NewerOlder