Created
March 17, 2021 09:52
-
-
Save PaulRBerg/94c3dcc41135cb977473b7e9934fff33 to your computer and use it in GitHub Desktop.
Basic contract written in Solidity v0.8.2
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract Mulmod { | |
uint256 public constant a = 2**254; | |
uint256 public constant b = 2**255; | |
function doMul(uint256 x, uint256 y) external pure returns (uint256) { | |
return x * y; | |
} | |
function doMulMod(uint256 x, uint256 y) external pure returns (uint256) { | |
return mulmod(x, y, type(uint256).max); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment