Skip to content

Instantly share code, notes, and snippets.

@axic
axic / README.md
Last active December 15, 2021 03:14
ewasm “WRC20” token contract coding challenge

ewasm “WRC20” token contract coding challenge

This document describes a simple contract in pseudocode and gives a couple of test cases for it.

The challenge is designed to be fairly easy to implement in a language of choice, compiled to wasm and interacted with. It is loosely based on the ERC20 token standard, named "WRC20", where the W stands for WebAssembly.

External interface

The contract has two features:

@tschubotz
tschubotz / gnosis_safe_developer_resources.md
Last active January 15, 2021 16:11
Gnosis Safe - Developer Resources and links

A payment channel protocol for LES incentivization

Author: Zsolt Felfoldi ([email protected])

Special thanks to:

  • Daniel A. Nagy for the idea of the "stamper" role
  • Viktor Tron and the rest of the Swarm team for their work on the SWAP, SWEAR and SWINDLE framework

Abstract

@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active March 13, 2025 16:33
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

#!/usr/bin/env bash
cat <<EOF | xargs -L1 ipfs ping -n 1
QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA
QmbVWZQhCGrS7DhgLqWbgvdmKN7JueKCREVanfnVpgyq8x
QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE
QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR
QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i
EOF

These blocks have been mined on the old mainnet chain, presumably having failed to update the miner software for the Constantinople fork - a waste of money...

block 7280000 miner 0x06b8c5883ec71bc3f4b332081519f23834c8706e extradata .......geth.go1.10.4.linux
block 7280001 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
block 7280002 miner 0x28974b4a92e7be907418722b37446f2eb60184cc extradata .......geth.go1.10.linux
block 7280003 miner 0x06b8c5883ec71bc3f4b332081519f23834c8706e extradata .......geth.go1.10.4.linux
block 7280004 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
block 7280005 miner 0x8e59176cd996342da6fdf20c85cb02bca095d552 extradata .Grupo+58
block 7280006 miner 0x96338149e9f6c262d4cb7aeec1cf4c652079a11c extradata .......Parity-Ethereum.1.30.1.li
@houssemzaier
houssemzaier / SticktModeUtil.kt
Created February 9, 2020 22:23
This solution gives the possibility to just hide the "android.os.strictmode.UntaggedSocketViolation" or just log it in a verbose lever, which I prefer.
@RequiresApi(Build.VERSION_CODES.P)
fun StrictMode.VmPolicy.Builder.detectAllExpect(ignoredViolationPackageName: String, justVerbose: Boolean = true): StrictMode.VmPolicy.Builder {
return detectAll()
.penaltyListener(Executors.newSingleThreadExecutor(), StrictMode.OnVmViolationListener
{
it.filter(ignoredViolationPackageName, justVerbose)
})
}

Anonymous: a proof-of-unique-human system

Anonymous is a coordination game for global proof-of-unique-human, through monthly pseudonym events that last 15 minutes, where every single person on Earth is randomly paired together with another person, 1-on-1, to verify that the other is a human being, in a pseudo-anonymous context. The proof-of-unique-human is that you are with the same person for the whole event. The proof-of-unique-human is untraceable from month to month, much like cash. True anonymity.

When you register for Anonymous, you use register(). You need a “registrationToken” that you got if you were verified in the last event. You can see one be deducted from your account with registrationToken[msg.sender]--. The purpose of the registration tokens is that you can easily mix them, so that your personhood is not traceable from month to month.

function register() public scheduler {

require(isReg(msg.sender) == false && data[schedule].tokens[1

@dmihal
dmihal / L2TransferHelper.sol
Created December 1, 2021 19:14
Ticket payment scripts
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
interface IDai {
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
// function permit(address holder, address spender, uint256 nonce, uint256 expiry,
// bool allowed, uint8 v, bytes32 r, bytes32 s) external;
function transferFrom(address, address, uint256) external returns (bool);
function balanceOf(address) external view returns (uint256);
@mmv08
mmv08 / wallet_batchTransactions.md
Last active May 13, 2022 10:45
# wallet_batchTransactions JSON-RPC method (v1, EOA-compatible)