Compare commits

..

No commits in common. "921033020880725a2bd382506fb183dd6d506d1d" and "50d917a33ea4cfe4e07f2b4931f47d5d026e4241" have entirely different histories.

214 changed files with 687 additions and 579 deletions
abis
components/withdraw
layouts
package.json
static/events
deposits_10_eth_0.1.json.gzdeposits_10_eth_1.json.gzdeposits_137_matic_100.json.gzdeposits_137_matic_1000.json.gzdeposits_1_cdai_5000.json.gzdeposits_1_cdai_50000.json.gzdeposits_1_cdai_500000.json.gzdeposits_1_cdai_5000000.json.gzdeposits_1_dai_100.json.gzdeposits_1_dai_1000.json.gzdeposits_1_dai_10000.json.gzdeposits_1_dai_100000.json.gzdeposits_1_eth_0.1.json.gzdeposits_1_eth_1.json.gzdeposits_1_eth_10.json.gzdeposits_1_eth_100.json.gzdeposits_1_usdc_100.json.gzdeposits_1_usdc_1000.json.gzdeposits_1_usdt_100.json.gzdeposits_1_usdt_1000.json.gzdeposits_1_wbtc_0.1.json.gzdeposits_1_wbtc_1.json.gzdeposits_1_wbtc_10.json.gzdeposits_42161_eth_0.1.json.gzdeposits_42161_eth_1.json.gzdeposits_42161_eth_10.json.gzdeposits_43114_avax_10.json.gzdeposits_43114_avax_100.json.gzdeposits_56_bnb_0.1.json.gzdeposits_56_bnb_1.json.gzdeposits_56_bnb_10.json.gzdeposits_56_bnb_100.json.gzdeposits_5_cdai_5000.json.gzdeposits_5_cdai_50000.json.gzdeposits_5_cdai_500000.json.gzdeposits_5_cdai_5000000.json.gzdeposits_5_dai_100.json.gzdeposits_5_dai_1000.json.gzdeposits_5_dai_10000.json.gzdeposits_5_dai_100000.json.gzdeposits_5_eth_0.1.json.gzdeposits_5_eth_1.json.gzdeposits_5_eth_10.json.gzdeposits_5_eth_100.json.gzdeposits_5_usdc_100.json.gzdeposits_5_usdc_1000.json.gzdeposits_5_usdt_100.json.gzdeposits_5_usdt_1000.json.gzdeposits_5_wbtc_0.1.json.gzdeposits_5_wbtc_1.json.gzdeposits_5_wbtc_10.json.gzencrypted_notes_1.json.gzencrypted_notes_10.json.gzencrypted_notes_42161.json.gzencrypted_notes_5.json.gzencrypted_notes_56.json.gzwithdrawals_10_eth_0.1.json.gzwithdrawals_10_eth_1.json.gzwithdrawals_137_matic_100.json.gzwithdrawals_137_matic_1000.json.gzwithdrawals_1_cdai_5000.json.gzwithdrawals_1_cdai_50000.json.gzwithdrawals_1_cdai_500000.json.gzwithdrawals_1_cdai_5000000.json.gzwithdrawals_1_dai_100.json.gzwithdrawals_1_dai_1000.json.gzwithdrawals_1_dai_10000.json.gzwithdrawals_1_dai_100000.json.gzwithdrawals_1_eth_0.1.json.gzwithdrawals_1_eth_1.json.gzwithdrawals_1_eth_10.json.gzwithdrawals_1_eth_100.json.gzwithdrawals_1_usdc_100.json.gzwithdrawals_1_usdc_1000.json.gzwithdrawals_1_usdt_100.json.gzwithdrawals_1_usdt_1000.json.gzwithdrawals_1_wbtc_0.1.json.gzwithdrawals_1_wbtc_1.json.gzwithdrawals_1_wbtc_10.json.gzwithdrawals_42161_eth_0.1.json.gzwithdrawals_42161_eth_1.json.gzwithdrawals_42161_eth_10.json.gzwithdrawals_43114_avax_10.json.gzwithdrawals_56_bnb_0.1.json.gzwithdrawals_56_bnb_1.json.gzwithdrawals_56_bnb_10.json.gzwithdrawals_56_bnb_100.json.gzwithdrawals_5_cdai_5000.json.gzwithdrawals_5_cdai_50000.json.gzwithdrawals_5_cdai_500000.json.gzwithdrawals_5_cdai_5000000.json.gzwithdrawals_5_dai_100.json.gzwithdrawals_5_dai_1000.json.gzwithdrawals_5_dai_10000.json.gz

@ -0,0 +1,181 @@
[
{
"inputs": [
{ "internalType": "contract MultiWrapper", "name": "_multiWrapper", "type": "address" },
{ "internalType": "contract IOracle[]", "name": "existingOracles", "type": "address[]" },
{ "internalType": "enum OffchainOracle.OracleType[]", "name": "oracleTypes", "type": "uint8[]" },
{ "internalType": "contract IERC20[]", "name": "existingConnectors", "type": "address[]" },
{ "internalType": "contract IERC20", "name": "wBase", "type": "address" }
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "contract IERC20", "name": "connector", "type": "address" }
],
"name": "ConnectorAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "contract IERC20", "name": "connector", "type": "address" }
],
"name": "ConnectorRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "contract MultiWrapper", "name": "multiWrapper", "type": "address" }
],
"name": "MultiWrapperUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "contract IOracle", "name": "oracle", "type": "address" },
{
"indexed": false,
"internalType": "enum OffchainOracle.OracleType",
"name": "oracleType",
"type": "uint8"
}
],
"name": "OracleAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": false, "internalType": "contract IOracle", "name": "oracle", "type": "address" },
{
"indexed": false,
"internalType": "enum OffchainOracle.OracleType",
"name": "oracleType",
"type": "uint8"
}
],
"name": "OracleRemoved",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [{ "internalType": "contract IERC20", "name": "connector", "type": "address" }],
"name": "addConnector",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "contract IOracle", "name": "oracle", "type": "address" },
{ "internalType": "enum OffchainOracle.OracleType", "name": "oracleKind", "type": "uint8" }
],
"name": "addOracle",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "connectors",
"outputs": [{ "internalType": "contract IERC20[]", "name": "allConnectors", "type": "address[]" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "contract IERC20", "name": "srcToken", "type": "address" },
{ "internalType": "contract IERC20", "name": "dstToken", "type": "address" },
{ "internalType": "bool", "name": "useWrappers", "type": "bool" }
],
"name": "getRate",
"outputs": [{ "internalType": "uint256", "name": "weightedRate", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "contract IERC20", "name": "srcToken", "type": "address" },
{ "internalType": "bool", "name": "useSrcWrappers", "type": "bool" }
],
"name": "getRateToEth",
"outputs": [{ "internalType": "uint256", "name": "weightedRate", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "multiWrapper",
"outputs": [{ "internalType": "contract MultiWrapper", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oracles",
"outputs": [
{ "internalType": "contract IOracle[]", "name": "allOracles", "type": "address[]" },
{ "internalType": "enum OffchainOracle.OracleType[]", "name": "oracleTypes", "type": "uint8[]" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "contract IERC20", "name": "connector", "type": "address" }],
"name": "removeConnector",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "contract IOracle", "name": "oracle", "type": "address" },
{ "internalType": "enum OffchainOracle.OracleType", "name": "oracleKind", "type": "uint8" }
],
"name": "removeOracle",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "contract MultiWrapper", "name": "_multiWrapper", "type": "address" }],
"name": "setMultiWrapper",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

@ -0,0 +1,151 @@
[
{
"inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "DecimalsUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "GasPriceUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "L1BaseFeeUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "OverheadUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "", "type": "uint256" }],
"name": "ScalarUpdated",
"type": "event"
},
{
"inputs": [],
"name": "decimals",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasPrice",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes", "name": "_data", "type": "bytes" }],
"name": "getL1Fee",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes", "name": "_data", "type": "bytes" }],
"name": "getL1GasUsed",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "l1BaseFee",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "overhead",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "scalar",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_decimals", "type": "uint256" }],
"name": "setDecimals",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_gasPrice", "type": "uint256" }],
"name": "setGasPrice",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_baseFee", "type": "uint256" }],
"name": "setL1BaseFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_overhead", "type": "uint256" }],
"name": "setOverhead",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "uint256", "name": "_scalar", "type": "uint256" }],
"name": "setScalar",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]

