-
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 Sepolia
- Loading branch information
Showing
5 changed files
with
42 additions
and
20 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
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
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
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
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"; | ||
|
@@ -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 SepoliaMixin is FreeMemory, SettlerBase, MaverickV2 { | ||
constructor() { | ||
|
@@ -74,7 +76,7 @@ abstract contract SepoliaMixin is FreeMemory, SettlerBase, MaverickV2 { | |
|
||
/// @custom:security-contact [email protected] | ||
contract SepoliaSettler is Settler, SepoliaMixin { | ||
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)) { | ||
|
@@ -121,10 +123,11 @@ contract SepoliaSettler is Settler, SepoliaMixin { | |
|
||
/// @custom:security-contact [email protected] | ||
contract SepoliaSettlerMetaTxn is SettlerMetaTxn, SepoliaMixin { | ||
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) | ||
|
@@ -150,13 +153,44 @@ contract SepoliaSettlerMetaTxn is SettlerMetaTxn, SepoliaMixin { | |
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
virtual | ||
override(SettlerAbstract, SettlerBase, SepoliaMixin) | ||
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 SepoliaSettlerIntent is SettlerIntent, SepoliaSettlerMetaTxn { | ||
constructor(bytes20 gitCommit) SepoliaSettlerMetaTxn(gitCommit) {} | ||
|
||
// Solidity inheritance is stupid | ||
function _dispatch(uint256 i, bytes4 action, bytes calldata data) | ||
internal | ||
override(SepoliaSettlerMetaTxn, SettlerBase, SettlerAbstract) | ||
returns (bool) | ||
{ | ||
return super._dispatch(i, action, data); | ||
} | ||
|
||
function _msgSender() internal view override(SettlerIntent, SepoliaSettlerMetaTxn) 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(SepoliaSettlerMetaTxn, SettlerMetaTxn) returns (bool) { | ||
return super._dispatchVIP(action, data, sig); | ||
} | ||
} |