add code & tests

This commit is contained in:
ButterflyEffect 2024-01-03 19:12:52 +00:00
commit b895b8658d
16 changed files with 20232 additions and 0 deletions

11
.gitignore vendored Normal file

@ -0,0 +1,11 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types
# Hardhat files
cache
artifacts

19
.prettierrc Normal file

@ -0,0 +1,19 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true
}
},
{"files": "*.js", "options": {
"bracketSpacing": true,
"printWidth": 120
}}
],
"bracketSpacing": true
}

9
README.md Normal file

@ -0,0 +1,9 @@
# Proposal 45
Set me as official Tornado dev
Deploy: npx hardhat run --network mainnet script/deploy.js
Tests: npm run test
Dont forget to fill env file

30
contracts/Proposal.sol Normal file

@ -0,0 +1,30 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./interfaces/IERC20.sol";
import { ISablier } from "./interfaces/ISablier.sol"; // copied from proposal 28
contract Proposal {
address constant me = 0xeb3E49Af2aB5D5D0f83A9289cF5a34d9e1f6C5b4;
address constant torn = 0x77777FeDdddFfC19Ff86DB637967013e6C6A116C;
address constant sablier = 0xCD18eAa163733Da39c232722cBC4E8940b1D8888;
uint256 constant quarterDuration = 91 days;
uint256 constant remunerationAmount = 16666 ether;
function executeProposal() external {
// from proposal 28
uint256 remunerationNormalizedAmount = remunerationAmount - (remunerationAmount % quarterDuration);
uint256 remunerationPeriodStart = block.timestamp;
IERC20(torn).approve(sablier, remunerationNormalizedAmount);
ISablier(sablier).createStream(
me,
remunerationNormalizedAmount,
torn,
remunerationPeriodStart,
remunerationPeriodStart + quarterDuration
);
}
}

@ -0,0 +1,6 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface IERC20 {
function approve(address spender, uint256 amount) external returns (bool);
}

@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
struct SablierStream {
address sender;
address recipient;
uint256 deposit;
address token;
uint256 startTime;
uint256 stopTime;
uint256 remainingBalance;
uint256 ratePerSecond;
}
interface ISablier {
function createStream(address recipent, uint256 deposit, address tokenAddress, uint256 startTime, uint256 stopTime)
external
returns (uint256);
function getStream(uint256 streamId) external view returns (SablierStream memory);
}

48
hardhat.config.js Normal file

@ -0,0 +1,48 @@
require("@nomicfoundation/hardhat-toolbox");
require("hardhat-gas-reporter");
require("dotenv").config();
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
mocha: {
timeout: 100000000,
},
networks: {
mainnet: {
url: "https://ethereum.publicnode.com",
accounts: [process.env.REAL_PK],
},
testnet: {
url: "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
accounts: [process.env.TEST_PK],
},
hardhat: {
forking: {
url: "https://rpc.mevblocker.io/fast",
enabled: true,
blockNumber: 18919895,
accounts: [process.env.REAL_PK],
},
chainId: 1,
accounts: [
{
privateKey: process.env.REAL_PK,
balance: "10000000000000000000000000000000",
},
],
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY,
},
gasReporter: {
enabled: false
}
};

17717
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

45
package.json Normal file

@ -0,0 +1,45 @@
{
"name": "proposal-45",
"version": "1.0.0",
"description": "",
"main": "hardhat.config.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "npx hardhat test",
"deploy": "npx hardhat run --network mainnet scripts/deploy.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.1.1",
"@typechain/ethers-v6": "^0.4.3",
"@typechain/hardhat": "^8.0.3",
"@types/chai": "^4.3.9",
"@types/mocha": "^10.0.2",
"chai": "^4.3.10",
"chai-things": "^0.2.0",
"dotenv": "^16.3.1",
"ethers": "^6.8.0",
"hardhat": "^2.18.1",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3",
"solidity-coverage": "^0.8.5",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
"typescript": "^5.2.2"
},
"dependencies": {
"@openzeppelin/contracts": "^3.2.0-rc.0",
"@openzeppelin/upgrades-core": "^1.30.1",
"base58-solidity": "^1.0.2",
"content-hash": "^2.5.2",
"torn-token": "^1.0.8"
}
}

