This functions equivalantly to how our crosschain paymaster functions on a live network but is managed via the local .contracts/test directory.
Execution flow is (client side):
- user adds funds to escrow and time locks
- user wallet inititalization code is generated
- user selects execution chain and payment chain
- user constructs bid to paymaster via paymasterAndData
- userop is fully constructe and signed
- userop is sent to our bundler network
- if our bundler sees appropiately locked funds and tx, it will be included in the next bundle
Exection flow continuted (on-chain - execution chain):
- userop is submitted to target chain entryPoint
- userop is validated
- userop is create code is executed if applicable
- paymaster funds are validated
- paymaster calls Hyperlane oracle to submit crosschain call, creates postOp context
- transaction innerOp is executed
- postOp crosschain call is paid for
Exection flow continuted (on-chain - origin chain):
- Hyperlane message is receieved by escrow
- Full user operation is validated for origin, paymaster, asset(s), sender, and account
- Bid amount is transfered to paymasters requested disbursement account
git clone https://github.com/qi-protocol/crosschain-paymaster --recurse-submodules
replace .secret.example with .secret and a private key (can be anything)
forge build
forge test --match-contract PaymasterTest -vvvv