Define clearly how to deploy the contracts

- Use `Deploy ERC20 Poof Cash` part of README to deploy the contracts
 - Remove build/ and contracts/ since they are generated
 - Rely on the existing trusted prover / verifier keys from Tornado trusted setup
 - Automatically change owner to zero address after deploying the ERC20Tornado contract
This commit is contained in:
Brian Li 2021-04-25 10:01:10 -07:00
parent 4d028922e6
commit d946cf0808
40 changed files with 18 additions and 2143399 deletions

View File

@ -3,9 +3,12 @@ MERKLE_TREE_HEIGHT=20
ETH_AMOUNT=100000000000000000
TOKEN_AMOUNT=100000000000000000
PRIVATE_KEY=
ERC20_TOKEN=
# RPC_URL=https://forno.celo.org
# RPC_URL=https://alfajores-forno.celo-testnet.org
# Enable for tests
ERC20_TOKEN=
# CELO on Mainnet
# ERC20_TOKEN=0x471ece3750da237f93b8e339c536989b8978a438
# CELO on Alfajores
# ERC20_TOKEN=0xf194afdf50b03e69bd7d057c1aa9e10c9954e4c9

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
build
client
.vscode
Tornado_flat.sol

View File

@ -95,14 +95,17 @@ Example:
> Transaction mined in block 17036120
> Done
## Deploy ERC20 Tornado Cash
## Deploy ERC20 Poof Cash
1. `npm i`
1. `npm run download`
1. `npm run build:contract`
1. `cp .env.example .env`
1. Tune all necessary params
1. `npx truffle migrate --network kovan --reset --f 2 --to 3`
1. `npx truffle migrate --network kovan --reset --f 4`
1. `npx truffle migrate --network alfajores --reset --f 2 --to 4`
1. `npx truffle migrate --network alfajores --reset --f 5`
**Note**. If you want to reuse the same verifier for all the instances, then after you deployed one of the instances you should only run the 5th migration (`--f 5`).
**Note**. If you want to reuse the same verifier for all the instances, then after you deployed one of the instances you should only run the 5th migration (`--f 5`). Likely, you will want to tune your .env parameters for each run of the 5th migration.
## How to resolve ENS name to DNS name for a relayer
NOTE: Not yet relevant for CELO

File diff suppressed because one or more lines are too long

View File

