Conversation
7414f2d to
7735bff
Compare
4050e2e to
ff795e8
Compare
|
TODO:
|
* forge install: permit2 * remove vendored contracts * move IOrders to interfaces/ * move permit2 to folder
test: permit2 flows
| /// @custom:reverts OnlyBuilder if called by non-block builder | ||
| function sweep(address recipient, address token) public { | ||
| if (msg.sender != block.coinbase) revert OnlyBuilder(); | ||
| function sweep(address recipient, address token) external { |
There was a problem hiding this comment.
did we make a decision on specifying a min amount swept here?
There was a problem hiding this comment.
it isn't strictly necessary because sweep should be submitted in a bundle with the corresponding initiate calls; if another Filler gets their bundle submitted first, the second bundle's initiate calls will be rejected (because of the tx nonce) so the bundle should be rejected for that reason.
prestwich
left a comment
There was a problem hiding this comment.
tests pass, code is clean, architecture makes sense
| uint256 num = outputs.length; | ||
| bytes32[] memory hashes = new bytes32[](num); | ||
| for (uint256 i = 0; i < num; ++i) { | ||
| hashes[i] = keccak256(abi.encode(_OUTPUT_TYPEHASH, outputs[i])); |
There was a problem hiding this comment.
so quick note, if the output ever includes another struct or a dynamic type, we can't use abi.encode here. This may be worth documenting here and near the output structdef
| returns (Witness memory _witness) | ||
| { | ||
| _witness.witnessHash = | ||
| keccak256(abi.encode(_ENTER_WITNESS_TYPEHASH, EnterWitness(rollupChainId, rollupRecipient))); |
There was a problem hiding this comment.
same note. if the struct ever includes dynamic types we can't use abi.encode
implement permit2 signature-based token transfers for all token flows