Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GBL-Reputation #1

Open
falehenrique opened this issue Sep 15, 2018 · 1 comment
Open

GBL-Reputation #1

falehenrique opened this issue Sep 15, 2018 · 1 comment
Assignees
Labels

Comments

@falehenrique
Copy link
Contributor

falehenrique commented Sep 15, 2018

Author: Henrique Leite

Category: Smart Contract

Why

The objective in this proposal is a smart contract to control the reputation of collaborators in GoBlockchain.
The base of a trust is a reputation, because that were created intermediary to establish relationships of trust between people.
When people join a GoBlockchain to make projects or give class, they need to getting points through tasks as participate of creation projects, events, class, etc.

How:

contract Reputation {
    /**
    * contract address
    */
    PersonIdentity public personIdentity;
    /**
    * Profile by collaborators
    */
    enum TypeProfile{COLAB, AMBASSADOR, ESPECIALIST, ADVISOR}
    TypeProfile public typeProfile;

    /**
    * map with id profile and range of reputation
    */
    mapping (uint8 => Profile) mapProfile;

    /**
    * map with the colab address and your profile
    */
    mapping (address => ProfileColab) mapProfileColab;    

    /**
    * Range of reputation, ex:
    * 1 until 100 is a collaborator
    * 101 until 300 is a ambassador    
    */
    struct RangeReputation {
        uint64 start;
        uint64 end;
    }
    /**
    * Profile of collaborators
    */
    struct Profile {
        TypeProfile typeProfile;
        RangeReputation range;
        bool status;
    }

    /**
    * Colab profile with the total points
    */
    struct ProfileColab {
        address addresssColab;
        Profile profile;
        int points;
    }    
    
    /**
    * @dev setIdentityContract Add a address of indentity to check if a address is a collaborator.
    * @param address is the contract Identity
    */        
    function setIdentityContract(address _contractAddress) public;

    /**
    * @dev addReputation. Add a reputation with the range, ex: Ambassador = 100, 200
    * @param _type is the type of profile
    * @param _start the number of start range 
    * @param _end the number of end range 
    */    
    function addReputation(TypeProfile _type, uint64 _start, uint64 _end) public;

    /**
    * @dev removeReputation. Remove a reputation, change the status to false
    */    
    function removeReputation(TypeProfile _type) public;

    /**
    * @dev addPersonReputation. Add a reputation in a person
    * @TODO change the modifiers to a vote
    */       
    function addPersonReputation(address _addressColab, int8 _points);

    /**
    * @dev removePersonReputation. Remove a reputation of the person
    * @TODO change the modifiers to a vote
    */   
    function removePersonReputation(address _addressColab, int8 _points);
}

Date Created:

15/09/2018

Requires:

Link used to study:

https://github.com/pandoraboxchain/token-1329-hackathon/blob/master/contracts/reputation/ReputationIssuable.sol

@guisantos
Copy link

What if we change the TypeProfile to an array or some sort of structed data, so we can create different types of profiles.
Instead of being limited to "COLAB, AMBASSADOR, ESPECIALIST, ADVISOR" we can have some flexibility to create and setup new kinds of profiles when we need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants