Skip to content

Commit b8e3001

Browse files
committed
Merge branches 'dcmt/katana-permit', 'e1Ru1o/changelog-fix' and 'dcmt/release'
4 parents 0bf47fc + 20ece9d + 88da3bb + 0970367 commit b8e3001

File tree

5 files changed

+50
-22
lines changed

5 files changed

+50
-22
lines changed

CHANGELOG.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Master list of UniV3 forks:
4242

4343
### Breaking changes
4444

45+
### Non-breaking changes
46+
47+
## 2026-01-16
48+
49+
### Breaking changes
50+
4551
* Remove EulerSwap action `EULERSWAP` from Base as it has no liquidity
4652
* Remove the following UniV3 forks from Base because they do little-to-no volume
4753
* Thick
@@ -56,16 +62,16 @@ Master list of UniV3 forks:
5662
attempting to buy WETH (wrapped native) is not possible. You will always get
5763
raw ETH (native).
5864
* Added new VIP `TRANSFER_FROM_WITH_PERMIT` to TakerSubmitted settlers.
59-
It is Similar to `TRANSFER_FROM` action but instead of a signature it
65+
* It is Similar to `TRANSFER_FROM` action but instead of a signature it
6066
receives a permit calldata to be executed before transfering the assets.
6167
Permit calldata is encoded as follow:
62-
1. 0x00 for ERC2612 or 0x01 for DAIPermit or 0x02 for NativeMetaTransaction
63-
2. Encoding of:
64-
a. owner, amount, deadline, v, r, s in case of regular ERC2612 permit
65-
b. owner, nonce, expiry, allowed, v, r, s in case of regular DAI permit
66-
c. owner, amount, v, r, s in case of native meta transaction
67-
In all cases spender is allways set to be AllowanceHolder
68-
On native meta transactions `approve` function is allways the function called
68+
a. 0x00 for ERC2612 or 0x01 for DAIPermit or 0x02 for NativeMetaTransaction
69+
b. Encoding of:
70+
a. owner, amount, deadline, v, r, s in case of regular ERC2612 permit
71+
b. owner, nonce, expiry, allowed, v, r, s in case of regular DAI permit
72+
c. owner, amount, v, r, s in case of native meta transaction
73+
* In all cases spender is allways set to be AllowanceHolder.
74+
* On native meta transactions `approve` function is allways the function called
6975

7076
## 2025-12-29
7177

chain_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@
914914
"allowanceHolder": "0x0000000000001fF3684f28c67538d4D072C22734",
915915
"deployer": "0x00000000000004533Fe15556B1E086BB1A72cEae"
916916
},
917-
"sourcifyApi": "https://sourcify-api-monad.blockvision.org",
917+
"sourcifyApi": "https://sourcify-api-monad.blockvision.org/",
918918
"blockscoutApi": "https://api.socialscan.io/monad/v1/explorer/command_api/contract",
919919
"etherscanApi": "https://api.etherscan.io/v2/api?chainid=143"
920920
},

sh/common_gas.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,28 @@ function apply_gas_multiplier {
2727
declare -i _gas_estimate="$1"
2828
shift
2929

30-
# Mantle has funky gas rules, exclude it from this logic
31-
if (( chainid != 5000 )) && (( _gas_estimate > eip7825_gas_limit )) ; then
32-
echo 'Gas estimate without buffer /already/ exceeds the EIP-7825 limit' >&2
33-
exit 1
30+
# Mantle has funky gas rules, exclude it from this logic. EraVm chains similarly price in ergs, not gas.
31+
if (( _gas_estimate > eip7825_gas_limit )) ; then
32+
if (( chainid != 5000 )) && [[ $era_vm != [Tt]rue ]] ; then
33+
echo 'Gas estimate without buffer /already/ exceeds the EIP-7825 limit' >&2
34+
exit 1
35+
fi
3436
fi
3537

3638
declare -i _gas_limit=$((_gas_estimate * gas_estimate_multiplier / 100))
3739

38-
if (( chainid != 5000 )) && (( _gas_limit > eip7825_gas_limit )) ; then
39-
declare _gas_limit_keep_going
40-
IFS='' read -p 'Gas limit with multiplier exceeds EIP-7825 limit. Cap gas limit and keep going? [y/N]: ' -e -r -i n _gas_limit_keep_going
41-
declare -r _gas_limit_keep_going
42-
if [[ "${_gas_limit_keep_going:-n}" != [Yy] ]] ; then
43-
echo >&2
44-
echo 'Exiting as requested' >&2
45-
exit 1
40+
if (( _gas_limit > eip7825_gas_limit )) ; then
41+
if (( chainid != 5000 )) && [[ $era_vm != [Tt]rue ]] ; then
42+
declare _gas_limit_keep_going
43+
IFS='' read -p 'Gas limit with multiplier exceeds EIP-7825 limit. Cap gas limit and keep going? [y/N]: ' -e -r -i n _gas_limit_keep_going
44+
declare -r _gas_limit_keep_going
45+
if [[ "${_gas_limit_keep_going:-n}" != [Yy] ]] ; then
46+
echo >&2
47+
echo 'Exiting as requested' >&2
48+
exit 1
49+
fi
50+
_gas_limit=$eip7825_gas_limit
4651
fi
47-
_gas_limit=$eip7825_gas_limit
4852
fi
4953

5054
echo $_gas_limit

src/Settler.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ abstract contract Settler is ISettlerTakerSubmitted, Permit2PaymentTakerSubmitte
7070
}
7171

7272
function _dispatchVIP(uint256 action, bytes calldata data) internal virtual returns (bool) {
73+
//// NOTICE: Portions of this function have been copy/paste'd into
74+
//// `src/chains/Katana/TakerSubmitted.sol:KatanaSettler._dispatchVIP`. If you make changes
75+
//// here, you need to make sure that corresponding changes are made to that function.
76+
7377
if (action == uint32(ISettlerActions.TRANSFER_FROM.selector)) {
7478
(address recipient, ISignatureTransfer.PermitTransferFrom memory permit, bytes memory sig) =
7579
abi.decode(data, (address, ISignatureTransfer.PermitTransferFrom, bytes));

src/chains/Katana/TakerSubmitted.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {Settler} from "../../Settler.sol";
77
import {IERC20} from "@forge-std/interfaces/IERC20.sol";
88
import {ISignatureTransfer} from "@permit2/interfaces/ISignatureTransfer.sol";
99
import {ISettlerActions} from "../../ISettlerActions.sol";
10+
import {FastLogic} from "../../utils/FastLogic.sol";
11+
import {revertConfusedDeputy} from "../../core/SettlerErrors.sol";
1012

1113
// Solidity inheritance is stupid
1214
import {SettlerAbstract} from "../../SettlerAbstract.sol";
@@ -16,6 +18,8 @@ import {AbstractContext} from "../../Context.sol";
1618

1719
/// @custom:security-contact security@0x.org
1820
contract KatanaSettler is Settler, KatanaMixin {
21+
using FastLogic for bool;
22+
1923
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {}
2024

2125
function _dispatchVIP(uint256 action, bytes calldata data) internal override DANGEROUS_freeMemory returns (bool) {
@@ -27,6 +31,16 @@ contract KatanaSettler is Settler, KatanaMixin {
2731
(ISignatureTransfer.SignatureTransferDetails memory transferDetails,) =
2832
_permitToTransferDetails(permit, recipient);
2933
_transferFrom(permit, transferDetails, sig);
34+
} else if (action == uint32(ISettlerActions.TRANSFER_FROM_WITH_PERMIT.selector)) {
35+
(address recipient, ISignatureTransfer.PermitTransferFrom memory permit, bytes memory permitData) =
36+
abi.decode(data, (address, ISignatureTransfer.PermitTransferFrom, bytes));
37+
if (_isRestrictedTarget(permit.permitted.token).or(!_isForwarded())) {
38+
revertConfusedDeputy();
39+
}
40+
_dispatchPermit(permit.permitted.token, permitData);
41+
(ISignatureTransfer.SignatureTransferDetails memory transferDetails,) =
42+
_permitToTransferDetails(permit, recipient);
43+
_transferFrom(permit, transferDetails, new bytes(0), true);
3044
} else {
3145
return false;
3246
}

0 commit comments

Comments
 (0)