@ -1,235 +0,0 @@
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// 2019 OKIMS
// ported to solidity 0.5
// fixed linter warnings
// added requiere error messages
//
pragma solidity ^0.5.0;
library Pairing {
struct G1Point {
uint X;
uint Y;
}
// Encoding of field elements is: X[0] * z + X[1]
struct G2Point {
uint[2] X;
uint[2] Y;
}
/// @return the generator of G1
function P1() internal pure returns (G1Point memory) {
return G1Point(1, 2);
}
/// @return the generator of G2
function P2() internal pure returns (G2Point memory) {
// Original code point
return G2Point(
[11559732032986387107991004021392285783925812861821192530917403151452391805634,
10857046999023057135944570762232829481370756359578518086990519993285655852781],
[4082367875863433681332203403145435568316851327593401208105741076214120093531,
8495653923123431417604973247489272438418190587263600148770280649306958101930]
);
/*
// Changed by Jordi point
return G2Point(
[10857046999023057135944570762232829481370756359578518086990519993285655852781,
11559732032986387107991004021392285783925812861821192530917403151452391805634],
[8495653923123431417604973247489272438418190587263600148770280649306958101930,
4082367875863433681332203403145435568316851327593401208105741076214120093531]
);
*/
}
/// @return the negation of p, i.e. p.addition(p.negate()) should be zero.
function negate(G1Point memory p) internal pure returns (G1Point memory) {
// The prime q in the base field F_q for G1
uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
if (p.X == 0 && p.Y == 0)
return G1Point(0, 0);
return G1Point(p.X, q - (p.Y % q));
}
/// @return the sum of two points of G1
function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {
uint[4] memory input;
input[0] = p1.X;
input[1] = p1.Y;
input[2] = p2.X;
input[3] = p2.Y;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(sub(gas, 2000), 6, input, 0xc0, r, 0x60)
// Use "invalid" to make gas estimation work
switch success case 0 { invalid() }
}
require(success,"pairing-add-failed");
}
/// @return the product of a point on G1 and a scalar, i.e.
/// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.
function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {
uint[3] memory input;
input[0] = p.X;
input[1] = p.Y;
input[2] = s;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(sub(gas, 2000), 7, input, 0x80, r, 0x60)
// Use "invalid" to make gas estimation work
switch success case 0 { invalid() }
}
require (success,"pairing-mul-failed");
}
/// @return the result of computing the pairing check
/// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1
/// For example pairing([P1(), P1().negate()], [P2(), P2()]) should
/// return true.
function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {
require(p1.length == p2.length,"pairing-lengths-failed");
uint elements = p1.length;
uint inputSize = elements * 6;
uint[] memory input = new uint[](inputSize);
for (uint i = 0; i < elements; i++)
{
input[i * 6 + 0] = p1[i].X;
input[i * 6 + 1] = p1[i].Y;
input[i * 6 + 2] = p2[i].X[0];
input[i * 6 + 3] = p2[i].X[1];
input[i * 6 + 4] = p2[i].Y[0];
input[i * 6 + 5] = p2[i].Y[1];
}
uint[1] memory out;
bool success;
// solium-disable-next-line security/no-inline-assembly
assembly {
success := staticcall(sub(gas, 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)
// Use "invalid" to make gas estimation work
switch success case 0 { invalid() }
}
require(success,"pairing-opcode-failed");
return out[0] != 0;
}
/// Convenience method for a pairing check for two pairs.
function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](2);
G2Point[] memory p2 = new G2Point[](2);
p1[0] = a1;
p1[1] = b1;
p2[0] = a2;
p2[1] = b2;
return pairing(p1, p2);
}
/// Convenience method for a pairing check for three pairs.
function pairingProd3(
G1Point memory a1, G2Point memory a2,
G1Point memory b1, G2Point memory b2,
G1Point memory c1, G2Point memory c2
) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](3);
G2Point[] memory p2 = new G2Point[](3);
p1[0] = a1;
p1[1] = b1;
p1[2] = c1;
p2[0] = a2;
p2[1] = b2;
p2[2] = c2;
return pairing(p1, p2);
}
/// Convenience method for a pairing check for four pairs.
function pairingProd4(
G1Point memory a1, G2Point memory a2,
G1Point memory b1, G2Point memory b2,
G1Point memory c1, G2Point memory c2,
G1Point memory d1, G2Point memory d2
) internal view returns (bool) {
G1Point[] memory p1 = new G1Point[](4);
G2Point[] memory p2 = new G2Point[](4);
p1[0] = a1;
p1[1] = b1;
p1[2] = c1;
p1[3] = d1;
p2[0] = a2;
p2[1] = b2;
p2[2] = c2;
p2[3] = d2;
return pairing(p1, p2);
}
}
contract Verifier {
using Pairing for *;
struct VerifyingKey {
Pairing.G1Point alfa1;
Pairing.G2Point beta2;
Pairing.G2Point gamma2;
Pairing.G2Point delta2;
Pairing.G1Point[] IC;
}
struct Proof {
Pairing.G1Point A;
Pairing.G2Point B;
Pairing.G1Point C;
}
function verifyingKey() internal pure returns (VerifyingKey memory vk) {
vk.alfa1 = Pairing.G1Point(18657542331331594053741415770570506550706569498961410954133033897989591401189,6264260897865443982211421147903875993071737418978097054373843876593191958554);
vk.beta2 = Pairing.G2Point([16145146493105051731835577431466522777312556712102642258586604156965648489323,1408397907630178084475841628288979560031077923161720290656645690888514900690], [11978935468110936479452540476685650963253543448444491042448602999296500877530,112918063640144403952377835324065916772928630126644486578966192894527844242]);
vk.gamma2 = Pairing.G2Point([14714161541472190840706407460577570471955020383164127014044969149845099089043,21154405576246819890480857261813245873290117922496461244951437100679802599302], [1840081830277905838744371828531811119637362077753056677334840017658318568390,410971760875258255000700145958941470970464459511247951845295749195541674770]);
vk.delta2 = Pairing.G2Point([609622496158014325110420558804365410223349280839149569464161962343427764287,8317373424286384092546596992464745037177203788231027221499358270203939798311], [8964380816483194889991669997269927098310306830885265614044859474784301616839,4657156249795161919628914303326963019564805696528481901536526126579308090139]);
vk.IC = new Pairing.G1Point[](7);
vk.IC[0] = Pairing.G1Point(20166610602661498805481216064041390370160663060098850035854617107084652933188,1659975302204996438525238174042926887396319013457610086028476512633965956990);
vk.IC[1] = Pairing.G1Point(4220871189670953026506414371868481831410889010217108719382613726183286975446,1000393167704732207794518371383982711909560731997085626334108036666911896515);
vk.IC[2] = Pairing.G1Point(12239086110821316935616912649060211038392877351736651065425057336661040984065,5374452082587629349940763802872591986728213630869355796260909357433421532329);
vk.IC[3] = Pairing.G1Point(10285133610545411845819507508720146823943262881879468951491365404146203175832,2498247655234760266120312262546972165343297120557370090775420013522145792015);
vk.IC[4] = Pairing.G1Point(18113182104873248546285711585405582060453978828497035767859046179153107375835,6729094613760083456600449536123737034270234634314951752808465378236383530847);
vk.IC[5] = Pairing.G1Point(2675854458152962472161665122142721791686118092900325507962353336751375645555,12913224302380448616475651904030096179632834250198895128713731772227526103851);
vk.IC[6] = Pairing.G1Point(6904531203927324497190715701219512027355142032925478416168419557191017067138,3297385619144148685859898508280807841114612552526206265036207895270147740391);
}
function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {
uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
VerifyingKey memory vk = verifyingKey();
require(input.length + 1 == vk.IC.length,"verifier-bad-input");
// Compute the linear combination vk_x
Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);
for (uint i = 0; i < input.length; i++) {
require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field");
vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));
}
vk_x = Pairing.addition(vk_x, vk.IC[0]);
if (!Pairing.pairingProd4(
Pairing.negate(proof.A), proof.B,
vk.alfa1, vk.beta2,
vk_x, vk.gamma2,
proof.C, vk.delta2
)) return 1;
return 0;
}
function verifyProof(
uint[2] memory a,
uint[2][2] memory b,
uint[2] memory c,
uint[6] memory input
) public view returns (bool r) {
Proof memory proof;
proof.A = Pairing.G1Point(a[0], a[1]);
proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);
proof.C = Pairing.G1Point(c[0], c[1]);
uint[] memory inputValues = new uint[](input.length);
for(uint i = 0; i < input.length; i++){
inputValues[i] = input[i];
}
if (verify(inputValues, proof) == 0) {
return true;
} else {
return false;
}
}
function verifyProof(bytes calldata proof, uint[6] calldata inputs) external view returns (bool r) {
// solidity does not support decoding uint[2][2] yet
(uint[2] memory a, uint[2] memory b1, uint[2] memory b2, uint[2] memory c) = abi.decode(proof, (uint[2], uint[2], uint[2], uint[2]));
return verifyProof(a, [b1, b2], c, inputs);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,118 +0,0 @@
{
"protocol": "groth",
"nPublic": 6,
"IC": [
[
"20166610602661498805481216064041390370160663060098850035854617107084652933188",
"1659975302204996438525238174042926887396319013457610086028476512633965956990",
"1"
],
[
"4220871189670953026506414371868481831410889010217108719382613726183286975446",
"1000393167704732207794518371383982711909560731997085626334108036666911896515",
"1"
],
[
"12239086110821316935616912649060211038392877351736651065425057336661040984065",
"5374452082587629349940763802872591986728213630869355796260909357433421532329",
"1"
],
[
"10285133610545411845819507508720146823943262881879468951491365404146203175832",
"2498247655234760266120312262546972165343297120557370090775420013522145792015",
"1"
],
[
"18113182104873248546285711585405582060453978828497035767859046179153107375835",
"6729094613760083456600449536123737034270234634314951752808465378236383530847",
"1"
],
[
"2675854458152962472161665122142721791686118092900325507962353336751375645555",
"12913224302380448616475651904030096179632834250198895128713731772227526103851",
"1"
],
[
"6904531203927324497190715701219512027355142032925478416168419557191017067138",
"3297385619144148685859898508280807841114612552526206265036207895270147740391",
"1"
]
],
"vk_alfa_1": [
"18657542331331594053741415770570506550706569498961410954133033897989591401189",
"6264260897865443982211421147903875993071737418978097054373843876593191958554",
"1"
],
"vk_beta_2": [
[
"1408397907630178084475841628288979560031077923161720290656645690888514900690",
"16145146493105051731835577431466522777312556712102642258586604156965648489323"
],
[
"112918063640144403952377835324065916772928630126644486578966192894527844242",
"11978935468110936479452540476685650963253543448444491042448602999296500877530"
],
[
"1",
"0"
]
],
"vk_gamma_2": [
[
"21154405576246819890480857261813245873290117922496461244951437100679802599302",
"14714161541472190840706407460577570471955020383164127014044969149845099089043"
],
[
"410971760875258255000700145958941470970464459511247951845295749195541674770",
"1840081830277905838744371828531811119637362077753056677334840017658318568390"
],
[
"1",
"0"
]
],
"vk_delta_2": [
[
"8317373424286384092546596992464745037177203788231027221499358270203939798311",
"609622496158014325110420558804365410223349280839149569464161962343427764287"
],
[
"4657156249795161919628914303326963019564805696528481901536526126579308090139",
"8964380816483194889991669997269927098310306830885265614044859474784301616839"
],
[
"1",
"0"
]
],
"vk_alfabeta_12": [
[
[
"13776378282796697954808321117097452714542893433112654073325706501647641131671",
"2348307168026415979764457718404143546110127821041586870279486223380917843413"
],
[
"10699251774866640947568192684233379580238257505082459170070756064852606220319",
"15291496727883183459475879228508921599058945370120142669667134663076130019932"
],
[
"3297588901801813378736620194052344788093732183640943042682382828790236485880",
"18816064327765849815318394667402876002183395380006620290694704432295616909332"
]
],
[
[
"5935480659281653640943322500250120656348373491054422704498108586630510656318",
"11080034225364013134240376938097607626910641212716151520514593429384961977294"
],
[
"6898722617795825071338185429991529502200783234759457358099597741021229383327",
"9384702739721653200828569005480831501406886349022105320139439015339329839373"
],
[
"5541709883441070098606450040729114102826730953824221073684511881864766209870",
"9650969008223932662888557014944894976409963914346113439192511144716322365471"
]
]
]
}

View File

@ -1,374 +0,0 @@
{
"contractName": "BadRecipient",
"abi": [
{
"payable": false,
"stateMutability": "nonpayable",
"type": "fallback"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"fallback\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/home/dotfiles/tornado-core/contracts/Mocks/BadRecipient.sol\":\"BadRecipient\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/home/dotfiles/tornado-core/contracts/Mocks/BadRecipient.sol\":{\"keccak256\":\"0x0329be02a9fec6e4fbd93d8c98887acd5d46bb09af18298232fc2fe72838ca03\",\"urls\":[\"bzz-raw://c4670e578c58b2326efebcba1a2dd2ee0bf6d70c26f84cdaa3e81f67bd0e360d\",\"dweb:/ipfs/QmbVoxKmmrWzjdnLfJkxhWe6UyjrpCFYjMxRP6uRCfGi7r\"]}},\"version\":1}",
"bytecode": "0x6080604052348015600f57600080fd5b50609c80601d6000396000f3fe6080604052348015600f57600080fd5b5060405162461bcd60e51b815260040180806020018281038252602181526020018060476021913960400191505060405180910390fdfe7468697320636f6e747261637420646f6573206e6f742061636365707420455448a265627a7a7231582032df8468882a84a1577428256b3075571818622e500ee7132ec9e216f517c73064736f6c63430005110032",
"deployedBytecode": "0x6080604052348015600f57600080fd5b5060405162461bcd60e51b815260040180806020018281038252602181526020018060476021913960400191505060405180910390fdfe7468697320636f6e747261637420646f6573206e6f742061636365707420455448a265627a7a7231582032df8468882a84a1577428256b3075571818622e500ee7132ec9e216f517c73064736f6c63430005110032",
"sourceMap": "25:110:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;25:110:4;;;;;;;",
"deployedSourceMap": "25:110:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;77:51:4;;-1:-1:-1;;;77:51:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"source": "pragma solidity ^0.5.0;\n\ncontract BadRecipient {\n function() external {\n require(false, \"this contract does not accept ETH\");\n }\n}\n",
"sourcePath": "/home/home/dotfiles/tornado-core/contracts/Mocks/BadRecipient.sol",
"ast": {
"absolutePath": "/home/home/dotfiles/tornado-core/contracts/Mocks/BadRecipient.sol",
"exportedSymbols": {
"BadRecipient": [
754
]
},
"id": 755,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 744,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 754,
"linearizedBaseContracts": [
754
],
"name": "BadRecipient",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 752,
"nodeType": "Block",
"src": "71:62:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 748,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "85:5:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
{
"argumentTypes": null,
"hexValue": "7468697320636f6e747261637420646f6573206e6f742061636365707420455448",
"id": 749,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "92:35:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_a3dfa67cd4d104a688bb8ad9f6858d9a8fecb15cbae3a5d0cd6923d5d60a93c8",
"typeString": "literal_string \"this contract does not accept ETH\""
},
"value": "this contract does not accept ETH"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_a3dfa67cd4d104a688bb8ad9f6858d9a8fecb15cbae3a5d0cd6923d5d60a93c8",
"typeString": "literal_string \"this contract does not accept ETH\""
}
],
"id": 747,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
3273,
3274
],
"referencedDeclaration": 3274,
"src": "77:7:4",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 750,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "77:51:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 751,
"nodeType": "ExpressionStatement",
"src": "77:51:4"
}
]
},
"documentation": null,
"id": 753,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 745,
"nodeType": "ParameterList",
"parameters": [],
"src": "59:2:4"
},
"returnParameters": {
"id": 746,
"nodeType": "ParameterList",
"parameters": [],
"src": "71:0:4"
},
"scope": 754,
"src": "51:82:4",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
}
],
"scope": 755,
"src": "25:110:4"
}
],
"src": "0:136:4"
},
"legacyAST": {
"attributes": {
"absolutePath": "/home/home/dotfiles/tornado-core/contracts/Mocks/BadRecipient.sol",
"exportedSymbols": {
"BadRecipient": [
754
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.5",
".0"
]
},
"id": 744,
"name": "PragmaDirective",
"src": "0:23:4"
},
{
"attributes": {
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"linearizedBaseContracts": [
754
],
"name": "BadRecipient",
"scope": 755
},
"children": [
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": false,
"kind": "fallback",
"modifiers": [
null
],
"name": "",
"scope": 754,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 745,
"name": "ParameterList",
"src": "59:2:4"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 746,
"name": "ParameterList",
"src": "71:0:4"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_a3dfa67cd4d104a688bb8ad9f6858d9a8fecb15cbae3a5d0cd6923d5d60a93c8",
"typeString": "literal_string \"this contract does not accept ETH\""
}
],
"overloadedDeclarations": [
3273,
3274
],
"referencedDeclaration": 3274,
"type": "function (bool,string memory) pure",
"value": "require"
},
"id": 747,
"name": "Identifier",
"src": "77:7:4"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "66616c7365",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "false"
},
"id": 748,
"name": "Literal",
"src": "85:5:4"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "7468697320636f6e747261637420646f6573206e6f742061636365707420455448",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "string",
"type": "literal_string \"this contract does not accept ETH\"",
"value": "this contract does not accept ETH"
},
"id": 749,
"name": "Literal",
"src": "92:35:4"
}
],
"id": 750,
"name": "FunctionCall",
"src": "77:51:4"
}
],
"id": 751,
"name": "ExpressionStatement",
"src": "77:51:4"
}
],
"id": 752,
"name": "Block",
"src": "71:62:4"
}
],
"id": 753,
"name": "FunctionDefinition",
"src": "51:82:4"
}
],
"id": 754,
"name": "ContractDefinition",
"src": "25:110:4"
}
],
"id": 755,
"name": "SourceUnit",
"src": "0:136:4"
},
"compiler": {
"name": "solc",
"version": "0.5.17+commit.d19bba13.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.3.4",
"updatedAt": "2021-04-04T20:21:29.863Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,666 +0,0 @@
{
"contractName": "Context",
"abi": [
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/GSN/Context.sol\":\"Context\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/GSN/Context.sol\":{\"keccak256\":\"0x90a3995645af7562d84b9d69363ffa5ae7217714ab61e951bf7bc450f40e4061\",\"urls\":[\"bzz-raw://216ef9d6b614db4eb46970b4e84903f2534a45572dd30a79f0041f1a5830f436\",\"dweb:/ipfs/QmNPrJ4MWKUAWzKXpUqeyKRUfosaoANZAqXgvepdrCwZAG\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity ^0.5.0;\n\n/*\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with GSN meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\ncontract Context {\n // Empty internal constructor, to prevent people from mistakenly deploying\n // an instance of this contract, which should be used via inheritance.\n constructor () internal { }\n // solhint-disable-previous-line no-empty-blocks\n\n function _msgSender() internal view returns (address payable) {\n return msg.sender;\n }\n\n function _msgData() internal view returns (bytes memory) {\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\n return msg.data;\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/GSN/Context.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/GSN/Context.sol",
"exportedSymbols": {
"Context": [
2290
]
},
"id": 2291,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2265,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:10"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 2290,
"linearizedBaseContracts": [
2290
],
"name": "Context",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2268,
"nodeType": "Block",
"src": "726:3:10",
"statements": []
},
"documentation": null,
"id": 2269,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2266,
"nodeType": "ParameterList",
"parameters": [],
"src": "714:2:10"
},
"returnParameters": {
"id": 2267,
"nodeType": "ParameterList",
"parameters": [],
"src": "726:0:10"
},
"scope": 2290,
"src": "702:27:10",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2277,
"nodeType": "Block",
"src": "850:34:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2274,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3270,
"src": "867:3:10",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 2275,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "867:10:10",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"functionReturnParameters": 2273,
"id": 2276,
"nodeType": "Return",
"src": "860:17:10"
}
]
},
"documentation": null,
"id": 2278,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgSender",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2270,
"nodeType": "ParameterList",
"parameters": [],
"src": "807:2:10"
},
"returnParameters": {
"id": 2273,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2272,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2278,
"src": "833:15:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 2271,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "833:15:10",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "832:17:10"
},
"scope": 2290,
"src": "788:96:10",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2288,
"nodeType": "Block",
"src": "947:165:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2283,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3304,
"src": "957:4:10",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Context_$2290",
"typeString": "contract Context"
}
},
"id": 2284,
"nodeType": "ExpressionStatement",
"src": "957:4:10"
},
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2285,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3270,
"src": "1097:3:10",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 2286,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "data",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1097:8:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
},
"functionReturnParameters": 2282,
"id": 2287,
"nodeType": "Return",
"src": "1090:15:10"
}
]
},
"documentation": null,
"id": 2289,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgData",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2279,
"nodeType": "ParameterList",
"parameters": [],
"src": "907:2:10"
},
"returnParameters": {
"id": 2282,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2281,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 2289,
"src": "933:12:10",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 2280,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "933:5:10",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "932:14:10"
},
"scope": 2290,
"src": "890:222:10",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 2291,
"src": "525:589:10"
}
],
"src": "0:1115:10"
},
"legacyAST": {
"attributes": {
"absolutePath": "@openzeppelin/contracts/GSN/Context.sol",
"exportedSymbols": {
"Context": [
2290
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.5",
".0"
]
},
"id": 2265,
"name": "PragmaDirective",
"src": "0:23:10"
},
{
"attributes": {
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"linearizedBaseContracts": [
2290
],
"name": "Context",
"scope": 2291
},
"children": [
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": true,
"kind": "constructor",
"modifiers": [
null
],
"name": "",
"scope": 2290,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2266,
"name": "ParameterList",
"src": "714:2:10"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2267,
"name": "ParameterList",
"src": "726:0:10"
},
{
"attributes": {
"statements": [
null
]
},
"children": [],
"id": 2268,
"name": "Block",
"src": "726:3:10"
}
],
"id": 2269,
"name": "FunctionDefinition",
"src": "702:27:10"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": false,
"kind": "function",
"modifiers": [
null
],
"name": "_msgSender",
"scope": 2290,
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2270,
"name": "ParameterList",
"src": "807:2:10"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 2278,
"stateVariable": false,
"storageLocation": "default",
"type": "address payable",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "payable",
"type": "address payable"
},
"id": 2271,
"name": "ElementaryTypeName",
"src": "833:15:10"
}
],
"id": 2272,
"name": "VariableDeclaration",
"src": "833:15:10"
}
],
"id": 2273,
"name": "ParameterList",
"src": "832:17:10"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 2273
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3270,
"type": "msg",
"value": "msg"
},
"id": 2274,
"name": "Identifier",
"src": "867:3:10"
}
],
"id": 2275,
"name": "MemberAccess",
"src": "867:10:10"
}
],
"id": 2276,
"name": "Return",
"src": "860:17:10"
}
],
"id": 2277,
"name": "Block",
"src": "850:34:10"
}
],
"id": 2278,
"name": "FunctionDefinition",
"src": "788:96:10"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": false,
"kind": "function",
"modifiers": [
null
],
"name": "_msgData",
"scope": 2290,
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2279,
"name": "ParameterList",
"src": "907:2:10"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 2289,
"stateVariable": false,
"storageLocation": "memory",
"type": "bytes",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bytes",
"type": "bytes"
},
"id": 2280,
"name": "ElementaryTypeName",
"src": "933:5:10"
}
],
"id": 2281,
"name": "VariableDeclaration",
"src": "933:12:10"
}
],
"id": 2282,
"name": "ParameterList",
"src": "932:14:10"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3304,
"type": "contract Context",
"value": "this"
},
"id": 2283,
"name": "Identifier",
"src": "957:4:10"
}
],
"id": 2284,
"name": "ExpressionStatement",
"src": "957:4:10"
},
{
"attributes": {
"functionReturnParameters": 2282
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "data",
"referencedDeclaration": null,
"type": "bytes calldata"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3270,
"type": "msg",
"value": "msg"
},
"id": 2285,
"name": "Identifier",
"src": "1097:3:10"
}
],
"id": 2286,
"name": "MemberAccess",
"src": "1097:8:10"
}
],
"id": 2287,
"name": "Return",
"src": "1090:15:10"
}
],
"id": 2288,
"name": "Block",
"src": "947:165:10"
}
],
"id": 2289,
"name": "FunctionDefinition",
"src": "890:222:10"
}
],
"id": 2290,
"name": "ContractDefinition",
"src": "525:589:10"
}
],
"id": 2291,
"name": "SourceUnit",
"src": "0:1115:10"
},
"compiler": {
"name": "solc",
"version": "0.5.17+commit.d19bba13.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.3.4",
"updatedAt": "2021-04-04T20:21:29.907Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,796 +0,0 @@
{
"contractName": "ReentrancyGuard",
"abi": [
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"details\":\"Contract module that helps prevent reentrant calls to a function. * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier available, which can be applied to functions to make sure there are no nested (reentrant) calls to them. * Note that because there is a single `nonReentrant` guard, functions marked as `nonReentrant` may not call one another. This can be worked around by making those functions `private`, and then adding `external` `nonReentrant` entry points to them. * TIP: If you would like to learn more about reentrancy and alternative ways to protect against it, check out our blog post https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. * _Since v2.5.0:_ this module is now much more gas efficient, given net gas metering changes introduced in the Istanbul hardfork.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/ReentrancyGuard.sol\":\"ReentrancyGuard\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/ReentrancyGuard.sol\":{\"keccak256\":\"0xb63221b23818d622bfd83d18e0968307e4fcb7a35536bdceded76e1cf8349acd\",\"urls\":[\"bzz-raw://44e1e8c22362c4708a8c3362735f1465f5b05e2f7315e16c7010d694ce019d73\",\"dweb:/ipfs/QmWj9g8X1hxkXRre2kwkEjLBetjuzmSbWHD81bsSojnBkS\"]}},\"version\":1}",
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n *\n * _Since v2.5.0:_ this module is now much more gas efficient, given net gas\n * metering changes introduced in the Istanbul hardfork.\n */\ncontract ReentrancyGuard {\n bool private _notEntered;\n\n constructor () internal {\n // Storing an initial non-zero value makes deployment a bit more\n // expensive, but in exchange the refund on every call to nonReentrant\n // will be lower in amount. Since refunds are capped to a percetange of\n // the total transaction's gas, it is best to keep them low in cases\n // like this one, to increase the likelihood of the full refund coming\n // into effect.\n _notEntered = true;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and make it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n // On the first call to nonReentrant, _notEntered will be true\n require(_notEntered, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _notEntered = false;\n\n _;\n\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _notEntered = true;\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/utils/ReentrancyGuard.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/ReentrancyGuard.sol",
"exportedSymbols": {
"ReentrancyGuard": [
3255
]
},
"id": 3256,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 3227,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:18"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@dev Contract module that helps prevent reentrant calls to a function.\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\navailable, which can be applied to functions to make sure there are no nested\n(reentrant) calls to them.\n * Note that because there is a single `nonReentrant` guard, functions marked as\n`nonReentrant` may not call one another. This can be worked around by making\nthose functions `private`, and then adding `external` `nonReentrant` entry\npoints to them.\n * TIP: If you would like to learn more about reentrancy and alternative ways\nto protect against it, check out our blog post\nhttps://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n * _Since v2.5.0:_ this module is now much more gas efficient, given net gas\nmetering changes introduced in the Istanbul hardfork.",
"fullyImplemented": true,
"id": 3255,
"linearizedBaseContracts": [
3255
],
"name": "ReentrancyGuard",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 3229,
"name": "_notEntered",
"nodeType": "VariableDeclaration",
"scope": 3255,
"src": "944:24:18",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 3228,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "944:4:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "private"
},
{
"body": {
"id": 3236,
"nodeType": "Block",
"src": "999:447:18",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 3234,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3232,
"name": "_notEntered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3229,
"src": "1421:11:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 3233,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1435:4:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "1421:18:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 3235,
"nodeType": "ExpressionStatement",
"src": "1421:18:18"
}
]
},
"documentation": null,
"id": 3237,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3230,
"nodeType": "ParameterList",
"parameters": [],
"src": "987:2:18"
},
"returnParameters": {
"id": 3231,
"nodeType": "ParameterList",
"parameters": [],
"src": "999:0:18"
},
"scope": 3255,
"src": "975:471:18",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 3253,
"nodeType": "Block",
"src": "1845:410:18",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3240,
"name": "_notEntered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3229,
"src": "1934:11:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "5265656e7472616e637947756172643a207265656e7472616e742063616c6c",
"id": 3241,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1947:33:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_ebf73bba305590e4764d5cb53b69bffd6d4d092d1a67551cb346f8cfcdab8619",
"typeString": "literal_string \"ReentrancyGuard: reentrant call\""
},
"value": "ReentrancyGuard: reentrant call"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ebf73bba305590e4764d5cb53b69bffd6d4d092d1a67551cb346f8cfcdab8619",
"typeString": "literal_string \"ReentrancyGuard: reentrant call\""
}
],
"id": 3239,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
3273,
3274
],
"referencedDeclaration": 3274,
"src": "1926:7:18",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 3242,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1926:55:18",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 3243,
"nodeType": "ExpressionStatement",
"src": "1926:55:18"
},
{
"expression": {
"argumentTypes": null,
"id": 3246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3244,
"name": "_notEntered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3229,
"src": "2056:11:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 3245,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2070:5:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "2056:19:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 3247,
"nodeType": "ExpressionStatement",
"src": "2056:19:18"
},
{
"id": 3248,
"nodeType": "PlaceholderStatement",
"src": "2086:1:18"
},
{
"expression": {
"argumentTypes": null,
"id": 3251,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 3249,
"name": "_notEntered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3229,
"src": "2230:11:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 3250,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2244:4:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "2230:18:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 3252,
"nodeType": "ExpressionStatement",
"src": "2230:18:18"
}
]
},
"documentation": "@dev Prevents a contract from calling itself, directly or indirectly.\nCalling a `nonReentrant` function from another `nonReentrant`\nfunction is not supported. It is possible to prevent this from happening\nby making the `nonReentrant` function external, and make it call a\n`private` function that does the actual work.",
"id": 3254,
"name": "nonReentrant",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 3238,
"nodeType": "ParameterList",
"parameters": [],
"src": "1842:2:18"
},
"src": "1821:434:18",
"visibility": "internal"
}
],
"scope": 3256,
"src": "913:1344:18"
}
],
"src": "0:2258:18"
},
"legacyAST": {
"attributes": {
"absolutePath": "@openzeppelin/contracts/utils/ReentrancyGuard.sol",
"exportedSymbols": {
"ReentrancyGuard": [
3255
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.5",
".0"
]
},
"id": 3227,
"name": "PragmaDirective",
"src": "0:23:18"
},
{
"attributes": {
"baseContracts": [
null
],
"contractDependencies": [
null
],
"contractKind": "contract",
"documentation": "@dev Contract module that helps prevent reentrant calls to a function.\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\navailable, which can be applied to functions to make sure there are no nested\n(reentrant) calls to them.\n * Note that because there is a single `nonReentrant` guard, functions marked as\n`nonReentrant` may not call one another. This can be worked around by making\nthose functions `private`, and then adding `external` `nonReentrant` entry\npoints to them.\n * TIP: If you would like to learn more about reentrancy and alternative ways\nto protect against it, check out our blog post\nhttps://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n * _Since v2.5.0:_ this module is now much more gas efficient, given net gas\nmetering changes introduced in the Istanbul hardfork.",
"fullyImplemented": true,
"linearizedBaseContracts": [
3255
],
"name": "ReentrancyGuard",
"scope": 3256
},
"children": [
{
"attributes": {
"constant": false,
"name": "_notEntered",
"scope": 3255,
"stateVariable": true,
"storageLocation": "default",
"type": "bool",
"value": null,
"visibility": "private"
},
"children": [
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 3228,
"name": "ElementaryTypeName",
"src": "944:4:18"
}
],
"id": 3229,
"name": "VariableDeclaration",
"src": "944:24:18"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": true,
"kind": "constructor",
"modifiers": [
null
],
"name": "",
"scope": 3255,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 3230,
"name": "ParameterList",
"src": "987:2:18"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 3231,
"name": "ParameterList",
"src": "999:0:18"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3229,
"type": "bool",
"value": "_notEntered"
},
"id": 3232,
"name": "Identifier",
"src": "1421:11:18"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "74727565",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "true"
},
"id": 3233,
"name": "Literal",
"src": "1435:4:18"
}
],
"id": 3234,
"name": "Assignment",
"src": "1421:18:18"
}
],
"id": 3235,
"name": "ExpressionStatement",
"src": "1421:18:18"
}
],
"id": 3236,
"name": "Block",
"src": "999:447:18"
}
],
"id": 3237,
"name": "FunctionDefinition",
"src": "975:471:18"
},
{
"attributes": {
"documentation": "@dev Prevents a contract from calling itself, directly or indirectly.\nCalling a `nonReentrant` function from another `nonReentrant`\nfunction is not supported. It is possible to prevent this from happening\nby making the `nonReentrant` function external, and make it call a\n`private` function that does the actual work.",
"name": "nonReentrant",
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 3238,
"name": "ParameterList",
"src": "1842:2:18"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_ebf73bba305590e4764d5cb53b69bffd6d4d092d1a67551cb346f8cfcdab8619",
"typeString": "literal_string \"ReentrancyGuard: reentrant call\""
}
],
"overloadedDeclarations": [
3273,
3274
],
"referencedDeclaration": 3274,
"type": "function (bool,string memory) pure",
"value": "require"
},
"id": 3239,
"name": "Identifier",
"src": "1926:7:18"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3229,
"type": "bool",
"value": "_notEntered"
},
"id": 3240,
"name": "Identifier",
"src": "1934:11:18"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "5265656e7472616e637947756172643a207265656e7472616e742063616c6c",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "string",
"type": "literal_string \"ReentrancyGuard: reentrant call\"",
"value": "ReentrancyGuard: reentrant call"
},
"id": 3241,
"name": "Literal",
"src": "1947:33:18"
}
],
"id": 3242,
"name": "FunctionCall",
"src": "1926:55:18"
}
],
"id": 3243,
"name": "ExpressionStatement",
"src": "1926:55:18"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3229,
"type": "bool",
"value": "_notEntered"
},
"id": 3244,
"name": "Identifier",
"src": "2056:11:18"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "66616c7365",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "false"
},
"id": 3245,
"name": "Literal",
"src": "2070:5:18"
}
],
"id": 3246,
"name": "Assignment",
"src": "2056:19:18"
}
],
"id": 3247,
"name": "ExpressionStatement",
"src": "2056:19:18"
},
{
"id": 3248,
"name": "PlaceholderStatement",
"src": "2086:1:18"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3229,
"type": "bool",
"value": "_notEntered"
},
"id": 3249,
"name": "Identifier",
"src": "2230:11:18"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "74727565",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "true"
},
"id": 3250,
"name": "Literal",
"src": "2244:4:18"
}
],
"id": 3251,
"name": "Assignment",
"src": "2230:18:18"
}
],
"id": 3252,
"name": "ExpressionStatement",
"src": "2230:18:18"
}
],
"id": 3253,
"name": "Block",
"src": "1845:410:18"
}
],
"id": 3254,
"name": "ModifierDefinition",
"src": "1821:434:18"
}
],
"id": 3255,
"name": "ContractDefinition",
"src": "913:1344:18"
}
],
"id": 3256,
"name": "SourceUnit",
"src": "0:2258:18"
},
"compiler": {
"name": "solc",
"version": "0.5.17+commit.d19bba13.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.3.4",
"updatedAt": "2021-04-04T20:21:29.919Z",
"devdoc": {
"details": "Contract module that helps prevent reentrant calls to a function. * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier available, which can be applied to functions to make sure there are no nested (reentrant) calls to them. * Note that because there is a single `nonReentrant` guard, functions marked as `nonReentrant` may not call one another. This can be worked around by making those functions `private`, and then adding `external` `nonReentrant` entry points to them. * TIP: If you would like to learn more about reentrancy and alternative ways to protect against it, check out our blog post https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. * _Since v2.5.0:_ this module is now much more gas efficient, given net gas metering changes introduced in the Istanbul hardfork.",
"methods": {}
},
"userdoc": {
"methods": {}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,7 @@ async function downloadFile({ url, path }) {
}
async function main() {
const release = await axios.get('https://api.github.com/repos/tornadocash/tornado-core/releases/latest')
const release = await axios.get('https://api.github.com/repos/poofcash/poof-core/releases/latest')
const { assets } = release.data
if (!fs.existsSync(circuitsPath)){
fs.mkdirSync(circuitsPath, { recursive: true })

View File

@ -6,6 +6,7 @@ const FeeManager = artifacts.require('FeeManager')
const hasherContract = artifacts.require('Hasher')
const ERC20Mock = artifacts.require('ERC20Mock')
const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
module.exports = function (deployer, network, accounts) {
return deployer.then(async () => {
@ -19,6 +20,7 @@ module.exports = function (deployer, network, accounts) {
const tokenInstance = await deployer.deploy(ERC20Mock)
token = tokenInstance.address
}
console.log(`Deploying ERC20Tornado with token ${ERC20_TOKEN} and denomination ${TOKEN_AMOUNT}`)
const tornado = await deployer.deploy(
ERC20Tornado,
verifier.address,
@ -29,5 +31,7 @@ module.exports = function (deployer, network, accounts) {
token,
)
console.log('ERC20Tornado\'s address ', tornado.address)
tornado.changeOwner(ZERO_ADDRESS)
console.log('Changed ERC20Tornado contract owner to zero address')
})
}