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
  • cloneAndInit
  • predictAddress

Was this helpful?

  1. About the Protocol
  2. Protocol V3 Documentation
  3. Core Contracts & API

CompoundStakingFactory

The staking contract that donates earned interest to the DAO.

The contract allow stakers to deposit Token (DAI) or withdraw their stake in Token (DAI) the contracts buy cToken (cDAI) and can transfer the daily interest to the DAO.

Events

Deployed

Emitted when new clone of the Compound staking contract was deployed.

Parameter name
Annotation

proxy

The ERC1167 clones factory.

cToken

The compound token which is accepted in the deployed staking contract clone.

impl

The amount of claimers claims.

event Deployed(address proxy, address cToken, address impl);

cloneAndInit

The function instantiates and initalizes an EIP 1167 proxy contract as minimal clone of the staking contract at public field impl.

Parameter name
Annotation

_cToken

The compound token to be used for staking in this contract.

_ns

The NameService contract address which holds all the necessary addresses.

_maxRewardThreshold

The amount of blocks that need to pass in order to user would get their rewards with 1x multiplier instead of 0.5x.

_tokenUsdOracle

The address of the TOKEN/USD oracle. (TOKEN is the underlying token of _cToken.)

_compUsdOracle

The address of the AAVE/USD oracle.

_tokenToDaiSwapPath

The UniswapV2 swap path from TOKEN to DAI. (TOKEN is the underlying token of _cToken.)

function cloneAndInit(
    address _cToken,
    address _ns,
    uint64 _maxRewardThreshold,
    address _tokenUsdOracle,
    address _compUsdOracle,
    address[] memory _tokenToDaiSwapPath
) public;

There is another overloaded version of the signature:

function cloneAndInit(
    address _impl,
    address _cToken,
    address _ns,
    uint64 _maxRewardThreshold,
    address _tokenUsdOracle,
    address _compUsdOracle,
    address[] memory _tokenToDaiSwapPath
) public;

Here you can specify the _impl of the clone proxy.

predictAddress

The function is to compute the address of the proxy clone of the staking contract to deploy.

Parameter name
Annotation

_impl

The imlementation of the staking contract.

cToken

First parameter of the constructor for _impl. (The compound token to stake.)

paramsHash

The keccak256 hash of remaining parameters of the constructor for _impl.

Returns: an address of the clone to be deployed.

function predictAddress(
    address _impl,
    address cToken,
    bytes32 paramsHash
) public view returns (address);
PreviousClaimersDistributionNextAaveStakingFactory

Last updated 2 years ago

Was this helpful?