Skip to content

Instantly share code, notes, and snippets.

View killerstorm's full-sized avatar

Alex Mizrahi killerstorm

View GitHub Profile

Okay, let's break down that line of code and its significance within the useLoadTxHistory.ts file. We'll cover the method itself, the parameters used, what the returned logs represent, and some areas for further investigation.

Detailed Explanation of the Code

  • safeContract.queryFilter(safeContract.filters.ExecutionSuccess(), 0, 'latest')

    • safeContract: This is an instance of an ethers.js Contract object (specifically, a Gnosis_safe contract instance). It represents a connection to a specific Safe smart contract deployed on the blockchain, as defined in eternalsafe/src/utils/safe-versions.ts.
      • How safeContract is obtained: The safeContract is derived by combining the Safe's address, the Safe's version as retrieved from the Safe Info from the Safe Gateway, and the current web3 provider from /src/hooks/wallets/web3.ts. The version will help retrieve the specific ABI from /src/utils/safe-versions.ts. This all happens in `eternalsafe/src/hooks/loadables/use
contract EthGrowthToken {
uint256 ethBalance = 0;
uint constant depositFeePc = 1;
uint constant withdrawFeePc = 1;
// Following function implement growth logic:
// ether can be converted to and from tokens according to a current price which
// is calculated as (ethBalance / totalTokens), however we charge deposit
@killerstorm
killerstorm / chromiapyclientexample.ipynb
Last active January 22, 2025 00:16
ChromiaPyClientExample.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@killerstorm
killerstorm / gtv.py
Last active November 26, 2024 14:38
postchain python client, AI generated
from typing import Dict, List, Union, Any, Tuple
from enum import Enum
import asn1
# Define GTV types
RawGtv = Union[None, bool, bytes, str, int, Dict[str, Any], List[Any]]
DictPairTuple = Tuple[str, Any]
class GTVType(Enum):
NULL = 0
;; -*- lexical-binding: t; -*-
(require 'url)
(defun llm (command)
(interactive "sWhat: ")
(let* ((start (if (use-region-p) (region-beginning) (point)))
(end (if (use-region-p) (region-end) (point)))
(text-before (buffer-substring-no-properties (point-min) start))
(selection (buffer-substring-no-properties start end))
(text-after (buffer-substring-no-properties end (point-max))))

Hello. I want you to emulate SHRDLU behavior. We start with the following initial state:

objects:
  - id: B1
    type: BLOCK
    position: [110, 100, 0]
    size: [100, 100, 100]
    color: RED
  - id: B2
import requests
import yaml
from typing import List, Dict, Optional
class PlanItem:
def __init__(self, id: str, description: str, status: str, subtasks: List['PlanItem'] = None):
self.id = id
self.status = status
self.description = description
import re
from typing import List, Union, Dict, Optional
import yaml
import openai
import requests
MARKER_PREFIX = "///"
class CodeFragment:
def __init__(self, marker: str, description: str, content: str):
override fun createSpecialOperations(position: SpecialTransactionPosition, bctx: BlockEContext): List<OpData> {
if (position == SpecialTransactionPosition.Begin) {
val retval = mutableListOf<OpData>()
val rqs = this.module.query(bctx, "get_auth_requests",
GtvDictionary.build(mapOf()))
for (r in rqs.asArray()) {
val rString = r.asString()
val res = pendingRequests[rString]
@killerstorm
killerstorm / dreddit.md
Last active January 24, 2022 21:17
Dreddit

An architecture for distributed p2p reddit-like thing

Problem?

If you're a reddit user you probably know that from time to time reddit goes slow or even down due to unexpectedly high load (many users trying to use site simultaneously) and after that users create posts like "Fix it! Can't you just buy more servers?". I've found a pretty interesting question in one of those threads once -- why can't we make a distributed, p2p reddit(-like thing) so it won't depend on lots of expensive servers?

As a person who has some clue on how p2p systems work (I've implemented an ED2k client once, for example) I've commented that there are unresolved technical problems. P2P was amazingly successful for some applications, notably, filesharing. But using it for a highly-interactive