Skip to content

Commit

Permalink
forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Aug 28, 2024
1 parent cc4b257 commit 751615b
Show file tree
Hide file tree
Showing 15 changed files with 156 additions and 41 deletions.
16 changes: 9 additions & 7 deletions src/SettlerIntent.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ abstract contract SettlerIntent is Permit2PaymentIntent, SettlerMetaTxn {
return super._msgSender();
}

// Solidity inheritance is so stupid
function _witnessTypeSuffix() internal pure virtual override(Permit2PaymentMetaTxn, Permit2PaymentIntent) returns (string memory) {
return super._witnessTypeSuffix();
}

function _hashSlippage(AllowedSlippage calldata slippage)
function _witnessTypeSuffix()
internal
pure
returns (bytes32 result)
virtual
// Solidity inheritance is so stupid
override(Permit2PaymentMetaTxn, Permit2PaymentIntent)
returns (string memory)
{
return super._witnessTypeSuffix();
}

function _hashSlippage(AllowedSlippage calldata slippage) internal pure returns (bytes32 result) {
// This function does not check for or clean any dirty bits that might
// exist in `slippage`. We assume that `slippage` will be used elsewhere
// in this context and that if there are dirty bits it will result in a
Expand Down
9 changes: 4 additions & 5 deletions src/SettlerMetaTxn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ abstract contract SettlerMetaTxn is Permit2PaymentMetaTxn, SettlerBase {
return true;
}

function _executeMetaTxn(
AllowedSlippage calldata slippage,
bytes[] calldata actions,
bytes calldata sig
) internal returns (bool) {
function _executeMetaTxn(AllowedSlippage calldata slippage, bytes[] calldata actions, bytes calldata sig)
internal
returns (bool)
{
require(actions.length != 0);
{
(bytes4 action, bytes calldata data) = actions.decodeCall(0);
Expand Down
21 changes: 18 additions & 3 deletions src/chains/Arbitrum.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ abstract contract ArbitrumMixin is FreeMemory, SettlerBase, MaverickV2, CurveTri
contract ArbitrumSettler is Settler, ArbitrumMixin {
constructor(bytes20 gitCommit) SettlerBase(gitCommit) {}

function _dispatchVIP(bytes4 action, bytes calldata data) internal virtual 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) {
Expand Down Expand Up @@ -252,15 +258,24 @@ contract ArbitrumSettlerIntent is SettlerIntent, ArbitrumSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(ArbitrumSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Avalanche.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,24 @@ contract SepoliSaettlerIntent is SettlerIntent, AvalancheSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(AvalancheSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,24 @@ contract BaseSettlerIntent is SettlerIntent, BaseSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(BaseSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Blast.sol
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,24 @@ contract BlastSettlerIntent is SettlerIntent, BlastSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(BlastSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Bnb.sol
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,24 @@ contract BnbSettlerIntent is SettlerIntent, BnbSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(BnbSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(BnbSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Linea.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,24 @@ contract LineaSettlerIntent is SettlerIntent, LineaSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(LineaSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(LineaSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Mainnet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,24 @@ contract MainnetSettlerIntent is SettlerIntent, MainnetSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(MainnetSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(MainnetSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Mantle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,24 @@ contract MantleSettlerIntent is SettlerIntent, MantleSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(MantleSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(MantleSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Optimism.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,24 @@ contract OptimismSettlerIntent is SettlerIntent, OptimismSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(OptimismSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(OptimismSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Polygon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,24 @@ contract PolygonSettlerIntent is SettlerIntent, PolygonSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(PolygonSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(PolygonSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Scroll.sol
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,24 @@ contract ScrollSettlerIntent is SettlerIntent, ScrollSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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(ScrollSettlerMetaTxn, SettlerMetaTxn) returns (bool) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(ScrollSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
13 changes: 11 additions & 2 deletions src/chains/Sepolia.sol
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,24 @@ contract SepoliaSettlerIntent is SettlerIntent, SepoliaSettlerMetaTxn {
return super._msgSender();
}

function _witnessTypeSuffix() internal pure override(SettlerIntent, Permit2PaymentMetaTxn) returns (string memory) {
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) {
function _dispatchVIP(bytes4 action, bytes calldata data, bytes calldata sig)
internal
override(SepoliaSettlerMetaTxn, SettlerMetaTxn)
returns (bool)
{
return super._dispatchVIP(action, data, sig);
}
}
Loading

0 comments on commit 751615b

Please sign in to comment.