diff --git a/protocol/contracts/beanstalk/storage/System.sol b/protocol/contracts/beanstalk/storage/System.sol index 00033af26..7c448ae61 100644 --- a/protocol/contracts/beanstalk/storage/System.sol +++ b/protocol/contracts/beanstalk/storage/System.sol @@ -316,10 +316,10 @@ struct AssetSettings { int96 milestoneStem; // │ 12 (30) bytes1 encodeType; // │ 1 (31) // one byte is left here. ──┘ 1 (32) - int32 deltaStalkEarnedPerSeason; // ────┐ 3 - uint128 gaugePoints; // │ 16 (19) - uint64 optimalPercentDepositedBdv; // │ 8 (27) - // 5 bytes are left here. ──┘ 5 (32) + int32 deltaStalkEarnedPerSeason; // ────┐ 4 + uint128 gaugePoints; // │ 16 (20) + uint64 optimalPercentDepositedBdv; // │ 8 (28) + // 4 bytes are left here. ──┘ 4 (32) Implementation gaugePointImplementation; Implementation liquidityWeightImplementation; } diff --git a/protocol/contracts/libraries/Silo/LibGerminate.sol b/protocol/contracts/libraries/Silo/LibGerminate.sol index 6129166bf..088008dc4 100644 --- a/protocol/contracts/libraries/Silo/LibGerminate.sol +++ b/protocol/contracts/libraries/Silo/LibGerminate.sol @@ -459,7 +459,7 @@ library LibGerminate { if (s.sys.silo.assetSettings[token].milestoneSeason < s.sys.season.current) { prevStalkEarnedPerSeason = s.sys.silo.assetSettings[token].stalkEarnedPerSeason; } else { - int64 deltaStalkEarnedPerSeason = s + int32 deltaStalkEarnedPerSeason = s .sys .silo .assetSettings[token] @@ -467,11 +467,11 @@ library LibGerminate { if (deltaStalkEarnedPerSeason >= 0) { prevStalkEarnedPerSeason = s.sys.silo.assetSettings[token].stalkEarnedPerSeason - - uint32(uint64(deltaStalkEarnedPerSeason)); + uint32(deltaStalkEarnedPerSeason); } else { prevStalkEarnedPerSeason = s.sys.silo.assetSettings[token].stalkEarnedPerSeason + - uint32(uint64(-deltaStalkEarnedPerSeason)); + uint32(-deltaStalkEarnedPerSeason); } } } diff --git a/protocol/contracts/libraries/Silo/LibWhitelist.sol b/protocol/contracts/libraries/Silo/LibWhitelist.sol index 3237aebfb..c77eafdf3 100644 --- a/protocol/contracts/libraries/Silo/LibWhitelist.sol +++ b/protocol/contracts/libraries/Silo/LibWhitelist.sol @@ -203,8 +203,9 @@ library LibWhitelist { s.sys.silo.assetSettings[token].milestoneSeason = s.sys.season.current; // stalkEarnedPerSeason is set to int32 before casting down. - s.sys.silo.assetSettings[token].deltaStalkEarnedPerSeason = (int32(stalkEarnedPerSeason) - - int32(s.sys.silo.assetSettings[token].stalkEarnedPerSeason)).toInt32(); + s.sys.silo.assetSettings[token].deltaStalkEarnedPerSeason = + int32(stalkEarnedPerSeason) - + int32(s.sys.silo.assetSettings[token].stalkEarnedPerSeason); s.sys.silo.assetSettings[token].stalkEarnedPerSeason = stalkEarnedPerSeason; emit UpdatedStalkPerBdvPerSeason(token, stalkEarnedPerSeason, s.sys.season.current);