Skip to content

Commit 8c07107

Browse files
authored
♻️ 1.3.1: Update MulticallerWithSigner with defensive signing (#28)
1 parent 8a4540a commit 8c07107

File tree

9 files changed

+267
-143
lines changed

9 files changed

+267
-143
lines changed

.gas-snapshot

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 80066, ~: 81872)
2-
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 580304, ~: 580357)
3-
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 306501, ~: 301746)
1+
MulticallerTest:testMultiCallerWithSignerIncrementNonceSalt(uint256) (runs: 256, μ: 83521, ~: 82301)
2+
MulticallerTest:testMultiCallerWithSignerIncrementNonceSaltWithERC1271(uint256) (runs: 256, μ: 614878, ~: 614930)
3+
MulticallerTest:testMulticallerCdFallback(string) (runs: 256, μ: 295907, ~: 281868)
44
MulticallerTest:testMulticallerForwardsMessageValue() (gas: 214013)
55
MulticallerTest:testMulticallerGetNames() (gas: 147637)
66
MulticallerTest:testMulticallerReentrancyGuard() (gas: 19980)
7-
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169898, ~: 172026)
7+
MulticallerTest:testMulticallerRefund(uint256) (runs: 256, μ: 169978, ~: 172012)
88
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded() (gas: 122173)
9-
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 520631, ~: 527233)
9+
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(string,string,uint256) (runs: 256, μ: 487938, ~: 508582)
1010
MulticallerTest:testMulticallerReturnDataIsProperlyEncoded(uint256,uint256,uint256,uint256) (runs: 256, μ: 122252, ~: 122252)
1111
MulticallerTest:testMulticallerRevertWithCustomError() (gas: 35485)
1212
MulticallerTest:testMulticallerRevertWithMessage() (gas: 38244)
13-
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 39122, ~: 39181)
13+
MulticallerTest:testMulticallerRevertWithMessage(string) (runs: 256, μ: 38922, ~: 38644)
1414
MulticallerTest:testMulticallerRevertWithNothing() (gas: 35306)
1515
MulticallerTest:testMulticallerSenderDoesNotRevertWithoutMulticallerDeployed() (gas: 3423)
1616
MulticallerTest:testMulticallerTargetGetMulticallerSender() (gas: 27448)
1717
MulticallerTest:testMulticallerWithNoData() (gas: 16213)
18-
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 127763, ~: 118802)
18+
MulticallerTest:testMulticallerWithSigner(uint256) (runs: 256, μ: 131230, ~: 119355)
1919
MulticallerTest:testMulticallerWithSignerEIP712Domain() (gas: 12375)
20-
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 135610)
21-
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 79498, ~: 77716)
22-
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 584890, ~: 584632)
20+
MulticallerTest:testMulticallerWithSignerGetMulticallerSigner() (gas: 136389)
21+
MulticallerTest:testMulticallerWithSignerInvalidateNonces(uint256) (runs: 256, μ: 81419, ~: 79804)
22+
MulticallerTest:testMulticallerWithSignerInvalidateNoncesWithERC1271(uint256) (runs: 256, μ: 616664, ~: 616391)
2323
MulticallerTest:testMulticallerWithSignerNonPayableFunctions() (gas: 48884)
24-
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124037)
25-
MulticallerTest:testMulticallerWithSignerRevert() (gas: 203818)
26-
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 613068, ~: 601565)
27-
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 128593)
24+
MulticallerTest:testMulticallerWithSignerReentrancyGuard() (gas: 124909)
25+
MulticallerTest:testMulticallerWithSignerRevert() (gas: 206240)
26+
MulticallerTest:testMulticallerWithSignerWithERC1271(uint256) (runs: 256, μ: 659790, ~: 651359)
27+
MulticallerTest:testMulticallerWithSignerWithNoData() (gas: 130147)
2828
MulticallerTest:testNastyCalldataRevert() (gas: 3420)
2929
MulticallerTest:testOffsetTrick(uint256,uint256,uint256) (runs: 256, μ: 571, ~: 571)
30-
MulticallerTest:test__codesize() (gas: 49524)
30+
MulticallerTest:test__codesize() (gas: 50276)
3131
TestPlus:test__codesize() (gas: 1102)

API.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@ If you need them in your code, please copy and paste them.
101101
#### `_AGGREGATE_WITH_SIGNER_TYPEHASH`
102102
```solidity
103103
bytes32 private constant _AGGREGATE_WITH_SIGNER_TYPEHASH =
104-
0xc4d2f044d99707794280032fc14879a220a3f7dc766d75100809624f91d69e97;
104+
0xfb989fd34c8af81a76f18167f528fc7315f92cacc19a0e63215abd54633f8a28;
105105
```
106106

107107
For EIP-712 signature digest calculation for the `aggregateWithSigner` function.
108108

109-
`keccak256("AggregateWithSigner(address[] targets,bytes[] data,uint256[] values,uint256 nonce,uint256 nonceSalt)")`.
109+
`keccak256("AggregateWithSigner(address signer,address[] targets,bytes[] data,uint256[] values,uint256 nonce,uint256 nonceSalt)")`.
110110

111+
- `signer`: The signer of the signature.
111112
- `targets`: An array of addresses to call.
112113
- `data`: An array of calldata to forward to the targets.
113114
- `values`: How much ETH to forward to each target.
@@ -117,26 +118,28 @@ For EIP-712 signature digest calculation for the `aggregateWithSigner` function.
117118
#### `_INVALIDATE_NONCES_FOR_SIGNER_TYPEHASH`
118119
```solidity
119120
bytes32 private constant _INVALIDATE_NONCES_FOR_SIGNER_TYPEHASH =
120-
0xe75b4aefef1358e66ac7ed2f180022e0a7f661dcd2781630ce58e05bb8bdb1c1;
121+
0x12b047058eea3df4085cdc159a103d9c100c4e78cfb7029cc39d02cb8b9e48f5;
121122
```
122123

123124
For EIP-712 signature digest calculation for the `invalidateNoncesForSigner` function.
124125

125-
`keccak256("InvalidateNoncesForSigner(uint256[] nonces,uint256 nonceSalt)")`.
126+
`keccak256("InvalidateNoncesForSigner(address signer,uint256[] nonces,uint256 nonceSalt)")`.
126127

128+
- `signer`: The signer of the signature.
127129
- `nonces`: The array of nonces for the signer.
128130
- `nonceSalt`: The current nonce salt of the signer.
129131

130132
#### `_INCREMENT_NONCE_SALT_FOR_SIGNER_TYPEHASH`
131133
```solidity
132134
bytes32 private constant _INCREMENT_NONCE_SALT_FOR_SIGNER_TYPEHASH =
133-
0x898da98c106c91ce6f05405740b0ed23b5c4dc847a0dd1996fb93189d8310bef;
135+
0xfa181078c7d1d4d369301511d3c5611e9367d0cebbf65eefdee9dfc75849c1d3;
134136
```
135137

136138
For EIP-712 signature digest calculation for the `incrementNonceSaltForSigner` function.
137139

138-
`keccak256("IncrementNonceSaltForSigner(uint256 nonceSalt)")`.
140+
`keccak256("IncrementNonceSaltForSigner(address signer,uint256 nonceSalt)")`.
139141

142+
- `signer`: The signer of the signature.
140143
- `nonceSalt`: The current nonce salt of the signer.
141144

142145
#### `_DOMAIN_TYPEHASH`
@@ -327,7 +330,7 @@ The address of the multicaller with sender contract.
327330
#### `MULTICALLER_WITH_SIGNER`
328331
```solidity
329332
address internal constant MULTICALLER_WITH_SIGNER =
330-
0x0000000000005e17F9eA3651537Cffda3946E0be;
333+
0x000000000000D9ECebf3C23529de49815Dac1c4c;
331334
```
332335

333336
The address of the multicaller with signer contract.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ Please open an issue if you need help to deploy to an EVM chain of your choice.
1414
- Ethereum
1515
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://etherscan.io/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
1616
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
17-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://etherscan.io/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
17+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://etherscan.io/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
1818
- Goerli
1919
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://goerli.etherscan.io/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
2020
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://goerli.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
21-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://goerli.etherscan.io/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
21+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://goerli.etherscan.io/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
2222
- Sepolia
2323
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://sepolia.etherscan.io/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
2424
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://sepolia.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
25-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://sepolia.etherscan.io/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
25+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://sepolia.etherscan.io/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
2626
- Polygon
2727
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://polygonscan.com/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
2828
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://polygonscan.com/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
29-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://polygonscan.com/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
29+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://polygonscan.com/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
3030
- Mumbai
3131
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://mumbai.polygonscan.com/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
3232
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://mumbai.polygonscan.com/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
33-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://mumbai.polygonscan.com/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
33+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://mumbai.polygonscan.com/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
3434
- Optimism
3535
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://optimistic.etherscan.io/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
3636
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://optimistic.etherscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
37-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://optimistic.etherscan.io/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
37+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://optimistic.etherscan.io/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
3838
- Arbitrum
3939
- Multicaller: [`0x0000000000002Bdbf1Bf3279983603Ec279CC6dF`](https://arbiscan.io/address/0x0000000000002Bdbf1Bf3279983603Ec279CC6dF)
4040
- MulticallerWithSender: [`0x00000000002Fd5Aeb385D324B580FCa7c83823A0`](https://arbiscan.io/address/0x00000000002Fd5Aeb385D324B580FCa7c83823A0)
41-
- MulticallerWithSigner: [`0x0000000000005e17F9eA3651537Cffda3946E0be`](https://arbiscan.io/address/0x0000000000005e17F9eA3651537Cffda3946E0be)
41+
- MulticallerWithSigner: [`0x000000000000D9ECebf3C23529de49815Dac1c4c`](https://arbiscan.io/address/0x000000000000D9ECebf3C23529de49815Dac1c4c)
4242

4343
## Contracts
4444

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "multicaller",
33
"license": "MIT",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"description": "Efficient multicaller contract",
66
"files": [
77
"src/**/*.sol"

src/LibMulticaller.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ library LibMulticaller {
3030
/**
3131
* @dev The address of the multicaller with signer contract.
3232
*/
33-
address internal constant MULTICALLER_WITH_SIGNER = 0x0000000000005e17F9eA3651537Cffda3946E0be;
33+
address internal constant MULTICALLER_WITH_SIGNER = 0x000000000000D9ECebf3C23529de49815Dac1c4c;
3434

3535
/**
3636
* @dev Returns the caller of `aggregateWithSender` on `MULTICALLER_WITH_SENDER`.

0 commit comments

Comments
 (0)