Omniscia rain protocol Audit
MathOps Manual Review Findings
MathOps Manual Review Findings
MOS-01M: Inexistent Accumulation of Exponention
Type | Severity | Location |
---|---|---|
Mathematical Operations | MathOps.sol:L98 |
Description:
The MathOps
library incorrectly performs an exponention accumulation as the result of the exponention operation (**
) is never stored to the accumulator_
.
Example:
contracts/vm/ops/MathOps.sol
92// Exponentiation.93else if (opcode_ == EXP) {94 while (cursor_ < top_) {95 unchecked {96 cursor_++;97 }98 accumulator_**state_.stack[cursor_];99 }100}
Recommendation:
We advise it to be properly accumulated as otherwise the operation will always yield the value of the first member of the exponention chain.
Alleviation:
The operation was corrected to properly accumulate the power instructions.