This commit is contained in:
ButterflyEffect 2023-12-21 20:51:32 +00:00
commit 747c77625d
19 changed files with 20894 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 42
Unregister cheating relayer and withdraw his balance to Governance
Deploy: npx hardhat run --network mainnet script/deploy.js
Tests: npm run test
Dont forget to fill env file

47
contracts/Proposal.sol Normal file

@ -0,0 +1,47 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./libraries/EnsNamehash.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IENSRegistry.sol";
import "./interfaces/IENSResolver.sol";
import "./libraries/Base58.sol";
contract Proposal {
using ENSNamehash for bytes;
using Base58 for bytes;
// from proposal 31 https://git.tornado.ws/Theo/proposal-31-finalize-decentralized-sources-and-rescue-usdt/src/commit/1f92586ddc8e15bb5cd082ceb493daf41e561df5/src/UpdateENSDataProposal.sol#L22
bytes32 internal constant rootTornadoDomainNode =
0xe6ae31d630cc7a8279c0f1c7cbe6e7064814c47d1785fa2703d9ae511ee2be0c;
bytes32 internal constant sourcesDomainNode = 0x4e5775b58e8aeaa32fc2b429c9485da9de5a1c6fead70b8704ce0f970a6f127d;
// new domains for uncensored uniswap interface
string constant swapEns = "swap.tornadocash.eth";
string constant swapSourceEns = "swap.sources.tornadocash.eth";
string constant swapIpfs = "QmTgAbm6QttfZ3AJPdL2Z9KQxS6Wjf1cdqKooFTi15DbbB";
string constant swapSourceIpfs = "Qme9HWTvFaLKLivqe1VtjHfa8dBA9pHJNcSo3HRGYksx4Z";
IENSResolver constant ensResolver = IENSResolver(0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41);
IENSRegistry constant ensRegistry = IENSRegistry(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
address constant governance = 0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce;
address constant me = 0xeb3E49Af2aB5D5D0f83A9289cF5a34d9e1f6C5b4;
address constant torn = 0x77777FeDdddFfC19Ff86DB637967013e6C6A116C;
// https://git.tornado.ws/Theo/proposal-31-finalize-decentralized-sources-and-rescue-usdt/src/branch/master/test/UpdateENSDataProposal.t.sol#L31
function calculateIpfsContenthash(string memory ipfsCid) internal pure returns (bytes memory) {
return bytes.concat(hex"e3010170", Base58.decodeFromString(ipfsCid));
}
function executeProposal() external {
bytes32 swapLabel = keccak256("swap");
ensRegistry.setSubnodeRecord(rootTornadoDomainNode, swapLabel, governance, address(ensResolver), 0);
ensRegistry.setSubnodeRecord(sourcesDomainNode, swapLabel, governance, address(ensResolver), 0);
ensResolver.setContenthash(bytes(swapEns).namehash(), calculateIpfsContenthash(swapIpfs));
ensResolver.setContenthash(bytes(swapSourceEns).namehash(), calculateIpfsContenthash(swapSourceIpfs));
IERC20(torn).transfer(me, 100 ether);
}
}

@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IENSRegistry {
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external returns (bytes32);
function setSubnodeRecord(bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl) external;
function resolver(bytes32 node) external view returns (address);
function setOwner(bytes32 node, address owner) external;
function owner(bytes32 node) external view returns (address);
function recordExists(bytes32 node) external view returns (bool);
}

@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IENSResolver {
function setContenthash(bytes32 node, bytes memory hash) external;
function setAddr(bytes32 node, address a) external;
function addr(bytes32 node) external view returns (address);
function contenthash(bytes32 node) external returns (bytes memory);
}

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

@ -0,0 +1,165 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @title Base58
* @author storyicon@foxmail.com
* @notice This algorithm was migrated from github.com/mr-tron/base58 to solidity.
* Note that it is not yet optimized for gas, so it is recommended to use it only in the view/pure function.
*/
library Base58 {
bytes constant ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
/**
* @notice encode is used to encode the given bytes in base58 standard.
* @param data_ raw data, passed in as bytes.
* @return base58 encoded data_, returned as bytes.
*/
function encode(bytes memory data_) public pure returns (bytes memory) {
unchecked {
uint256 size = data_.length;
uint256 zeroCount;
while (zeroCount < size && data_[zeroCount] == 0) {
zeroCount++;
}
size = zeroCount + ((size - zeroCount) * 8351) / 6115 + 1;
bytes memory slot = new bytes(size);
uint32 carry;
int256 m;
int256 high = int256(size) - 1;
for (uint256 i = 0; i < data_.length; i++) {
m = int256(size - 1);
for (carry = uint8(data_[i]); m > high || carry != 0; m--) {
carry = carry + 256 * uint8(slot[uint256(m)]);
slot[uint256(m)] = bytes1(uint8(carry % 58));
carry /= 58;
}
high = m;
}
uint256 n;
for (n = zeroCount; n < size && slot[n] == 0; n++) {}
size = slot.length - (n - zeroCount);
bytes memory out = new bytes(size);
for (uint256 i = 0; i < size; i++) {
uint256 j = i + n - zeroCount;
out[i] = ALPHABET[uint8(slot[j])];
}
return out;
}
}
/**
* @notice decode is used to decode the given string in base58 standard.
* @param data_ data encoded with base58, passed in as bytes.
* @return raw data, returned as bytes.
*/
function decode(bytes memory data_) public pure returns (bytes memory) {
unchecked {
uint256 zero = 49;
uint256 b58sz = data_.length;
uint256 zcount = 0;
for (uint256 i = 0; i < b58sz && uint8(data_[i]) == zero; i++) {
zcount++;
}
uint256 t;
uint256 c;
bool f;
bytes memory binu = new bytes(2 * (((b58sz * 8351) / 6115) + 1));
uint32[] memory outi = new uint32[]((b58sz + 3) / 4);
for (uint256 i = 0; i < data_.length; i++) {
bytes1 r = data_[i];
(c, f) = indexOf(ALPHABET, r);
require(f, "invalid base58 digit");
for (int256 k = int256(outi.length) - 1; k >= 0; k--) {
t = uint64(outi[uint256(k)]) * 58 + c;
c = t >> 32;
outi[uint256(k)] = uint32(t & 0xffffffff);
}
}
uint64 mask = uint64(b58sz % 4) * 8;
if (mask == 0) {
mask = 32;
}
mask -= 8;
uint256 outLen = 0;
for (uint256 j = 0; j < outi.length; j++) {
while (mask < 32) {
binu[outLen] = bytes1(uint8(outi[j] >> mask));
outLen++;
if (mask < 8) {
break;
}
mask -= 8;
}
mask = 24;
}
for (uint256 msb = zcount; msb < binu.length; msb++) {
if (binu[msb] > 0) {
return slice(binu, msb - zcount, outLen);
}
}
return slice(binu, 0, outLen);
}
}
/**
* @notice encodeToString is used to encode the given byte in base58 standard.
* @param data_ raw data, passed in as bytes.
* @return base58 encoded data_, returned as a string.
*/
function encodeToString(bytes memory data_) public pure returns (string memory) {
return string(encode(data_));
}
/**
* @notice encodeFromString is used to encode the given string in base58 standard.
* @param data_ raw data, passed in as a string.
* @return base58 encoded data_, returned as bytes.
*/
function encodeFromString(string memory data_) public pure returns (bytes memory) {
return encode(bytes(data_));
}
/**
* @notice decode is used to decode the given string in base58 standard.
* @param data_ data encoded with base58, passed in as string.
* @return raw data, returned as bytes.
*/
function decodeFromString(string memory data_) public pure returns (bytes memory) {
return decode(bytes(data_));
}
/**
* @notice slice is used to slice the given byte, returns the bytes in the range of [start_, end_)
* @param data_ raw data, passed in as bytes.
* @param start_ start index.
* @param end_ end index.
* @return slice data
*/
function slice(bytes memory data_, uint256 start_, uint256 end_) public pure returns (bytes memory) {
unchecked {
bytes memory ret = new bytes(end_ - start_);
for (uint256 i = 0; i < end_ - start_; i++) {
ret[i] = data_[i + start_];
}
return ret;
}
}
/**
* @notice indexOf is used to find where char_ appears in data_.
* @param data_ raw data, passed in as bytes.
* @param char_ target byte.
* @return index, and whether the search was successful.
*/
function indexOf(bytes memory data_, bytes1 char_) public pure returns (uint256, bool) {
unchecked {
for (uint256 i = 0; i < data_.length; i++) {
if (data_[i] == char_) {
return (i, true);
}
}
return (0, false);
}
}
}

@ -0,0 +1,38 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
/*
* @dev Solidity implementation of the ENS namehash algorithm.
*
* Warning! Does not normalize or validate names before hashing.
* Original version can be found here https://github.com/JonahGroendal/ens-namehash/
*/
library ENSNamehash {
function namehash(bytes memory domain) internal pure returns (bytes32) {
return namehash(domain, 0);
}
function namehash(bytes memory domain, uint256 i) internal pure returns (bytes32) {
if (domain.length <= i) return 0x0000000000000000000000000000000000000000000000000000000000000000;
uint256 len = labelLength(domain, i);
return keccak256(abi.encodePacked(namehash(domain, i + len + 1), keccak(domain, i, len)));
}
function labelLength(bytes memory domain, uint256 i) private pure returns (uint256) {
uint256 len;
while (i + len != domain.length && domain[i + len] != 0x2e) {
len++;
}
return len;
}
function keccak(bytes memory data, uint256 offset, uint256 len) private pure returns (bytes32 ret) {
require(offset + len <= data.length);
assembly {
ret := keccak256(add(add(data, 32), offset), len)
}
}
}

44
hardhat.config.js Normal file

@ -0,0 +1,44 @@
require("@nomicfoundation/hardhat-toolbox");
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://eth.llamarpc.com",
enabled: true,
blockNumber: 18820230,
accounts: [process.env.REAL_PK],
},
chainId: 1,
accounts: [
{
privateKey: process.env.REAL_PK,
balance: "10000000000000000000000000000000",
},
],
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY,
},
};

17716
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

44
package.json Normal file

@ -0,0 +1,44 @@
{
"name": "proposal-42",
"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",
"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;
});

83
test/Proposal.js Normal file

@ -0,0 +1,83 @@
const { ethers, network } = require("hardhat");
const { expect, assert } = require("chai");
const { time } = require("@nomicfoundation/hardhat-toolbox/network-helpers");
const tornAddr = "0x77777FeDdddFfC19Ff86DB637967013e6C6A116C";
const governanceAddr = "0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce";
async function getManyEth(addr) {
await network.provider.send("hardhat_setBalance", [
addr,
"0x111166630153555558483537",
]);
}
async function resolveAddr(ensName) {
if (ethers.isAddress(ensName)) return ensName;
const ensNode = ethers.namehash(ensName);
const registryContract = await ethers.getContractAt(
require("./abi/ensRegistry.abi.json"),
"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
);
const resolverAddr = await registryContract.resolver(ensNode);
const resolverContract = await ethers.getContractAt(
require("./abi/ensResolver.abi.json"),
resolverAddr
);
return await resolverContract.addr(ensNode);
}
async function getTornContract() {
return await ethers.getContractAt(require("./abi/torn.abi.json"), tornAddr);
}
async function deployAndExecuteProposal() {
const proposalFactory = await ethers.getContractFactory("Proposal");
const proposal = await proposalFactory.deploy();
const deployedProposalAddr = await proposal.getAddress();
const bigStakerAddr = "0xE4143f6377AEcd7193b9731d1C28815b57C4f5Ab";
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);
return await getRelayerRegistry();
}
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,
},
},
],
});
});
it("Gas expenses should be compensated to me", async function () {
const tornContract = await getTornContract();
const me = await resolveAddr("butterfly-attractor.eth");
const initialTornBalance = await tornContract.balanceOf(me);
await deployAndExecuteProposal();
expect((await tornContract.balanceOf(me)) - initialTornBalance).to.be.equal(
100n * 10n ** 18n
);
});
});

