diff --git a/eth/README.md b/eth/README.md index 850d084..1993dd6 100644 --- a/eth/README.md +++ b/eth/README.md @@ -8,7 +8,7 @@ The first step is to clone the github repository where the contracts are located While the prepared deployment is not found to master, branch in repository must be changed: -`git checkout feature/newDeploymentScript-eth` (tested with commit `6335252b073dc59afafc45040dae8630c72ecdf3`) +`git checkout feature/newDeploymentScript-eth-1` (tested with commit `071926ea2bce1c673cb1ff2728297191a396d350`) Now, install the dependencies: diff --git a/eth/auction.go b/eth/auction.go index 74459c3..0701997 100644 --- a/eth/auction.go +++ b/eth/auction.go @@ -56,6 +56,19 @@ type AuctionState struct { Coordinators map[ethCommon.Address]*Coordinator } +// AuctionEventInitialize is the InitializeHermezAuctionProtocolEvent event of +// the Smart Contract +type AuctionEventInitialize struct { + DonationAddress ethCommon.Address + BootCoordinatorAddress ethCommon.Address + BootCoordinatorURL string + Outbidding uint16 + SlotDeadline uint8 + ClosedAuctionSlots uint16 + OpenAuctionSlots uint16 + AllocationRatio [3]uint16 +} + // AuctionEventNewBid is an event of the Auction Smart Contract type AuctionEventNewBid struct { Slot int64 @@ -726,8 +739,38 @@ var ( logAuctionNewDefaultSlotSetBid = crypto.Keccak256Hash([]byte("NewDefaultSlotSetBid(uint128,uint128)")) logAuctionNewForge = crypto.Keccak256Hash([]byte("NewForge(address,uint128)")) logAuctionHEZClaimed = crypto.Keccak256Hash([]byte("HEZClaimed(address,uint128)")) + logAuctionInitialize = crypto.Keccak256Hash([]byte( + "InitializeHermezAuctionProtocolEvent(address,address,string,uint16,uint8,uint16,uint16,uint16[3])")) ) +// AuctionEventInit returns the initialize event with its corresponding block number +func (c *AuctionClient) AuctionEventInit() (*AuctionEventInitialize, int64, error) { + query := ethereum.FilterQuery{ + Addresses: []ethCommon.Address{ + c.address, + }, + Topics: [][]ethCommon.Hash{{logAuctionInitialize}}, + } + logs, err := c.client.client.FilterLogs(context.Background(), query) + if err != nil { + return nil, 0, tracerr.Wrap(err) + } + if len(logs) != 1 { + return nil, 0, fmt.Errorf("no event of type InitializeHermezAuctionProtocolEvent found") + } + vLog := logs[0] + if vLog.Topics[0] != logAuctionInitialize { + return nil, 0, fmt.Errorf("event is not InitializeHermezAuctionProtocolEvent") + } + + var auctionInit AuctionEventInitialize + if err := c.contractAbi.UnpackIntoInterface(&auctionInit, + "InitializeHermezAuctionProtocolEvent", vLog.Data); err != nil { + return nil, 0, tracerr.Wrap(err) + } + return &auctionInit, int64(vLog.BlockNumber), err +} + // AuctionEventsByBlock returns the events in a block that happened in the // Auction Smart Contract and the blockHash where the eents happened. If there // are no events in that block, blockHash is nil. @@ -764,7 +807,7 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e Address ethCommon.Address } var newBid AuctionEventNewBid - if err := c.contractAbi.Unpack(&auxNewBid, "NewBid", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&auxNewBid, "NewBid", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } newBid.BidAmount = auxNewBid.BidAmount @@ -773,19 +816,19 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e auctionEvents.NewBid = append(auctionEvents.NewBid, newBid) case logAuctionNewSlotDeadline: var newSlotDeadline AuctionEventNewSlotDeadline - if err := c.contractAbi.Unpack(&newSlotDeadline, "NewSlotDeadline", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newSlotDeadline, "NewSlotDeadline", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } auctionEvents.NewSlotDeadline = append(auctionEvents.NewSlotDeadline, newSlotDeadline) case logAuctionNewClosedAuctionSlots: var newClosedAuctionSlots AuctionEventNewClosedAuctionSlots - if err := c.contractAbi.Unpack(&newClosedAuctionSlots, "NewClosedAuctionSlots", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newClosedAuctionSlots, "NewClosedAuctionSlots", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } auctionEvents.NewClosedAuctionSlots = append(auctionEvents.NewClosedAuctionSlots, newClosedAuctionSlots) case logAuctionNewOutbidding: var newOutbidding AuctionEventNewOutbidding - if err := c.contractAbi.Unpack(&newOutbidding, "NewOutbidding", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newOutbidding, "NewOutbidding", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } auctionEvents.NewOutbidding = append(auctionEvents.NewOutbidding, newOutbidding) @@ -795,26 +838,26 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e auctionEvents.NewDonationAddress = append(auctionEvents.NewDonationAddress, newDonationAddress) case logAuctionNewBootCoordinator: var newBootCoordinator AuctionEventNewBootCoordinator - if err := c.contractAbi.Unpack(&newBootCoordinator, "NewBootCoordinator", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newBootCoordinator, "NewBootCoordinator", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } newBootCoordinator.NewBootCoordinator = ethCommon.BytesToAddress(vLog.Topics[1].Bytes()) auctionEvents.NewBootCoordinator = append(auctionEvents.NewBootCoordinator, newBootCoordinator) case logAuctionNewOpenAuctionSlots: var newOpenAuctionSlots AuctionEventNewOpenAuctionSlots - if err := c.contractAbi.Unpack(&newOpenAuctionSlots, "NewOpenAuctionSlots", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newOpenAuctionSlots, "NewOpenAuctionSlots", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } auctionEvents.NewOpenAuctionSlots = append(auctionEvents.NewOpenAuctionSlots, newOpenAuctionSlots) case logAuctionNewAllocationRatio: var newAllocationRatio AuctionEventNewAllocationRatio - if err := c.contractAbi.Unpack(&newAllocationRatio, "NewAllocationRatio", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newAllocationRatio, "NewAllocationRatio", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } auctionEvents.NewAllocationRatio = append(auctionEvents.NewAllocationRatio, newAllocationRatio) case logAuctionSetCoordinator: var setCoordinator AuctionEventSetCoordinator - if err := c.contractAbi.Unpack(&setCoordinator, "SetCoordinator", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&setCoordinator, "SetCoordinator", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } setCoordinator.BidderAddress = ethCommon.BytesToAddress(vLog.Topics[1].Bytes()) @@ -822,7 +865,7 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e auctionEvents.SetCoordinator = append(auctionEvents.SetCoordinator, setCoordinator) case logAuctionNewForgeAllocated: var newForgeAllocated AuctionEventNewForgeAllocated - if err := c.contractAbi.Unpack(&newForgeAllocated, "NewForgeAllocated", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&newForgeAllocated, "NewForgeAllocated", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } newForgeAllocated.Bidder = ethCommon.BytesToAddress(vLog.Topics[1].Bytes()) @@ -835,7 +878,7 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e NewInitialMinBid *big.Int } var newDefaultSlotSetBid AuctionEventNewDefaultSlotSetBid - if err := c.contractAbi.Unpack(&auxNewDefaultSlotSetBid, "NewDefaultSlotSetBid", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&auxNewDefaultSlotSetBid, "NewDefaultSlotSetBid", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } newDefaultSlotSetBid.NewInitialMinBid = auxNewDefaultSlotSetBid.NewInitialMinBid @@ -848,7 +891,7 @@ func (c *AuctionClient) AuctionEventsByBlock(blockNum int64) (*AuctionEvents, *e auctionEvents.NewForge = append(auctionEvents.NewForge, newForge) case logAuctionHEZClaimed: var HEZClaimed AuctionEventHEZClaimed - if err := c.contractAbi.Unpack(&HEZClaimed, "HEZClaimed", vLog.Data); err != nil { + if err := c.contractAbi.UnpackIntoInterface(&HEZClaimed, "HEZClaimed", vLog.Data); err != nil { return nil, nil, tracerr.Wrap(err) } HEZClaimed.Owner = ethCommon.BytesToAddress(vLog.Topics[1].Bytes()) diff --git a/eth/auction_test.go b/eth/auction_test.go index eb88fea..0ab7342 100644 --- a/eth/auction_test.go +++ b/eth/auction_test.go @@ -27,6 +27,20 @@ func TestAuctionGetCurrentSlotNumber(t *testing.T) { assert.Equal(t, currentSlotConst, currentSlotInt) } +func TestAuctionEventInit(t *testing.T) { + auctionInit, blockNum, err := auctionClientTest.AuctionEventInit() + require.NoError(t, err) + assert.Equal(t, int64(18), blockNum) + assert.Equal(t, donationAddressConst, auctionInit.DonationAddress) + assert.Equal(t, bootCoordinatorAddressConst, auctionInit.BootCoordinatorAddress) + assert.Equal(t, "https://boot.coordinator.io", auctionInit.BootCoordinatorURL) + assert.Equal(t, uint16(1000), auctionInit.Outbidding) + assert.Equal(t, uint8(20), auctionInit.SlotDeadline) + assert.Equal(t, uint16(2), auctionInit.ClosedAuctionSlots) + assert.Equal(t, uint16(4320), auctionInit.OpenAuctionSlots) + assert.Equal(t, [3]uint16{4000, 4000, 2000}, auctionInit.AllocationRatio) +} + func TestAuctionConstants(t *testing.T) { INITMINBID := new(big.Int) INITMINBID.SetString(minBidStr, 10) diff --git a/eth/contracts/auction/HermezAuctionProtocol.go b/eth/contracts/auction/HermezAuctionProtocol.go index d14ff8a..2c72682 100644 --- a/eth/contracts/auction/HermezAuctionProtocol.go +++ b/eth/contracts/auction/HermezAuctionProtocol.go @@ -28,24 +28,7 @@ var ( ) // HermezAuctionProtocolABI is the input ABI used to generate the binding from. -const HermezAuctionProtocolABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"HEZClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16[3]\",\"name\":\"newAllocationRatio\",\"type\":\"uint16[3]\"}],\"name\":\"NewAllocationRatio\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"}],\"name\":\"NewBid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBootCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newBootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"NewBootCoordinator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newClosedAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"NewClosedAuctionSlots\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"slotSet\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"newInitialMinBid\",\"type\":\"uint128\"}],\"name\":\"NewDefaultSlotSetBid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newDonationAddress\",\"type\":\"address\"}],\"name\":\"NewDonationAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slotToForge\",\"type\":\"uint128\"}],\"name\":\"NewForge\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slotToForge\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"burnAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"donationAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"governanceAmount\",\"type\":\"uint128\"}],\"name\":\"NewForgeAllocated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newOpenAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"NewOpenAuctionSlots\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newOutbidding\",\"type\":\"uint16\"}],\"name\":\"NewOutbidding\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"newSlotDeadline\",\"type\":\"uint8\"}],\"name\":\"NewSlotDeadline\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"name\":\"SetCoordinator\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_SLOT\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_MINIMAL_BIDDING\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootCoordinatorURL\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"canForge\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slotSet\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"newInitialMinBid\",\"type\":\"uint128\"}],\"name\":\"changeDefaultSlotSetBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimHEZ\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"claimPendingHEZ\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"coordinators\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"}],\"name\":\"forge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"genesisBlock\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllocationRatio\",\"outputs\":[{\"internalType\":\"uint16[3]\",\"name\":\"\",\"type\":\"uint16[3]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBootCoordinator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"}],\"name\":\"getClaimableHEZ\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClosedAuctionSlots\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSlotNumber\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"slotSet\",\"type\":\"uint8\"}],\"name\":\"getDefaultSlotSetBid\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDonationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"getMinBidBySlot\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOpenAuctionSlots\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOutbidding\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSlotDeadline\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"blockNumber\",\"type\":\"uint128\"}],\"name\":\"getSlotNumber\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"getSlotSet\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"genesis\",\"type\":\"uint128\"},{\"internalType\":\"address\",\"name\":\"hermezRollupAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_governanceAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"donationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bootCoordinatorAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_bootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"hermezAuctionProtocolInitializer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezRollup\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"pendingBalances\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"processBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"startingSlot\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"endingSlot\",\"type\":\"uint128\"},{\"internalType\":\"bool[6]\",\"name\":\"slotSets\",\"type\":\"bool[6]\"},{\"internalType\":\"uint128\",\"name\":\"maxBid\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"minBid\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"processMultiBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16[3]\",\"name\":\"newAllocationRatio\",\"type\":\"uint16[3]\"}],\"name\":\"setAllocationRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBootCoordinator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"newBootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"setBootCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newClosedAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"setClosedAuctionSlots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newDonationAddress\",\"type\":\"address\"}],\"name\":\"setDonationAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newOpenAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"setOpenAuctionSlots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newOutbidding\",\"type\":\"uint16\"}],\"name\":\"setOutbidding\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newDeadline\",\"type\":\"uint8\"}],\"name\":\"setSlotDeadline\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"name\":\"slots\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"forgerCommitment\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"closedMinBid\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenHEZ\",\"outputs\":[{\"internalType\":\"contractIHEZToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// HermezAuctionProtocolBin is the compiled bytecode used for deploying new contracts. -var HermezAuctionProtocolBin = "0x608060405234801561001057600080fd5b506143a4806100206000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c806372ca58a31161013b578063aebd6d98116100b8578063d92bdda31161007c578063d92bdda314610a82578063dfd5281b14610aa3578063e606591414610ac4578063ec29159b14610acc578063ecdae41b14610b0c5761023d565b8063aebd6d98146109c4578063b3dc7bb1146109cc578063b5f7f2f0146109f2578063bc415567146109fa578063c63de51514610a615761023d565b806383b1f6a0116100ff57806383b1f6a01461088857806387e6b6bb146108c8578063a48af096146108e8578063ac4b901214610996578063ac5f658b1461099e5761023d565b806372ca58a31461077b578063795053d3146107f857806379a135e3146108005780637c643b701461080857806382787405146108365761023d565b80634e5a5178116101c95780635cca49031161018d5780635cca49031461058f5780635e73a67f146105b55780636cbdc3df146106995780636dfe47c91461074d5780636f48e79b146107555761023d565b80634e5a51781461044457806354c03ab71461046a57806355b442e61461048e578063564e6a7114610496578063583ad0dd146104b65761023d565b806337d1bd0b1161021057806337d1bd0b1461034257806341d42c23146103685780634b93b7fa1461038e5780634cdc9c631461041d5780634da9639d146104255761023d565b80630c4da4f6146102425780630eeaf0801461026657806313de9af21461031c5780632243de471461033a575b600080fd5b61024a610b32565b604080516001600160801b039092168252519081900360200190f35b61031a6004803603604081101561027c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156102a657600080fd5b8201836020820111156102b857600080fd5b803590602001918460018302840111600160201b831117156102d957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610b42945050505050565b005b610324610cf0565b6040805160ff9092168252519081900360200190f35b610324610cff565b61024a6004803603602081101561035857600080fd5b50356001600160801b0316610d04565b61031a6004803603602081101561037e57600080fd5b50356001600160801b0316610ea9565b61031a600480360360808110156103a457600080fd5b6001600160801b0382358116926020810135821692604082013590921691810190608081016060820135600160201b8111156103df57600080fd5b8201836020820111156103f157600080fd5b803590602001918460018302840111600160201b8311171561041257600080fd5b509092509050611105565b61024a61140f565b61042d61141e565b6040805161ffff9092168252519081900360200190f35b61031a6004803603602081101561045a57600080fd5b50356001600160a01b031661142f565b6104726119a2565b604080516001600160a01b039092168252519081900360200190f35b61042d6119b1565b61024a600480360360208110156104ac57600080fd5b503560ff166119bb565b61031a60048036036101808110156104cd57600080fd5b6040805160c081810183526001600160801b038535811695602081013582169594810135909116938101929091610120830191906060840190600690839083908082843760009201919091525091946001600160801b0384358116956020860135909116949193509150606081019060400135600160201b81111561055157600080fd5b82018360208201111561056357600080fd5b803590602001918460018302840111600160201b8311171561058457600080fd5b5090925090506119f3565b61024a600480360360208110156105a557600080fd5b50356001600160a01b0316611dd5565b61031a600480360360e08110156105cb57600080fd5b6001600160a01b0382358116926001600160801b036020820135169260408201358316926060830135811692608081013582169260a08201359092169181019060e0810160c0820135600160201b81111561062557600080fd5b82018360208201111561063757600080fd5b803590602001918460018302840111600160201b8311171561065857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611df9945050505050565b61031a600480360360408110156106af57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106d957600080fd5b8201836020820111156106eb57600080fd5b803590602001918460018302840111600160201b8311171561070c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061204f945050505050565b61031a612172565b61031a6004803603602081101561076b57600080fd5b50356001600160a01b0316612356565b610783612434565b6040805160208082528351818301528351919283929083019185019080838360005b838110156107bd5781810151838201526020016107a5565b50505050905090810190601f1680156107ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104726124c2565b6104726124d1565b61031a6004803603604081101561081e57600080fd5b506001600160801b03813581169160200135166124e0565b61031a6004803603606081101561084c57600080fd5b81019080806060019060038060200260405190810160405280929190826003602002808284376000920191909152509194506127449350505050565b6108b46004803603604081101561089e57600080fd5b506001600160a01b0381351690602001356128b8565b604080519115158252519081900360200190f35b61031a600480360360208110156108de57600080fd5b503560ff166128cd565b61090e600480360360208110156108fe57600080fd5b50356001600160a01b03166129b3565b60405180836001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561095a578181015183820152602001610942565b50505050905090810190601f1680156109875780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b61042d612a67565b61024a600480360360208110156109b457600080fd5b50356001600160801b0316612a78565b610472612a8e565b61024a600480360360208110156109e257600080fd5b50356001600160801b0316612a9d565b610472612ad7565b610a2060048036036020811015610a1057600080fd5b50356001600160801b0316612ae6565b604080516001600160a01b0390961686529315156020860152911515848401526001600160801b039081166060850152166080830152519081900360a00190f35b61031a60048036036020811015610a7757600080fd5b503561ffff16612b34565b61031a60048036036020811015610a9857600080fd5b503561ffff16612bdb565b61031a60048036036020811015610ab957600080fd5b503561ffff16612c82565b61024a612d6f565b610ad4612d7b565b6040518082606080838360005b83811015610af9578181015183820152602001610ae1565b5050505090500191505060405180910390f35b61024a60048036036020811015610b2257600080fd5b50356001600160a01b0316612ddd565b6000610b3d43612a9d565b905090565b604080516000815260208082018084528251902084519093859301918291908401908083835b60208310610b875780518252601f199092019160209182019101610b68565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001201415610bff5760405162461bcd60e51b8152600401808060200182810382526034815260200180613efa6034913960400191505060405180910390fd5b33600090815260736020908152604090912080546001600160a01b0319166001600160a01b0385161781558251610c3e92600190920191840190613930565b50816001600160a01b0316336001600160a01b03167f5246b2ac9ee77efe2e64af6df00055d97e2d6e1b277f5a8d17ba5bca1a573da0836040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cb2578181015183820152602001610c9a565b50505050905090810190601f168015610cdf5780820380516001836020036101000a031916815260200191505b509250505060405180910390a35050565b60705462010000900460ff1690565b602881565b606e54600090600160801b900461ffff16610d1d610b32565b016001600160801b0316826001600160801b03161015610d6e5760405162461bcd60e51b8152600401808060200182810382526036815260200180613daf6036913960400191505060405180910390fd5b6000610d7983612a78565b6001600160801b038085166000908152607160205260409020600101549192501615610e13576070546001600160801b03808516600090815260716020526040902060010154610e0e92610dea9261271092610ddb9291169061ffff16612df8565b6001600160801b031690612e72565b6001600160801b038086166000908152607160205260409020600101541690612eb4565b610ea2565b607054610ea290610e669061271090610ddb9061ffff16606b6001600160801b03871660068110610e4057fe5b60028104919091015460019091166010026101000a90046001600160801b031690612df8565b606b836001600160801b031660068110610e7c57fe5b60028104919091015460019091166010026101000a90046001600160801b031690612eb4565b9392505050565b610eb1610b32565b6001600160801b0316816001600160801b031610610f005760405162461bcd60e51b815260040180806020018281038252603d815260200180613bb3603d913960400191505060405180910390fd5b6001600160801b038116600090815260716020526040902054600160a01b900460ff1615610f5f5760405162461bcd60e51b815260040180806020018281038252603d815260200180613b76603d913960400191505060405180910390fd5b6001600160801b038082166000908152607160205260408120600101549091600160801b9091041615610fb6576001600160801b03808316600090815260716020526040902060010154600160801b900416610ff4565b606b610fc183612a78565b6001600160801b031660068110610fd457fe5b600291828204019190066010029054906101000a90046001600160801b03165b6001600160801b038381166000908152607160205260409020600101549192508083169116106110555760405162461bcd60e51b815260040180806020018281038252603d815260200180613b76603d913960400191505060405180910390fd5b6001600160801b038083166000908152607160209081526040808320600181018054868816600160801b029087161790819055815460ff60a01b1916600160a01b17918290556001600160a01b0390911684526072909252909120546110bf929081169116612eb4565b6001600160801b039283166000908152607160209081526040808320546001600160a01b031683526072909152902080546001600160801b031916919093161790915550565b336000908152607360205260409020546001600160a01b03166111595760405162461bcd60e51b815260040180806020018281038252603d815260200180613bf0603d913960400191505060405180910390fd5b606e54600160801b900461ffff1661116f610b32565b016001600160801b0316846001600160801b0316116111bf5760405162461bcd60e51b81526004018080602001828103825260318152602001806142686031913960400191505060405180910390fd5b6111c884610d04565b6001600160801b0316836001600160801b031610156112185760405162461bcd60e51b8152600401808060200182810382526030815260200180613cd86030913960400191505060405180910390fd5b606e5461ffff600160901b8204811691600160801b900416611238610b32565b01016001600160801b0316846001600160801b0316111561128a5760405162461bcd60e51b8152600401808060200182810382526033815260200180613fda6033913960400191505060405180910390fd5b80156112a4576112a4856001600160801b03168383612f1a565b606554604080516323b872dd60e01b81523360048201523060248201526001600160801b038816604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561130657600080fd5b505af115801561131a573d6000803e3d6000fd5b505050506040513d602081101561133057600080fd5b505161136d5760405162461bcd60e51b8152600401808060200182810382526038815260200180613d086038913960400191505060405180910390fd5b33600090815260726020526040902054611390906001600160801b031686612eb4565b33600090815260726020526040902080546001600160801b0319166001600160801b039283161790819055848216911610156113fd5760405162461bcd60e51b8152600401808060200182810382526035815260200180613fa56035913960400191505060405180910390fd5b6114088484336131b9565b5050505050565b606e546001600160801b031681565b606e54600160801b900461ffff1690565b6066546001600160a01b031633146114785760405162461bcd60e51b81526004018080602001828103825260308152602001806140616030913960400191505060405180910390fd5b611482814361339c565b6114bd5760405162461bcd60e51b815260040180806020018281038252602a815260200180614126602a913960400191505060405180910390fd5b60006114c7610b32565b6001600160801b038116600090815260716020526040902054909150600160a81b900460ff1661158257606e5460009061153790611527906001600160801b03908116906115189086166028612df8565b6001600160801b031690612eb4565b6001600160801b03431690613650565b60705490915062010000900460ff166001600160801b0382161015611580576001600160801b0382166000908152607160205260409020805460ff60a81b1916600160a81b1790555b505b6001600160801b038116600090815260716020526040902054600160a01b900460ff1661195f576001600160801b038082166000908152607160205260409020805460ff60a01b1916600160a01b17815560010154161561195f576001600160801b038082166000908152607160205260408120600101549091600160801b9091041615611634576001600160801b03808316600090815260716020526040902060010154600160801b900416611672565b606b61163f83612a78565b6001600160801b03166006811061165257fe5b600291828204019190066010029054906101000a90046001600160801b03165b6001600160801b038381166000908152607160205260409020600101549192508083169116101561172c576001600160801b038083166000908152607160209081526040808320600181015490546001600160a01b031684526072909252909120546116e2929081169116612eb4565b6001600160801b038381166000908152607160209081526040808320546001600160a01b031683526072909152902080546001600160801b0319169290911691909117905561195d565b6001600160801b03828116600090815260716020526040812060010154606f549216916117669061271090610ddb90859061ffff16612df8565b606f549091506000906117959061271090610ddb906001600160801b0387169062010000900461ffff16612df8565b606f549091506000906117c59061271090610ddb906001600160801b03881690600160201b900461ffff16612df8565b60655460408051630852cd8d60e31b81526001600160801b038716600482015290519293506001600160a01b03909116916342966c68916024808201926020929091908290030181600087803b15801561181e57600080fd5b505af1158015611832573d6000803e3d6000fd5b505050506040513d602081101561184857600080fd5b50506068546001600160a01b0316600090815260726020526040902054611878906001600160801b031683612eb4565b6068546001600160a01b0390811660009081526072602052604080822080546001600160801b0319166001600160801b03958616179055606754909216815220546118c4911682612eb4565b6067546001600160a01b03908116600090815260726020908152604080832080546001600160801b0319166001600160801b039687161790558a85168084526071835292819020548151898716815288871693810193909352948616828201525191938b84169316917fd64ebb43f4c2b91022b97389834432f1027ef55586129ba05a3a3065b2304f05916060908290030190a4505050505b505b6040516001600160801b038216906001600160a01b038416907f7cae662d4cfa9d9c5575c65f0cc41a858c51ca14ebcbd02a802a62376c3ad23890600090a35050565b6068546001600160a01b031690565b60705461ffff1690565b6000606b8260ff16600681106119cd57fe5b600291828204019190066010029054906101000a90046001600160801b03169050919050565b606e54600160801b900461ffff16611a09610b32565b016001600160801b0316876001600160801b031611611a595760405162461bcd60e51b8152600401808060200182810382526035815260200180613d7a6035913960400191505060405180910390fd5b606e5461ffff600160901b8204811691600160801b900416611a79610b32565b01016001600160801b0316866001600160801b03161115611acb5760405162461bcd60e51b81526004018080602001828103825260378152602001806141fb6037913960400191505060405180910390fd5b826001600160801b0316846001600160801b03161015611b1c5760405162461bcd60e51b8152600401808060200182810382526041815260200180613de56041913960600191505060405180910390fd5b336000908152607360205260409020546001600160a01b0316611b705760405162461bcd60e51b81526004018080602001828103825260418152602001806142996041913960600191505060405180910390fd5b8015611b8a57611b8a886001600160801b03168383612f1a565b606554604080516323b872dd60e01b81523360048201523060248201526001600160801b038b16604482015290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015611bec57600080fd5b505af1158015611c00573d6000803e3d6000fd5b505050506040513d6020811015611c1657600080fd5b5051611c535760405162461bcd60e51b815260040180806020018281038252603d815260200180613c2d603d913960400191505060405180910390fd5b33600090815260726020526040902054611c76906001600160801b031689612eb4565b33600090815260726020526040812080546001600160801b0319166001600160801b039390931692909217909155875b876001600160801b0316816001600160801b031611611dc9576000611cca82610d04565b9050856001600160801b0316816001600160801b031611611ced57859250611d33565b856001600160801b0316816001600160801b0316118015611d205750866001600160801b0316816001600160801b031611155b15611d2d57809250611d33565b50611dc1565b87611d3d83612a78565b6001600160801b031660068110611d5057fe5b602002015115611dbf57336000908152607260205260409020546001600160801b0380851691161015611db45760405162461bcd60e51b81526004018080602001828103825260398152602001806141866039913960400191505060405180910390fd5b611dbf8284336131b9565b505b600101611ca6565b50505050505050505050565b6001600160a01b03166000908152607260205260409020546001600160801b031690565b600054610100900460ff1680611e125750611e12613692565b80611e20575060005460ff16155b611e5b5760405162461bcd60e51b815260040180806020018281038252602e815260200180614091602e913960400191505060405180910390fd5b600054610100900460ff16158015611e86576000805460ff1961ff0019909116610100171660011790555b611e8e613698565b607080546103e861ffff199091161762ff0000191662140000179055606e805461ffff60801b1916600160811b1761ffff60901b1916608760951b17905560408051606081018252610fa080825260208201526107d091810191909152611ef990606f9060036139ae565b506040805160c081018252678ac7230489e8000080825260208201819052918101829052606081018290526080810182905260a0810191909152611f4190606b906006613a40565b50606580546001600160a01b0319166001600160a01b038a16179055606e54600160801b900461ffff9081166028021643016001600160801b0388161015611fba5760405162461bcd60e51b815260040180806020018281038252604d815260200180613ead604d913960600191505060405180910390fd5b606e80546001600160801b0319166001600160801b038916179055606680546001600160a01b03199081166001600160a01b038981169190911790925560678054821688841617905560688054821687841617905560698054909116918516919091179055815161203290606a906020850190613930565b508015612045576000805461ff00191690555b5050505050505050565b6067546001600160a01b031633146120985760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b606980546001600160a01b0319166001600160a01b03841617905580516120c690606a906020840190613930565b5060695460408051602080825284518183015284516001600160a01b03909416937f0487eab4c1da34bf653268e33bee8bfec7dacfd6f3226047197ebf872293cfd6938693928392918301919085019080838360005b8381101561213457818101518382015260200161211c565b50505050905090810190601f1680156121615780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b60335460ff166121c9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6033805460ff1916905560006121de33611dd5565b90506000816001600160801b0316116122285760405162461bcd60e51b815260040180806020018281038252603381526020018061400d6033913960400191505060405180910390fd5b33600081815260726020908152604080832080546001600160801b0319169055606554815163a9059cbb60e01b815260048101959095526001600160801b038616602486015290516001600160a01b039091169363a9059cbb9360448083019493928390030190829087803b1580156122a057600080fd5b505af11580156122b4573d6000803e3d6000fd5b505050506040513d60208110156122ca57600080fd5b50516123075760405162461bcd60e51b81526004018080602001828103825260368152602001806141506036913960400191505060405180910390fd5b604080516001600160801b0383168152905133917f199ef0cb54d2b296ff6eaec2721bacf0ca3fd8344a43f5bdf4548b34dfa2594f919081900360200190a2506033805460ff19166001179055565b6067546001600160a01b0316331461239f5760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b6001600160a01b0381166123e45760405162461bcd60e51b815260040180806020018281038252603c8152602001806141bf603c913960400191505060405180910390fd5b606880546001600160a01b0319166001600160a01b0383811691909117918290556040519116907fa62863cbad1647a2855e9cd39d04fa6dfd32e1b9cfaff1aaf6523f4aaafeccd790600090a250565b606a805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156124ba5780601f1061248f576101008083540402835291602001916124ba565b820191906000526020600020905b81548152906001019060200180831161249d57829003601f168201915b505050505081565b6067546001600160a01b031681565b6065546001600160a01b031681565b6067546001600160a01b031633146125295760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b6006826001600160801b031611156125725760405162461bcd60e51b8152600401808060200182810382526042815260200180613c966042913960600191505060405180910390fd5b606b826001600160801b03166006811061258857fe5b60028104919091015460019091166010026101000a90046001600160801b03166125e35760405162461bcd60e51b8152600401808060200182810382526042815260200180613e266042913960600191505060405180910390fd5b60006125ed610b32565b9050805b606e54600160801b900461ffff1682016001600160801b03908116908216116126a7576001600160801b03808216600090815260716020526040902060010154600160801b90041661269f57606b61264882612a78565b6001600160801b03166006811061265b57fe5b6002810491909101546001600160801b038381166000908152607160205260409020600190810180548316919094166010026101000a90920416600160801b021790555b6001016125f1565b5081606b846001600160801b0316600681106126bf57fe5b600291828204019190066010026101000a8154816001600160801b0302191690836001600160801b031602179055507fa922aa010d1ff8e70b2aa9247d891836795c3d3ba2a543c37c91a44dc4a50172838360405180836001600160801b03168152602001826001600160801b031681526020019250505060405180910390a1505050565b6067546001600160a01b0316331461278d5760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b805161271061ffff909116118015906127b35750612710816001602002015161ffff1611155b80156127cc5750612710816002602002015161ffff1611155b80156127f65750806002602002015181600160200201518260006020020151010161ffff16612710145b6128315760405162461bcd60e51b8152600401808060200182810382526045815260200180613e686045913960600191505060405180910390fd5b61283e606f8260036139ae565b506040517f0bb59eceb12f1bdb63e4a7d57c70d6473fefd7c3f51af5a3604f7e97197073e490606f9060608101826000835b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411612870579050505091505060405180910390a150565b60006128c4838361339c565b90505b92915050565b6067546001600160a01b031633146129165760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b602860ff821611156129595760405162461bcd60e51b8152600401808060200182810382526044815260200180613f2e6044913960600191505060405180910390fd5b6070805460ff8084166201000090810262ff0000199093169290921792839055604080519290930416815290517f4a0d90b611c15e02dbf23b10f35b936cf2c77665f8c77822d3eca131f9d986d39181900360200190a150565b6073602090815260009182526040918290208054600180830180548651600261010094831615949094026000190190911692909204601f81018690048602830186019096528582526001600160a01b03909216949293909290830182828015612a5d5780601f10612a3257610100808354040283529160200191612a5d565b820191906000526020600020905b815481529060010190602001808311612a4057829003601f168201915b5050505050905082565b606e54600160901b900461ffff1690565b60006128c76001600160801b0383166006613747565b6066546001600160a01b031681565b606e546000906001600160801b039081169083161015612abe5760006128c7565b50606e5460286001600160801b03918216909203160490565b6069546001600160a01b031690565b607160205260009081526040902080546001909101546001600160a01b0382169160ff600160a01b8204811692600160a81b90920416906001600160801b0380821691600160801b90041685565b6067546001600160a01b03163314612b7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b606e805461ffff808416600160901b90810261ffff60901b199093169290921792839055604080519290930416815290517f3da0492dea7298351bc14d1c0699905fd0657c33487449751af50fc0c8b593f19181900360200190a150565b6067546001600160a01b03163314612c245760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b606e805461ffff808416600160801b90810261ffff60801b199093169290921792839055604080519290930416815290517fc78051d3757db196b1e445f3a9a1380944518c69b5d7922ec747c54f0340a4ea9181900360200190a150565b6067546001600160a01b03163314612ccb5760405162461bcd60e51b81526004018080602001828103825260368152602001806140bf6036913960400191505060405180910390fd5b60018161ffff16118015612ce457506127108161ffff16105b612d1f5760405162461bcd60e51b815260040180806020018281038252603a815260200180613d40603a913960400191505060405180910390fd5b6070805461ffff191661ffff838116919091179182905560408051929091168252517fd3748b8c326e93d12af934fbf87471e315a89bc3f7b8222343acf0210edf248e916020908290030190a150565b678ac7230489e8000081565b612d83613ae1565b60408051606081019182905290606f90600390826000855b82829054906101000a900461ffff1661ffff1681526020019060020190602082600101049283019260010382029150808411612d9b5790505050505050905090565b6072602052600090815260409020546001600160801b031681565b60006001600160801b038316612e10575060006128c7565b8282026001600160801b038084169080861690831681612e2c57fe5b046001600160801b0316146128c45760405162461bcd60e51b81526004018080602001828103825260218152602001806140406021913960400191505060405180910390fd5b60006128c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613789565b60008282016001600160801b0380851690821610156128c4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082826020811015612f2c57600080fd5b50356001600160e01b031916905063d505accf60e01b8114612f7f5760405162461bcd60e51b815260040180806020018281038252602e8152602001806142da602e913960400191505060405180910390fd5b6000808080808080612f94896004818d613b4d565b60e0811015612fa257600080fd5b506001600160a01b038135811698506020820135169650604081013595506060810135945060ff608082013516935060a0810135925060c00135905033871461301c5760405162461bcd60e51b81526004018080602001828103825260368152602001806143396036913960400191505060405180910390fd5b6001600160a01b03861630146130635760405162461bcd60e51b81526004018080602001828103825260368152602001806142326036913960400191505060405180910390fd5b8a85146130a15760405162461bcd60e51b815260040180806020018281038252602c815260200180613c6a602c913960400191505060405180910390fd5b606554604080516001600160a01b038a811660248301528981166044830152606482018990526084820188905260ff871660a483015260c4820186905260e48083018690528351808403909101815261010490920183526020820180516001600160e01b031663d505accf60e01b178152925182519190941693919282918083835b602083106131425780518252601f199092019160209182019101613123565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146131a4576040519150601f19603f3d011682016040523d82523d6000602084013e6131a9565b606091505b5050505050505050505050505050565b6001600160801b03808416600090815260716020526040902080546001909101546001600160a01b039091169190811690841681106132295760405162461bcd60e51b81526004018080602001828103825260318152602001806140f56031913960400191505060405180910390fd5b6001600160a01b038316600090815260726020526040902054613255906001600160801b031685613650565b6001600160a01b03848116600081815260726020908152604080832080546001600160801b03199081166001600160801b03988916179091558b87168452607190925290912080546001600160a01b03191690921782556001919091018054909116928716929092179091558216158015906132d957506001600160801b03811615155b15613341576001600160a01b03821660009081526072602052604090205461330a906001600160801b031682612eb4565b6001600160a01b038316600090815260726020526040902080546001600160801b0319166001600160801b03929092169190911790555b826001600160a01b0316856001600160801b03167fd48e8329cdb2fb109b4fe445d7b681a74b256bff16e6f7f33b9d4fbe9038e4338660405180826001600160801b0316815260200191505060405180910390a35050505050565b6000600160801b82106133e05760405162461bcd60e51b81526004018080602001828103825260318152602001806143086031913960400191505060405180910390fd5b606e546001600160801b031682101561342a5760405162461bcd60e51b8152600401808060200182810382526033815260200180613f726033913960400191505060405180910390fd5b600061343583612a9d565b606e5490915060009061346f9061345f906001600160801b03908116906115189086166028612df8565b6001600160801b03861690613650565b6001600160801b0380841660009081526071602052604081206001015492935091600160801b900416156134c7576001600160801b03808416600090815260716020526040902060010154600160801b900416613505565b606b6134d284612a78565b6001600160801b0316600681106134e557fe5b600291828204019190066010029054906101000a90046001600160801b03165b6001600160801b038416600090815260716020526040902054909150600160a81b900460ff1615801561354c575060705462010000900460ff166001600160801b03831610155b1561355d57600193505050506128c7565b6001600160801b0383166000908152607160209081526040808320546001600160a01b03908116845260739092529091205481169087161480156135c157506001600160801b03838116600090815260716020526040902060010154818316911610155b156135d257600193505050506128c7565b6069546001600160a01b03878116911614801561363357506001600160801b038381166000908152607160205260409020600101548183169116108061363357506001600160801b0380841660009081526071602052604090206001015416155b1561364457600193505050506128c7565b600093505050506128c7565b60006128c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613846565b303b1590565b600054610100900460ff16806136b157506136b1613692565b806136bf575060005460ff16155b6136fa5760405162461bcd60e51b815260040180806020018281038252602e815260200180614091602e913960400191505060405180910390fd5b600054610100900460ff16158015613725576000805460ff1961ff0019909116610100171660011790555b6033805460ff191660011790558015613744576000805461ff00191690555b50565b60006128c483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506138b3565b6000816001600160801b03841661381e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156137e35781810151838201526020016137cb565b50505050905090810190601f1680156138105780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000836001600160801b0316856001600160801b03168161383c57fe5b0495945050505050565b6000836001600160801b0316836001600160801b0316111582906138ab5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156137e35781810151838201526020016137cb565b505050900390565b6000816001600160801b03841661390b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156137e35781810151838201526020016137cb565b50826001600160801b0316846001600160801b03168161392757fe5b06949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061397157805160ff191683800117855561399e565b8280016001018555821561399e579182015b8281111561399e578251825591602001919060010190613983565b506139aa929150613aff565b5090565b600183019183908215613a345791602002820160005b83821115613a0457835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026139c4565b8015613a325782816101000a81549061ffff0219169055600201602081600101049283019260010302613a04565b505b506139aa929150613b14565b600383019183908215613ad55791602002820160005b83821115613aa057835183826101000a8154816001600160801b0302191690836001600160801b031602179055509260200192601001602081600f01049283019260010302613a56565b8015613ad35782816101000a8154906001600160801b030219169055601001602081600f01049283019260010302613aa0565b505b506139aa929150613b2e565b60405180606001604052806003906020820280368337509192915050565b5b808211156139aa5760008155600101613b00565b5b808211156139aa57805461ffff19168155600101613b15565b5b808211156139aa5780546001600160801b0319168155600101613b2f565b60008085851115613b5c578182fd5b83861115613b68578182fd5b505082019391909203915056fe4865726d657a41756374696f6e50726f746f636f6c3a3a636c61696d50656e64696e6748455a3a204f4e4c595f49465f4e4f545f46554c46494c4c45444865726d657a41756374696f6e50726f746f636f6c3a3a636c61696d50656e64696e6748455a3a204f4e4c595f49465f50524556494f55535f534c4f544865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a20434f4f5244494e41544f525f4e4f545f524547495354455245444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c74694269643a20544f4b454e5f5452414e534645525f4641494c45444865726d657a41756374696f6e50726f746f636f6c3a3a5f7065726d69743a2057524f4e475f414d4f554e544865726d657a41756374696f6e50726f746f636f6c3a3a6368616e676544656661756c74536c6f745365744269643a204e4f545f56414c49445f534c4f545f5345544865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a2042454c4f575f4d494e494d554d4865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a20544f4b454e5f5452414e534645525f4641494c45444865726d657a41756374696f6e50726f746f636f6c3a3a7365744f757462696464696e673a204f555442494444494e475f4e4f545f56414c49444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c74694269642041554354494f4e5f434c4f5345444865726d657a41756374696f6e50726f746f636f6c3a3a6765744d696e4269644279536c6f743a2041554354494f4e5f434c4f5345444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c7469426964204d41584249445f475245415445525f5448414e5f4d494e4249444865726d657a41756374696f6e50726f746f636f6c3a3a6368616e676544656661756c74536c6f745365744269643a20534c4f545f444543454e5452414c495a45444865726d657a41756374696f6e50726f746f636f6c3a3a736574416c6c6f636174696f6e526174696f3a20414c4c4f434154494f4e5f524154494f5f4e4f545f56414c49444865726d657a41756374696f6e50726f746f636f6c3a3a6865726d657a41756374696f6e50726f746f636f6c496e697469616c697a65722047454e455349535f42454c4f575f4d494e494d414c4865726d657a41756374696f6e50726f746f636f6c3a3a736574436f6f7264696e61746f723a204e4f545f56414c49445f55524c4865726d657a41756374696f6e50726f746f636f6c3a3a736574536c6f74446561646c696e653a20475245415445525f5448414e5f424c4f434b535f5045525f534c4f544865726d657a41756374696f6e50726f746f636f6c3a3a63616e466f7267652041554354494f4e5f4e4f545f535441525445444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a204e4f545f454e4f5547485f42414c414e43454865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a2041554354494f4e5f4e4f545f4f50454e4865726d657a41756374696f6e50726f746f636f6c3a3a636c61696d48455a3a204e4f545f454e4f5547485f42414c414e4345536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774865726d657a41756374696f6e50726f746f636f6c3a3a666f7267653a204f4e4c595f4845524d455a5f524f4c4c5550436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65644865726d657a41756374696f6e50726f746f636f6c3a3a6f6e6c79476f7665726e616e63653a204f4e4c595f474f5645524e414e43454865726d657a41756374696f6e50726f746f636f6c3a3a5f646f4269643a204249445f4d5553545f42455f4849474845524865726d657a41756374696f6e50726f746f636f6c3a3a666f7267653a2043414e4e4f545f464f5247454865726d657a41756374696f6e50726f746f636f6c3a3a636c61696d48455a3a20544f4b454e5f5452414e534645525f4641494c45444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c7469426964204e4f545f454e4f5547485f42414c414e43454865726d657a41756374696f6e50726f746f636f6c3a3a736574446f6e6174696f6e416464726573733a204e4f545f56414c49445f414444524553534865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c74694269642041554354494f4e5f4e4f545f4f50454e4865726d657a41756374696f6e50726f746f636f6c3a3a5f7065726d69743a205350454e4445525f4e4f545f455155414c5f544849534865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734269643a2041554354494f4e5f434c4f5345444865726d657a41756374696f6e50726f746f636f6c3a3a70726f636573734d756c746942696420434f4f5244494e41544f525f4e4f545f524547495354455245444865726d657a41756374696f6e50726f746f636f6c3a3a5f7065726d69743a204e4f545f56414c49445f43414c4c4865726d657a41756374696f6e50726f746f636f6c3a3a63616e466f7267652057524f4e475f424c4f434b4e554d4245524865726d657a41756374696f6e50726f746f636f6c3a3a5f7065726d69743a204f574e45525f4e4f545f455155414c5f53454e444552a264697066735822122099dc77f293169f6c7f77ab0963f14bf47bdcb61ac21c151039d31955849cbc3964736f6c634300060c0033" - -// DeployHermezAuctionProtocol deploys a new Ethereum contract, binding an instance of HermezAuctionProtocol to it. -func DeployHermezAuctionProtocol(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *HermezAuctionProtocol, error) { - parsed, err := abi.JSON(strings.NewReader(HermezAuctionProtocolABI)) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezAuctionProtocolBin), backend) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - return address, tx, &HermezAuctionProtocol{HermezAuctionProtocolCaller: HermezAuctionProtocolCaller{contract: contract}, HermezAuctionProtocolTransactor: HermezAuctionProtocolTransactor{contract: contract}, HermezAuctionProtocolFilterer: HermezAuctionProtocolFilterer{contract: contract}}, nil -} +const HermezAuctionProtocolABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"HEZClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"donationAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"bootCoordinatorAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"bootCoordinatorURL\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"outbidding\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"slotDeadline\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"closedAuctionSlots\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"openAuctionSlots\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16[3]\",\"name\":\"allocationRatio\",\"type\":\"uint16[3]\"}],\"name\":\"InitializeHermezAuctionProtocolEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16[3]\",\"name\":\"newAllocationRatio\",\"type\":\"uint16[3]\"}],\"name\":\"NewAllocationRatio\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"}],\"name\":\"NewBid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBootCoordinator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newBootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"NewBootCoordinator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newClosedAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"NewClosedAuctionSlots\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"slotSet\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"newInitialMinBid\",\"type\":\"uint128\"}],\"name\":\"NewDefaultSlotSetBid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newDonationAddress\",\"type\":\"address\"}],\"name\":\"NewDonationAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slotToForge\",\"type\":\"uint128\"}],\"name\":\"NewForge\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint128\",\"name\":\"slotToForge\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"burnAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"donationAmount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"governanceAmount\",\"type\":\"uint128\"}],\"name\":\"NewForgeAllocated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newOpenAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"NewOpenAuctionSlots\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newOutbidding\",\"type\":\"uint16\"}],\"name\":\"NewOutbidding\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"newSlotDeadline\",\"type\":\"uint8\"}],\"name\":\"NewSlotDeadline\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"name\":\"SetCoordinator\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_SLOT\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"INITIAL_MINIMAL_BIDDING\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bootCoordinatorURL\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"canForge\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slotSet\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"newInitialMinBid\",\"type\":\"uint128\"}],\"name\":\"changeDefaultSlotSetBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimHEZ\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"claimPendingHEZ\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"coordinators\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"}],\"name\":\"forge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"genesisBlock\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllocationRatio\",\"outputs\":[{\"internalType\":\"uint16[3]\",\"name\":\"\",\"type\":\"uint16[3]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBootCoordinator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"}],\"name\":\"getClaimableHEZ\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClosedAuctionSlots\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCurrentSlotNumber\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"slotSet\",\"type\":\"uint8\"}],\"name\":\"getDefaultSlotSetBid\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDonationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"getMinBidBySlot\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOpenAuctionSlots\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOutbidding\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSlotDeadline\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"blockNumber\",\"type\":\"uint128\"}],\"name\":\"getSlotNumber\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"}],\"name\":\"getSlotSet\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"genesis\",\"type\":\"uint128\"},{\"internalType\":\"address\",\"name\":\"hermezRollupAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_governanceAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"donationAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bootCoordinatorAddress\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_bootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"hermezAuctionProtocolInitializer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezRollup\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"pendingBalances\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"slot\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"processBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"startingSlot\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"endingSlot\",\"type\":\"uint128\"},{\"internalType\":\"bool[6]\",\"name\":\"slotSets\",\"type\":\"bool[6]\"},{\"internalType\":\"uint128\",\"name\":\"maxBid\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"minBid\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"processMultiBid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16[3]\",\"name\":\"newAllocationRatio\",\"type\":\"uint16[3]\"}],\"name\":\"setAllocationRatio\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBootCoordinator\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"newBootCoordinatorURL\",\"type\":\"string\"}],\"name\":\"setBootCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newClosedAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"setClosedAuctionSlots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forger\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"coordinatorURL\",\"type\":\"string\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newDonationAddress\",\"type\":\"address\"}],\"name\":\"setDonationAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newOpenAuctionSlots\",\"type\":\"uint16\"}],\"name\":\"setOpenAuctionSlots\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"newOutbidding\",\"type\":\"uint16\"}],\"name\":\"setOutbidding\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newDeadline\",\"type\":\"uint8\"}],\"name\":\"setSlotDeadline\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"name\":\"slots\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"bidder\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fulfilled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"forgerCommitment\",\"type\":\"bool\"},{\"internalType\":\"uint128\",\"name\":\"bidAmount\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"closedMinBid\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenHEZ\",\"outputs\":[{\"internalType\":\"contractIHEZToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" // HermezAuctionProtocol is an auto generated Go binding around an Ethereum contract. type HermezAuctionProtocol struct { @@ -155,7 +138,7 @@ func bindHermezAuctionProtocol(address common.Address, caller bind.ContractCalle // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_HermezAuctionProtocol *HermezAuctionProtocolRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_HermezAuctionProtocol *HermezAuctionProtocolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _HermezAuctionProtocol.Contract.HermezAuctionProtocolCaller.contract.Call(opts, result, method, params...) } @@ -174,7 +157,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolRaw) Transact(opts *bind.Tran // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_HermezAuctionProtocol *HermezAuctionProtocolCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_HermezAuctionProtocol *HermezAuctionProtocolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _HermezAuctionProtocol.Contract.contract.Call(opts, result, method, params...) } @@ -193,12 +176,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolTransactorRaw) Transact(opts // // Solidity: function BLOCKS_PER_SLOT() view returns(uint8) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) BLOCKSPERSLOT(opts *bind.CallOpts) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "BLOCKS_PER_SLOT") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "BLOCKS_PER_SLOT") + + if err != nil { + return *new(uint8), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, tracerr.Wrap(err) + } // BLOCKSPERSLOT is a free data retrieval call binding the contract method 0x2243de47. @@ -219,12 +207,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) BLOCKSPERSLOT( // // Solidity: function INITIAL_MINIMAL_BIDDING() view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) INITIALMINIMALBIDDING(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "INITIAL_MINIMAL_BIDDING") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "INITIAL_MINIMAL_BIDDING") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // INITIALMINIMALBIDDING is a free data retrieval call binding the contract method 0xe6065914. @@ -245,12 +238,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) INITIALMINIMAL // // Solidity: function bootCoordinatorURL() view returns(string) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) BootCoordinatorURL(opts *bind.CallOpts) (string, error) { - var ( - ret0 = new(string) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "bootCoordinatorURL") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "bootCoordinatorURL") + + if err != nil { + return *new(string), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, tracerr.Wrap(err) + } // BootCoordinatorURL is a free data retrieval call binding the contract method 0x72ca58a3. @@ -271,12 +269,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) BootCoordinato // // Solidity: function canForge(address forger, uint256 blockNumber) view returns(bool) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) CanForge(opts *bind.CallOpts, forger common.Address, blockNumber *big.Int) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "canForge", forger, blockNumber) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "canForge", forger, blockNumber) + + if err != nil { + return *new(bool), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, tracerr.Wrap(err) + } // CanForge is a free data retrieval call binding the contract method 0x83b1f6a0. @@ -300,13 +303,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) Coordinators(opts *bi Forger common.Address CoordinatorURL string }, error) { - ret := new(struct { + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "coordinators", arg0) + + outstruct := new(struct { Forger common.Address CoordinatorURL string }) - out := ret - err := _HermezAuctionProtocol.contract.Call(opts, out, "coordinators", arg0) - return *ret, tracerr.Wrap(err) + + outstruct.Forger = out[0].(common.Address) + outstruct.CoordinatorURL = out[1].(string) + + return *outstruct, tracerr.Wrap(err) + } // Coordinators is a free data retrieval call binding the contract method 0xa48af096. @@ -333,12 +342,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) Coordinators(a // // Solidity: function genesisBlock() view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GenesisBlock(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "genesisBlock") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "genesisBlock") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GenesisBlock is a free data retrieval call binding the contract method 0x4cdc9c63. @@ -359,12 +373,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GenesisBlock() // // Solidity: function getAllocationRatio() view returns(uint16[3]) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetAllocationRatio(opts *bind.CallOpts) ([3]uint16, error) { - var ( - ret0 = new([3]uint16) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getAllocationRatio") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getAllocationRatio") + + if err != nil { + return *new([3]uint16), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([3]uint16)).(*[3]uint16) + + return out0, tracerr.Wrap(err) + } // GetAllocationRatio is a free data retrieval call binding the contract method 0xec29159b. @@ -385,12 +404,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetAllocationR // // Solidity: function getBootCoordinator() view returns(address) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetBootCoordinator(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getBootCoordinator") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getBootCoordinator") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // GetBootCoordinator is a free data retrieval call binding the contract method 0xb5f7f2f0. @@ -411,12 +435,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetBootCoordin // // Solidity: function getClaimableHEZ(address bidder) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetClaimableHEZ(opts *bind.CallOpts, bidder common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getClaimableHEZ", bidder) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getClaimableHEZ", bidder) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetClaimableHEZ is a free data retrieval call binding the contract method 0x5cca4903. @@ -437,12 +466,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetClaimableHE // // Solidity: function getClosedAuctionSlots() view returns(uint16) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetClosedAuctionSlots(opts *bind.CallOpts) (uint16, error) { - var ( - ret0 = new(uint16) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getClosedAuctionSlots") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getClosedAuctionSlots") + + if err != nil { + return *new(uint16), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, tracerr.Wrap(err) + } // GetClosedAuctionSlots is a free data retrieval call binding the contract method 0x4da9639d. @@ -463,12 +497,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetClosedAucti // // Solidity: function getCurrentSlotNumber() view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetCurrentSlotNumber(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getCurrentSlotNumber") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getCurrentSlotNumber") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetCurrentSlotNumber is a free data retrieval call binding the contract method 0x0c4da4f6. @@ -489,12 +528,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetCurrentSlot // // Solidity: function getDefaultSlotSetBid(uint8 slotSet) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetDefaultSlotSetBid(opts *bind.CallOpts, slotSet uint8) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getDefaultSlotSetBid", slotSet) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getDefaultSlotSetBid", slotSet) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetDefaultSlotSetBid is a free data retrieval call binding the contract method 0x564e6a71. @@ -515,12 +559,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetDefaultSlot // // Solidity: function getDonationAddress() view returns(address) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetDonationAddress(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getDonationAddress") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getDonationAddress") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // GetDonationAddress is a free data retrieval call binding the contract method 0x54c03ab7. @@ -541,12 +590,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetDonationAdd // // Solidity: function getMinBidBySlot(uint128 slot) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetMinBidBySlot(opts *bind.CallOpts, slot *big.Int) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getMinBidBySlot", slot) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getMinBidBySlot", slot) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetMinBidBySlot is a free data retrieval call binding the contract method 0x37d1bd0b. @@ -567,12 +621,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetMinBidBySlo // // Solidity: function getOpenAuctionSlots() view returns(uint16) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetOpenAuctionSlots(opts *bind.CallOpts) (uint16, error) { - var ( - ret0 = new(uint16) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getOpenAuctionSlots") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getOpenAuctionSlots") + + if err != nil { + return *new(uint16), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, tracerr.Wrap(err) + } // GetOpenAuctionSlots is a free data retrieval call binding the contract method 0xac4b9012. @@ -593,12 +652,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetOpenAuction // // Solidity: function getOutbidding() view returns(uint16) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetOutbidding(opts *bind.CallOpts) (uint16, error) { - var ( - ret0 = new(uint16) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getOutbidding") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getOutbidding") + + if err != nil { + return *new(uint16), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16) + + return out0, tracerr.Wrap(err) + } // GetOutbidding is a free data retrieval call binding the contract method 0x55b442e6. @@ -619,12 +683,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetOutbidding( // // Solidity: function getSlotDeadline() view returns(uint8) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotDeadline(opts *bind.CallOpts) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotDeadline") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getSlotDeadline") + + if err != nil { + return *new(uint8), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, tracerr.Wrap(err) + } // GetSlotDeadline is a free data retrieval call binding the contract method 0x13de9af2. @@ -645,12 +714,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetSlotDeadlin // // Solidity: function getSlotNumber(uint128 blockNumber) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotNumber(opts *bind.CallOpts, blockNumber *big.Int) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotNumber", blockNumber) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getSlotNumber", blockNumber) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetSlotNumber is a free data retrieval call binding the contract method 0xb3dc7bb1. @@ -671,12 +745,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetSlotNumber( // // Solidity: function getSlotSet(uint128 slot) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotSet(opts *bind.CallOpts, slot *big.Int) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotSet", slot) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "getSlotSet", slot) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetSlotSet is a free data retrieval call binding the contract method 0xac5f658b. @@ -697,12 +776,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GetSlotSet(slo // // Solidity: function governanceAddress() view returns(address) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GovernanceAddress(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "governanceAddress") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "governanceAddress") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // GovernanceAddress is a free data retrieval call binding the contract method 0x795053d3. @@ -723,12 +807,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) GovernanceAddr // // Solidity: function hermezRollup() view returns(address) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) HermezRollup(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "hermezRollup") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "hermezRollup") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // HermezRollup is a free data retrieval call binding the contract method 0xaebd6d98. @@ -749,12 +838,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) HermezRollup() // // Solidity: function pendingBalances(address ) view returns(uint128) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) PendingBalances(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "pendingBalances", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "pendingBalances", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // PendingBalances is a free data retrieval call binding the contract method 0xecdae41b. @@ -781,16 +875,25 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) Slots(opts *bind.Call BidAmount *big.Int ClosedMinBid *big.Int }, error) { - ret := new(struct { + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "slots", arg0) + + outstruct := new(struct { Bidder common.Address Fulfilled bool ForgerCommitment bool BidAmount *big.Int ClosedMinBid *big.Int }) - out := ret - err := _HermezAuctionProtocol.contract.Call(opts, out, "slots", arg0) - return *ret, tracerr.Wrap(err) + + outstruct.Bidder = out[0].(common.Address) + outstruct.Fulfilled = out[1].(bool) + outstruct.ForgerCommitment = out[2].(bool) + outstruct.BidAmount = out[3].(*big.Int) + outstruct.ClosedMinBid = out[4].(*big.Int) + + return *outstruct, tracerr.Wrap(err) + } // Slots is a free data retrieval call binding the contract method 0xbc415567. @@ -823,12 +926,17 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCallerSession) Slots(arg0 *bi // // Solidity: function tokenHEZ() view returns(address) func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) TokenHEZ(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _HermezAuctionProtocol.contract.Call(opts, out, "tokenHEZ") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HermezAuctionProtocol.contract.Call(opts, &out, "tokenHEZ") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3. @@ -1301,6 +1409,148 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseHEZClaimed(log if err := _HermezAuctionProtocol.contract.UnpackLog(event, "HEZClaimed", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log + return event, nil +} + +// HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator is returned from FilterInitializeHermezAuctionProtocolEvent and is used to iterate over the raw logs and unpacked data for InitializeHermezAuctionProtocolEvent events raised by the HermezAuctionProtocol contract. +type HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator struct { + Event *HermezAuctionProtocolInitializeHermezAuctionProtocolEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(HermezAuctionProtocolInitializeHermezAuctionProtocolEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(HermezAuctionProtocolInitializeHermezAuctionProtocolEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// HermezAuctionProtocolInitializeHermezAuctionProtocolEvent represents a InitializeHermezAuctionProtocolEvent event raised by the HermezAuctionProtocol contract. +type HermezAuctionProtocolInitializeHermezAuctionProtocolEvent struct { + DonationAddress common.Address + BootCoordinatorAddress common.Address + BootCoordinatorURL string + Outbidding uint16 + SlotDeadline uint8 + ClosedAuctionSlots uint16 + OpenAuctionSlots uint16 + AllocationRatio [3]uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitializeHermezAuctionProtocolEvent is a free log retrieval operation binding the contract event 0x9717e4e04c13817c600463a7a450110c754fd78758cdd538603f30528a24ce4b. +// +// Solidity: event InitializeHermezAuctionProtocolEvent(address donationAddress, address bootCoordinatorAddress, string bootCoordinatorURL, uint16 outbidding, uint8 slotDeadline, uint16 closedAuctionSlots, uint16 openAuctionSlots, uint16[3] allocationRatio) +func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterInitializeHermezAuctionProtocolEvent(opts *bind.FilterOpts) (*HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator, error) { + + logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "InitializeHermezAuctionProtocolEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return &HermezAuctionProtocolInitializeHermezAuctionProtocolEventIterator{contract: _HermezAuctionProtocol.contract, event: "InitializeHermezAuctionProtocolEvent", logs: logs, sub: sub}, nil +} + +// WatchInitializeHermezAuctionProtocolEvent is a free log subscription operation binding the contract event 0x9717e4e04c13817c600463a7a450110c754fd78758cdd538603f30528a24ce4b. +// +// Solidity: event InitializeHermezAuctionProtocolEvent(address donationAddress, address bootCoordinatorAddress, string bootCoordinatorURL, uint16 outbidding, uint8 slotDeadline, uint16 closedAuctionSlots, uint16 openAuctionSlots, uint16[3] allocationRatio) +func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchInitializeHermezAuctionProtocolEvent(opts *bind.WatchOpts, sink chan<- *HermezAuctionProtocolInitializeHermezAuctionProtocolEvent) (event.Subscription, error) { + + logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "InitializeHermezAuctionProtocolEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(HermezAuctionProtocolInitializeHermezAuctionProtocolEvent) + if err := _HermezAuctionProtocol.contract.UnpackLog(event, "InitializeHermezAuctionProtocolEvent", log); err != nil { + return tracerr.Wrap(err) + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitializeHermezAuctionProtocolEvent is a log parse operation binding the contract event 0x9717e4e04c13817c600463a7a450110c754fd78758cdd538603f30528a24ce4b. +// +// Solidity: event InitializeHermezAuctionProtocolEvent(address donationAddress, address bootCoordinatorAddress, string bootCoordinatorURL, uint16 outbidding, uint8 slotDeadline, uint16 closedAuctionSlots, uint16 openAuctionSlots, uint16[3] allocationRatio) +func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseInitializeHermezAuctionProtocolEvent(log types.Log) (*HermezAuctionProtocolInitializeHermezAuctionProtocolEvent, error) { + event := new(HermezAuctionProtocolInitializeHermezAuctionProtocolEvent) + if err := _HermezAuctionProtocol.contract.UnpackLog(event, "InitializeHermezAuctionProtocolEvent", log); err != nil { + return nil, tracerr.Wrap(err) + } + event.Raw = log return event, nil } @@ -1434,6 +1684,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewAllocationR if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewAllocationRatio", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1589,6 +1840,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBid(log typ if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBid", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1733,6 +1985,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBootCoordin if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBootCoordinator", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1866,6 +2119,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewClosedAucti if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewClosedAuctionSlots", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2000,6 +2254,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDefaultSlot if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDefaultSlotSetBid", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2143,6 +2398,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDonationAdd if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDonationAddress", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2295,6 +2551,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForge(log t if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForge", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2459,6 +2716,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForgeAlloca if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForgeAllocated", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2592,6 +2850,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOpenAuction if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOpenAuctionSlots", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2725,6 +2984,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOutbidding( if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOutbidding", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2858,6 +3118,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewSlotDeadlin if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewSlotDeadline", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -3011,5 +3272,6 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseSetCoordinator if err := _HermezAuctionProtocol.contract.UnpackLog(event, "SetCoordinator", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } diff --git a/eth/contracts/hermez/Hermez.go b/eth/contracts/hermez/Hermez.go index 722c202..beb3bf3 100644 --- a/eth/contracts/hermez/Hermez.go +++ b/eth/contracts/hermez/Hermez.go @@ -28,24 +28,7 @@ var ( ) // HermezABI is the input ABI used to generate the binding from. -const HermezABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"}],\"name\":\"AddToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"batchNum\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"l1UserTxsLen\",\"type\":\"uint16\"}],\"name\":\"ForgeBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"queueIndex\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"position\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"l1UserTx\",\"type\":\"bytes\"}],\"name\":\"L1UserTxEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"SafeMode\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"numBucket\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockStamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawals\",\"type\":\"uint256\"}],\"name\":\"UpdateBucketWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[4][5]\",\"name\":\"arrayBuckets\",\"type\":\"uint256[4][5]\"}],\"name\":\"UpdateBucketsParameters\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeAddToken\",\"type\":\"uint256\"}],\"name\":\"UpdateFeeAddToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"newForgeL1L2BatchTimeout\",\"type\":\"uint8\"}],\"name\":\"UpdateForgeL1L2BatchTimeout\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"addressArray\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"valueArray\",\"type\":\"uint64[]\"}],\"name\":\"UpdateTokenExchange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"UpdateWithdrawalDelay\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"WithdrawEvent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ABSOLUTE_MAX_L1L2BATCHTIMEOUT\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"babyPubKey\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"fromIdx\",\"type\":\"uint48\"},{\"internalType\":\"uint16\",\"name\":\"loadAmountF\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"amountF\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"toIdx\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"addL1Transaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"addToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"buckets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ceilUSD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockStamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdrawals\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockWithdrawalRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxWithdrawals\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"name\":\"exitNullifierMap\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"exitRootsMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeAddToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newLastIdx\",\"type\":\"uint48\"},{\"internalType\":\"uint256\",\"name\":\"newStRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newExitRoot\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"encodedL1CoordinatorTx\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"l1L2TxsData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feeIdxCoordinator\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"verifierIdx\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"l1Batch\",\"type\":\"bool\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofA\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"proofB\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofC\",\"type\":\"uint256[2]\"}],\"name\":\"forgeBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"forgeL1L2BatchTimeout\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezAuctionContract\",\"outputs\":[{\"internalType\":\"contractIHermezAuctionProtocol\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezGovernanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_verifiers\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_verifiersParams\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"_withdrawVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_hermezAuctionContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenHEZ\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"_forgeL1L2BatchTimeout\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"_feeAddToken\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_poseidon2Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poseidon3Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poseidon4Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_hermezGovernanceAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_withdrawalDelay\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_withdrawDelayerContract\",\"type\":\"address\"}],\"name\":\"initializeHermez\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"name\":\"instantWithdrawalViewer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastForgedBatch\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastIdx\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastL1L2Batch\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"mapL1TxQueue\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextL1FillingQueue\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextL1ToForgeQueue\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registerTokensCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rollupVerifiers\",\"outputs\":[{\"internalType\":\"contractVerifierRollupInterface\",\"name\":\"verifierInterface\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nLevels\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeMode\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"stateRootMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenExchange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenHEZ\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokenList\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[4][5]\",\"name\":\"arrayBuckets\",\"type\":\"uint256[4][5]\"}],\"name\":\"updateBucketsParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeAddToken\",\"type\":\"uint256\"}],\"name\":\"updateFeeAddToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newForgeL1L2BatchTimeout\",\"type\":\"uint8\"}],\"name\":\"updateForgeL1L2BatchTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"addressArray\",\"type\":\"address[]\"},{\"internalType\":\"uint64[]\",\"name\":\"valueArray\",\"type\":\"uint64[]\"}],\"name\":\"updateTokenExchange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"updateWithdrawalDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"proofA\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"proofB\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofC\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"withdrawCircuit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawDelayerContract\",\"outputs\":[{\"internalType\":\"contractIWithdrawalDelayer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint256\",\"name\":\"babyPubKey\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"internalType\":\"uint256[]\",\"name\":\"siblings\",\"type\":\"uint256[]\"},{\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"withdrawMerkleProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawVerifier\",\"outputs\":[{\"internalType\":\"contractVerifierWithdrawInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" - -// HermezBin is the compiled bytecode used for deploying new contracts. -var HermezBin = "0x608060405234801561001057600080fd5b5061576d806100206000396000f3fe6080604052600436106102195760003560e01c8063864eb16411610123578063a7ab6961116100ab578063d486645c1161006f578063d486645c14610c62578063d9d4ca4414610c92578063dc3e718e14610d79578063ef4a5c4a14610e1e578063f84f92ee14610e5157610219565b8063a7ab696114610be1578063abe3219c14610bf6578063bded9bb814610c0b578063cbd7b5fb14610c20578063d0f32e6714610c4d57610219565b80639ce2ad42116100f25780639ce2ad4214610af05780639e00d7ea14610b5d5780639ead722214610b8d5780639f34e9a314610bb7578063a327583814610bcc57610219565b8063864eb164146109ae578063886df587146109c357806395a09f2a14610a705780639b51fb0d14610a9b57610219565b806338330200116101a657806368e95e531161017557806368e95e53146107165780636e7e1365146107a757806370c2f1c0146108f957806379a135e31461098457806384ef9ed41461099957610219565b806338330200146104ed5780633ee641ea1461053f57806344e0b2ce1461056f578063599897e31461058457610219565b80631a748c2d116101ed5780631a748c2d146103115780631b0a8223146104435780632bd8362614610458578063314e5eda1461046d578063375110aa1461049757610219565b80624aca6e1461021e578063013f7852146102635780630dd94b96146102945780630ee8e52b146102e3575b600080fd5b34801561022a57600080fd5b506102516004803603602081101561024157600080fd5b50356001600160a01b0316610e8f565b60408051918252519081900360200190f35b34801561026f57600080fd5b50610278610ea1565b604080516001600160a01b039092168252519081900360200190f35b3480156102a057600080fd5b506102c7600480360360208110156102b757600080fd5b50356001600160a01b0316610eb0565b604080516001600160401b039092168252519081900360200190f35b3480156102ef57600080fd5b506102f8610ecb565b6040805163ffffffff9092168252519081900360200190f35b34801561031d57600080fd5b506104416004803603604081101561033457600080fd5b810190602081018135600160201b81111561034e57600080fd5b82018360208201111561036057600080fd5b803590602001918460208302840111600160201b8311171561038157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103d057600080fd5b8201836020820111156103e257600080fd5b803590602001918460208302840111600160201b8311171561040357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ede945050505050565b005b34801561044f57600080fd5b506102786110a1565b34801561046457600080fd5b506102786110b0565b34801561047957600080fd5b506104416004803603602081101561049057600080fd5b50356110bf565b3480156104a357600080fd5b506104d9600480360360408110156104ba57600080fd5b5080356001600160a01b031690602001356001600160c01b0316611143565b604080519115158252519081900360200190f35b3480156104f957600080fd5b506105176004803603602081101561051057600080fd5b50356111df565b604080516001600160a01b039094168452602084019290925282820152519081900360600190f35b34801561054b57600080fd5b506102516004803603602081101561056257600080fd5b503563ffffffff16611219565b34801561057b57600080fd5b506102f861122b565b34801561059057600080fd5b5061044160048036036101a08110156105a857600080fd5b810190602081018135600160201b8111156105c257600080fd5b8201836020820111156105d457600080fd5b803590602001918460208302840111600160201b831117156105f557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561064457600080fd5b82018360208201111561065657600080fd5b803590602001918460208302840111600160201b8311171561067757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550506001600160a01b03833581169450602084013581169360408101358216935060ff606082013516925060808101359160a082013581169160c081013582169160e08201358116916101008101358216916001600160401b03610120830135169161014001351661123e565b34801561072257600080fd5b50610441600480360361028081101561073a57600080fd5b6040805160a0810190915290820191906102808201908260056000835b828210156107985760408051608081810190925290808402860190600490839083908082843760009201919091525050508152600190910190602001610757565b50929550611436945050505050565b3480156107b357600080fd5b5061044160048036036102008110156107cb57600080fd5b65ffffffffffff8235169160208101359160408201359190810190608081016060820135600160201b81111561080057600080fd5b82018360208201111561081257600080fd5b803590602001918460018302840111600160201b8311171561083357600080fd5b919390929091602081019035600160201b81111561085057600080fd5b82018360208201111561086257600080fd5b803590602001918460018302840111600160201b8311171561088357600080fd5b919390929091602081019035600160201b8111156108a057600080fd5b8201836020820111156108b257600080fd5b803590602001918460018302840111600160201b831117156108d357600080fd5b919350915060ff813516906020810135151590604081019060808101906101000161162c565b34801561090557600080fd5b506104416004803603604081101561091c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561094657600080fd5b82018360208201111561095857600080fd5b803590602001918460018302840111600160201b8311171561097957600080fd5b509092509050611aaa565b34801561099057600080fd5b50610278611d21565b3480156109a557600080fd5b506102c7611d30565b3480156109ba57600080fd5b50610278611d3f565b610441600480360360e08110156109d957600080fd5b81359165ffffffffffff602082013581169261ffff604084013581169360608101359091169263ffffffff6080830135169260a0830135909116919081019060e0810160c0820135600160201b811115610a3257600080fd5b820183602082011115610a4457600080fd5b803590602001918460018302840111600160201b83111715610a6557600080fd5b509092509050611d4e565b348015610a7c57600080fd5b50610a85612064565b6040805160ff9092168252519081900360200190f35b348015610aa757600080fd5b50610ac560048036036020811015610abe57600080fd5b5035612069565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b348015610afc57600080fd5b5061044160048036036101a0811015610b1457600080fd5b506040810160c0820163ffffffff6101008401358116906001600160c01b0361012086013516906101408601351665ffffffffffff61016087013516610180870135151561209b565b348015610b6957600080fd5b5061025160048036036020811015610b8057600080fd5b503563ffffffff1661246e565b348015610b9957600080fd5b5061027860048036036020811015610bb057600080fd5b5035612480565b348015610bc357600080fd5b506102516124a7565b348015610bd857600080fd5b50610a856124ad565b348015610bed57600080fd5b506102c76124bd565b348015610c0257600080fd5b506104416124d3565b348015610c1757600080fd5b50610251612649565b348015610c2c57600080fd5b5061044160048036036020811015610c4357600080fd5b503560ff1661264f565b348015610c5957600080fd5b506102f861272f565b348015610c6e57600080fd5b50610c77612742565b6040805165ffffffffffff9092168252519081900360200190f35b348015610c9e57600080fd5b50610441600480360360e0811015610cb557600080fd5b63ffffffff82358116926001600160c01b0360208201351692604082013592606083013516919081019060a081016080820135600160201b811115610cf957600080fd5b820183602082011115610d0b57600080fd5b803590602001918460208302840111600160201b83111715610d2c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505065ffffffffffff83351693505050602001351515612757565b348015610d8557600080fd5b50610da960048036036020811015610d9c57600080fd5b503563ffffffff16612947565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610de3578181015183820152602001610dcb565b50505050905090810190601f168015610e105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610e2a57600080fd5b5061044160048036036020811015610e4157600080fd5b50356001600160401b03166129e2565b348015610e5d57600080fd5b506104d960048036036040811015610e7457600080fd5b50803563ffffffff16906020013565ffffffffffff16612ad7565b60586020526000908152604090205481565b604f546001600160a01b031681565b6051602052600090815260409020546001600160401b031681565b605c54600160601b900463ffffffff1681565b604f546001600160a01b03163314610f275760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b8051825114610f675760405162461bcd60e51b8152600401808060200182810382526041815260200180614e296041913960600191505060405180910390fd5b60005b8251811015610fe157818181518110610f7f57fe5b602002602001015160516000858481518110610f9757fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805467ffffffffffffffff19166001600160401b0392909216919091179055600101610f6a565b507f10ff643ebeca3e33002e61b76fa85e7e10091e30afa39295f91af9838b3033b38282604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015611049578181015183820152602001611031565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015611088578181015183820152602001611070565b5050505090500194505050505060405180910390a15050565b6050546001600160a01b031681565b605a546001600160a01b031681565b604f546001600160a01b031633146111085760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b60598190556040805182815290517fd1c873cd16013f0dc5f37992c0d12794389698512895ec036a568e393b46e3c19181900360200190a150565b6000806111508484612af7565b9050806111615760019150506111d9565b600061116c82612cad565b905060006036826005811061117d57fe5b60050201905060008160020154111561119c57600193505050506111d9565b60006111b5826001015443612d1e90919063ffffffff16565b905081600301548110156111d05760009450505050506111d9565b60019450505050505b92915050565b605281815481106111ec57fe5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116925083565b60556020526000908152604090205481565b605354600160d01b900463ffffffff1681565b600054610100900460ff16806112575750611257612d67565b80611265575060005460ff16155b6112a05760405162461bcd60e51b815260040180806020018281038252602e8152602001806152a3602e913960400191505060405180910390fd5b600054610100900460ff161580156112cb576000805460ff1961ff0019909116610100171660011790555b6112d58e8e612d6d565b8b605360006101000a8154816001600160a01b0302191690836001600160a01b031602179055508a605a60006101000a8154816001600160a01b0302191690836001600160a01b0316021790555089605d60006101000a8154816001600160a01b0302191690836001600160a01b0316021790555088605c60106101000a81548160ff021916908360ff1602179055508760598190555060ff605360146101000a81548165ffffffffffff021916908365ffffffffffff1602179055506001605c600c6101000a81548163ffffffff021916908363ffffffff160217905550605760009080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b03160217905550611409878787612e3e565b611414848484612f20565b8015611426576000805461ff00191690555b5050505050505050505050505050565b604f546001600160a01b0316331461147f5760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b60005b60058110156115ac57600082826005811061149957fe5b602002015151905060008383600581106114af57fe5b602002015160016020020151905060008484600581106114cb57fe5b602002015160400151905060008585600581106114e457fe5b60200201516060015190508083111561152e5760405162461bcd60e51b815260040180806020018281038252605d81526020018061556d605d913960600191505060405180910390fd5b6040518060a00160405280858152602001438152602001848152602001838152602001828152506036866005811061156257fe5b600502016000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040155905050505050508080600101915050611482565b507f3c39a1e91c69d4cfeacb11190befc2b1c983746e6b21ab2441a3051de88d448081604051808260056000925b8184101561161a5760208402830151608080838360005b838110156116095781810151838201526020016115f1565b5050505090500192600101926115da565b9250505091505060405180910390a150565b33321461166a5760405162461bcd60e51b815260040180806020018281038252602a81526020018061508f602a913960400191505060405180910390fd5b605a546040805163041d8fb560e51b815233600482015243602482015290516001600160a01b03909216916383b1f6a091604480820192602092909190829003018186803b1580156116bb57600080fd5b505afa1580156116cf573d6000803e3d6000fd5b505050506040513d60208110156116e557600080fd5b505115156001146117275760405162461bcd60e51b8152600401808060200182810382526022815260200180614fbf6022913960400191505060405180910390fd5b8361178357605c54600160801b810460ff166001600160401b03918216011643106117835760405162461bcd60e51b81526004018080602001828103825260268152602001806154226026913960400191505060405180910390fd5b60006117928f8f8f888a613015565b905060528660ff16815481106117a457fe5b60009182526020918290206003909102015460408051928301815283835280516343753b4d60e01b81526001600160a01b03909216926343753b4d9288928892889290916004909101908190869080828437600083820152601f01601f1916909101905084608080828437600083820152601f01601f1916909101905083604080828437600081840152601f19601f82011690508083019250505082600160200280838360005b8381101561186357818101518382015260200161184b565b5050505090500194505050505060206040518083038186803b15801561188857600080fd5b505afa15801561189c573d6000803e3d6000fd5b505050506040513d60208110156118b257600080fd5b50516118ef5760405162461bcd60e51b8152600401808060200182810382526021815260200180614ea66021913960400191505060405180910390fd5b6053601a81819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550508e605360146101000a81548165ffffffffffff021916908365ffffffffffff1602179055508d605460006053601a9054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001908152602001600020819055508c605560006053601a9054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002081905550600085156119ea57605c805467ffffffffffffffff1916436001600160401b03161790556119e76132ef565b90505b605a54604080516309cb4a2f60e31b815233600482015290516001600160a01b0390921691634e5a51789160248082019260009290919082900301818387803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b50506053546040805161ffff861681529051600160d01b90920463ffffffff1693507fe00040c8a3b0bf905636c26924e90520eafc5003324138236fddee2d3458861892506020908290030190a250505050505050505050505050505050565b605754600160201b8110611aef5760405162461bcd60e51b81526004018080602001828103825260218152602001806150b96021913960400191505060405180910390fd5b6001600160a01b038416611b345760405162461bcd60e51b815260040180806020018281038252602381526020018061506c6023913960400191505060405180910390fd5b6001600160a01b03841660009081526058602052604090205415611b9f576040805162461bcd60e51b815260206004820152601f60248201527f4865726d657a3a3a616464546f6b656e3a20414c52454144595f414444454400604482015290519081900360640190fd5b6000846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611bda57600080fd5b505afa158015611bee573d6000803e3d6000fd5b505050506040513d6020811015611c0457600080fd5b505111611c425760405162461bcd60e51b81526004018080602001828103825260238152602001806154dd6023913960400191505060405180910390fd5b8115611c6357605d54605954611c63916001600160a01b03169085856133ac565b605d54604f54605954611c86926001600160a01b03908116923392911690613675565b60578054600181019091557fe8e5595d268aaa85b36c3557e9d96c14a4fffaee9f45bcae0c407968a71096300180546001600160a01b0319166001600160a01b038616908117909155600081815260586020908152604091829020849055815163ffffffff8516815291517fcb73d161edb7cd4fb1d92fedfd2555384fd997fd44ab507656f8c81e15747dde9281900390910190a250505050565b605d546001600160a01b031681565b605c546001600160401b031681565b6053546001600160a01b031681565b60575463ffffffff851610611d945760405162461bcd60e51b815260040180806020018281038252602e815260200180615448602e913960400191505060405180910390fd5b6000611d9f876137d2565b9050600160801b8110611de35760405162461bcd60e51b8152600401808060200182810382526031815260200180614ec76031913960400191505060405180910390fd5b801561204a5763ffffffff8516611e3757348114611e325760405162461bcd60e51b81526004018080602001828103825260378152602001806157016037913960400191505060405180910390fd5b61204a565b3415611e745760405162461bcd60e51b815260040180806020018281038252602f815260200180615157602f913960400191505060405180910390fd5b8115611ead57611ead60578663ffffffff1681548110611e9057fe5b6000918252602090912001546001600160a01b03168285856133ac565b600060578663ffffffff1681548110611ec257fe5b60009182526020918290200154604080516370a0823160e01b815230600482015290516001600160a01b03909216926370a0823192602480840193829003018186803b158015611f1157600080fd5b505afa158015611f25573d6000803e3d6000fd5b505050506040513d6020811015611f3b57600080fd5b505160578054919250611f759163ffffffff8916908110611f5857fe5b6000918252602090912001546001600160a01b0316333085613675565b600060578763ffffffff1681548110611f8a57fe5b60009182526020918290200154604080516370a0823160e01b815230600482015290516001600160a01b03909216926370a0823192602480840193829003018186803b158015611fd957600080fd5b505afa158015611fed573d6000803e3d6000fd5b505050506040513d602081101561200357600080fd5b5051905081810383146120475760405162461bcd60e51b81526004018080602001828103825260398152602001806155f46039913960400191505060405180910390fd5b50505b612059338a8a8a8a8a8a613816565b505050505050505050565b60f081565b6036816005811061207657fe5b6005020180546001820154600283015460038401546004909401549294509092909185565b801561210d576120d260578663ffffffff16815481106120b757fe5b6000918252602090912001546001600160a01b031685613a7a565b61210d5760405162461bcd60e51b81526004018080602001828103825260438152602001806152d16043913960600191505060405180910390fd5b63ffffffff8316600090815260566020908152604080832065ffffffffffff8616845290915290205460ff16156121755760405162461bcd60e51b815260040180806020018281038252602e81526020018061524b602e913960400191505060405180910390fd5b63ffffffff831660009081526055602090815260408083205481518084018290523360601b818401526001600160e01b031960e08b901b16605482015267ffffffffffffffff1989841b1660588201526001600160d01b031960d088901b1660708201528251605681830301815260769091019283905280519194937f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019360029390918291908401908083835b602083106122415780518252601f199092019160209182019101612222565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa158015612280573d6000803e3d6000fd5b5050506040513d602081101561229557600080fd5b50518161229e57fe5b605354604080516020810182529390920680845282516343753b4d60e01b81529094506001600160a01b03909116926343753b4d928e928e928e929091600401908190869080828437600083820152601f01601f1916909101905084608080828437600083820152601f01601f1916909101905083604080828437600081840152601f19601f82011690508083019250505082600160200280838360005b8381101561235457818101518382015260200161233c565b5050505090500194505050505060206040518083038186803b15801561237957600080fd5b505afa15801561238d573d6000803e3d6000fd5b505050506040513d60208110156123a357600080fd5b505115156001146123e55760405162461bcd60e51b81526004018080602001828103825260298152602001806153a26029913960400191505060405180910390fd5b63ffffffff8516600090815260566020908152604080832065ffffffffffff881684529091529020805460ff19166001179055612423868885613c47565b8215158563ffffffff168565ffffffffffff167f69177d798b38e27bcc4e0338307e4f1490e12d1006729d0e6e9cc82a8732f41560405160405180910390a450505050505050505050565b60546020526000908152604090205481565b6057818154811061248d57fe5b6000918252602090912001546001600160a01b0316905081565b60575490565b605c54600160801b900460ff1681565b604f54600160a01b90046001600160401b031681565b604f546001600160a01b0316331461251c5760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b60005b60058110156125a7576040518060a001604052806000815260200160008152602001600081526020016000815260200160008152506036826005811061256157fe5b600502016000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040155905050808060010191505061251f565b50605054604f5460408051630e670af560e01b8152600160a01b9092046001600160401b03166004830152516001600160a01b0390921691630e670af59160248082019260009290919082900301818387803b15801561260657600080fd5b505af115801561261a573d6000803e3d6000fd5b50506040517f0410e6ef2bd89ecf5b2dc2f62157f9863e09e89cb7c7f1abb7d4ec43a6019d1e925060009150a1565b60595481565b604f546001600160a01b031633146126985760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b60f060ff821611156126db5760405162461bcd60e51b815260040180806020018281038252603c815260200180614e6a603c913960400191505060405180910390fd5b605c805460ff8316600160801b810260ff60801b199092169190911790915560408051918252517fff6221781ac525b04585dbb55cd2ebd2a92c828ca3e42b23813a1137ac9744319181900360200190a150565b605c54600160401b900463ffffffff1681565b605354600160a01b900465ffffffffffff1681565b80156127c95761278e60578863ffffffff168154811061277357fe5b6000918252602090912001546001600160a01b031687613a7a565b6127c95760405162461bcd60e51b81526004018080602001828103825260478152602001806151866047913960600191505060405180910390fd5b6127d1614ccb565b6127e8886000896001600160c01b03168933613dd7565b905060006127f582613e39565b63ffffffff87166000908152605560209081526040808320546056835281842065ffffffffffff8a168552909252909120549192509060ff161561286a5760405162461bcd60e51b81526004018080602001828103825260328152602001806151f86032913960400191505060405180910390fd5b61287e81878765ffffffffffff1685613ed6565b15156001146128be5760405162461bcd60e51b815260040180806020018281038252602e815260200180615476602e913960400191505060405180910390fd5b63ffffffff8716600090815260566020908152604080832065ffffffffffff891684529091529020805460ff191660011790556128fc898b86613c47565b8315158763ffffffff168665ffffffffffff167f69177d798b38e27bcc4e0338307e4f1490e12d1006729d0e6e9cc82a8732f41560405160405180910390a450505050505050505050565b605b6020908152600091825260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156129da5780601f106129af576101008083540402835291602001916129da565b820191906000526020600020905b8154815290600101906020018083116129bd57829003601f168201915b505050505081565b604f546001600160a01b03163314612a2b5760405162461bcd60e51b815260040180806020018281038252603f81526020018061552e603f913960400191505060405180910390fd5b62127500816001600160401b03161115612a765760405162461bcd60e51b815260040180806020018281038252604a815260200180614fe1604a913960600191505060405180910390fd5b604f80546001600160401b038316600160a01b810267ffffffffffffffff60a01b199092169190911790915560408051918252517f9db302c4547a21fb20a3a794e5f63ee87eb6e4afc3325ebdadba2d1fb4a907379181900360200190a150565b605660209081526000928352604080842090915290825290205460ff1681565b6001600160a01b0382166000908152605160205260408120546001600160401b0316612b25575060006111d9565b6001600160a01b038316600090815260516020526040812054655af3107a4000906001600160401b03166001600160c01b0385160260408051600481526024810182526020810180516001600160e01b031663313ce56760e01b1781529151815194909304945060009384936060936001600160a01b038b1693928291908083835b60208310612bc65780518252601f199092019160209182019101612ba7565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114612c26576040519150601f19603f3d011682016040523d82523d6000602084013e612c2b565b606091505b50915091508115612c5057808060200190516020811015612c4b57600080fd5b505192505b604d8360ff1610612c925760405162461bcd60e51b815260040180806020018281038252603b815260200180614dae603b913960400191505060405180910390fd5b8260ff16600a0a8481612ca157fe5b04979650505050505050565b6000805b6005811015612ce15760368160058110612cc757fe5b60050201548311612cd9579050612d19565b600101612cb1565b5060405162461bcd60e51b81526004018080602001828103825260398152602001806154a46039913960400191505060405180910390fd5b919050565b6000612d6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613f5d565b9392505050565b303b1590565b60005b8251811015612e395760526040518060600160405280858481518110612d9257fe5b60200260200101516001600160a01b03168152602001600880868681518110612db757fe5b6020026020010151901b901c815260200160f8858581518110612dd657fe5b60209081029190910181015190911c909152825460018082018555600094855293829020835160039092020180546001600160a01b0319166001600160a01b03909216919091178155908201518184015560409091015160029091015501612d70565b505050565b600054610100900460ff1680612e575750612e57612d67565b80612e65575060005460ff16155b612ea05760405162461bcd60e51b815260040180806020018281038252602e8152602001806152a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612ecb576000805460ff1961ff0019909116610100171660011790555b603380546001600160a01b038087166001600160a01b0319928316179092556034805486841690831617905560358054928516929091169190911790558015612f1a576000805461ff00191690555b50505050565b600054610100900460ff1680612f395750612f39612d67565b80612f47575060005460ff16155b612f825760405162461bcd60e51b815260040180806020018281038252602e8152602001806152a3602e913960400191505060405180910390fd5b600054610100900460ff16158015612fad576000805460ff1961ff0019909116610100171660011790555b604f80546001600160a01b03199081166001600160a01b038781169190911767ffffffffffffffff60a01b1916600160a01b6001600160401b0388160217909255605080549091169184169190911790558015612f1a576000805461ff001916905550505050565b605354600160d01b810463ffffffff166000908152605460205260408120546052805492939192600160a01b90920465ffffffffffff16918491829182919060ff891690811061306157fe5b906000526020600020906003020160010154600860528960ff168154811061308557fe5b9060005260206000209060030201600201548161309e57fe5b046002026003010290506000600860528960ff16815481106130bc57fe5b906000526020600020906003020160020154816130d557fe5b604080519290910481028481018084016148b201909252614872909101825260d087811b60208401528e901b6026830152602c8201889052604c82018d9052606c82018c90529150608c810161312b818c613ff4565b61480001613139600461422b565b90965094508385111561317d5760405162461bcd60e51b815260040180806020018281038252602e815260200180615500602e913960400191505060405180910390fd5b84868237840161318f8186860361423f565b8484030161319d600561422b565b90965094508285146131e05760405162461bcd60e51b8152600401808060200182810382526040815260200180614de96040913960400191505060405180910390fd5b8486823784016131f28186850361423f565b848303810190504660f01b815260028101905060006053601a9054906101000a900463ffffffff1660010163ffffffff1690508060e01b82527f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000016002846040518082805190602001908083835b6020831061327e5780518252601f19909201916020918201910161325f565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa1580156132bd573d6000803e3d6000fd5b5050506040513d60208110156132d257600080fd5b5051816132db57fe5b069f9e505050505050505050505050505050565b605c54600160401b900463ffffffff166000908152605b60205260408120805460486002610100600184161502600019019092169190910404906133339083614ce9565b605c8054600163ffffffff600160401b808404821692909201811682026bffffffff000000000000000019909316929092179283905582048116600160601b9092041614156133a757605c8054600163ffffffff600160601b808404821692909201160263ffffffff60601b199091161790555b905090565b6000828260208110156133be57600080fd5b50356001600160e01b031916905063d505accf60e01b81146134115760405162461bcd60e51b815260040180806020018281038252602e8152602001806156aa602e913960400191505060405180910390fd5b6000808080808080613426896004818d614d85565b60e081101561343457600080fd5b506001600160a01b038135811698506020820135169650604081013595506060810135945060ff608082013516935060a0810135925060c0013590503387146134ae5760405162461bcd60e51b8152600401808060200182810382526030815260200180614f2c6030913960400191505060405180910390fd5b6001600160a01b03861630146134f55760405162461bcd60e51b81526004018080602001828103825260258152602001806151326025913960400191505060405180910390fd5b8a85146135335760405162461bcd60e51b815260040180806020018281038252602d8152602001806153f5602d913960400191505060405180910390fd5b8b6001600160a01b031663d505accf60e01b8888888888888860405160240180886001600160a01b03168152602001876001600160a01b031681526020018681526020018581526020018460ff168152602001838152602001828152602001975050505050505050604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050506040518082805190602001908083835b602083106135fd5780518252601f1990920191602091820191016135de565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461365f576040519150601f19603f3d011682016040523d82523d6000602084013e613664565b606091505b505050505050505050505050505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106136fa5780518252601f1990920191602091820191016136db565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461375c576040519150601f19603f3d011682016040523d82523d6000602084013e613761565b606091505b509150915081801561378f57508051158061378f575080806020019051602081101561378c57600080fd5b50515b6137ca5760405162461bcd60e51b8152600401808060200182810382526034815260200180614ef86034913960400191505060405180910390fd5b505050505050565b60006103ff8216601f600b84901c166001600a85811c8216919083900a90818502908314801561380157508315155b1561380c5760028204015b9695505050505050565b6000613821846137d2565b9050600160c01b81106138655760405162461bcd60e51b815260040180806020018281038252602e8152602001806150da602e913960400191505060405180910390fd5b65ffffffffffff82166138b45780156138af5760405162461bcd60e51b815260040180806020018281038252603b81526020018061566f603b913960400191505060405180910390fd5b61396e565b65ffffffffffff8216600114156139065761ffff8516156138af5760405162461bcd60e51b8152600401808060200182810382526037815260200180614f5c6037913960400191505060405180910390fd5b60ff65ffffffffffff8316118015613933575060535465ffffffffffff600160a01b909104811690831611155b61396e5760405162461bcd60e51b815260040180806020018281038252602881526020018061537a6028913960400191505060405180910390fd5b65ffffffffffff86166139bc57866139b75760405162461bcd60e51b815260040180806020018281038252604181526020018061502b6041913960600191505060405180910390fd5b613a61565b60ff65ffffffffffff87161180156139e9575060535465ffffffffffff600160a01b909104811690871611155b613a245760405162461bcd60e51b815260040180806020018281038252602a815260200180615108602a913960400191505060405180910390fd5b8615613a615760405162461bcd60e51b81526004018080602001828103825260428152602001806153146042913960600191505060405180910390fd5b613a7088888888888888614258565b5050505050505050565b600080613a878484612af7565b905080613a985760019150506111d9565b6000613aa382612cad565b9050600060368260058110613ab457fe5b6005020190506000613ad3826001015443612d1e90919063ffffffff16565b90508160030154811015613b6857600282015415613b5b57816004015482600201541415613b02574360018301555b600282018054600019019081905560018301546040805192835251909160ff8616917fa35fe9a9e21cdbbc4774aa8a56e7b97ea9c06afc09ffb06af593d26951e350aa9181900360200190a360019450505050506111d9565b60009450505050506111d9565b6000613b8183600301548361442490919063ffffffff16565b90508260040154613b9f82856002015461446690919063ffffffff16565b10613bc4576004830154613bb4906001612d1e565b6002840155436001840155613bf7565b60028301805482016000190190556003830154613bf190613be69083906144c0565b600185015490614466565b60018401555b60018301546002840154604080519182525160ff8716917fa35fe9a9e21cdbbc4774aa8a56e7b97ea9c06afc09ffb06af593d26951e350aa919081900360200190a36001955050505050506111d9565b8015613c8d57613c8860578363ffffffff1681548110613c6357fe5b6000918252602090912001546001600160a01b0316336001600160c01b038616614519565b612e39565b63ffffffff8216613d19576050546040805163cfc0b64160e01b81523360048201526000602482018190526001600160c01b0387166044830181905292516001600160a01b039094169363cfc0b6419392606480820193929182900301818588803b158015613cfb57600080fd5b505af1158015613d0f573d6000803e3d6000fd5b5050505050612e39565b600060578363ffffffff1681548110613d2e57fe5b6000918252602090912001546050546001600160a01b039182169250613d60918391166001600160c01b03871661476b565b6050546040805163cfc0b64160e01b81523360048201526001600160a01b0384811660248301526001600160c01b03881660448301529151919092169163cfc0b64191606480830192600092919082900301818387803b158015613dc357600080fd5b505af1158015613a70573d6000803e3d6000fd5b613ddf614ccb565b613de7614ccb565b63ffffffff96909616602095861b65ffff000000001617690100000000000000000060b785901c1617865250928401919091526001600160ff1b031660408301526001600160a01b0316606082015290565b60355460405163248f667760e01b81526000916001600160a01b03169063248f6677908490600401808260808083838a5b83811015613e82578181015183820152602001613e6a565b5050505090500191505060206040518083038186803b158015613ea457600080fd5b505afa158015613eb8573d6000803e3d6000fd5b505050506040513d6020811015613ece57600080fd5b505192915050565b600080613ee384846148b8565b8551909150600090600019015b60008112613f5057868181518110613f0457fe5b60200260200101519150600081876000821215613f1d57fe5b6001911c811614905080613f3a57613f3584846148e4565b613f44565b613f4483856148e4565b93505060001901613ef0565b5050909414949350505050565b60008184841115613fec5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613fb1578181015183820152602001613f99565b50505050905090810190601f168015613fde5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600080614001600361422b565b9092509050606581046000606085156140d157605c54600160401b900463ffffffff166000908152605b60209081526040918290208054835160026101006001841615026000190190921691909104601f81018490048402820184019094528381529290918301828280156140b75780601f1061408c576101008083540402835291602001916140b7565b820191906000526020600020905b81548152906001019060200180831161409a57829003601f168201915b5050505050905060488151816140c957fe5b0491506140d6565b600091505b61010083830111156141195760405162461bcd60e51b81526004018080602001828103825260248152602001806153566024913960400191505060405180910390fd5b8115614147576048820287019660208201905b8881101561414457815181526020918201910161412c565b50505b60005b8381101561420e576057546065870196803560001a916001820135916021810135916041820135916061013560e01c9081106141b75760405162461bcd60e51b815260040180806020018281038252602a815260200180615279602a913960400191505060405180910390fd5b6001600160a01b0360ff8616156141d7576141d483858789614901565b90505b60601b8d5260148d0191909152600060348d0181905260e09190911b603e8d015260428c015250506048909801975060010161414a565b50614222876048858561010003030261423f565b50505050505050565b602002600490810135602481019291013590565b808201915b82811015612e395760008152602001614244565b604080516bffffffffffffffffffffffff1960608a901b16602080830191909152603482018990526001600160d01b031960d089811b821660548501526001600160f01b031960f08a811b8216605a87015289901b16605c808601919091526001600160e01b031960e089901b16605e8601529086901b9091166062840152835160488185030181526068909301845254600160601b900463ffffffff166000908152605b9091529190912061430e9082614aa1565b605c54600160601b900463ffffffff166000818152605b602090815260408083205481518381528651818501528651604860026101006001861615026000190190941693909304929092049560ff87169590947fdd5c7c5ea02d3c5d1621513faa6de53d474ee6f111eda6352a63e3dfe8c401199489948493918401928601918190849084905b838110156143ad578181015183820152602001614395565b50505050905090810190601f1680156143da5780820380516001836020036101000a031916815260200191505b509250505060405180910390a36080811061205957605c8054600163ffffffff600160601b808404821692909201160263ffffffff60601b19909116179055505050505050505050565b6000612d6083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250614beb565b600082820183811015612d60576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826144cf575060006111d9565b828202828482816144dc57fe5b0414612d605760405162461bcd60e51b815260040180806020018281038252602181526020018061522a6021913960400191505060405180910390fd5b6001600160a01b0383166146175760408051600080825260208201909252339083906040518082805190602001908083835b6020831061456a5780518252601f19909201916020918201910161454b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146145cc576040519150601f19603f3d011682016040523d82523d6000602084013e6145d1565b606091505b50509050806146115760405162461bcd60e51b815260040180806020018281038252602a8152602001806153cb602a913960400191505060405180910390fd5b50612e39565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106146945780518252601f199092019160209182019101614675565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146146f6576040519150601f19603f3d011682016040523d82523d6000602084013e6146fb565b606091505b5091509150818015614729575080511580614729575080806020019051602081101561472657600080fd5b50515b6147645760405162461bcd60e51b815260040180806020018281038252602c815260200180614f93602c913960400191505060405180910390fd5b5050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b602083106147e85780518252601f1990920191602091820191016147c9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461484a576040519150601f19603f3d011682016040523d82523d6000602084013e61484f565b606091505b509150915081801561487d57508051158061487d575080806020019051602081101561487a57600080fd5b50515b6147645760405162461bcd60e51b815260040180806020018281038252602a8152602001806155ca602a913960400191505060405180910390fd5b60006148c2614d30565b83815260208101839052600160408201526148dc81614c50565b949350505050565b60006148ee614d4e565b838152602081018390526148dc81614c8d565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156149625760405162461bcd60e51b81526004018080602001828103825260298152602001806156d86029913960400191505060405180910390fd5b6000469050600086823060405160200180807f19457468657265756d205369676e6564204d6573736167653a0a313230000000815250601d018061562d604291396042018481526020018361ffff1660f01b8152600201826001600160a01b031660601b81526014019350505050604051602081830303815290604052805190602001209050600060018286898960405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015614a44573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116614a965760405162461bcd60e51b815260040180806020018281038252602b8152602001806151cd602b913960400191505060405180910390fd5b979650505050505050565b815460026001808316156101000203821604825180820160208110602084100160028114614b4b5760018114614b70578660005260208404602060002001600160028402018855602085068060200390508088018589016001836101000a0392508282511684540184556001840193506020820191505b80821015614b355781518455600184019350602082019150614b18565b815191036101000a908190040290915550614222565b60028302826020036101000a846020036101000a602089015104020185018755614222565b8660005260208404602060002001600160028402018855846020038088018589016001836101000a0392508282511660ff198a160184556020820191506001840193505b80821015614bd15781518455600184019350602082019150614bb4565b815191036101000a90819004029091555050505050505050565b60008183614c3a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315613fb1578181015183820152602001613f99565b506000838581614c4657fe5b0495945050505050565b6034546040516304b98e1d60e31b8152825160049091019081526000916001600160a01b0316906325cc70e8908490808260608083836020613e6a565b603354604080516314d2f97b60e11b8152835160049091019081526000926001600160a01b0316916329a5f2f6918591819083908083836020613e6a565b60405180608001604052806004906020820280368337509192915050565b50805460018160011615610100020316600290046000825580601f10614d0f5750614d2d565b601f016020900490600052602060002090810190614d2d9190614d6c565b50565b60405180606001604052806003906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b5b80821115614d815760008155600101614d6d565b5090565b60008085851115614d94578182fd5b83861115614da0578182fd5b505082019391909203915056fe496e7374616e7457697468647261774d616e616765723a3a5f746f6b656e325553443a20544f4b454e5f444543494d414c535f4f564552464c4f574865726d657a3a3a5f636f6e73747275637443697263756974496e7075743a20494e56414c49445f464545494458434f4f5244494e41544f525f4c454e475448496e7374616e7457697468647261774d616e616765723a3a757064617465546f6b656e45786368616e67653a20494e56414c49445f41525241595f4c454e4754484865726d657a3a3a757064617465466f7267654c314c32426174636854696d656f75743a204d41585f464f52474554494d454f55545f4558434545444865726d657a3a3a666f72676542617463683a20494e56414c49445f50524f4f464865726d657a3a3a6164644c315472616e73616374696f6e3a204c4f4144414d4f554e545f4558434545445f4c494d49544865726d657a3a3a5f736166655472616e7366657246726f6d3a2045524332305f5452414e5346455246524f4d5f4641494c45444865726d657a3a3a5f7065726d69743a205045524d49545f4f574e45525f4d5553545f42455f5448455f53454e4445524865726d657a3a3a5f6164644c315472616e73616374696f6e3a204c4f4144414d4f554e545f4d5553545f42455f305f49465f455849544865726d657a3a3a5f736166655472616e736665723a2045524332305f5452414e534645525f4641494c45444865726d657a3a3a666f72676542617463683a2041554354494f4e5f44454e494544496e7374616e7457697468647261774d616e616765723a3a7570646174655769746864726177616c44656c61793a204558434545445f4d41585f5749544844524157414c5f44454c41594865726d657a3a3a5f6164644c315472616e73616374696f6e3a20494e56414c49445f4352454154455f4143434f554e545f574954485f4e4f5f424142594a55424865726d657a3a3a616464546f6b656e3a20414444524553535f305f494e56414c49444865726d657a3a3a666f72676542617463683a20494e54454e414c5f54585f4e4f545f414c4c4f5745444865726d657a3a3a616464546f6b656e3a20544f4b454e5f4c4953545f46554c4c4865726d657a3a3a5f6164644c315472616e73616374696f6e3a20414d4f554e545f4558434545445f4c494d49544865726d657a3a3a5f6164644c315472616e73616374696f6e3a20494e56414c49445f46524f4d4944584865726d657a3a3a5f7065726d69743a205350454e4445525f4d5553545f42455f544849534865726d657a3a3a6164644c315472616e73616374696f6e3a204d53475f56414c55455f4e4f545f455155414c5f304865726d657a3a3a77697468647261774d65726b6c6550726f6f663a20494e5354414e545f57495448445241575f5741535445445f464f525f544849535f5553445f52414e47454865726d657a48656c706572733a3a5f636865636b5369673a20494e56414c49445f5349474e41545552454865726d657a3a3a77697468647261774d65726b6c6550726f6f663a2057495448445241575f414c52454144595f444f4e45536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774865726d657a3a3a7769746864726177436972637569743a2057495448445241575f414c52454144595f444f4e454865726d657a3a3a5f6275696c644c31446174613a20544f4b454e5f4e4f545f52454749535445524544436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65644865726d657a3a3a7769746864726177436972637569743a20494e5354414e545f57495448445241575f5741535445445f464f525f544849535f5553445f52414e47454865726d657a3a3a5f6164644c315472616e73616374696f6e3a20424142594a55425f4d5553545f42455f305f49465f4e4f545f4352454154455f4143434f554e544865726d657a3a3a5f6275696c644c31446174613a204c315f54585f4f564552464c4f574865726d657a3a3a5f6164644c315472616e73616374696f6e3a20494e56414c49445f544f4944584865726d657a3a3a7769746864726177436972637569743a20494e56414c49445f5a4b5f50524f4f464865726d657a3a3a5f736166655472616e736665723a204554485f5452414e534645525f4641494c45444865726d657a3a3a5f7065726d69743a205045524d49545f414d4f554e545f444f45535f4e4f545f4d415443484865726d657a3a3a666f72676542617463683a204c314c3242415443485f52455155495245444865726d657a3a3a6164644c315472616e73616374696f6e3a20544f4b454e5f4e4f545f524547495354455245444865726d657a3a3a77697468647261774d65726b6c6550726f6f663a20534d545f50524f4f465f494e56414c4944496e7374616e7457697468647261774d616e616765723a3a5f66696e644275636b65744964783a204558434545445f4d41585f414d4f554e544865726d657a3a3a616464546f6b656e3a20544f54414c5f535550504c595f5a45524f4865726d657a3a3a5f636f6e73747275637443697263756974496e7075743a204c325f54585f4f564552464c4f57496e7374616e7457697468647261774d616e616765723a3a6f6e6c79476f7665726e616e63653a204f4e4c595f474f5645524e414e43455f41444452455353496e7374616e7457697468647261774d616e616765723a3a7570646174654275636b657473506172616d65746572733a205749544844524157414c535f4d5553545f42455f4c4553535f5448414e5f4d41585749544844524157414c534865726d657a3a3a5f73616665417070726f76653a2045524332305f415050524f56455f4641494c45444865726d657a3a3a6164644c315472616e73616374696f6e3a204c4f4144414d4f554e545f45524332305f444f45535f4e4f545f4d415443484920617574686f72697a65207468697320626162796a75626a7562206b657920666f72206865726d657a20726f6c6c7570206163636f756e74206372656174696f6e4865726d657a3a3a5f6164644c315472616e73616374696f6e3a20414d4f554e545f4d5553545f42455f305f49465f4e4f545f5452414e534645524865726d657a41756374696f6e50726f746f636f6c3a3a5f7065726d69743a204e4f545f56414c49445f43414c4c4865726d657a48656c706572733a3a5f636865636b5369673a20494e56414c49445f535f56414c55454865726d657a3a3a6164644c315472616e73616374696f6e3a204c4f4144414d4f554e545f4554485f444f45535f4e4f545f4d41544348a2646970667358221220a84697555131f274217588c1ae00520914a8e9aa4d22b904467b5d50b033f72764736f6c634300060c0033" - -// DeployHermez deploys a new Ethereum contract, binding an instance of Hermez to it. -func DeployHermez(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Hermez, error) { - parsed, err := abi.JSON(strings.NewReader(HermezABI)) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezBin), backend) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - return address, tx, &Hermez{HermezCaller: HermezCaller{contract: contract}, HermezTransactor: HermezTransactor{contract: contract}, HermezFilterer: HermezFilterer{contract: contract}}, nil -} +const HermezABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"}],\"name\":\"AddToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"batchNum\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"l1UserTxsLen\",\"type\":\"uint16\"}],\"name\":\"ForgeBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"forgeL1L2BatchTimeout\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAddToken\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"withdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"InitializeHermezEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"queueIndex\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"position\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"l1UserTx\",\"type\":\"bytes\"}],\"name\":\"L1UserTxEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"SafeMode\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"numBucket\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockStamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawals\",\"type\":\"uint256\"}],\"name\":\"UpdateBucketWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[4][5]\",\"name\":\"arrayBuckets\",\"type\":\"uint256[4][5]\"}],\"name\":\"UpdateBucketsParameters\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeAddToken\",\"type\":\"uint256\"}],\"name\":\"UpdateFeeAddToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"newForgeL1L2BatchTimeout\",\"type\":\"uint8\"}],\"name\":\"UpdateForgeL1L2BatchTimeout\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"addressArray\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"valueArray\",\"type\":\"uint64[]\"}],\"name\":\"UpdateTokenExchange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"UpdateWithdrawalDelay\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"WithdrawEvent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ABSOLUTE_MAX_L1L2BATCHTIMEOUT\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"babyPubKey\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"fromIdx\",\"type\":\"uint48\"},{\"internalType\":\"uint16\",\"name\":\"loadAmountF\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"amountF\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"toIdx\",\"type\":\"uint48\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"addL1Transaction\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"permit\",\"type\":\"bytes\"}],\"name\":\"addToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"buckets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"ceilUSD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockStamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdrawals\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockWithdrawalRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxWithdrawals\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"name\":\"exitNullifierMap\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"exitRootsMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeAddToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newLastIdx\",\"type\":\"uint48\"},{\"internalType\":\"uint256\",\"name\":\"newStRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"newExitRoot\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"encodedL1CoordinatorTx\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"l1L2TxsData\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"feeIdxCoordinator\",\"type\":\"bytes\"},{\"internalType\":\"uint8\",\"name\":\"verifierIdx\",\"type\":\"uint8\"},{\"internalType\":\"bool\",\"name\":\"l1Batch\",\"type\":\"bool\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofA\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"proofB\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofC\",\"type\":\"uint256[2]\"}],\"name\":\"forgeBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"forgeL1L2BatchTimeout\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezAuctionContract\",\"outputs\":[{\"internalType\":\"contractIHermezAuctionProtocol\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezGovernanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_verifiers\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_verifiersParams\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"_withdrawVerifier\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_hermezAuctionContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenHEZ\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"_forgeL1L2BatchTimeout\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"_feeAddToken\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_poseidon2Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poseidon3Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poseidon4Elements\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_hermezGovernanceAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_withdrawalDelay\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_withdrawDelayerContract\",\"type\":\"address\"}],\"name\":\"initializeHermez\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"name\":\"instantWithdrawalViewer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"l1L2TxsDataHashMap\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastForgedBatch\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastIdx\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lastL1L2Batch\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"mapL1TxQueue\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextL1FillingQueue\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextL1ToForgeQueue\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registerTokensCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"rollupVerifiers\",\"outputs\":[{\"internalType\":\"contractVerifierRollupInterface\",\"name\":\"verifierInterface\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nLevels\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"safeMode\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"stateRootMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenExchange\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenHEZ\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokenList\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenMap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[4][5]\",\"name\":\"arrayBuckets\",\"type\":\"uint256[4][5]\"}],\"name\":\"updateBucketsParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeAddToken\",\"type\":\"uint256\"}],\"name\":\"updateFeeAddToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"newForgeL1L2BatchTimeout\",\"type\":\"uint8\"}],\"name\":\"updateForgeL1L2BatchTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"addressArray\",\"type\":\"address[]\"},{\"internalType\":\"uint64[]\",\"name\":\"valueArray\",\"type\":\"uint64[]\"}],\"name\":\"updateTokenExchange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"updateWithdrawalDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"proofA\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"proofB\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"proofC\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"withdrawCircuit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawDelayerContract\",\"outputs\":[{\"internalType\":\"contractIWithdrawalDelayer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"tokenID\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint256\",\"name\":\"babyPubKey\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"numExitRoot\",\"type\":\"uint32\"},{\"internalType\":\"uint256[]\",\"name\":\"siblings\",\"type\":\"uint256[]\"},{\"internalType\":\"uint48\",\"name\":\"idx\",\"type\":\"uint48\"},{\"internalType\":\"bool\",\"name\":\"instantWithdraw\",\"type\":\"bool\"}],\"name\":\"withdrawMerkleProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawVerifier\",\"outputs\":[{\"internalType\":\"contractVerifierWithdrawInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" // Hermez is an auto generated Go binding around an Ethereum contract. type Hermez struct { @@ -155,7 +138,7 @@ func bindHermez(address common.Address, caller bind.ContractCaller, transactor b // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_Hermez *HermezRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_Hermez *HermezRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Hermez.Contract.HermezCaller.contract.Call(opts, result, method, params...) } @@ -174,7 +157,7 @@ func (_Hermez *HermezRaw) Transact(opts *bind.TransactOpts, method string, param // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_Hermez *HermezCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_Hermez *HermezCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _Hermez.Contract.contract.Call(opts, result, method, params...) } @@ -193,12 +176,17 @@ func (_Hermez *HermezTransactorRaw) Transact(opts *bind.TransactOpts, method str // // Solidity: function ABSOLUTE_MAX_L1L2BATCHTIMEOUT() view returns(uint8) func (_Hermez *HermezCaller) ABSOLUTEMAXL1L2BATCHTIMEOUT(opts *bind.CallOpts) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "ABSOLUTE_MAX_L1L2BATCHTIMEOUT") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "ABSOLUTE_MAX_L1L2BATCHTIMEOUT") + + if err != nil { + return *new(uint8), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, tracerr.Wrap(err) + } // ABSOLUTEMAXL1L2BATCHTIMEOUT is a free data retrieval call binding the contract method 0x95a09f2a. @@ -225,16 +213,25 @@ func (_Hermez *HermezCaller) Buckets(opts *bind.CallOpts, arg0 *big.Int) (struct BlockWithdrawalRate *big.Int MaxWithdrawals *big.Int }, error) { - ret := new(struct { + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "buckets", arg0) + + outstruct := new(struct { CeilUSD *big.Int BlockStamp *big.Int Withdrawals *big.Int BlockWithdrawalRate *big.Int MaxWithdrawals *big.Int }) - out := ret - err := _Hermez.contract.Call(opts, out, "buckets", arg0) - return *ret, tracerr.Wrap(err) + + outstruct.CeilUSD = out[0].(*big.Int) + outstruct.BlockStamp = out[1].(*big.Int) + outstruct.Withdrawals = out[2].(*big.Int) + outstruct.BlockWithdrawalRate = out[3].(*big.Int) + outstruct.MaxWithdrawals = out[4].(*big.Int) + + return *outstruct, tracerr.Wrap(err) + } // Buckets is a free data retrieval call binding the contract method 0x9b51fb0d. @@ -267,12 +264,17 @@ func (_Hermez *HermezCallerSession) Buckets(arg0 *big.Int) (struct { // // Solidity: function exitNullifierMap(uint32 , uint48 ) view returns(bool) func (_Hermez *HermezCaller) ExitNullifierMap(opts *bind.CallOpts, arg0 uint32, arg1 *big.Int) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "exitNullifierMap", arg0, arg1) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "exitNullifierMap", arg0, arg1) + + if err != nil { + return *new(bool), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, tracerr.Wrap(err) + } // ExitNullifierMap is a free data retrieval call binding the contract method 0xf84f92ee. @@ -293,12 +295,17 @@ func (_Hermez *HermezCallerSession) ExitNullifierMap(arg0 uint32, arg1 *big.Int) // // Solidity: function exitRootsMap(uint32 ) view returns(uint256) func (_Hermez *HermezCaller) ExitRootsMap(opts *bind.CallOpts, arg0 uint32) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "exitRootsMap", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "exitRootsMap", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // ExitRootsMap is a free data retrieval call binding the contract method 0x3ee641ea. @@ -319,12 +326,17 @@ func (_Hermez *HermezCallerSession) ExitRootsMap(arg0 uint32) (*big.Int, error) // // Solidity: function feeAddToken() view returns(uint256) func (_Hermez *HermezCaller) FeeAddToken(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "feeAddToken") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "feeAddToken") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // FeeAddToken is a free data retrieval call binding the contract method 0xbded9bb8. @@ -345,12 +357,17 @@ func (_Hermez *HermezCallerSession) FeeAddToken() (*big.Int, error) { // // Solidity: function forgeL1L2BatchTimeout() view returns(uint8) func (_Hermez *HermezCaller) ForgeL1L2BatchTimeout(opts *bind.CallOpts) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "forgeL1L2BatchTimeout") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "forgeL1L2BatchTimeout") + + if err != nil { + return *new(uint8), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, tracerr.Wrap(err) + } // ForgeL1L2BatchTimeout is a free data retrieval call binding the contract method 0xa3275838. @@ -371,12 +388,17 @@ func (_Hermez *HermezCallerSession) ForgeL1L2BatchTimeout() (uint8, error) { // // Solidity: function hermezAuctionContract() view returns(address) func (_Hermez *HermezCaller) HermezAuctionContract(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "hermezAuctionContract") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "hermezAuctionContract") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // HermezAuctionContract is a free data retrieval call binding the contract method 0x2bd83626. @@ -397,12 +419,17 @@ func (_Hermez *HermezCallerSession) HermezAuctionContract() (common.Address, err // // Solidity: function hermezGovernanceAddress() view returns(address) func (_Hermez *HermezCaller) HermezGovernanceAddress(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "hermezGovernanceAddress") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "hermezGovernanceAddress") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // HermezGovernanceAddress is a free data retrieval call binding the contract method 0x013f7852. @@ -423,12 +450,17 @@ func (_Hermez *HermezCallerSession) HermezGovernanceAddress() (common.Address, e // // Solidity: function instantWithdrawalViewer(address tokenAddress, uint192 amount) view returns(bool) func (_Hermez *HermezCaller) InstantWithdrawalViewer(opts *bind.CallOpts, tokenAddress common.Address, amount *big.Int) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "instantWithdrawalViewer", tokenAddress, amount) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "instantWithdrawalViewer", tokenAddress, amount) + + if err != nil { + return *new(bool), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, tracerr.Wrap(err) + } // InstantWithdrawalViewer is a free data retrieval call binding the contract method 0x375110aa. @@ -445,16 +477,52 @@ func (_Hermez *HermezCallerSession) InstantWithdrawalViewer(tokenAddress common. return _Hermez.Contract.InstantWithdrawalViewer(&_Hermez.CallOpts, tokenAddress, amount) } +// L1L2TxsDataHashMap is a free data retrieval call binding the contract method 0xce5ec65a. +// +// Solidity: function l1L2TxsDataHashMap(uint32 ) view returns(bytes32) +func (_Hermez *HermezCaller) L1L2TxsDataHashMap(opts *bind.CallOpts, arg0 uint32) ([32]byte, error) { + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "l1L2TxsDataHashMap", arg0) + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + +} + +// L1L2TxsDataHashMap is a free data retrieval call binding the contract method 0xce5ec65a. +// +// Solidity: function l1L2TxsDataHashMap(uint32 ) view returns(bytes32) +func (_Hermez *HermezSession) L1L2TxsDataHashMap(arg0 uint32) ([32]byte, error) { + return _Hermez.Contract.L1L2TxsDataHashMap(&_Hermez.CallOpts, arg0) +} + +// L1L2TxsDataHashMap is a free data retrieval call binding the contract method 0xce5ec65a. +// +// Solidity: function l1L2TxsDataHashMap(uint32 ) view returns(bytes32) +func (_Hermez *HermezCallerSession) L1L2TxsDataHashMap(arg0 uint32) ([32]byte, error) { + return _Hermez.Contract.L1L2TxsDataHashMap(&_Hermez.CallOpts, arg0) +} + // LastForgedBatch is a free data retrieval call binding the contract method 0x44e0b2ce. // // Solidity: function lastForgedBatch() view returns(uint32) func (_Hermez *HermezCaller) LastForgedBatch(opts *bind.CallOpts) (uint32, error) { - var ( - ret0 = new(uint32) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "lastForgedBatch") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "lastForgedBatch") + + if err != nil { + return *new(uint32), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, tracerr.Wrap(err) + } // LastForgedBatch is a free data retrieval call binding the contract method 0x44e0b2ce. @@ -475,12 +543,17 @@ func (_Hermez *HermezCallerSession) LastForgedBatch() (uint32, error) { // // Solidity: function lastIdx() view returns(uint48) func (_Hermez *HermezCaller) LastIdx(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "lastIdx") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "lastIdx") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // LastIdx is a free data retrieval call binding the contract method 0xd486645c. @@ -501,12 +574,17 @@ func (_Hermez *HermezCallerSession) LastIdx() (*big.Int, error) { // // Solidity: function lastL1L2Batch() view returns(uint64) func (_Hermez *HermezCaller) LastL1L2Batch(opts *bind.CallOpts) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "lastL1L2Batch") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "lastL1L2Batch") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // LastL1L2Batch is a free data retrieval call binding the contract method 0x84ef9ed4. @@ -527,12 +605,17 @@ func (_Hermez *HermezCallerSession) LastL1L2Batch() (uint64, error) { // // Solidity: function mapL1TxQueue(uint32 ) view returns(bytes) func (_Hermez *HermezCaller) MapL1TxQueue(opts *bind.CallOpts, arg0 uint32) ([]byte, error) { - var ( - ret0 = new([]byte) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "mapL1TxQueue", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "mapL1TxQueue", arg0) + + if err != nil { + return *new([]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, tracerr.Wrap(err) + } // MapL1TxQueue is a free data retrieval call binding the contract method 0xdc3e718e. @@ -553,12 +636,17 @@ func (_Hermez *HermezCallerSession) MapL1TxQueue(arg0 uint32) ([]byte, error) { // // Solidity: function nextL1FillingQueue() view returns(uint32) func (_Hermez *HermezCaller) NextL1FillingQueue(opts *bind.CallOpts) (uint32, error) { - var ( - ret0 = new(uint32) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "nextL1FillingQueue") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "nextL1FillingQueue") + + if err != nil { + return *new(uint32), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, tracerr.Wrap(err) + } // NextL1FillingQueue is a free data retrieval call binding the contract method 0x0ee8e52b. @@ -579,12 +667,17 @@ func (_Hermez *HermezCallerSession) NextL1FillingQueue() (uint32, error) { // // Solidity: function nextL1ToForgeQueue() view returns(uint32) func (_Hermez *HermezCaller) NextL1ToForgeQueue(opts *bind.CallOpts) (uint32, error) { - var ( - ret0 = new(uint32) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "nextL1ToForgeQueue") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "nextL1ToForgeQueue") + + if err != nil { + return *new(uint32), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, tracerr.Wrap(err) + } // NextL1ToForgeQueue is a free data retrieval call binding the contract method 0xd0f32e67. @@ -605,12 +698,17 @@ func (_Hermez *HermezCallerSession) NextL1ToForgeQueue() (uint32, error) { // // Solidity: function registerTokensCount() view returns(uint256) func (_Hermez *HermezCaller) RegisterTokensCount(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "registerTokensCount") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "registerTokensCount") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // RegisterTokensCount is a free data retrieval call binding the contract method 0x9f34e9a3. @@ -635,14 +733,21 @@ func (_Hermez *HermezCaller) RollupVerifiers(opts *bind.CallOpts, arg0 *big.Int) MaxTx *big.Int NLevels *big.Int }, error) { - ret := new(struct { + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "rollupVerifiers", arg0) + + outstruct := new(struct { VerifierInterface common.Address MaxTx *big.Int NLevels *big.Int }) - out := ret - err := _Hermez.contract.Call(opts, out, "rollupVerifiers", arg0) - return *ret, tracerr.Wrap(err) + + outstruct.VerifierInterface = out[0].(common.Address) + outstruct.MaxTx = out[1].(*big.Int) + outstruct.NLevels = out[2].(*big.Int) + + return *outstruct, tracerr.Wrap(err) + } // RollupVerifiers is a free data retrieval call binding the contract method 0x38330200. @@ -671,12 +776,17 @@ func (_Hermez *HermezCallerSession) RollupVerifiers(arg0 *big.Int) (struct { // // Solidity: function stateRootMap(uint32 ) view returns(uint256) func (_Hermez *HermezCaller) StateRootMap(opts *bind.CallOpts, arg0 uint32) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "stateRootMap", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "stateRootMap", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // StateRootMap is a free data retrieval call binding the contract method 0x9e00d7ea. @@ -697,12 +807,17 @@ func (_Hermez *HermezCallerSession) StateRootMap(arg0 uint32) (*big.Int, error) // // Solidity: function tokenExchange(address ) view returns(uint64) func (_Hermez *HermezCaller) TokenExchange(opts *bind.CallOpts, arg0 common.Address) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "tokenExchange", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "tokenExchange", arg0) + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // TokenExchange is a free data retrieval call binding the contract method 0x0dd94b96. @@ -723,12 +838,17 @@ func (_Hermez *HermezCallerSession) TokenExchange(arg0 common.Address) (uint64, // // Solidity: function tokenHEZ() view returns(address) func (_Hermez *HermezCaller) TokenHEZ(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "tokenHEZ") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "tokenHEZ") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3. @@ -749,12 +869,17 @@ func (_Hermez *HermezCallerSession) TokenHEZ() (common.Address, error) { // // Solidity: function tokenList(uint256 ) view returns(address) func (_Hermez *HermezCaller) TokenList(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "tokenList", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "tokenList", arg0) + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // TokenList is a free data retrieval call binding the contract method 0x9ead7222. @@ -775,12 +900,17 @@ func (_Hermez *HermezCallerSession) TokenList(arg0 *big.Int) (common.Address, er // // Solidity: function tokenMap(address ) view returns(uint256) func (_Hermez *HermezCaller) TokenMap(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "tokenMap", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "tokenMap", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // TokenMap is a free data retrieval call binding the contract method 0x004aca6e. @@ -801,12 +931,17 @@ func (_Hermez *HermezCallerSession) TokenMap(arg0 common.Address) (*big.Int, err // // Solidity: function withdrawDelayerContract() view returns(address) func (_Hermez *HermezCaller) WithdrawDelayerContract(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "withdrawDelayerContract") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "withdrawDelayerContract") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // WithdrawDelayerContract is a free data retrieval call binding the contract method 0x1b0a8223. @@ -827,12 +962,17 @@ func (_Hermez *HermezCallerSession) WithdrawDelayerContract() (common.Address, e // // Solidity: function withdrawVerifier() view returns(address) func (_Hermez *HermezCaller) WithdrawVerifier(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "withdrawVerifier") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "withdrawVerifier") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // WithdrawVerifier is a free data retrieval call binding the contract method 0x864eb164. @@ -853,12 +993,17 @@ func (_Hermez *HermezCallerSession) WithdrawVerifier() (common.Address, error) { // // Solidity: function withdrawalDelay() view returns(uint64) func (_Hermez *HermezCaller) WithdrawalDelay(opts *bind.CallOpts) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _Hermez.contract.Call(opts, out, "withdrawalDelay") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _Hermez.contract.Call(opts, &out, "withdrawalDelay") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // WithdrawalDelay is a free data retrieval call binding the contract method 0xa7ab6961. @@ -1268,6 +1413,7 @@ func (_Hermez *HermezFilterer) ParseAddToken(log types.Log) (*HermezAddToken, er if err := _Hermez.contract.UnpackLog(event, "AddToken", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1412,6 +1558,143 @@ func (_Hermez *HermezFilterer) ParseForgeBatch(log types.Log) (*HermezForgeBatch if err := _Hermez.contract.UnpackLog(event, "ForgeBatch", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log + return event, nil +} + +// HermezInitializeHermezEventIterator is returned from FilterInitializeHermezEvent and is used to iterate over the raw logs and unpacked data for InitializeHermezEvent events raised by the Hermez contract. +type HermezInitializeHermezEventIterator struct { + Event *HermezInitializeHermezEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *HermezInitializeHermezEventIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(HermezInitializeHermezEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(HermezInitializeHermezEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *HermezInitializeHermezEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *HermezInitializeHermezEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// HermezInitializeHermezEvent represents a InitializeHermezEvent event raised by the Hermez contract. +type HermezInitializeHermezEvent struct { + ForgeL1L2BatchTimeout uint8 + FeeAddToken *big.Int + WithdrawalDelay uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitializeHermezEvent is a free log retrieval operation binding the contract event 0xc5272ad4c8d9f2e9af2f9555c11ead049be22b6e45c16975adc82371b7cd1040. +// +// Solidity: event InitializeHermezEvent(uint8 forgeL1L2BatchTimeout, uint256 feeAddToken, uint64 withdrawalDelay) +func (_Hermez *HermezFilterer) FilterInitializeHermezEvent(opts *bind.FilterOpts) (*HermezInitializeHermezEventIterator, error) { + + logs, sub, err := _Hermez.contract.FilterLogs(opts, "InitializeHermezEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return &HermezInitializeHermezEventIterator{contract: _Hermez.contract, event: "InitializeHermezEvent", logs: logs, sub: sub}, nil +} + +// WatchInitializeHermezEvent is a free log subscription operation binding the contract event 0xc5272ad4c8d9f2e9af2f9555c11ead049be22b6e45c16975adc82371b7cd1040. +// +// Solidity: event InitializeHermezEvent(uint8 forgeL1L2BatchTimeout, uint256 feeAddToken, uint64 withdrawalDelay) +func (_Hermez *HermezFilterer) WatchInitializeHermezEvent(opts *bind.WatchOpts, sink chan<- *HermezInitializeHermezEvent) (event.Subscription, error) { + + logs, sub, err := _Hermez.contract.WatchLogs(opts, "InitializeHermezEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(HermezInitializeHermezEvent) + if err := _Hermez.contract.UnpackLog(event, "InitializeHermezEvent", log); err != nil { + return tracerr.Wrap(err) + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitializeHermezEvent is a log parse operation binding the contract event 0xc5272ad4c8d9f2e9af2f9555c11ead049be22b6e45c16975adc82371b7cd1040. +// +// Solidity: event InitializeHermezEvent(uint8 forgeL1L2BatchTimeout, uint256 feeAddToken, uint64 withdrawalDelay) +func (_Hermez *HermezFilterer) ParseInitializeHermezEvent(log types.Log) (*HermezInitializeHermezEvent, error) { + event := new(HermezInitializeHermezEvent) + if err := _Hermez.contract.UnpackLog(event, "InitializeHermezEvent", log); err != nil { + return nil, tracerr.Wrap(err) + } + event.Raw = log return event, nil } @@ -1565,6 +1848,7 @@ func (_Hermez *HermezFilterer) ParseL1UserTxEvent(log types.Log) (*HermezL1UserT if err := _Hermez.contract.UnpackLog(event, "L1UserTxEvent", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1697,6 +1981,7 @@ func (_Hermez *HermezFilterer) ParseSafeMode(log types.Log) (*HermezSafeMode, er if err := _Hermez.contract.UnpackLog(event, "SafeMode", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1850,6 +2135,7 @@ func (_Hermez *HermezFilterer) ParseUpdateBucketWithdraw(log types.Log) (*Hermez if err := _Hermez.contract.UnpackLog(event, "UpdateBucketWithdraw", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1983,6 +2269,7 @@ func (_Hermez *HermezFilterer) ParseUpdateBucketsParameters(log types.Log) (*Her if err := _Hermez.contract.UnpackLog(event, "UpdateBucketsParameters", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2116,6 +2403,7 @@ func (_Hermez *HermezFilterer) ParseUpdateFeeAddToken(log types.Log) (*HermezUpd if err := _Hermez.contract.UnpackLog(event, "UpdateFeeAddToken", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2249,6 +2537,7 @@ func (_Hermez *HermezFilterer) ParseUpdateForgeL1L2BatchTimeout(log types.Log) ( if err := _Hermez.contract.UnpackLog(event, "UpdateForgeL1L2BatchTimeout", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2383,6 +2672,7 @@ func (_Hermez *HermezFilterer) ParseUpdateTokenExchange(log types.Log) (*HermezU if err := _Hermez.contract.UnpackLog(event, "UpdateTokenExchange", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2516,6 +2806,7 @@ func (_Hermez *HermezFilterer) ParseUpdateWithdrawalDelay(log types.Log) (*Herme if err := _Hermez.contract.UnpackLog(event, "UpdateWithdrawalDelay", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -2677,5 +2968,6 @@ func (_Hermez *HermezFilterer) ParseWithdrawEvent(log types.Log) (*HermezWithdra if err := _Hermez.contract.UnpackLog(event, "WithdrawEvent", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } diff --git a/eth/contracts/tokenHEZ/HEZ.go b/eth/contracts/tokenHEZ/HEZ.go index cf05bb3..7ca67a6 100644 --- a/eth/contracts/tokenHEZ/HEZ.go +++ b/eth/contracts/tokenHEZ/HEZ.go @@ -30,23 +30,6 @@ var ( // HEZABI is the input ABI used to generate the binding from. const HEZABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"initialHolder\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"authorizer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"name\":\"AuthorizationUsed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"EIP712DOMAIN_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NAME_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TRANSFER_WITH_AUTHORIZATION_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION_HASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"authorizationState\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"validAfter\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"validBefore\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"transferWithAuthorization\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" -// HEZBin is the compiled bytecode used for deploying new contracts. -var HEZBin = "0x608060405234801561001057600080fd5b506040516111153803806111158339818101604052602081101561003357600080fd5b505161004a816a52b7d2dcc80cd2e4000000610050565b506101b1565b610069816000546100f260201b6109531790919060201c565b60009081556001600160a01b03831681526001602090815260409091205461009a9183906109536100f2821b17901c565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6040805180820190915260118152704d4154483a4144445f4f564552464c4f5760781b602082015281830190838210156101aa5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561016f578181015183820152602001610157565b50505050905090810190601f16801561019c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b610f55806101c06000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a9059cbb1161007c578063a9059cbb14610308578063c473af3314610334578063d505accf1461033c578063dd62ed3e1461038f578063e3ee160e146103bd578063e94a01021461041c57610137565b806370a08231146102a45780637ecebe00146102ca57806395d89b41146102f05780639e4e7318146102f8578063a0cc6a681461030057610137565b806323b872dd116100ff57806323b872dd1461022357806330adf81f14610259578063313ce567146102615780633408e4701461027f57806342966c681461028757610137565b806304622c2e1461013c57806306fdde0314610156578063095ea7b3146101d357806318160ddd1461021357806318369a2a1461021b575b600080fd5b610144610448565b60408051918252519081900360200190f35b61015e61046c565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610198578181015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ff600480360360408110156101e957600080fd5b506001600160a01b03813516906020013561049c565b604080519115158252519081900360200190f35b6101446104b2565b6101446104b8565b6101ff6004803603606081101561023957600080fd5b506001600160a01b038135811691602081013590911690604001356104c7565b610144610539565b61026961055d565b6040805160ff9092168252519081900360200190f35b610144610562565b6101ff6004803603602081101561029d57600080fd5b5035610566565b610144600480360360208110156102ba57600080fd5b50356001600160a01b031661057a565b610144600480360360208110156102e057600080fd5b50356001600160a01b031661058c565b61015e61059e565b6101446105bd565b6101446105e1565b6101ff6004803603604081101561031e57600080fd5b506001600160a01b038135169060200135610605565b610144610612565b61038d600480360360e081101561035257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610636565b005b610144600480360360408110156103a557600080fd5b506001600160a01b0381358116916020013516610736565b61038d60048036036101208110156103d457600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060ff60c0820135169060e0810135906101000135610753565b6101ff6004803603604081101561043257600080fd5b506001600160a01b038135169060200135610933565b7f64c0a41a0260272b78f2a5bd50d5ff7c1779bc3bba16dcff4550c7c642b0e4b481565b604051806040016040528060148152602001732432b936b2bd102732ba3bb7b935902a37b5b2b760611b81525081565b60006104a9338484610a12565b50600192915050565b60005481565b6a52b7d2dcc80cd2e400000081565b6001600160a01b03831660009081526002602090815260408083203384529091528120546000198114610523576104fe8184610a74565b6001600160a01b03861660009081526002602090815260408083203384529091529020555b61052e858585610af0565b506001949350505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b4690565b60006105723383610bfa565b506001919050565b60016020526000908152604090205481565b60036020526000908152604090205481565b604051806040016040528060038152602001622422ad60e91b81525081565b7fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc681565b7f7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a226781565b60006104a9338484610af0565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b4284101561068b576040805162461bcd60e51b815260206004820152601960248201527f48455a3a3a7065726d69743a20415554485f4558504952454400000000000000604482015290519081900360640190fd5b6001600160a01b0380881660008181526003602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938a1660608401526080830189905260a083019390935260c08083018890528151808403909101815260e0909201905280519101206107218882868686610c8c565b61072c888888610a12565b5050505050505050565b600260209081526000928352604080842090915290825290205481565b8542116107915760405162461bcd60e51b8152600401808060200182810382526032815260200180610e926032913960400191505060405180910390fd5b8442106107cf5760405162461bcd60e51b815260040180806020018281038252602c815260200180610e44602c913960400191505060405180910390fd5b6001600160a01b038916600090815260046020908152604080832087845290915290205460ff16156108325760405162461bcd60e51b8152600401808060200182810382526031815260200180610eef6031913960400191505060405180910390fd5b604080517f7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a22676020808301919091526001600160a01b03808d16838501528b166060830152608082018a905260a0820189905260c0820188905260e08083018890528351808403909101815261010090920190925280519101206108b88a82868686610c8c565b6001600160a01b038a1660009081526004602090815260408083208884529091529020805460ff191660011790556108f18a8a8a610af0565b60405185906001600160a01b038c16907f98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a590600090a350505050505050505050565b600460209081526000928352604080842090915290825290205460ff1681565b6040805180820190915260118152704d4154483a4144445f4f564552464c4f5760781b60208201528183019083821015610a0b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109d05781810151838201526020016109b8565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6040805180820190915260128152714d4154483a5355425f554e444552464c4f5760701b60208201528183039083821115610a0b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156109d05781810151838201526020016109b8565b6001600160a01b0382163014801590610b1157506001600160a01b03821615155b610b4c5760405162461bcd60e51b8152600401808060200182810382526022815260200180610e706022913960400191505060405180910390fd5b6001600160a01b038316600090815260016020526040902054610b6f9082610a74565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610b9e9082610953565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216600090815260016020526040902054610c1d9082610a74565b6001600160a01b03831660009081526001602052604081209190915554610c449082610a74565b60009081556040805183815290516001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f64c0a41a0260272b78f2a5bd50d5ff7c1779bc3bba16dcff4550c7c642b0e4b47fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6610cf9610562565b6040805160208082019690965280820194909452606084019290925260808301523060a0808401919091528151808403909101815260c08301825280519084012061190160f01b60e084015260e283018190526101028084018a9052825180850390910181526101228401808452815191860191909120600091829052610142850180855281905260ff8a1661016286015261018285018990526101a285018890529251919550919391926001926101c2808301939192601f198301929081900390910190855afa158015610dd2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610e085750876001600160a01b0316816001600160a01b0316145b61072c5760405162461bcd60e51b815260040180806020018281038252602b815260200180610ec4602b913960400191505060405180910390fdfe48455a3a3a7472616e7366657257697468417574686f72697a6174696f6e3a20415554485f4558504952454448455a3a3a5f7472616e736665723a204e4f545f56414c49445f5452414e5346455248455a3a3a7472616e7366657257697468417574686f72697a6174696f6e3a20415554485f4e4f545f5945545f56414c494448455a3a3a5f76616c69646174655369676e6564446174613a20494e56414c49445f5349474e415455524548455a3a3a7472616e7366657257697468417574686f72697a6174696f6e3a20415554485f414c52454144595f55534544a26469706673582212205aeb9e56ca4697b469366e6fc34ffebcc82c53ce1a5ae2775970617ccc42be4a64736f6c634300060c0033" - -// DeployHEZ deploys a new Ethereum contract, binding an instance of HEZ to it. -func DeployHEZ(auth *bind.TransactOpts, backend bind.ContractBackend, initialHolder common.Address) (common.Address, *types.Transaction, *HEZ, error) { - parsed, err := abi.JSON(strings.NewReader(HEZABI)) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HEZBin), backend, initialHolder) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - return address, tx, &HEZ{HEZCaller: HEZCaller{contract: contract}, HEZTransactor: HEZTransactor{contract: contract}, HEZFilterer: HEZFilterer{contract: contract}}, nil -} - // HEZ is an auto generated Go binding around an Ethereum contract. type HEZ struct { HEZCaller // Read-only binding to the contract @@ -155,7 +138,7 @@ func bindHEZ(address common.Address, caller bind.ContractCaller, transactor bind // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_HEZ *HEZRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_HEZ *HEZRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _HEZ.Contract.HEZCaller.contract.Call(opts, result, method, params...) } @@ -174,7 +157,7 @@ func (_HEZ *HEZRaw) Transact(opts *bind.TransactOpts, method string, params ...i // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_HEZ *HEZCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_HEZ *HEZCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _HEZ.Contract.contract.Call(opts, result, method, params...) } @@ -193,12 +176,17 @@ func (_HEZ *HEZTransactorRaw) Transact(opts *bind.TransactOpts, method string, p // // Solidity: function EIP712DOMAIN_HASH() view returns(bytes32) func (_HEZ *HEZCaller) EIP712DOMAINHASH(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "EIP712DOMAIN_HASH") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "EIP712DOMAIN_HASH") + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + } // EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33. @@ -219,12 +207,17 @@ func (_HEZ *HEZCallerSession) EIP712DOMAINHASH() ([32]byte, error) { // // Solidity: function NAME_HASH() view returns(bytes32) func (_HEZ *HEZCaller) NAMEHASH(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "NAME_HASH") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "NAME_HASH") + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + } // NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e. @@ -245,12 +238,17 @@ func (_HEZ *HEZCallerSession) NAMEHASH() ([32]byte, error) { // // Solidity: function PERMIT_TYPEHASH() view returns(bytes32) func (_HEZ *HEZCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "PERMIT_TYPEHASH") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "PERMIT_TYPEHASH") + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + } // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. @@ -271,12 +269,17 @@ func (_HEZ *HEZCallerSession) PERMITTYPEHASH() ([32]byte, error) { // // Solidity: function TRANSFER_WITH_AUTHORIZATION_TYPEHASH() view returns(bytes32) func (_HEZ *HEZCaller) TRANSFERWITHAUTHORIZATIONTYPEHASH(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "TRANSFER_WITH_AUTHORIZATION_TYPEHASH") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "TRANSFER_WITH_AUTHORIZATION_TYPEHASH") + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + } // TRANSFERWITHAUTHORIZATIONTYPEHASH is a free data retrieval call binding the contract method 0xa0cc6a68. @@ -297,12 +300,17 @@ func (_HEZ *HEZCallerSession) TRANSFERWITHAUTHORIZATIONTYPEHASH() ([32]byte, err // // Solidity: function VERSION_HASH() view returns(bytes32) func (_HEZ *HEZCaller) VERSIONHASH(opts *bind.CallOpts) ([32]byte, error) { - var ( - ret0 = new([32]byte) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "VERSION_HASH") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "VERSION_HASH") + + if err != nil { + return *new([32]byte), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, tracerr.Wrap(err) + } // VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318. @@ -323,12 +331,17 @@ func (_HEZ *HEZCallerSession) VERSIONHASH() ([32]byte, error) { // // Solidity: function allowance(address , address ) view returns(uint256) func (_HEZ *HEZCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "allowance", arg0, arg1) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. @@ -349,12 +362,17 @@ func (_HEZ *HEZCallerSession) Allowance(arg0 common.Address, arg1 common.Address // // Solidity: function authorizationState(address , bytes32 ) view returns(bool) func (_HEZ *HEZCaller) AuthorizationState(opts *bind.CallOpts, arg0 common.Address, arg1 [32]byte) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "authorizationState", arg0, arg1) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "authorizationState", arg0, arg1) + + if err != nil { + return *new(bool), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, tracerr.Wrap(err) + } // AuthorizationState is a free data retrieval call binding the contract method 0xe94a0102. @@ -375,12 +393,17 @@ func (_HEZ *HEZCallerSession) AuthorizationState(arg0 common.Address, arg1 [32]b // // Solidity: function balanceOf(address ) view returns(uint256) func (_HEZ *HEZCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "balanceOf", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. @@ -401,12 +424,17 @@ func (_HEZ *HEZCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { // // Solidity: function decimals() view returns(uint8) func (_HEZ *HEZCaller) Decimals(opts *bind.CallOpts) (uint8, error) { - var ( - ret0 = new(uint8) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "decimals") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, tracerr.Wrap(err) + } // Decimals is a free data retrieval call binding the contract method 0x313ce567. @@ -427,12 +455,17 @@ func (_HEZ *HEZCallerSession) Decimals() (uint8, error) { // // Solidity: function getChainId() pure returns(uint256 chainId) func (_HEZ *HEZCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "getChainId") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "getChainId") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // GetChainId is a free data retrieval call binding the contract method 0x3408e470. @@ -453,12 +486,17 @@ func (_HEZ *HEZCallerSession) GetChainId() (*big.Int, error) { // // Solidity: function initialBalance() view returns(uint256) func (_HEZ *HEZCaller) InitialBalance(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "initialBalance") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "initialBalance") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // InitialBalance is a free data retrieval call binding the contract method 0x18369a2a. @@ -479,12 +517,17 @@ func (_HEZ *HEZCallerSession) InitialBalance() (*big.Int, error) { // // Solidity: function name() view returns(string) func (_HEZ *HEZCaller) Name(opts *bind.CallOpts) (string, error) { - var ( - ret0 = new(string) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "name") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, tracerr.Wrap(err) + } // Name is a free data retrieval call binding the contract method 0x06fdde03. @@ -505,12 +548,17 @@ func (_HEZ *HEZCallerSession) Name() (string, error) { // // Solidity: function nonces(address ) view returns(uint256) func (_HEZ *HEZCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "nonces", arg0) - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "nonces", arg0) + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // Nonces is a free data retrieval call binding the contract method 0x7ecebe00. @@ -531,12 +579,17 @@ func (_HEZ *HEZCallerSession) Nonces(arg0 common.Address) (*big.Int, error) { // // Solidity: function symbol() view returns(string) func (_HEZ *HEZCaller) Symbol(opts *bind.CallOpts) (string, error) { - var ( - ret0 = new(string) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "symbol") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, tracerr.Wrap(err) + } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. @@ -557,12 +610,17 @@ func (_HEZ *HEZCallerSession) Symbol() (string, error) { // // Solidity: function totalSupply() view returns(uint256) func (_HEZ *HEZCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _HEZ.contract.Call(opts, out, "totalSupply") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _HEZ.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, tracerr.Wrap(err) + } // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. @@ -855,6 +913,7 @@ func (_HEZ *HEZFilterer) ParseApproval(log types.Log) (*HEZApproval, error) { if err := _HEZ.contract.UnpackLog(event, "Approval", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1007,6 +1066,7 @@ func (_HEZ *HEZFilterer) ParseAuthorizationUsed(log types.Log) (*HEZAuthorizatio if err := _HEZ.contract.UnpackLog(event, "AuthorizationUsed", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1160,5 +1220,6 @@ func (_HEZ *HEZFilterer) ParseTransfer(log types.Log) (*HEZTransfer, error) { if err := _HEZ.contract.UnpackLog(event, "Transfer", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } diff --git a/eth/contracts/update.sh b/eth/contracts/update.sh new file mode 100755 index 0000000..a5cb85c --- /dev/null +++ b/eth/contracts/update.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +gen() { + local name=$1 + local pkg=$2 + local folder=$3 + if [ -z "$3" ]; then + folder=$name + fi + + jq .abi "${CONTRACTS}/artifacts/${pkg}.json" > /tmp/${name}.abi + abigen --abi /tmp/${name}.abi --pkg=${pkg} --out=${folder}/${pkg}.go +} + +if [ "$1" = "" ]; then + echo "Usage: $0 CONTRACTS_REPO_PATH" + exit 1 +fi + +CONTRACTS="$1" + +gen hermez Hermez +gen auction HermezAuctionProtocol +gen withdrawdelayer WithdrawalDelayer +gen HEZ HEZ tokenHEZ diff --git a/eth/contracts/withdrawdelayer/WithdrawalDelayer.go b/eth/contracts/withdrawdelayer/WithdrawalDelayer.go index 4ab8956..c07fba1 100644 --- a/eth/contracts/withdrawdelayer/WithdrawalDelayer.go +++ b/eth/contracts/withdrawdelayer/WithdrawalDelayer.go @@ -28,24 +28,7 @@ var ( ) // WithdrawalDelayerABI is the input ABI used to generate the binding from. -const WithdrawalDelayerABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTimestamp\",\"type\":\"uint64\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EmergencyModeEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EscapeHatchWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"NewEmergencyCouncil\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newHermezGovernanceAddress\",\"type\":\"address\"}],\"name\":\"NewHermezGovernanceAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"withdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"NewWithdrawalDelay\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_EMERGENCY_MODE_TIME\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_WITHDRAWAL_DELAY\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"changeWithdrawalDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimEmergencyCouncil\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"_amount\",\"type\":\"uint192\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"depositInfo\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"depositTimestamp\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enableEmergencyMode\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"escapeHatchWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEmergencyCouncil\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEmergencyModeStartingTime\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHermezGovernanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawalDelay\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezRollupAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isEmergencyMode\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingEmergencyCouncil\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingGovernance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"newEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"transferEmergencyCouncil\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"withdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_initialWithdrawalDelay\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_initialHermezRollup\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_initialHermezGovernanceAddress\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_initialEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"withdrawalDelayerInitializer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" - -// WithdrawalDelayerBin is the compiled bytecode used for deploying new contracts. -var WithdrawalDelayerBin = "0x608060405234801561001057600080fd5b50611cf5806100206000396000f3fe6080604052600436106101355760003560e01c80637fd6b102116100ab578063ca79033f1161006f578063ca79033f146103ee578063cfc0b64114610403578063d38bfff414610443578063db2a1a8114610476578063de35f282146104a9578063f39c38a0146104e457610135565b80637fd6b1021461033b57806399ef11c51461037e578063a238f9df14610393578063b4b8e39d146103c4578063c5b1c7d0146103d957610135565b80633d4dff7b116100fd5780633d4dff7b1461021857806342cb72161461026d578063493b0170146102c15780635d36b190146102fc578063668cdd671461031157806367fa24031461032657610135565b8063031609401461013a5780630b21d430146101745780630e670af5146101a55780630fd266d7146101da57806320a194b8146101ef575b600080fd5b34801561014657600080fd5b5061014f6104f9565b604080516fffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018057600080fd5b50610189610508565b604080516001600160a01b039092168252519081900360200190f35b3480156101b157600080fd5b506101d8600480360360208110156101c857600080fd5b50356001600160401b0316610517565b005b3480156101e657600080fd5b5061018961061b565b3480156101fb57600080fd5b5061020461062a565b604080519115158252519081900360200190f35b34801561022457600080fd5b506102426004803603602081101561023b57600080fd5b503561063a565b604080516001600160c01b0390931683526001600160401b0390911660208301528051918290030190f35b34801561027957600080fd5b506101d86004803603608081101561029057600080fd5b506001600160401b03813516906001600160a01b036020820135811691604081013582169160609091013516610667565b3480156102cd57600080fd5b50610242600480360360408110156102e457600080fd5b506001600160a01b0381358116916020013516610776565b34801561030857600080fd5b506101d8610807565b34801561031d57600080fd5b5061014f6108b1565b34801561033257600080fd5b506101896108c7565b34801561034757600080fd5b506101d86004803603606081101561035e57600080fd5b506001600160a01b038135811691602081013590911690604001356108d6565b34801561038a57600080fd5b50610189610af9565b34801561039f57600080fd5b506103a8610b08565b604080516001600160401b039092168252519081900360200190f35b3480156103d057600080fd5b506103a8610b0f565b3480156103e557600080fd5b506101d8610b16565b3480156103fa57600080fd5b506101d8610c12565b6101d86004803603606081101561041957600080fd5b5080356001600160a01b0390811691602081013590911690604001356001600160c01b0316610cbc565b34801561044f57600080fd5b506101d86004803603602081101561046657600080fd5b50356001600160a01b031661106e565b34801561048257600080fd5b506101d86004803603602081101561049957600080fd5b50356001600160a01b03166110d9565b3480156104b557600080fd5b506101d8600480360360408110156104cc57600080fd5b506001600160a01b0381358116916020013516611144565b3480156104f057600080fd5b5061018961139e565b6065546001600160401b031690565b6066546001600160a01b031690565b6066546001600160a01b031633148061053a5750606a546001600160a01b031633145b6105755760405162461bcd60e51b8152600401808060200182810382526043815260200180611a146043913960600191505060405180910390fd5b621275006001600160401b03821611156105c05760405162461bcd60e51b8152600401808060200182810382526046815260200180611bb76046913960600191505060405180910390fd5b6065805467ffffffffffffffff19166001600160401b03838116919091179182905560408051929091168252517f6b3670ab51e04a9da086741e5fd1eb36ffaf1d661a15330c528e1f3e0c8722d7916020908290030190a150565b606a546001600160a01b031681565b606954600160a01b900460ff1690565b606b602052600090815260409020546001600160c01b03811690600160c01b90046001600160401b031682565b600054610100900460ff168061068057506106806113ad565b8061068e575060005460ff16155b6106c95760405162461bcd60e51b815260040180806020018281038252602e815260200180611ac1602e913960400191505060405180910390fd5b600054610100900460ff161580156106f4576000805460ff1961ff0019909116610100171660011790555b6106fc6113b3565b6065805467ffffffffffffffff19166001600160401b038716179055606a80546001600160a01b03199081166001600160a01b0387811691909117909255606680548216868416179055606980549091169184169190911760ff60a01b19169055801561076f576000805461ff00191690555b5050505050565b6000806107816117b3565b505060408051606094851b6001600160601b03199081166020808401919091529490951b909416603485015280518085036028018152604885018083528151918501919091206000908152606b9094529281902060888501909152546001600160c01b03811692839052600160c01b90046001600160401b031660689093018390525091565b6067546001600160a01b031633146108505760405162461bcd60e51b815260040180806020018281038252603b8152602001806119a3603b913960400191505060405180910390fd5b60678054606680546001600160a01b038084166001600160a01b03199283161792839055921690925560408051929091168252517f3bf02437d5cd40067085d9dac2c3cdcbef0a449d98a259a40d9c24380aca81bf916020908290030190a1565b606554600160401b90046001600160401b031690565b6068546001600160a01b031681565b60335460ff1661092d576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6033805460ff19169055606954600160a01b900460ff1661097f5760405162461bcd60e51b81526004018080602001828103825260348152602001806118ca6034913960400191505060405180910390fd5b6069546001600160a01b03163314806109a257506066546001600160a01b031633145b6109dd5760405162461bcd60e51b8152600401808060200182810382526039815260200180611b206039913960400191505060405180910390fd5b6069546001600160a01b031633148015610a0857506066546069546001600160a01b03908116911614155b15610a6a576065546001600160401b03600160401b909104811662eff100018116429091161015610a6a5760405162461bcd60e51b815260040180806020018281038252604481526020018061192d6044913960600191505060405180910390fd5b6001600160a01b038216610a8757610a828382611462565b610a92565b610a928284836114f7565b816001600160a01b0316836001600160a01b0316336001600160a01b03167fde200220117ba95c9a6c4a1a13bb06b0b7be90faa85c8fb4576630119f891693846040518082815260200191505060405180910390a450506033805460ff1916600117905550565b6069546001600160a01b031690565b6212750081565b62eff10081565b6066546001600160a01b03163314610b5f5760405162461bcd60e51b8152600401808060200182810382526037815260200180611c326037913960400191505060405180910390fd5b606954600160a01b900460ff1615610ba85760405162461bcd60e51b81526004018080602001828103825260378152602001806118936037913960400191505060405180910390fd5b6069805460ff60a01b1916600160a01b179055606580546001600160401b034216600160401b026fffffffffffffffff0000000000000000199091161790556040517f2064d51aa5a8bd67928c7675e267e05c67ad5adf7c9098d0a602d01f36fda9c590600090a1565b6068546001600160a01b03163314610c5b5760405162461bcd60e51b81526004018080602001828103825260418152602001806117f36041913960600191505060405180910390fd5b60688054606980546001600160a01b038084166001600160a01b03199283161792839055921690925560408051929091168252517fcc267667d474ef34ee2de2d060e7c8b2c7295cefa22e57fd7049e22b5fdb5396916020908290030190a1565b60335460ff16610d13576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6033805460ff19169055606a546001600160a01b03163314610d665760405162461bcd60e51b8152600401808060200182810382526027815260200180611a9a6027913960400191505060405180910390fd5b3415610dfe576001600160a01b03821615610db25760405162461bcd60e51b815260040180806020018281038252602f8152602001806118fe602f913960400191505060405180910390fd5b34816001600160c01b031614610df95760405162461bcd60e51b81526004018080602001828103825260288152602001806117cb6028913960400191505060405180910390fd5b611051565b606a5460408051636eb1769f60e11b81526001600160a01b03928316600482015230602482015290516001600160c01b0384169285169163dd62ed3e916044808301926020929190829003018186803b158015610e5a57600080fd5b505afa158015610e6e573d6000803e3d6000fd5b505050506040513d6020811015610e8457600080fd5b50511015610ec35760405162461bcd60e51b8152600401808060200182810382526030815260200180611c696030913960400191505060405180910390fd5b60006060836001600160a01b031660405180606001604052806025815260200161186e602591398051602091820120606a54604080516001600160a01b0390921660248301523060448301526001600160c01b038816606480840191909152815180840390910181526084909201815292810180516001600160e01b03166001600160e01b031990931692909217825291518251909182918083835b60208310610f7e5780518252601f199092019160209182019101610f5f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610fe0576040519150601f19603f3d011682016040523d82523d6000602084013e610fe5565b606091505b5091509150818015611013575080511580611013575080806020019051602081101561101057600080fd5b50515b61104e5760405162461bcd60e51b8152600401808060200182810382526031815260200180611aef6031913960400191505060405180910390fd5b50505b61105c838383611674565b50506033805460ff1916600117905550565b6066546001600160a01b031633146110b75760405162461bcd60e51b81526004018080602001828103825260368152602001806119de6036913960400191505060405180910390fd5b606780546001600160a01b0319166001600160a01b0392909216919091179055565b6069546001600160a01b031633146111225760405162461bcd60e51b8152600401808060200182810382526043815260200180611a576043913960600191505060405180910390fd5b606880546001600160a01b0319166001600160a01b0392909216919091179055565b60335460ff1661119b576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6033805460ff19169055606954600160a01b900460ff16156111ee5760405162461bcd60e51b815260040180806020018281038252602a815260200180611b59602a913960400191505060405180910390fd5b60408051606084811b6001600160601b03199081166020808501919091529185901b16603483015282518083036028018152604890920183528151918101919091206000818152606b909252919020546001600160c01b0316806112835760405162461bcd60e51b8152600401808060200182810382526027815260200180611c996027913960400191505060405180910390fd5b6065546000838152606b60205260409020546001600160401b03918216600160c01b90910482160181164290911610156112ee5760405162461bcd60e51b8152600401808060200182810382526035815260200180611bfd6035913960400191505060405180910390fd5b6000828152606b60205260408120556001600160a01b0383166113235761131e84826001600160c01b0316611462565b611337565b6113378385836001600160c01b03166114f7565b836001600160a01b0316836001600160a01b03167f72608e45b52a95a12c2ac7f15ff53f92fc9572c9d84b6e6b5d7f0f7826cf32718360405180826001600160c01b0316815260200191505060405180910390a350506033805460ff191660011790555050565b6067546001600160a01b031681565b303b1590565b600054610100900460ff16806113cc57506113cc6113ad565b806113da575060005460ff16155b6114155760405162461bcd60e51b815260040180806020018281038252602e815260200180611ac1602e913960400191505060405180910390fd5b600054610100900460ff16158015611440576000805460ff1961ff0019909116610100171660011790555b6033805460ff19166001179055801561145f576000805461ff00191690555b50565b6040516000906001600160a01b0384169083908381818185875af1925050503d80600081146114ad576040519150601f19603f3d011682016040523d82523d6000602084013e6114b2565b606091505b50509050806114f25760405162461bcd60e51b81526004018080602001828103825260328152602001806119716032913960400191505060405180910390fd5b505050565b604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0385811660248301526044808301869052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009460609489169392918291908083835b602083106115a45780518252601f199092019160209182019101611585565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611606576040519150601f19603f3d011682016040523d82523d6000602084013e61160b565b606091505b5091509150818015611639575080511580611639575080806020019051602081101561163657600080fd5b50515b61076f5760405162461bcd60e51b815260040180806020018281038252603a815260200180611834603a913960400191505060405180910390fd5b60408051606085811b6001600160601b03199081166020808501919091529186901b16603483015282518083036028018152604890920183528151918101919091206000818152606b909252919020546001600160c01b0390811683810191821610156117125760405162461bcd60e51b8152600401808060200182810382526034815260200180611b836034913960400191505060405180910390fd5b6000828152606b602090815260409182902080546001600160401b03428116600160c01b9081026001600160c01b038089166001600160c01b03199095169490941784161793849055855192891683529092049091169181019190915281516001600160a01b0380881693908916927f41219b99485f78192a5b9b1be28c7d53c3a2bdbe7900ae40c79fae8d9d6108fd929081900390910190a35050505050565b60408051808201909152600080825260208201529056fe5769746864726177616c44656c617965723a3a6465706f7369743a2057524f4e475f414d4f554e545769746864726177616c44656c617965723a3a636c61696d456d657267656e6379436f756e63696c3a204f4e4c595f50454e44494e475f474f5645524e414e43455769746864726177616c44656c617965723a3a5f746f6b656e5769746864726177616c3a20544f4b454e5f5452414e534645525f4641494c45447472616e7366657246726f6d28616464726573732c616464726573732c75696e74323536295769746864726177616c44656c617965723a3a656e61626c65456d657267656e63794d6f64653a20414c52454144595f454e41424c45445769746864726177616c44656c617965723a3a65736361706548617463685769746864726177616c3a204f4e4c595f454d4f44455769746864726177616c44656c617965723a3a6465706f7369743a2057524f4e475f544f4b454e5f414444524553535769746864726177616c44656c617965723a3a65736361706548617463685769746864726177616c3a204e4f5f4d41585f454d455247454e43595f4d4f44455f54494d455769746864726177616c44656c617965723a3a5f6574685769746864726177616c3a205452414e534645525f4641494c45445769746864726177616c44656c617965723a3a636c61696d476f7665726e616e63653a204f4e4c595f50454e44494e475f474f5645524e414e43455769746864726177616c44656c617965723a3a7472616e73666572476f7665726e616e63653a204f4e4c595f474f5645524e414e43455769746864726177616c44656c617965723a3a6368616e67655769746864726177616c44656c61793a204f4e4c595f524f4c4c55505f4f525f474f5645524e414e43455769746864726177616c44656c617965723a3a7472616e73666572456d657267656e6379436f756e63696c3a204f4e4c595f454d455247454e43595f434f554e43494c5769746864726177616c44656c617965723a3a6465706f7369743a204f4e4c595f524f4c4c5550436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645769746864726177616c44656c617965723a3a6465706f7369743a20544f4b454e5f5452414e534645525f4641494c45445769746864726177616c44656c617965723a3a65736361706548617463685769746864726177616c3a204f4e4c595f474f5645524e414e43455769746864726177616c44656c617965723a3a6465706f7369743a20454d455247454e43595f4d4f44455769746864726177616c44656c617965723a3a5f70726f636573734465706f7369743a204445504f5349545f4f564552464c4f575769746864726177616c44656c617965723a3a6368616e67655769746864726177616c44656c61793a20455843454544535f4d41585f5749544844524157414c5f44454c41595769746864726177616c44656c617965723a3a7769746864726177616c3a205749544844524157414c5f4e4f545f414c4c4f5745445769746864726177616c44656c617965723a3a656e61626c65456d657267656e63794d6f64653a204f4e4c595f474f5645524e414e43455769746864726177616c44656c617965723a3a6465706f7369743a204e4f545f454e4f5547485f414c4c4f57414e43455769746864726177616c44656c617965723a3a7769746864726177616c3a204e4f5f46554e4453a2646970667358221220e5a3370e58aedbb9299b84dab9f46ede78dea7760c7d54540ca28b4126cc4f0b64736f6c634300060c0033" - -// DeployWithdrawalDelayer deploys a new Ethereum contract, binding an instance of WithdrawalDelayer to it. -func DeployWithdrawalDelayer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WithdrawalDelayer, error) { - parsed, err := abi.JSON(strings.NewReader(WithdrawalDelayerABI)) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - - address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(WithdrawalDelayerBin), backend) - if err != nil { - return common.Address{}, nil, nil, tracerr.Wrap(err) - } - return address, tx, &WithdrawalDelayer{WithdrawalDelayerCaller: WithdrawalDelayerCaller{contract: contract}, WithdrawalDelayerTransactor: WithdrawalDelayerTransactor{contract: contract}, WithdrawalDelayerFilterer: WithdrawalDelayerFilterer{contract: contract}}, nil -} +const WithdrawalDelayerABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTimestamp\",\"type\":\"uint64\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EmergencyModeEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EscapeHatchWithdrawal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"initialWithdrawalDelay\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"initialHermezGovernanceAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"initialEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"InitializeWithdrawalDelayerEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"NewEmergencyCouncil\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newHermezGovernanceAddress\",\"type\":\"address\"}],\"name\":\"NewHermezGovernanceAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"withdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"NewWithdrawalDelay\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_EMERGENCY_MODE_TIME\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_WITHDRAWAL_DELAY\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_newWithdrawalDelay\",\"type\":\"uint64\"}],\"name\":\"changeWithdrawalDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimEmergencyCouncil\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint192\",\"name\":\"_amount\",\"type\":\"uint192\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"depositInfo\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deposits\",\"outputs\":[{\"internalType\":\"uint192\",\"name\":\"amount\",\"type\":\"uint192\"},{\"internalType\":\"uint64\",\"name\":\"depositTimestamp\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enableEmergencyMode\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"escapeHatchWithdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEmergencyCouncil\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEmergencyModeStartingTime\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getHermezGovernanceAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawalDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"hermezRollupAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isEmergencyMode\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingEmergencyCouncil\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingGovernance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"newEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"transferEmergencyCouncil\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"_owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"}],\"name\":\"withdrawal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_initialWithdrawalDelay\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_initialHermezRollup\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_initialHermezGovernanceAddress\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_initialEmergencyCouncil\",\"type\":\"address\"}],\"name\":\"withdrawalDelayerInitializer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // WithdrawalDelayer is an auto generated Go binding around an Ethereum contract. type WithdrawalDelayer struct { @@ -155,7 +138,7 @@ func bindWithdrawalDelayer(address common.Address, caller bind.ContractCaller, t // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_WithdrawalDelayer *WithdrawalDelayerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_WithdrawalDelayer *WithdrawalDelayerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WithdrawalDelayer.Contract.WithdrawalDelayerCaller.contract.Call(opts, result, method, params...) } @@ -174,7 +157,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerRaw) Transact(opts *bind.TransactOpts // sets the output to result. The result type might be a single field for simple // returns, a slice of interfaces for anonymous returns and a struct for named // returns. -func (_WithdrawalDelayer *WithdrawalDelayerCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { +func (_WithdrawalDelayer *WithdrawalDelayerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { return _WithdrawalDelayer.Contract.contract.Call(opts, result, method, params...) } @@ -193,12 +176,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerTransactorRaw) Transact(opts *bind.Tr // // Solidity: function MAX_EMERGENCY_MODE_TIME() view returns(uint64) func (_WithdrawalDelayer *WithdrawalDelayerCaller) MAXEMERGENCYMODETIME(opts *bind.CallOpts) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_EMERGENCY_MODE_TIME") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "MAX_EMERGENCY_MODE_TIME") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // MAXEMERGENCYMODETIME is a free data retrieval call binding the contract method 0xb4b8e39d. @@ -219,12 +207,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) MAXEMERGENCYMODETIME() // // Solidity: function MAX_WITHDRAWAL_DELAY() view returns(uint64) func (_WithdrawalDelayer *WithdrawalDelayerCaller) MAXWITHDRAWALDELAY(opts *bind.CallOpts) (uint64, error) { - var ( - ret0 = new(uint64) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_WITHDRAWAL_DELAY") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "MAX_WITHDRAWAL_DELAY") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df. @@ -245,16 +238,18 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) MAXWITHDRAWALDELAY() ( // // Solidity: function depositInfo(address _owner, address _token) view returns(uint192, uint64) func (_WithdrawalDelayer *WithdrawalDelayerCaller) DepositInfo(opts *bind.CallOpts, _owner common.Address, _token common.Address) (*big.Int, uint64, error) { - var ( - ret0 = new(*big.Int) - ret1 = new(uint64) - ) - out := &[]interface{}{ - ret0, - ret1, + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "depositInfo", _owner, _token) + + if err != nil { + return *new(*big.Int), *new(uint64), tracerr.Wrap(err) } - err := _WithdrawalDelayer.contract.Call(opts, out, "depositInfo", _owner, _token) - return *ret0, *ret1, tracerr.Wrap(err) + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(uint64)).(*uint64) + + return out0, out1, tracerr.Wrap(err) + } // DepositInfo is a free data retrieval call binding the contract method 0x493b0170. @@ -278,13 +273,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) Deposits(opts *bind.CallOpts, Amount *big.Int DepositTimestamp uint64 }, error) { - ret := new(struct { + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "deposits", arg0) + + outstruct := new(struct { Amount *big.Int DepositTimestamp uint64 }) - out := ret - err := _WithdrawalDelayer.contract.Call(opts, out, "deposits", arg0) - return *ret, tracerr.Wrap(err) + + outstruct.Amount = out[0].(*big.Int) + outstruct.DepositTimestamp = out[1].(uint64) + + return *outstruct, tracerr.Wrap(err) + } // Deposits is a free data retrieval call binding the contract method 0x3d4dff7b. @@ -311,12 +312,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) Deposits(arg0 [32]byte // // Solidity: function getEmergencyCouncil() view returns(address) func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetEmergencyCouncil(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyCouncil") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "getEmergencyCouncil") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // GetEmergencyCouncil is a free data retrieval call binding the contract method 0x99ef11c5. @@ -335,27 +341,32 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetEmergencyCouncil() // GetEmergencyModeStartingTime is a free data retrieval call binding the contract method 0x668cdd67. // -// Solidity: function getEmergencyModeStartingTime() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetEmergencyModeStartingTime(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyModeStartingTime") - return *ret0, tracerr.Wrap(err) +// Solidity: function getEmergencyModeStartingTime() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetEmergencyModeStartingTime(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "getEmergencyModeStartingTime") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // GetEmergencyModeStartingTime is a free data retrieval call binding the contract method 0x668cdd67. // -// Solidity: function getEmergencyModeStartingTime() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerSession) GetEmergencyModeStartingTime() (*big.Int, error) { +// Solidity: function getEmergencyModeStartingTime() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerSession) GetEmergencyModeStartingTime() (uint64, error) { return _WithdrawalDelayer.Contract.GetEmergencyModeStartingTime(&_WithdrawalDelayer.CallOpts) } // GetEmergencyModeStartingTime is a free data retrieval call binding the contract method 0x668cdd67. // -// Solidity: function getEmergencyModeStartingTime() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetEmergencyModeStartingTime() (*big.Int, error) { +// Solidity: function getEmergencyModeStartingTime() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetEmergencyModeStartingTime() (uint64, error) { return _WithdrawalDelayer.Contract.GetEmergencyModeStartingTime(&_WithdrawalDelayer.CallOpts) } @@ -363,12 +374,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetEmergencyModeStarti // // Solidity: function getHermezGovernanceAddress() view returns(address) func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetHermezGovernanceAddress(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "getHermezGovernanceAddress") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "getHermezGovernanceAddress") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // GetHermezGovernanceAddress is a free data retrieval call binding the contract method 0x0b21d430. @@ -387,27 +403,32 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetHermezGovernanceAdd // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x03160940. // -// Solidity: function getWithdrawalDelay() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetWithdrawalDelay(opts *bind.CallOpts) (*big.Int, error) { - var ( - ret0 = new(*big.Int) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "getWithdrawalDelay") - return *ret0, tracerr.Wrap(err) +// Solidity: function getWithdrawalDelay() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetWithdrawalDelay(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "getWithdrawalDelay") + + if err != nil { + return *new(uint64), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, tracerr.Wrap(err) + } // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x03160940. // -// Solidity: function getWithdrawalDelay() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerSession) GetWithdrawalDelay() (*big.Int, error) { +// Solidity: function getWithdrawalDelay() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerSession) GetWithdrawalDelay() (uint64, error) { return _WithdrawalDelayer.Contract.GetWithdrawalDelay(&_WithdrawalDelayer.CallOpts) } // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x03160940. // -// Solidity: function getWithdrawalDelay() view returns(uint128) -func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetWithdrawalDelay() (*big.Int, error) { +// Solidity: function getWithdrawalDelay() view returns(uint64) +func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetWithdrawalDelay() (uint64, error) { return _WithdrawalDelayer.Contract.GetWithdrawalDelay(&_WithdrawalDelayer.CallOpts) } @@ -415,12 +436,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) GetWithdrawalDelay() ( // // Solidity: function hermezRollupAddress() view returns(address) func (_WithdrawalDelayer *WithdrawalDelayerCaller) HermezRollupAddress(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "hermezRollupAddress") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "hermezRollupAddress") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // HermezRollupAddress is a free data retrieval call binding the contract method 0x0fd266d7. @@ -441,12 +467,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) HermezRollupAddress() // // Solidity: function isEmergencyMode() view returns(bool) func (_WithdrawalDelayer *WithdrawalDelayerCaller) IsEmergencyMode(opts *bind.CallOpts) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "isEmergencyMode") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "isEmergencyMode") + + if err != nil { + return *new(bool), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, tracerr.Wrap(err) + } // IsEmergencyMode is a free data retrieval call binding the contract method 0x20a194b8. @@ -467,12 +498,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) IsEmergencyMode() (boo // // Solidity: function pendingEmergencyCouncil() view returns(address) func (_WithdrawalDelayer *WithdrawalDelayerCaller) PendingEmergencyCouncil(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "pendingEmergencyCouncil") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "pendingEmergencyCouncil") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // PendingEmergencyCouncil is a free data retrieval call binding the contract method 0x67fa2403. @@ -493,12 +529,17 @@ func (_WithdrawalDelayer *WithdrawalDelayerCallerSession) PendingEmergencyCounci // // Solidity: function pendingGovernance() view returns(address) func (_WithdrawalDelayer *WithdrawalDelayerCaller) PendingGovernance(opts *bind.CallOpts) (common.Address, error) { - var ( - ret0 = new(common.Address) - ) - out := ret0 - err := _WithdrawalDelayer.contract.Call(opts, out, "pendingGovernance") - return *ret0, tracerr.Wrap(err) + var out []interface{} + err := _WithdrawalDelayer.contract.Call(opts, &out, "pendingGovernance") + + if err != nil { + return *new(common.Address), tracerr.Wrap(err) + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, tracerr.Wrap(err) + } // PendingGovernance is a free data retrieval call binding the contract method 0xf39c38a0. @@ -876,6 +917,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseDeposit(log types.Log) if err := _WithdrawalDelayer.contract.UnpackLog(event, "Deposit", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1008,6 +1050,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEmergencyModeEnabled(l if err := _WithdrawalDelayer.contract.UnpackLog(event, "EmergencyModeEnabled", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1170,6 +1213,143 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEscapeHatchWithdrawal( if err := _WithdrawalDelayer.contract.UnpackLog(event, "EscapeHatchWithdrawal", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log + return event, nil +} + +// WithdrawalDelayerInitializeWithdrawalDelayerEventIterator is returned from FilterInitializeWithdrawalDelayerEvent and is used to iterate over the raw logs and unpacked data for InitializeWithdrawalDelayerEvent events raised by the WithdrawalDelayer contract. +type WithdrawalDelayerInitializeWithdrawalDelayerEventIterator struct { + Event *WithdrawalDelayerInitializeWithdrawalDelayerEvent // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *WithdrawalDelayerInitializeWithdrawalDelayerEventIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(WithdrawalDelayerInitializeWithdrawalDelayerEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(WithdrawalDelayerInitializeWithdrawalDelayerEvent) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *WithdrawalDelayerInitializeWithdrawalDelayerEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *WithdrawalDelayerInitializeWithdrawalDelayerEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// WithdrawalDelayerInitializeWithdrawalDelayerEvent represents a InitializeWithdrawalDelayerEvent event raised by the WithdrawalDelayer contract. +type WithdrawalDelayerInitializeWithdrawalDelayerEvent struct { + InitialWithdrawalDelay uint64 + InitialHermezGovernanceAddress common.Address + InitialEmergencyCouncil common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitializeWithdrawalDelayerEvent is a free log retrieval operation binding the contract event 0x8b81dca4c96ae06989fa8aa1baa4ccc05dfb42e0948c7d5b7505b68ccde41eec. +// +// Solidity: event InitializeWithdrawalDelayerEvent(uint64 initialWithdrawalDelay, address initialHermezGovernanceAddress, address initialEmergencyCouncil) +func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterInitializeWithdrawalDelayerEvent(opts *bind.FilterOpts) (*WithdrawalDelayerInitializeWithdrawalDelayerEventIterator, error) { + + logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "InitializeWithdrawalDelayerEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return &WithdrawalDelayerInitializeWithdrawalDelayerEventIterator{contract: _WithdrawalDelayer.contract, event: "InitializeWithdrawalDelayerEvent", logs: logs, sub: sub}, nil +} + +// WatchInitializeWithdrawalDelayerEvent is a free log subscription operation binding the contract event 0x8b81dca4c96ae06989fa8aa1baa4ccc05dfb42e0948c7d5b7505b68ccde41eec. +// +// Solidity: event InitializeWithdrawalDelayerEvent(uint64 initialWithdrawalDelay, address initialHermezGovernanceAddress, address initialEmergencyCouncil) +func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchInitializeWithdrawalDelayerEvent(opts *bind.WatchOpts, sink chan<- *WithdrawalDelayerInitializeWithdrawalDelayerEvent) (event.Subscription, error) { + + logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "InitializeWithdrawalDelayerEvent") + if err != nil { + return nil, tracerr.Wrap(err) + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(WithdrawalDelayerInitializeWithdrawalDelayerEvent) + if err := _WithdrawalDelayer.contract.UnpackLog(event, "InitializeWithdrawalDelayerEvent", log); err != nil { + return tracerr.Wrap(err) + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + case err := <-sub.Err(): + return tracerr.Wrap(err) + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitializeWithdrawalDelayerEvent is a log parse operation binding the contract event 0x8b81dca4c96ae06989fa8aa1baa4ccc05dfb42e0948c7d5b7505b68ccde41eec. +// +// Solidity: event InitializeWithdrawalDelayerEvent(uint64 initialWithdrawalDelay, address initialHermezGovernanceAddress, address initialEmergencyCouncil) +func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseInitializeWithdrawalDelayerEvent(log types.Log) (*WithdrawalDelayerInitializeWithdrawalDelayerEvent, error) { + event := new(WithdrawalDelayerInitializeWithdrawalDelayerEvent) + if err := _WithdrawalDelayer.contract.UnpackLog(event, "InitializeWithdrawalDelayerEvent", log); err != nil { + return nil, tracerr.Wrap(err) + } + event.Raw = log return event, nil } @@ -1303,6 +1483,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewEmergencyCouncil(lo if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewEmergencyCouncil", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1436,6 +1617,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewHermezGovernanceAdd if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewHermezGovernanceAddress", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1569,6 +1751,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewWithdrawalDelay(log if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewWithdrawalDelay", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } @@ -1722,5 +1905,6 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseWithdraw(log types.Log if err := _WithdrawalDelayer.contract.UnpackLog(event, "Withdraw", log); err != nil { return nil, tracerr.Wrap(err) } + event.Raw = log return event, nil } diff --git a/eth/ethereum.go b/eth/ethereum.go index 1e91373..ed3e1a9 100644 --- a/eth/ethereum.go +++ b/eth/ethereum.go @@ -137,7 +137,8 @@ func (c *EthereumClient) CallAuth(gasLimit uint64, gasPrice.Add(gasPrice, inc) log.Debugw("Transaction metadata", "gasPrice", gasPrice) - auth, err := bind.NewKeyStoreTransactor(c.ks, *c.account) + // TODO: Set the correct chainID + auth, err := bind.NewKeyStoreTransactorWithChainID(c.ks, *c.account, big.NewInt(0)) if err != nil { return nil, tracerr.Wrap(err) } diff --git a/eth/rollup.go b/eth/rollup.go index 2e78232..eace101 100644 --- a/eth/rollup.go +++ b/eth/rollup.go @@ -51,6 +51,14 @@ type RollupState struct { CurrentIdx int64 } +// RollupEventInitialize is the InitializeHermezEvent event of the +// Smart Contract +type RollupEventInitialize struct { + ForgeL1L2BatchTimeout uint8 + FeeAddToken *big.Int + WithdrawalDelay uint64 +} + // RollupEventL1UserTx is an event of the Rollup Smart Contract type RollupEventL1UserTx struct { // ToForgeL1TxsNum int64 // QueueIndex *big.Int @@ -660,11 +668,40 @@ var ( logHermezWithdrawEvent = crypto.Keccak256Hash([]byte("WithdrawEvent(uint48,uint32,bool)")) logHermezUpdateBucketWithdraw = crypto.Keccak256Hash([]byte("UpdateBucketWithdraw(uint8,uint256,uint256)")) logHermezUpdateWithdrawalDelay = crypto.Keccak256Hash([]byte("UpdateWithdrawalDelay(uint64)")) - logHermezUpdateBucketsParameters = crypto.Keccak256Hash([]byte("UpdateBucketsParameters(uint256[4][" + strconv.Itoa(common.RollupConstNumBuckets) + "])")) - logHermezUpdateTokenExchange = crypto.Keccak256Hash([]byte("UpdateTokenExchange(address[],uint64[])")) - logHermezSafeMode = crypto.Keccak256Hash([]byte("SafeMode()")) + logHermezUpdateBucketsParameters = crypto.Keccak256Hash([]byte("UpdateBucketsParameters(uint256[4][" + + strconv.Itoa(common.RollupConstNumBuckets) + "])")) + logHermezUpdateTokenExchange = crypto.Keccak256Hash([]byte("UpdateTokenExchange(address[],uint64[])")) + logHermezSafeMode = crypto.Keccak256Hash([]byte("SafeMode()")) + logHermezInitialize = crypto.Keccak256Hash([]byte("InitializeHermezEvent(uint8,uint256,uint64)")) ) +// RollupEventInit returns the initialize event with its corresponding block number +func (c *RollupClient) RollupEventInit() (*RollupEventInitialize, int64, error) { + query := ethereum.FilterQuery{ + Addresses: []ethCommon.Address{ + c.address, + }, + Topics: [][]ethCommon.Hash{{logHermezInitialize}}, + } + logs, err := c.client.client.FilterLogs(context.Background(), query) + if err != nil { + return nil, 0, tracerr.Wrap(err) + } + if len(logs) != 1 { + return nil, 0, fmt.Errorf("no event of type InitializeHermezEvent found") + } + vLog := logs[0] + if vLog.Topics[0] != logHermezInitialize { + return nil, 0, fmt.Errorf("event is not InitializeHermezEvent") + } + + var rollupInit RollupEventInitialize + if err := c.contractAbi.UnpackIntoInterface(&rollupInit, "InitializeHermezEvent", vLog.Data); err != nil { + return nil, 0, tracerr.Wrap(err) + } + return &rollupInit, int64(vLog.BlockNumber), err +} + // RollupEventsByBlock returns the events in a block that happened in the Rollup Smart Contract func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethCommon.Hash, error) { var rollupEvents RollupEvents @@ -695,7 +732,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC case logHermezL1UserTxEvent: var L1UserTxAux rollupEventL1UserTxAux var L1UserTx RollupEventL1UserTx - err := c.contractAbi.Unpack(&L1UserTxAux, "L1UserTxEvent", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&L1UserTxAux, "L1UserTxEvent", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -711,7 +748,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC rollupEvents.L1UserTx = append(rollupEvents.L1UserTx, L1UserTx) case logHermezAddToken: var addToken RollupEventAddToken - err := c.contractAbi.Unpack(&addToken, "AddToken", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&addToken, "AddToken", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -719,7 +756,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC rollupEvents.AddToken = append(rollupEvents.AddToken, addToken) case logHermezForgeBatch: var forgeBatch RollupEventForgeBatch - err := c.contractAbi.Unpack(&forgeBatch, "ForgeBatch", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&forgeBatch, "ForgeBatch", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -731,7 +768,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC var updateForgeL1L2BatchTimeout struct { NewForgeL1L2BatchTimeout uint8 } - err := c.contractAbi.Unpack(&updateForgeL1L2BatchTimeout, "UpdateForgeL1L2BatchTimeout", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&updateForgeL1L2BatchTimeout, "UpdateForgeL1L2BatchTimeout", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -741,7 +778,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC }) case logHermezUpdateFeeAddToken: var updateFeeAddToken RollupEventUpdateFeeAddToken - err := c.contractAbi.Unpack(&updateFeeAddToken, "UpdateFeeAddToken", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&updateFeeAddToken, "UpdateFeeAddToken", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -759,7 +796,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC case logHermezUpdateBucketWithdraw: var updateBucketWithdrawAux rollupEventUpdateBucketWithdrawAux var updateBucketWithdraw RollupEventUpdateBucketWithdraw - err := c.contractAbi.Unpack(&updateBucketWithdrawAux, "UpdateBucketWithdraw", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&updateBucketWithdrawAux, "UpdateBucketWithdraw", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -770,7 +807,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC case logHermezUpdateWithdrawalDelay: var withdrawalDelay RollupEventUpdateWithdrawalDelay - err := c.contractAbi.Unpack(&withdrawalDelay, "UpdateWithdrawalDelay", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&withdrawalDelay, "UpdateWithdrawalDelay", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -778,7 +815,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC case logHermezUpdateBucketsParameters: var bucketsParametersAux rollupEventUpdateBucketsParametersAux var bucketsParameters RollupEventUpdateBucketsParameters - err := c.contractAbi.Unpack(&bucketsParametersAux, "UpdateBucketsParameters", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&bucketsParametersAux, "UpdateBucketsParameters", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -791,7 +828,7 @@ func (c *RollupClient) RollupEventsByBlock(blockNum int64) (*RollupEvents, *ethC rollupEvents.UpdateBucketsParameters = append(rollupEvents.UpdateBucketsParameters, bucketsParameters) case logHermezUpdateTokenExchange: var tokensExchange RollupEventUpdateTokenExchange - err := c.contractAbi.Unpack(&tokensExchange, "UpdateTokenExchange", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&tokensExchange, "UpdateTokenExchange", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -840,7 +877,9 @@ func (c *RollupClient) RollupForgeBatchArgs(ethTxHash ethCommon.Hash, l1UserTxsL return nil, nil, tracerr.Wrap(err) } var aux rollupForgeBatchArgsAux - if err := method.Inputs.Unpack(&aux, txData[4:]); err != nil { + if values, err := method.Inputs.Unpack(txData[4:]); err != nil { + return nil, nil, tracerr.Wrap(err) + } else if err := method.Inputs.Copy(&aux, values); err != nil { return nil, nil, tracerr.Wrap(err) } rollupForgeBatchArgs := RollupForgeBatchArgs{ diff --git a/eth/rollup_test.go b/eth/rollup_test.go index 358d60a..bd78a8b 100644 --- a/eth/rollup_test.go +++ b/eth/rollup_test.go @@ -55,6 +55,15 @@ func genKeysBjj(i int64) *keys { } } +func TestRollupEventInit(t *testing.T) { + rollupInit, blockNum, err := rollupClient.RollupEventInit() + require.NoError(t, err) + assert.Equal(t, int64(19), blockNum) + assert.Equal(t, uint8(10), rollupInit.ForgeL1L2BatchTimeout) + assert.Equal(t, big.NewInt(10), rollupInit.FeeAddToken) + assert.Equal(t, uint64(60*60*24*7*2), rollupInit.WithdrawalDelay) +} + func TestRollupConstants(t *testing.T) { rollupConstants, err := rollupClient.RollupConstants() require.NoError(t, err) diff --git a/eth/wdelayer.go b/eth/wdelayer.go index f230097..0f6ad97 100644 --- a/eth/wdelayer.go +++ b/eth/wdelayer.go @@ -25,6 +25,14 @@ type DepositState struct { DepositTimestamp uint64 } +// WDelayerEventInitialize is the InitializeWithdrawalDelayerEvent event of the +// Smart Contract +type WDelayerEventInitialize struct { + InitialWithdrawalDelay uint64 + InitialHermezGovernanceAddress ethCommon.Address + InitialEmergencyCouncil ethCommon.Address +} + // WDelayerEventDeposit is an event of the WithdrawalDelayer Smart Contract type WDelayerEventDeposit struct { Owner ethCommon.Address @@ -105,8 +113,8 @@ type WDelayerInterface interface { WDelayerTransferEmergencyCouncil(newAddress ethCommon.Address) (*types.Transaction, error) WDelayerClaimEmergencyCouncil() (*types.Transaction, error) WDelayerIsEmergencyMode() (bool, error) - WDelayerGetWithdrawalDelay() (*big.Int, error) - WDelayerGetEmergencyModeStartingTime() (*big.Int, error) + WDelayerGetWithdrawalDelay() (int64, error) + WDelayerGetEmergencyModeStartingTime() (int64, error) WDelayerEnableEmergencyMode() (*types.Transaction, error) WDelayerChangeWithdrawalDelay(newWithdrawalDelay uint64) (*types.Transaction, error) WDelayerDepositInfo(owner, token ethCommon.Address) (depositInfo DepositState, err error) @@ -238,25 +246,27 @@ func (c *WDelayerClient) WDelayerIsEmergencyMode() (ermergencyMode bool, err err } // WDelayerGetWithdrawalDelay is the interface to call the smart contract function -func (c *WDelayerClient) WDelayerGetWithdrawalDelay() (withdrawalDelay *big.Int, err error) { +func (c *WDelayerClient) WDelayerGetWithdrawalDelay() (withdrawalDelay int64, err error) { + var _withdrawalDelay uint64 if err := c.client.Call(func(ec *ethclient.Client) error { - withdrawalDelay, err = c.wdelayer.GetWithdrawalDelay(c.opts) + _withdrawalDelay, err = c.wdelayer.GetWithdrawalDelay(c.opts) return tracerr.Wrap(err) }); err != nil { - return nil, tracerr.Wrap(err) + return 0, tracerr.Wrap(err) } - return withdrawalDelay, nil + return int64(_withdrawalDelay), nil } // WDelayerGetEmergencyModeStartingTime is the interface to call the smart contract function -func (c *WDelayerClient) WDelayerGetEmergencyModeStartingTime() (emergencyModeStartingTime *big.Int, err error) { +func (c *WDelayerClient) WDelayerGetEmergencyModeStartingTime() (emergencyModeStartingTime int64, err error) { + var _emergencyModeStartingTime uint64 if err := c.client.Call(func(ec *ethclient.Client) error { - emergencyModeStartingTime, err = c.wdelayer.GetEmergencyModeStartingTime(c.opts) + _emergencyModeStartingTime, err = c.wdelayer.GetEmergencyModeStartingTime(c.opts) return tracerr.Wrap(err) }); err != nil { - return nil, tracerr.Wrap(err) + return 0, tracerr.Wrap(err) } - return emergencyModeStartingTime, nil + return int64(_emergencyModeStartingTime), nil } // WDelayerEnableEmergencyMode is the interface to call the smart contract function @@ -368,8 +378,38 @@ var ( logWDelayerEscapeHatchWithdrawal = crypto.Keccak256Hash([]byte("EscapeHatchWithdrawal(address,address,address,uint256)")) logWDelayerNewEmergencyCouncil = crypto.Keccak256Hash([]byte("NewEmergencyCouncil(address)")) logWDelayerNewHermezGovernanceAddress = crypto.Keccak256Hash([]byte("NewHermezGovernanceAddress(address)")) + logWDelayerInitialize = crypto.Keccak256Hash([]byte( + "InitializeWithdrawalDelayerEvent(uint64,address,address)")) ) +// WDelayerEventInit returns the initialize event with its corresponding block number +func (c *WDelayerClient) WDelayerEventInit() (*WDelayerEventInitialize, int64, error) { + query := ethereum.FilterQuery{ + Addresses: []ethCommon.Address{ + c.address, + }, + Topics: [][]ethCommon.Hash{{logWDelayerInitialize}}, + } + logs, err := c.client.client.FilterLogs(context.Background(), query) + if err != nil { + return nil, 0, tracerr.Wrap(err) + } + if len(logs) != 1 { + return nil, 0, fmt.Errorf("no event of type InitializeWithdrawalDelayerEvent found") + } + vLog := logs[0] + if vLog.Topics[0] != logWDelayerInitialize { + return nil, 0, fmt.Errorf("event is not InitializeWithdrawalDelayerEvent") + } + + var wDelayerInit WDelayerEventInitialize + if err := c.contractAbi.UnpackIntoInterface(&wDelayerInit, "InitializeWithdrawalDelayerEvent", + vLog.Data); err != nil { + return nil, 0, tracerr.Wrap(err) + } + return &wDelayerInit, int64(vLog.BlockNumber), err +} + // WDelayerEventsByBlock returns the events in a block that happened in the // WDelayer Smart Contract and the blockHash where the eents happened. If // there are no events in that block, blockHash is nil. @@ -402,7 +442,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, switch vLog.Topics[0] { case logWDelayerDeposit: var deposit WDelayerEventDeposit - err := c.contractAbi.Unpack(&deposit, "Deposit", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&deposit, "Deposit", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -413,7 +453,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, case logWDelayerWithdraw: var withdraw WDelayerEventWithdraw - err := c.contractAbi.Unpack(&withdraw, "Withdraw", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&withdraw, "Withdraw", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -427,7 +467,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, case logWDelayerNewWithdrawalDelay: var withdrawalDelay WDelayerEventNewWithdrawalDelay - err := c.contractAbi.Unpack(&withdrawalDelay, "NewWithdrawalDelay", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&withdrawalDelay, "NewWithdrawalDelay", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -435,7 +475,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, case logWDelayerEscapeHatchWithdrawal: var escapeHatchWithdrawal WDelayerEventEscapeHatchWithdrawal - err := c.contractAbi.Unpack(&escapeHatchWithdrawal, "EscapeHatchWithdrawal", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&escapeHatchWithdrawal, "EscapeHatchWithdrawal", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -446,7 +486,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, case logWDelayerNewEmergencyCouncil: var emergencyCouncil WDelayerEventNewEmergencyCouncil - err := c.contractAbi.Unpack(&emergencyCouncil, "NewEmergencyCouncil", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&emergencyCouncil, "NewEmergencyCouncil", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } @@ -454,7 +494,7 @@ func (c *WDelayerClient) WDelayerEventsByBlock(blockNum int64) (*WDelayerEvents, case logWDelayerNewHermezGovernanceAddress: var governanceAddress WDelayerEventNewHermezGovernanceAddress - err := c.contractAbi.Unpack(&governanceAddress, "NewHermezGovernanceAddress", vLog.Data) + err := c.contractAbi.UnpackIntoInterface(&governanceAddress, "NewHermezGovernanceAddress", vLog.Data) if err != nil { return nil, nil, tracerr.Wrap(err) } diff --git a/eth/wdelayer_test.go b/eth/wdelayer_test.go index 8b11fcf..43bc0fc 100644 --- a/eth/wdelayer_test.go +++ b/eth/wdelayer_test.go @@ -12,11 +12,20 @@ import ( var wdelayerClient *WDelayerClient var wdelayerClientTest *WDelayerClient -var initWithdrawalDelay = big.NewInt(60) -var newWithdrawalDelay = big.NewInt(79) +var initWithdrawalDelay int64 = 60 +var newWithdrawalDelay int64 = 79 var maxEmergencyModeTime = time.Hour * 24 * 7 * 26 var maxWithdrawalDelay = time.Hour * 24 * 7 * 2 +func TestWDelayerInit(t *testing.T) { + wDelayerInit, blockNum, err := wdelayerClientTest.WDelayerEventInit() + require.NoError(t, err) + assert.Equal(t, int64(16), blockNum) + assert.Equal(t, uint64(initWithdrawalDelay), wDelayerInit.InitialWithdrawalDelay) + assert.Equal(t, governanceAddressConst, wDelayerInit.InitialHermezGovernanceAddress) + assert.Equal(t, emergencyCouncilAddressConst, wDelayerInit.InitialEmergencyCouncil) +} + func TestWDelayerConstants(t *testing.T) { wDelayerConstants, err := wdelayerClientTest.WDelayerConstants() require.Nil(t, err) @@ -94,7 +103,7 @@ func TestWDelayerGetWithdrawalDelay(t *testing.T) { } func TestWDelayerChangeWithdrawalDelay(t *testing.T) { - _, err := wdelayerClientTest.WDelayerChangeWithdrawalDelay(newWithdrawalDelay.Uint64()) + _, err := wdelayerClientTest.WDelayerChangeWithdrawalDelay(uint64(newWithdrawalDelay)) require.Nil(t, err) withdrawalDelay, err := wdelayerClientTest.WDelayerGetWithdrawalDelay() require.Nil(t, err) @@ -103,7 +112,7 @@ func TestWDelayerChangeWithdrawalDelay(t *testing.T) { require.Nil(t, err) wdelayerEvents, _, err := wdelayerClientTest.WDelayerEventsByBlock(currentBlockNum) require.Nil(t, err) - assert.Equal(t, newWithdrawalDelay.Uint64(), wdelayerEvents.NewWithdrawalDelay[0].WithdrawalDelay) + assert.Equal(t, uint64(newWithdrawalDelay), wdelayerEvents.NewWithdrawalDelay[0].WithdrawalDelay) } func TestWDelayerDeposit(t *testing.T) { @@ -135,7 +144,7 @@ func TestWDelayerWithdrawal(t *testing.T) { amount.SetString("1100000000000000000", 10) _, err := wdelayerClientTest.WDelayerWithdrawal(auxAddressConst, tokenHEZAddressConst) require.Contains(t, err.Error(), "WITHDRAWAL_NOT_ALLOWED") - addTime(float64(newWithdrawalDelay.Int64()), ethClientDialURL) + addTime(float64(newWithdrawalDelay), ethClientDialURL) addBlock(ethClientDialURL) _, err = wdelayerClientTest.WDelayerWithdrawal(auxAddressConst, tokenHEZAddressConst) require.Nil(t, err) @@ -185,7 +194,7 @@ func TestWDelayerGetEmergencyModeStartingTime(t *testing.T) { // contract construction. Since we called WDelayerEnableEmergencyMode // previously, `emergencyModeStartingTime` is set to the time when the // call was made, so it's > 0. - assert.True(t, emergencyModeStartingTime.Cmp(big.NewInt(0)) == 1) + assert.Greater(t, emergencyModeStartingTime, int64(0)) } func TestWDelayerEscapeHatchWithdrawal(t *testing.T) { diff --git a/go.mod b/go.mod index c52e522..f950d32 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,9 @@ go 1.14 require ( github.com/BurntSushi/toml v0.3.1 github.com/aristanetworks/goarista v0.0.0-20190912214011-b54698eaaca6 + github.com/btcsuite/btcd v0.21.0-beta // indirect github.com/dghubble/sling v1.3.0 - github.com/ethereum/go-ethereum v1.9.17 + github.com/ethereum/go-ethereum v1.9.25 github.com/getkin/kin-openapi v0.22.0 github.com/gin-contrib/cors v1.3.1 github.com/gin-gonic/gin v1.5.0 @@ -31,8 +32,9 @@ require ( github.com/urfave/cli/v2 v2.2.0 go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 + golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 golang.org/x/net v0.0.0-20200822124328-c89045814202 + golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e // indirect golang.org/x/tools v0.0.0-20200914163123-ea50a3c84940 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/go-playground/validator.v9 v9.29.1 diff --git a/go.sum b/go.sum index 8827691..a414da8 100644 --- a/go.sum +++ b/go.sum @@ -71,13 +71,20 @@ github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32 h1:qkOC5Gd33k54tobS3 github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3 h1:A/EVblehb75cUgXA5njHPn0kLAsykn6mJGz7rnmW5W0= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= +github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d h1:yJzD/yFppdVCf6ApMkVy8cUxV0XrxdP9rVf6D87/Mng= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= +github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -129,6 +136,7 @@ github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzh github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dghubble/sling v1.3.0 h1:pZHjCJq4zJvc6qVQ5wN1jo5oNZlNE0+8T/h0XeXBUKU= github.com/dghubble/sling v1.3.0/go.mod h1:XXShWaBWKzNLhu2OxikSNFrlsvowtz4kyRuXUG7oQKY= @@ -138,7 +146,9 @@ github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55k github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/dop251/goja v0.0.0-20200219165308-d1232e640a87/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -158,6 +168,8 @@ github.com/ethereum/go-ethereum v1.9.12/go.mod h1:PvsVkQmhZFx92Y+h2ylythYlheEDt/ github.com/ethereum/go-ethereum v1.9.13/go.mod h1:qwN9d1GLyDh0N7Ab8bMGd0H9knaji2jOBm2RrMGjXls= github.com/ethereum/go-ethereum v1.9.17 h1:2D02O8KcoyQHxfizvMi0vGXXzFIkQTMeKXwt0+4SYEA= github.com/ethereum/go-ethereum v1.9.17/go.mod h1:kihoiSg74VC4dZAXMkmoWp70oQabz48BJg1tuzricFc= +github.com/ethereum/go-ethereum v1.9.25 h1:mMiw/zOOtCLdGLWfcekua0qPrJTe7FVIiHJ4IKNTfR0= +github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -168,6 +180,7 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= @@ -244,11 +257,20 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 h1:lMm2hD9Fy0ynom5+85/pbdkiYcBqM1JWmhpAXLmy0fw= github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 h1:ur2rms48b3Ep1dxh7aUV2FZEQ8jEVO2F6ILKx8ofkAg= +github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -258,6 +280,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -304,6 +327,8 @@ github.com/hermeznetwork/tracerr v0.3.1-0.20201126162137-de9930d0cf29 h1:dlXz/aV github.com/hermeznetwork/tracerr v0.3.1-0.20201126162137-de9930d0cf29/go.mod h1:nsWC1+tc4qUEbUGRv4DcPJJTjLsedlPajlFmpJoohK4= github.com/holiman/uint256 v1.1.0 h1:Iye6ze0DW9s+7EMn8y6Q4ebegDzpu28JQHEVM1Bq+Wg= github.com/holiman/uint256 v1.1.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= +github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -345,6 +370,7 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJye github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a h1:zPPuIq2jAWWPTrGt70eK/BSch+gFAGrNzecsoENgu2o= @@ -464,6 +490,7 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -476,9 +503,14 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= @@ -618,6 +650,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/syndtr/goleveldb v0.0.0-20180621010148-0d5a0ceb10cf/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= @@ -692,12 +726,17 @@ golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaE golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 h1:3wPMTskHO3+O6jqTEXyFcsnuxMQOqYSaHsDxcbUXpqA= +golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= @@ -714,6 +753,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -723,6 +763,7 @@ golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -747,8 +788,10 @@ golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -785,18 +828,31 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kYgpFIzOAfeAAN7m3qQ4= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= @@ -852,6 +908,13 @@ google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -899,6 +962,7 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= diff --git a/test/ethclient.go b/test/ethclient.go index a334acb..f85650e 100644 --- a/test/ethclient.go +++ b/test/ethclient.go @@ -1599,21 +1599,21 @@ func (c *Client) WDelayerIsEmergencyMode() (bool, error) { } // WDelayerGetWithdrawalDelay is the interface to call the smart contract function -func (c *Client) WDelayerGetWithdrawalDelay() (*big.Int, error) { +func (c *Client) WDelayerGetWithdrawalDelay() (int64, error) { c.rw.RLock() defer c.rw.RUnlock() log.Error("TODO") - return nil, tracerr.Wrap(errTODO) + return 0, tracerr.Wrap(errTODO) } // WDelayerGetEmergencyModeStartingTime is the interface to call the smart contract function -func (c *Client) WDelayerGetEmergencyModeStartingTime() (*big.Int, error) { +func (c *Client) WDelayerGetEmergencyModeStartingTime() (int64, error) { c.rw.RLock() defer c.rw.RUnlock() log.Error("TODO") - return nil, tracerr.Wrap(errTODO) + return 0, tracerr.Wrap(errTODO) } // WDelayerEnableEmergencyMode is the interface to call the smart contract function