Field Facet

The Field Facet is where Beans are Sown.

Call Functions

function sow(
    uint256 beans,
    uint256 minTemperature,
    LibTransfer.From mode
)
    external
    payable
    returns (uint256 pods);

Sow Beans in exchange for Pods.

ParameterTypeDescription

beans

uint256

The number of Beans to Sow.

minTemperature

uint256

The minimum Temperature at which to Sow.

mode

From

The balance to transfer Beans from; see LibTransfer.From.

Return ValueTypeDescription

pods

uint256

The number of Pods received.

function sowWithMin(
    uint256 beans,
    uint256 minTemperature,
    uint256 minSoil,
    LibTransfer.From mode
) public payable returns (uint256 pods);

Sow Beans in exchange for Pods. Use at least minSoil.

ParameterTypeDescription

beans

uint256

The number of Beans to Sow.

minTemperature

uint256

The minimum Temperature at which to Sow.

minSoil

uint256

The minimum amount of Soil to use; reverts if there is less than this much Soil available upon execution.

mode

From

The balance to transfer Beans from; see LibTransfer.From.

Return ValueTypeDescription

pods

uint256

The number of Pods received.

function harvest(uint256[] calldata plots, LibTransfer.To mode)
    external
    payable;

Harvest Pods from the Field.

ParameterTypeDescription

plots

uint256[]

List of Plot IDs to Harvest.

mode

To

The balance to transfer Beans to; see LibTransfer.To.

View Functions

function podIndex() public view returns (uint256);

Returns the total number of Pods ever minted.

Return TypeDescription

uint256

The total number of Pods ever minted.

function harvestableIndex() public view returns (uint256);

Returns the index below which Pods are Harvestable.

Return TypeDescription

uint256

The index below which Pods are Harvestable.

function totalPods() public view returns (uint256);

Returns the number of outstanding Pods. Includes Pods that are currently Harvestable but have not yet been Harvested.

Return TypeDescription

uint256

The number of outstanding Pods.

function totalHarvested() public view returns (uint256);

Returns the number of Pods that have ever been Harvested.

Return TypeDescription

uint256

The number of Pods that have ever been Harvested.

function totalHarvestable() public view returns (uint256);

Returns the number of Pods that are currently Harvestable but have not yet been Harvested.

Return TypeDescription

uint256

The number of Pods that are currently Harvestable but have not yet been Harvested.

function totalUnharvestable() public view returns (uint256);

Returns the number of Pods that are not yet Harvestable.

Return TypeDescription

uint256

The number of Pods that are not yet Harvestable.

function plot(address account, uint256 index)
    public
    view
    returns (uint256);

Returns the number of Pods remaining in a Plot.

ParameterTypeDescription

account

address

The account that owns a Plot.

index

uint256

The ID of a Plot.

Return TypeDescription

uint256

The number of Pods remaining in a Plot.

function totalSoil() external view returns (uint256);

Returns the total available Soil.

Return TypeDescription

uint256

The total available Soil.

function yield() external view returns (uint32);

Returns the current yield (aka "Temperature") offered by Beanstalk when burning Beans in exchange for Pods.

Return TypeDescription

uint32

The current yield offered by Beanstalk when burning Beans in exchange for Pods.

function temperature() external view returns (uint256);

Returns the current Temperature, the interest rate offered by Beanstalk in exchange for Sowing Beans.

Return ValueDescription

uint256

The current Temperature.

function maxTemperature() external view returns (uint256);

Returns the Maximum Temperature that Beanstalk is willing to offer this Season.

Return TypeDescription

uint256

The Maximum Temperature.

function remainingPods() external view returns (uint256);

Returns the remaining Pods that could be issued this Season.

Return ValueDescription

uint256

The remaining Pods that could be issued this Season.

Events

event Sow(
    address indexed account,
    uint256 index,
    uint256 beans,
    uint256 pods
);

Emitted from LibDibbler.sowNoSoil when an account creates a Plot. A Plot is a set of Pods created in from a single sow or fund call.

ParameterTypeDescription

account

address

The account that Sowed Beans for Pods.

index

uint256

The Place in Line of the Plot.

beans

uint256

The amount of Beans burnt to create the Plot.

pods

uint256

The amount of Pods associated with the created Plot.

event Harvest(address indexed account, uint256[] plots, uint256 beans);

Emitted when account claims the Beans associated with Harvestable Pods.

ParameterTypeDescription

account

address

The account that owns the plots.

plots

uint256[]

The indices of Plots that were Harvested.

beans

uint256

The amount of Beans transferred to account.

event PodListingCancelled(address indexed account, uint256 index);

Emitted when a Pod Listing is Cancelled.

ParameterTypeDescription

account

address

The account that created the Pod Listing.

index

uint256

The index of the Plot listed.

Last updated