35
scripts/deploy.js Normal file

@ -0,0 +1,35 @@
// We require the Hardhat Runtime Environment explicitly here. This is optional
// but useful for running the script in a standalone fashion through `node <script>`.
//
// You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat
// will compile your contracts, add the Hardhat Runtime Environment's members to the
// global scope, and execute the script.
const hre = require("hardhat");
const { ethers } = require("hardhat");
async function main() {
const proposalFactory = await ethers.getContractFactory("Proposal");
const proposal = await proposalFactory.deploy();
const deployedProposalAddr = await proposal.getAddress();
console.log(
`Proposal contract deployed by address ${deployedProposalAddr}, waiting for blockchain confirmations...`
);
tx = proposal.deploymentTransaction();
await tx.wait(16);
console.log(
"Deployment confirmed with 32 blocks, waiting for verification on Etherscan"
);
await hre.run("verify:verify", {
address: deployedProposalAddr,
contract: "contracts/Proposal.sol:Proposal",
});
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});

122
test/Proposal.js Normal file

@ -0,0 +1,122 @@
const { ethers, network } = require("hardhat");
const contentHash = require('content-hash')
const { expect, assert } = require("chai");
const { time } = require("@nomicfoundation/hardhat-toolbox/network-helpers");
const tornAddr = "0x77777FeDdddFfC19Ff86DB637967013e6C6A116C";
const sablierAddr = "0xCD18eAa163733Da39c232722cBC4E8940b1D8888";
const governanceAddr = "0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce";
async function getManyEth(addr) {
await network.provider.send("hardhat_setBalance", [
addr,
"0x111166630153555558483537",
]);
}
async function getEnsRegistry(){
const ensAddr = "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
return await ethers.getContractAt(require("./abi/ensRegistry.abi.json"), ensAddr);
}
async function getEnsResolver(ensName){
const ensRegistry = await getEnsRegistry();
const resolverAddr = await ensRegistry.resolver(ethers.namehash(ensName));
return await ethers.getContractAt(require("./abi/ensResolver.abi.json"), resolverAddr);
}
async function resolveAddr(ensName) {
if (ethers.isAddress(ensName)) return ensName;
const ensResolver = await getEnsResolver(ensName);
return await ensResolver.addr(ethers.namehash(ensName));
}
async function getTornContract() {
return await ethers.getContractAt(require("./abi/torn.abi.json"), tornAddr);
}
async function getSablierContract(){
return await ethers.getContractAt(require("./abi/sabler.abi.json"), sablierAddr);
}
async function deployAndExecuteProposal() {
const proposalFactory = await ethers.getContractFactory("Proposal");
const proposal = await proposalFactory.deploy();
const deployedProposalAddr = await proposal.getAddress();
const bigStakerAddr = "0xAd0dC9b5bf4308Cc26C1d44E1BEB2d30c43Bca1b";
await getManyEth(bigStakerAddr);
const stakerSigner = await ethers.getImpersonatedSigner(bigStakerAddr);
const governanceContract = await ethers.getContractAt(
require("./abi/governance.abi.json"),
governanceAddr,
stakerSigner
);
await governanceContract.propose(deployedProposalAddr, "");
const proposalId = await governanceContract.proposalCount();
await time.increase(60 * 60);
await governanceContract.castVote(proposalId, true);
await time.increase(60 * 60 * 24 * 7 + 60);
await governanceContract.execute(proposalId);
await time.increase(60 * 60 * 24 * 4);
}
async function getMe(){
return await resolveAddr("butterfly-attractor.eth");
}
describe("Proposal results check", function () {
beforeEach(async function () {
await network.provider.request({
method: "hardhat_reset",
params: [
{
forking: {
jsonRpcUrl: config.networks.hardhat.forking.url,
blockNumber: config.networks.hardhat.forking.blockNumber,
},
},
],
});
});
async function getStreamArgs(){
const sablier = await getSablierContract();
const filter = sablier.filters.CreateStream;
const events = await sablier.queryFilter(filter, config.networks.hardhat.forking.blockNumber - 1);
return events[0].args;
}
it("Stream should be open correct", async function(){
await deployAndExecuteProposal();
const streamArgs = await getStreamArgs();
expect(streamArgs[1]).to.be.equal(governanceAddr);
expect(streamArgs[2]).to.be.equal(await getMe());
expect(streamArgs[3]).to.be.greaterThan(16500n * 10n ** 18n);
expect(streamArgs[4]).to.be.equal(tornAddr);
})
it("I should be able to withdraw tokens at the end of stream", async function(){
await deployAndExecuteProposal();
const streamArgs = await getStreamArgs();
const streamId = streamArgs[0];
const streamAmount = streamArgs[3];
const sablier = await getSablierContract();
const me = await getMe();
const meAsSigner = await ethers.getSigner(me);
const sablierContract = sablier.connect(meAsSigner);
const torn = await getTornContract();
const myOldBalance = await torn.balanceOf(me);
await expect(sablierContract.withdrawFromStream(streamId, streamAmount)).to.be.revertedWith("amount exceeds the available balance");
await time.increase(60 * 60 * 24 * 91 + 60);
await sablierContract.withdrawFromStream(streamId, streamAmount);
const myNewBalance = await torn.balanceOf(me);
expect(myNewBalance - myOldBalance).to.be.greaterThan(16500n * 10n ** 18n);
expect(myNewBalance - myOldBalance).to.be.equal(streamAmount);
})
});

@ -0,0 +1,274 @@
[
{
"inputs": [
{ "internalType": "contract ENS", "name": "_old", "type": "address" }
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "label",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "NewOwner",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "resolver",
"type": "address"
}
],
"name": "NewResolver",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint64",
"name": "ttl",
"type": "uint64"
}
],
"name": "NewTTL",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "Transfer",
"type": "event"
},
{
"constant": true,
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "address", "name": "operator", "type": "address" }
],
"name": "isApprovedForAll",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "old",
"outputs": [
{ "internalType": "contract ENS", "name": "", "type": "address" }
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "recordExists",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "resolver",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "address", "name": "operator", "type": "address" },
{ "internalType": "bool", "name": "approved", "type": "bool" }
],
"name": "setApprovalForAll",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "owner", "type": "address" }
],
"name": "setOwner",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "address", "name": "resolver", "type": "address" },
{ "internalType": "uint64", "name": "ttl", "type": "uint64" }
],
"name": "setRecord",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "resolver", "type": "address" }
],
"name": "setResolver",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes32", "name": "label", "type": "bytes32" },
{ "internalType": "address", "name": "owner", "type": "address" }
],
"name": "setSubnodeOwner",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes32", "name": "label", "type": "bytes32" },
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "address", "name": "resolver", "type": "address" },
{ "internalType": "uint64", "name": "ttl", "type": "uint64" }
],
"name": "setSubnodeRecord",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "uint64", "name": "ttl", "type": "uint64" }
],
"name": "setTTL",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "ttl",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]

