Skip to content

Commit

Permalink
Remove non-malleability check
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Aug 1, 2023
1 parent 7fe435c commit 435542b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 38 deletions.
30 changes: 15 additions & 15 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 77967, ~: 78971)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 579597, ~: 579501)
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 307420, ~: 301901)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 78613, ~: 81051)
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 579534, ~: 579438)
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 307357, ~: 301690)
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 213836)
MulticallerTest:testMulticallerGetNames() (gas: 147569)
MulticallerTest:testMulticallerReentrancyGuard() (gas: 18370)
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169441, ~: 171973)
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169308, ~: 171891)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 122104)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 512999, ~: 485451)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 502591, ~: 485451)
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 122228, ~: 122228)
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 32024)
MulticallerTest:testMulticallerRevertWithMessage() (gas: 34841)
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 35700, ~: 35751)
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 35664, ~: 35751)
MulticallerTest:testMulticallerRevertWithNothing() (gas: 31867)
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3408)
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27451)
MulticallerTest:testMulticallerWithNoData() (gas: 16181)
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 129657, ~: 121930)
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 129687, ~: 122088)
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 12442)
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 139951)
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 81467, ~: 80060)
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 586511, ~: 584950)
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 139930)
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 80856, ~: 79849)
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 584010, ~: 584701)
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48950)
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 127328)
MulticallerTest:testMulticallerWithSignerRevert() (gas: 211569)
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 127307)
MulticallerTest:testMulticallerWithSignerRevert() (gas: 211506)
MulticallerTest:testMulticallerWithSignerRevertsWithNastyArrayLength() (gas: 9297)
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 626599, ~: 606086)
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 131569)
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 630925, ~: 606173)
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 131527)
MulticallerTest:testNastyCalldataRevert() (gas: 3388)
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 571, ~: 571)
MulticallerTest:test__codesize() (gas: 50734)
MulticallerTest:test__codesize() (gas: 50657)
TestPlus:test__codesize() (gas: 1102)
2 changes: 1 addition & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ The address of the multicaller with sender contract.
#### `MULTICALLER_WITH_SIGNER`
```solidity
address internal constant MULTICALLER_WITH_SIGNER =
0x0000000000007DeD88fff5c18A2Bb6254ECd4130;
0x0000000000003C6E14B7f65dA82b10132d9904F9;
```

The address of the multicaller with signer contract.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ Enables "forwarding" of `msg.sender` to the contracts called.
- Ethereum
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://etherscan.io/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://etherscan.io/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://etherscan.io/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Goerli
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://goerli.etherscan.io/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://goerli.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://goerli.etherscan.io/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://goerli.etherscan.io/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Sepolia
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://sepolia.etherscan.io/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://sepolia.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://sepolia.etherscan.io/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://sepolia.etherscan.io/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Polygon
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://polygonscan.com/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://polygonscan.com/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://polygonscan.com/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://polygonscan.com/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Mumbai
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://mumbai.polygonscan.com/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://mumbai.polygonscan.com/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://mumbai.polygonscan.com/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://mumbai.polygonscan.com/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Optimism
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://optimistic.etherscan.io/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://optimistic.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://optimistic.etherscan.io/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://optimistic.etherscan.io/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)
- Arbitrum
- Multicaller: [`0x0000000000009C27972b97d86134DFcffACAbE15`](https://arbiscan.io/address/0x0000000000009C27972b97d86134DFcffACAbE15)
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://arbiscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
- MulticallerWithSigner: [`0x0000000000007DeD88fff5c18A2Bb6254ECd4130`](https://arbiscan.io/address/0x0000000000007DeD88fff5c18A2Bb6254ECd4130)
- MulticallerWithSigner: [`0x0000000000003C6E14B7f65dA82b10132d9904F9`](https://arbiscan.io/address/0x0000000000003C6E14B7f65dA82b10132d9904F9)

Please open an issue if you need help to deploy to an EVM chain of your choice.

Expand Down
2 changes: 1 addition & 1 deletion src/LibMulticaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library LibMulticaller {
/**
* @dev The address of the multicaller with signer contract.
*/
address internal constant MULTICALLER_WITH_SIGNER = 0x0000000000007DeD88fff5c18A2Bb6254ECd4130;
address internal constant MULTICALLER_WITH_SIGNER = 0x0000000000003C6E14B7f65dA82b10132d9904F9;

/**
* @dev Returns the caller of `aggregateWithSender` on `MULTICALLER_WITH_SENDER`.
Expand Down
13 changes: 3 additions & 10 deletions src/MulticallerWithSigner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ contract MulticallerWithSigner {
bytes32 private constant _VERSION_HASH =
0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6;

/**
* @dev The number which `s` must be less than in order for
* the signature to be non-malleable.
*/
bytes32 private constant _S_THRES =
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1;

// =============================================================
// ERRORS
// =============================================================
Expand Down Expand Up @@ -220,7 +213,7 @@ contract MulticallerWithSigner {
mstore(returndatasize(), digest) // Store the digest.
calldatacopy(0x40, signature.offset, signature.length) // Copy `r`, `s`, `v`.
mstore(0x20, byte(returndatasize(), mload(0x80))) // `v`.
let t := staticcall(gas(), lt(mload(0x60), _S_THRES), 0x00, 0x80, 0x01, 0x20)
let t := staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20)
signatureIsValid := mul(returndatasize(), eq(signer, mload(t)))
}
// ERC1271 fallback.
Expand Down Expand Up @@ -387,7 +380,7 @@ contract MulticallerWithSigner {
mstore(returndatasize(), digest) // Store the digest.
calldatacopy(0x40, signature.offset, signature.length) // Copy `r`, `s`, `v`.
mstore(0x20, byte(returndatasize(), mload(0x80))) // `v`.
let t := staticcall(gas(), lt(mload(0x60), _S_THRES), 0x00, 0x80, 0x01, 0x20)
let t := staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20)
signatureIsValid := mul(returndatasize(), eq(signer, mload(t)))
}
// ERC1271 fallback.
Expand Down Expand Up @@ -505,7 +498,7 @@ contract MulticallerWithSigner {
mstore(returndatasize(), digest) // Store the digest.
calldatacopy(0x40, signature.offset, signature.length) // Copy `r`, `s`, `v`.
mstore(0x20, byte(returndatasize(), mload(0x80))) // `v`.
let t := staticcall(gas(), lt(mload(0x60), _S_THRES), 0x00, 0x80, 0x01, 0x20)
let t := staticcall(gas(), 1, 0x00, 0x80, 0x01, 0x20)
signatureIsValid := mul(returndatasize(), eq(signer, mload(t)))
}
// ERC1271 fallback.
Expand Down
Loading

0 comments on commit 435542b

Please sign in to comment.