> For the complete documentation index, see [llms.txt](https://docs.pinto.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinto.money/pinto-improvements/pi-1.md).

# PI-1: Convert Newly Earned Pinto and Misc. Bug Fixes

Executed on November 27, 2024 at 05:52 UTC.

## Summary <a href="#b2de4019-aad5-82a2-9b86-81f6cf3a2180" id="b2de4019-aad5-82a2-9b86-81f6cf3a2180"></a>

1. [**Germination**](https://docs.pinto.money/resources/glossary#germination) **of** [**Earned Pinto**](https://docs.pinto.money/resources/glossary#earned-pinto)**:** Eliminate the Germination Period for Earned Pinto, enabling [Pinto](https://docs.pinto.money/resources/glossary#pinto) → LP [Converts](https://docs.pinto.money/resources/glossary#convert) immediately after a [Farmer](https://docs.pinto.money/resources/glossary#farmers) [Plants](https://docs.pinto.money/resources/glossary#plant) their Earned Pinto.
2. **Re-germination of Converted** [**Deposit**](https://docs.pinto.money/resources/glossary#deposit)**s:** Eliminate a bug where Converts can erroneously cause a Deposit to Germinate again.
3. **Minimum** [**Crop Ratio**](https://docs.pinto.money/resources/glossary#crop-ratio) **During** [**Rain**](https://docs.pinto.money/resources/glossary#rain)**:** Add a distinct Minimum Crop Ratio while the system is Raining.
4. **Initial** [**Soil**](https://docs.pinto.money/resources/glossary#soil) **Supply:** Add `initialSoil` to expose the remaining Soil supply before [Morning](https://docs.pinto.money/resources/glossary#morning) Auction scaling.
5. **Event and Rain Data Fixes:** Correct the number of Pinto emitted by the [`Sow`](https://docs.pinto.money/resources/glossary#sow) event and `startRain`’s emitted Crop Ratio change.
6. [**Plenty**](https://docs.pinto.money/responding-to-state/flood) **Claim Return Values:** Return the number of tokens claimed as Plenty from `claimPlenty` and the token addresses and numbers of tokens claimed from `claimAllPlenty`.

## Links <a href="#f7ae4019-aad5-826a-b0e4-81410d1dd13f" id="f7ae4019-aad5-826a-b0e4-81410d1dd13f"></a>

* [Implementation PR](https://github.com/pinto-org/protocol/pull/2)
* Implementation Commit: [d3d412c3d5af2d8cf654f72d378d3c826675c5fd](https://github.com/pinto-org/protocol/commit/d3d412c3d5af2d8cf654f72d378d3c826675c5fd)
* [Diamond Cut Transaction](https://basescan.org/tx/0x47d5574f7472ed3bc3940640747935b3f4c2fe8ee2ad2484f9c42f4a8549595c)

## Problems <a href="#id-7dae4019-aad5-83f4-85ac-014b024d3ccc" id="id-7dae4019-aad5-83f4-85ac-014b024d3ccc"></a>

### 1. Germination of Earned Pinto <a href="#bbee4019-aad5-8329-8578-0193b2c5de70" id="bbee4019-aad5-8329-8578-0193b2c5de70"></a>

Earned Pinto Deposits should be able to be used in a Pinto → LP Convert immediately upon distribution (*i.e.*, they should not Germinate). However, when a Farmer Planted their Earned Pinto, they were not able to Convert their new Pinto Deposit to an LP token Deposit until 2 [Seasons](https://docs.pinto.money/resources/glossary#season) elapsed. This inability to Convert immediately after Planting was a significant inefficiency with respect to target maintenance because users that just Planted their Earned Pinto needed to wait until the Germination Period ended and then return to the [Farm](https://docs.pinto.money/resources/glossary#farm) to Convert their Pinto for target maintenance.

### 2. Re-germination of Converted Deposits <a href="#eb1e4019-aad5-8306-82b7-01cef372b262" id="eb1e4019-aad5-8306-82b7-01cef372b262"></a>

When a Farmer Converted a Pinto Deposit that had recently finished Germinating to an LP token Deposit (or vice versa), the output Deposit became Germinating again. In this case the then Germinating Deposit lost its [Stalk](https://docs.pinto.money/resources/glossary#stalk), and instead was issued Germinating Stalk (*i.e.*, a claim on Stalk after the Germination Period ends). Germinating Stalk is ineligible for mints or [Flood](https://docs.pinto.money/resources/glossary#flood) rewards. Thus, a user was disincentivized to Convert during times of large mints and Floods because they would lose 2 Seasons of mints and eliminate their share of subsequent Flood distributions during the current Rain associated with the Converted Deposits.

### 3. Minimum Crop Ratio During Rain <a href="#e4ee4019-aad5-8398-9e42-81c4620ffb3d" id="e4ee4019-aad5-8398-9e42-81c4620ffb3d"></a>

When the system is Raining, the minimum Crop Ratio should be lowered to increase the incentive to Convert from Deposited Pinto to the Deposited LP token with the most [Seeds](https://docs.pinto.money/resources/glossary#seeds).

### 4. Initial Soil Supply <a href="#id-605e4019-aad5-82ba-b04a-815c81e67248" id="id-605e4019-aad5-82ba-b04a-815c81e67248"></a>

There was no on-chain function that returned the remaining Soil supply before Morning Auction scaling, so the UI had to make excessive RPC calls to reconstruct it.

### 5. Event and Rain Data Fixes <a href="#id-49ae4019-aad5-82e7-b9ed-0195fda4a399" id="id-49ae4019-aad5-82e7-b9ed-0195fda4a399"></a>

The `Sow` event emitted an incorrect number of Pinto, and `startRain` did not correctly emit the change in `BeanToMaxLpGpPerBdvRatio`, resulting in incorrect data in the subgraph.

### 6. Plenty Claim Return Values <a href="#id-642e4019-aad5-8286-9868-81fe8ac5e2d5" id="id-642e4019-aad5-8286-9868-81fe8ac5e2d5"></a>

The `claimPlenty` and `claimAllPlenty` functions did not return sufficient data to easily compose transactions together in the UI.

## Solutions <a href="#id-942e4019-aad5-8202-99ed-814b6efab4b0" id="id-942e4019-aad5-8202-99ed-814b6efab4b0"></a>

### 1. Germination of Earned Pinto <a href="#id-341e4019-aad5-8353-8b28-8147181d9add" id="id-341e4019-aad5-8353-8b28-8147181d9add"></a>

Update the `plant` function to issue a non-Germinating Pinto Deposit crediting it with the [Grown Stalk](https://docs.pinto.money/resources/glossary#grown-stalk) it would have earned at the previous Season's Seeds per [PDV](https://docs.pinto.money/resources/glossary#pinto-denominated-value-pdv) for Pinto, plus an additional 1 micro Seed.

### 2. Re-germination of Converted Deposits <a href="#id-248e4019-aad5-8361-9e0e-814f1eb763c6" id="id-248e4019-aad5-8361-9e0e-814f1eb763c6"></a>

Update the `convert` function to issue a non-Germinating token Deposit for Pinto ↔ LP Converts if the value being Converted was not Germinating. If the resulting Deposit would otherwise have a Germinating Stem, top up Grown Stalk to the non-Germinating minimum based on the previous Season's Seeds per PDV of the output token, plus an additional 1 micro Seed.

### 3. Minimum Crop Ratio During Rain <a href="#e19e4019-aad5-8371-a1ab-81fa88c8ee98" id="e19e4019-aad5-8371-a1ab-81fa88c8ee98"></a>

Add `rainingMinBeanMaxLpGpPerBdvRatio` to the `EvaluationParameters` struct in storage and initialize the value to `33333333333333333333` (approximately 33.33%), and update `getBeanToMaxLpGpPerBdvRatioScaled` to use `rainingMinBeanMaxLpGpPerBdvRatio` instead of `minBeanMaxLpGpPerBdvRatio` when the system is Raining.

### 4. Initial Soil Supply <a href="#e84e4019-aad5-8301-8dd6-81251f0ce302" id="e84e4019-aad5-8301-8dd6-81251f0ce302"></a>

Add the `initialSoil` function, which returns `s.sys.soil`.

### 5. Event and Rain Data Fixes <a href="#id-49ce4019-aad5-82a8-be8f-018f1f4cb05d" id="id-49ce4019-aad5-82a8-be8f-018f1f4cb05d"></a>

Update the `Sow` event to properly emit the number of Pinto that were used to Sow, rather than the number of Soil deducted from `s.sys.soil`.

Update the `startRain` function in `LibFlood.sol` to properly emit the change in `BeanToMaxLpGpPerBdvRatio`.

### 6. Plenty Claim Return Values <a href="#id-5ace4019-aad5-8399-b238-815b37c27a7b" id="id-5ace4019-aad5-8399-b238-815b37c27a7b"></a>

Update the `claimPlenty` function to return the number of tokens claimed. Update `claimAllPlenty` to return the token addresses and numbers of tokens claimed.

## Rationale <a href="#id-09fe4019-aad5-8306-a528-01f0fff332cb" id="id-09fe4019-aad5-8306-a528-01f0fff332cb"></a>

### 1. Germination of Earned Pinto <a href="#b39e4019-aad5-82b2-9f6d-819a5ebe5d55" id="b39e4019-aad5-82b2-9f6d-819a5ebe5d55"></a>

There is no reason to enforce a Germination Period for newly Planted Earned Pinto Deposits. The Germination Period prevents a specific manipulation. Without it, a user could Deposit value in the [Silo](https://docs.pinto.money/resources/glossary#silo) to receive Stalk, call the [`gm`](https://docs.pinto.money/resources/glossary#gm) (which triggers the [Sunrise](https://docs.pinto.money/pinto-mechanics/sun-the-source-of-life-on-the-farm)), and then immediately withdraw the Deposit plus the yield from that Sunrise, all without holding exposure to the price of Pinto. Earned Pinto already accrued from a Deposit that completed Germination, so exempting it does not enable the manipulation described above.

The inability to Convert newly Planted Pinto to Deposited LP tokens is a significant inefficiency with respect to target maintenance because it creates a lag between when Farmers Plant their Pinto and when they can Convert them. This lag may delay the effect of mint distributions on target maintenance with respect to the value that stays in the protocol (*i.e.*, wasn’t sold) by at least one Season, because delayed Converts can delay the peg recovery and lead to more Pinto being minted.

### 2. Re-germination of Converted Deposits <a href="#a6be4019-aad5-82d4-be66-01596b592a17" id="a6be4019-aad5-82d4-be66-01596b592a17"></a>

Once value that was Deposited in the Silo has completed its Germination Period, there is no reason to make it Germinate again upon a Convert because the value will have already been in the Silo for a sufficient period of time, ensuring that it is not taking advantage of a Pinto mint without holding exposure to the Pinto price.

The ability to Convert a non-Germinating Pinto Deposit into a Germinating LP token Deposit creates a disincentive to Convert, which can lead to excess mints because holders that would otherwise have Converted do not.

### 3. Minimum Crop Ratio During Rain <a href="#f0de4019-aad5-8221-b41f-0156af33b039" id="f0de4019-aad5-8221-b41f-0156af33b039"></a>

When it's Raining, Pinto should be very aggressive in incentivizing Converts from Pinto Deposits to LP token Deposits. During a Flood, the protocol should be minimizing how much it mints because when the Flood ends it will almost certainly experience heavy outflows. Accordingly, lowering the Crop Ratio to an exceptionally low value – below the Minimum Crop Ratio – will create a stronger incentive for Depositors to Convert their Deposited Pinto to LP token Deposits and minimize excessive minting.

### 4. Initial Soil Supply <a href="#id-565e4019-aad5-8388-ba97-8104736c436d" id="id-565e4019-aad5-8388-ba97-8104736c436d"></a>

Exposing the remaining unscaled Soil directly lets the UI read the protocol’s current value without reconstructing it through multiple RPC calls.

### 5. Event and Rain Data Fixes <a href="#a0fe4019-aad5-8335-8c90-81912d0b21a3" id="a0fe4019-aad5-8335-8c90-81912d0b21a3"></a>

Emitting the Pinto actually Sown and emitting the Crop Ratio change allows the subgraph and UI to process the protocol’s state changes accurately.

### 6. Plenty Claim Return Values <a href="#id-7fce4019-aad5-8222-8d33-018493b7fdba" id="id-7fce4019-aad5-8222-8d33-018493b7fdba"></a>

Returning the claimed token addresses and numbers of tokens lets the UI use claim results when composing subsequent actions in the same transaction.

## Contract Changes <a href="#b6de4019-aad5-8211-b2ee-01b26636767f" id="b6de4019-aad5-8211-b2ee-01b26636767f"></a>

### Initialization <a href="#id-1d8e4019-aad5-8304-bf41-81a0a10320b6" id="id-1d8e4019-aad5-8304-bf41-81a0a10320b6"></a>

`InitPI1.init()` was called at [`0x4cbD1A8ff8E3dcE759dC9049417DeeBC3Ac24ddA`](https://basescan.org/address/0x4cbD1A8ff8E3dcE759dC9049417DeeBC3Ac24ddA#code) to initialize `rainingMinBeanMaxLpGpPerBdvRatio` to `33333333333333333333` (approximately 33.33%).

### Facet Changes <a href="#id-0d8e4019-aad5-8240-a790-0194416ec8dd" id="id-0d8e4019-aad5-8240-a790-0194416ec8dd"></a>

| **Facet**              | **Action**              | **Previous Implementation**                                                                                                  | **New Implementation**                                                                                                       |
| ---------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `ClaimFacet`           | Replace                 | [`0x85495A065bEc462d76Fbfa1E344C06f64308Af91`](https://basescan.org/address/0x85495A065bEc462d76Fbfa1E344C06f64308Af91#code) | [`0xEa0Aad388e2dF06F90A218cA2eDa199294fBAaDB`](https://basescan.org/address/0xEa0Aad388e2dF06F90A218cA2eDa199294fBAaDB#code) |
| `ApprovalFacet`        | Replace                 | [`0x77e228C03277e38FcfF8FC21106afDc22389e85c`](https://basescan.org/address/0x77e228C03277e38FcfF8FC21106afDc22389e85c#code) | [`0x540e776e8F0eaC5dFA82110b827CB6ceA6705669`](https://basescan.org/address/0x540e776e8F0eaC5dFA82110b827CB6ceA6705669#code) |
| `ConvertFacet`         | Replace                 | [`0x0FAf9BBDDD27647bA9972672aee4E638B364E249`](https://basescan.org/address/0x0FAf9BBDDD27647bA9972672aee4E638B364E249#code) | [`0x379D2d7FF9907F127f1226a9024BCF0789619734`](https://basescan.org/address/0x379D2d7FF9907F127f1226a9024BCF0789619734#code) |
| `ConvertGettersFacet`  | Replace                 | [`0xF0f2e61939DE4daf29d894B466b51798C5c54A1d`](https://basescan.org/address/0xF0f2e61939DE4daf29d894B466b51798C5c54A1d#code) | [`0xfE55E1e7f3FdAef6b1E6E3d6D53f84a374151817`](https://basescan.org/address/0xfE55E1e7f3FdAef6b1E6E3d6D53f84a374151817#code) |
| `SiloFacet`            | Replace                 | [`0x8A42a986DDB3612437f8445bB199FDb14714fa42`](https://basescan.org/address/0x8A42a986DDB3612437f8445bB199FDb14714fa42#code) | [`0x3235540bb01Ef11e4208a9B99c2F2Dd9860E721a`](https://basescan.org/address/0x3235540bb01Ef11e4208a9B99c2F2Dd9860E721a#code) |
| `SiloGettersFacet`     | Replace + Add selectors | [`0x12b94E41697AC173d619CecCcAAd1C2C21A2a66C`](https://basescan.org/address/0x12b94E41697AC173d619CecCcAAd1C2C21A2a66C#code) | [`0x039Ec53Bb37F8fe240798E3591d9439C68e72B7b`](https://basescan.org/address/0x039Ec53Bb37F8fe240798E3591d9439C68e72B7b#code) |
| `PipelineConvertFacet` | Replace                 | [`0x032CAe4820C7379B1419Af64a3e2a4Ce4861Ab0a`](https://basescan.org/address/0x032CAe4820C7379B1419Af64a3e2a4Ce4861Ab0a#code) | [`0x9d108e7f673C773Ac196bDE4bEBC6758088D2e59`](https://basescan.org/address/0x9d108e7f673C773Ac196bDE4bEBC6758088D2e59#code) |
| `SeasonFacet`          | Replace                 | [`0x03fbe88B58FceA841A749FF2e93E4e56D2f42C06`](https://basescan.org/address/0x03fbe88B58FceA841A749FF2e93E4e56D2f42C06#code) | [`0x269C8386bE50C176f03355c7C7925356fdEF9F84`](https://basescan.org/address/0x269C8386bE50C176f03355c7C7925356fdEF9F84#code) |
| `GaugeGettersFacet`    | Replace                 | [`0xABcBa236f57a807084F7884B3eEdD25C077595Ba`](https://basescan.org/address/0xABcBa236f57a807084F7884B3eEdD25C077595Ba#code) | [`0xD26a44C9F7C58864c2ea938BE9E2f0Ae25954bc2`](https://basescan.org/address/0xD26a44C9F7C58864c2ea938BE9E2f0Ae25954bc2#code) |
| `FieldFacet`           | Replace + Add selector  | [`0x34d5239E92720773C2E7a5A93Db8587a3af6Bb04`](https://basescan.org/address/0x34d5239E92720773C2E7a5A93Db8587a3af6Bb04#code) | [`0x6430F859a3b8825D25382Ebc7941fCD719635797`](https://basescan.org/address/0x6430F859a3b8825D25382Ebc7941fCD719635797#code) |

### Other Contract / Parameter Changes <a href="#f22e4019-aad5-8241-b5cb-816bc2145031" id="f22e4019-aad5-8241-b5cb-816bc2145031"></a>

Introduced a separate minimum Crop Ratio during Rain of approximately 33.33%, using `rainingMinBeanMaxLpGpPerBdvRatio`. Outside Rain, `getBeanToMaxLpGpPerBdvRatioScaled` continues to use `minBeanMaxLpGpPerBdvRatio`. Previously, the 50% minimum also applied during Rain. The minimum remains 50% outside Rain. Ratios use 18 decimal places per percentage point (`100e18 = 100%`).

Externally linked library deployments changed as follows (previous → new). These address changes do not by themselves imply changes to each library’s behavior.

| Library              | Previous Implementation                                                                                                      | New Implementation                                                                                                           | Used By                                                           |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `LibSilo`            | [`0x6a634f53d185298ad84a51e2c6fac8b5256d0165`](https://basescan.org/address/0x6a634f53d185298ad84a51e2c6fac8b5256d0165#code) | [`0x351ca256f86c10b01f2640f22ca379cf1e74d8e2`](https://basescan.org/address/0x351ca256f86c10b01f2640f22ca379cf1e74d8e2#code) | `ClaimFacet`, `ConvertFacet`, `SiloFacet`, `PipelineConvertFacet` |
| `LibTokenSilo`       | [`0xa565840bc1a3d3b24fb36c02472aa495259477b6`](https://basescan.org/address/0xa565840bc1a3d3b24fb36c02472aa495259477b6#code) | [`0xbbe1d3e7bb0b50d1999f631674efd5446881612a`](https://basescan.org/address/0xbbe1d3e7bb0b50d1999f631674efd5446881612a#code) | `ClaimFacet`, `ConvertFacet`, `SiloFacet`, `PipelineConvertFacet` |
| `LibConvert`         | [`0xad4a3b66c5e672acc952d9f4b728b4c845f8cb7a`](https://basescan.org/address/0xad4a3b66c5e672acc952d9f4b728b4c845f8cb7a#code) | [`0x3dedd64cfbf6db642cf6a22ce747fdfb9f17b570`](https://basescan.org/address/0x3dedd64cfbf6db642cf6a22ce747fdfb9f17b570#code) | `ConvertFacet`                                                    |
| `LibPipelineConvert` | [`0x9b0943584aa2bd99cefd82004dfe859d369e4326`](https://basescan.org/address/0x9b0943584aa2bd99cefd82004dfe859d369e4326#code) | [`0x4917dcbafc47b57b9ec004424a44ccdc5834d054`](https://basescan.org/address/0x4917dcbafc47b57b9ec004424a44ccdc5834d054#code) | `ConvertFacet`, `PipelineConvertFacet`                            |
| `LibEvaluate`        | [`0x34ebbb2b16cf20964b6819cef921dd10599f117c`](https://basescan.org/address/0x34ebbb2b16cf20964b6819cef921dd10599f117c#code) | [`0x7f1770fa1b43abdbe8095295ecae37c00d4ba7f8`](https://basescan.org/address/0x7f1770fa1b43abdbe8095295ecae37c00d4ba7f8#code) | `SeasonFacet`                                                     |
| `LibGauge`           | [`0xc3ccf1a9cff074fd572c9ab7d55486ef003fd427`](https://basescan.org/address/0xc3ccf1a9cff074fd572c9ab7d55486ef003fd427#code) | [`0xcd376159cfa7ff6c60a3b6d55e2ce75cec515669`](https://basescan.org/address/0xcd376159cfa7ff6c60a3b6d55e2ce75cec515669#code) | `SeasonFacet`                                                     |
| `LibIncentive`       | [`0x7b160137d1298e3b71285ea6a260cb2248176d82`](https://basescan.org/address/0x7b160137d1298e3b71285ea6a260cb2248176d82#code) | [`0x86da3aba20454a441eceae9d5b960564abd0cba1`](https://basescan.org/address/0x86da3aba20454a441eceae9d5b960564abd0cba1#code) | `SeasonFacet`                                                     |
| `LibShipping`        | [`0x1fa93c17cfe8a33d9a195e904031e26232591571`](https://basescan.org/address/0x1fa93c17cfe8a33d9a195e904031e26232591571#code) | [`0x2b6a87195446b28c404cd5d78351998a1e8b31f9`](https://basescan.org/address/0x2b6a87195446b28c404cd5d78351998a1e8b31f9#code) | `SeasonFacet`                                                     |
| `LibWellMinting`     | [`0x4910f9a342c79ea50a4395477cfdb11f36a010ad`](https://basescan.org/address/0x4910f9a342c79ea50a4395477cfdb11f36a010ad#code) | [`0x78e2a41721b97f33e13a383d15726b1ac96c2a19`](https://basescan.org/address/0x78e2a41721b97f33e13a383d15726b1ac96c2a19#code) | `SeasonFacet`                                                     |
| `LibFlood`           | [`0x2174762d93abebd7c4317104c26b6961d6cb3f10`](https://basescan.org/address/0x2174762d93abebd7c4317104c26b6961d6cb3f10#code) | [`0xd668ecc7df030202ee50f9c465db7f7da7581a48`](https://basescan.org/address/0xd668ecc7df030202ee50f9c465db7f7da7581a48#code) | `SeasonFacet`                                                     |
| `LibGerminate`       | [`0x74f409bf422e33bc34d909a1233516307adb6daa`](https://basescan.org/address/0x74f409bf422e33bc34d909a1233516307adb6daa#code) | [`0x06cc9fb93b3cefa5dc6bb5f418c7358cd3ea0a85`](https://basescan.org/address/0x06cc9fb93b3cefa5dc6bb5f418c7358cd3ea0a85#code) | `SeasonFacet`                                                     |

`ApprovalFacet`, `ConvertGettersFacet`, `SiloGettersFacet`, `GaugeGettersFacet`, and `FieldFacet` have no externally linked libraries.

### Function Changes <a href="#id-4d6e4019-aad5-8364-aa32-81acc0b83e93" id="id-4d6e4019-aad5-8364-aa32-81acc0b83e93"></a>

* Updated `plant` and Pinto ↔ LP `convert` behavior to produce non-Germinating Deposits. `plant` now returns the non-Germinating Stem instead of the current Stem tip.
* Added `getHighestNonGerminatingStem(address)` and `getHighestNonGerminatingStems(address[])` to expose the highest non-Germinating Stem for one or more tokens.
* Removed obsolete special handling for Earned Pinto in withdrawal and transfer accounting in `TokenSilo` and `LibSilo`, consistent with Planted Deposits now receiving a non-Germinating Stem.
* Added internal helpers in `LibGerminate`, `LibTokenSilo`, and `LibConvert` to calculate the highest non-Germinating Stem and the minimum Grown Stalk needed to prevent re-germination.
* Updated `LibTokenSilo.calculateStalkFromStemAndBdv` to return `uint256` and perform the BDV multiplication as unsigned 256-bit arithmetic.
* Updated `LibGauge.getBeanToMaxLpGpPerBdvRatioScaled` to use the Rain-specific minimum Crop Ratio while Raining.
* Added `initialSoil()` to return `s.sys.soil`.
* Updated `claimPlenty` to return the number of tokens claimed and `claimAllPlenty` to return an array of token addresses and numbers of tokens claimed.

### Event Changes <a href="#de7e4019-aad5-82f9-bd63-01c971ec1dd9" id="de7e4019-aad5-82f9-bd63-01c971ec1dd9"></a>

* Added a `StalkBalanceChanged` emission when `plant` mints the Grown Stalk credited to the newly Planted Deposit, reporting the additional active Stalk and Roots.
* Corrected the number of Pinto emitted by `Sow` to reflect the number of Pinto Sown rather than the scaled Soil deducted.
* Corrected the Crop Ratio change emitted by `startRain`. Emitted `BeanToMaxLpGpPerBdvRatioChange` before resetting the stored ratio to zero.
