Skip to content

Instantly share code, notes, and snippets.

@ashwinYardi
Created March 30, 2023 05:19
Show Gist options
  • Save ashwinYardi/029cfddd5b7eceb677d4b750cf064e68 to your computer and use it in GitHub Desktop.
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.
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