Skip to content

Commit

Permalink
allow override custom proxy params
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVS09 committed May 30, 2023
1 parent 192d611 commit f877342
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,9 @@ export function addHelpers(
}
}

checkABIConflict = options.proxy.checkABIConflict ?? checkABIConflict;
checkProxyAdmin = options.proxy.checkProxyAdmin ?? checkProxyAdmin;

if (options.proxy.proxyContract) {
if (typeof options.proxy.proxyContract === 'string') {
try {
Expand Down Expand Up @@ -1305,7 +1308,7 @@ export function addHelpers(
);
// ensure no clash
const mergedABI = mergeABIs([proxyContract.abi, artifact.abi], {
check: checkABIConflict, // TODO options for custom proxy ?
check: checkABIConflict,
skipSupportsInterface: true, // TODO options for custom proxy ?
}).filter((v) => v.type !== 'constructor');
mergedABI.push(proxyContractConstructor); // use proxy constructor abi
Expand Down
2 changes: 2 additions & 0 deletions types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ type ProxyOptionsBase = {
artifact?: string | ArtifactData;
};
implementationName?: string;
checkABIConflict?: boolean;
checkProxyAdmin?: boolean;
};

export type ProxyOptions =
Expand Down

0 comments on commit f877342

Please sign in to comment.