Created
March 16, 2021 10:26
-
-
Save nakajo2011/8674742a617d319fb7a5781ca143c5e5 to your computer and use it in GitHub Desktop.
ModExp sample on Solidity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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