-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: specialize
SettlerIntent
on all other chains
- Loading branch information
Showing
11 changed files
with
419 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.25; | |
import {SettlerBase} from "../SettlerBase.sol"; | ||
import {Settler} from "../Settler.sol"; | ||
import {SettlerMetaTxn} from "../SettlerMetaTxn.sol"; | ||
import {SettlerIntent} from "../SettlerIntent.sol"; | ||
|
||
import {IERC20} from "forge-std/interfaces/IERC20.sol"; | ||
import {MaverickV2, IMaverickV2Pool} from "../core/MaverickV2.sol"; | ||
|
@@ -39,6 +40,7 @@ import {dackieSwapV3ArbitrumFactory, dackieSwapV3ForkId} from "../core/univ3fork | |
import {SettlerAbstract} from "../SettlerAbstract.sol"; | ||
import {AbstractContext} from "../Context.sol"; | ||
import {Permit2PaymentAbstract} from "../core/Permit2PaymentAbstract.sol"; | ||
import {Permit2PaymentMetaTxn} from "../core/Permit2Payment.sol"; | ||
|
||
abstract contract ArbitrumMixin is FreeMemory, SettlerBase, MaverickV2, CurveTricrypto, DodoV2 { | ||
constructor() { | ||
|
@@ -124,9 +126,9 @@ abstract contract ArbitrumMixin is FreeMemory, SettlerBase, MaverickV2, CurveTri | |
|
||
/// @custom:security-contact [email protected] | ||
contract ArbitrumSettler is Settler, ArbitrumMixin { | ||
constructor(bytes20 gitCommit) Settler(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data) internal override DANGEROUS_freeMemory returns (bool) { | ||
function _dispatchVIP(bytes4 action, bytes calldata data) internal virtual override DANGEROUS_freeMemory returns (bool) { | ||
if (super._dispatchVIP(action, data)) { | ||
return true; | ||
} else if (action == ISettlerActions.MAVERICKV2_VIP.selector) { | ||
|
@@ -168,6 +170,7 @@ contract ArbitrumSettler is Settler, ArbitrumMixin { | |
|
||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, ArbitrumMixin) | ||
returns (bool) | ||
{ | ||
|
@@ -181,10 +184,11 @@ contract ArbitrumSettler is Settler, ArbitrumMixin { | |
|
||
/// @custom:security-contact [email protected] | ||
contract ArbitrumSettlerMetaTxn is SettlerMetaTxn, ArbitrumMixin { | ||
constructor(bytes20 gitCommit) SettlerMetaTxn(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) | ||
internal | ||
virtual | ||
override | ||
DANGEROUS_freeMemory | ||
returns (bool) | ||
|
@@ -219,13 +223,44 @@ contract ArbitrumSettlerMetaTxn is SettlerMetaTxn, ArbitrumMixin { | |
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, ArbitrumMixin) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
function _msgSender() internal view virtual override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
return super._msgSender(); | ||
} | ||
} | ||
|
||
/// @custom:security-contact [email protected] | ||
contract ArbitrumSettlerIntent is SettlerIntent, ArbitrumSettlerMetaTxn { | ||
constructor(bytes20 gitCommit) ArbitrumSettlerMetaTxn(gitCommit) {} | ||
|
||
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
override(ArbitrumSettlerMetaTxn, SettlerBase, SettlerAbstract) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerIntent, ArbitrumSettlerMetaTxn) returns (address) { | ||
return super._msgSender(); | ||
} | ||
|
||
function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) { | ||
return super._witnessTypeSuffix(); | ||
} | ||
|
||
function _tokenId() internal pure override(SettlerIntent, SettlerMetaTxn, SettlerAbstract) returns (uint256) { | ||
return super._tokenId(); | ||
} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) internal override(ArbitrumSettlerMetaTxn, SettlerMetaTxn) returns (bool) { | ||
return super._dispatchVIP(action, data, sig); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.25; | |
import {SettlerBase} from "../SettlerBase.sol"; | ||
import {Settler} from "../Settler.sol"; | ||
import {SettlerMetaTxn} from "../SettlerMetaTxn.sol"; | ||
import {SettlerIntent} from "../SettlerIntent.sol"; | ||
|
||
import {IERC20} from "forge-std/interfaces/IERC20.sol"; | ||
import {DodoV2, IDodoV2} from "../core/DodoV2.sol"; | ||
|
@@ -24,6 +25,7 @@ import { | |
import {SettlerAbstract} from "../SettlerAbstract.sol"; | ||
import {AbstractContext} from "../Context.sol"; | ||
import {Permit2PaymentAbstract} from "../core/Permit2PaymentAbstract.sol"; | ||
import {Permit2PaymentMetaTxn} from "../core/Permit2Payment.sol"; | ||
|
||
abstract contract AvalancheMixin is FreeMemory, SettlerBase, DodoV2 { | ||
constructor() { | ||
|
@@ -72,7 +74,7 @@ abstract contract AvalancheMixin is FreeMemory, SettlerBase, DodoV2 { | |
|
||
/// @custom:security-contact [email protected] | ||
contract AvalancheSettler is Settler, AvalancheMixin { | ||
constructor(bytes20 gitCommit) Settler(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data) internal override DANGEROUS_freeMemory returns (bool) { | ||
return super._dispatchVIP(action, data); | ||
|
@@ -103,10 +105,11 @@ contract AvalancheSettler is Settler, AvalancheMixin { | |
|
||
/// @custom:security-contact [email protected] | ||
contract AvalancheSettlerMetaTxn is SettlerMetaTxn, AvalancheMixin { | ||
constructor(bytes20 gitCommit) SettlerMetaTxn(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) | ||
internal | ||
virtual | ||
override | ||
DANGEROUS_freeMemory | ||
returns (bool) | ||
|
@@ -117,13 +120,44 @@ contract AvalancheSettlerMetaTxn is SettlerMetaTxn, AvalancheMixin { | |
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, AvalancheMixin) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
function _msgSender() internal view virtual override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
return super._msgSender(); | ||
} | ||
} | ||
|
||
/// @custom:security-contact [email protected] | ||
contract SepoliSaettlerIntent is SettlerIntent, AvalancheSettlerMetaTxn { | ||
constructor(bytes20 gitCommit) AvalancheSettlerMetaTxn(gitCommit) {} | ||
|
||
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
override(AvalancheSettlerMetaTxn, SettlerBase, SettlerAbstract) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerIntent, AvalancheSettlerMetaTxn) returns (address) { | ||
return super._msgSender(); | ||
} | ||
|
||
function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) { | ||
return super._witnessTypeSuffix(); | ||
} | ||
|
||
function _tokenId() internal pure override(SettlerIntent, SettlerMetaTxn, SettlerAbstract) returns (uint256) { | ||
return super._tokenId(); | ||
} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) internal override(AvalancheSettlerMetaTxn, SettlerMetaTxn) returns (bool) { | ||
return super._dispatchVIP(action, data, sig); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.25; | |
import {SettlerBase} from "../SettlerBase.sol"; | ||
import {Settler} from "../Settler.sol"; | ||
import {SettlerMetaTxn} from "../SettlerMetaTxn.sol"; | ||
import {SettlerIntent} from "../SettlerIntent.sol"; | ||
|
||
import {IERC20} from "forge-std/interfaces/IERC20.sol"; | ||
import {DodoV2, IDodoV2} from "../core/DodoV2.sol"; | ||
|
@@ -42,6 +43,7 @@ import {kinetixV3BaseFactory, kinetixV3ForkId} from "../core/univ3forks/KinetixV | |
import {SettlerAbstract} from "../SettlerAbstract.sol"; | ||
import {AbstractContext} from "../Context.sol"; | ||
import {Permit2PaymentAbstract} from "../core/Permit2PaymentAbstract.sol"; | ||
import {Permit2PaymentMetaTxn} from "../core/Permit2Payment.sol"; | ||
|
||
abstract contract BaseMixin is FreeMemory, SettlerBase, MaverickV2, DodoV2 { | ||
constructor() { | ||
|
@@ -155,7 +157,7 @@ abstract contract BaseMixin is FreeMemory, SettlerBase, MaverickV2, DodoV2 { | |
|
||
/// @custom:security-contact [email protected] | ||
contract BaseSettler is Settler, BaseMixin { | ||
constructor(bytes20 gitCommit) Settler(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data) internal override DANGEROUS_freeMemory returns (bool) { | ||
if (super._dispatchVIP(action, data)) { | ||
|
@@ -202,10 +204,11 @@ contract BaseSettler is Settler, BaseMixin { | |
|
||
/// @custom:security-contact [email protected] | ||
contract BaseSettlerMetaTxn is SettlerMetaTxn, BaseMixin { | ||
constructor(bytes20 gitCommit) SettlerMetaTxn(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) | ||
internal | ||
virtual | ||
override | ||
DANGEROUS_freeMemory | ||
returns (bool) | ||
|
@@ -231,13 +234,44 @@ contract BaseSettlerMetaTxn is SettlerMetaTxn, BaseMixin { | |
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, BaseMixin) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
function _msgSender() internal view virtual override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
return super._msgSender(); | ||
} | ||
} | ||
|
||
/// @custom:security-contact [email protected] | ||
contract BaseSettlerIntent is SettlerIntent, BaseSettlerMetaTxn { | ||
constructor(bytes20 gitCommit) BaseSettlerMetaTxn(gitCommit) {} | ||
|
||
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
override(BaseSettlerMetaTxn, SettlerBase, SettlerAbstract) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerIntent, BaseSettlerMetaTxn) returns (address) { | ||
return super._msgSender(); | ||
} | ||
|
||
function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) { | ||
return super._witnessTypeSuffix(); | ||
} | ||
|
||
function _tokenId() internal pure override(SettlerIntent, SettlerMetaTxn, SettlerAbstract) returns (uint256) { | ||
return super._tokenId(); | ||
} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) internal override(BaseSettlerMetaTxn, SettlerMetaTxn) returns (bool) { | ||
return super._dispatchVIP(action, data, sig); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.25; | |
import {SettlerBase} from "../SettlerBase.sol"; | ||
import {Settler} from "../Settler.sol"; | ||
import {SettlerMetaTxn} from "../SettlerMetaTxn.sol"; | ||
import {SettlerIntent} from "../SettlerIntent.sol"; | ||
|
||
import {FreeMemory} from "../utils/FreeMemory.sol"; | ||
|
||
|
@@ -36,6 +37,7 @@ import {SettlerAbstract} from "../SettlerAbstract.sol"; | |
import {AbstractContext} from "../Context.sol"; | ||
import {Permit2PaymentAbstract} from "../core/Permit2PaymentAbstract.sol"; | ||
import {Permit2PaymentBase} from "../core/Permit2Payment.sol"; | ||
import {Permit2PaymentMetaTxn} from "../core/Permit2Payment.sol"; | ||
|
||
abstract contract BlastMixin is FreeMemory, SettlerBase { | ||
constructor() { | ||
|
@@ -109,7 +111,7 @@ abstract contract BlastMixin is FreeMemory, SettlerBase { | |
|
||
/// @custom:security-contact [email protected] | ||
contract BlastSettler is Settler, BlastMixin { | ||
constructor(bytes20 gitCommit) Settler(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data) internal override DANGEROUS_freeMemory returns (bool) { | ||
return super._dispatchVIP(action, data); | ||
|
@@ -135,10 +137,11 @@ contract BlastSettler is Settler, BlastMixin { | |
|
||
/// @custom:security-contact [email protected] | ||
contract BlastSettlerMetaTxn is SettlerMetaTxn, BlastMixin { | ||
constructor(bytes20 gitCommit) SettlerMetaTxn(gitCommit) {} | ||
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) | ||
internal | ||
virtual | ||
override | ||
DANGEROUS_freeMemory | ||
returns (bool) | ||
|
@@ -149,6 +152,7 @@ contract BlastSettlerMetaTxn is SettlerMetaTxn, BlastMixin { | |
function _isRestrictedTarget(address target) | ||
internal | ||
pure | ||
virtual | ||
override(Permit2PaymentBase, BlastMixin, Permit2PaymentAbstract) | ||
returns (bool) | ||
{ | ||
|
@@ -158,13 +162,53 @@ contract BlastSettlerMetaTxn is SettlerMetaTxn, BlastMixin { | |
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, BlastMixin) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
function _msgSender() internal view virtual override(SettlerMetaTxn, AbstractContext) returns (address) { | ||
return super._msgSender(); | ||
} | ||
} | ||
|
||
/// @custom:security-contact [email protected] | ||
contract BlastSettlerIntent is SettlerIntent, BlastSettlerMetaTxn { | ||
constructor(bytes20 gitCommit) BlastSettlerMetaTxn(gitCommit) {} | ||
|
||
// Solidity inheritance is stupid | ||
function _isRestrictedTarget(address target) | ||
internal | ||
pure | ||
override(BlastSettlerMetaTxn, Permit2PaymentBase, Permit2PaymentAbstract) | ||
returns (bool) | ||
{ | ||
return super._isRestrictedTarget(target); | ||
} | ||
|
||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
override(BlastSettlerMetaTxn, SettlerBase, SettlerAbstract) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerIntent, BlastSettlerMetaTxn) returns (address) { | ||
return super._msgSender(); | ||
} | ||
|
||
function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) { | ||
return super._witnessTypeSuffix(); | ||
} | ||
|
||
function _tokenId() internal pure override(SettlerIntent, SettlerMetaTxn, SettlerAbstract) returns (uint256) { | ||
return super._tokenId(); | ||
} | ||
|
||
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig) internal override(BlastSettlerMetaTxn, SettlerMetaTxn) returns (bool) { | ||
return super._dispatchVIP(action, data, sig); | ||
} | ||
} |
Oops, something went wrong.