arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
hermez-node/test/ethclient.go
test/ethclient.goRaw
  1package test
  2
  3import (
  4	"context"
  5	"encoding/binary"
  6	"encoding/json"
  7	"fmt"
  8	"math/big"
  9	"time"
 10
 11	ethCommon "github.com/ethereum/go-ethereum/common"
 12	"github.com/ethereum/go-ethereum/core/types"
 13	"github.com/hermeznetwork/hermez-node/common"
 14	"github.com/hermeznetwork/hermez-node/eth"
 15	"github.com/hermeznetwork/hermez-node/log"
 16	"github.com/hermeznetwork/hermez-node/utils"
 17	"github.com/iden3/go-iden3-crypto/babyjub"
 18	"github.com/mitchellh/copystructure"
 19)
 20
 21// RollupBlock stores all the data related to the Rollup SC from an ethereum block
 22type RollupBlock struct {
 23	State  eth.RollupState
 24	Vars   eth.RollupVariables
 25	Events eth.RollupEvents
 26}
 27
 28// AuctionBlock stores all the data related to the Auction SC from an ethereum block
 29type AuctionBlock struct {
 30	State  eth.AuctionState
 31	Vars   eth.AuctionVariables
 32	Events eth.AuctionEvents
 33}
 34
 35// EthereumBlock stores all the generic data related to the an ethereum block
 36type EthereumBlock struct {
 37	BlockNum   int64
 38	Time       int64
 39	Hash       ethCommon.Hash
 40	ParentHash ethCommon.Hash
 41	// state      ethState
 42}
 43
 44// Block represents a ethereum block
 45type Block struct {
 46	Rollup  *RollupBlock
 47	Auction *AuctionBlock
 48	Eth     *EthereumBlock
 49}
 50
 51// type ethState struct {
 52// 	blockNum int64
 53// }
 54
 55// type state struct {
 56// 	rollupState  eth.RollupState
 57// 	rollupVars   eth.RollupVariables
 58// 	auctionState eth.AuctionState
 59// 	auctionVars  eth.AuctionVariables
 60// 	eth          ethState
 61// }
 62
 63// ClientSetup is used to initialize the constants of the Smart Contracts and
 64// other details of the test Client
 65type ClientSetup struct {
 66	RollupConstants  *eth.RollupConstants
 67	RollupVariables  *eth.RollupVariables
 68	AuctionConstants *eth.AuctionConstants
 69	AuctionVariables *eth.AuctionVariables
 70	VerifyProof      bool
 71}
 72
 73// Timer is an interface to simulate a source of time, useful to advance time
 74// virtually.
 75type Timer interface {
 76	Time() int64
 77}
 78
 79// type forgeBatchArgs struct {
 80// 	ethTx     *types.Transaction
 81// 	blockNum  int64
 82// 	blockHash ethCommon.Hash
 83// }
 84
 85// Client implements the eth.ClientInterface interface, allowing to manipulate the
 86// values for testing, working with deterministic results.
 87type Client struct {
 88	log              bool
 89	rollupConstants  *eth.RollupConstants
 90	auctionConstants *eth.AuctionConstants
 91	blocks           map[int64]*Block
 92	// state            state
 93	blockNum    int64 // last mined block num
 94	maxBlockNum int64 // highest block num calculated
 95	timer       Timer
 96	hasher      hasher
 97
 98	forgeBatchArgsPending map[ethCommon.Hash]*eth.RollupForgeBatchArgs
 99	forgeBatchArgs        map[ethCommon.Hash]*eth.RollupForgeBatchArgs
100}
101
102// NewClient returns a new test Client that implements the eth.IClient
103// interface, at the given initialBlockNumber.
104func NewClient(l bool, timer Timer, setup *ClientSetup) *Client {
105	blocks := make(map[int64]*Block)
106	blockNum := int64(0)
107
108	hasher := hasher{}
109	// Add ethereum genesis block
110	mapL1TxQueue := make(map[int64]*eth.QueueStruct)
111	mapL1TxQueue[0] = eth.NewQueueStruct()
112	mapL1TxQueue[1] = eth.NewQueueStruct()
113	blockCurrent := Block{
114		Rollup: &RollupBlock{
115			State: eth.RollupState{
116				StateRoot:              big.NewInt(0),
117				ExitRoots:              make([]*big.Int, 0),
118				ExitNullifierMap:       make(map[[256 / 8]byte]bool),
119				TokenList:              make([]ethCommon.Address, 0),
120				TokenMap:               make(map[ethCommon.Address]bool),
121				MapL1TxQueue:           mapL1TxQueue,
122				LastL1L2Batch:          0,
123				CurrentToForgeL1TxsNum: 0,
124				LastToForgeL1TxsNum:    1,
125				CurrentIdx:             0,
126			},
127			Vars:   *setup.RollupVariables,
128			Events: eth.NewRollupEvents(),
129		},
130		Auction: &AuctionBlock{
131			State: eth.AuctionState{
132				Slots:           make(map[int64]eth.SlotState),
133				PendingBalances: make(map[ethCommon.Address]*big.Int),
134				Coordinators:    make(map[ethCommon.Address]eth.Coordinator),
135			},
136			Vars:   *setup.AuctionVariables,
137			Events: eth.NewAuctionEvents(),
138		},
139		Eth: &EthereumBlock{
140			BlockNum:   blockNum,
141			Time:       timer.Time(),
142			Hash:       hasher.Next(),
143			ParentHash: ethCommon.Hash{},
144		},
145	}
146	blocks[blockNum] = &blockCurrent
147	blockNextRaw, err := copystructure.Copy(&blockCurrent)
148	if err != nil {
149		panic(err)
150	}
151	blockNext := blockNextRaw.(*Block)
152	blocks[blockNum+1] = blockNext
153
154	return &Client{
155		log:                   l,
156		rollupConstants:       setup.RollupConstants,
157		auctionConstants:      setup.AuctionConstants,
158		blocks:                blocks,
159		timer:                 timer,
160		hasher:                hasher,
161		forgeBatchArgsPending: make(map[ethCommon.Hash]*eth.RollupForgeBatchArgs),
162		forgeBatchArgs:        make(map[ethCommon.Hash]*eth.RollupForgeBatchArgs),
163	}
164}
165
166//
167// Mock Control
168//
169
170// Debugf calls log.Debugf if c.log is true
171func (c *Client) Debugf(template string, args ...interface{}) {
172	if c.log {
173		log.Debugf(template, args...)
174	}
175}
176
177// Debugw calls log.Debugw if c.log is true
178func (c *Client) Debugw(template string, kv ...interface{}) {
179	if c.log {
180		log.Debugw(template, kv...)
181	}
182}
183
184type hasher struct {
185	counter uint64
186}
187
188// Next returns the next hash
189func (h *hasher) Next() ethCommon.Hash {
190	var hash ethCommon.Hash
191	binary.LittleEndian.PutUint64(hash[:], h.counter)
192	h.counter++
193	return hash
194}
195
196func (c *Client) nextBlock() *Block {
197	return c.blocks[c.blockNum+1]
198}
199
200// CtlMineBlock moves one block forward
201func (c *Client) CtlMineBlock() {
202	blockCurrent := c.nextBlock()
203	c.blockNum++
204	c.maxBlockNum = c.blockNum
205	blockCurrent.Eth = &EthereumBlock{
206		BlockNum:   c.blockNum,
207		Time:       c.timer.Time(),
208		Hash:       c.hasher.Next(),
209		ParentHash: blockCurrent.Eth.Hash,
210	}
211	for ethTxHash, forgeBatchArgs := range c.forgeBatchArgsPending {
212		c.forgeBatchArgs[ethTxHash] = forgeBatchArgs
213	}
214	c.forgeBatchArgsPending = make(map[ethCommon.Hash]*eth.RollupForgeBatchArgs)
215
216	blockNextRaw, err := copystructure.Copy(blockCurrent)
217	if err != nil {
218		panic(err)
219	}
220	blockNext := blockNextRaw.(*Block)
221	blockNext.Rollup.Events = eth.NewRollupEvents()
222	blockNext.Auction.Events = eth.NewAuctionEvents()
223	c.blocks[c.blockNum+1] = blockNext
224	c.Debugw("TestClient mined block", "blockNum", c.blockNum)
225}
226
227// CtlRollback discards the last mined block.  Use this to replace a mined
228// block to simulate reorgs.
229func (c *Client) CtlRollback() {
230	if c.blockNum == 0 {
231		panic("Can't rollback at blockNum = 0")
232	}
233	delete(c.blocks, c.blockNum+1) // delete next block
234	delete(c.blocks, c.blockNum)   // delete current block
235	c.blockNum--
236	blockCurrent := c.blocks[c.blockNum]
237	blockNextRaw, err := copystructure.Copy(blockCurrent)
238	if err != nil {
239		panic(err)
240	}
241	blockNext := blockNextRaw.(*Block)
242	blockNext.Rollup.Events = eth.NewRollupEvents()
243	blockNext.Auction.Events = eth.NewAuctionEvents()
244	c.blocks[c.blockNum+1] = blockNext
245}
246
247//
248// Ethereum
249//
250
251// EthCurrentBlock returns the current blockNum
252func (c *Client) EthCurrentBlock() (int64, error) {
253	if c.blockNum < c.maxBlockNum {
254		panic("blockNum has decreased.  " +
255			"After a rollback you must mine to reach the same or higher blockNum")
256	}
257	return c.blockNum, nil
258}
259
260// func newHeader(number *big.Int) *types.Header {
261// 	return &types.Header{
262// 		Number: number,
263// 		Time:   uint64(number.Int64()),
264// 	}
265// }
266
267// EthHeaderByNumber returns the *types.Header for the given block number in a
268// deterministic way.
269// func (c *Client) EthHeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
270// 	return newHeader(number), nil
271// }
272
273// EthBlockByNumber returns the *common.Block for the given block number in a
274// deterministic way.
275func (c *Client) EthBlockByNumber(ctx context.Context, blockNum int64) (*common.Block, error) {
276	block, ok := c.blocks[blockNum]
277	if !ok {
278		return nil, fmt.Errorf("block not found")
279	}
280	return &common.Block{
281		EthBlockNum: blockNum,
282		Timestamp:   time.Unix(block.Eth.Time, 0),
283		Hash:        block.Eth.Hash,
284		ParentHash:  block.Eth.ParentHash,
285	}, nil
286}
287
288var errTODO = fmt.Errorf("TODO: Not implemented yet")
289
290//
291// Rollup
292//
293
294// CtlAddL1TxUser adds an L1TxUser to the L1UserTxs queue of the Rollup
295func (c *Client) CtlAddL1TxUser(l1Tx *common.L1Tx) {
296	nextBlock := c.nextBlock()
297	r := nextBlock.Rollup
298	queue := r.State.MapL1TxQueue[r.State.LastToForgeL1TxsNum]
299	if len(queue.L1TxQueue) >= c.rollupConstants.MaxL1UserTx {
300		r.State.LastToForgeL1TxsNum++
301		r.State.MapL1TxQueue[r.State.LastToForgeL1TxsNum] = eth.NewQueueStruct()
302		queue = r.State.MapL1TxQueue[r.State.LastToForgeL1TxsNum]
303	}
304	if int64(l1Tx.FromIdx) > r.State.CurrentIdx {
305		panic("l1Tx.FromIdx > r.State.CurrentIdx")
306	}
307	if int(l1Tx.TokenID)+1 > len(r.State.TokenList) {
308		panic("l1Tx.TokenID + 1 > len(r.State.TokenList)")
309	}
310	queue.L1TxQueue = append(queue.L1TxQueue, *l1Tx)
311	r.Events.L1UserTx = append(r.Events.L1UserTx, eth.RollupEventL1UserTx{L1Tx: *l1Tx})
312}
313
314func (c *Client) newTransaction(name string, value interface{}) *types.Transaction {
315	data, err := json.Marshal(value)
316	if err != nil {
317		panic(err)
318	}
319	return types.NewTransaction(0, ethCommon.Address{}, nil, 0, nil,
320		data)
321}
322
323// RollupForgeBatch is the interface to call the smart contract function
324func (c *Client) RollupForgeBatch(*eth.RollupForgeBatchArgs) (*types.Transaction, error) {
325	return nil, errTODO
326}
327
328// CtlAddBatch adds forged batch to the Rollup, without checking any ZKProof
329func (c *Client) CtlAddBatch(args *eth.RollupForgeBatchArgs) {
330	nextBlock := c.nextBlock()
331	r := nextBlock.Rollup
332	r.State.StateRoot = args.NewStRoot
333	if args.NewLastIdx < r.State.CurrentIdx {
334		panic("args.NewLastIdx < r.State.CurrentIdx")
335	}
336	r.State.CurrentIdx = args.NewLastIdx
337	r.State.ExitRoots = append(r.State.ExitRoots, args.NewExitRoot)
338	if args.L1Batch {
339		r.State.CurrentToForgeL1TxsNum++
340		if r.State.CurrentToForgeL1TxsNum == r.State.LastToForgeL1TxsNum {
341			r.State.LastToForgeL1TxsNum++
342			r.State.MapL1TxQueue[r.State.LastToForgeL1TxsNum] = eth.NewQueueStruct()
343		}
344	}
345	ethTx := c.newTransaction("forgebatch", args)
346	c.forgeBatchArgsPending[ethTx.Hash()] = args
347	r.Events.ForgeBatch = append(r.Events.ForgeBatch, eth.RollupEventForgeBatch{
348		BatchNum:  int64(len(r.State.ExitRoots)),
349		EthTxHash: ethTx.Hash(),
350	})
351}
352
353// RollupAddToken is the interface to call the smart contract function
354func (c *Client) RollupAddToken(tokenAddress ethCommon.Address) (*types.Transaction, error) {
355	nextBlock := c.nextBlock()
356	r := nextBlock.Rollup
357	if _, ok := r.State.TokenMap[tokenAddress]; ok {
358		return nil, fmt.Errorf("Token %v already registered", tokenAddress)
359	}
360
361	r.State.TokenMap[tokenAddress] = true
362	r.State.TokenList = append(r.State.TokenList, tokenAddress)
363	r.Events.AddToken = append(r.Events.AddToken, eth.RollupEventAddToken{Address: tokenAddress,
364		TokenID: uint32(len(r.State.TokenList) - 1)})
365	return c.newTransaction("addtoken", tokenAddress), nil
366}
367
368// RollupWithdrawSNARK is the interface to call the smart contract function
369// func (c *Client) RollupWithdrawSNARK() (*types.Transaction, error) { // TODO (Not defined in Hermez.sol)
370// 	return nil, errTODO
371// }
372
373// RollupWithdrawMerkleProof is the interface to call the smart contract function
374func (c *Client) RollupWithdrawMerkleProof(tokenID int64, balance *big.Int, babyPubKey *babyjub.PublicKey, numExitRoot int64, siblings []*big.Int, idx int64, instantWithdraw bool) (*types.Transaction, error) {
375	return nil, errTODO
376}
377
378// RollupForceExit is the interface to call the smart contract function
379func (c *Client) RollupForceExit(fromIdx int64, amountF utils.Float16, tokenID int64) (*types.Transaction, error) {
380	return nil, errTODO
381}
382
383// RollupForceTransfer is the interface to call the smart contract function
384func (c *Client) RollupForceTransfer(fromIdx int64, amountF utils.Float16, tokenID, toIdx int64) (*types.Transaction, error) {
385	return nil, errTODO
386}
387
388// RollupCreateAccountDepositTransfer is the interface to call the smart contract function
389func (c *Client) RollupCreateAccountDepositTransfer(babyPubKey babyjub.PublicKey, loadAmountF, amountF utils.Float16, tokenID int64, toIdx int64) (*types.Transaction, error) {
390	return nil, errTODO
391}
392
393// RollupDepositTransfer is the interface to call the smart contract function
394func (c *Client) RollupDepositTransfer(fromIdx int64, loadAmountF, amountF utils.Float16, tokenID int64, toIdx int64) (*types.Transaction, error) {
395	return nil, errTODO
396}
397
398// RollupDeposit is the interface to call the smart contract function
399func (c *Client) RollupDeposit(fromIdx int64, loadAmountF utils.Float16, tokenID int64) (*types.Transaction, error) {
400	return nil, errTODO
401}
402
403// RollupCreateAccountDepositFromRelayer is the interface to call the smart contract function
404func (c *Client) RollupCreateAccountDepositFromRelayer(accountCreationAuthSig []byte, babyPubKey babyjub.PublicKey, loadAmountF utils.Float16) (*types.Transaction, error) {
405	return nil, errTODO
406}
407
408// RollupCreateAccountDeposit is the interface to call the smart contract function
409func (c *Client) RollupCreateAccountDeposit(babyPubKey babyjub.PublicKey, loadAmountF utils.Float16, tokenID int64) (*types.Transaction, error) {
410	return nil, errTODO
411}
412
413// RollupGetTokenAddress is the interface to call the smart contract function
414func (c *Client) RollupGetTokenAddress(tokenID int64) (*ethCommon.Address, error) {
415	return nil, errTODO
416}
417
418// RollupGetL1TxFromQueue is the interface to call the smart contract function
419func (c *Client) RollupGetL1TxFromQueue(queue int64, position int64) ([]byte, error) {
420	return nil, errTODO
421}
422
423// RollupGetQueue is the interface to call the smart contract function
424func (c *Client) RollupGetQueue(queue int64) ([]byte, error) {
425	return nil, errTODO
426}
427
428// RollupUpdateForgeL1Timeout is the interface to call the smart contract function
429func (c *Client) RollupUpdateForgeL1Timeout(newForgeL1Timeout int64) (*types.Transaction, error) {
430	return nil, errTODO
431}
432
433// RollupUpdateFeeL1UserTx is the interface to call the smart contract function
434func (c *Client) RollupUpdateFeeL1UserTx(newFeeL1UserTx *big.Int) (*types.Transaction, error) {
435	return nil, errTODO
436}
437
438// RollupUpdateFeeAddToken is the interface to call the smart contract function
439func (c *Client) RollupUpdateFeeAddToken(newFeeAddToken *big.Int) (*types.Transaction, error) {
440	return nil, errTODO
441}
442
443// RollupUpdateTokensHEZ is the interface to call the smart contract function
444func (c *Client) RollupUpdateTokensHEZ(newTokenHEZ ethCommon.Address) (*types.Transaction, error) {
445	return nil, errTODO
446}
447
448// RollupUpdateGovernance is the interface to call the smart contract function
449// func (c *Client) RollupUpdateGovernance() (*types.Transaction, error) { // TODO (Not defined in Hermez.sol)
450// 	return nil, errTODO
451// }
452
453// RollupConstants returns the Constants of the Rollup Smart Contract
454func (c *Client) RollupConstants() (*eth.RollupConstants, error) {
455	return nil, errTODO
456}
457
458// RollupEventsByBlock returns the events in a block that happened in the Rollup Smart Contract
459func (c *Client) RollupEventsByBlock(blockNum int64) (*eth.RollupEvents, *ethCommon.Hash, error) {
460	block, ok := c.blocks[blockNum]
461	if !ok {
462		return nil, nil, fmt.Errorf("Block %v doesn't exist", blockNum)
463	}
464	return &block.Rollup.Events, &block.Eth.Hash, nil
465}
466
467// RollupForgeBatchArgs returns the arguments used in a ForgeBatch call in the Rollup Smart Contract in the given transaction
468func (c *Client) RollupForgeBatchArgs(ethTxHash ethCommon.Hash) (*eth.RollupForgeBatchArgs, error) {
469	forgeBatchArgs, ok := c.forgeBatchArgs[ethTxHash]
470	if !ok {
471		return nil, fmt.Errorf("transaction not found")
472	}
473	return forgeBatchArgs, nil
474}
475
476//
477// Auction
478//
479
480// AuctionSetSlotDeadline is the interface to call the smart contract function
481func (c *Client) AuctionSetSlotDeadline(newDeadline uint8) (*types.Transaction, error) {
482	return nil, errTODO
483}
484
485// AuctionGetSlotDeadline is the interface to call the smart contract function
486func (c *Client) AuctionGetSlotDeadline() (uint8, error) {
487	return 0, errTODO
488}
489
490// AuctionSetOpenAuctionSlots is the interface to call the smart contract function
491func (c *Client) AuctionSetOpenAuctionSlots(newOpenAuctionSlots uint16) (*types.Transaction, error) {
492	return nil, errTODO
493}
494
495// AuctionGetOpenAuctionSlots is the interface to call the smart contract function
496func (c *Client) AuctionGetOpenAuctionSlots() (uint16, error) { return 0, errTODO }
497
498// AuctionSetClosedAuctionSlots is the interface to call the smart contract function
499func (c *Client) AuctionSetClosedAuctionSlots(newClosedAuctionSlots uint16) (*types.Transaction, error) {
500	return nil, errTODO
501}
502
503// AuctionGetClosedAuctionSlots is the interface to call the smart contract function
504func (c *Client) AuctionGetClosedAuctionSlots() (uint16, error) {
505	return 0, errTODO
506}
507
508// AuctionSetOutbidding is the interface to call the smart contract function
509func (c *Client) AuctionSetOutbidding(newOutbidding uint8) (*types.Transaction, error) {
510	return nil, errTODO
511}
512
513// AuctionGetOutbidding is the interface to call the smart contract function
514func (c *Client) AuctionGetOutbidding() (uint8, error) {
515	return 0, errTODO
516}
517
518// AuctionSetAllocationRatio is the interface to call the smart contract function
519func (c *Client) AuctionSetAllocationRatio(newAllocationRatio [3]uint8) (*types.Transaction, error) {
520	return nil, errTODO
521}
522
523// AuctionGetAllocationRatio is the interface to call the smart contract function
524func (c *Client) AuctionGetAllocationRatio() ([3]uint8, error) {
525	return [3]uint8{}, errTODO
526}
527
528// AuctionSetDonationAddress is the interface to call the smart contract function
529func (c *Client) AuctionSetDonationAddress(newDonationAddress ethCommon.Address) (*types.Transaction, error) {
530	return nil, errTODO
531}
532
533// AuctionGetDonationAddress is the interface to call the smart contract function
534func (c *Client) AuctionGetDonationAddress() (*ethCommon.Address, error) {
535	return nil, errTODO
536}
537
538// AuctionSetBootCoordinator is the interface to call the smart contract function
539func (c *Client) AuctionSetBootCoordinator(newBootCoordinator ethCommon.Address) (*types.Transaction, error) {
540	return nil, errTODO
541}
542
543// AuctionGetBootCoordinator is the interface to call the smart contract function
544func (c *Client) AuctionGetBootCoordinator() (*ethCommon.Address, error) {
545	return nil, errTODO
546}
547
548// AuctionChangeEpochMinBid is the interface to call the smart contract function
549func (c *Client) AuctionChangeEpochMinBid(slotEpoch int64, newInitialMinBid *big.Int) (*types.Transaction, error) {
550	return nil, errTODO
551}
552
553// AuctionRegisterCoordinator is the interface to call the smart contract function
554func (c *Client) AuctionRegisterCoordinator(forgerAddress ethCommon.Address, URL string) (*types.Transaction, error) {
555	return nil, errTODO
556}
557
558// AuctionIsRegisteredCoordinator is the interface to call the smart contract function
559func (c *Client) AuctionIsRegisteredCoordinator(forgerAddress ethCommon.Address) (bool, error) {
560	return false, errTODO
561}
562
563// AuctionUpdateCoordinatorInfo is the interface to call the smart contract function
564func (c *Client) AuctionUpdateCoordinatorInfo(forgerAddress ethCommon.Address, newWithdrawAddress ethCommon.Address, newURL string) (*types.Transaction, error) {
565	return nil, errTODO
566}
567
568// AuctionGetCurrentSlotNumber is the interface to call the smart contract function
569func (c *Client) AuctionGetCurrentSlotNumber() (int64, error) {
570	return 0, errTODO
571}
572
573// AuctionGetMinBidBySlot is the interface to call the smart contract function
574func (c *Client) AuctionGetMinBidBySlot(slot int64) (*big.Int, error) {
575	return nil, errTODO
576}
577
578// AuctionGetMinBidEpoch is the interface to call the smart contract function
579func (c *Client) AuctionGetMinBidEpoch(epoch uint8) (*big.Int, error) {
580	return nil, errTODO
581}
582
583// AuctionTokensReceived is the interface to call the smart contract function
584// func (c *Client) AuctionTokensReceived(operator, from, to ethCommon.Address, amount *big.Int, userData, operatorData []byte) error {
585// 	return errTODO
586// }
587
588// AuctionBid is the interface to call the smart contract function
589func (c *Client) AuctionBid(slot int64, bidAmount *big.Int, forger ethCommon.Address) (*types.Transaction, error) {
590	return nil, errTODO
591}
592
593// AuctionMultiBid is the interface to call the smart contract function
594func (c *Client) AuctionMultiBid(startingSlot int64, endingSlot int64, slotEpoch [6]bool, maxBid, closedMinBid, budget *big.Int, forger ethCommon.Address) (*types.Transaction, error) {
595	return nil, errTODO
596}
597
598// AuctionCanForge is the interface to call the smart contract function
599func (c *Client) AuctionCanForge(forger ethCommon.Address) (bool, error) {
600	return false, errTODO
601}
602
603// AuctionForge is the interface to call the smart contract function
604// func (c *Client) AuctionForge(forger ethCommon.Address) (bool, error) {
605// 	return false, errTODO
606// }
607
608// AuctionClaimHEZ is the interface to call the smart contract function
609func (c *Client) AuctionClaimHEZ() (*types.Transaction, error) {
610	return nil, errTODO
611}
612
613// AuctionConstants returns the Constants of the Auction Smart Contract
614func (c *Client) AuctionConstants() (*eth.AuctionConstants, error) {
615	return nil, errTODO
616}
617
618// AuctionEventsByBlock returns the events in a block that happened in the Auction Smart Contract
619func (c *Client) AuctionEventsByBlock(blockNum int64) (*eth.AuctionEvents, *ethCommon.Hash, error) {
620	return nil, nil, errTODO
621}