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 authored and Woodpile37 committed Jan 14, 2024
1 parent ec3b19a commit 9eb88e0
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 9eb88e0

Please sign in to comment.