Skip to content

Instantly share code, notes, and snippets.

@corbanbrook
corbanbrook / multi-wallet-extension-support.md
Last active May 12, 2022 08:49
Multi Wallet Extension Support

Multi Wallet Extension Support

As more and more web3 wallet projects enter the space, each with their own stregnths and weaknesses, users will have a great deal of choice for not only which wallet they use but which combination of wallets they use. This presents a problem for browser extensions which all expose the window.ethereum provider object.

How do we allow multiple providers to "play nice" with each other?

Problems

1. When multiple wallets extensions are installed which wallet is used?

@mmv08
mmv08 / wallet_batchTransactions.md
Last active May 13, 2022 10:45
# wallet_batchTransactions JSON-RPC method (v1, EOA-compatible)
@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);

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

@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)
})
}

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
#!/usr/bin/env bash
cat <<EOF | xargs -L1 ipfs ping -n 1
QmUd6zHcbkbcs7SMxwLs48qZVX3vpcM8errYS7xEczwRMA
QmbVWZQhCGrS7DhgLqWbgvdmKN7JueKCREVanfnVpgyq8x
QmUEMvxS2e7iDrereVYc5SWPauXPyNwxcy9BXZrC1QTcHE
QmdnXwLrC8p1ueiq2Qya8joNvk3TVVDAut7PrikmZwubtR
QmNSYxZAiJHeLdkBg38roksAR9So7Y5eojks1yjEcUtZ7i
EOF
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 1, 2024 21:12
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"

A payment channel protocol for LES incentivization

Author: Zsolt Felfoldi (zsfelfoldi@ethereum.org)

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

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