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

M-01 MitigationConfirmed #25

Open
code423n4 opened this issue Jul 21, 2023 · 1 comment
Open

M-01 MitigationConfirmed #25

code423n4 opened this issue Jul 21, 2023 · 1 comment
Labels
mitigation-confirmed MR-M-01 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

Vulnerability details

Original Issue

code-423n4/2023-06-angle-findings#40

Details

LibHelpers.piecewiseLinear() reverts when the value is less than the first element of the array.

Mitigation

PR: AngleProtocol/angle-transmuter@5f7635c

    function piecewiseLinear(uint64 x, uint64[] memory xArray, int64[] memory yArray) internal pure returns (int64) {
        uint256 indexLowerBound = findLowerBound(true, xArray, 1, x);
        if (indexLowerBound == 0 && x < xArray[0]) return yArray[0];
        else if (indexLowerBound == xArray.length - 1) return yArray[xArray.length - 1];
        return
            yArray[indexLowerBound] +
            ((yArray[indexLowerBound + 1] - yArray[indexLowerBound]) * int64(x - xArray[indexLowerBound])) /

During the mitigation, it outputs the first value of the y array when the value is less than the first element of the x array.

Conclusion

This issue was mitigated properly.

@c4-judge
Copy link

hansfriese marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mitigation-confirmed MR-M-01 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants