Season Facet

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.

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.

View Functions

function season() public view returns (uint32);

Returns the current Season number.

function paused() public view returns (bool);

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

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

Returns the Season struct.

function abovePeg() external view returns (bool);

Returns whether Beanstalk started this Season above or below peg.

function sunriseBlock() external view returns (uint32);

Returns 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().

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

Returns the Weather struct.

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

Returns the Rain struct.

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

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

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

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

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

Returns the deltaB for a given pool.

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

Returns the last Well oracle snapshot for a given Well.

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

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

Events

event Sunrise(uint256 indexed season);

Emitted when the Season changes.

event Incentivization(address indexed account, uint256 beans);

Emitted when Beanstalk pays Beans to the sunrise caller.

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.

event Soil(uint32 indexed season, uint256 soil);

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

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

Emitted when the Weather (now Temperature) changes.

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

Emitted when Beans are minted during the Season of Plenty.

Last updated