@ -0,0 +1,671 @@
[
{
"inputs": [
{ "internalType": "contract ENS", "name": "_ens", "type": "address" },
{
"internalType": "contract INameWrapper",
"name": "wrapperAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_trustedETHController",
"type": "address"
},
{
"internalType": "address",
"name": "_trustedReverseRegistrar",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "uint256",
"name": "contentType",
"type": "uint256"
}
],
"name": "ABIChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address",
"name": "a",
"type": "address"
}
],
"name": "AddrChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "coinType",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes",
"name": "newAddress",
"type": "bytes"
}
],
"name": "AddressChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "delegate",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "Approved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "hash",
"type": "bytes"
}
],
"name": "ContenthashChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "name",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint16",
"name": "resource",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "record",
"type": "bytes"
}
],
"name": "DNSRecordChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "name",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint16",
"name": "resource",
"type": "uint16"
}
],
"name": "DNSRecordDeleted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes",
"name": "lastzonehash",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "zonehash",
"type": "bytes"
}
],
"name": "DNSZonehashChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "bytes4",
"name": "interfaceID",
"type": "bytes4"
},
{
"indexed": false,
"internalType": "address",
"name": "implementer",
"type": "address"
}
],
"name": "InterfaceChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "NameChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "x",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "y",
"type": "bytes32"
}
],
"name": "PubkeyChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "string",
"name": "indexedKey",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "key",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "value",
"type": "string"
}
],
"name": "TextChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint64",
"name": "newVersion",
"type": "uint64"
}
],
"name": "VersionChanged",
"type": "event"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "uint256", "name": "contentTypes", "type": "uint256" }
],
"name": "ABI",
"outputs": [
{ "internalType": "uint256", "name": "", "type": "uint256" },
{ "internalType": "bytes", "name": "", "type": "bytes" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "addr",
"outputs": [
{ "internalType": "address payable", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "uint256", "name": "coinType", "type": "uint256" }
],
"name": "addr",
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "delegate", "type": "address" },
{ "internalType": "bool", "name": "approved", "type": "bool" }
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "clearRecords",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "contenthash",
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes32", "name": "name", "type": "bytes32" },
{ "internalType": "uint16", "name": "resource", "type": "uint16" }
],
"name": "dnsRecord",
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes32", "name": "name", "type": "bytes32" }
],
"name": "hasDNSRecords",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
],
"name": "interfaceImplementer",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "delegate", "type": "address" }
],
"name": "isApprovedFor",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "account", "type": "address" },
{ "internalType": "address", "name": "operator", "type": "address" }
],
"name": "isApprovedForAll",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes[]", "name": "data", "type": "bytes[]" }
],
"name": "multicall",
"outputs": [
{ "internalType": "bytes[]", "name": "results", "type": "bytes[]" }
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "nodehash", "type": "bytes32" },
{ "internalType": "bytes[]", "name": "data", "type": "bytes[]" }
],
"name": "multicallWithNodeCheck",
"outputs": [
{ "internalType": "bytes[]", "name": "results", "type": "bytes[]" }
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "name",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "pubkey",
"outputs": [
{ "internalType": "bytes32", "name": "x", "type": "bytes32" },
{ "internalType": "bytes32", "name": "y", "type": "bytes32" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"name": "recordVersions",
"outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "uint256", "name": "contentType", "type": "uint256" },
{ "internalType": "bytes", "name": "data", "type": "bytes" }
],
"name": "setABI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "uint256", "name": "coinType", "type": "uint256" },
{ "internalType": "bytes", "name": "a", "type": "bytes" }
],
"name": "setAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "address", "name": "a", "type": "address" }
],
"name": "setAddr",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "operator", "type": "address" },
{ "internalType": "bool", "name": "approved", "type": "bool" }
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes", "name": "hash", "type": "bytes" }
],
"name": "setContenthash",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes", "name": "data", "type": "bytes" }
],
"name": "setDNSRecords",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" },
{ "internalType": "address", "name": "implementer", "type": "address" }
],
"name": "setInterface",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "string", "name": "newName", "type": "string" }
],
"name": "setName",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes32", "name": "x", "type": "bytes32" },
{ "internalType": "bytes32", "name": "y", "type": "bytes32" }
],
"name": "setPubkey",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "string", "name": "key", "type": "string" },
{ "internalType": "string", "name": "value", "type": "string" }
],
"name": "setText",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "bytes", "name": "hash", "type": "bytes" }
],
"name": "setZonehash",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
],
"name": "supportsInterface",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" },
{ "internalType": "string", "name": "key", "type": "string" }
],
"name": "text",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "zonehash",
"outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
"stateMutability": "view",
"type": "function"
}
]

