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
  • stake
  • withdrawStake
  • withdrawRewards
  • getUserPendingReward

Was this helpful?

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

GovernanceStaking

This is the staking contract that allows citizens to stake G$ to get GOOD rewards.

Events

ReputationEarned

Emitted when staker earns an amount of GOOD tokens.

Parameter name
Annotation

staker

The staker address who earned reputation.

amount

The amount of reputation.

event ReputationEarned(address indexed staker, uint256 amount);

Staked

Emitted when staker stakes an amount of GoodDollars.

Parameter name
Annotation

staker

The staker address who earned reputation.

amount

The amount of stake.

event Staked(address indexed staker, uint256 amount);

StakeWithdraw

Emitted when staker withdraws an amount of staked GoodDollars.

Parameter name
Annotation

staker

The staker address who earned reputation.

amount

The amount of stake.

event StakeWithdraw(address indexed staker, uint256 amount);

stake

The function allows a staker to deposit Tokens. Notice that approve is needed to be executed before the execution of this method.

Parameter name
Annotation

_amount

The amount of G$ to stake.

Can be executed only when the contract is not paused.

function stake(uint256 _amount) external;

withdrawStake

The function withdraws the senders staked G$.

Parameter name
Annotation

_amount

The amount of G$ to withdraw.

Can be executed only when the contract is not paused.

function withdrawStake(uint256 _amount) external;

withdrawRewards

The function allows staker to withdraw their rewards without withdraw their stake.

Returns: amount of rewards that were sent to the msg.sender.

function withdrawRewards() public returns (uint256);

getUserPendingReward

The function allows to acquire the number of G$ rewards for a specific _user.

Parameter name
Annotation

_user

User to check the pending rewards.

Returns: an amount of G$ rewards for the user.

function getUserPendingReward(address _user) public view returns (uint256);
PreviousInvitesNextClaimersDistribution

Last updated 3 years ago

Was this helpful?