Skip to content

Commit

Permalink
Allow visibility on human-readable constructors (via telegram).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 28, 2023
1 parent b5724e4 commit 3a52201
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src.ts/abi/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function setify(items: Array<string>): ReadonlySet<string> {
return Object.freeze(result);
}

const _kwVisibDeploy = "external public payable";
const KwVisibDeploy = setify(_kwVisibDeploy.split(" "));

// Visibility Keywords
const _kwVisib = "constant external internal payable private public pure view";
const KwVisib = setify(_kwVisib.split(" "));
Expand Down Expand Up @@ -1265,7 +1268,7 @@ export class ConstructorFragment extends Fragment {
} else if (obj instanceof TokenString) {
consumeKeywords(obj, setify([ "constructor" ]));
const inputs = consumeParams(obj);
const payable = !!consumeKeywords(obj, setify([ "payable" ])).has("payable");
const payable = !!consumeKeywords(obj, KwVisibDeploy).has("payable");
const gas = consumeGas(obj);
consumeEoi(obj);

Expand Down

0 comments on commit 3a52201

Please sign in to comment.