Skip to content

Commit

Permalink
Merge pull request #421 from alephium/minor
Browse files Browse the repository at this point in the history
Throw an error if private functions are exposed in non-devnet
  • Loading branch information
polarker authored Sep 10, 2024
2 parents 782b20b + 74e4100 commit 44072fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/web3/src/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,10 @@ export class Contract extends Artifact {
}

buildByteCodeToDeploy(initialFields: Fields, isDevnet: boolean, exposePrivateFunctions = false): string {
if (exposePrivateFunctions && !isDevnet) {
throw new Error('Cannot expose private functions in non-devnet environment')
}

try {
const bytecode =
exposePrivateFunctions && isDevnet
Expand Down

0 comments on commit 44072fd

Please sign in to comment.