Skip to content

Instantly share code, notes, and snippets.

@naps62
naps62 / ethui-v2.md
Last active October 25, 2024 11:14
ethui v2

ethui v2 (formerly Iron wallet)

overall goal: unified setup for building, testing and deploying web3 apps, both smart contracts & web app

ethui app (wallet)

  • lots of improvements to be made, but the main core is good enough to build on top of (famous last words, I know)
  • I truly believe we offer some ideas that are not present in any other developer tool
  • some ideas can absolutely be adapted for end-users (i.e. to provide power-user features, robustness, and a good trade-off between UX and security)
#!/usr/bin/env bash
function check_root() {
id -u
ps -o comm= -p $PPID
if [[ "$(id -u)" -ne 0 || $(ps -o comm= -p $PPID) == "sudo" ]]; then
echo -e "\nExiting..."
exit
fi
}
echo "asd"
@naps62
naps62 / Diva Airdrop Claim.md
Created July 3, 2023 09:59
Diva Airdrop Claim

Claiming the airdrop for Diva

@naps62
naps62 / swap.sol
Created November 11, 2022 19:42
UniswapV3: Swap USDT->WETH->RPL
pragma solidity ^0.8.13;
import "forge-std/Script.sol";
interface UniV3 {
struct ExactInputParams {
bytes path;
address recipient;
uint256 amountIn;
uint256 amountOutMinimum;
name: Test contracts (foundry)
on:
push:
branches:
- master
- foundry
tags:
- "*"
pull_request:
@naps62
naps62 / Justfile
Last active May 25, 2022 14:47
Justfile for compiling Circom circuits
set positional-arguments
build_dir := "./build"
all:
just compile Hello
# TODO add other circuits
#
# Circom compilation
@naps62
naps62 / Ballot.sol
Last active April 23, 2022 20:34
ZKU Application
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/// @title Voting with delegation.
contract Ballot {
// This declares a new complex type which will
// be used for variables later.
// It will represent a single voter.
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
@naps62
naps62 / focus-mode.vim
Last active June 16, 2020 10:08
Vim focus mode
let g:focused = 0
function! Focus()
let g:focused = 1 - g:focused
if g:focused == 1
let b:coc_suggest_disable = 1
:Goyo 120
:Limelight
:Voom markdown
:exe "normal \<C-w>\<C-w>"
%{
configs: [
%{
name: "default",
strict: true,
color: true,
checks: [
# Consistency
{Credo.Check.Consistency.MultiAliasImportRequireUse, false},
@naps62
naps62 / mineTx.js
Created January 15, 2018 10:52
waiting for a transaction to be mined in truffle tests
const toTxHash = (value) => {
if (typeof value === "string") {
// this is probably a tx hash already
return value;
} else if (typeof value.receipt === "object") {
// this is probably a tx object
return value.receipt.transactionHash;
} else {
throw "Unsupported tx type: " + value;
}