Other Resources
Upgradable contracts
Modification to deployment scripts might be required; reference Zksync docs or our example project.
call vs send/transfer
transfer
and send
forwards a fixed amount of 2300 gas to the receiving contract; such calls will fail depending on the pubdata costs.
Please use payable(<address>).call{value: <X>}("")
instead, but take care of potential reentrancy attack vectors that are usually mitigated by these send
/ transfer
gas limit.
System contracts
In ZKsync, system contracts are special types of smart contracts that are deployed and controlled by the protocol itself, rather than by external users. In some cases, these contracts can also be leveraged by developers to simplify development. We demonstrate this in our example project by using the ContractDeployer
system contract to retrieve the deterministic address (contractDeployer.getNewAddressCreate2()
) of a CREATE2
deployed contract.
Other Links
Additional system contract usage can be found in Abstract’s documentation.