Beanstalk
  • Agronomics Handbook
  • Farmers' Almanac
  • Whitepaper
  • Contract Addresses
  • 🌱Overview
    • Introduction
    • Development Ethos
    • EIP-2535 Diamond
    • App Storage
    • Internal Balances
  • 🌾Protocol
    • Overview
    • Louper
    • Sun
      • Season Facet
    • Silo
      • Silo Facet
      • BDV Facet
      • Whitelist Facet
      • Convert Facet
      • Convert Getters Facet
      • Enroot Facet
      • Approval Facet
      • Metadata Facet
      • Migration Facet
      • Legacy Claim Withdrawal Facet
    • Field
      • Field Facet
      • Fundraiser Facet
    • Barn
      • Fertilizer Facet
      • Unripe Facet
    • Market
      • Marketplace Facet
    • Farm
      • Farm Facet
      • Depot Facet
      • Token Facet
      • Token Support Facet
      • Curve Facet
    • Diamond
      • Diamond Cut Facet
      • Diamond Loupe Facet
      • Ownership Facet
      • Pause Facet
  • 📜Misc.
    • Technical Recordings
    • Upgrade History
    • FAQ
    • Terminology Discrepancies
Powered by GitBook
On this page
  • Call Functions
  • Fund
  • Create Fundraiser
  • View Functions
  • Remaining Funding
  • Total Funding
  • Funding Token
  • Fundraiser
  • Number Of Fundraisers
  • Events
  • Create Fundraiser
  • Fund Fundraiser
  • Complete Fundraiser
Edit on GitHub
Export as PDF
  1. Protocol
  2. Field

Fundraiser Facet

PreviousField FacetNextBarn

Last updated 7 months ago

Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.

The Fundraiser Facet dandles the creation, funding, and completion of .

Call Functions

function fund(
    uint32 id,
    uint256 amount,
    LibTransfer.From mode
) external payable nonReentrant returns (uint256);

Fund a Fundraiser in exchange for Pods.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

amount

uint256

Amount of fundraisers[id].token to provide.

mode

From

Return Type
Description

uint256

The number of Pods received.

function createFundraiser(
    address payee,
    address token,
    uint256 amount
) external payable;

Creates a Fundraiser. Can only be called by the owner of Beanstalk.

Parameter
Type
Description

payee

address

The address to which funds are delivered at the end of the Fundraiser.

token

address

The address of the token that can be sent to the Fundraiser in exchange for Pods.

amount

uint256

The amount of token that is being raised.

View Functions

function remainingFunding(uint32 id) public view returns (uint256);

Returns the remaining number of tokens to raise.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

Return Type
Description

uint256

The remaining number of tokens to raise.

function totalFunding(uint32 id) public view returns (uint256);

Returns the total amount of tokens raised so far.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

Return Type
Description

uint256

The total amount of tokens raised so far.

function fundingToken(uint32 id) public view returns (address);

Returns the address of the token that can be sent to the Fundraiser.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

Return Type
Description

address

The address of the token that can be sent to the Fundraiser.

function fundraiser(uint32 id)
    public
    view
    returns (Storage.Fundraiser memory);

Returns the Fundraiser struct.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

Return Type
Description

Fundraiser

function numberOfFundraisers() public view returns (uint32);

Returns the number of Fundraisers.

Return Type
Description

uint32

The number of Fundraisers.

Events

event CreateFundraiser(
    uint32 indexed id,
    address fundraiser,
    address token,
    uint256 amount
);

Emitted when a Fundraiser is created.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

fundraiser

address

The address to which funds are delivered.

token

address

The address of the token that can be sent to the Fundraiser in exchange for Pods.

amount

uint256

The amount of token that is being raised.

event FundFundraiser(
    address indexed account,
    uint32 indexed id,
    uint256 amount
);

Emitted when a Farmer calls fund.

Parameter
Type
Description

account

address

The address of the Farmer.

id

uint32

The Fundraiser ID.

amount

uint256

The amount of token that account provided.

event CompleteFundraiser(uint32 indexed id);

Emitted when a Fundraiser is fully funded.

Parameter
Type
Description

id

uint32

The Fundraiser ID.

Balance to spend tokens from; see .

Returns the Fundraiser struct in .

🌾
Fundraisers
Fund
Create Fundraiser
Remaining Funding
Total Funding
Funding Token
Fundraiser
Number Of Fundraisers
Create Fundraiser
Fund Fundraiser
Complete Fundraiser
LibTransfer.From
App Storage