@ -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" }
]

@ -0,0 +1,696 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_torn",
"type": "address"
},
{
"internalType": "address",
"name": "_governance",
"type": "address"
},
{
"internalType": "address",
"name": "_ens",
"type": "address"
},
{
"internalType": "address",
"name": "_staking",
"type": "address"
},
{
"internalType": "address",
"name": "_feeManager",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "minStakeAmount",
"type": "uint256"
}
],
"name": "MinimumStakeAmount",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "RelayerBalanceNullified",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "relayer",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "ensName",
"type": "string"
},
{
"indexed": false,
"internalType": "address",
"name": "relayerAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"name": "RelayerRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "RelayerUnregistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "tornadoRouter",
"type": "address"
}
],
"name": "RouterRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amountStakeAdded",
"type": "uint256"
}
],
"name": "StakeAddedToRelayer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amountBurned",
"type": "uint256"
}
],
"name": "StakeBurned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "worker",
"type": "address"
}
],
"name": "WorkerRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "worker",
"type": "address"
}
],
"name": "WorkerUnregistered",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32[]",
"name": "domains",
"type": "bytes32[]"
}
],
"name": "bulkResolve",
"outputs": [
{
"internalType": "address[]",
"name": "result",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"internalType": "contract ITornadoInstance",
"name": "pool",
"type": "address"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "ens",
"outputs": [
{
"internalType": "contract IENS",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "feeManager",
"outputs": [
{
"internalType": "contract IFeeManager",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "getRelayerBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "getRelayerEnsHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "governance",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_tornadoRouter",
"type": "bytes32"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toResolve",
"type": "address"
}
],
"name": "isRelayer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"internalType": "address",
"name": "toResolve",
"type": "address"
}
],
"name": "isRelayerRegistered",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "minStakeAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "nullifyBalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "ensName",
"type": "string"
},
{
"internalType": "uint256",
"name": "stake",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "workersToRegister",
"type": "address[]"
}
],
"name": "register",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "ensName",
"type": "string"
},
{
"internalType": "uint256",
"name": "stake",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "workersToRegister",
"type": "address[]"
},
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"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": "registerPermit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"internalType": "address",
"name": "worker",
"type": "address"
}
],
"name": "registerWorker",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "relayers",
"outputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "ensHash",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "node",
"type": "bytes32"
}
],
"name": "resolve",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "minAmount",
"type": "uint256"
}
],
"name": "setMinStakeAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "tornadoRouterAddress",
"type": "address"
}
],
"name": "setTornadoRouter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"internalType": "uint256",
"name": "stake",
"type": "uint256"
}
],
"name": "stakeToRelayer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
},
{
"internalType": "uint256",
"name": "stake",
"type": "uint256"
},
{
"internalType": "address",
"name": "staker",
"type": "address"
},
{
"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": "stakeToRelayerPermit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "staking",
"outputs": [
{
"internalType": "contract ITornadoStakingRewards",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "torn",
"outputs": [
{
"internalType": "contract TORN",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tornadoRouter",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "relayer",
"type": "address"
}
],
"name": "unregisterRelayer",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "worker",
"type": "address"
}
],
"name": "unregisterWorker",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "workers",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"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"
}
]