Closed idea404 closed 10 months ago
After you get the value it will be of form 2^128 * deploymentNonce + normalNonce. You then need to do the floored division (BigNumber.div(..)).
This is already implemented in _splitRawNonce()
which is used by getDeploymentNonce()
.
Implented in both SDKs:
zksync2-js v0.2.1
: implementation, testzksync-web3 v0.16.0
: implementation, test
🌟 Feature Request
📝 Description
Implement a new method like
wallet.getDeployNonce()
that returns the deployment nounce.🤔 Rationale
To get the deployment nounce for a deploy transaction now, you need to ask for the
rawNonce
for an account (the param is uint256, you need to pad the address with zeroes to the left) https://github.com/matter-labs/era-system-contracts/blob/3e954a629ad8e01616174bde2218241b360fda0a/contracts/NonceHolder.sol#L35After you get the value it will be of form
2^128 * deploymentNonce + normalNonce
. You then need to do the floored division (BigNumber.div(..)
).