Closed realkinando closed 3 years ago
Took some time to do extra research before pushing :
Event ForwardedTx(address indexed from, uint256 indexed batchId,uint256 indexed batchNonce,...) is emitted after every Tx forwarded by BiconomyForwarder.sol. This event is inspired by the EIP 1776 contracts made by Ronan Sandford[1]. It returns all the req params + result of the call
Event FeeCharged(address index from, uint256 indexed batchId, uint256 indexed batchNonce, uint256 feeCharged, address token) is emitted after every Tx forwarded by ERC20FeeProxy.sol. This specifically emits the fee charged, which is calculated and levied within ERC20FeeProxy.sol
Events have been separated such that BiconomyForwarder.sol can produce useful information for data processing, without relayers being forced to use a fee proxy, if they want such data logged
Address from, uint256 batchId & uint256 batchNonce, present in both events, can be combined to form a composite key. This is vital to be able to create ERC20Forwarder subgraph [2], or to present a table of transactions made (alongside the fees levied) within the Biconomy dApp dashboard
References : 1 - https://github.com/wighawag/singleton-1776-meta-transaction/blob/master/contracts/src/GenericMetaTxProcessor.sol 2 - https://thegraph.com/docs/define-a-subgraph#writing-mappings 3 - https://github.com/ethereum/EIPs/issues/2585
fixed contract import errors, tests, personal sign, made helpers