Giter VIP home page Giter VIP logo

block-foundation / solidity-architecture-competition Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 96 KB

Solidity Smart Contract: Architecture Competition

Home Page: https://www.blockfoundation.io

License: Creative Commons Attribution Share Alike 4.0 International

Solidity 51.39% Dockerfile 0.27% JavaScript 5.09% TypeScript 43.25%
architecture block-foundation blockchain blockfoundation eth ethereum hardhat smart-contracts sol solidity

solidity-architecture-competition's Introduction

GitHub License devContainer


Block Foundation Logo

Decentralized Architectural Competition

Block Foundation Smart Contract Series [Solidity]


Block Foundation Brand

Contents



Report a Bug Request a Feature Ask a Question Make a Suggestion Start a Discussion

Welcome to the Decentralized Architectural Competition project, a smart contract that integrates the robustness of blockchain technology to administer an architectural design competition.

Introduction

The smart contract permits the handling of competition entries, voting, and the announcement of the victor. This underscores how conventional architectural competitions can be reformed by incorporating blockchain technology, thereby resulting in a system that offers unalterable, secure, and decentralized processes for both the administrators and contestants.

In this construct, participants interact with the smart contract to submit their architectural design, which also necessitates an entry fee payment, thereby establishing their effective registration in the contest. The blockchain stores all entries, thus assuring their immutable nature and transparency.

Voting is conducted via the smart contract as well, facilitating a transparent vote count for each submission. The system has been devised in such a manner that each participant is permitted a single vote, and voting is restricted after a predetermined deadline.

It further includes an automated reward distribution system. Upon reaching the voting deadline and after the vote count, the prize money, which is an accumulation of the entry fees, is automatically transferred to the winner's account. This mechanism ensures an immediate reward distribution system.

This project serves as a testament to how blockchain technology can be employed to transform multiple sectors, including architectural design. The fairness, transparency, and security of the system make it an intriguing development in the realm of architectural competitions. Such decentralized systems can foster global participation and unbiased outcomes.

Features

  • Immutable Entries: Each participant submits their design via the smart contract. The entries, stored on the blockchain, ensure immutability and transparency.
  • Transparent Voting: Voting happens through the smart contract. Each participant gets one vote and cannot vote post the pre-specified deadline.
  • Automatic Prize Distribution: Once the voting ends, the prize money, accumulated from the entry fees, is auto-transferred to the winner's account, ensuring swift and fair reward distribution.

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/yourGitHubUsername/DecentralizedArchitecturalCompetition.git
  1. Change into the project directory:
cd DecentralizedArchitecturalCompetition
  1. Install dependencies:
npm install

Deployment

  1. Compile the smart contract:
truffle compile
  1. Deploy the smart contract:
truffle migrate --network yourPreferredNetwork

Quick Start

Install

npm i

Compile

npm run compile

Contract

The contract is deployed by the organizer of the competition. The constructor sets the organizer and entry fee. A competitor can submit their entry using the submitEntry function. They have to send an amount equal to or greater than the entry fee. The organizer can select the winner using the selectWinner function. They can only do this before a winner has been declared and they have to provide a valid entry index. When the winner is selected, all the entry fees collected are transferred to the winner. This is a basic contract. If you need a more complex or specific functionality, please provide additional details.

The smart contract includes functionality for:

  • A voting mechanism where participants can vote on entries.
  • Restricting one vote per address.
  • Automatic distribution of prize money.
  • We'll also improve on a few security aspects. Let's continue using Solidity language for this:

In this contract:

  • A voteCount field to Entry, a hasVoted mapping to keep track of who has voted, and a votingDeadline to determine when voting ends.
  • A vote function that allows people to vote on entries. Each address can only vote once, and voting can only occur before the deadline.
  • A declareWinner function now declares the winner based on who has the most votes after the voting deadline has passed.
  • We emit an event when the winner is declared.
  • We also added two modifiers to check if the current time is before or after the voting deadline.
  • The winner is declared based on voting, rather than being chosen by the organizer.
  • All entry fees collected are transferred to the winner after they have been declared.

Please note that this is still a basic example and real-world contracts would likely need additional functionality, such as more complex voting mechanisms, additional security measures, handling of ties, and more. This code has not been audited and is not recommended for use in production without further modifications and testing.

Development Resources

Other Repositories

Block Foundation Smart Contract Series

Solidity Teal
Template >>> >>>
Architectural Design >>> >>>
Architecture Competition >>> >>>
Housing Cooporative >>> >>>
Land Registry >>> >>>
Real-Estate Crowdfunding >>> >>>
Rent-to-Own >>> >>>
Self-Owning Building >>> >>>
Smart Home >>> >>>

Colophon

Authors

This is an open-source project by the Block Foundation.

The Block Foundation mission is enabling architects to take back initiative and contribute in solving the mismatch in housing through blockchain technology. Therefore the Block Foundation seeks to unschackle the traditional constraints and construct middle ground between rent and the rigidity of traditional mortgages.

website: www.blockfoundation.io

Development Resources

Contributing

We'd love for you to contribute and to make this project even better than it is today! Please refer to the contribution guidelines for information.

Legal Information

Copyright

Copyright © 2023 Stichting Block Foundation. All Rights Reserved.

License

Except as otherwise noted, the content in this repository is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License, and code samples are licensed under the Apache 2.0 License.

Also see LICENSE and LICENSE-CODE.

Disclaimer

THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

solidity-architecture-competition's People

Contributors

vanvianen avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.