@@ -2,12 +2,23 @@ import { azimuth } from 'azimuth-js';
3import { usePointCache } from 'store/pointCache';
3import { usePointCache } from 'store/pointCache';
5−import { eqAddr } from './wallet';
5+import { eqAddr, ETH_ZERO_ADDR } from './wallet';
7const NULL_PERMISSIONS = {
7const NULL_PERMISSIONS = {
8 isOwner: false,
12 isOwner: false,
13+ isActiveOwner: false,
9 isTransferProxy: false,
14 isTransferProxy: false,
10 isManagementProxy: false,
15 isManagementProxy: false,
17+ isManagementProxySet: false,
18+ isSpawnProxySet: false,
19+ isVotingProxySet: false,
20+ isTransferProxySet: false,
11 canManage: false,
22 canManage: false,
12 canTransfer: false,
23 canTransfer: false,
13 canSpawn: false,
24 canSpawn: false,
@@ -31,10 +42,18 @@ export default function usePermissionsForPoint(address, point) {
32 const isOwner = eqAddr(address, details.owner);
43 const isOwner = eqAddr(address, details.owner);
33 const isActiveOwner = isOwner && details.active;
44 const isActiveOwner = isOwner && details.active;
34− const isTransferProxy = eqAddr(address, details.transferProxy);
35 const isManagementProxy = eqAddr(address, details.managementProxy);
45 const isManagementProxy = eqAddr(address, details.managementProxy);
36 const isSpawnProxy = eqAddr(address, details.spawnProxy);
46 const isSpawnProxy = eqAddr(address, details.spawnProxy);
37 const isVotingProxy = eqAddr(address, details.votingProxy);
47 const isVotingProxy = eqAddr(address, details.votingProxy);
48+ const isTransferProxy = eqAddr(address, details.transferProxy);
50+ const isManagementProxySet = !eqAddr(
52+ details.managementProxy
54+ const isSpawnProxySet = !eqAddr(ETH_ZERO_ADDR, details.spawnProxy);
55+ const isVotingProxySet = !eqAddr(ETH_ZERO_ADDR, details.votingProxy);
56+ const isTransferProxySet = !eqAddr(ETH_ZERO_ADDR, details.transferProxy);
39 const canManage = isOwner || isManagementProxy;
58 const canManage = isOwner || isManagementProxy;
40 const canTransfer = isOwner || isTransferProxy;
59 const canTransfer = isOwner || isTransferProxy;
@@ -51,6 +70,11 @@ export default function usePermissionsForPoint(address, point) {
51 isTransferProxy,
70 isTransferProxy,
52 isManagementProxy,
71 isManagementProxy,
73+ isManagementProxySet,
54 canManage,
78 canManage,
55 canTransfer,
79 canTransfer,