Giter Club home page Giter Club logo

movelo's Introduction

Movelo leverages blockchain technology to incentivize eco-friendly commuting choices such as walking or biking. By participating in campaigns sponsored by local businesses, users can earn rewards for choosing greener transportation options. Our smart contract on the Ethereum blockchain automates the process of tracking and rewarding these eco-conscious decisions.

Smart Contract Functions

Below are the technical functions provided by the Movelo smart contract:

1. createSponsorship

  • Allows a business to sponsor a campaign encouraging people to visit their location.
  • Input parameters:
    • budget (uint256): The total budget allocated for the campaign.
    • name (string): The name of the campaign.
    • description (string): A description of the campaign.
    • imageURL (string): A URL to an image representing the campaign.
    • duration (uint256): The duration of the campaign in seconds.
    • ratePerMile (uint256): The rate paid per mile walked or biked.
    • allowedAddresses (address[]): (Optional) An array of addresses allowed to participate in the campaign.
    • locationLatitudes (uint256[]): An array of latitudes representing targeted locations.
    • locationLongitudes (uint256[]): An array of longitudes representing targeted locations.

2. payout

  • Allows a user to claim a payout after walking or biking to a sponsored location.
  • Input parameters:
    • miles (uint256): The number of miles walked or biked.
    • sponsorshipId (uint256): The ID of the sponsorship campaign.

3. awardBadge

  • Allows the contract owner to award badges to users.
  • Input parameters:
    • user (address): The address of the user to award the badge to.
    • imageURI (string): A URI to an image representing the badge.
    • description (string): A description of the badge.
    • sponsor (address): The address of the sponsor awarding the badge.

4. isAddressInList

  • A helper function to check if an address is in a given list of addresses.
  • Input parameters:
    • user (address): The address to check.
    • list (address[]): The list of addresses to check against.

5. campaignRunning

  • Checks if a campaign is still running.
  • Input parameters:
    • campaignId (uint256): The ID of the campaign to check.

6. withdrawUnspentFunds

  • Allows a sponsor to withdraw any unspent funds from a campaign after it has ended.
  • Input parameters:
    • sponsorshipId (uint256): The ID of the sponsorship campaign.

Events

  • SponsorshipCreated: Emitted when a new sponsorship campaign is created.
  • Payout: Emitted when a user claims a payout.
  • BadgeEarned: Emitted when a user earns a badge.
  • EmergencyStopActivated: Emitted when the contract owner activates the emergency stop feature.
  • EmergencyStopDeactivated: Emitted when the contract owner deactivates the emergency stop feature.

Modifiers

  • onlyOwner: Ensures that only the contract owner can call certain functions.

Constructor

  • The constructor initializes the contract with the address of the BadgeCreator contract.

Movelo’s smart contract provides a reliable and transparent way to motivate and reward eco-friendly commuting, making a positive impact on local communities and the environment.

movelo's People

Contributors

s-alad avatar cjcrafter avatar wjorgensen avatar onkr0d 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.