Skip to content

Instantly share code, notes, and snippets.

View jtriley2p's full-sized avatar

Riley jtriley2p

View GitHub Profile
@jtriley2p
jtriley2p / Signatures.md
Last active January 26, 2022 20:25
Biconomy Function Signatures

Biconomy Function Signatures

// ---------------------------------- //
// signature
"getNonce(address,uint256)"

// keccak256 hash
0x895358038f2a11adf6dc83f52acf8e031067227760d4efa3d9a55399e3a98616
@jtriley2p
jtriley2p / ERC20ForwardRequest.sol
Created January 26, 2022 17:38
ERC20 Forward Request Struct
interface IForwarder {
/// @dev Full ERC20 Forward Request, Not all fields are relevant
/// @param from Account that signs the metatransaction (sender)
/// @param to Target address to execute function call (Superfluid host)
/// @param token Token to collect meta-tx fees in (not applicable)
/// @param txGas Gas provided for call execution
/// @param tokenGasPrice Token amount for meta-tx fee (not applicable)
/// @param batchId Unique ID of meta-tx batch
/// @param batchNonce Nonce unique to `from` and `batchId`
/// @param deadliine Execution deadline timestamp (zero for no deadline)
@jtriley2p
jtriley2p / MetaStreamCloser.draft.md
Created January 25, 2022 17:21
Closing Flows on a User's Behalf with Meta Transactions

MetaStreamCloser

Abstract

The MetaStreamCloser contract allows a user to provide a digital signature, giving permission to a third party to close streams on the user's behalf. A stream's sender or receiver may propmt the contract for a message to sign, the message being a deleteFlow function call. By generating a signature and sending it to a third party, that third party has access to explicitly delete the unique flow of a token between the sender and receiver exactly once.

@jtriley2p
jtriley2p / idaBatch.ts
Last active January 19, 2022 23:49
IDAv1 Batch Call
import { Framework } from '@superfluid-finance/sdk-core'
import { ethers } from 'ethers'
// extracted from `./.env`
const apiKey = process.env.API_KEY
const privateKey = process.env.PRIV_KEY
// intializing
const provider = new ethers.providers.InfuraProvider('matic', apiKey)
const sf = await Framework.create({ networkName: 'matic', provider })
@jtriley2p
jtriley2p / YulContract.yul
Last active January 12, 2022 15:22
Simple Yul Contract Implementation
/// @title Simple read-write contract written in Yul
/// @author jtriley.eth
/// @notice This is designed to be functionally identical to ./SolidityContract.sol
/// This is for educational purposes only, do not use in production.
object "YulContract" {
code {
/// @dev Deploys the contract
datacopy(0, dataoffset("runtime"), datasize("runtime"))
return (0, datasize("runtime"))
}
@jtriley2p
jtriley2p / SolidityContract.sol
Last active January 12, 2022 15:16
Simple Solidity Contract Implementation
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Simple read-write contract written in Solidity
/// @author jtriley.eth
/// @notice This is designed to be functionally identical to ./YulContract.sol
/// This is for educational purposes only, do not use in production.
contract SolidityContract {
/// @notice emitted when _myNumber is set