Giter Site home page Giter Site logo

loyalty-gifts-contracts's Introduction

Issues MIT License LinkedIn


Logo

Loyal: A Solidity Protocol for Web3 Customer Engagement Programs

Example Gift Contracts
Explore the docs »

View Demo of a dApp interacting with the protocol. · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

A fully open source solidity protocol for real-world customer engagment.

This repository provides a protocol for, and example implementations of, loyalty gift contracts: Contracts that exchange points for gifts or vouchers. These contracts interact with standard loyalty programs: ERC-1155 based contracts that mint (fungible) points and (non-fungible) loyalty cards.

If you have not checked out the loyalty programs repository, please do so first. See the repository at https://github.com/7Cedars/loyalty-program-contracts.

(back to top)

Example Gift Contracts

  • PointsForLoyaltyGifts.sol: Simple exchange of points for immediate gift.
  • PointsForLoyaltyVouchers.sol: Simple exchange of points for gift voucher.
  • TieredAccess.sol: provides 'gold', 'silver', 'bronze' vouchers for tiered access to gifts.
  • PointsForPseudoRaffle.sol: a pseudo random allocation of gifts and vouchers. Work in Progress.
  • PointsForRaffle.sol: A randomised raffle, using Chainling VRF. Coming soon.
  • FreeGiftFriday.sol: Gifts are only available on a certain day. Coming soon.
  • TransactionsForGifts.sol: Gifts on the basis of number of transactions over the last 7 and 14 days. Coming soon.
  • AuthorisedAllocation.sol: Have an external party distribute gifts at will. Coming soon.

Built With

(back to top)

Getting Started

To get a local copy up and running do the following.

Prerequisites

Install Foundry

$ curl -L https://foundry.paradigm.xyz | bash
$ foundryup

Clone the repository

  1. Get a free alchemy API Key at alchemy.com
  2. Clone the repo
 git clone https://github.com/7Cedars/loyalty-program-contracts.git
  1. Install packages
 yarn add

Run the test and build the contracts

  1. run tests
$ forge test
  1. and build
 $ forge build

Choose Loyalty Gift Contract and Deploy

 $ forge script --fork-url <RPC_URL> script/[HERE YOU SCRIPT].s.sol --broadcast

(back to top)

Usage

A front-end dApp demonstration of this web3 protocol has been deployed on vercel.com. Try it out at https://loyalty-program-psi.vercel.app/.

(back to top)

Roadmap

  • Code clean up and clarify structure.
  • Build more examples. At the moment only one exists.
  • Implement deploy scripts to multiple EVM compatible (test)nets

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Thank you!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Seven Cedars - @7__Cedars - [email protected]

GitHub profile https://github.com/7Cedars

(back to top)

Acknowledgments

  • This project was build while following PatrickCollins amazing Learn Solidity, Blockchain Development, & Smart Contracts Youtube course. Comes highly recommended for anyone wanting to get into Foundry & intermediate/advanced solidity coding.
  • I took the template for the readme file from Drew Othneil.
  • All the images for the gifts and vouchers were created with help from www.svgrepo.com. A fantastic repo with CC licensed art work. Specific links are included in all the images.
  • And a special thanks should go out to SpeedRunEthereum and LearnWeb3 for providing the first introductions to solidity coding.
  • The DateTime library was copy-pasted from https://github.com/RollaProject/solidity-datetime/blob/master/contracts/DateTime.sol
  • And the deploy scripts use Etherscan.io APIs.

(back to top)

loyalty-gifts-contracts's People

Contributors

7cedars avatar

Watchers

 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.