Skip to content

Commit

Permalink
Merge pull request #29 from ourzora/11-08-prettier_and_add_zk_chains
Browse files Browse the repository at this point in the history
prettier and add zk chains
  • Loading branch information
iainnash authored Nov 8, 2024
2 parents f5dada2 + ca8ac05 commit 86770b5
Show file tree
Hide file tree
Showing 7 changed files with 762 additions and 497 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"license": "MIT",
"type": "module",
"dependencies": {
"@safe-global/protocol-kit": "^3.0.0",
"@safe-global/safe-deployments": "^1.33.0",
"@safe-global/protocol-kit": "^3.1.1",
"@safe-global/safe-deployments": "^1.37.14",
"@zoralabs/zorb": "^0.1.0",
"buffer": "^6.0.3",
"ethers": "^6.7.1",
"formik": "^2.4.5",
"lodash": "^4.17.21",
Expand All @@ -16,7 +17,7 @@
"react-router-dom": "^6.20.0",
"reshaped": "^2.6.0",
"toastify-js": "^1.12.0",
"viem": "^2.9.23",
"viem": "^2.21.43",
"yup": "^1.3.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/NewSafeProposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ const EditProposal = ({
setProposal(proposal);
}
},
[setProposal]
[setProposal],
);

const defaultActions = proposal || DEFAULT_PROPOSAL;
Expand Down Expand Up @@ -399,7 +399,7 @@ export const NewSafeProposal = () => {
setIsEditing(true);
evt.preventDefault();
},
[setIsEditing]
[setIsEditing],
);

return (
Expand Down
20 changes: 19 additions & 1 deletion src/chains.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ContractNetworksConfig } from "@safe-global/protocol-kit";
import { ContractNetworkConfig } from "@safe-global/protocol-kit/dist/src/types";
import * as chains from "viem/chains";

const defaultL2Addresses = {
const defaultL2Addresses: ContractNetworkConfig = {
multiSendAddress: "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
safeProxyFactoryAddress: "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2",
multiSendCallOnlyAddress: "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D",
Expand All @@ -13,12 +14,27 @@ const defaultL2Addresses = {
simulateTxAccessorAddress: "0x59AD6735bCd8152B84860Cb256dD9e96b85F69Da",
};

const zkAddresses: ContractNetworkConfig = {
multiSendAddress: "0x0dFcccB95225ffB03c6FBB2559B530C2B7C8A912",
safeProxyFactoryAddress: "0xDAec33641865E4651fB43181C6DB6f7232Ee91c2",
multiSendCallOnlyAddress: "0xf220D3b4DFb23C4ade8C88E526C1353AbAcbC38F",
fallbackHandlerAddress: "0x2f870a80647BbC554F3a0EBD093f11B4d2a7492A",
createCallAddress: "0xcB8e5E438c5c2b45FbE17B02Ca9aF91509a8ad56",
signMessageLibAddress: "0x357147caf9C0cCa67DfA0CF5369318d8193c8407",
// renamed from safeMasterCopyAddress
safeSingletonAddress: "0x1727c2c531cf966f902E5927b98490fDFb3b2b70",
simulateTxAccessorAddress: "0x4191E2e12E8BC5002424CE0c51f9947b02675a44",
};

// Example how to add new networks before they are merged and released from `safe-global/safe-deployments` package.
export const contractNetworks: ContractNetworksConfig = {
[`${chains.zoraSepolia.id}`]: defaultL2Addresses,
[`${chains.blastSepolia.id}`]: defaultL2Addresses,
[`${chains.optimismSepolia.id}`]: defaultL2Addresses,
[`${chains.blast.id}`]: defaultL2Addresses,
[`${chains.zksyncSepoliaTestnet.id}`]: zkAddresses,
[`${chains.zksync.id}`]: zkAddresses,
[`${chains.abstractTestnet.id}`]: zkAddresses,
};

export const allowedNetworks: { [chainId: number]: chains.Chain } = {
Expand All @@ -36,6 +52,8 @@ export const allowedNetworks: { [chainId: number]: chains.Chain } = {
[chains.optimismSepolia.id]: chains.optimismSepolia,
[chains.blastSepolia.id]: chains.blastSepolia,
[chains.blast.id]: chains.blast,
[chains.zksync.id]: chains.zkSync,
[chains.zksyncSepoliaTestnet.id]: chains.zksyncSepoliaTestnet,
};

Object.keys(contractNetworks).map((network) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SetOwnerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const RemoveOwnerModalContent = ({
{
ownerAddress: target,
threshold: threshold,
}
},
);
if (!removeOwnerTx || !safeInformation) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useSetParamsFromQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export const useRedirectToProposalWithNewParams = () => {
}
setParams(params);
},
[setParams, networkId, safeAddress, pathname, navigate]
[setParams, networkId, safeAddress, pathname, navigate],
);
};
4 changes: 2 additions & 2 deletions src/hooks/useUpdateProposalViaQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Proposal } from "../schemas/proposal";
import { useRedirectToProposalWithNewParams } from "./useSetParamsFromQuery";

export type AddAction = (
newAction: NonNullable<Proposal["actions"]>[0]
newAction: NonNullable<Proposal["actions"]>[0],
) => void;

export type UpdateProposal = {
Expand All @@ -24,7 +24,7 @@ export const useUpdateProposalInQuery = ({
nonce: proposal?.nonce,
});
},
[proposal, setParams]
[proposal, setParams],
);

return {
Expand Down
Loading

0 comments on commit 86770b5

Please sign in to comment.