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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @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")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
/// @title Interface extracted from Biconomy Source Code. | |
/// @author jtriley.eth | |
/// @notice This allows us to interface with the Trusted Forwarder contract that | |
/// will call the respective functions on the Superfluid host. | |
interface IForwarder { | |
/// @dev Full ERC20 Forward Request, Not all fields are relevant |
There is an increasing need for off-chain infrastructure in the Supefluid ecosystem as more projects, protocols, and individuals need to interact with contracts in complex, scheduled, or automated ways. This includes, but is not limited to, insolvent stream liquidation, pre-insolvency courtesy stream closures, scheduled transactions, and meta transactions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selecetor | contract_name | signature_type | signature | |
---|---|---|---|---|
0x0023de29 | ERC777RecipientDrainingGas | function | tokensReceived(address,address,address,uint256,bytes,bytes) | |
0x0023de29 | ERC777RecipientReverting | function | tokensReceived(address,address,address,uint256,bytes,bytes) | |
0x0023de29 | IERC777Recipient | function | tokensReceived(address,address,address,uint256,bytes,bytes) | |
0x0023de29 | TOGA | function | tokensReceived(address,address,address,uint256,bytes,bytes) | |
0x00fdd58e | ERC1155 | function | balanceOf(address,uint256) | |
0x00fdd58e | ERC1155Burnable | function | balanceOf(address,uint256) | |
0x00fdd58e | ERC1155Pausable | function | balanceOf(address,uint256) | |
0x00fdd58e | ERC1155PresetMinterPauser | function | balanceOf(address,uint256) | |
0x00fdd58e | ERC1155Supply | function | balanceOf(address,uint256) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --snip-- | |
_host.callAgreement( | |
_cfa, | |
abi.encodeWithSelector( | |
_cfa.createFlow.selector, | |
token, | |
receiver, | |
flowRate, | |
new bytes(0) |
OlderNewer