Skip to content

Instantly share code, notes, and snippets.

View cre-mer's full-sized avatar
:atom:
Voll-Strack Developer

Jonas Merhej cre-mer

:atom:
Voll-Strack Developer
View GitHub Profile
@cre-mer
cre-mer / Verifier.sol
Last active November 20, 2024 15:25
An imagination of how Solidity can implement a standalone bytes in bytes out function.
// Now we can call the function from a contract like so
import { myVerifier } from "./myVerifier.sol";
contract Verifier {
// @dev returns 42
// @param myVerifier the address of the deployed standalone function
function isValidProof(myVerifier myVerifier_) external returns(uint256) {
return _myVerifier(42);
}
@cre-mer
cre-mer / Proving a List is Sorted in Ascending Sequence
Created August 7, 2024 12:51
Circuit to prove that a list is sorted in an ascending sequence using only addition, multiplication, and equality checks
sorted_list = [3, 9, 10, 404, 1337]
unsorted_list = [3, 9, 10, 1337, 404]
# define default constant
MAX = 4
def decimal_to_binary(dec, max = MAX):
"""
convert a decimal number `dec =< max` to binary, returning each binary index as a list
"""
@cre-mer
cre-mer / README.md
Last active October 11, 2022 21:18
JavaScript snippet to run from the browser console in https://faucet.polygon.technology/ to auto recharge an address.

How to

  1. Go to https://faucet.polygon.technology/
  2. Paste your address
  3. Copy and paste the script in the browser console
  4. Press enter and enjoy

Notes

Loop runs max 20 times. The faucet funds 0.5 MATIC each time and the faucet doesn't fund if address balance is bigger than 10 MATIC. After 20 runs an alert pops up with the message that it's done.

Attention