Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ModExp sample on Solidity
pragma solidity ^0.8.1;
contract ModExpContracts {
address public constant modExpAddress = 0x0000000000000000000000000000000000000005;
bytes public _result;
function modExp(
uint baseLength,
uint expLength,
uint modLength,
bytes calldata _base,
bytes calldata exp,
bytes calldata modulus)
public
{
(bool _success, bytes memory result) = modExpAddress.call(
abi.encodePacked(baseLength, expLength, modLength, _base, exp, modulus));
_result = result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment