Skip to content

Commit

Permalink
Merge branch 'modular-exponentiation-precompile-wrapper-OpenZeppelin#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mw2000 committed Jun 25, 2023
2 parents a1c1439 + 01badeb commit d81d69d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/token/ERC1155/IERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ interface IERC1155 is IERC165 {
*
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
Expand Down
5 changes: 1 addition & 4 deletions contracts/utils/math/Math.sol
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,7 @@ library Math {
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
require(m != 0, "ModularExponentiation: Can't calculate for modulus equal to zero");
bool success;
bytes memory result;

(success, result) = (address(5).staticcall(abi.encode(32, 32, 32, b, e, m)));
(bool success, bytes memory result) = (address(5).staticcall(abi.encode(32, 32, 32, b, e, m)));
require(success, "ModularExponentiation: Failed at calculating the result");
return abi.decode(result, (uint256));
}
Expand Down

0 comments on commit d81d69d

Please sign in to comment.