@ -0,0 +1,636 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "stakingRewardsAddress",
"type": "address"
},
{ "internalType": "address", "name": "gasCompLogic", "type": "address" },
{
"internalType": "address",
"name": "userVaultAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "Delegated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "proposer",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "target",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
},
{
"indexed": false,
"internalType": "string",
"name": "description",
"type": "string"
}
],
"name": "ProposalCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
}
],
"name": "ProposalExecuted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "bytes",
"name": "errorData",
"type": "bytes"
}
],
"name": "RewardUpdateFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "RewardUpdateSuccessful",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
}
],
"name": "Undelegated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "proposalId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "voter",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "support",
"type": "bool"
},
{
"indexed": false,
"internalType": "uint256",
"name": "votes",
"type": "uint256"
}
],
"name": "Voted",
"type": "event"
},
{
"inputs": [],
"name": "CLOSING_PERIOD",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EXECUTION_DELAY",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "EXECUTION_EXPIRATION",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PROPOSAL_THRESHOLD",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "QUORUM_VOTES",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Staking",
"outputs": [
{
"internalType": "contract ITornadoStakingRewards",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VOTE_EXTEND_TIME",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VOTING_DELAY",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VOTING_PERIOD",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32[]", "name": "domains", "type": "bytes32[]" }
],
"name": "bulkResolve",
"outputs": [
{ "internalType": "address[]", "name": "result", "type": "address[]" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "canWithdrawAfter",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address[]", "name": "from", "type": "address[]" },
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" },
{ "internalType": "bool", "name": "support", "type": "bool" }
],
"name": "castDelegatedVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" },
{ "internalType": "bool", "name": "support", "type": "bool" }
],
"name": "castVote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" }
],
"name": "checkIfQuorumReached",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }],
"name": "delegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "delegatedTo",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" }
],
"name": "execute",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "gasCompensationVault",
"outputs": [
{
"internalType": "contract IGasCompensationVault",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" },
{ "internalType": "address", "name": "voter", "type": "address" }
],
"name": "getReceipt",
"outputs": [
{
"components": [
{ "internalType": "bool", "name": "hasVoted", "type": "bool" },
{ "internalType": "bool", "name": "support", "type": "bool" },
{ "internalType": "uint256", "name": "votes", "type": "uint256" }
],
"internalType": "struct Governance.Receipt",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" },
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "hasAccountVoted",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "_torn", "type": "bytes32" }
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "latestProposalIds",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
{ "internalType": "uint8", "name": "v", "type": "uint8" },
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
],
"name": "lock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "lockWithApproval",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "lockedBalance",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "proposalCodehashes",
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proposalCount",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "proposals",
"outputs": [
{ "internalType": "address", "name": "proposer", "type": "address" },
{ "internalType": "address", "name": "target", "type": "address" },
{ "internalType": "uint256", "name": "startTime", "type": "uint256" },
{ "internalType": "uint256", "name": "endTime", "type": "uint256" },
{ "internalType": "uint256", "name": "forVotes", "type": "uint256" },
{ "internalType": "uint256", "name": "againstVotes", "type": "uint256" },
{ "internalType": "bool", "name": "executed", "type": "bool" },
{ "internalType": "bool", "name": "extended", "type": "bool" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "target", "type": "address" },
{ "internalType": "string", "name": "description", "type": "string" }
],
"name": "propose",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "from", "type": "address" },
{ "internalType": "address", "name": "target", "type": "address" },
{ "internalType": "string", "name": "description", "type": "string" }
],
"name": "proposeByDelegate",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "resolve",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "returnMultisigAddress",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "closingPeriod", "type": "uint256" }
],
"name": "setClosingPeriod",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "executionDelay", "type": "uint256" }
],
"name": "setExecutionDelay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "executionExpiration",
"type": "uint256"
}
],
"name": "setExecutionExpiration",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "gasCompensationsLimit",
"type": "uint256"
}
],
"name": "setGasCompensations",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "proposalThreshold",
"type": "uint256"
}
],
"name": "setProposalThreshold",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "quorumVotes", "type": "uint256" }
],
"name": "setQuorumVotes",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "voteExtendTime", "type": "uint256" }
],
"name": "setVoteExtendTime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "votingDelay", "type": "uint256" }
],
"name": "setVotingDelay",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "votingPeriod", "type": "uint256" }
],
"name": "setVotingPeriod",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "proposalId", "type": "uint256" }
],
"name": "state",
"outputs": [
{
"internalType": "enum Governance.ProposalState",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "torn",
"outputs": [
{ "internalType": "contract TORN", "name": "", "type": "address" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "undelegate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "unlock",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "userVault",
"outputs": [
{
"internalType": "contract ITornadoVault",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "withdrawFromHelper",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{ "stateMutability": "payable", "type": "receive" }
]

217
test/abi/sabler.abi.json Normal file

@ -0,0 +1,217 @@
[
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "streamId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "senderBalance",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "recipientBalance",
"type": "uint256"
}
],
"name": "CancelStream",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "streamId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "deposit",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stopTime",
"type": "uint256"
}
],
"name": "CreateStream",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "streamId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "WithdrawFromStream",
"type": "event"
},
{
"constant": true,
"inputs": [
{ "internalType": "uint256", "name": "streamId", "type": "uint256" },
{ "internalType": "address", "name": "who", "type": "address" }
],
"name": "balanceOf",
"outputs": [
{ "internalType": "uint256", "name": "balance", "type": "uint256" }
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "uint256", "name": "streamId", "type": "uint256" }
],
"name": "cancelStream",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "deposit", "type": "uint256" },
{ "internalType": "address", "name": "tokenAddress", "type": "address" },
{ "internalType": "uint256", "name": "startTime", "type": "uint256" },
{ "internalType": "uint256", "name": "stopTime", "type": "uint256" }
],
"name": "createStream",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "uint256", "name": "streamId", "type": "uint256" }
],
"name": "deltaOf",
"outputs": [
{ "internalType": "uint256", "name": "delta", "type": "uint256" }
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "uint256", "name": "streamId", "type": "uint256" }
],
"name": "getStream",
"outputs": [
{ "internalType": "address", "name": "sender", "type": "address" },
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "deposit", "type": "uint256" },
{ "internalType": "address", "name": "tokenAddress", "type": "address" },
{ "internalType": "uint256", "name": "startTime", "type": "uint256" },
{ "internalType": "uint256", "name": "stopTime", "type": "uint256" },
{
"internalType": "uint256",
"name": "remainingBalance",
"type": "uint256"
},
{ "internalType": "uint256", "name": "ratePerSecond", "type": "uint256" }
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "nextStreamId",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{ "internalType": "uint256", "name": "streamId", "type": "uint256" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "withdrawFromStream",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]

370
test/abi/torn.abi.json Normal file

@ -0,0 +1,370 @@
[
{
"inputs": [
{ "internalType": "bytes32", "name": "_governance", "type": "bytes32" },
{ "internalType": "uint256", "name": "_pausePeriod", "type": "uint256" },
{
"components": [
{ "internalType": "bytes32", "name": "to", "type": "bytes32" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"internalType": "struct TORN.Recipient[]",
"name": "_vestings",
"type": "tuple[]"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "target",
"type": "address"
}
],
"name": "Allowed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "target",
"type": "address"
}
],
"name": "Disallowed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event"
},
{
"inputs": [
{ "internalType": "address[]", "name": "target", "type": "address[]" }
],
"name": "addToAllowedList",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "address", "name": "spender", "type": "address" }
],
"name": "allowance",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "allowedTransferee",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "spender", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "approve",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "balanceOf",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "blockTimestamp",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32[]", "name": "domains", "type": "bytes32[]" }
],
"name": "bulkResolve",
"outputs": [
{ "internalType": "address[]", "name": "result", "type": "address[]" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "account", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "burnFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "canUnpauseAfter",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "chainID",
"outputs": [
{ "internalType": "uint256", "name": "_chainID", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bool", "name": "decision", "type": "bool" }],
"name": "changeTransferability",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "spender", "type": "address" },
{
"internalType": "uint256",
"name": "subtractedValue",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "governance",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "spender", "type": "address" },
{ "internalType": "uint256", "name": "addedValue", "type": "uint256" }
],
"name": "increaseAllowance",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" }
],
"name": "nonces",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" },
{ "internalType": "address", "name": "spender", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
{ "internalType": "uint256", "name": "deadline", "type": "uint256" },
{ "internalType": "uint8", "name": "v", "type": "uint8" },
{ "internalType": "bytes32", "name": "r", "type": "bytes32" },
{ "internalType": "bytes32", "name": "s", "type": "bytes32" }
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address[]", "name": "target", "type": "address[]" }
],
"name": "removeFromAllowedList",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_token",
"type": "address"
},
{ "internalType": "address payable", "name": "_to", "type": "address" },
{ "internalType": "uint256", "name": "_balance", "type": "uint256" }
],
"name": "rescueTokens",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "bytes32", "name": "node", "type": "bytes32" }
],
"name": "resolve",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "transfer",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "sender", "type": "address" },
{ "internalType": "address", "name": "recipient", "type": "address" },
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
],
"name": "transferFrom",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "nonpayable",
"type": "function"
}
]