Skip to content

v2.0.0-beta.1.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@drortirosh drortirosh released this 30 Aug 21:37
· 366 commits to master since this release
6b6f569

Major change for the contracts:

Major Paymaster change:

Removed Paymaster.acceptRelayedCall
This reduce the gas cost of request (no double check for signature, nonce) and simplifies paymaster implementation.

  • now the paymaster decide in its preRelayedCall whether to accept the call or not. You don't need a separate "view verifier" function. e.g. can call mytoken.transferFrom(req.from, address(this), preCharge) instead of verifying separately that the caller has balance, has approval, etc.
  • paymaster needs also to call _verifyForwarder() - but actual signature, nonce check are done later (and correctly refuse the request if they fail)

Generic Forwarder

the trustedForwarder is no longer GSN specific: This also means that a "recipient" contract trusting the forwarder will continue to work with future GSN version which might modify request structure (or other relaying network)

Client configuration

As the bare-minimum, the client can be configured with the paymaster address. From there, the resolveConfigurationGSN() can build the configuration required by the RelayProvider

Development environment

Added simple ways to start GSN for testing (deploy contracts and start a relayer), on top of existing "ganache" instance:
from command-ilne: npx gsn start
from the test file itself: GsnTestEnvironment.startGsn()