From 77ababc31925b6670c9130240a89424a63182900 Mon Sep 17 00:00:00 2001
From: "Jo Smith ( trinity )" <joanna@gmx.us>
Date: Sat, 14 Dec 2024 13:05:35 -0300
Subject: [PATCH] Create styling

Create Style for APP
---
 decentralized | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 decentralized

diff --git a/decentralized b/decentralized
new file mode 100644
index 000000000..62accc852
--- /dev/null
+++ b/decentralized
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.0;
+
+contract DecentralizedAlgorithm {
+    struct Algorithm {
+        string name;
+        string code; // Pseudocode or reference to the algorithm
+        uint256 votes;
+    }
+
+    Algorithm[] public algorithms;
+    mapping(address => uint256) public userVotes;
+
+    event AlgorithmAdded(string name, string code);
+    event Voted(address indexed user, uint256 algorithmId);
+
+    function addAlgorithm(string memory _name, string memory _code) public {
+        algorithms.push(Algorithm({
+            name: _name,
+            code: _code,
+            votes: 0
+        }));
+        emit AlgorithmAdded(_name, _code);
+    }
+
+    function vote(uint256 _algorithmId) public {
+        require(_algorithmId < algorithms.length, "Invalid algorithm ID");
+        require(userVotes[msg.sender] == 0, "User has already voted");
+
+        algorithms[_algorithmId].votes += 1;
+        userVotes[msg.sender] = _algorithmId;
+
+        emit Voted(msg.sender, _algorithmId);
+    }
+
+    function getAlgorithms() public view returns (Algorithm[] memory) {
+        return algorithms;
+    }
+}