Release 04.12.2024: migration guide
This release of =nil; fixes several issues with the =nil; CLI and adds quality-of-life improvements to Nil.js
.
Summary of key changes
General changes
- The Cometa service supports displaying Solidity generated code
- Cometa can now also pinpoint the exact function (in addition to the exact line of code) where an issue occurs
- The names and descriptions of several errors have been made clearer, simplifying debugging
=nil; CLI changes
- The =nil; CLI can use the
rpc_endpoint
from its config for working with the faucet service and the Cometa service if no separate endpoints are set for either of them - The
nil contract call-readonly
command now returns JSON-formatted output when objects are returned by a call - The =nil; CLI can display debug logs and events emitted by smart contracts when using the
nil contract call-readonly
command - The output of the
nil config show
command has been made more concise
Nil.js
changes and smart-contracts
changes
Nil.js
now provides the contract factory, a Hardhat-like interface for interacting with smart contracts- It is possible to estimate gas with
Nil.js
via theestimateGas()
function Nil.js
supports sending somefeeCredit
with external transactions, making external deployment of smart contracts more convenient- The
SmartAccount.sol
contract includes thesimpleAsyncCall()
function that can forward anyfeeCredit
sent with an external transaction
Migration of smart contracts
- Use
simpleAsyncCall()
insideSmartAccount.sol
Previously, the smart account contract in SmartAccount.sol
did not forward feeCredit
from any external transactions that were sent to it. As a result, the smart account used its balance to pay for the execution of smart contracts across async call chains. This made managing feeCredit
complicated when interacting with other smart contracts.
simpleAsyncCall()
resolves this issue: the smart account will use Nil.FORWARD_REMAINING
to send its own remaining feeCredit
across the async call chain. Note that the smart account has one additional overload of simpleAsyncCall()
that accepts the feeCredit
argument and uses Nil.FORWARD_NONE
. This overload is functionally equivalent to the previous asyncCall()
function used by the smart account.
Using the new default smart account requires redeploying it in any existing projects built on =nil;.
Inside SmartAccount.sol
, the asyncCall()
function and its overloads has been removed.
Migration of =nil; CLI commands
- Use
rpc_endpoint
across all services including faucet and Cometa
It is now not necessary to set separate values for rpc_endpoint
, cometa_endpoint
, and faucet_endpoint
in the config file for the =nil; CLI. If cometa_endpoint
and faucet_endpoint
are empty, =nil; CLI will simply send requests to the RPC endpoint, and these services should still work correctly.
- Parse improved output of the
nil contract call-readonly
command
When an object is returned as part of a call, the =nil; CLI can now show JSON-formatted output that demonstrates each object field and value:
Success, result:
(address,string,string,string,string,string,string,string): {"owner": ADDRESS,"profile_name":"Jack Smith","affiliation":"bigco","bio":"bio","role":"engineer","twitter_link":"twitter","linkedin_link":"linkedin","github_link":"github"}
In addition, the CLI now shows logs and events emitted by smart contracts when performing calls.
- View concise contents of the =nil; CLI config file
The nil config show
command now outputs the contents of the CLI config file without any excessive logs:
The config file : path/to/config.ini
private_key : PRIVATE_KEY
address : ADDRESS
rpc_endpoint : RPC_ENDPOINT
As a result, the output of the command should be easier to parse in scripts.