Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.1",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/providers": "^5.4.3",
"@ethersproject/solidity": "^5.4.0",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/strings": "^5.5.0",
"@ethersproject/units": "^5.4.0",
"@ethersproject/wallet": "^5.4.0",
"@gnosis.pm/safe-apps-provider": "^0.8.0",
Expand All @@ -26,7 +25,7 @@
"@portis/web3": "^4.0.5",
"@pusher/push-notifications-web": "^1.1.0",
"@snapshot-labs/lock": "github:snapshot-labs/lock#master",
"@snapshot-labs/snapshot.js": "^0.2.20",
"@snapshot-labs/snapshot.js": "^0.3.0",
"@toruslabs/torus-embed": "^1.12.1",
"@vue/apollo-composable": "4.0.0-alpha.12",
"@vueuse/core": "^5.2.0",
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ClearDelegate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { ref, watchEffect, inject } from 'vue';
import { useI18n } from 'vue-i18n';
import { useUsername } from '@/composables/useUsername';
import { getInstance } from '@snapshot-labs/lock/plugins/vue3';
import { sendTransaction } from '@snapshot-labs/snapshot.js/src/utils';
import { sendTransaction, sleep } from '@snapshot-labs/snapshot.js/src/utils';
import { formatBytes32String } from '@ethersproject/strings';
import { contractAddress } from '@/helpers/delegation';
import { sleep } from '@/helpers/utils';
import { useTxStatus } from '@/composables/useTxStatus';

const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Plugins.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { ref, computed, watch, toRefs } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';

const props = defineProps({ open: Boolean, plugin: Object });
const emit = defineEmits(['add', 'close']);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/ProposalPlugins.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref, watch, toRefs } from 'vue';
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';
import pluginsObj from '@/../snapshot-plugins/src/plugins';
import pluginsConfig from '@/components/Plugin/config.json';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Strategy.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { ref, computed, toRefs, watch } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';

const defaultParams = {
symbol: 'DAI',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Validation.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { ref, computed, toRefs, watch } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';

const defaultParams = {};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Plugin/CommentBox/Comment.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref, computed, toRef, watch } from 'vue';
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';
import { useNotifications } from '@/composables/useNotifications';
import { useModal } from '@/composables/useModal';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plugin/SafeSnap/Config.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';

const isValidInput = input => {
return input.safes.every(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plugin/SafeSnap/Form/TransactionBatch.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { clone } from '@/helpers/utils';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';
import { useSafesnap } from '@/composables/useSafesnap';

export default {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plugin/SafeSnap/HandleOutcome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
import Plugin from '@/../snapshot-plugins/src/plugins/safeSnap';
import networks from '@snapshot-labs/snapshot.js/src/networks.json';
import { getInstance } from '@snapshot-labs/lock/plugins/vue3';
import { sleep } from '@/helpers/utils';
import { sleep } from '@snapshot-labs/snapshot.js/src/utils';
import { BigNumber } from '@ethersproject/bignumber';
import { formatBatchTransaction } from '@/helpers/abi/utils';
import { formatUnits } from '@ethersproject/units';
Expand Down
19 changes: 0 additions & 19 deletions src/helpers/ens.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/helpers/snapshot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getScores } from '@snapshot-labs/snapshot.js/src/utils';
import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';
import { apolloClient } from '@/helpers/apollo';
import { PROPOSAL_VOTES_QUERY } from '@/helpers/queries';
import cloneDeep from 'lodash/cloneDeep';
Expand Down Expand Up @@ -40,7 +39,6 @@ export async function getProposal(id) {
export async function getResults(space, proposal, votes) {
try {
const voters = votes.map(vote => vote.voter);
const provider = getProvider(space.network);
const strategies = proposal.strategies ?? space.strategies;
/* Get scores */
if (proposal.state !== 'pending') {
Expand All @@ -49,7 +47,6 @@ export async function getResults(space, proposal, votes) {
space.id,
strategies,
space.network,
provider,
voters,
parseInt(proposal.snapshot)
);
Expand Down Expand Up @@ -90,7 +87,6 @@ export async function getPower(space, address, proposal) {
space.id,
strategies,
space.network,
getProvider(space.network),
[address],
parseInt(proposal.snapshot)
);
Expand Down
10 changes: 0 additions & 10 deletions src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ export function jsonParse(input, fallback?) {
}
}

export async function sleep(time) {
return new Promise(resolve => {
setTimeout(resolve, time);
});
}

export function clone(item) {
return JSON.parse(JSON.stringify(item));
}

export function lsSet(key: string, value: any) {
return localStorage.setItem(`${pkg.name}.${key}`, JSON.stringify(value));
}
Expand Down
4 changes: 1 addition & 3 deletions src/views/Delegate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {
getScores
} from '@snapshot-labs/snapshot.js/src/utils';
import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';
import { sleep } from '@snapshot-labs/snapshot.js/src/utils';
import {
getDelegates,
getDelegators,
getDelegatesBySpace,
contractAddress
} from '@/helpers/delegation';
import { sleep } from '@/helpers/utils';
import { useApp } from '@/composables/useApp';
import { useWeb3 } from '@/composables/useWeb3';
import { useTxStatus } from '@/composables/useTxStatus';
Expand Down Expand Up @@ -137,12 +137,10 @@ async function getDelegatesWithScore() {

const delegatesAddresses = uniqueDelegators.map(d => d.delegate);

const provider = getProvider(space.value.network);
const scores = await getScores(
space.value.id,
delegationStrategy,
space.value.network,
provider,
delegatesAddresses,
'latest'
);
Expand Down
1 change: 0 additions & 1 deletion src/views/Playground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ async function loadScores() {
'',
[strategyParams],
form.value.network.toString(),
provider,
form.value.addresses,
parseInt(form.value.snapshot)
);
Expand Down
2 changes: 1 addition & 1 deletion src/views/SpaceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import draggable from 'vuedraggable';
import { useI18n } from 'vue-i18n';
import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';
import { getBlockNumber } from '@snapshot-labs/snapshot.js/src/utils/web3';
import { clone } from '@snapshot-labs/snapshot.js/src/utils';
import { getInstance } from '@snapshot-labs/lock/plugins/vue3';
import { useModal } from '@/composables/useModal';
import { useTerms } from '@/composables/useTerms';
import { PROPOSAL_QUERY } from '@/helpers/queries';
import validations from '@snapshot-labs/snapshot.js/src/validations';
import { clone } from '@/helpers/utils';
import { useDomain } from '@/composables/useDomain';
import { useApolloQuery } from '@/composables/useApolloQuery';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
8 changes: 5 additions & 3 deletions src/views/SpaceSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import { computed, ref, watchEffect, inject } from 'vue';
import { useI18n } from 'vue-i18n';
import { getAddress } from '@ethersproject/address';
import { validateSchema } from '@snapshot-labs/snapshot.js/src/utils';
import {
validateSchema,
getSpaceUri,
clone
} from '@snapshot-labs/snapshot.js/src/utils';
import schemas from '@snapshot-labs/snapshot.js/src/schemas';
import networks from '@snapshot-labs/snapshot.js/src/networks.json';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
import { getSpaceUri } from '@/helpers/ens';
import defaults from '@/locales/default';
import { useCopy } from '@/composables/useCopy';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
55 changes: 44 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
"@ethersproject/logger" "^5.4.0"
bn.js "^4.11.9"

"@ethersproject/bignumber@^5.0.12", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.4.0", "@ethersproject/bignumber@^5.4.1":
"@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.4.0", "@ethersproject/bignumber@^5.4.1":
version "5.4.1"
resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.1.tgz#64399d3b9ae80aa83d483e550ba57ea062c1042d"
integrity sha512-fJhdxqoQNuDOk6epfM7yD6J8Pol4NUCy1vkaGAkuujZm0+lNow//MKu1hLhRiYV4BsOHyBv5/lsTjF+7hWwhJg==
Expand All @@ -528,20 +528,43 @@
"@ethersproject/logger" "^5.4.0"
bn.js "^4.11.9"

"@ethersproject/bignumber@^5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527"
integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==
dependencies:
"@ethersproject/bytes" "^5.5.0"
"@ethersproject/logger" "^5.5.0"
bn.js "^4.11.9"

"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.0.8", "@ethersproject/bytes@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e"
integrity sha512-H60ceqgTHbhzOj4uRc/83SCN9d+BSUnOkrr2intevqdtEMO1JFVZ1XL84OEZV+QjV36OaZYxtnt4lGmxcGsPfA==
dependencies:
"@ethersproject/logger" "^5.4.0"

"@ethersproject/bytes@^5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c"
integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==
dependencies:
"@ethersproject/logger" "^5.5.0"

"@ethersproject/constants@5.4.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a"
integrity sha512-tzjn6S7sj9+DIIeKTJLjK9WGN2Tj0P++Z8ONEIlZjyoTkBuODN+0VfhAyYksKi43l1Sx9tX2VlFfzjfmr5Wl3Q==
dependencies:
"@ethersproject/bignumber" "^5.4.0"

"@ethersproject/constants@^5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e"
integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==
dependencies:
"@ethersproject/bignumber" "^5.5.0"

"@ethersproject/contracts@5.4.1", "@ethersproject/contracts@^5.0.3":
version "5.4.1"
resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.1.tgz#3eb4f35b7fe60a962a75804ada2746494df3e470"
Expand Down Expand Up @@ -627,6 +650,11 @@
resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.0.tgz#f39adadf62ad610c420bcd156fd41270e91b3ca9"
integrity sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ==

"@ethersproject/logger@^5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d"
integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==

"@ethersproject/networks@5.4.2", "@ethersproject/networks@^5.4.0":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.2.tgz#2247d977626e97e2c3b8ee73cd2457babde0ce35"
Expand Down Expand Up @@ -743,7 +771,7 @@
elliptic "6.5.4"
hash.js "1.1.7"

"@ethersproject/solidity@5.4.0", "@ethersproject/solidity@^5.0.10", "@ethersproject/solidity@^5.4.0":
"@ethersproject/solidity@5.4.0", "@ethersproject/solidity@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec"
integrity sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ==
Expand All @@ -754,7 +782,7 @@
"@ethersproject/sha2" "^5.4.0"
"@ethersproject/strings" "^5.4.0"

"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.0.5", "@ethersproject/strings@^5.4.0":
"@ethersproject/strings@5.4.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a"
integrity sha512-k/9DkH5UGDhv7aReXLluFG5ExurwtIpUfnDNhQA29w896Dw3i4uDTz01Quaptbks1Uj9kI8wo9tmW73wcIEaWA==
Expand All @@ -763,6 +791,15 @@
"@ethersproject/constants" "^5.4.0"
"@ethersproject/logger" "^5.4.0"

"@ethersproject/strings@^5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549"
integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==
dependencies:
"@ethersproject/bytes" "^5.5.0"
"@ethersproject/constants" "^5.5.0"
"@ethersproject/logger" "^5.5.0"

"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0"
Expand Down Expand Up @@ -1016,20 +1053,16 @@
version "0.1.3"
resolved "https://codeload.github.com/snapshot-labs/lock/tar.gz/789573f654162e710f9f3b8cba9c34e04242c9ed"

"@snapshot-labs/snapshot.js@^0.2.20":
version "0.2.20"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot.js/-/snapshot.js-0.2.20.tgz#fa174696a2789e32ffcb18d437ba76610d7686a7"
integrity sha512-nw/2b0NcLtkFqeebBqKVXR+qrltoReRZu+QGScT01PBB8pvMXwJQtM/SctEimIc+CrsEDQAuJzFxVPIo2Cwmtw==
"@snapshot-labs/snapshot.js@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@snapshot-labs/snapshot.js/-/snapshot.js-0.3.0.tgz#a026a7a42323f63358bcd40ff7d73a79bddbc70d"
integrity sha512-cvMOyfpV/egef/imY2H4Z/dN3jxhI2guiPeRmgOP6gmOmWlLrHtWAljMj7pYQGjWD9dQHmu/CzCpKalxu+ZQHw==
dependencies:
"@ethersproject/abi" "^5.0.4"
"@ethersproject/address" "^5.0.4"
"@ethersproject/bignumber" "^5.0.12"
"@ethersproject/bytes" "^5.0.8"
"@ethersproject/contracts" "^5.0.3"
"@ethersproject/hash" "^5.0.9"
"@ethersproject/providers" "^5.3.1"
"@ethersproject/solidity" "^5.0.10"
"@ethersproject/strings" "^5.0.5"
"@ethersproject/wallet" "^5.4.0"
ajv "^8.6.0"
ajv-formats "^2.1.0"
Expand Down