Skip to content

Commit

Permalink
add workchain check for newAddress const evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Apr 17, 2024
1 parent 59038b4 commit 2cc6347
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types/resolveConstantValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ function reduceAddress(ast: ASTExpression, ctx: CompilerContext): Address {
reduceInt(ast.args[1]).toString(16),
"hex",
);
if (wc !== 0n && wc !== -1n) {
throwError(
`Expected workchain to equal 0 or -1, received: ${wc}`,
ast.ref,
);
}
if (!enabledMasterchain(ctx)) {
if (wc !== 0n) {
throwError(
Expand Down

0 comments on commit 2cc6347

Please sign in to comment.