Skip to content

Instantly share code, notes, and snippets.

View simon-something's full-sized avatar

Simon Something </DrGoNoGo> simon-something

View GitHub Profile
@simon-something
simon-something / privacy-pools-ceremony_attestation.log
Created February 23, 2025 12:51
Attestation for Privacy Pools Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm simon-something-83670532 and I have contributed to the Privacy Pools Ceremony.
The following are my contribution signatures:
Circuit # 1 (withdraw)
Contributor # 194
Contribution Hash:
ea8b048c d1884486 207ecb8c 26534b6a
5aa96d24 538b13b4 bfc86e21 bfa7d5d3
cb83aad4 802dd7aa c2bd1dd5 e6e54ebf
6c9530e9 9395e777 b5f83ee5 93b18d1d
@simon-something
simon-something / leanIMT.circom
Created January 6, 2025 21:46
Lean Incremental Merkle Tree membership proof
pragma circom 2.2.0;
include "circomlib/poseidon.circom";
include "circomlib/comparators.circom";
include "circomlib/mux1.circom";
// Based on a lead, its index and siblings in a lean incremental
// Merkle tree, re-compute the root of the tree
template LeanIMTInclusionProof(maxDepth) {
signal input leaf;

Keybase proof

I hereby claim:

  • I am simon-something on github.
  • I am drgorilla_md (https://keybase.io/drgorilla_md) on keybase.
  • I have a public key ASAKUGl92_4u_MpBR5aVXXfOaE2ZU7Z79UG_OzAs09gs2Qo

To claim this, I am signing this object:

@simon-something
simon-something / test.sol
Created September 2, 2024 15:29
var instantiation once or in a loop?
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;
import {Test, console} from "forge-std/Test.sol";
// Ran 2 tests for test/Counter.t copy 2.sol:VarCreation
// [PASS] test_test1() (gas: 18480)
// [PASS] test_test2() (gas: 18320)
contract VarCreation is Test {
@simon-something
simon-something / test.sol
Created September 2, 2024 15:19
calldata array length cached or nah?
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;
import {Test, console} from "forge-std/Test.sol";
// Ran 2 tests for test/Counter.t copy.sol:LenCalldata
// [PASS] test_test1() (gas: 15999)
// [PASS] test_test2() (gas: 15979)
contract LenCalldata is Test {
@simon-something
simon-something / test.sol
Created September 2, 2024 15:13
mapping key creation vs solc
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;
import {Test, console} from "forge-std/Test.sol";
// Ran 6 tests for test/Counter.t.sol:CounterTest
// [PASS] test_test1E2E(uint256) (runs: 258, μ: 31839, ~: 31839)
// [PASS] test_test1Set() (gas: 27750)
// [PASS] test_test1Test() (gas: 28762)
// [PASS] test_test2E2E(uint256) (runs: 258, μ: 31631, ~: 31631)
@simon-something
simon-something / ctf.sol
Created June 20, 2024 12:58
branchless in assembly in a long forgotten ctf (2y ago?)
// SPDX-License-Identifier: None
pragma solidity ^0.8.17;
import { Test } from "forge-std/Test.sol";
import { Gate, IGuardian } from "../src/Gate.sol";
/**
* @title Answer to the Gate Challenge
*
* @notice The logic summarized is, for every calls to guardian, the following
@simon-something
simon-something / Nonce.t.sol
Last active June 19, 2024 11:22
contract nonce if revert
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
import {Test} from 'forge-std/Test.sol';
contract DeployRevert {
constructor() {
revert("DeployRevert");
}
}
@simon-something
simon-something / A.sol
Created February 28, 2024 08:09
internal function pointer
// SPDX-License-Identifier: GPL-3.0
// no optimization
pragma solidity 0.8.19;
contract A {
event Log(string bleh);
// Pass an arbitrary bytecode offset, then make it a fn pointer and call it
function callme(bytes32 _offset) external {
@simon-something
simon-something / test.sol
Created March 17, 2023 08:35
Quick gas comparison between multiple ways to access struct elements stored in a single word
pragma solidity 0.8.16;
// optim 200 runs
contract Test { //27038
struct StructA {
uint128 _a;
uint128 _b;
}
StructA structA;