Release 06.11.2024: migration guide
This release of =nil; simplifies operations with the CurrencyId
type by adding new comparison operators. The =nil; CLI can set the RPC endpoint of the Cometa service, removing the need to modify the Cometa config file manually. Usage of the =nil; Hardhat plugin no longer requires passing the --network nil
flag to Ignition deployments and tasks.
Summary of key changes
Nil.sol
now allows for easy comparisons ofCurrencyId
via new comparison operators and 'wrapper' functionsNil.js
includes bindings for using the Cometa service- The =nil; CLI can set the Cometa RPC endpoint for use with the
nil cometa
command - The =nil; CLI can top-up the balances of smart contracts without needing a wallet
- The previously mandatory
--network nil
flag has been removed for Ignition deployments and tasks in the =nil; Hardhat plugin - The endpoints for the Cometa service and the Faucet service have been merged with the standard
http://api.devnet.nil.foundation/api/$USERNAME/$TOKEN
endpoint
Migration of smart contracts
- Use more comparison operators with the
CurrencyId
type
The CurrencyId
type now supports additional comparison operators including !=
, <
, >
, <=
, and >=
. The Nil.sol
library also includes new 'wrapper' functions that apply these operators to the CurrencyId
s passed as their arguments.
Migration of =nil; CLI commands
- Add the Cometa RPC endpoint to the =nil; CLI config
Prior to using the Cometa service via the =nil; CLI, set its RPC endpoint via the nil config set cometa_endpoint COMETA_ENDPOINT
command. Note that this action is not required for using other CLI commands for interacting with the cluster.
Read this tutorial to learn more about the Cometa service.
- Top-up smart contracts without needing a wallet
The =nil; CLI can now be used to top-up smart contracts without requiring a wallet:
nil contract top-up CONTRACT_ADDRESS AMOUNT CURRENCY_ID
Migration of Nil.js
scripts
- Use the new Cometa service bindings in
Nil.js
scripts
The Nil.js
package now contains several 'helper' functions and classes for interacting with the Cometa service. To access the service, simply initialize a new CometaService
and then call compileContract()
and registerContract()
.
More information about the Nil.js
Cometa bindings is given in the references section.
- Remove
await
statements when using the thesigner.getPublicKey()
andsigner.getAddress()
functions
These functions have become synchronous and the await
statement no longer influences their results.
- Remove all usages of the
wallet.getAddressHex()
function
Instead, use the wallet.address
property. It contains the wallet address as a Hex
value.
Migration of Hardhat scripts
- Remove the
--network nil
flag from Ignition deployments and tasks
The =nil; Hardhat plugin no longer requires passing the --network nil
flag when deploying a contract or running a task using Ignition.