Update ethclient contracts & rollup iteration 1

This commit is contained in:
laisolizq
2020-10-06 12:00:11 +02:00
parent 15a122a6a0
commit 202b98b3e6
13 changed files with 1443 additions and 1787 deletions

View File

@@ -1,27 +1,103 @@
package eth
import (
"context"
"math/big"
"strings"
Hermez "github.com/hermeznetwork/hermez-node/eth/contracts/hermez"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
ethCommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/hermeznetwork/hermez-node/common"
Hermez "github.com/hermeznetwork/hermez-node/eth/contracts/hermez"
"github.com/hermeznetwork/hermez-node/log"
"github.com/iden3/go-iden3-crypto/babyjub"
)
const (
// FeeIdxCoordinatorLen is the number of tokens the coordinator can use
// RollupConstFeeIdxCoordinatorLen is the number of tokens the coordinator can use
// to collect fees (determines the number of tokens that the
// coordinator can collect fees from). This value is determined by the
// circuit.
FeeIdxCoordinatorLen = 64
RollupConstFeeIdxCoordinatorLen = 64
// RollupConstReservedIDx First 256 indexes reserved, first user index will be the 256
RollupConstReservedIDx = 255
// RollupConstExitIDx IDX 1 is reserved for exits
RollupConstExitIDx = 1
// RollupConstLimitLoadAmount Max load amount allowed (loadAmount: L1 --> L2)
RollupConstLimitLoadAmount = (1 << 128)
// RollupConstLimitL2TransferAmount Max amount allowed (amount L2 --> L2)
RollupConstLimitL2TransferAmount = (1 << 192)
// RollupConstLimitTokens Max number of tokens allowed to be registered inside the rollup
RollupConstLimitTokens = (1 << 32)
// RollupConstL1CoordinatorTotalBytes [4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature
RollupConstL1CoordinatorTotalBytes = 101
// RollupConstL1UserTotalBytes [20 bytes] fromEthAddr + [32 bytes] fromBjj-compressed + [6 bytes] fromIdx +
// [2 bytes] loadAmountFloat16 + [2 bytes] amountFloat16 + [4 bytes] tokenId + [6 bytes] toIdx
RollupConstL1UserTotalBytes = 72
// RollupConstMaxL1UserTX Maximum L1-user transactions allowed to be queued in a batch
RollupConstMaxL1UserTX = 128
// RollupConstMaxL1TX Maximum L1 transactions allowed to be queued in a batch
RollupConstMaxL1TX = 256
// RollupConstRfield Modulus zkSNARK
RollupConstRfield = 21888242871839275222246405745257275088548364400416034343698204186575808495617
// RollupConstInputSHAConstantBytes [6 bytes] lastIdx + [6 bytes] newLastIdx + [32 bytes] stateRoot + [32 bytes] newStRoot + [32 bytes] newExitRoot +
// [_MAX_L1_TX * _L1_USER_TOTALBYTES bytes] l1TxsData + totalL2TxsDataLength + feeIdxCoordinatorLength + [2 bytes] chainID =
// 18542 bytes + totalL2TxsDataLength + feeIdxCoordinatorLength
RollupConstInputSHAConstantBytes = 18542
// RollupConstNumBuckets Number of buckets
RollupConstNumBuckets = 5
// RollupConstMaxWithdrawalDelay max withdrawal delay in seconds
RollupConstMaxWithdrawalDelay = 2 * 7 * 24 * 60 * 60
// RollupConstExchangeMultiplier exchange multiplier
RollupConstExchangeMultiplier = 1e14
// LenVerifiers number of Rollup Smart Contract Verifiers
LenVerifiers = 1
)
var (
// RollupConstEthAddressInternalOnly This ethereum address is used internally for rollup accounts that don't have ethereum address, only Babyjubjub
// This non-ethereum accounts can be created by the coordinator and allow users to have a rollup
// account without needing an ethereum address
RollupConstEthAddressInternalOnly = ethCommon.HexToAddress("0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF")
// RollupConstERC1820 ERC1820Registry address
RollupConstERC1820 = ethCommon.HexToAddress("0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24")
// ERC777 tokens signatures
// RollupConstRecipientInterfaceHash ERC777 recipient interface hash
RollupConstRecipientInterfaceHash = crypto.Keccak256([]byte("ERC777TokensRecipient"))
// RollupConstPerformL1UserTXSignature the signature of the function that can be called thru an ERC777 `send`
RollupConstPerformL1UserTXSignature = crypto.Keccak256([]byte("addL1Transaction(uint256,uint48,uint16,uint16,uint32,uint48)"))
// RollupConstAddTokenSignature the signature of the function that can be called thru an ERC777 `send`
RollupConstAddTokenSignature = crypto.Keccak256([]byte("addToken(address)"))
// RollupConstSendSignature ERC777 Signature
RollupConstSendSignature = crypto.Keccak256([]byte("send(address,uint256,bytes)"))
// RollupConstERC777Granularity ERC777 Signature
RollupConstERC777Granularity = crypto.Keccak256([]byte("granularity()"))
// RollupConstWithdrawalDelayerDeposit This constant are used to deposit tokens from ERC77 tokens into withdrawal delayer
RollupConstWithdrawalDelayerDeposit = crypto.Keccak256([]byte("deposit(address,address,uint192)"))
// ERC20 signature
// RollupConstTransferSignature This constant is used in the _safeTransfer internal method in order to safe GAS.
RollupConstTransferSignature = crypto.Keccak256([]byte("transfer(address,uint256)"))
// RollupConstTransferFromSignature This constant is used in the _safeTransfer internal method in order to safe GAS.
RollupConstTransferFromSignature = crypto.Keccak256([]byte("transferFrom(address,address,uint256)"))
// RollupConstApproveSignature This constant is used in the _safeTransfer internal method in order to safe GAS.
RollupConstApproveSignature = crypto.Keccak256([]byte("approve(address,uint256)"))
// RollupConstERC20Signature ERC20 decimals signature
RollupConstERC20Signature = crypto.Keccak256([]byte("decimals()"))
)
// RollupConstants are the constants of the Rollup Smart Contract
type RollupConstants struct {
/* type RollupConstants struct {
// Maxim Deposit allowed
MaxAmountDeposit *big.Int
MaxAmountL2 *big.Int
@@ -50,12 +126,24 @@ type RollupConstants struct {
NoLimitToken int
NumBuckets int
MaxWDelay int64
}*/
// RollupPublicConstants are the constants of the Rollup Smart Contract
type RollupPublicConstants struct {
AbsoluteMaxL1L2BatchTimeout uint8
TokenHEZ ethCommon.Address
Verifiers []RollupVerifierStruct
HermezAuctionContract ethCommon.Address
HermezGovernanceDAOAddress ethCommon.Address
SafetyAddress ethCommon.Address
WithdrawDelayerContract ethCommon.Address
}
// RollupVariables are the variables of the Rollup Smart Contract
type RollupVariables struct {
FeeAddToken *big.Int
ForgeL1Timeout int64
FeeAddToken *big.Int
ForgeL1L2BatchTimeout int64
WithdrawalDelay uint64
}
// QueueStruct is the queue of L1Txs for a batch
@@ -73,6 +161,12 @@ func NewQueueStruct() *QueueStruct {
}
}
// RollupVerifierStruct is the information about verifiers of the Rollup Smart Contract
type RollupVerifierStruct struct {
MaxTx *big.Int
NLevels *big.Int
}
// RollupState represents the state of the Rollup in the Smart Contract
//nolint:structcheck,unused
type RollupState struct {
@@ -90,9 +184,16 @@ type RollupState struct {
// RollupEventL1UserTx is an event of the Rollup Smart Contract
type RollupEventL1UserTx struct {
ToForgeL1TxsNum uint64 // QueueIndex *big.Int
Position uint8 // TransactionIndex *big.Int
L1Tx common.L1Tx
ToForgeL1TxsNum int64 // QueueIndex *big.Int
Position int // TransactionIndex *big.Int
}
// RollupEventL1UserTxAux is an event of the Rollup Smart Contract
type RollupEventL1UserTxAux struct {
ToForgeL1TxsNum uint64 // QueueIndex *big.Int
Position uint8 // TransactionIndex *big.Int
L1Tx []byte
}
// RollupEventAddToken is an event of the Rollup Smart Contract
@@ -109,7 +210,7 @@ type RollupEventForgeBatch struct {
// RollupEventUpdateForgeL1L2BatchTimeout is an event of the Rollup Smart Contract
type RollupEventUpdateForgeL1L2BatchTimeout struct {
ForgeL1Timeout *big.Int
ForgeL1L2BatchTimeout uint8
}
// RollupEventUpdateFeeAddToken is an event of the Rollup Smart Contract
@@ -119,8 +220,8 @@ type RollupEventUpdateFeeAddToken struct {
// RollupEventWithdrawEvent is an event of the Rollup Smart Contract
type RollupEventWithdrawEvent struct {
Idx *big.Int
NumExitRoot *big.Int
Idx uint64
NumExitRoot uint64
InstantWithdraw bool
}
@@ -149,19 +250,35 @@ func NewRollupEvents() RollupEvents {
// RollupForgeBatchArgs are the arguments to the ForgeBatch function in the Rollup Smart Contract
//nolint:structcheck,unused
type RollupForgeBatchArgs struct {
ProofA [2]*big.Int
ProofB [2][2]*big.Int
ProofC [2]*big.Int
NewLastIdx int64
NewStRoot *big.Int
NewExitRoot *big.Int
L1CoordinatorTxs []*common.L1Tx
L1CoordinatorTxsAuths [][]byte // Authorization for accountCreations for each L1CoordinatorTxs
L2Txs []*common.L2Tx
FeeIdxCoordinator []common.Idx
NewLastIdx uint64
NewStRoot *big.Int
NewExitRoot *big.Int
L1CoordinatorTxs []*common.L1Tx
L2TxsData []*common.L2Tx
FeeIdxCoordinator []common.Idx
// Circuit selector
VerifierIdx int64
VerifierIdx uint8
L1Batch bool
ProofA [2]*big.Int
ProofB [2][2]*big.Int
ProofC [2]*big.Int
}
// RollupForgeBatchArgsAux are the arguments to the ForgeBatch function in the Rollup Smart Contract
//nolint:structcheck,unused
type RollupForgeBatchArgsAux struct {
NewLastIdx uint64
NewStRoot *big.Int
NewExitRoot *big.Int
L1CoordinatorTxs []byte
L2TxsData []byte
FeeIdxCoordinator []byte
// Circuit selector
VerifierIdx uint8
L1Batch bool
ProofA [2]*big.Int
ProofB [2][2]*big.Int
ProofC [2]*big.Int
}
// RollupInterface is the inteface to to Rollup Smart Contract
@@ -201,7 +318,7 @@ type RollupInterface interface {
// Smart Contract Status
//
RollupConstants() (*RollupConstants, error)
RollupConstants() (*RollupPublicConstants, error)
RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethCommon.Hash, error)
RollupForgeBatchArgs(ethCommon.Hash) (*RollupForgeBatchArgs, error)
}
@@ -212,16 +329,22 @@ type RollupInterface interface {
// RollupClient is the implementation of the interface to the Rollup Smart Contract in ethereum.
type RollupClient struct {
client *EthereumClient
address ethCommon.Address
client *EthereumClient
address ethCommon.Address
contractAbi abi.ABI
}
// NewRollupClient creates a new RollupClient
func NewRollupClient(client *EthereumClient, address ethCommon.Address) *RollupClient {
return &RollupClient{
client: client,
address: address,
func NewRollupClient(client *EthereumClient, address ethCommon.Address) (*RollupClient, error) {
contractAbi, err := abi.JSON(strings.NewReader(string(Hermez.HermezABI)))
if err != nil {
return nil, err
}
return &RollupClient{
client: client,
address: address,
contractAbi: contractAbi,
}, nil
}
// RollupForgeBatch is the interface to call the smart contract function
@@ -323,99 +446,205 @@ func (c *RollupClient) RollupUpdateFeeAddToken(newFeeAddToken *big.Int) (*types.
}
// RollupConstants returns the Constants of the Rollup Smart Contract
func (c *RollupClient) RollupConstants() (*RollupConstants, error) {
rollupConstants := new(RollupConstants)
func (c *RollupClient) RollupConstants() (*RollupPublicConstants, error) {
rollupConstants := new(RollupPublicConstants)
if err := c.client.Call(func(ec *ethclient.Client) error {
rollup, err := Hermez.NewHermez(c.address, ec)
hermez, err := Hermez.NewHermez(c.address, ec)
if err != nil {
return err
}
// rollupConstants.GovernanceAddress :=
l1CoordinatorBytes, err := rollup.L1COORDINATORBYTES(nil)
rollupConstants.AbsoluteMaxL1L2BatchTimeout, err = hermez.ABSOLUTEMAXL1L2BATCHTIMEOUT(nil)
if err != nil {
return err
}
rollupConstants.L1CoordinatorBytes = int(l1CoordinatorBytes.Int64())
l1UserBytes, err := rollup.L1USERBYTES(nil)
rollupConstants.TokenHEZ, err = hermez.TokenHEZ(nil)
if err != nil {
return err
}
rollupConstants.L1UserBytes = int(l1UserBytes.Int64())
l2Bytes, err := rollup.L2BYTES(nil)
for i := int64(0); i < int64(LenVerifiers); i++ {
newRollupVerifier := new(RollupVerifierStruct)
rollupVerifier, err := hermez.RollupVerifiers(nil, big.NewInt(i))
if err != nil {
return err
}
newRollupVerifier.MaxTx = rollupVerifier.MaxTx
newRollupVerifier.NLevels = rollupVerifier.NLevels
rollupConstants.Verifiers = append(rollupConstants.Verifiers, *newRollupVerifier)
}
rollupConstants.HermezAuctionContract, err = hermez.HermezAuctionContract(nil)
if err != nil {
return err
}
rollupConstants.L2Bytes = int(l2Bytes.Int64())
rollupConstants.LastIDx, err = rollup.LASTIDX(nil)
rollupConstants.HermezGovernanceDAOAddress, err = hermez.HermezGovernanceDAOAddress(nil)
if err != nil {
return err
}
rollupConstants.MaxAmountDeposit, err = rollup.MAXLOADAMOUNT(nil)
rollupConstants.SafetyAddress, err = hermez.SafetyAddress(nil)
if err != nil {
return err
}
rollupConstants.MaxAmountL2, err = rollup.MAXAMOUNT(nil)
if err != nil {
return err
}
maxL1Tx, err := rollup.MAXL1TX(nil)
if err != nil {
return err
}
rollupConstants.MaxL1Tx = int(maxL1Tx.Int64())
maxL1UserTx, err := rollup.MAXL1USERTX(nil)
if err != nil {
return err
}
rollupConstants.MaxL1UserTx = int(maxL1UserTx.Int64())
maxTokens, err := rollup.MAXTOKENS(nil)
if err != nil {
return err
}
rollupConstants.MaxTokens = maxTokens.Int64()
maxWDelay, err := rollup.MAXWITHDRAWALDELAY(nil)
if err != nil {
return err
}
rollupConstants.MaxWDelay = maxWDelay.Int64()
noLimitToken, err := rollup.NOLIMIT(nil)
if err != nil {
return err
}
rollupConstants.NoLimitToken = int(noLimitToken.Int64())
numBuckets, err := rollup.NUMBUCKETS(nil)
if err != nil {
return err
}
rollupConstants.NumBuckets = int(numBuckets.Int64())
// rollupConstants.ReservedIDx =
rollupConstants.Rfield, err = rollup.RFIELD(nil)
if err != nil {
return err
}
// rollupConstants.SafetyBot =
// rollupConstants.TokenHEZ =
// rollupConstants.WithdrawalContract =
return nil
rollupConstants.WithdrawDelayerContract, err = hermez.WithdrawDelayerContract(nil)
return err
}); err != nil {
return nil, err
}
return rollupConstants, nil
}
var (
logHermezL1UserTXEvent = crypto.Keccak256Hash([]byte("L1UserTxEvent(uint64,uint8,bytes)"))
logHermezAddToken = crypto.Keccak256Hash([]byte("AddToken(address,uint32)"))
logHermezForgeBatch = crypto.Keccak256Hash([]byte("ForgeBatch(uint64)"))
logHermezUpdateForgeL1L2BatchTimeout = crypto.Keccak256Hash([]byte("UpdateForgeL1L2BatchTimeout(uint8)"))
logHermezUpdateFeeAddToken = crypto.Keccak256Hash([]byte("UpdateFeeAddToken(uint256)"))
logHermezWithdrawEvent = crypto.Keccak256Hash([]byte("WithdrawEvent(uint48,uint48,bool)"))
)
// RollupEventsByBlock returns the events in a block that happened in the Rollup Smart Contract
func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethCommon.Hash, error) {
log.Error("TODO")
return nil, nil, errTODO
var rollupEvents RollupEvents
var blockHash ethCommon.Hash
query := ethereum.FilterQuery{
FromBlock: big.NewInt(blockNum),
ToBlock: big.NewInt(blockNum),
Addresses: []ethCommon.Address{
c.address,
},
BlockHash: nil,
Topics: [][]ethCommon.Hash{},
}
logs, err := c.client.client.FilterLogs(context.Background(), query)
if err != nil {
return nil, nil, err
}
if len(logs) > 0 {
blockHash = logs[0].BlockHash
}
for _, vLog := range logs {
if vLog.BlockHash != blockHash {
return nil, nil, ErrBlockHashMismatchEvent
}
switch vLog.Topics[0] {
case logHermezL1UserTXEvent:
var L1UserTxAux RollupEventL1UserTxAux
var L1UserTx RollupEventL1UserTx
err := c.contractAbi.Unpack(&L1UserTxAux, "L1UserTxEvent", vLog.Data)
if err != nil {
return nil, nil, err
}
L1Tx, err := common.L1TxFromBytes(L1UserTxAux.L1Tx)
if err != nil {
return nil, nil, err
}
L1UserTx.ToForgeL1TxsNum = new(big.Int).SetBytes(vLog.Topics[1][:]).Uint64()
L1UserTx.Position = uint8(new(big.Int).SetBytes(vLog.Topics[2][:]).Uint64())
L1UserTx.L1Tx = *L1Tx
rollupEvents.L1UserTx = append(rollupEvents.L1UserTx, L1UserTx)
case logHermezAddToken:
var addToken RollupEventAddToken
err := c.contractAbi.Unpack(&addToken, "AddToken", vLog.Data)
if err != nil {
return nil, nil, err
}
addToken.Address = ethCommon.BytesToAddress(vLog.Topics[1].Bytes())
rollupEvents.AddToken = append(rollupEvents.AddToken, addToken)
case logHermezForgeBatch:
var forgeBatch RollupEventForgeBatch
forgeBatch.BatchNum = new(big.Int).SetBytes(vLog.Topics[1][:]).Int64()
rollupEvents.ForgeBatch = append(rollupEvents.ForgeBatch, forgeBatch)
case logHermezUpdateForgeL1L2BatchTimeout:
var updateForgeL1L2BatchTimeout RollupEventUpdateForgeL1L2BatchTimeout
err := c.contractAbi.Unpack(&updateForgeL1L2BatchTimeout, "UpdateForgeL1L2BatchTimeout", vLog.Data)
if err != nil {
return nil, nil, err
}
rollupEvents.UpdateForgeL1L2BatchTimeout = append(rollupEvents.UpdateForgeL1L2BatchTimeout, updateForgeL1L2BatchTimeout)
case logHermezUpdateFeeAddToken:
var updateFeeAddToken RollupEventUpdateFeeAddToken
err := c.contractAbi.Unpack(&updateFeeAddToken, "UpdateFeeAddToken", vLog.Data)
if err != nil {
return nil, nil, err
}
rollupEvents.UpdateFeeAddToken = append(rollupEvents.UpdateFeeAddToken, updateFeeAddToken)
case logHermezWithdrawEvent:
var withdraw RollupEventWithdrawEvent
err := c.contractAbi.Unpack(&withdraw, "WithdrawEvent", vLog.Data)
if err != nil {
return nil, nil, err
}
withdraw.Idx = new(big.Int).SetBytes(vLog.Topics[1][:]).Uint64()
withdraw.NumExitRoot = new(big.Int).SetBytes(vLog.Topics[2][:]).Uint64()
rollupEvents.WithdrawEvent = append(rollupEvents.WithdrawEvent, withdraw)
}
}
return &rollupEvents, &blockHash, nil
}
// RollupForgeBatchArgs returns the arguments used in a ForgeBatch call in the Rollup Smart Contract in the given transaction
func (c *RollupClient) RollupForgeBatchArgs(ethTxHash ethCommon.Hash) (*RollupForgeBatchArgs, error) {
tx, _, err := c.client.client.TransactionByHash(context.Background(), ethTxHash)
if err != nil {
return nil, err
}
txData := tx.Data()
method, err := c.contractAbi.MethodById(txData)
if err != nil {
return nil, err
}
aux := new(RollupForgeBatchArgsAux)
method.Inputs.Unpack(aux, txData)
rollupForgeBatchArgs := new(RollupForgeBatchArgs)
rollupForgeBatchArgs.L1Batch = aux.L1Batch
rollupForgeBatchArgs.NewExitRoot = aux.NewExitRoot
rollupForgeBatchArgs.NewLastIdx = aux.NewLastIdx
rollupForgeBatchArgs.NewStRoot = aux.NewStRoot
rollupForgeBatchArgs.ProofA = aux.ProofA
rollupForgeBatchArgs.ProofB = aux.ProofB
rollupForgeBatchArgs.ProofC = aux.ProofC
rollupForgeBatchArgs.VerifierIdx = aux.VerifierIdx
numTxsL1 := len(aux.L1CoordinatorTxs) / common.L1TxBytesLen
for i := 0; i < numTxsL1; i++ {
L1Tx, err := common.L1TxFromCoordinatorBytes(aux.L1CoordinatorTxs[i*common.L1CoordinatorTxBytesLen : (i+1)*common.L1CoordinatorTxBytesLen])
if err != nil {
return nil, err
}
rollupForgeBatchArgs.L1CoordinatorTxs = append(rollupForgeBatchArgs.L1CoordinatorTxs, L1Tx)
}
rollupConsts, err := c.RollupConstants()
if err != nil {
return nil, err
}
nLevels := rollupConsts.Verifiers[rollupForgeBatchArgs.VerifierIdx].NLevels.Int64()
lenL2TxsBytes := int((nLevels/8)*2 + 2 + 1)
numTxsL2 := len(aux.L2TxsData) / lenL2TxsBytes
for i := 0; i < numTxsL2; i++ {
L2Tx, err := common.L2TxFromBytes(aux.L2TxsData[i*lenL2TxsBytes:(i+1)*lenL2TxsBytes], int(nLevels))
if err != nil {
return nil, err
}
rollupForgeBatchArgs.L2TxsData = append(rollupForgeBatchArgs.L2TxsData, L2Tx)
}
lenFeeIdxCoordinatorBytes := int(nLevels / 8)
numFeeIdxCoordinator := len(aux.FeeIdxCoordinator) / lenFeeIdxCoordinatorBytes
for i := 0; i < numFeeIdxCoordinator; i++ {
var paddedFeeIdx [6]byte
if lenFeeIdxCoordinatorBytes < common.IdxBytesLen {
copy(paddedFeeIdx[6-lenFeeIdxCoordinatorBytes:], aux.FeeIdxCoordinator[i*lenFeeIdxCoordinatorBytes:(i+1)*lenFeeIdxCoordinatorBytes])
} else {
copy(paddedFeeIdx[:], aux.FeeIdxCoordinator[i*lenFeeIdxCoordinatorBytes:(i+1)*lenFeeIdxCoordinatorBytes])
}
FeeIdxCoordinator, err := common.IdxFromBytes(paddedFeeIdx[:])
if err != nil {
return nil, err
}
rollupForgeBatchArgs.FeeIdxCoordinator = append(rollupForgeBatchArgs.FeeIdxCoordinator, FeeIdxCoordinator)
}
return rollupForgeBatchArgs, nil
// tx := client.TransactionByHash(ethTxHash) -> types.Transaction
// txData := types.Transaction -> Data()
// m := abi.MethodById(txData) -> Method
// m.Inputs.Unpack(txData) -> Args
// client.TransactionReceipt()?
log.Error("TODO")
return nil, errTODO
}