Compare commits
22 Commits
proposal-2
...
master
Author | SHA1 | Date | |
---|---|---|---|
9e1a3c16d2 | |||
d0cee4aa9a | |||
820a651615 | |||
d9d32f54a5 | |||
5b643d2848 | |||
e5bf96f896 | |||
1494315784 | |||
91889af448 | |||
558b6fcd0c | |||
b4e23e96b4 | |||
023c4634c3 | |||
e8a7fec326 | |||
500d2bd0a4 | |||
334412c803 | |||
6137e1328a | |||
879c8549e6 | |||
d10ea812db | |||
9210330208 | |||
fb0a5131f4 | |||
d16449bcf8 | |||
d9ae37ebb2 | |||
7db929cc8c |
5
.gitignore
vendored
5
.gitignore
vendored
@ -88,5 +88,8 @@ sw.*
|
|||||||
# Mac OSX
|
# Mac OSX
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Events unarchived files
|
||||||
static/*/*.json
|
static/*/*.json
|
||||||
|
|
||||||
|
# UI build archive
|
||||||
|
dist.zip
|
2
.nvmrc
2
.nvmrc
@ -1 +1 @@
|
|||||||
14
|
v14.21.3
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Building locally
|
## Building locally
|
||||||
|
|
||||||
- Install [Node.js](https://nodejs.org) version 14
|
- Install [Node.js](https://nodejs.org) version 16
|
||||||
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
|
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
|
||||||
- Install [Yarn](https://yarnpkg.com/en/docs/install)
|
- Install [Yarn](https://yarnpkg.com/en/docs/install)
|
||||||
- Install dependencies: `yarn`
|
- Install dependencies: `yarn`
|
||||||
|
@ -1,181 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,151 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
@ -4,7 +4,10 @@
|
|||||||
<div class="box-modal-title">{{ $t('withdrawalSettings') }}</div>
|
<div class="box-modal-title">{{ $t('withdrawalSettings') }}</div>
|
||||||
<button type="button" class="delete" @click="$parent.cancel('escape')" />
|
<button type="button" class="delete" @click="$parent.cancel('escape')" />
|
||||||
</header>
|
</header>
|
||||||
<b-tabs v-model="withdrawType" :animated="false" class="is-modal">
|
<b-tabs v-if="isRelayersAvailable" v-model="withdrawType" :animated="false" class="is-modal">
|
||||||
|
<RelayerTab />
|
||||||
|
</b-tabs>
|
||||||
|
<b-tabs v-else v-model="withdrawType" :animated="false" class="is-modal">
|
||||||
<RelayerTab />
|
<RelayerTab />
|
||||||
<WalletTab />
|
<WalletTab />
|
||||||
</b-tabs>
|
</b-tabs>
|
||||||
@ -46,7 +49,11 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState('application', {
|
...mapState('application', {
|
||||||
defaultWithdrawType: 'withdrawType'
|
defaultWithdrawType: 'withdrawType'
|
||||||
})
|
}),
|
||||||
|
...mapState('relayer', ['isLoadingRelayers', 'validRelayers']),
|
||||||
|
isRelayersAvailable() {
|
||||||
|
return !this.isLoadingRelayers && this.validRelayers.length > 0;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.withdrawType = this.defaultWithdrawType
|
this.withdrawType = this.defaultWithdrawType
|
||||||
|
@ -192,7 +192,7 @@ export default {
|
|||||||
...mapState('relayer', ['isLoadingRelayers']),
|
...mapState('relayer', ['isLoadingRelayers']),
|
||||||
...mapGetters('txHashKeeper', ['txExplorerUrl']),
|
...mapGetters('txHashKeeper', ['txExplorerUrl']),
|
||||||
...mapGetters('application', ['isNotEnoughTokens', 'selectedStatisticCurrency']),
|
...mapGetters('application', ['isNotEnoughTokens', 'selectedStatisticCurrency']),
|
||||||
...mapGetters('metamask', ['networkConfig', 'netId', 'isLoggedIn', 'nativeCurrency']),
|
...mapGetters('metamask', ['networkConfig', 'netId', 'isLoggedIn']),
|
||||||
notEnoughDeposits() {
|
notEnoughDeposits() {
|
||||||
if (this.depositsPast < 5) {
|
if (this.depositsPast < 5) {
|
||||||
return true
|
return true
|
||||||
@ -200,7 +200,7 @@ export default {
|
|||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
shouldSettingsShow() {
|
shouldSettingsShow() {
|
||||||
return !this.hasErrorNote && !this.error.message
|
return !this.isLoading && !this.error.type && !this.hasErrorNote
|
||||||
},
|
},
|
||||||
hasErrorNote() {
|
hasErrorNote() {
|
||||||
const note = this.withdrawNote.split('-')[4]
|
const note = this.withdrawNote.split('-')[4]
|
||||||
@ -337,9 +337,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$store.dispatch('application/setAndUpdateStatistic', { currency, amount: Number(amount) })
|
this.$store.dispatch('application/setAndUpdateStatistic', { currency, amount: Number(amount) })
|
||||||
if (currency !== this.nativeCurrency) {
|
this.$store.dispatch('fees/calculateWithdrawalFeeViaRelayer', {})
|
||||||
this.$store.dispatch('application/setDefaultEthToReceive', { currency })
|
|
||||||
}
|
|
||||||
this.$store.dispatch('loading/updateProgress', { progress: -1 })
|
this.$store.dispatch('loading/updateProgress', { progress: -1 })
|
||||||
this.depositsPast = Number(depositsPast) <= 0 ? 0 : depositsPast
|
this.depositsPast = Number(depositsPast) <= 0 ? 0 : depositsPast
|
||||||
this.depositTxHash = txHash
|
this.depositTxHash = txHash
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
|
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
|
||||||
{{ $t('networkFee') }}
|
{{ $t('networkFee') }}
|
||||||
<span data-test="label_network_fee">{{ toDecimals(networkFee, 18, 6) }} {{ networkCurrency }}</span>
|
<span data-test="label_network_fee"
|
||||||
|
>{{ toDecimals(withdrawalNetworkFee, 18, 6) }} {{ networkCurrency }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
|
<div v-if="withdrawType === 'relayer'" class="withdraw-data-item">
|
||||||
{{ $t('relayerFee') }}
|
{{ $t('relayerFee') }}
|
||||||
@ -69,13 +71,13 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('application', ['selectedStatistic']),
|
...mapState('application', ['selectedStatistic']),
|
||||||
|
...mapState('fees', ['withdrawalNetworkFee', 'withdrawalFeeViaRelayer']),
|
||||||
...mapGetters('metamask', ['networkConfig', 'nativeCurrency']),
|
...mapGetters('metamask', ['networkConfig', 'nativeCurrency']),
|
||||||
...mapGetters('metamask', {
|
...mapGetters('metamask', {
|
||||||
networkCurrency: 'currency'
|
networkCurrency: 'currency'
|
||||||
}),
|
}),
|
||||||
...mapGetters('gasPrices', ['gasPriceInGwei']),
|
...mapGetters('fees', ['gasPriceInGwei']),
|
||||||
...mapGetters('token', ['toDecimals', 'fromDecimals']),
|
...mapGetters('token', ['toDecimals', 'fromDecimals']),
|
||||||
...mapGetters('application', ['networkFee']),
|
|
||||||
...mapGetters('price', ['tokenRate']),
|
...mapGetters('price', ['tokenRate']),
|
||||||
relayerFee() {
|
relayerFee() {
|
||||||
const { amount } = this.selectedStatistic
|
const { amount } = this.selectedStatistic
|
||||||
@ -91,7 +93,7 @@ export default {
|
|||||||
const tornadoServiceFee = this.relayerFee
|
const tornadoServiceFee = this.relayerFee
|
||||||
const { currency } = this.selectedStatistic
|
const { currency } = this.selectedStatistic
|
||||||
const { decimals } = this.networkConfig.tokens[currency]
|
const { decimals } = this.networkConfig.tokens[currency]
|
||||||
const ethFee = this.networkFee
|
const ethFee = this.withdrawalNetworkFee
|
||||||
if (currency === this.nativeCurrency) {
|
if (currency === this.nativeCurrency) {
|
||||||
return ethFee.add(tornadoServiceFee)
|
return ethFee.add(tornadoServiceFee)
|
||||||
}
|
}
|
||||||
@ -117,17 +119,12 @@ export default {
|
|||||||
return fromWei(this.ethToReceive)
|
return fromWei(this.ethToReceive)
|
||||||
},
|
},
|
||||||
total() {
|
total() {
|
||||||
const { amount, currency } = this.selectedStatistic
|
const { amount } = this.selectedStatistic
|
||||||
let total = toBN(this.fromDecimals(amount.toString()))
|
let total = toBN(this.fromDecimals(amount.toString()))
|
||||||
|
|
||||||
if (this.withdrawType === 'relayer') {
|
if (this.withdrawType === 'relayer') {
|
||||||
const relayerFee = this.totalRelayerFee
|
const relayerFee = this.withdrawalFeeViaRelayer
|
||||||
|
total = total.sub(relayerFee)
|
||||||
if (currency === this.nativeCurrency) {
|
|
||||||
total = total.sub(relayerFee)
|
|
||||||
} else {
|
|
||||||
total = total.sub(relayerFee).sub(this.ethToReceiveInToken)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.toDecimals(total, null, 6)
|
return this.toDecimals(total, null, 6)
|
||||||
|
@ -65,7 +65,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.checkRecoveryKey()
|
this.checkRecoveryKey()
|
||||||
this.newNotify()
|
this.newNotify()
|
||||||
this.$store.dispatch('gasPrices/setDefault')
|
this.$store.dispatch('fees/setDefaultGasPrice')
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$preventMultitabs()
|
this.$preventMultitabs()
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
await this.selectRpc({ netId: 1, action: this.preselectRpc })
|
await this.selectRpc({ netId: 1, action: this.preselectRpc })
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$store.dispatch('gasPrices/fetchGasPrice')
|
this.$store.dispatch('fees/fetchGasPrice')
|
||||||
this.$store.dispatch('price/fetchTokenPrice', {}, { root: true })
|
this.$store.dispatch('price/fetchTokenPrice', {}, { root: true })
|
||||||
try {
|
try {
|
||||||
this.$store.dispatch('application/loadAllNotesData')
|
this.$store.dispatch('application/loadAllNotesData')
|
||||||
|
@ -21,7 +21,7 @@ export async function checkExistAccount({ getters, dispatch, rootState, rootGett
|
|||||||
|
|
||||||
const isExist = Boolean(Array.isArray(events) && Boolean(events.length))
|
const isExist = Boolean(Array.isArray(events) && Boolean(events.length))
|
||||||
|
|
||||||
console.log('isExist', isExist)
|
console.log('Is encrypted note events exist: ', isExist)
|
||||||
|
|
||||||
dispatch('createMutation', {
|
dispatch('createMutation', {
|
||||||
type: 'CHECK_ACCOUNT',
|
type: 'CHECK_ACCOUNT',
|
||||||
|
@ -29,9 +29,9 @@ export default {
|
|||||||
name: 'MevblockerRPC',
|
name: 'MevblockerRPC',
|
||||||
url: 'https://rpc.mevblocker.io'
|
url: 'https://rpc.mevblocker.io'
|
||||||
},
|
},
|
||||||
llamaRPC: {
|
oneRPC: {
|
||||||
name: 'llamarpc',
|
name: '1RPC',
|
||||||
url: 'https://eth.llamarpc.com'
|
url: 'https://1rpc.io/eth'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
multicall: '0xeefba1e63905ef1d7acba5a8513c70307c1ce441',
|
multicall: '0xeefba1e63905ef1d7acba5a8513c70307c1ce441',
|
||||||
@ -401,17 +401,17 @@ export default {
|
|||||||
multicall: '0xe86e3989c74293Acc962156cd3F525c07b6a1B6e',
|
multicall: '0xe86e3989c74293Acc962156cd3F525c07b6a1B6e',
|
||||||
echoContractAccount: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4',
|
echoContractAccount: '0xa75BF2815618872f155b7C4B0C81bF990f5245E4',
|
||||||
rpcUrls: {
|
rpcUrls: {
|
||||||
publicRpc1: {
|
publicRpc: {
|
||||||
name: 'Avalanche RPC',
|
name: 'Avalanche RPC',
|
||||||
url: 'https://endpoints.omniatech.io/v1/avax/mainnet/public'
|
url: 'https://api.avax.network/ext/bc/C/rpc'
|
||||||
},
|
},
|
||||||
meowRPC: {
|
meowRPC: {
|
||||||
name: 'Meow RPC',
|
name: 'Meow RPC',
|
||||||
url: 'https://avax.meowrpc.com'
|
url: 'https://avax.meowrpc.com'
|
||||||
},
|
},
|
||||||
communityRPC: {
|
oneRPC: {
|
||||||
name: 'Tornado RPC',
|
name: 'OneRPC',
|
||||||
url: 'https://avalanche-rpc.tornado.ws/ext/bc/C/rpc'
|
url: 'https://1rpc.io/avax/c'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tokens: {
|
tokens: {
|
||||||
@ -459,6 +459,10 @@ export default {
|
|||||||
chainnodes: {
|
chainnodes: {
|
||||||
name: 'Tornado RPC',
|
name: 'Tornado RPC',
|
||||||
url: 'https://goerli.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
|
url: 'https://goerli.chainnodes.org/d692ae63-0a7e-43e0-9da9-fe4f4cc6c607'
|
||||||
|
},
|
||||||
|
gatewayRPC: {
|
||||||
|
name: 'Gateway RPC',
|
||||||
|
url: 'https://rpc.goerli.eth.gateway.fm'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tokens: {
|
tokens: {
|
||||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tornadocash-classic-ui",
|
"name": "tornadocash-classic-ui",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Private ethereum transactions",
|
"description": "Private ethereum transactions",
|
||||||
"author": "Tornado Cash Team",
|
"author": "Tornado Cash Team",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -23,9 +23,10 @@
|
|||||||
"@apollo/client": "^3.3.20",
|
"@apollo/client": "^3.3.20",
|
||||||
"@metamask/onboarding": "^1.0.0",
|
"@metamask/onboarding": "^1.0.0",
|
||||||
"@nuxtjs/moment": "^1.6.0",
|
"@nuxtjs/moment": "^1.6.0",
|
||||||
"@tornado/gas-price-oracle": "^0.5.3",
|
"@tornado/fixed-merkle-tree": "0.7",
|
||||||
"@tornado/snarkjs": "0.1.20-p2",
|
"@tornado/snarkjs": "0.1.20",
|
||||||
"@tornado/websnark": "0.0.4-p1",
|
"@tornado/tornado-oracles": "^2.1.0",
|
||||||
|
"@tornado/websnark": "0.0.4",
|
||||||
"@walletconnect/web3-provider": "1.7.8",
|
"@walletconnect/web3-provider": "1.7.8",
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.10.2",
|
||||||
"arraybuffer-loader": "^1.0.8",
|
"arraybuffer-loader": "^1.0.8",
|
||||||
@ -39,7 +40,6 @@
|
|||||||
"eth-ens-namehash": "^2.0.8",
|
"eth-ens-namehash": "^2.0.8",
|
||||||
"eth-sig-util": "^2.5.3",
|
"eth-sig-util": "^2.5.3",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"fixed-merkle-tree": "^0.7.3",
|
|
||||||
"form-data": "^3.0.0",
|
"form-data": "^3.0.0",
|
||||||
"graphql": "^15.5.1",
|
"graphql": "^15.5.1",
|
||||||
"idb": "^6.0.0",
|
"idb": "^6.0.0",
|
||||||
|
@ -262,7 +262,7 @@ export default async (ctx, inject) => {
|
|||||||
|
|
||||||
Object.keys(tokens).forEach((token) => {
|
Object.keys(tokens).forEach((token) => {
|
||||||
Object.keys(tokens[token].instanceAddress).forEach((amount) => {
|
Object.keys(tokens[token].instanceAddress).forEach((amount) => {
|
||||||
if (nativeCurrency === token && netId === 1) {
|
if (nativeCurrency === token) {
|
||||||
stores.push({
|
stores.push({
|
||||||
name: `stringify_bloom_${netId}_${token}_${amount}`,
|
name: `stringify_bloom_${netId}_${token}_${amount}`,
|
||||||
keyPath: 'hashBloom'
|
keyPath: 'hashBloom'
|
||||||
|
@ -3,7 +3,7 @@ import 'dotenv/config'
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
import BloomFilter from 'bloomfilter.js'
|
import BloomFilter from 'bloomfilter.js'
|
||||||
import { MerkleTree } from 'fixed-merkle-tree'
|
import { MerkleTree } from '@tornado/fixed-merkle-tree'
|
||||||
import { buildMimcSponge } from 'circomlibjs'
|
import { buildMimcSponge } from 'circomlibjs'
|
||||||
|
|
||||||
import networkConfig, { enabledChains } from '../networkConfig'
|
import networkConfig, { enabledChains } from '../networkConfig'
|
||||||
|
@ -17,21 +17,22 @@ function updateEncrypted(netId) {
|
|||||||
async function updateCommon(netId) {
|
async function updateCommon(netId) {
|
||||||
const { nativeCurrency, tokens } = networkConfig[`netId${netId}`]
|
const { nativeCurrency, tokens } = networkConfig[`netId${netId}`]
|
||||||
|
|
||||||
console.log(Object.keys(tokens[nativeCurrency].instanceAddress))
|
for (const type of EVENTS) {
|
||||||
|
for (const [tokenName, tokenInfo] of Object.entries(tokens)) {
|
||||||
|
console.log(`${tokenInfo.symbol}: ${Object.keys(tokenInfo.instanceAddress)}`)
|
||||||
|
for (const instance of Object.keys(tokenInfo.instanceAddress)) {
|
||||||
|
console.warn('instance', instance)
|
||||||
|
|
||||||
for await (const type of EVENTS) {
|
const filename = `${type.toLowerCase()}s_${netId}_${tokenName}_${instance}.json`
|
||||||
for await (const instance of Object.keys(tokens[nativeCurrency].instanceAddress)) {
|
|
||||||
console.warn('instance', instance)
|
|
||||||
|
|
||||||
const filename = `${type.toLowerCase()}s_${netId}_${nativeCurrency}_${instance}.json`
|
const isSaved = save(`${EVENTS_PATH}${filename}`)
|
||||||
|
|
||||||
const isSaved = save(`${EVENTS_PATH}${filename}`)
|
if (isSaved) {
|
||||||
|
try {
|
||||||
if (isSaved) {
|
testCommon(netId, type, filename)
|
||||||
try {
|
} catch (err) {
|
||||||
testCommon(netId, type, filename)
|
console.error(err.message)
|
||||||
} catch (err) {
|
}
|
||||||
console.error(err.message)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { MerkleTree, PartialMerkleTree } from 'fixed-merkle-tree'
|
import { MerkleTree, PartialMerkleTree } from '@tornado/fixed-merkle-tree'
|
||||||
|
|
||||||
import { trees } from '@/constants'
|
import { trees } from '@/constants'
|
||||||
import { download } from '@/store/snark'
|
import { download } from '@/store/snark'
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/events/deposits_1_cdai_5000.json.gz
Normal file
BIN
static/events/deposits_1_cdai_5000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_cdai_50000.json.gz
Normal file
BIN
static/events/deposits_1_cdai_50000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_cdai_500000.json.gz
Normal file
BIN
static/events/deposits_1_cdai_500000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_cdai_5000000.json.gz
Normal file
BIN
static/events/deposits_1_cdai_5000000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_dai_100.json.gz
Normal file
BIN
static/events/deposits_1_dai_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_dai_1000.json.gz
Normal file
BIN
static/events/deposits_1_dai_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_dai_10000.json.gz
Normal file
BIN
static/events/deposits_1_dai_10000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_dai_100000.json.gz
Normal file
BIN
static/events/deposits_1_dai_100000.json.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/events/deposits_1_usdc_100.json.gz
Normal file
BIN
static/events/deposits_1_usdc_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_usdc_1000.json.gz
Normal file
BIN
static/events/deposits_1_usdc_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_usdt_100.json.gz
Normal file
BIN
static/events/deposits_1_usdt_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_usdt_1000.json.gz
Normal file
BIN
static/events/deposits_1_usdt_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_wbtc_0.1.json.gz
Normal file
BIN
static/events/deposits_1_wbtc_0.1.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_wbtc_1.json.gz
Normal file
BIN
static/events/deposits_1_wbtc_1.json.gz
Normal file
Binary file not shown.
BIN
static/events/deposits_1_wbtc_10.json.gz
Normal file
BIN
static/events/deposits_1_wbtc_10.json.gz
Normal file
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.
0
static/events/deposits_5_cdai_5000.json.gz
Normal file
0
static/events/deposits_5_cdai_5000.json.gz
Normal file
0
static/events/deposits_5_cdai_50000.json.gz
Normal file
0
static/events/deposits_5_cdai_50000.json.gz
Normal file
0
static/events/deposits_5_cdai_500000.json.gz
Normal file
0
static/events/deposits_5_cdai_500000.json.gz
Normal file
0
static/events/deposits_5_cdai_5000000.json.gz
Normal file
0
static/events/deposits_5_cdai_5000000.json.gz
Normal file
0
static/events/deposits_5_dai_100.json.gz
Normal file
0
static/events/deposits_5_dai_100.json.gz
Normal file
0
static/events/deposits_5_dai_1000.json.gz
Normal file
0
static/events/deposits_5_dai_1000.json.gz
Normal file
0
static/events/deposits_5_dai_10000.json.gz
Normal file
0
static/events/deposits_5_dai_10000.json.gz
Normal file
0
static/events/deposits_5_dai_100000.json.gz
Normal file
0
static/events/deposits_5_dai_100000.json.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0
static/events/deposits_5_usdc_100.json.gz
Normal file
0
static/events/deposits_5_usdc_100.json.gz
Normal file
0
static/events/deposits_5_usdc_1000.json.gz
Normal file
0
static/events/deposits_5_usdc_1000.json.gz
Normal file
0
static/events/deposits_5_usdt_100.json.gz
Normal file
0
static/events/deposits_5_usdt_100.json.gz
Normal file
0
static/events/deposits_5_usdt_1000.json.gz
Normal file
0
static/events/deposits_5_usdt_1000.json.gz
Normal file
0
static/events/deposits_5_wbtc_0.1.json.gz
Normal file
0
static/events/deposits_5_wbtc_0.1.json.gz
Normal file
0
static/events/deposits_5_wbtc_1.json.gz
Normal file
0
static/events/deposits_5_wbtc_1.json.gz
Normal file
0
static/events/deposits_5_wbtc_10.json.gz
Normal file
0
static/events/deposits_5_wbtc_10.json.gz
Normal file
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.
BIN
static/events/withdrawals_1_cdai_5000.json.gz
Normal file
BIN
static/events/withdrawals_1_cdai_5000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_cdai_50000.json.gz
Normal file
BIN
static/events/withdrawals_1_cdai_50000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_cdai_500000.json.gz
Normal file
BIN
static/events/withdrawals_1_cdai_500000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_cdai_5000000.json.gz
Normal file
BIN
static/events/withdrawals_1_cdai_5000000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_dai_100.json.gz
Normal file
BIN
static/events/withdrawals_1_dai_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_dai_1000.json.gz
Normal file
BIN
static/events/withdrawals_1_dai_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_dai_10000.json.gz
Normal file
BIN
static/events/withdrawals_1_dai_10000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_dai_100000.json.gz
Normal file
BIN
static/events/withdrawals_1_dai_100000.json.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/events/withdrawals_1_usdc_100.json.gz
Normal file
BIN
static/events/withdrawals_1_usdc_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_usdc_1000.json.gz
Normal file
BIN
static/events/withdrawals_1_usdc_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_usdt_100.json.gz
Normal file
BIN
static/events/withdrawals_1_usdt_100.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_usdt_1000.json.gz
Normal file
BIN
static/events/withdrawals_1_usdt_1000.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_wbtc_0.1.json.gz
Normal file
BIN
static/events/withdrawals_1_wbtc_0.1.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_wbtc_1.json.gz
Normal file
BIN
static/events/withdrawals_1_wbtc_1.json.gz
Normal file
Binary file not shown.
BIN
static/events/withdrawals_1_wbtc_10.json.gz
Normal file
BIN
static/events/withdrawals_1_wbtc_10.json.gz
Normal file
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
Loading…
Reference in New Issue
Block a user