Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/generic harvester #117

Merged
merged 69 commits into from
Oct 29, 2024
Merged

Feat/generic harvester #117

merged 69 commits into from
Oct 29, 2024

Conversation

0xtekgrinder
Copy link
Contributor

No description provided.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slither found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/GenericHarvester.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Fixed Show fixed Hide fixed
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
wow Outdated Show resolved Hide resolved
contracts/helpers/GenericHarvester.sol Outdated Show resolved Hide resolved
contracts/helpers/GenericHarvester.sol Outdated Show resolved Hide resolved
contracts/helpers/GenericHarvester.sol Outdated Show resolved Hide resolved
contracts/helpers/BaseRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockRebalancer.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockHarvester.sol Outdated Show resolved Hide resolved
contracts/helpers/BaseHarvester.sol Outdated Show resolved Hide resolved
contracts/helpers/MultiBlockHarvester.sol Outdated Show resolved Hide resolved
Comment on lines +229 to +244
function _updateLimitExposuresYieldAsset(
address asset,
YieldBearingParams storage yieldBearingInfo
) internal virtual {
uint64[] memory xFeeMint;
(xFeeMint, ) = TRANSMUTER.getCollateralMintFees(collatInfo.asset);
(xFeeMint, ) = transmuter.getCollateralMintFees(asset);
uint256 length = xFeeMint.length;
if (length <= 1) collatInfo.maxExposureYieldAsset = 1e9;
else collatInfo.maxExposureYieldAsset = xFeeMint[length - 2];
if (length <= 1) yieldBearingInfo.maxExposure = 1e9;
else yieldBearingInfo.maxExposure = xFeeMint[length - 2];

uint64[] memory xFeeBurn;
(xFeeBurn, ) = TRANSMUTER.getCollateralBurnFees(collatInfo.asset);
(xFeeBurn, ) = transmuter.getCollateralBurnFees(asset);
length = xFeeBurn.length;
if (length <= 1) collatInfo.minExposureYieldAsset = 0;
else collatInfo.minExposureYieldAsset = xFeeBurn[length - 2];
if (length <= 1) yieldBearingInfo.minExposure = 0;
else yieldBearingInfo.minExposure = xFeeBurn[length - 2];
}
Comment on lines +229 to +244
function _updateLimitExposuresYieldAsset(
address asset,
YieldBearingParams storage yieldBearingInfo
) internal virtual {
uint64[] memory xFeeMint;
(xFeeMint, ) = TRANSMUTER.getCollateralMintFees(collatInfo.asset);
(xFeeMint, ) = transmuter.getCollateralMintFees(asset);
uint256 length = xFeeMint.length;
if (length <= 1) collatInfo.maxExposureYieldAsset = 1e9;
else collatInfo.maxExposureYieldAsset = xFeeMint[length - 2];
if (length <= 1) yieldBearingInfo.maxExposure = 1e9;
else yieldBearingInfo.maxExposure = xFeeMint[length - 2];

uint64[] memory xFeeBurn;
(xFeeBurn, ) = TRANSMUTER.getCollateralBurnFees(collatInfo.asset);
(xFeeBurn, ) = transmuter.getCollateralBurnFees(asset);
length = xFeeBurn.length;
if (length <= 1) collatInfo.minExposureYieldAsset = 0;
else collatInfo.minExposureYieldAsset = xFeeBurn[length - 2];
if (length <= 1) yieldBearingInfo.minExposure = 0;
else yieldBearingInfo.minExposure = xFeeBurn[length - 2];
}
contracts/helpers/GenericHarvester.sol Show resolved Hide resolved
contracts/helpers/GenericHarvester.sol Show resolved Hide resolved
scripts/DeployGenericHarvester.s.sol Outdated Show resolved Hide resolved
scripts/DeployMultiBlockHarvester.s.sol Outdated Show resolved Hide resolved
@0xtekgrinder 0xtekgrinder merged commit f7bb92f into main Oct 29, 2024
6 of 7 checks passed
@0xtekgrinder 0xtekgrinder deleted the feat/generic-harvester branch October 29, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants