GoodDocs
  • Welcome to GoodDocs!
  • GoodDollar Ecosystem Vision
  • About the Protocol
    • Usage
    • Tokenomics
    • Sybil-Resistance
    • Protocol V3 Documentation
      • Architecture & Value Flow
      • System's Elements
      • Core Contracts & API
        • GoodDollar
        • GoodCompoundStaking V2 (DAI)
        • GoodAaveStaking V2 (USDC)
        • GoodReserveCDai
        • GoodFundManager
        • GoodMarketMaker
        • ContributionCalculation
        • UBIScheme
        • Identity
        • FirstClaimPool
        • AdminWallet
        • OneTimePayments
        • DonationsStaking
        • NameService
        • GReputation
        • CompoundVotingMachine
        • StakersDistribution
        • UniswapV2SwapHelper
        • Invites
        • GovernanceStaking
        • ClaimersDistribution
        • CompoundStakingFactory
        • AaveStakingFactory
        • ExchangeHelper
        • FuseFaucet
        • GoodDollarMintBurnWrapper
      • Previous Protocol Versions
        • Protocol V1
          • Architecture & Value Flow
          • Core Contracts & API
        • Protocol V2
          • Architecture & Value Flow
          • System's Elements
            • 1. The token (G$)
            • 2. The Reserve
            • 3. The Trust
            • 4. Staking rewards (APR)
            • 5. The Fund Manager
            • 6. The Distribution Contract (DisCo)
            • 7. Governance (DAO)
          • Core Contracts & API
            • GoodDollar
            • GoodCompoundStaking V2 (DAI)
            • GoodAaveStaking V2 (USDC)
            • GoodReserveCDai
            • GoodFundManager
            • GoodMarketMaker
            • ContributionCalculation
            • UBIScheme
            • Identity
            • FirstClaimPool
            • AdminWallet
            • OneTimePayments
            • DonationsStaking
            • NameService
            • GReputation
            • CompoundVotingMachine
            • StakersDistribution
            • UniswapV2SwapHelper
            • Invites
            • GovernanceStaking
            • ClaimersDistribution
            • CompoundStakingFactory
            • AaveStakingFactory
            • ExchangeHelper
            • FuseFaucet
  • User Guides
    • Buy & Sell G$
    • Stake to create UBI
    • Claim GOOD and G$X
    • Bridge GoodDollars
    • Connect another wallet address to identity
  • Liquidity
  • Wallet and Products
    • GoodWallet
    • GoodDapp
    • New GoodWallet
    • GoodCollective
    • GoodID & GoodOffers
    • 3rd Party Partners and Integrations
  • Frequently Asked Questions
    • Web3 basic knowledge and security tips - by Consensys
    • About GoodDollar
    • GoodDollar Protocol & G$ Token
    • Using GoodDollar
    • GoodDollar Community
    • Troubleshooting
  • For Developers
    • Contributing to GoodDollar
    • GoodDapp Developer Guides
      • Deploy your own GoodDapp UI
    • APIs & SDKs
      • Claim UBI
      • React Hooks Setup
      • Login With GoodDollar
      • Sybil Resistance
        • Identity (Ethers v5 / React)
        • Identity (Viem/Wagmi)
  • Useful Links
    • GoodDollar.org
    • GoodDapp
    • GoodWallet
    • GoodDollar User Guides
    • Statistics Dashboard
    • GoodDollar Whitepaper
    • GoodDollar Litepaper
    • GoodDollar Litepaper - Español
Powered by GitBook
On this page
  • Events
  • getChainBlocksPerMonth
  • setMonthlyReputationDistribution
  • userStaked
  • userWithdraw
  • claimReputation
  • getUserPendingRewards
  • getUserMintedAndPending

Was this helpful?

  1. About the Protocol
  2. Protocol V3 Documentation
  3. Previous Protocol Versions
  4. Protocol V2
  5. Core Contracts & API

StakersDistribution

Staking contracts will update this contract with staker token stake amount.

This contract will be able to mint GDAO. 2M GDAO that will be allocated between staking contracts each month pro-rate based on $ value staked. Each staker will receive his share pro rata per staking contract he participates in.

Events

ReputationEarned

Emitted when the staker claims the reputation.

Parameter name
Annotation

staker

The stakers address.

stakingContracts

The contracts for which the staker claims reputation.

reputation

Reputation token amount.

event ReputationEarned(
    address staker,
    address[] stakingContracts,
    uint256 reputation
);

getChainBlocksPerMonth

The function returns amount of blocks in month.

function getChainBlocksPerMonth() public pure override returns (uint256);

setMonthlyReputationDistribution

The function updates the monthly reputation distribution.

Parameter name
Annotation

newMonthlyReputationDistribution

The name of an address.

Can only be called by the Avatar.

function setMonthlyReputationDistribution(uint256 newMonthlyReputationDistribution) external;

userStaked

The staking contract can call this function to increase user current contribution.

Parameter name
Annotation

_staker

The user address to update.

_value

The value to increase by.

function userStaked(address _staker, uint256 _value) external;

userWithdraw

The staking contract can call this to decrease user current contribution.

Parameter name
Annotation

_staker

The user address to update.

_value

The value to decrease by.

function userWithdraw(address _staker, uint256 _value) external;

claimReputation

The function mints reputation to user according to his share in the different staking contracts.

Parameter name
Annotation

_staker

The user address to distribute reputation to.

_stakingContracts

The user to distribute reputation to.

function claimReputation(address _staker, address[] calldata _stakingContracts) external;

getUserPendingRewards

The function gets user reputation rewards accrued in GoodStaking contracts.

Parameter name
Annotation

_contracts

The list of contracts to check for rewards.

_user

The user to check rewards for.

Returns: reputation rewards pending amount for user.

function getUserPendingRewards(address[] memory _contracts, address _user) public view returns (uint256);

getUserMintedAndPending

The staking contract can call this to decrease user current contribution.

Parameter name
Annotation

_contracts

The staking contracts to sum _user minted and pending.

_user

The account to get rewards status for.

Returns: a tuple of two items: (minted, pending) in GDAO tokens in wei.

function getUserMintedAndPending(address[] memory _contracts, address _user) public view returns (uint256, uint256);
PreviousCompoundVotingMachineNextUniswapV2SwapHelper

Last updated 3 years ago

Was this helpful?