thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

Update Solidity v0.8, @openzeppelin/contracts #566

Open jacque006 opened 3 years ago

jacque006 commented 3 years ago

https://www.npmjs.com/package/@openzeppelin/contracts Update to latest v4

jacque006 commented 3 years ago

Note risks/considerations in https://github.com/thehubbleproject/hubble-contracts/issues/564#issuecomment-826034726

ChihChengLiang commented 3 years ago

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.