Skip to content

Instantly share code, notes, and snippets.

@elijahboston
elijahboston / StorageWithOwnership.sol
Created October 19, 2023 16:57
StorageWithOwnership.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract StorageWithOwnership {
uint256 number;
address public owner;
constructor() {
owner = msg.sender;
@elijahboston
elijahboston / payloads.js
Last active October 19, 2023 16:24
particle error
// this works, 0x455... is a wallet address
{
"method": "particle_aa_getFeeQuotes",
"params": [
"Qy_1j8BvF.ede01527-4f25-4a26-83ab-e3b41283693f",
"0xae934CFEbdf0798C8d7721d5ADF2adAc8d43Ae55",
[
{
"to": "0x4559b1771b1d7C1846d91a91335273C3a28f9395"
}
@elijahboston
elijahboston / factory.sol
Created October 18, 2023 14:58
contract factory contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// _____ _ _ _ _ _____ _
// / ___| | | | | | | |_ _| | |
// \ `--.| |_ ___ __ _| | |_| |__ | | ___ ___| |_
// `--. \ __/ _ \/ _` | | __| '_ \| |/ _ \/ __| __|
// /\__/ / || __/ (_| | | |_| | | | | __/\__ \ |_
// \____/ \__\___|\__,_|_|\__|_| |_\_/\___||___/\__|
//
@elijahboston
elijahboston / storage.sol
Created October 12, 2023 18:18
contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
@elijahboston
elijahboston / particle_tx.txt
Created October 12, 2023 18:14
successful particle tx
{
"method": "particle_aa_getFeeQuotes",
"params": [
"Qy_1j8BvF.ede01527-4f25-4a26-83ab-e3b41283693f",
"0x1E15a71F3d1841708dBA1F2C0e6e4eB388Fe9c5A",
[
{
"to": "0x1E15a71F3d1841708dBA1F2C0e6e4eB388Fe9c5A",
"data": "0x608060405234801561001057600080fd5b50610150806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80632e64cec11461003b5780636057361d14610059575b600080fd5b610043610075565b60405161005091906100a1565b60405180910390f35b610073600480360381019061006e91906100ed565b61007e565b005b60008054905090565b8060008190555050565b6000819050919050565b61009b81610088565b82525050565b60006020820190506100b66000830184610092565b92915050565b600080fd5b6100ca81610088565b81146100d557600080fd5b50565b6000813590506100e7816100c1565b92915050565b600060208284031215610103576101026100bc565b5b6000610111848285016100d8565b9150509291505056fea2646970667358221220aa1920a6b5a5aafd58b893f268df436f513d63357ecfdf0a894f99089b74ae9764736f6c63430008120033"
}
{
"method": "particle_aa_getFeeQuotes",
"params": [
"Qy_1j8BvF.ede01527-4f25-4a26-83ab-e3b41283693f",
"0x1E15a71F3d1841708dBA1F2C0e6e4eB388Fe9c5A",
[
{
"to": "0xe851A53e94B3D46723748D2C5770A92B692D3bEE",
"data": "0x60c0604052610141608090815250662386f26fc1000060a0908152503480156200002857600080fd5b506040518060400160405280600681526020017f52414345525300000000000000000000000000000000000000000000000000008152506040518060400160405280600681526020017f52414345525300000000000000000000000000000000000000000000000000008152508160029081620000a6919062000494565b508060039081620000b8919062000494565b50620000c96200014760201b60201c565b6000819055505050620000f1620000e56200014c60201b60201c565b6200015460201b60201c565b600160098190555060405180604001604052806000151581526020016000815250600a60008201518160000160006101000a81548160ff021916908315150217905550602082015181600101559050506200057b565b600090565b600033905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006
@elijahboston
elijahboston / generic-generator.ts
Created June 3, 2020 15:53
Generic Array Generator
/**
* A generic generator that returns the next item in the array each time it's called.
* @param arr An array of items
*/
function* arrayGenerator<T>(arr: T[] | undefined) {
if (!arr) {
return undefined;
}
for (const item of arr) {
yield item;
@elijahboston
elijahboston / flatten.js
Last active September 23, 2019 03:20
Flatten Multi-dimensional Arrays
// Full source and tests available from https://github.com/elijahboston/flatten
// Flatten a multi-dimensional array
// by recursively concatenating non-Array
// elements
// Ex: flatten([0, [1, 2], [3, 4]]) -> [0, 1, 2, 3, 4,]
const flatten = arr =>
// Use a reducer since its behavior is well
// suited to recursion
arr.reduce(
@elijahboston
elijahboston / custom.zsh
Last active August 17, 2019 17:41
ZSH Aliases and Functions
### GENERAL PURPOSE
# Find out what's running on the given port
# > onport 8080
onport() {
lsof -w -n -i tcp:${1}
}
### AWS
# Find out what's running on the given port
# > onport 8080
function onport() {
lsof -w -n -i tcp:${1}
}