Skip to content

Instantly share code, notes, and snippets.

@tserg
tserg / opus_troves.cairo
Created October 19, 2025 01:46
Fetch information about a user's troves
// Addresses
// Abbot: 0x04d0bb0a4c40012384e7c419e6eb3c637b28e8363fb66958b60d90505b9c072f
// Frontend Data Provider (FDP): 0x023037703b187f6ff23b883624a0a9f266c9d44671e762048c70100c2f128ab9
// https://scarbs.xyz/packages/opus
// https://github.com/lindy-labs/opus_interfaces/blob/main/src/interfaces/abbot.cairo
// https://github.com/lindy-labs/opus_interfaces/blob/main/src/interfaces/frontend_data_provider.cairo
use opus::interfaces::{IAbbotDispatcher, IAbbotDispatcherTrait, IFrontendDataProvider, IFrontEndDataProviderTrait};
use opus::types::{ShrineAssetInfo, TroveAssetInfo, TroveInfo};
@tserg
tserg / ERC20.vy
Last active September 11, 2023 03:17
Library sketch
# Sketch of ERC-20 contract that imports ERC20
from vyper.interfaces import IERC20
from snekmate.tokens import ERC20
implements: IERC20
@external
def __init__(
@tserg
tserg / demo.vy
Last active September 16, 2023 07:13
ETH Singapore 2023 Intro to Vyper
# @version ^0.3.7
# Declare an enum with three members
enum Permission:
EXECUTE # 1
WRITE # 2
READ # 4
# Declare a public storage mapping of address to Permission enum
permissions: public(HashMap[address, Permission])
@tserg
tserg / attestation.txt
Created April 12, 2022 02:31
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 324
Hash: 727545a3 98bb723f b84b734a bdf8039a
3db48631 a4b2479c 666efd5f 6f5945a4
437744e7 7aeb0193 ccb497c0 15f47c65
06e3b30b cdc1f520 9e25bdd6 2c3f3d0e