Introducing Locklift v2

Broxus
3 min readAug 30, 2022

--

As many of you know, in addition to high quality DApps, Broxus develops tools for easy and fast development on the Everscale network. And we’re happy to let you know that we’ve recently updated Ever-locklift (GitHub). Ever-locklift is a Node JS framework for working with Everscale contracts that helps you build, test, run and maintain your smart contracts.

Full refactoring & typescript support

The new version is rewritten from scratch in TypeScript. TypeScript tests and scripts are supported natively now. Locklift now uses the everscale-inpage-provider (GitHub) as a core for interacting with the blockchain

The first Locklift version supported only one communication channel with the node — via Graph QL. In the new release, we have added support for the JRPC protocol.

Thanks to the unified code base with https://github.com/broxus/everscale-inpage-provider, the syntax of the new tests largely matches the syntax of your frontend applications.

Type hints

Now any IDE with TypeScript support will provide you with lists of the available methods as well as the parameters corresponding to their types. Types are collected and updated automatically when contracts are being built.

import { FactorySource } from “../build/factorySource”;let sample: Contract<FactorySource[“Sample”]>;

You’ll see both available methods…

…and accepted parameters

Better control over contract execution flow

The code below will wait for the execution of only the first message.

await sample.methods.ping({   recipient: new_sample.address}).sendExternal({ publicKey: signer.publicKey })

In case you need to make sure that the call chain has been fully executed, use waitFinalized.

await locklift.transactions.waitFinalized(   sample.methods.ping({       recipient: new_sample.address     }).sendExternal({ publicKey: signer.publicKey }));

Tracing module

We use the following test contract to demonstrate.

await locklift.tracing.trace(           sample.methods.ping({            recipient: new_sample.address           }).sendExternal({ publicKey: signer.publicKey }),           {}        );

You will get a visual representation of the branch that fell with an error in the console. You can find more details on using the tracing module in the documentation.

Faster compilation

The contracts are now being assembled in parallel. This provides a significant boost in speed, which is especially noticeable on projects with a large code base. For example https://github.com/broxus/octusbridge-contracts/ on the MacBook Pro i9 builds in 5 seconds, while the first version of the locklift takes 18 seconds!

Automatic compiler and linker loading

Now to change the compiler or linker, you just need to specify the version in locklift.config.js . Locklift will automatically download the specified version.

Custom giver support

We have completely updated the giver model. You no longer need to deploy a special Giver contract to deploy contracts to the real network, as it was before. It is enough to specify an existing SafeMultisig wallet from EVER Wallet and specify the seed phrase.

Win and Mac platforms are supported now

Last but not least. From now on, locklift is officially supported on Windows via WSL.

Experience the convenience of Everscale smart contracts development with tools from Broxus! 😊

--

--

Broxus

This is the official Medium account of Broxus, developer of octusbridge.io, flatqube.io, EVER Wallet & everscan.io.