arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/common/exittree.go
common/exittree.goRaw
 1package common
 2
 3import (
 4	"math/big"
 5
 6	ethCommon "github.com/ethereum/go-ethereum/common"
 7	"github.com/iden3/go-merkletree"
 8)
 9
10// ExitInfo represents the ExitTree Leaf data
11type ExitInfo struct {
12	BatchNum    BatchNum                        `meddler:"batch_num"`
13	AccountIdx  Idx                             `meddler:"account_idx"`
14	MerkleProof *merkletree.CircomVerifierProof `meddler:"merkle_proof,json"`
15	Balance     *big.Int                        `meddler:"balance,bigint"`
16	// InstantWithdrawn is the ethBlockNum in which the exit is withdrawn
17	// instantly.  nil means this hasn't happened.
18	InstantWithdrawn *int64 `meddler:"instant_withdrawn"`
19	// DelayedWithdrawRequest is the ethBlockNum in which the exit is
20	// requested to be withdrawn from the delayedWithdrawn smart contract.
21	// nil means this hasn't happened.
22	DelayedWithdrawRequest *int64 `meddler:"delayed_withdraw_request"`
23	// DelayedWithdrawn is the ethBlockNum in which the exit is withdrawn
24	// from the delayedWithdrawn smart contract.  nil means this hasn't
25	// happened.
26	DelayedWithdrawn *int64 `meddler:"delayed_withdrawn"`
27}
28
29// WithdrawInfo represents a withdraw action to the rollup
30type WithdrawInfo struct {
31	Idx             Idx
32	NumExitRoot     BatchNum
33	InstantWithdraw bool
34	TxHash          ethCommon.Hash // hash of the transaction in which the withdraw happened
35	Owner           ethCommon.Address
36	Token           ethCommon.Address
37}