-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: reduce gsn paymaster validation and allow additional callers
- Loading branch information
1 parent
3df60c2
commit ba30602
Showing
10 changed files
with
558 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.6.0 <0.9.0; | ||
|
||
interface IGSNForwarder { | ||
struct ForwardRequest { | ||
address from; | ||
address to; | ||
uint256 value; | ||
uint256 gas; | ||
uint256 nonce; | ||
bytes data; | ||
uint256 validUntil; | ||
} | ||
|
||
function getNonce(address _from) external view returns (uint256 nonce_); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.6.0 <0.9.0; | ||
|
||
interface IGSNPaymaster { | ||
function trustedForwarder() external view returns (address trustedForwarder_); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.6.0 <0.9.0; | ||
|
||
import {IGSNTypes} from "./IGSNTypes.sol"; | ||
|
||
interface IGSNRelayHub { | ||
function relayCall( | ||
uint256 _maxAcceptanceBudget, | ||
IGSNTypes.RelayRequest calldata _relayRequest, | ||
bytes calldata _signature, | ||
bytes calldata _approvalData, | ||
uint256 _externalGasLimit | ||
) external returns (bool paymasterAccepted_, bytes memory returnValue_); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity >=0.6.0 <0.9.0; | ||
|
||
import {IGSNForwarder} from "./IGSNForwarder.sol"; | ||
|
||
interface IGSNTypes { | ||
struct RelayData { | ||
uint256 gasPrice; | ||
uint256 pctRelayFee; | ||
uint256 baseRelayFee; | ||
address relayWorker; | ||
address paymaster; | ||
address forwarder; | ||
bytes paymasterData; | ||
uint256 clientId; | ||
} | ||
|
||
struct RelayRequest { | ||
IGSNForwarder.ForwardRequest request; | ||
RelayData relayData; | ||
} | ||
} |
Oops, something went wrong.