Skip to content

Instantly share code, notes, and snippets.

@extropyCoder
extropyCoder / semaphore-binary-merkle-root-fix_attestation.log
Created August 1, 2025 16:03
Attestation for Semaphore Binary Merkle Root Fix MPC Phase 2 Trusted Setup ceremony
Hey, I'm extropyCoder-15907736 and I have contributed to the Semaphore Binary Merkle Root Fix MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (semaphore-1)
Contributor # 102
Contribution Hash: 5478df9d d6edaaa5 f6c12947 7e0c184f
3ff5efe3 0710bc4b 583ba8a8 01e188e3
960e1b11 7b5e230d 202ed565 9d7133fb
34a62f1b ba6946c5 78dc1e20 64137db5
@extropyCoder
extropyCoder / Feedback.sol
Created April 12, 2025 17:13
Example Semaphore contract
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
import "@semaphore-protocol/contracts/interfaces/ISemaphore.sol";
contract Feedback {
ISemaphore public semaphore;
uint256 public groupId;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// Minimal ERC20 interface
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract GameItems is ERC1155, Ownable {
uint256 public constant GOLD = 0;
uint256 public constant SILVER = 1;
import { ActionGetResponse, ActionPostResponse } from "@solana/actions";
import { serialize } from "wagmi";
import { parseEther } from "viem";
// CAIP-2 format for Monad
const blockchain = `eip155:10143`;
// Wallet address that will receive the donations
const donationWallet = `<RECEIVER_ADDRESS>`;
@extropyCoder
extropyCoder / flash2.move
Created August 14, 2024 08:39
Fixed Code
module 0x42::example {
struct Coin<T> {
amount: u64
}
struct Receipt<phantom T> {
amount: u64
}
public fun flash_loan<T>(_user: &signer, amount:u64): (Coin<T>, Receipt<T>) {
let (coin, fee) = withdraw(user, amount);
@extropyCoder
extropyCoder / flash1.move
Created August 14, 2024 08:37
Vulnerable code
module 0x42::example {
struct Coin<T> {
amount: u64
}
struct Receipt {
amount: u64
}
public fun flash_loan<T>(user: &signer, amount: u64): (Coin<T>, Receipt) {
@extropyCoder
extropyCoder / generics.move
Created August 14, 2024 08:34
Specifying abilities
module 0x42::example {
struct Table<phantom K: copy + drop, phantom V> has store {
handle: address,
}
public fun add<K: copy + drop, V>(table: &mut Table<K, V>, key: K, val: V) {
add_box<K, V, Box<V>>(table, key, Box { val })
}
}
@extropyCoder
extropyCoder / example1.move
Last active August 14, 2024 08:02
Move Security
// BAD CODE
module 0x42::example {
struct Subscription has key {
end_subscription: u64
}
entry fun registration(user: &signer, end_subscription: u64) {
let price = calculate_subscription_price(end_subscription);
@extropyCoder
extropyCoder / h5.move
Created August 12, 2024 18:46
Move Homework 5 Answer
module my_addr::homework5 {
struct Asset has drop {
value : u64,
flag : u8
}
public entry fun build_asset(value : u64, flag : u8) {