Skip to content

Latest commit

 

History

History
210 lines (152 loc) · 7.57 KB

README.md

File metadata and controls

210 lines (152 loc) · 7.57 KB

Contributors Forks Stargazers Issues


SocialCredits

A semi-soulbound ERC20 token to be distributed to incentivized participants.

Report Bug · Request Feature

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

About The Project

This is a simple ERC20 contract purpose built to allow for programmatic distribution of a semi-soulbound incentive token. The contract utilizes OwnableRoles to allow multi-party management of the token, be it programmatic or manual. The design is intended to reduce friction when utilized within DAOs or similar structures. Each address that receives a mint allocation can use it to distribute tokens however that address desires or is programmed to do. Allocations can only be reduced to what has been issued so far, there is no over or undersubscription when it comes to mint allocations.

(back to top)

Built With

  • Ethereum
  • Solidity

(back to top)

Getting Started

SocialCredits was designed using Foundry, so I recommend familiarizing yourself with that if required.

Prerequisites

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

Installation

  1. Set up your ERC20 project using Foundry
    forge init ProjectName
  2. Install SocialCredits
    forge install zodomo/SocialCredits --no-commit
  3. Import SocialCredits
    Add the following above the beginning of your project's primary contract
    import "../lib/SocialCredits/src/SocialCredits.sol";
  4. Inherit the module
    Add the following to the contract declaration
    contract ProjectName is SocialCredits {}
  5. Populate constructor arguments
    Add the following parameters and declaration to your constructor
    constructor(
       string memory name_,
       string memory symbol_,
       uint256 _maxSupply,
       address _owner
    ) SocialCredits(name_, symbol_, _maxSupply, _owner) {}

(back to top)

Usage

Once deployed, the owner can fully operate the contract. If they wish to delegate permissions to other addresses, they can do so with the grantRoles(address, uint256) function.

The function allocate(address, uint256) is used to allow EOAs or contracts to call mint(address, uint256) up to the allocation specified.

setLockExemptSender(uint256) and setLockExemptRecipient(uint256) are important for allowing DEXes to function and platform contracts to manipulate tokens. Uniswap router and pair need to be exempted as sender to allow for liquidity removal and buys, and platform contracts must be exempted as recipients in order to enable users to send them to platform contracts which can then send the tokens if they have sender exemptions too. Keep in mind, these exemptions are bypassing the transfer lock, so exempting the pair as a recipient allows sells to occur during the lock as well.

If tokens need to be burned without reducing the max supply, have the minter call forfeit(address,uint256) instead of burn(address,uint256). The forfeit() function returns the tokens to the minter's allocation. Use of burn(address,uint256) will reduce max supply!

(back to top)

Contributing

Contributions are what 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". Don't forget to give the project a star! Thanks again!

  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 AGPL-3 License. See LICENSE.txt for more information.

(back to top)

Contact

Zodomo - @0xZodomo - [email protected] - Zodomo.eth

Project Link: https://github.com/Zodomo/SocialCredits

(back to top)

Acknowledgments

(back to top)