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
  • Sunrise
  • GM
  • View Functions
  • Season
  • Paused
  • Time
  • Above Peg
  • Sunrise Block
  • Season Time
  • Weather
  • Rain
  • Plenty Per Root
  • Total deltaB
  • Pool deltaB
  • Well Oracle Snapshot
  • Curve Oracle
  • Events
  • Sunrise
  • Incentivization
  • Reward
  • Soil
  • Weather Change
  • Season of Plenty
Edit on GitHub
Export as PDF
  1. Protocol
  2. Sun

Season Facet

PreviousSunNextSilo

Last updated 6 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 Season Facet contains the gm function and handles all logic for Season changes.

Call Functions

function sunrise() external payable returns (uint256);

Advances Beanstalk to the next Season, sending reward Beans to the caller's Circulating balance.

Return Type
Description

uint256

The number of Beans minted to the caller.

function gm(
    address account,
    LibTransfer.To mode
) public payable returns (uint256);

Advances Beanstalk to the next Season, sending reward Beans to a specified address and balance.

Parameter
Type
Description

account

address

Indicates to which address reward Beans should be sent.

mode

To

Return Type
Description

uint256

The number of Beans minted to the caller.

View Functions

function season() public view returns (uint32);

Returns the current Season number.

Return Type
Description

uint32

The current Season number.

function paused() public view returns (bool);

Returns whether Beanstalk is Paused. When Paused, sunrise cannot be called.

Return Type
Description

bool

Whether Beanstalk is Paused.

function time() external view returns (Storage.Season memory);

Returns the Season struct.

Return Type
Description

Season

function abovePeg() external view returns (bool);

Returns whether Beanstalk started this Season above or below peg.

Return Type
Description

bool

Whether Beanstalk started this Season above or below peg.

function sunriseBlock() external view returns (uint32);

Returns the block during which the current Season started.

Return Type
Description

uint32

The block during which the current Season started.

function seasonTime() public view virtual returns (uint32);

Returns the expected Season number given the current block timestamp. The sunrise function can be called when seasonTime() > season().

Return Type
Description

uint32

The expected Season number given the current block timestamp.

function weather() public view returns (Storage.Weather memory);

Returns the Weather struct.

Return Type
Description

Weather

function rain() public view returns (Storage.Rain memory);

Returns the Rain struct.

Return Type
Description

Rain

function plentyPerRoot(uint32 season) external view returns (uint256);

Returns the Season of Plenty (SOP) rewards per Root for the given Season.

Parameter
Type
Description

season

uint32

The Season to fetch SOP rewards per Root for.

Return Type
Description

uint256

The SOP rewards for the given Season.

function totalDeltaB() external view returns (int256 deltaB);

Returns the cumulative deltaB across all pools on the Oracle Whitelist.

Return Value
Type
Description

deltaB

int256

The cumulative deltaB.

function poolDeltaB(address pool) external view returns (int256);

Returns the deltaB for a given pool.

Parameter
Type
Description

pool

address

The address of the pool .

Return Value
Description

int256

The deltaB for the given pool.

function wellOracleSnapshot(address well) external view returns (bytes memory snapshot);

Returns the last Well oracle snapshot for a given Well.

Parameter
Type
Description

well

address

The address of the pool to get the snapshot for.

Type

int256

function curveOracle() external view returns (Storage.CurveMetapoolOracle memory co);

Returns the last Curve oracle data snapshot for the BEAN:3CRV pool.

Return Value
Type
Description

co

Storage.CurveMetapoolOracle

Last Curve oracle data snapshot.

Events

event Sunrise(uint256 indexed season);

Emitted when the Season changes.

Parameter
Type
Description

season

uint256

The new Season number.

event Incentivization(address indexed account, uint256 beans);

Emitted when Beanstalk pays Beans to the sunrise caller.

Parameter
Type
Description

account

address

The address to which the reward Beans were sent.

beans

uint256

The amount of Beans paid as a reward.

event Reward(uint32 indexed season, uint256 toField, uint256 toSilo, uint256 toFertilizer);

Emitted during Sunrise when Beans are distributed to the Field, the Silo, and Fertilizer.

Parameter
Type
Description

season

uint32

The Season in which Beans were distributed.

toField

uint256

The number of Beans distributed to the Field.

toSilo

uint256

The number of Beans distributed to the Silo.

toFertilizer

uint256

The number of Beans distributed to Fertilizer holders.

event Soil(uint32 indexed season, uint256 soil);

Emitted during Sunrise when Beanstalk adjusts the amount of available Soil.

Parameter
Type
Description

season

uint32

The Season in which Soil was adjusted.

soil

uint256

The new amount of Soil available.

event WeatherChange(uint256 indexed season, uint256 caseId, int8 change);
Parameter
Type
Description

season

uint256

The current Season.

caseId

uint256

change

int8

The change in Temperature from the previous value.

event SeasonOfPlenty(
    uint256 indexed season,
    uint256 amount,
    uint256 toField
);

Emitted when Beans are minted during the Season of Plenty.

Parameter
Type
Description

season

uint256

The Season in which Beans were minted for distribution.

amount

uint256

The amount of 3CRV which was received for swapping Beans.

toField

uint256

The amount of Beans which were distributed to remaining Pods in the Field.

The balance to transfer Beans to; see .

The Season struct in .

Returns the Weather struct in .

Returns the Rain struct in .

Emitted when the Weather (now ) changes.

The "".

🌾
Sunrise
GM
Season
Paused
Time
Above Peg
Sunrise Block
Season Time
Weather
Rain
Plenty Per Root
Total deltaB
Pool deltaB
Well Oracle Snapshot
Curve Oracle
Sunrise
Incentivization
Reward
Soil
Weather Change
Temperature
Season of Plenty
LibTransfer.To
App Storage
App Storage
App Storage
Weather Case