Created
March 30, 2023 05:19
-
-
Save ashwinYardi/029cfddd5b7eceb677d4b750cf064e68 to your computer and use it in GitHub Desktop.
Solidity Contract for demoing how to use libraries. The contract uses Factorial Library to calculate the factorial of the number.
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
import "./Factorial.sol"; | |
contract FactorialCalculator { | |
using Factorial for uint; | |
uint public factorial; | |
constructor(uint n) public { | |
factorial = n.factorial(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment