-
Notifications
You must be signed in to change notification settings - Fork 92
GSN Contract Implementation For Gasless Token Withdrawl #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0f692ba
Implement contract held ETH & withdraw by shadow address
apbendi 42824a9
Implement contract held ERC20s & withdraw by shadow address
apbendi ed26212
Updated contracts with BaseRelayRecipient and failing ReentrancyGuards
apbendi 3e45686
Some initial setup for GSN usage & testing
apbendi 5aac331
Complete GSN Implementation And Test Token Withdrawls
apbendi cc6f6e4
Send ETH straight to the stealth address
apbendi 9017bae
Allow withdrawer to specify address to accept tokens
apbendi ea224e5
Add some additional GSN withraw tests
apbendi 4096b0c
Revert unneeded changes to test-environment.config.js
apbendi 4cc8411
Improve require statements in withdraw method
apbendi 283e64d
Update naming to reflect only token payments are held by the contract
apbendi 9ab1021
Update naming for consistency across tests
apbendi 0fdd6b2
Include forwarder as Umbra constructor arg
apbendi dad5342
Add comments to gsn tests to clarify what's going on
apbendi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| pragma solidity ^0.5.0; | ||
| pragma solidity ^0.6.2; | ||
|
|
||
| contract GasTester { | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,41 @@ | ||
| pragma solidity ^0.6.2; | ||
| pragma experimental ABIEncoderV2; | ||
|
|
||
| import "@opengsn/gsn/contracts/BasePaymaster.sol"; | ||
|
|
||
| contract UmbraPaymaster is BasePaymaster { | ||
|
|
||
| address public umbraAddr; | ||
|
|
||
| constructor(address _umbraAddr) public { | ||
| umbraAddr = _umbraAddr; | ||
| } | ||
|
|
||
| function acceptRelayedCall( | ||
| GSNTypes.RelayRequest calldata relayRequest , | ||
| bytes calldata approvalData, | ||
| uint256 maxPossibleGas | ||
| ) external view override returns (bytes memory context) { | ||
| (approvalData, maxPossibleGas); // avoid a warning | ||
|
|
||
| require(relayRequest.target == umbraAddr, "UmbraPaymaster: Not Target"); | ||
|
|
||
| return abi.encode(0x0); | ||
apbendi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| function preRelayedCall( | ||
| bytes calldata context | ||
| ) external relayHubOnly override returns(bytes32) { | ||
| return bytes32(0); | ||
| } | ||
|
|
||
| function postRelayedCall( | ||
| bytes calldata context, | ||
| bool success, | ||
| bytes32 preRetVal, | ||
| uint256 gasUse, | ||
| GSNTypes.GasData calldata gasData | ||
| ) external relayHubOnly override { | ||
| (success, preRetVal, gasUse, gasData); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.