Vectorized

Results 90 comments of Vectorized

Ok, let it marinate for a day or few.

@pcaversaccio I have already removed the check and rearranged some opcodes for lesser stack operations. ;) https://github.com/Rari-Capital/solmate/pull/247/commits/e8aaa05958625d05a8180683c1f02f9a6e319b8c I also knew that the precompile had the checks all along lol 😂...

@1kresh If you can't wait use this first: https://github.com/Vectorized/solady

The test fails for `ERC1155Test::testFailFuzzSafeBatchTransferInsufficientBalance` for certain rare fuzz cases. You can try the following: ```solidity function testFailFuzzSafeBatchTransferInsufficientBalanceRareCase() public { uint256[] memory ids = new uint256[](2); ids[0] = 0; ids[1]...

Note that we need 4 `mstore`s for the reverts, as the scratch space may be dirty from those special tricks.

Let's marinate a while first. I think the [JS and TS codes from merkletreejs, which is used in OpenZeppelin](https://github.com/miguelmota/merkletreejs) may have some unhandled edge cases for when the tree is...

@joshieDo Thanks. Fixed the fuzz test.

https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3446 Ok, changed the case for one node to return true, for: ```solidity MerkleProof.verifyMultiProof( [root] /* proof */, root /* root */, [] /* leafs */, [] /* flags */...

Saves around 200 gas if there are 5 elements in proof. We can make a copy of the function just for calldata. Should we? If @transmissions11 is ok with some...

@hrkrshnn I tried `proof[idx]`, but the assembly cannot compile. Here are some numbers: ``` [PASS] testValidProofSupplied() (gas: 2464) [PASS] testValidProofSuppliedCalldata() (gas: 2262) [PASS] testVerifyEmptyMerkleProofSuppliedLeafAndRootDifferent() (gas: 1733) [PASS] testVerifyEmptyMerkleProofSuppliedLeafAndRootDifferentCalldata() (gas: 1565)...