hubble-contracts
hubble-contracts copied to clipboard
Update Solidity v0.8, @openzeppelin/contracts
https://www.npmjs.com/package/@openzeppelin/contracts Update to latest v4
- Requires solidity v0.8
- Note section How to upgrade from 3.x in https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.0.0 , includes upgrade script.
Note risks/considerations in https://github.com/thehubbleproject/hubble-contracts/issues/564#issuecomment-826034726
One nice thing to have in 0.8 is the dynamic calldata. Solidity seems to support this in the higher version https://github.com/ethereum/solidity/issues/9160 (need to validate if it works ).
The current submitTransfer looks like this
function submitTransfer(
bytes32[] calldata stateRoots,
uint256[2][] calldata signatures,
uint256[] calldata feeReceivers,
bytes[] calldata txss
) external ... {
but with that, we can do
function submitTransfer(TransferCommitment[] calldata commits) external ... {
which would improve readability a lot.