Skip to content

Commit

Permalink
fix abi serialization for proxy (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
killroy192 authored Mar 6, 2024
1 parent f0323ea commit fc21f32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dgma/hardhat-sol-bundler",
"version": "0.5.4",
"version": "0.5.5",
"description": "Declarative deployment tool for smart contracts",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe("context", () => {
const state = stateFabric.create({} as IGlobalState);
const expectedContractState = {
address: "0xaddress",
abi: [{} as ethers.ethers.Fragment] as ethers.Interface["fragments"],
abi: [] as ethers.Interface["fragments"],
factoryByteCode: "bytecode",
args: [1, 2, 3],
contractName: "ContractName",
Expand Down
13 changes: 12 additions & 1 deletion src/deploy/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,18 @@ export const serialize: ContextManipulator = async (
const cst = contractState?.value();
if (cst) {
const abi = cst.contract!.interface.fragments.concat(
cst.proxy ? cst.factory!.interface.fragments : [],
cst.proxy
? cst.factory!.interface.fragments.filter((fragment) => {
const isNotValid =
fragment.type !== "constructor" && fragment.type !== "fallback";

if (isNotValid) {
console.warn(
`contract ${cst.name} has intersect fragments for constructor or fallback. Chose those which describes proxy contract`,
);
}
})
: [],
);

const ctxUpdate: Partial<ILockContract> = {
Expand Down

0 comments on commit fc21f32

Please sign in to comment.