@ -192,7 +192,7 @@ export default {
...mapState('relayer', ['isLoadingRelayers']),
...mapGetters('txHashKeeper', ['txExplorerUrl']),
...mapGetters('application', ['isNotEnoughTokens', 'selectedStatisticCurrency']),
...mapGetters('metamask', ['networkConfig', 'netId', 'isLoggedIn']),
...mapGetters('metamask', ['networkConfig', 'netId', 'isLoggedIn', 'nativeCurrency']),
notEnoughDeposits() {
if (this.depositsPast < 5) {
return true
@ -337,7 +337,9 @@ export default {
})
}
this.$store.dispatch('application/setAndUpdateStatistic', { currency, amount: Number(amount) })
this.$store.dispatch('fees/calculateWithdrawalFeeViaRelayer', {})
if (currency !== this.nativeCurrency) {
this.$store.dispatch('application/setDefaultEthToReceive', { currency })
}
this.$store.dispatch('loading/updateProgress', { progress: -1 })
this.depositsPast = Number(depositsPast) <= 0 ? 0 : depositsPast
this.depositTxHash = txHash

@ -18,9 +18,7 @@
</div>
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
{{ $t('networkFee') }}
<span data-test="label_network_fee"
>{{ toDecimals(withdrawalNetworkFee, 18, 6) }} {{ networkCurrency }}</span
>
<span data-test="label_network_fee">{{ toDecimals(networkFee, 18, 6) }} {{ networkCurrency }}</span>
</div>
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
{{ $t('relayerFee') }}
@ -71,13 +69,13 @@ export default {
},
computed: {
...mapState('application', ['selectedStatistic']),
...mapState('fees', ['withdrawalNetworkFee', 'withdrawalFeeViaRelayer']),
...mapGetters('metamask', ['networkConfig', 'nativeCurrency']),
...mapGetters('metamask', {
networkCurrency: 'currency'
}),
...mapGetters('fees', ['gasPriceInGwei']),
...mapGetters('gasPrices', ['gasPriceInGwei']),
...mapGetters('token', ['toDecimals', 'fromDecimals']),
...mapGetters('application', ['networkFee']),
...mapGetters('price', ['tokenRate']),
relayerFee() {
const { amount } = this.selectedStatistic
@ -93,7 +91,7 @@ export default {
const tornadoServiceFee = this.relayerFee
const { currency } = this.selectedStatistic
const { decimals } = this.networkConfig.tokens[currency]
const ethFee = this.withdrawalNetworkFee
const ethFee = this.networkFee
if (currency === this.nativeCurrency) {
return ethFee.add(tornadoServiceFee)
}
@ -119,12 +117,17 @@ export default {
return fromWei(this.ethToReceive)
},
total() {
const { amount } = this.selectedStatistic
const { amount, currency } = this.selectedStatistic
let total = toBN(this.fromDecimals(amount.toString()))
if (this.withdrawType === 'relayer') {
const relayerFee = this.withdrawalFeeViaRelayer
total = total.sub(relayerFee)
const relayerFee = this.totalRelayerFee
if (currency === this.nativeCurrency) {
total = total.sub(relayerFee)
} else {
total = total.sub(relayerFee).sub(this.ethToReceiveInToken)
}
}
return this.toDecimals(total, null, 6)

@ -65,7 +65,7 @@ export default {
created() {
this.checkRecoveryKey()
this.newNotify()
this.$store.dispatch('fees/setDefaultGasPrice')
this.$store.dispatch('gasPrices/setDefault')
},
mounted() {
this.$preventMultitabs()
@ -80,7 +80,7 @@ export default {
await this.selectRpc({ netId: 1, action: this.preselectRpc })
}
this.$store.dispatch('fees/fetchGasPrice')
this.$store.dispatch('gasPrices/fetchGasPrice')
this.$store.dispatch('price/fetchTokenPrice', {}, { root: true })
try {
this.$store.dispatch('application/loadAllNotesData')

@ -1,6 +1,6 @@
{
"name": "tornadocash-classic-ui",
"version": "1.2.0",
"version": "1.1.0",
"description": "Private ethereum transactions",
"author": "Tornado Cash Team",
"scripts": {
@ -23,8 +23,8 @@
"@apollo/client": "^3.3.20",
"@metamask/onboarding": "^1.0.0",
"@nuxtjs/moment": "^1.6.0",
"@tornado/gas-price-oracle": "^0.5.3",
"@tornado/snarkjs": "0.1.20-p2",
"@tornado/tornado-oracles": "1.3.2",
"@tornado/websnark": "0.0.4-p1",
"@walletconnect/web3-provider": "1.7.8",
"ajv": "^6.10.2",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More