Browse Source

Use a non-zero from address in eth calls

feature/sql-semaphore1
Eduard S 4 years ago
parent
commit
1370bcca03
8 changed files with 382 additions and 355 deletions
  1. +25
    -23
      eth/auction.go
  2. +110
    -109
      eth/contracts/auction/HermezAuctionProtocol.go
  3. +99
    -98
      eth/contracts/hermez/Hermez.go
  4. +41
    -40
      eth/contracts/tokenHEZ/HEZ.go
  5. +62
    -61
      eth/contracts/withdrawdelayer/WithdrawalDelayer.go
  6. +21
    -4
      eth/ethereum.go
  7. +13
    -11
      eth/rollup.go
  8. +11
    -9
      eth/wdelayer.go

+ 25
- 23
eth/auction.go

@ -236,6 +236,7 @@ type AuctionClient struct {
auction *HermezAuctionProtocol.HermezAuctionProtocol auction *HermezAuctionProtocol.HermezAuctionProtocol
tokenHEZ *HEZ.HEZ tokenHEZ *HEZ.HEZ
contractAbi abi.ABI contractAbi abi.ABI
opts *bind.CallOpts
} }
// NewAuctionClient creates a new AuctionClient. `tokenAddress` is the address of the HEZ tokens. // NewAuctionClient creates a new AuctionClient. `tokenAddress` is the address of the HEZ tokens.
@ -259,6 +260,7 @@ func NewAuctionClient(client *EthereumClient, address ethCommon.Address, tokenHE
auction: auction, auction: auction,
tokenHEZ: tokenHEZ, tokenHEZ: tokenHEZ,
contractAbi: contractAbi, contractAbi: contractAbi,
opts: newCallOpts(),
}, nil }, nil
} }
@ -280,7 +282,7 @@ func (c *AuctionClient) AuctionSetSlotDeadline(newDeadline uint8) (*types.Transa
// AuctionGetSlotDeadline is the interface to call the smart contract function // AuctionGetSlotDeadline is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetSlotDeadline() (slotDeadline uint8, err error) { func (c *AuctionClient) AuctionGetSlotDeadline() (slotDeadline uint8, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
slotDeadline, err = c.auction.GetSlotDeadline(nil)
slotDeadline, err = c.auction.GetSlotDeadline(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -304,7 +306,7 @@ func (c *AuctionClient) AuctionSetOpenAuctionSlots(newOpenAuctionSlots uint16) (
// AuctionGetOpenAuctionSlots is the interface to call the smart contract function // AuctionGetOpenAuctionSlots is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetOpenAuctionSlots() (openAuctionSlots uint16, err error) { func (c *AuctionClient) AuctionGetOpenAuctionSlots() (openAuctionSlots uint16, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
openAuctionSlots, err = c.auction.GetOpenAuctionSlots(nil)
openAuctionSlots, err = c.auction.GetOpenAuctionSlots(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -328,7 +330,7 @@ func (c *AuctionClient) AuctionSetClosedAuctionSlots(newClosedAuctionSlots uint1
// AuctionGetClosedAuctionSlots is the interface to call the smart contract function // AuctionGetClosedAuctionSlots is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetClosedAuctionSlots() (closedAuctionSlots uint16, err error) { func (c *AuctionClient) AuctionGetClosedAuctionSlots() (closedAuctionSlots uint16, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
closedAuctionSlots, err = c.auction.GetClosedAuctionSlots(nil)
closedAuctionSlots, err = c.auction.GetClosedAuctionSlots(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -352,7 +354,7 @@ func (c *AuctionClient) AuctionSetOutbidding(newOutbidding uint16) (tx *types.Tr
// AuctionGetOutbidding is the interface to call the smart contract function // AuctionGetOutbidding is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetOutbidding() (outbidding uint16, err error) { func (c *AuctionClient) AuctionGetOutbidding() (outbidding uint16, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
outbidding, err = c.auction.GetOutbidding(nil)
outbidding, err = c.auction.GetOutbidding(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -376,7 +378,7 @@ func (c *AuctionClient) AuctionSetAllocationRatio(newAllocationRatio [3]uint16)
// AuctionGetAllocationRatio is the interface to call the smart contract function // AuctionGetAllocationRatio is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetAllocationRatio() (allocationRation [3]uint16, err error) { func (c *AuctionClient) AuctionGetAllocationRatio() (allocationRation [3]uint16, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
allocationRation, err = c.auction.GetAllocationRatio(nil)
allocationRation, err = c.auction.GetAllocationRatio(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return [3]uint16{}, tracerr.Wrap(err) return [3]uint16{}, tracerr.Wrap(err)
@ -401,7 +403,7 @@ func (c *AuctionClient) AuctionSetDonationAddress(newDonationAddress ethCommon.A
func (c *AuctionClient) AuctionGetDonationAddress() (donationAddress *ethCommon.Address, err error) { func (c *AuctionClient) AuctionGetDonationAddress() (donationAddress *ethCommon.Address, err error) {
var _donationAddress ethCommon.Address var _donationAddress ethCommon.Address
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_donationAddress, err = c.auction.GetDonationAddress(nil)
_donationAddress, err = c.auction.GetDonationAddress(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -426,7 +428,7 @@ func (c *AuctionClient) AuctionSetBootCoordinator(newBootCoordinator ethCommon.A
func (c *AuctionClient) AuctionGetBootCoordinator() (bootCoordinator *ethCommon.Address, err error) { func (c *AuctionClient) AuctionGetBootCoordinator() (bootCoordinator *ethCommon.Address, err error) {
var _bootCoordinator ethCommon.Address var _bootCoordinator ethCommon.Address
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_bootCoordinator, err = c.auction.GetBootCoordinator(nil)
_bootCoordinator, err = c.auction.GetBootCoordinator(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -451,7 +453,7 @@ func (c *AuctionClient) AuctionChangeDefaultSlotSetBid(slotSet int64, newInitial
// AuctionGetClaimableHEZ is the interface to call the smart contract function // AuctionGetClaimableHEZ is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetClaimableHEZ(claimAddress ethCommon.Address) (claimableHEZ *big.Int, err error) { func (c *AuctionClient) AuctionGetClaimableHEZ(claimAddress ethCommon.Address) (claimableHEZ *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
claimableHEZ, err = c.auction.GetClaimableHEZ(nil, claimAddress)
claimableHEZ, err = c.auction.GetClaimableHEZ(c.opts, claimAddress)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -476,7 +478,7 @@ func (c *AuctionClient) AuctionSetCoordinator(forger ethCommon.Address, coordina
func (c *AuctionClient) AuctionGetCurrentSlotNumber() (currentSlotNumber int64, err error) { func (c *AuctionClient) AuctionGetCurrentSlotNumber() (currentSlotNumber int64, err error) {
var _currentSlotNumber *big.Int var _currentSlotNumber *big.Int
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_currentSlotNumber, err = c.auction.GetCurrentSlotNumber(nil)
_currentSlotNumber, err = c.auction.GetCurrentSlotNumber(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -488,7 +490,7 @@ func (c *AuctionClient) AuctionGetCurrentSlotNumber() (currentSlotNumber int64,
func (c *AuctionClient) AuctionGetMinBidBySlot(slot int64) (minBid *big.Int, err error) { func (c *AuctionClient) AuctionGetMinBidBySlot(slot int64) (minBid *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
slotToSend := big.NewInt(slot) slotToSend := big.NewInt(slot)
minBid, err = c.auction.GetMinBidBySlot(nil, slotToSend)
minBid, err = c.auction.GetMinBidBySlot(c.opts, slotToSend)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return big.NewInt(0), tracerr.Wrap(err) return big.NewInt(0), tracerr.Wrap(err)
@ -500,7 +502,7 @@ func (c *AuctionClient) AuctionGetMinBidBySlot(slot int64) (minBid *big.Int, err
func (c *AuctionClient) AuctionGetSlotSet(slot int64) (slotSet *big.Int, err error) { func (c *AuctionClient) AuctionGetSlotSet(slot int64) (slotSet *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
slotToSend := big.NewInt(slot) slotToSend := big.NewInt(slot)
slotSet, err = c.auction.GetSlotSet(nil, slotToSend)
slotSet, err = c.auction.GetSlotSet(c.opts, slotToSend)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return big.NewInt(0), tracerr.Wrap(err) return big.NewInt(0), tracerr.Wrap(err)
@ -511,7 +513,7 @@ func (c *AuctionClient) AuctionGetSlotSet(slot int64) (slotSet *big.Int, err err
// AuctionGetDefaultSlotSetBid is the interface to call the smart contract function // AuctionGetDefaultSlotSetBid is the interface to call the smart contract function
func (c *AuctionClient) AuctionGetDefaultSlotSetBid(slotSet uint8) (minBidSlotSet *big.Int, err error) { func (c *AuctionClient) AuctionGetDefaultSlotSetBid(slotSet uint8) (minBidSlotSet *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
minBidSlotSet, err = c.auction.GetDefaultSlotSetBid(nil, slotSet)
minBidSlotSet, err = c.auction.GetDefaultSlotSetBid(c.opts, slotSet)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return big.NewInt(0), tracerr.Wrap(err) return big.NewInt(0), tracerr.Wrap(err)
@ -523,7 +525,7 @@ func (c *AuctionClient) AuctionGetDefaultSlotSetBid(slotSet uint8) (minBidSlotSe
func (c *AuctionClient) AuctionGetSlotNumber(blockNum int64) (slot int64, err error) { func (c *AuctionClient) AuctionGetSlotNumber(blockNum int64) (slot int64, err error) {
var _slot *big.Int var _slot *big.Int
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_slot, err = c.auction.GetSlotNumber(nil, big.NewInt(blockNum))
_slot, err = c.auction.GetSlotNumber(c.opts, big.NewInt(blockNum))
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return 0, tracerr.Wrap(err) return 0, tracerr.Wrap(err)
@ -538,7 +540,7 @@ func (c *AuctionClient) AuctionBid(amount *big.Int, slot int64, bidAmount *big.I
func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) { func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) {
owner := c.client.account.Address owner := c.client.account.Address
spender := c.address spender := c.address
nonce, err := c.tokenHEZ.Nonces(nil, owner)
nonce, err := c.tokenHEZ.Nonces(c.opts, owner)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
@ -565,7 +567,7 @@ func (c *AuctionClient) AuctionMultiBid(amount *big.Int, startingSlot, endingSlo
func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) { func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) {
owner := c.client.account.Address owner := c.client.account.Address
spender := c.address spender := c.address
nonce, err := c.tokenHEZ.Nonces(nil, owner)
nonce, err := c.tokenHEZ.Nonces(c.opts, owner)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
@ -589,7 +591,7 @@ func (c *AuctionClient) AuctionMultiBid(amount *big.Int, startingSlot, endingSlo
// AuctionCanForge is the interface to call the smart contract function // AuctionCanForge is the interface to call the smart contract function
func (c *AuctionClient) AuctionCanForge(forger ethCommon.Address, blockNum int64) (canForge bool, err error) { func (c *AuctionClient) AuctionCanForge(forger ethCommon.Address, blockNum int64) (canForge bool, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
canForge, err = c.auction.CanForge(nil, forger, big.NewInt(blockNum))
canForge, err = c.auction.CanForge(c.opts, forger, big.NewInt(blockNum))
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return false, tracerr.Wrap(err) return false, tracerr.Wrap(err)
@ -627,28 +629,28 @@ func (c *AuctionClient) AuctionForge(forger ethCommon.Address) (tx *types.Transa
func (c *AuctionClient) AuctionConstants() (auctionConstants *common.AuctionConstants, err error) { func (c *AuctionClient) AuctionConstants() (auctionConstants *common.AuctionConstants, err error) {
auctionConstants = new(common.AuctionConstants) auctionConstants = new(common.AuctionConstants)
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
auctionConstants.BlocksPerSlot, err = c.auction.BLOCKSPERSLOT(nil)
auctionConstants.BlocksPerSlot, err = c.auction.BLOCKSPERSLOT(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
genesisBlock, err := c.auction.GenesisBlock(nil)
genesisBlock, err := c.auction.GenesisBlock(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionConstants.GenesisBlockNum = genesisBlock.Int64() auctionConstants.GenesisBlockNum = genesisBlock.Int64()
auctionConstants.HermezRollup, err = c.auction.HermezRollup(nil)
auctionConstants.HermezRollup, err = c.auction.HermezRollup(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionConstants.InitialMinimalBidding, err = c.auction.INITIALMINIMALBIDDING(nil)
auctionConstants.InitialMinimalBidding, err = c.auction.INITIALMINIMALBIDDING(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionConstants.GovernanceAddress, err = c.auction.GovernanceAddress(nil)
auctionConstants.GovernanceAddress, err = c.auction.GovernanceAddress(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionConstants.TokenHEZ, err = c.auction.TokenHEZ(nil)
auctionConstants.TokenHEZ, err = c.auction.TokenHEZ(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -669,7 +671,7 @@ func (c *AuctionClient) AuctionVariables() (auctionVariables *common.AuctionVari
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionVariables.BootCoordinator = *bootCoordinator auctionVariables.BootCoordinator = *bootCoordinator
auctionVariables.BootCoordinatorURL, err = c.auction.BootCoordinatorURL(nil)
auctionVariables.BootCoordinatorURL, err = c.auction.BootCoordinatorURL(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }

+ 110
- 109
eth/contracts/auction/HermezAuctionProtocol.go

@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/hermeznetwork/tracerr"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -36,12 +37,12 @@ var HermezAuctionProtocolBin = "0x608060405234801561001057600080fd5b506143a48061
func DeployHermezAuctionProtocol(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *HermezAuctionProtocol, error) { func DeployHermezAuctionProtocol(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *HermezAuctionProtocol, error) {
parsed, err := abi.JSON(strings.NewReader(HermezAuctionProtocolABI)) parsed, err := abi.JSON(strings.NewReader(HermezAuctionProtocolABI))
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
return common.Address{}, nil, nil, tracerr.Wrap(err)
} }
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezAuctionProtocolBin), backend) address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezAuctionProtocolBin), backend)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
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 return address, tx, &HermezAuctionProtocol{HermezAuctionProtocolCaller: HermezAuctionProtocolCaller{contract: contract}, HermezAuctionProtocolTransactor: HermezAuctionProtocolTransactor{contract: contract}, HermezAuctionProtocolFilterer: HermezAuctionProtocolFilterer{contract: contract}}, nil
} }
@ -109,7 +110,7 @@ type HermezAuctionProtocolTransactorRaw struct {
func NewHermezAuctionProtocol(address common.Address, backend bind.ContractBackend) (*HermezAuctionProtocol, error) { func NewHermezAuctionProtocol(address common.Address, backend bind.ContractBackend) (*HermezAuctionProtocol, error) {
contract, err := bindHermezAuctionProtocol(address, backend, backend, backend) contract, err := bindHermezAuctionProtocol(address, backend, backend, backend)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocol{HermezAuctionProtocolCaller: HermezAuctionProtocolCaller{contract: contract}, HermezAuctionProtocolTransactor: HermezAuctionProtocolTransactor{contract: contract}, HermezAuctionProtocolFilterer: HermezAuctionProtocolFilterer{contract: contract}}, nil return &HermezAuctionProtocol{HermezAuctionProtocolCaller: HermezAuctionProtocolCaller{contract: contract}, HermezAuctionProtocolTransactor: HermezAuctionProtocolTransactor{contract: contract}, HermezAuctionProtocolFilterer: HermezAuctionProtocolFilterer{contract: contract}}, nil
} }
@ -118,7 +119,7 @@ func NewHermezAuctionProtocol(address common.Address, backend bind.ContractBacke
func NewHermezAuctionProtocolCaller(address common.Address, caller bind.ContractCaller) (*HermezAuctionProtocolCaller, error) { func NewHermezAuctionProtocolCaller(address common.Address, caller bind.ContractCaller) (*HermezAuctionProtocolCaller, error) {
contract, err := bindHermezAuctionProtocol(address, caller, nil, nil) contract, err := bindHermezAuctionProtocol(address, caller, nil, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolCaller{contract: contract}, nil return &HermezAuctionProtocolCaller{contract: contract}, nil
} }
@ -127,7 +128,7 @@ func NewHermezAuctionProtocolCaller(address common.Address, caller bind.Contract
func NewHermezAuctionProtocolTransactor(address common.Address, transactor bind.ContractTransactor) (*HermezAuctionProtocolTransactor, error) { func NewHermezAuctionProtocolTransactor(address common.Address, transactor bind.ContractTransactor) (*HermezAuctionProtocolTransactor, error) {
contract, err := bindHermezAuctionProtocol(address, nil, transactor, nil) contract, err := bindHermezAuctionProtocol(address, nil, transactor, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolTransactor{contract: contract}, nil return &HermezAuctionProtocolTransactor{contract: contract}, nil
} }
@ -136,7 +137,7 @@ func NewHermezAuctionProtocolTransactor(address common.Address, transactor bind.
func NewHermezAuctionProtocolFilterer(address common.Address, filterer bind.ContractFilterer) (*HermezAuctionProtocolFilterer, error) { func NewHermezAuctionProtocolFilterer(address common.Address, filterer bind.ContractFilterer) (*HermezAuctionProtocolFilterer, error) {
contract, err := bindHermezAuctionProtocol(address, nil, nil, filterer) contract, err := bindHermezAuctionProtocol(address, nil, nil, filterer)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolFilterer{contract: contract}, nil return &HermezAuctionProtocolFilterer{contract: contract}, nil
} }
@ -145,7 +146,7 @@ func NewHermezAuctionProtocolFilterer(address common.Address, filterer bind.Cont
func bindHermezAuctionProtocol(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { func bindHermezAuctionProtocol(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(HermezAuctionProtocolABI)) parsed, err := abi.JSON(strings.NewReader(HermezAuctionProtocolABI))
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
} }
@ -197,7 +198,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) BLOCKSPERSLOT(opts *b
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "BLOCKS_PER_SLOT") err := _HermezAuctionProtocol.contract.Call(opts, out, "BLOCKS_PER_SLOT")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// BLOCKSPERSLOT is a free data retrieval call binding the contract method 0x2243de47. // BLOCKSPERSLOT is a free data retrieval call binding the contract method 0x2243de47.
@ -223,7 +224,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) INITIALMINIMALBIDDING
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "INITIAL_MINIMAL_BIDDING") err := _HermezAuctionProtocol.contract.Call(opts, out, "INITIAL_MINIMAL_BIDDING")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// INITIALMINIMALBIDDING is a free data retrieval call binding the contract method 0xe6065914. // INITIALMINIMALBIDDING is a free data retrieval call binding the contract method 0xe6065914.
@ -249,7 +250,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) BootCoordinatorURL(op
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "bootCoordinatorURL") err := _HermezAuctionProtocol.contract.Call(opts, out, "bootCoordinatorURL")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// BootCoordinatorURL is a free data retrieval call binding the contract method 0x72ca58a3. // BootCoordinatorURL is a free data retrieval call binding the contract method 0x72ca58a3.
@ -275,7 +276,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) CanForge(opts *bind.C
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "canForge", forger, blockNumber) err := _HermezAuctionProtocol.contract.Call(opts, out, "canForge", forger, blockNumber)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// CanForge is a free data retrieval call binding the contract method 0x83b1f6a0. // CanForge is a free data retrieval call binding the contract method 0x83b1f6a0.
@ -305,7 +306,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) Coordinators(opts *bi
}) })
out := ret out := ret
err := _HermezAuctionProtocol.contract.Call(opts, out, "coordinators", arg0) err := _HermezAuctionProtocol.contract.Call(opts, out, "coordinators", arg0)
return *ret, err
return *ret, tracerr.Wrap(err)
} }
// Coordinators is a free data retrieval call binding the contract method 0xa48af096. // Coordinators is a free data retrieval call binding the contract method 0xa48af096.
@ -337,7 +338,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GenesisBlock(opts *bi
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "genesisBlock") err := _HermezAuctionProtocol.contract.Call(opts, out, "genesisBlock")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GenesisBlock is a free data retrieval call binding the contract method 0x4cdc9c63. // GenesisBlock is a free data retrieval call binding the contract method 0x4cdc9c63.
@ -363,7 +364,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetAllocationRatio(op
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getAllocationRatio") err := _HermezAuctionProtocol.contract.Call(opts, out, "getAllocationRatio")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetAllocationRatio is a free data retrieval call binding the contract method 0xec29159b. // GetAllocationRatio is a free data retrieval call binding the contract method 0xec29159b.
@ -389,7 +390,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetBootCoordinator(op
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getBootCoordinator") err := _HermezAuctionProtocol.contract.Call(opts, out, "getBootCoordinator")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetBootCoordinator is a free data retrieval call binding the contract method 0xb5f7f2f0. // GetBootCoordinator is a free data retrieval call binding the contract method 0xb5f7f2f0.
@ -415,7 +416,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetClaimableHEZ(opts
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getClaimableHEZ", bidder) err := _HermezAuctionProtocol.contract.Call(opts, out, "getClaimableHEZ", bidder)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetClaimableHEZ is a free data retrieval call binding the contract method 0x5cca4903. // GetClaimableHEZ is a free data retrieval call binding the contract method 0x5cca4903.
@ -441,7 +442,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetClosedAuctionSlots
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getClosedAuctionSlots") err := _HermezAuctionProtocol.contract.Call(opts, out, "getClosedAuctionSlots")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetClosedAuctionSlots is a free data retrieval call binding the contract method 0x4da9639d. // GetClosedAuctionSlots is a free data retrieval call binding the contract method 0x4da9639d.
@ -467,7 +468,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetCurrentSlotNumber(
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getCurrentSlotNumber") err := _HermezAuctionProtocol.contract.Call(opts, out, "getCurrentSlotNumber")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetCurrentSlotNumber is a free data retrieval call binding the contract method 0x0c4da4f6. // GetCurrentSlotNumber is a free data retrieval call binding the contract method 0x0c4da4f6.
@ -493,7 +494,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetDefaultSlotSetBid(
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getDefaultSlotSetBid", slotSet) err := _HermezAuctionProtocol.contract.Call(opts, out, "getDefaultSlotSetBid", slotSet)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetDefaultSlotSetBid is a free data retrieval call binding the contract method 0x564e6a71. // GetDefaultSlotSetBid is a free data retrieval call binding the contract method 0x564e6a71.
@ -519,7 +520,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetDonationAddress(op
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getDonationAddress") err := _HermezAuctionProtocol.contract.Call(opts, out, "getDonationAddress")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetDonationAddress is a free data retrieval call binding the contract method 0x54c03ab7. // GetDonationAddress is a free data retrieval call binding the contract method 0x54c03ab7.
@ -545,7 +546,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetMinBidBySlot(opts
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getMinBidBySlot", slot) err := _HermezAuctionProtocol.contract.Call(opts, out, "getMinBidBySlot", slot)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetMinBidBySlot is a free data retrieval call binding the contract method 0x37d1bd0b. // GetMinBidBySlot is a free data retrieval call binding the contract method 0x37d1bd0b.
@ -571,7 +572,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetOpenAuctionSlots(o
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getOpenAuctionSlots") err := _HermezAuctionProtocol.contract.Call(opts, out, "getOpenAuctionSlots")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetOpenAuctionSlots is a free data retrieval call binding the contract method 0xac4b9012. // GetOpenAuctionSlots is a free data retrieval call binding the contract method 0xac4b9012.
@ -597,7 +598,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetOutbidding(opts *b
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getOutbidding") err := _HermezAuctionProtocol.contract.Call(opts, out, "getOutbidding")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetOutbidding is a free data retrieval call binding the contract method 0x55b442e6. // GetOutbidding is a free data retrieval call binding the contract method 0x55b442e6.
@ -623,7 +624,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotDeadline(opts
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotDeadline") err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotDeadline")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetSlotDeadline is a free data retrieval call binding the contract method 0x13de9af2. // GetSlotDeadline is a free data retrieval call binding the contract method 0x13de9af2.
@ -649,7 +650,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotNumber(opts *b
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotNumber", blockNumber) err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotNumber", blockNumber)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetSlotNumber is a free data retrieval call binding the contract method 0xb3dc7bb1. // GetSlotNumber is a free data retrieval call binding the contract method 0xb3dc7bb1.
@ -675,7 +676,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GetSlotSet(opts *bind
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotSet", slot) err := _HermezAuctionProtocol.contract.Call(opts, out, "getSlotSet", slot)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetSlotSet is a free data retrieval call binding the contract method 0xac5f658b. // GetSlotSet is a free data retrieval call binding the contract method 0xac5f658b.
@ -701,7 +702,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) GovernanceAddress(opt
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "governanceAddress") err := _HermezAuctionProtocol.contract.Call(opts, out, "governanceAddress")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GovernanceAddress is a free data retrieval call binding the contract method 0x795053d3. // GovernanceAddress is a free data retrieval call binding the contract method 0x795053d3.
@ -727,7 +728,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) HermezRollup(opts *bi
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "hermezRollup") err := _HermezAuctionProtocol.contract.Call(opts, out, "hermezRollup")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// HermezRollup is a free data retrieval call binding the contract method 0xaebd6d98. // HermezRollup is a free data retrieval call binding the contract method 0xaebd6d98.
@ -753,7 +754,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) PendingBalances(opts
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "pendingBalances", arg0) err := _HermezAuctionProtocol.contract.Call(opts, out, "pendingBalances", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// PendingBalances is a free data retrieval call binding the contract method 0xecdae41b. // PendingBalances is a free data retrieval call binding the contract method 0xecdae41b.
@ -789,7 +790,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) Slots(opts *bind.Call
}) })
out := ret out := ret
err := _HermezAuctionProtocol.contract.Call(opts, out, "slots", arg0) err := _HermezAuctionProtocol.contract.Call(opts, out, "slots", arg0)
return *ret, err
return *ret, tracerr.Wrap(err)
} }
// Slots is a free data retrieval call binding the contract method 0xbc415567. // Slots is a free data retrieval call binding the contract method 0xbc415567.
@ -827,7 +828,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolCaller) TokenHEZ(opts *bind.C
) )
out := ret0 out := ret0
err := _HermezAuctionProtocol.contract.Call(opts, out, "tokenHEZ") err := _HermezAuctionProtocol.contract.Call(opts, out, "tokenHEZ")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3. // TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3.
@ -1245,7 +1246,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterHEZClaimed(op
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "HEZClaimed", ownerRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "HEZClaimed", ownerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolHEZClaimedIterator{contract: _HermezAuctionProtocol.contract, event: "HEZClaimed", logs: logs, sub: sub}, nil return &HermezAuctionProtocolHEZClaimedIterator{contract: _HermezAuctionProtocol.contract, event: "HEZClaimed", logs: logs, sub: sub}, nil
} }
@ -1262,7 +1263,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchHEZClaimed(opt
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "HEZClaimed", ownerRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "HEZClaimed", ownerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1272,19 +1273,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchHEZClaimed(opt
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolHEZClaimed) event := new(HermezAuctionProtocolHEZClaimed)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "HEZClaimed", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "HEZClaimed", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1298,7 +1299,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchHEZClaimed(opt
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseHEZClaimed(log types.Log) (*HermezAuctionProtocolHEZClaimed, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseHEZClaimed(log types.Log) (*HermezAuctionProtocolHEZClaimed, error) {
event := new(HermezAuctionProtocolHEZClaimed) event := new(HermezAuctionProtocolHEZClaimed)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "HEZClaimed", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "HEZClaimed", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1383,7 +1384,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewAllocation
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewAllocationRatio") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewAllocationRatio")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewAllocationRatioIterator{contract: _HermezAuctionProtocol.contract, event: "NewAllocationRatio", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewAllocationRatioIterator{contract: _HermezAuctionProtocol.contract, event: "NewAllocationRatio", logs: logs, sub: sub}, nil
} }
@ -1395,7 +1396,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewAllocationR
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewAllocationRatio") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewAllocationRatio")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1405,19 +1406,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewAllocationR
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewAllocationRatio) event := new(HermezAuctionProtocolNewAllocationRatio)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewAllocationRatio", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewAllocationRatio", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1431,7 +1432,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewAllocationR
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewAllocationRatio(log types.Log) (*HermezAuctionProtocolNewAllocationRatio, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewAllocationRatio(log types.Log) (*HermezAuctionProtocolNewAllocationRatio, error) {
event := new(HermezAuctionProtocolNewAllocationRatio) event := new(HermezAuctionProtocolNewAllocationRatio)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewAllocationRatio", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewAllocationRatio", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1528,7 +1529,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewBid(opts *
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewBid", slotRule, bidderRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewBid", slotRule, bidderRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewBidIterator{contract: _HermezAuctionProtocol.contract, event: "NewBid", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewBidIterator{contract: _HermezAuctionProtocol.contract, event: "NewBid", logs: logs, sub: sub}, nil
} }
@ -1550,7 +1551,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBid(opts *b
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewBid", slotRule, bidderRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewBid", slotRule, bidderRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1560,19 +1561,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBid(opts *b
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewBid) event := new(HermezAuctionProtocolNewBid)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBid", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBid", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1586,7 +1587,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBid(opts *b
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBid(log types.Log) (*HermezAuctionProtocolNewBid, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBid(log types.Log) (*HermezAuctionProtocolNewBid, error) {
event := new(HermezAuctionProtocolNewBid) event := new(HermezAuctionProtocolNewBid)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBid", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBid", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1677,7 +1678,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewBootCoordi
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewBootCoordinator", newBootCoordinatorRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewBootCoordinator", newBootCoordinatorRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewBootCoordinatorIterator{contract: _HermezAuctionProtocol.contract, event: "NewBootCoordinator", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewBootCoordinatorIterator{contract: _HermezAuctionProtocol.contract, event: "NewBootCoordinator", logs: logs, sub: sub}, nil
} }
@ -1694,7 +1695,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBootCoordin
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewBootCoordinator", newBootCoordinatorRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewBootCoordinator", newBootCoordinatorRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1704,19 +1705,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBootCoordin
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewBootCoordinator) event := new(HermezAuctionProtocolNewBootCoordinator)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBootCoordinator", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBootCoordinator", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1730,7 +1731,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewBootCoordin
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBootCoordinator(log types.Log) (*HermezAuctionProtocolNewBootCoordinator, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewBootCoordinator(log types.Log) (*HermezAuctionProtocolNewBootCoordinator, error) {
event := new(HermezAuctionProtocolNewBootCoordinator) event := new(HermezAuctionProtocolNewBootCoordinator)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBootCoordinator", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewBootCoordinator", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1815,7 +1816,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewClosedAuct
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewClosedAuctionSlots") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewClosedAuctionSlots")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewClosedAuctionSlotsIterator{contract: _HermezAuctionProtocol.contract, event: "NewClosedAuctionSlots", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewClosedAuctionSlotsIterator{contract: _HermezAuctionProtocol.contract, event: "NewClosedAuctionSlots", logs: logs, sub: sub}, nil
} }
@ -1827,7 +1828,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewClosedAucti
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewClosedAuctionSlots") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewClosedAuctionSlots")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1837,19 +1838,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewClosedAucti
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewClosedAuctionSlots) event := new(HermezAuctionProtocolNewClosedAuctionSlots)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewClosedAuctionSlots", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewClosedAuctionSlots", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1863,7 +1864,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewClosedAucti
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewClosedAuctionSlots(log types.Log) (*HermezAuctionProtocolNewClosedAuctionSlots, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewClosedAuctionSlots(log types.Log) (*HermezAuctionProtocolNewClosedAuctionSlots, error) {
event := new(HermezAuctionProtocolNewClosedAuctionSlots) event := new(HermezAuctionProtocolNewClosedAuctionSlots)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewClosedAuctionSlots", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewClosedAuctionSlots", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1949,7 +1950,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewDefaultSlo
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewDefaultSlotSetBid") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewDefaultSlotSetBid")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewDefaultSlotSetBidIterator{contract: _HermezAuctionProtocol.contract, event: "NewDefaultSlotSetBid", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewDefaultSlotSetBidIterator{contract: _HermezAuctionProtocol.contract, event: "NewDefaultSlotSetBid", logs: logs, sub: sub}, nil
} }
@ -1961,7 +1962,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDefaultSlot
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewDefaultSlotSetBid") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewDefaultSlotSetBid")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1971,19 +1972,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDefaultSlot
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewDefaultSlotSetBid) event := new(HermezAuctionProtocolNewDefaultSlotSetBid)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDefaultSlotSetBid", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDefaultSlotSetBid", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1997,7 +1998,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDefaultSlot
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDefaultSlotSetBid(log types.Log) (*HermezAuctionProtocolNewDefaultSlotSetBid, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDefaultSlotSetBid(log types.Log) (*HermezAuctionProtocolNewDefaultSlotSetBid, error) {
event := new(HermezAuctionProtocolNewDefaultSlotSetBid) event := new(HermezAuctionProtocolNewDefaultSlotSetBid)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDefaultSlotSetBid", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDefaultSlotSetBid", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2087,7 +2088,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewDonationAd
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewDonationAddress", newDonationAddressRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewDonationAddress", newDonationAddressRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewDonationAddressIterator{contract: _HermezAuctionProtocol.contract, event: "NewDonationAddress", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewDonationAddressIterator{contract: _HermezAuctionProtocol.contract, event: "NewDonationAddress", logs: logs, sub: sub}, nil
} }
@ -2104,7 +2105,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDonationAdd
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewDonationAddress", newDonationAddressRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewDonationAddress", newDonationAddressRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2114,19 +2115,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDonationAdd
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewDonationAddress) event := new(HermezAuctionProtocolNewDonationAddress)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDonationAddress", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDonationAddress", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2140,7 +2141,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewDonationAdd
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDonationAddress(log types.Log) (*HermezAuctionProtocolNewDonationAddress, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewDonationAddress(log types.Log) (*HermezAuctionProtocolNewDonationAddress, error) {
event := new(HermezAuctionProtocolNewDonationAddress) event := new(HermezAuctionProtocolNewDonationAddress)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDonationAddress", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewDonationAddress", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2235,7 +2236,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewForge(opts
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewForge", forgerRule, slotToForgeRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewForge", forgerRule, slotToForgeRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewForgeIterator{contract: _HermezAuctionProtocol.contract, event: "NewForge", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewForgeIterator{contract: _HermezAuctionProtocol.contract, event: "NewForge", logs: logs, sub: sub}, nil
} }
@ -2256,7 +2257,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForge(opts
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewForge", forgerRule, slotToForgeRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewForge", forgerRule, slotToForgeRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2266,19 +2267,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForge(opts
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewForge) event := new(HermezAuctionProtocolNewForge)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForge", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForge", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2292,7 +2293,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForge(opts
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForge(log types.Log) (*HermezAuctionProtocolNewForge, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForge(log types.Log) (*HermezAuctionProtocolNewForge, error) {
event := new(HermezAuctionProtocolNewForge) event := new(HermezAuctionProtocolNewForge)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForge", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForge", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2395,7 +2396,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewForgeAlloc
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewForgeAllocated", bidderRule, forgerRule, slotToForgeRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewForgeAllocated", bidderRule, forgerRule, slotToForgeRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewForgeAllocatedIterator{contract: _HermezAuctionProtocol.contract, event: "NewForgeAllocated", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewForgeAllocatedIterator{contract: _HermezAuctionProtocol.contract, event: "NewForgeAllocated", logs: logs, sub: sub}, nil
} }
@ -2420,7 +2421,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForgeAlloca
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewForgeAllocated", bidderRule, forgerRule, slotToForgeRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewForgeAllocated", bidderRule, forgerRule, slotToForgeRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2430,19 +2431,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForgeAlloca
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewForgeAllocated) event := new(HermezAuctionProtocolNewForgeAllocated)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForgeAllocated", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForgeAllocated", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2456,7 +2457,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewForgeAlloca
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForgeAllocated(log types.Log) (*HermezAuctionProtocolNewForgeAllocated, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewForgeAllocated(log types.Log) (*HermezAuctionProtocolNewForgeAllocated, error) {
event := new(HermezAuctionProtocolNewForgeAllocated) event := new(HermezAuctionProtocolNewForgeAllocated)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForgeAllocated", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewForgeAllocated", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2541,7 +2542,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewOpenAuctio
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewOpenAuctionSlots") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewOpenAuctionSlots")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewOpenAuctionSlotsIterator{contract: _HermezAuctionProtocol.contract, event: "NewOpenAuctionSlots", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewOpenAuctionSlotsIterator{contract: _HermezAuctionProtocol.contract, event: "NewOpenAuctionSlots", logs: logs, sub: sub}, nil
} }
@ -2553,7 +2554,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOpenAuction
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewOpenAuctionSlots") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewOpenAuctionSlots")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2563,19 +2564,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOpenAuction
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewOpenAuctionSlots) event := new(HermezAuctionProtocolNewOpenAuctionSlots)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOpenAuctionSlots", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOpenAuctionSlots", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2589,7 +2590,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOpenAuction
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOpenAuctionSlots(log types.Log) (*HermezAuctionProtocolNewOpenAuctionSlots, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOpenAuctionSlots(log types.Log) (*HermezAuctionProtocolNewOpenAuctionSlots, error) {
event := new(HermezAuctionProtocolNewOpenAuctionSlots) event := new(HermezAuctionProtocolNewOpenAuctionSlots)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOpenAuctionSlots", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOpenAuctionSlots", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2674,7 +2675,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewOutbidding
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewOutbidding") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewOutbidding")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewOutbiddingIterator{contract: _HermezAuctionProtocol.contract, event: "NewOutbidding", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewOutbiddingIterator{contract: _HermezAuctionProtocol.contract, event: "NewOutbidding", logs: logs, sub: sub}, nil
} }
@ -2686,7 +2687,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOutbidding(
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewOutbidding") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewOutbidding")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2696,19 +2697,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOutbidding(
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewOutbidding) event := new(HermezAuctionProtocolNewOutbidding)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOutbidding", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOutbidding", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2722,7 +2723,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewOutbidding(
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOutbidding(log types.Log) (*HermezAuctionProtocolNewOutbidding, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewOutbidding(log types.Log) (*HermezAuctionProtocolNewOutbidding, error) {
event := new(HermezAuctionProtocolNewOutbidding) event := new(HermezAuctionProtocolNewOutbidding)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOutbidding", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewOutbidding", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2807,7 +2808,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterNewSlotDeadli
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewSlotDeadline") logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "NewSlotDeadline")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolNewSlotDeadlineIterator{contract: _HermezAuctionProtocol.contract, event: "NewSlotDeadline", logs: logs, sub: sub}, nil return &HermezAuctionProtocolNewSlotDeadlineIterator{contract: _HermezAuctionProtocol.contract, event: "NewSlotDeadline", logs: logs, sub: sub}, nil
} }
@ -2819,7 +2820,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewSlotDeadlin
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewSlotDeadline") logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "NewSlotDeadline")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2829,19 +2830,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewSlotDeadlin
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolNewSlotDeadline) event := new(HermezAuctionProtocolNewSlotDeadline)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewSlotDeadline", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewSlotDeadline", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2855,7 +2856,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchNewSlotDeadlin
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewSlotDeadline(log types.Log) (*HermezAuctionProtocolNewSlotDeadline, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseNewSlotDeadline(log types.Log) (*HermezAuctionProtocolNewSlotDeadline, error) {
event := new(HermezAuctionProtocolNewSlotDeadline) event := new(HermezAuctionProtocolNewSlotDeadline)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewSlotDeadline", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "NewSlotDeadline", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2951,7 +2952,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) FilterSetCoordinato
logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "SetCoordinator", bidderRule, forgerRule) logs, sub, err := _HermezAuctionProtocol.contract.FilterLogs(opts, "SetCoordinator", bidderRule, forgerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAuctionProtocolSetCoordinatorIterator{contract: _HermezAuctionProtocol.contract, event: "SetCoordinator", logs: logs, sub: sub}, nil return &HermezAuctionProtocolSetCoordinatorIterator{contract: _HermezAuctionProtocol.contract, event: "SetCoordinator", logs: logs, sub: sub}, nil
} }
@ -2972,7 +2973,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchSetCoordinator
logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "SetCoordinator", bidderRule, forgerRule) logs, sub, err := _HermezAuctionProtocol.contract.WatchLogs(opts, "SetCoordinator", bidderRule, forgerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2982,19 +2983,19 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchSetCoordinator
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAuctionProtocolSetCoordinator) event := new(HermezAuctionProtocolSetCoordinator)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "SetCoordinator", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "SetCoordinator", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -3008,7 +3009,7 @@ func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) WatchSetCoordinator
func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseSetCoordinator(log types.Log) (*HermezAuctionProtocolSetCoordinator, error) { func (_HermezAuctionProtocol *HermezAuctionProtocolFilterer) ParseSetCoordinator(log types.Log) (*HermezAuctionProtocolSetCoordinator, error) {
event := new(HermezAuctionProtocolSetCoordinator) event := new(HermezAuctionProtocolSetCoordinator)
if err := _HermezAuctionProtocol.contract.UnpackLog(event, "SetCoordinator", log); err != nil { if err := _HermezAuctionProtocol.contract.UnpackLog(event, "SetCoordinator", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }

+ 99
- 98
eth/contracts/hermez/Hermez.go

@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/hermeznetwork/tracerr"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -36,12 +37,12 @@ var HermezBin = "0x608060405234801561001057600080fd5b5061576d806100206000396000f
func DeployHermez(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Hermez, error) { func DeployHermez(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Hermez, error) {
parsed, err := abi.JSON(strings.NewReader(HermezABI)) parsed, err := abi.JSON(strings.NewReader(HermezABI))
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
return common.Address{}, nil, nil, tracerr.Wrap(err)
} }
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezBin), backend) address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HermezBin), backend)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
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 return address, tx, &Hermez{HermezCaller: HermezCaller{contract: contract}, HermezTransactor: HermezTransactor{contract: contract}, HermezFilterer: HermezFilterer{contract: contract}}, nil
} }
@ -109,7 +110,7 @@ type HermezTransactorRaw struct {
func NewHermez(address common.Address, backend bind.ContractBackend) (*Hermez, error) { func NewHermez(address common.Address, backend bind.ContractBackend) (*Hermez, error) {
contract, err := bindHermez(address, backend, backend, backend) contract, err := bindHermez(address, backend, backend, backend)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &Hermez{HermezCaller: HermezCaller{contract: contract}, HermezTransactor: HermezTransactor{contract: contract}, HermezFilterer: HermezFilterer{contract: contract}}, nil return &Hermez{HermezCaller: HermezCaller{contract: contract}, HermezTransactor: HermezTransactor{contract: contract}, HermezFilterer: HermezFilterer{contract: contract}}, nil
} }
@ -118,7 +119,7 @@ func NewHermez(address common.Address, backend bind.ContractBackend) (*Hermez, e
func NewHermezCaller(address common.Address, caller bind.ContractCaller) (*HermezCaller, error) { func NewHermezCaller(address common.Address, caller bind.ContractCaller) (*HermezCaller, error) {
contract, err := bindHermez(address, caller, nil, nil) contract, err := bindHermez(address, caller, nil, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezCaller{contract: contract}, nil return &HermezCaller{contract: contract}, nil
} }
@ -127,7 +128,7 @@ func NewHermezCaller(address common.Address, caller bind.ContractCaller) (*Herme
func NewHermezTransactor(address common.Address, transactor bind.ContractTransactor) (*HermezTransactor, error) { func NewHermezTransactor(address common.Address, transactor bind.ContractTransactor) (*HermezTransactor, error) {
contract, err := bindHermez(address, nil, transactor, nil) contract, err := bindHermez(address, nil, transactor, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezTransactor{contract: contract}, nil return &HermezTransactor{contract: contract}, nil
} }
@ -136,7 +137,7 @@ func NewHermezTransactor(address common.Address, transactor bind.ContractTransac
func NewHermezFilterer(address common.Address, filterer bind.ContractFilterer) (*HermezFilterer, error) { func NewHermezFilterer(address common.Address, filterer bind.ContractFilterer) (*HermezFilterer, error) {
contract, err := bindHermez(address, nil, nil, filterer) contract, err := bindHermez(address, nil, nil, filterer)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezFilterer{contract: contract}, nil return &HermezFilterer{contract: contract}, nil
} }
@ -145,7 +146,7 @@ func NewHermezFilterer(address common.Address, filterer bind.ContractFilterer) (
func bindHermez(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { func bindHermez(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(HermezABI)) parsed, err := abi.JSON(strings.NewReader(HermezABI))
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
} }
@ -197,7 +198,7 @@ func (_Hermez *HermezCaller) ABSOLUTEMAXL1L2BATCHTIMEOUT(opts *bind.CallOpts) (u
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "ABSOLUTE_MAX_L1L2BATCHTIMEOUT") err := _Hermez.contract.Call(opts, out, "ABSOLUTE_MAX_L1L2BATCHTIMEOUT")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// ABSOLUTEMAXL1L2BATCHTIMEOUT is a free data retrieval call binding the contract method 0x95a09f2a. // ABSOLUTEMAXL1L2BATCHTIMEOUT is a free data retrieval call binding the contract method 0x95a09f2a.
@ -233,7 +234,7 @@ func (_Hermez *HermezCaller) Buckets(opts *bind.CallOpts, arg0 *big.Int) (struct
}) })
out := ret out := ret
err := _Hermez.contract.Call(opts, out, "buckets", arg0) err := _Hermez.contract.Call(opts, out, "buckets", arg0)
return *ret, err
return *ret, tracerr.Wrap(err)
} }
// Buckets is a free data retrieval call binding the contract method 0x9b51fb0d. // Buckets is a free data retrieval call binding the contract method 0x9b51fb0d.
@ -271,7 +272,7 @@ func (_Hermez *HermezCaller) ExitNullifierMap(opts *bind.CallOpts, arg0 uint32,
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "exitNullifierMap", arg0, arg1) err := _Hermez.contract.Call(opts, out, "exitNullifierMap", arg0, arg1)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// ExitNullifierMap is a free data retrieval call binding the contract method 0xf84f92ee. // ExitNullifierMap is a free data retrieval call binding the contract method 0xf84f92ee.
@ -297,7 +298,7 @@ func (_Hermez *HermezCaller) ExitRootsMap(opts *bind.CallOpts, arg0 uint32) (*bi
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "exitRootsMap", arg0) err := _Hermez.contract.Call(opts, out, "exitRootsMap", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// ExitRootsMap is a free data retrieval call binding the contract method 0x3ee641ea. // ExitRootsMap is a free data retrieval call binding the contract method 0x3ee641ea.
@ -323,7 +324,7 @@ func (_Hermez *HermezCaller) FeeAddToken(opts *bind.CallOpts) (*big.Int, error)
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "feeAddToken") err := _Hermez.contract.Call(opts, out, "feeAddToken")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// FeeAddToken is a free data retrieval call binding the contract method 0xbded9bb8. // FeeAddToken is a free data retrieval call binding the contract method 0xbded9bb8.
@ -349,7 +350,7 @@ func (_Hermez *HermezCaller) ForgeL1L2BatchTimeout(opts *bind.CallOpts) (uint8,
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "forgeL1L2BatchTimeout") err := _Hermez.contract.Call(opts, out, "forgeL1L2BatchTimeout")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// ForgeL1L2BatchTimeout is a free data retrieval call binding the contract method 0xa3275838. // ForgeL1L2BatchTimeout is a free data retrieval call binding the contract method 0xa3275838.
@ -375,7 +376,7 @@ func (_Hermez *HermezCaller) HermezAuctionContract(opts *bind.CallOpts) (common.
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "hermezAuctionContract") err := _Hermez.contract.Call(opts, out, "hermezAuctionContract")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// HermezAuctionContract is a free data retrieval call binding the contract method 0x2bd83626. // HermezAuctionContract is a free data retrieval call binding the contract method 0x2bd83626.
@ -401,7 +402,7 @@ func (_Hermez *HermezCaller) HermezGovernanceAddress(opts *bind.CallOpts) (commo
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "hermezGovernanceAddress") err := _Hermez.contract.Call(opts, out, "hermezGovernanceAddress")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// HermezGovernanceAddress is a free data retrieval call binding the contract method 0x013f7852. // HermezGovernanceAddress is a free data retrieval call binding the contract method 0x013f7852.
@ -427,7 +428,7 @@ func (_Hermez *HermezCaller) InstantWithdrawalViewer(opts *bind.CallOpts, tokenA
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "instantWithdrawalViewer", tokenAddress, amount) err := _Hermez.contract.Call(opts, out, "instantWithdrawalViewer", tokenAddress, amount)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// InstantWithdrawalViewer is a free data retrieval call binding the contract method 0x375110aa. // InstantWithdrawalViewer is a free data retrieval call binding the contract method 0x375110aa.
@ -453,7 +454,7 @@ func (_Hermez *HermezCaller) LastForgedBatch(opts *bind.CallOpts) (uint32, error
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "lastForgedBatch") err := _Hermez.contract.Call(opts, out, "lastForgedBatch")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// LastForgedBatch is a free data retrieval call binding the contract method 0x44e0b2ce. // LastForgedBatch is a free data retrieval call binding the contract method 0x44e0b2ce.
@ -479,7 +480,7 @@ func (_Hermez *HermezCaller) LastIdx(opts *bind.CallOpts) (*big.Int, error) {
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "lastIdx") err := _Hermez.contract.Call(opts, out, "lastIdx")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// LastIdx is a free data retrieval call binding the contract method 0xd486645c. // LastIdx is a free data retrieval call binding the contract method 0xd486645c.
@ -505,7 +506,7 @@ func (_Hermez *HermezCaller) LastL1L2Batch(opts *bind.CallOpts) (uint64, error)
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "lastL1L2Batch") err := _Hermez.contract.Call(opts, out, "lastL1L2Batch")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// LastL1L2Batch is a free data retrieval call binding the contract method 0x84ef9ed4. // LastL1L2Batch is a free data retrieval call binding the contract method 0x84ef9ed4.
@ -531,7 +532,7 @@ func (_Hermez *HermezCaller) MapL1TxQueue(opts *bind.CallOpts, arg0 uint32) ([]b
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "mapL1TxQueue", arg0) err := _Hermez.contract.Call(opts, out, "mapL1TxQueue", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// MapL1TxQueue is a free data retrieval call binding the contract method 0xdc3e718e. // MapL1TxQueue is a free data retrieval call binding the contract method 0xdc3e718e.
@ -557,7 +558,7 @@ func (_Hermez *HermezCaller) NextL1FillingQueue(opts *bind.CallOpts) (uint32, er
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "nextL1FillingQueue") err := _Hermez.contract.Call(opts, out, "nextL1FillingQueue")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// NextL1FillingQueue is a free data retrieval call binding the contract method 0x0ee8e52b. // NextL1FillingQueue is a free data retrieval call binding the contract method 0x0ee8e52b.
@ -583,7 +584,7 @@ func (_Hermez *HermezCaller) NextL1ToForgeQueue(opts *bind.CallOpts) (uint32, er
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "nextL1ToForgeQueue") err := _Hermez.contract.Call(opts, out, "nextL1ToForgeQueue")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// NextL1ToForgeQueue is a free data retrieval call binding the contract method 0xd0f32e67. // NextL1ToForgeQueue is a free data retrieval call binding the contract method 0xd0f32e67.
@ -609,7 +610,7 @@ func (_Hermez *HermezCaller) RegisterTokensCount(opts *bind.CallOpts) (*big.Int,
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "registerTokensCount") err := _Hermez.contract.Call(opts, out, "registerTokensCount")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// RegisterTokensCount is a free data retrieval call binding the contract method 0x9f34e9a3. // RegisterTokensCount is a free data retrieval call binding the contract method 0x9f34e9a3.
@ -641,7 +642,7 @@ func (_Hermez *HermezCaller) RollupVerifiers(opts *bind.CallOpts, arg0 *big.Int)
}) })
out := ret out := ret
err := _Hermez.contract.Call(opts, out, "rollupVerifiers", arg0) err := _Hermez.contract.Call(opts, out, "rollupVerifiers", arg0)
return *ret, err
return *ret, tracerr.Wrap(err)
} }
// RollupVerifiers is a free data retrieval call binding the contract method 0x38330200. // RollupVerifiers is a free data retrieval call binding the contract method 0x38330200.
@ -675,7 +676,7 @@ func (_Hermez *HermezCaller) StateRootMap(opts *bind.CallOpts, arg0 uint32) (*bi
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "stateRootMap", arg0) err := _Hermez.contract.Call(opts, out, "stateRootMap", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// StateRootMap is a free data retrieval call binding the contract method 0x9e00d7ea. // StateRootMap is a free data retrieval call binding the contract method 0x9e00d7ea.
@ -701,7 +702,7 @@ func (_Hermez *HermezCaller) TokenExchange(opts *bind.CallOpts, arg0 common.Addr
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "tokenExchange", arg0) err := _Hermez.contract.Call(opts, out, "tokenExchange", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TokenExchange is a free data retrieval call binding the contract method 0x0dd94b96. // TokenExchange is a free data retrieval call binding the contract method 0x0dd94b96.
@ -727,7 +728,7 @@ func (_Hermez *HermezCaller) TokenHEZ(opts *bind.CallOpts) (common.Address, erro
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "tokenHEZ") err := _Hermez.contract.Call(opts, out, "tokenHEZ")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3. // TokenHEZ is a free data retrieval call binding the contract method 0x79a135e3.
@ -753,7 +754,7 @@ func (_Hermez *HermezCaller) TokenList(opts *bind.CallOpts, arg0 *big.Int) (comm
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "tokenList", arg0) err := _Hermez.contract.Call(opts, out, "tokenList", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TokenList is a free data retrieval call binding the contract method 0x9ead7222. // TokenList is a free data retrieval call binding the contract method 0x9ead7222.
@ -779,7 +780,7 @@ func (_Hermez *HermezCaller) TokenMap(opts *bind.CallOpts, arg0 common.Address)
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "tokenMap", arg0) err := _Hermez.contract.Call(opts, out, "tokenMap", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TokenMap is a free data retrieval call binding the contract method 0x004aca6e. // TokenMap is a free data retrieval call binding the contract method 0x004aca6e.
@ -805,7 +806,7 @@ func (_Hermez *HermezCaller) WithdrawDelayerContract(opts *bind.CallOpts) (commo
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "withdrawDelayerContract") err := _Hermez.contract.Call(opts, out, "withdrawDelayerContract")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// WithdrawDelayerContract is a free data retrieval call binding the contract method 0x1b0a8223. // WithdrawDelayerContract is a free data retrieval call binding the contract method 0x1b0a8223.
@ -831,7 +832,7 @@ func (_Hermez *HermezCaller) WithdrawVerifier(opts *bind.CallOpts) (common.Addre
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "withdrawVerifier") err := _Hermez.contract.Call(opts, out, "withdrawVerifier")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// WithdrawVerifier is a free data retrieval call binding the contract method 0x864eb164. // WithdrawVerifier is a free data retrieval call binding the contract method 0x864eb164.
@ -857,7 +858,7 @@ func (_Hermez *HermezCaller) WithdrawalDelay(opts *bind.CallOpts) (uint64, error
) )
out := ret0 out := ret0
err := _Hermez.contract.Call(opts, out, "withdrawalDelay") err := _Hermez.contract.Call(opts, out, "withdrawalDelay")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// WithdrawalDelay is a free data retrieval call binding the contract method 0xa7ab6961. // WithdrawalDelay is a free data retrieval call binding the contract method 0xa7ab6961.
@ -1212,7 +1213,7 @@ func (_Hermez *HermezFilterer) FilterAddToken(opts *bind.FilterOpts, tokenAddres
logs, sub, err := _Hermez.contract.FilterLogs(opts, "AddToken", tokenAddressRule) logs, sub, err := _Hermez.contract.FilterLogs(opts, "AddToken", tokenAddressRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezAddTokenIterator{contract: _Hermez.contract, event: "AddToken", logs: logs, sub: sub}, nil return &HermezAddTokenIterator{contract: _Hermez.contract, event: "AddToken", logs: logs, sub: sub}, nil
} }
@ -1229,7 +1230,7 @@ func (_Hermez *HermezFilterer) WatchAddToken(opts *bind.WatchOpts, sink chan<- *
logs, sub, err := _Hermez.contract.WatchLogs(opts, "AddToken", tokenAddressRule) logs, sub, err := _Hermez.contract.WatchLogs(opts, "AddToken", tokenAddressRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1239,19 +1240,19 @@ func (_Hermez *HermezFilterer) WatchAddToken(opts *bind.WatchOpts, sink chan<- *
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezAddToken) event := new(HermezAddToken)
if err := _Hermez.contract.UnpackLog(event, "AddToken", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "AddToken", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1265,7 +1266,7 @@ func (_Hermez *HermezFilterer) WatchAddToken(opts *bind.WatchOpts, sink chan<- *
func (_Hermez *HermezFilterer) ParseAddToken(log types.Log) (*HermezAddToken, error) { func (_Hermez *HermezFilterer) ParseAddToken(log types.Log) (*HermezAddToken, error) {
event := new(HermezAddToken) event := new(HermezAddToken)
if err := _Hermez.contract.UnpackLog(event, "AddToken", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "AddToken", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1356,7 +1357,7 @@ func (_Hermez *HermezFilterer) FilterForgeBatch(opts *bind.FilterOpts, batchNum
logs, sub, err := _Hermez.contract.FilterLogs(opts, "ForgeBatch", batchNumRule) logs, sub, err := _Hermez.contract.FilterLogs(opts, "ForgeBatch", batchNumRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezForgeBatchIterator{contract: _Hermez.contract, event: "ForgeBatch", logs: logs, sub: sub}, nil return &HermezForgeBatchIterator{contract: _Hermez.contract, event: "ForgeBatch", logs: logs, sub: sub}, nil
} }
@ -1373,7 +1374,7 @@ func (_Hermez *HermezFilterer) WatchForgeBatch(opts *bind.WatchOpts, sink chan<-
logs, sub, err := _Hermez.contract.WatchLogs(opts, "ForgeBatch", batchNumRule) logs, sub, err := _Hermez.contract.WatchLogs(opts, "ForgeBatch", batchNumRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1383,19 +1384,19 @@ func (_Hermez *HermezFilterer) WatchForgeBatch(opts *bind.WatchOpts, sink chan<-
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezForgeBatch) event := new(HermezForgeBatch)
if err := _Hermez.contract.UnpackLog(event, "ForgeBatch", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "ForgeBatch", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1409,7 +1410,7 @@ func (_Hermez *HermezFilterer) WatchForgeBatch(opts *bind.WatchOpts, sink chan<-
func (_Hermez *HermezFilterer) ParseForgeBatch(log types.Log) (*HermezForgeBatch, error) { func (_Hermez *HermezFilterer) ParseForgeBatch(log types.Log) (*HermezForgeBatch, error) {
event := new(HermezForgeBatch) event := new(HermezForgeBatch)
if err := _Hermez.contract.UnpackLog(event, "ForgeBatch", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "ForgeBatch", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1505,7 +1506,7 @@ func (_Hermez *HermezFilterer) FilterL1UserTxEvent(opts *bind.FilterOpts, queueI
logs, sub, err := _Hermez.contract.FilterLogs(opts, "L1UserTxEvent", queueIndexRule, positionRule) logs, sub, err := _Hermez.contract.FilterLogs(opts, "L1UserTxEvent", queueIndexRule, positionRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezL1UserTxEventIterator{contract: _Hermez.contract, event: "L1UserTxEvent", logs: logs, sub: sub}, nil return &HermezL1UserTxEventIterator{contract: _Hermez.contract, event: "L1UserTxEvent", logs: logs, sub: sub}, nil
} }
@ -1526,7 +1527,7 @@ func (_Hermez *HermezFilterer) WatchL1UserTxEvent(opts *bind.WatchOpts, sink cha
logs, sub, err := _Hermez.contract.WatchLogs(opts, "L1UserTxEvent", queueIndexRule, positionRule) logs, sub, err := _Hermez.contract.WatchLogs(opts, "L1UserTxEvent", queueIndexRule, positionRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1536,19 +1537,19 @@ func (_Hermez *HermezFilterer) WatchL1UserTxEvent(opts *bind.WatchOpts, sink cha
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezL1UserTxEvent) event := new(HermezL1UserTxEvent)
if err := _Hermez.contract.UnpackLog(event, "L1UserTxEvent", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "L1UserTxEvent", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1562,7 +1563,7 @@ func (_Hermez *HermezFilterer) WatchL1UserTxEvent(opts *bind.WatchOpts, sink cha
func (_Hermez *HermezFilterer) ParseL1UserTxEvent(log types.Log) (*HermezL1UserTxEvent, error) { func (_Hermez *HermezFilterer) ParseL1UserTxEvent(log types.Log) (*HermezL1UserTxEvent, error) {
event := new(HermezL1UserTxEvent) event := new(HermezL1UserTxEvent)
if err := _Hermez.contract.UnpackLog(event, "L1UserTxEvent", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "L1UserTxEvent", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1646,7 +1647,7 @@ func (_Hermez *HermezFilterer) FilterSafeMode(opts *bind.FilterOpts) (*HermezSaf
logs, sub, err := _Hermez.contract.FilterLogs(opts, "SafeMode") logs, sub, err := _Hermez.contract.FilterLogs(opts, "SafeMode")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezSafeModeIterator{contract: _Hermez.contract, event: "SafeMode", logs: logs, sub: sub}, nil return &HermezSafeModeIterator{contract: _Hermez.contract, event: "SafeMode", logs: logs, sub: sub}, nil
} }
@ -1658,7 +1659,7 @@ func (_Hermez *HermezFilterer) WatchSafeMode(opts *bind.WatchOpts, sink chan<- *
logs, sub, err := _Hermez.contract.WatchLogs(opts, "SafeMode") logs, sub, err := _Hermez.contract.WatchLogs(opts, "SafeMode")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1668,19 +1669,19 @@ func (_Hermez *HermezFilterer) WatchSafeMode(opts *bind.WatchOpts, sink chan<- *
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezSafeMode) event := new(HermezSafeMode)
if err := _Hermez.contract.UnpackLog(event, "SafeMode", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "SafeMode", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1694,7 +1695,7 @@ func (_Hermez *HermezFilterer) WatchSafeMode(opts *bind.WatchOpts, sink chan<- *
func (_Hermez *HermezFilterer) ParseSafeMode(log types.Log) (*HermezSafeMode, error) { func (_Hermez *HermezFilterer) ParseSafeMode(log types.Log) (*HermezSafeMode, error) {
event := new(HermezSafeMode) event := new(HermezSafeMode)
if err := _Hermez.contract.UnpackLog(event, "SafeMode", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "SafeMode", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1790,7 +1791,7 @@ func (_Hermez *HermezFilterer) FilterUpdateBucketWithdraw(opts *bind.FilterOpts,
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateBucketWithdraw", numBucketRule, blockStampRule) logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateBucketWithdraw", numBucketRule, blockStampRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateBucketWithdrawIterator{contract: _Hermez.contract, event: "UpdateBucketWithdraw", logs: logs, sub: sub}, nil return &HermezUpdateBucketWithdrawIterator{contract: _Hermez.contract, event: "UpdateBucketWithdraw", logs: logs, sub: sub}, nil
} }
@ -1811,7 +1812,7 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketWithdraw(opts *bind.WatchOpts, s
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateBucketWithdraw", numBucketRule, blockStampRule) logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateBucketWithdraw", numBucketRule, blockStampRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1821,19 +1822,19 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketWithdraw(opts *bind.WatchOpts, s
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateBucketWithdraw) event := new(HermezUpdateBucketWithdraw)
if err := _Hermez.contract.UnpackLog(event, "UpdateBucketWithdraw", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateBucketWithdraw", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1847,7 +1848,7 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketWithdraw(opts *bind.WatchOpts, s
func (_Hermez *HermezFilterer) ParseUpdateBucketWithdraw(log types.Log) (*HermezUpdateBucketWithdraw, error) { func (_Hermez *HermezFilterer) ParseUpdateBucketWithdraw(log types.Log) (*HermezUpdateBucketWithdraw, error) {
event := new(HermezUpdateBucketWithdraw) event := new(HermezUpdateBucketWithdraw)
if err := _Hermez.contract.UnpackLog(event, "UpdateBucketWithdraw", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateBucketWithdraw", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1932,7 +1933,7 @@ func (_Hermez *HermezFilterer) FilterUpdateBucketsParameters(opts *bind.FilterOp
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateBucketsParameters") logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateBucketsParameters")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateBucketsParametersIterator{contract: _Hermez.contract, event: "UpdateBucketsParameters", logs: logs, sub: sub}, nil return &HermezUpdateBucketsParametersIterator{contract: _Hermez.contract, event: "UpdateBucketsParameters", logs: logs, sub: sub}, nil
} }
@ -1944,7 +1945,7 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketsParameters(opts *bind.WatchOpts
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateBucketsParameters") logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateBucketsParameters")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1954,19 +1955,19 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketsParameters(opts *bind.WatchOpts
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateBucketsParameters) event := new(HermezUpdateBucketsParameters)
if err := _Hermez.contract.UnpackLog(event, "UpdateBucketsParameters", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateBucketsParameters", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1980,7 +1981,7 @@ func (_Hermez *HermezFilterer) WatchUpdateBucketsParameters(opts *bind.WatchOpts
func (_Hermez *HermezFilterer) ParseUpdateBucketsParameters(log types.Log) (*HermezUpdateBucketsParameters, error) { func (_Hermez *HermezFilterer) ParseUpdateBucketsParameters(log types.Log) (*HermezUpdateBucketsParameters, error) {
event := new(HermezUpdateBucketsParameters) event := new(HermezUpdateBucketsParameters)
if err := _Hermez.contract.UnpackLog(event, "UpdateBucketsParameters", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateBucketsParameters", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2065,7 +2066,7 @@ func (_Hermez *HermezFilterer) FilterUpdateFeeAddToken(opts *bind.FilterOpts) (*
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateFeeAddToken") logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateFeeAddToken")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateFeeAddTokenIterator{contract: _Hermez.contract, event: "UpdateFeeAddToken", logs: logs, sub: sub}, nil return &HermezUpdateFeeAddTokenIterator{contract: _Hermez.contract, event: "UpdateFeeAddToken", logs: logs, sub: sub}, nil
} }
@ -2077,7 +2078,7 @@ func (_Hermez *HermezFilterer) WatchUpdateFeeAddToken(opts *bind.WatchOpts, sink
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateFeeAddToken") logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateFeeAddToken")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2087,19 +2088,19 @@ func (_Hermez *HermezFilterer) WatchUpdateFeeAddToken(opts *bind.WatchOpts, sink
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateFeeAddToken) event := new(HermezUpdateFeeAddToken)
if err := _Hermez.contract.UnpackLog(event, "UpdateFeeAddToken", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateFeeAddToken", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2113,7 +2114,7 @@ func (_Hermez *HermezFilterer) WatchUpdateFeeAddToken(opts *bind.WatchOpts, sink
func (_Hermez *HermezFilterer) ParseUpdateFeeAddToken(log types.Log) (*HermezUpdateFeeAddToken, error) { func (_Hermez *HermezFilterer) ParseUpdateFeeAddToken(log types.Log) (*HermezUpdateFeeAddToken, error) {
event := new(HermezUpdateFeeAddToken) event := new(HermezUpdateFeeAddToken)
if err := _Hermez.contract.UnpackLog(event, "UpdateFeeAddToken", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateFeeAddToken", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2198,7 +2199,7 @@ func (_Hermez *HermezFilterer) FilterUpdateForgeL1L2BatchTimeout(opts *bind.Filt
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateForgeL1L2BatchTimeout") logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateForgeL1L2BatchTimeout")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateForgeL1L2BatchTimeoutIterator{contract: _Hermez.contract, event: "UpdateForgeL1L2BatchTimeout", logs: logs, sub: sub}, nil return &HermezUpdateForgeL1L2BatchTimeoutIterator{contract: _Hermez.contract, event: "UpdateForgeL1L2BatchTimeout", logs: logs, sub: sub}, nil
} }
@ -2210,7 +2211,7 @@ func (_Hermez *HermezFilterer) WatchUpdateForgeL1L2BatchTimeout(opts *bind.Watch
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateForgeL1L2BatchTimeout") logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateForgeL1L2BatchTimeout")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2220,19 +2221,19 @@ func (_Hermez *HermezFilterer) WatchUpdateForgeL1L2BatchTimeout(opts *bind.Watch
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateForgeL1L2BatchTimeout) event := new(HermezUpdateForgeL1L2BatchTimeout)
if err := _Hermez.contract.UnpackLog(event, "UpdateForgeL1L2BatchTimeout", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateForgeL1L2BatchTimeout", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2246,7 +2247,7 @@ func (_Hermez *HermezFilterer) WatchUpdateForgeL1L2BatchTimeout(opts *bind.Watch
func (_Hermez *HermezFilterer) ParseUpdateForgeL1L2BatchTimeout(log types.Log) (*HermezUpdateForgeL1L2BatchTimeout, error) { func (_Hermez *HermezFilterer) ParseUpdateForgeL1L2BatchTimeout(log types.Log) (*HermezUpdateForgeL1L2BatchTimeout, error) {
event := new(HermezUpdateForgeL1L2BatchTimeout) event := new(HermezUpdateForgeL1L2BatchTimeout)
if err := _Hermez.contract.UnpackLog(event, "UpdateForgeL1L2BatchTimeout", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateForgeL1L2BatchTimeout", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2332,7 +2333,7 @@ func (_Hermez *HermezFilterer) FilterUpdateTokenExchange(opts *bind.FilterOpts)
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateTokenExchange") logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateTokenExchange")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateTokenExchangeIterator{contract: _Hermez.contract, event: "UpdateTokenExchange", logs: logs, sub: sub}, nil return &HermezUpdateTokenExchangeIterator{contract: _Hermez.contract, event: "UpdateTokenExchange", logs: logs, sub: sub}, nil
} }
@ -2344,7 +2345,7 @@ func (_Hermez *HermezFilterer) WatchUpdateTokenExchange(opts *bind.WatchOpts, si
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateTokenExchange") logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateTokenExchange")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2354,19 +2355,19 @@ func (_Hermez *HermezFilterer) WatchUpdateTokenExchange(opts *bind.WatchOpts, si
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateTokenExchange) event := new(HermezUpdateTokenExchange)
if err := _Hermez.contract.UnpackLog(event, "UpdateTokenExchange", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateTokenExchange", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2380,7 +2381,7 @@ func (_Hermez *HermezFilterer) WatchUpdateTokenExchange(opts *bind.WatchOpts, si
func (_Hermez *HermezFilterer) ParseUpdateTokenExchange(log types.Log) (*HermezUpdateTokenExchange, error) { func (_Hermez *HermezFilterer) ParseUpdateTokenExchange(log types.Log) (*HermezUpdateTokenExchange, error) {
event := new(HermezUpdateTokenExchange) event := new(HermezUpdateTokenExchange)
if err := _Hermez.contract.UnpackLog(event, "UpdateTokenExchange", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateTokenExchange", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2465,7 +2466,7 @@ func (_Hermez *HermezFilterer) FilterUpdateWithdrawalDelay(opts *bind.FilterOpts
logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateWithdrawalDelay") logs, sub, err := _Hermez.contract.FilterLogs(opts, "UpdateWithdrawalDelay")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezUpdateWithdrawalDelayIterator{contract: _Hermez.contract, event: "UpdateWithdrawalDelay", logs: logs, sub: sub}, nil return &HermezUpdateWithdrawalDelayIterator{contract: _Hermez.contract, event: "UpdateWithdrawalDelay", logs: logs, sub: sub}, nil
} }
@ -2477,7 +2478,7 @@ func (_Hermez *HermezFilterer) WatchUpdateWithdrawalDelay(opts *bind.WatchOpts,
logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateWithdrawalDelay") logs, sub, err := _Hermez.contract.WatchLogs(opts, "UpdateWithdrawalDelay")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2487,19 +2488,19 @@ func (_Hermez *HermezFilterer) WatchUpdateWithdrawalDelay(opts *bind.WatchOpts,
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezUpdateWithdrawalDelay) event := new(HermezUpdateWithdrawalDelay)
if err := _Hermez.contract.UnpackLog(event, "UpdateWithdrawalDelay", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateWithdrawalDelay", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2513,7 +2514,7 @@ func (_Hermez *HermezFilterer) WatchUpdateWithdrawalDelay(opts *bind.WatchOpts,
func (_Hermez *HermezFilterer) ParseUpdateWithdrawalDelay(log types.Log) (*HermezUpdateWithdrawalDelay, error) { func (_Hermez *HermezFilterer) ParseUpdateWithdrawalDelay(log types.Log) (*HermezUpdateWithdrawalDelay, error) {
event := new(HermezUpdateWithdrawalDelay) event := new(HermezUpdateWithdrawalDelay)
if err := _Hermez.contract.UnpackLog(event, "UpdateWithdrawalDelay", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "UpdateWithdrawalDelay", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -2613,7 +2614,7 @@ func (_Hermez *HermezFilterer) FilterWithdrawEvent(opts *bind.FilterOpts, idx []
logs, sub, err := _Hermez.contract.FilterLogs(opts, "WithdrawEvent", idxRule, numExitRootRule, instantWithdrawRule) logs, sub, err := _Hermez.contract.FilterLogs(opts, "WithdrawEvent", idxRule, numExitRootRule, instantWithdrawRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HermezWithdrawEventIterator{contract: _Hermez.contract, event: "WithdrawEvent", logs: logs, sub: sub}, nil return &HermezWithdrawEventIterator{contract: _Hermez.contract, event: "WithdrawEvent", logs: logs, sub: sub}, nil
} }
@ -2638,7 +2639,7 @@ func (_Hermez *HermezFilterer) WatchWithdrawEvent(opts *bind.WatchOpts, sink cha
logs, sub, err := _Hermez.contract.WatchLogs(opts, "WithdrawEvent", idxRule, numExitRootRule, instantWithdrawRule) logs, sub, err := _Hermez.contract.WatchLogs(opts, "WithdrawEvent", idxRule, numExitRootRule, instantWithdrawRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -2648,19 +2649,19 @@ func (_Hermez *HermezFilterer) WatchWithdrawEvent(opts *bind.WatchOpts, sink cha
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HermezWithdrawEvent) event := new(HermezWithdrawEvent)
if err := _Hermez.contract.UnpackLog(event, "WithdrawEvent", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "WithdrawEvent", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -2674,7 +2675,7 @@ func (_Hermez *HermezFilterer) WatchWithdrawEvent(opts *bind.WatchOpts, sink cha
func (_Hermez *HermezFilterer) ParseWithdrawEvent(log types.Log) (*HermezWithdrawEvent, error) { func (_Hermez *HermezFilterer) ParseWithdrawEvent(log types.Log) (*HermezWithdrawEvent, error) {
event := new(HermezWithdrawEvent) event := new(HermezWithdrawEvent)
if err := _Hermez.contract.UnpackLog(event, "WithdrawEvent", log); err != nil { if err := _Hermez.contract.UnpackLog(event, "WithdrawEvent", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }

+ 41
- 40
eth/contracts/tokenHEZ/HEZ.go

@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/hermeznetwork/tracerr"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -36,12 +37,12 @@ var HEZBin = "0x608060405234801561001057600080fd5b506040516111153803806111158339
func DeployHEZ(auth *bind.TransactOpts, backend bind.ContractBackend, initialHolder common.Address) (common.Address, *types.Transaction, *HEZ, error) { func DeployHEZ(auth *bind.TransactOpts, backend bind.ContractBackend, initialHolder common.Address) (common.Address, *types.Transaction, *HEZ, error) {
parsed, err := abi.JSON(strings.NewReader(HEZABI)) parsed, err := abi.JSON(strings.NewReader(HEZABI))
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
return common.Address{}, nil, nil, tracerr.Wrap(err)
} }
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HEZBin), backend, initialHolder) address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HEZBin), backend, initialHolder)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
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 return address, tx, &HEZ{HEZCaller: HEZCaller{contract: contract}, HEZTransactor: HEZTransactor{contract: contract}, HEZFilterer: HEZFilterer{contract: contract}}, nil
} }
@ -109,7 +110,7 @@ type HEZTransactorRaw struct {
func NewHEZ(address common.Address, backend bind.ContractBackend) (*HEZ, error) { func NewHEZ(address common.Address, backend bind.ContractBackend) (*HEZ, error) {
contract, err := bindHEZ(address, backend, backend, backend) contract, err := bindHEZ(address, backend, backend, backend)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZ{HEZCaller: HEZCaller{contract: contract}, HEZTransactor: HEZTransactor{contract: contract}, HEZFilterer: HEZFilterer{contract: contract}}, nil return &HEZ{HEZCaller: HEZCaller{contract: contract}, HEZTransactor: HEZTransactor{contract: contract}, HEZFilterer: HEZFilterer{contract: contract}}, nil
} }
@ -118,7 +119,7 @@ func NewHEZ(address common.Address, backend bind.ContractBackend) (*HEZ, error)
func NewHEZCaller(address common.Address, caller bind.ContractCaller) (*HEZCaller, error) { func NewHEZCaller(address common.Address, caller bind.ContractCaller) (*HEZCaller, error) {
contract, err := bindHEZ(address, caller, nil, nil) contract, err := bindHEZ(address, caller, nil, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZCaller{contract: contract}, nil return &HEZCaller{contract: contract}, nil
} }
@ -127,7 +128,7 @@ func NewHEZCaller(address common.Address, caller bind.ContractCaller) (*HEZCalle
func NewHEZTransactor(address common.Address, transactor bind.ContractTransactor) (*HEZTransactor, error) { func NewHEZTransactor(address common.Address, transactor bind.ContractTransactor) (*HEZTransactor, error) {
contract, err := bindHEZ(address, nil, transactor, nil) contract, err := bindHEZ(address, nil, transactor, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZTransactor{contract: contract}, nil return &HEZTransactor{contract: contract}, nil
} }
@ -136,7 +137,7 @@ func NewHEZTransactor(address common.Address, transactor bind.ContractTransactor
func NewHEZFilterer(address common.Address, filterer bind.ContractFilterer) (*HEZFilterer, error) { func NewHEZFilterer(address common.Address, filterer bind.ContractFilterer) (*HEZFilterer, error) {
contract, err := bindHEZ(address, nil, nil, filterer) contract, err := bindHEZ(address, nil, nil, filterer)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZFilterer{contract: contract}, nil return &HEZFilterer{contract: contract}, nil
} }
@ -145,7 +146,7 @@ func NewHEZFilterer(address common.Address, filterer bind.ContractFilterer) (*HE
func bindHEZ(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { func bindHEZ(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(HEZABI)) parsed, err := abi.JSON(strings.NewReader(HEZABI))
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
} }
@ -197,7 +198,7 @@ func (_HEZ *HEZCaller) EIP712DOMAINHASH(opts *bind.CallOpts) ([32]byte, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "EIP712DOMAIN_HASH") err := _HEZ.contract.Call(opts, out, "EIP712DOMAIN_HASH")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33. // EIP712DOMAINHASH is a free data retrieval call binding the contract method 0xc473af33.
@ -223,7 +224,7 @@ func (_HEZ *HEZCaller) NAMEHASH(opts *bind.CallOpts) ([32]byte, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "NAME_HASH") err := _HEZ.contract.Call(opts, out, "NAME_HASH")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e. // NAMEHASH is a free data retrieval call binding the contract method 0x04622c2e.
@ -249,7 +250,7 @@ func (_HEZ *HEZCaller) PERMITTYPEHASH(opts *bind.CallOpts) ([32]byte, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "PERMIT_TYPEHASH") err := _HEZ.contract.Call(opts, out, "PERMIT_TYPEHASH")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f. // PERMITTYPEHASH is a free data retrieval call binding the contract method 0x30adf81f.
@ -275,7 +276,7 @@ func (_HEZ *HEZCaller) TRANSFERWITHAUTHORIZATIONTYPEHASH(opts *bind.CallOpts) ([
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "TRANSFER_WITH_AUTHORIZATION_TYPEHASH") err := _HEZ.contract.Call(opts, out, "TRANSFER_WITH_AUTHORIZATION_TYPEHASH")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TRANSFERWITHAUTHORIZATIONTYPEHASH is a free data retrieval call binding the contract method 0xa0cc6a68. // TRANSFERWITHAUTHORIZATIONTYPEHASH is a free data retrieval call binding the contract method 0xa0cc6a68.
@ -301,7 +302,7 @@ func (_HEZ *HEZCaller) VERSIONHASH(opts *bind.CallOpts) ([32]byte, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "VERSION_HASH") err := _HEZ.contract.Call(opts, out, "VERSION_HASH")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318. // VERSIONHASH is a free data retrieval call binding the contract method 0x9e4e7318.
@ -327,7 +328,7 @@ func (_HEZ *HEZCaller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "allowance", arg0, arg1) err := _HEZ.contract.Call(opts, out, "allowance", arg0, arg1)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. // Allowance is a free data retrieval call binding the contract method 0xdd62ed3e.
@ -353,7 +354,7 @@ func (_HEZ *HEZCaller) AuthorizationState(opts *bind.CallOpts, arg0 common.Addre
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "authorizationState", arg0, arg1) err := _HEZ.contract.Call(opts, out, "authorizationState", arg0, arg1)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// AuthorizationState is a free data retrieval call binding the contract method 0xe94a0102. // AuthorizationState is a free data retrieval call binding the contract method 0xe94a0102.
@ -379,7 +380,7 @@ func (_HEZ *HEZCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "balanceOf", arg0) err := _HEZ.contract.Call(opts, out, "balanceOf", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. // BalanceOf is a free data retrieval call binding the contract method 0x70a08231.
@ -405,7 +406,7 @@ func (_HEZ *HEZCaller) Decimals(opts *bind.CallOpts) (uint8, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "decimals") err := _HEZ.contract.Call(opts, out, "decimals")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// Decimals is a free data retrieval call binding the contract method 0x313ce567. // Decimals is a free data retrieval call binding the contract method 0x313ce567.
@ -431,7 +432,7 @@ func (_HEZ *HEZCaller) GetChainId(opts *bind.CallOpts) (*big.Int, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "getChainId") err := _HEZ.contract.Call(opts, out, "getChainId")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetChainId is a free data retrieval call binding the contract method 0x3408e470. // GetChainId is a free data retrieval call binding the contract method 0x3408e470.
@ -457,7 +458,7 @@ func (_HEZ *HEZCaller) InitialBalance(opts *bind.CallOpts) (*big.Int, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "initialBalance") err := _HEZ.contract.Call(opts, out, "initialBalance")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// InitialBalance is a free data retrieval call binding the contract method 0x18369a2a. // InitialBalance is a free data retrieval call binding the contract method 0x18369a2a.
@ -483,7 +484,7 @@ func (_HEZ *HEZCaller) Name(opts *bind.CallOpts) (string, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "name") err := _HEZ.contract.Call(opts, out, "name")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// Name is a free data retrieval call binding the contract method 0x06fdde03. // Name is a free data retrieval call binding the contract method 0x06fdde03.
@ -509,7 +510,7 @@ func (_HEZ *HEZCaller) Nonces(opts *bind.CallOpts, arg0 common.Address) (*big.In
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "nonces", arg0) err := _HEZ.contract.Call(opts, out, "nonces", arg0)
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. // Nonces is a free data retrieval call binding the contract method 0x7ecebe00.
@ -535,7 +536,7 @@ func (_HEZ *HEZCaller) Symbol(opts *bind.CallOpts) (string, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "symbol") err := _HEZ.contract.Call(opts, out, "symbol")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// Symbol is a free data retrieval call binding the contract method 0x95d89b41. // Symbol is a free data retrieval call binding the contract method 0x95d89b41.
@ -561,7 +562,7 @@ func (_HEZ *HEZCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) {
) )
out := ret0 out := ret0
err := _HEZ.contract.Call(opts, out, "totalSupply") err := _HEZ.contract.Call(opts, out, "totalSupply")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. // TotalSupply is a free data retrieval call binding the contract method 0x18160ddd.
@ -795,7 +796,7 @@ func (_HEZ *HEZFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Ad
logs, sub, err := _HEZ.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) logs, sub, err := _HEZ.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZApprovalIterator{contract: _HEZ.contract, event: "Approval", logs: logs, sub: sub}, nil return &HEZApprovalIterator{contract: _HEZ.contract, event: "Approval", logs: logs, sub: sub}, nil
} }
@ -816,7 +817,7 @@ func (_HEZ *HEZFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *HEZApp
logs, sub, err := _HEZ.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) logs, sub, err := _HEZ.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -826,19 +827,19 @@ func (_HEZ *HEZFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *HEZApp
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HEZApproval) event := new(HEZApproval)
if err := _HEZ.contract.UnpackLog(event, "Approval", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "Approval", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -852,7 +853,7 @@ func (_HEZ *HEZFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *HEZApp
func (_HEZ *HEZFilterer) ParseApproval(log types.Log) (*HEZApproval, error) { func (_HEZ *HEZFilterer) ParseApproval(log types.Log) (*HEZApproval, error) {
event := new(HEZApproval) event := new(HEZApproval)
if err := _HEZ.contract.UnpackLog(event, "Approval", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "Approval", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -947,7 +948,7 @@ func (_HEZ *HEZFilterer) FilterAuthorizationUsed(opts *bind.FilterOpts, authoriz
logs, sub, err := _HEZ.contract.FilterLogs(opts, "AuthorizationUsed", authorizerRule, nonceRule) logs, sub, err := _HEZ.contract.FilterLogs(opts, "AuthorizationUsed", authorizerRule, nonceRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZAuthorizationUsedIterator{contract: _HEZ.contract, event: "AuthorizationUsed", logs: logs, sub: sub}, nil return &HEZAuthorizationUsedIterator{contract: _HEZ.contract, event: "AuthorizationUsed", logs: logs, sub: sub}, nil
} }
@ -968,7 +969,7 @@ func (_HEZ *HEZFilterer) WatchAuthorizationUsed(opts *bind.WatchOpts, sink chan<
logs, sub, err := _HEZ.contract.WatchLogs(opts, "AuthorizationUsed", authorizerRule, nonceRule) logs, sub, err := _HEZ.contract.WatchLogs(opts, "AuthorizationUsed", authorizerRule, nonceRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -978,19 +979,19 @@ func (_HEZ *HEZFilterer) WatchAuthorizationUsed(opts *bind.WatchOpts, sink chan<
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HEZAuthorizationUsed) event := new(HEZAuthorizationUsed)
if err := _HEZ.contract.UnpackLog(event, "AuthorizationUsed", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "AuthorizationUsed", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1004,7 +1005,7 @@ func (_HEZ *HEZFilterer) WatchAuthorizationUsed(opts *bind.WatchOpts, sink chan<
func (_HEZ *HEZFilterer) ParseAuthorizationUsed(log types.Log) (*HEZAuthorizationUsed, error) { func (_HEZ *HEZFilterer) ParseAuthorizationUsed(log types.Log) (*HEZAuthorizationUsed, error) {
event := new(HEZAuthorizationUsed) event := new(HEZAuthorizationUsed)
if err := _HEZ.contract.UnpackLog(event, "AuthorizationUsed", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "AuthorizationUsed", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1100,7 +1101,7 @@ func (_HEZ *HEZFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Add
logs, sub, err := _HEZ.contract.FilterLogs(opts, "Transfer", fromRule, toRule) logs, sub, err := _HEZ.contract.FilterLogs(opts, "Transfer", fromRule, toRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &HEZTransferIterator{contract: _HEZ.contract, event: "Transfer", logs: logs, sub: sub}, nil return &HEZTransferIterator{contract: _HEZ.contract, event: "Transfer", logs: logs, sub: sub}, nil
} }
@ -1121,7 +1122,7 @@ func (_HEZ *HEZFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *HEZTra
logs, sub, err := _HEZ.contract.WatchLogs(opts, "Transfer", fromRule, toRule) logs, sub, err := _HEZ.contract.WatchLogs(opts, "Transfer", fromRule, toRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1131,19 +1132,19 @@ func (_HEZ *HEZFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *HEZTra
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(HEZTransfer) event := new(HEZTransfer)
if err := _HEZ.contract.UnpackLog(event, "Transfer", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "Transfer", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1157,7 +1158,7 @@ func (_HEZ *HEZFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *HEZTra
func (_HEZ *HEZFilterer) ParseTransfer(log types.Log) (*HEZTransfer, error) { func (_HEZ *HEZFilterer) ParseTransfer(log types.Log) (*HEZTransfer, error) {
event := new(HEZTransfer) event := new(HEZTransfer)
if err := _HEZ.contract.UnpackLog(event, "Transfer", log); err != nil { if err := _HEZ.contract.UnpackLog(event, "Transfer", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }

+ 62
- 61
eth/contracts/withdrawdelayer/WithdrawalDelayer.go

@ -13,6 +13,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/hermeznetwork/tracerr"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -36,12 +37,12 @@ var WithdrawalDelayerBin = "0x608060405234801561001057600080fd5b50611cf580610020
func DeployWithdrawalDelayer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WithdrawalDelayer, error) { func DeployWithdrawalDelayer(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *WithdrawalDelayer, error) {
parsed, err := abi.JSON(strings.NewReader(WithdrawalDelayerABI)) parsed, err := abi.JSON(strings.NewReader(WithdrawalDelayerABI))
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
return common.Address{}, nil, nil, tracerr.Wrap(err)
} }
address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(WithdrawalDelayerBin), backend) address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(WithdrawalDelayerBin), backend)
if err != nil { if err != nil {
return common.Address{}, nil, nil, err
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 return address, tx, &WithdrawalDelayer{WithdrawalDelayerCaller: WithdrawalDelayerCaller{contract: contract}, WithdrawalDelayerTransactor: WithdrawalDelayerTransactor{contract: contract}, WithdrawalDelayerFilterer: WithdrawalDelayerFilterer{contract: contract}}, nil
} }
@ -109,7 +110,7 @@ type WithdrawalDelayerTransactorRaw struct {
func NewWithdrawalDelayer(address common.Address, backend bind.ContractBackend) (*WithdrawalDelayer, error) { func NewWithdrawalDelayer(address common.Address, backend bind.ContractBackend) (*WithdrawalDelayer, error) {
contract, err := bindWithdrawalDelayer(address, backend, backend, backend) contract, err := bindWithdrawalDelayer(address, backend, backend, backend)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayer{WithdrawalDelayerCaller: WithdrawalDelayerCaller{contract: contract}, WithdrawalDelayerTransactor: WithdrawalDelayerTransactor{contract: contract}, WithdrawalDelayerFilterer: WithdrawalDelayerFilterer{contract: contract}}, nil return &WithdrawalDelayer{WithdrawalDelayerCaller: WithdrawalDelayerCaller{contract: contract}, WithdrawalDelayerTransactor: WithdrawalDelayerTransactor{contract: contract}, WithdrawalDelayerFilterer: WithdrawalDelayerFilterer{contract: contract}}, nil
} }
@ -118,7 +119,7 @@ func NewWithdrawalDelayer(address common.Address, backend bind.ContractBackend)
func NewWithdrawalDelayerCaller(address common.Address, caller bind.ContractCaller) (*WithdrawalDelayerCaller, error) { func NewWithdrawalDelayerCaller(address common.Address, caller bind.ContractCaller) (*WithdrawalDelayerCaller, error) {
contract, err := bindWithdrawalDelayer(address, caller, nil, nil) contract, err := bindWithdrawalDelayer(address, caller, nil, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerCaller{contract: contract}, nil return &WithdrawalDelayerCaller{contract: contract}, nil
} }
@ -127,7 +128,7 @@ func NewWithdrawalDelayerCaller(address common.Address, caller bind.ContractCall
func NewWithdrawalDelayerTransactor(address common.Address, transactor bind.ContractTransactor) (*WithdrawalDelayerTransactor, error) { func NewWithdrawalDelayerTransactor(address common.Address, transactor bind.ContractTransactor) (*WithdrawalDelayerTransactor, error) {
contract, err := bindWithdrawalDelayer(address, nil, transactor, nil) contract, err := bindWithdrawalDelayer(address, nil, transactor, nil)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerTransactor{contract: contract}, nil return &WithdrawalDelayerTransactor{contract: contract}, nil
} }
@ -136,7 +137,7 @@ func NewWithdrawalDelayerTransactor(address common.Address, transactor bind.Cont
func NewWithdrawalDelayerFilterer(address common.Address, filterer bind.ContractFilterer) (*WithdrawalDelayerFilterer, error) { func NewWithdrawalDelayerFilterer(address common.Address, filterer bind.ContractFilterer) (*WithdrawalDelayerFilterer, error) {
contract, err := bindWithdrawalDelayer(address, nil, nil, filterer) contract, err := bindWithdrawalDelayer(address, nil, nil, filterer)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerFilterer{contract: contract}, nil return &WithdrawalDelayerFilterer{contract: contract}, nil
} }
@ -145,7 +146,7 @@ func NewWithdrawalDelayerFilterer(address common.Address, filterer bind.Contract
func bindWithdrawalDelayer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { func bindWithdrawalDelayer(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(WithdrawalDelayerABI)) parsed, err := abi.JSON(strings.NewReader(WithdrawalDelayerABI))
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
} }
@ -197,7 +198,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) MAXEMERGENCYMODETIME(opts *bi
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_EMERGENCY_MODE_TIME") err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_EMERGENCY_MODE_TIME")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// MAXEMERGENCYMODETIME is a free data retrieval call binding the contract method 0xb4b8e39d. // MAXEMERGENCYMODETIME is a free data retrieval call binding the contract method 0xb4b8e39d.
@ -223,7 +224,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) MAXWITHDRAWALDELAY(opts *bind
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_WITHDRAWAL_DELAY") err := _WithdrawalDelayer.contract.Call(opts, out, "MAX_WITHDRAWAL_DELAY")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df. // MAXWITHDRAWALDELAY is a free data retrieval call binding the contract method 0xa238f9df.
@ -253,7 +254,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) DepositInfo(opts *bind.CallOp
ret1, ret1,
} }
err := _WithdrawalDelayer.contract.Call(opts, out, "depositInfo", _owner, _token) err := _WithdrawalDelayer.contract.Call(opts, out, "depositInfo", _owner, _token)
return *ret0, *ret1, err
return *ret0, *ret1, tracerr.Wrap(err)
} }
// DepositInfo is a free data retrieval call binding the contract method 0x493b0170. // DepositInfo is a free data retrieval call binding the contract method 0x493b0170.
@ -283,7 +284,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) Deposits(opts *bind.CallOpts,
}) })
out := ret out := ret
err := _WithdrawalDelayer.contract.Call(opts, out, "deposits", arg0) err := _WithdrawalDelayer.contract.Call(opts, out, "deposits", arg0)
return *ret, err
return *ret, tracerr.Wrap(err)
} }
// Deposits is a free data retrieval call binding the contract method 0x3d4dff7b. // Deposits is a free data retrieval call binding the contract method 0x3d4dff7b.
@ -315,7 +316,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetEmergencyCouncil(opts *bin
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyCouncil") err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyCouncil")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetEmergencyCouncil is a free data retrieval call binding the contract method 0x99ef11c5. // GetEmergencyCouncil is a free data retrieval call binding the contract method 0x99ef11c5.
@ -341,7 +342,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetEmergencyModeStartingTime(
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyModeStartingTime") err := _WithdrawalDelayer.contract.Call(opts, out, "getEmergencyModeStartingTime")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetEmergencyModeStartingTime is a free data retrieval call binding the contract method 0x668cdd67. // GetEmergencyModeStartingTime is a free data retrieval call binding the contract method 0x668cdd67.
@ -367,7 +368,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetHermezGovernanceAddress(op
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "getHermezGovernanceAddress") err := _WithdrawalDelayer.contract.Call(opts, out, "getHermezGovernanceAddress")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetHermezGovernanceAddress is a free data retrieval call binding the contract method 0x0b21d430. // GetHermezGovernanceAddress is a free data retrieval call binding the contract method 0x0b21d430.
@ -393,7 +394,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) GetWithdrawalDelay(opts *bind
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "getWithdrawalDelay") err := _WithdrawalDelayer.contract.Call(opts, out, "getWithdrawalDelay")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// GetWithdrawalDelay is a free data retrieval call binding the contract method 0x03160940. // GetWithdrawalDelay is a free data retrieval call binding the contract method 0x03160940.
@ -419,7 +420,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) HermezRollupAddress(opts *bin
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "hermezRollupAddress") err := _WithdrawalDelayer.contract.Call(opts, out, "hermezRollupAddress")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// HermezRollupAddress is a free data retrieval call binding the contract method 0x0fd266d7. // HermezRollupAddress is a free data retrieval call binding the contract method 0x0fd266d7.
@ -445,7 +446,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) IsEmergencyMode(opts *bind.Ca
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "isEmergencyMode") err := _WithdrawalDelayer.contract.Call(opts, out, "isEmergencyMode")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// IsEmergencyMode is a free data retrieval call binding the contract method 0x20a194b8. // IsEmergencyMode is a free data retrieval call binding the contract method 0x20a194b8.
@ -471,7 +472,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) PendingEmergencyCouncil(opts
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "pendingEmergencyCouncil") err := _WithdrawalDelayer.contract.Call(opts, out, "pendingEmergencyCouncil")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// PendingEmergencyCouncil is a free data retrieval call binding the contract method 0x67fa2403. // PendingEmergencyCouncil is a free data retrieval call binding the contract method 0x67fa2403.
@ -497,7 +498,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerCaller) PendingGovernance(opts *bind.
) )
out := ret0 out := ret0
err := _WithdrawalDelayer.contract.Call(opts, out, "pendingGovernance") err := _WithdrawalDelayer.contract.Call(opts, out, "pendingGovernance")
return *ret0, err
return *ret0, tracerr.Wrap(err)
} }
// PendingGovernance is a free data retrieval call binding the contract method 0xf39c38a0. // PendingGovernance is a free data retrieval call binding the contract method 0xf39c38a0.
@ -816,7 +817,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterDeposit(opts *bind.Fi
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "Deposit", ownerRule, tokenRule) logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "Deposit", ownerRule, tokenRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerDepositIterator{contract: _WithdrawalDelayer.contract, event: "Deposit", logs: logs, sub: sub}, nil return &WithdrawalDelayerDepositIterator{contract: _WithdrawalDelayer.contract, event: "Deposit", logs: logs, sub: sub}, nil
} }
@ -837,7 +838,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchDeposit(opts *bind.Wat
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "Deposit", ownerRule, tokenRule) logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "Deposit", ownerRule, tokenRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -847,19 +848,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchDeposit(opts *bind.Wat
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerDeposit) event := new(WithdrawalDelayerDeposit)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "Deposit", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "Deposit", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -873,7 +874,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchDeposit(opts *bind.Wat
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseDeposit(log types.Log) (*WithdrawalDelayerDeposit, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseDeposit(log types.Log) (*WithdrawalDelayerDeposit, error) {
event := new(WithdrawalDelayerDeposit) event := new(WithdrawalDelayerDeposit)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "Deposit", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "Deposit", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -957,7 +958,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterEmergencyModeEnabled(
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "EmergencyModeEnabled") logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "EmergencyModeEnabled")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerEmergencyModeEnabledIterator{contract: _WithdrawalDelayer.contract, event: "EmergencyModeEnabled", logs: logs, sub: sub}, nil return &WithdrawalDelayerEmergencyModeEnabledIterator{contract: _WithdrawalDelayer.contract, event: "EmergencyModeEnabled", logs: logs, sub: sub}, nil
} }
@ -969,7 +970,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEmergencyModeEnabled(o
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "EmergencyModeEnabled") logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "EmergencyModeEnabled")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -979,19 +980,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEmergencyModeEnabled(o
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerEmergencyModeEnabled) event := new(WithdrawalDelayerEmergencyModeEnabled)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "EmergencyModeEnabled", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "EmergencyModeEnabled", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1005,7 +1006,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEmergencyModeEnabled(o
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEmergencyModeEnabled(log types.Log) (*WithdrawalDelayerEmergencyModeEnabled, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEmergencyModeEnabled(log types.Log) (*WithdrawalDelayerEmergencyModeEnabled, error) {
event := new(WithdrawalDelayerEmergencyModeEnabled) event := new(WithdrawalDelayerEmergencyModeEnabled)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "EmergencyModeEnabled", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "EmergencyModeEnabled", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1106,7 +1107,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterEscapeHatchWithdrawal
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "EscapeHatchWithdrawal", whoRule, toRule, tokenRule) logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "EscapeHatchWithdrawal", whoRule, toRule, tokenRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerEscapeHatchWithdrawalIterator{contract: _WithdrawalDelayer.contract, event: "EscapeHatchWithdrawal", logs: logs, sub: sub}, nil return &WithdrawalDelayerEscapeHatchWithdrawalIterator{contract: _WithdrawalDelayer.contract, event: "EscapeHatchWithdrawal", logs: logs, sub: sub}, nil
} }
@ -1131,7 +1132,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEscapeHatchWithdrawal(
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "EscapeHatchWithdrawal", whoRule, toRule, tokenRule) logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "EscapeHatchWithdrawal", whoRule, toRule, tokenRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1141,19 +1142,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEscapeHatchWithdrawal(
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerEscapeHatchWithdrawal) event := new(WithdrawalDelayerEscapeHatchWithdrawal)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "EscapeHatchWithdrawal", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "EscapeHatchWithdrawal", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1167,7 +1168,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchEscapeHatchWithdrawal(
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEscapeHatchWithdrawal(log types.Log) (*WithdrawalDelayerEscapeHatchWithdrawal, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseEscapeHatchWithdrawal(log types.Log) (*WithdrawalDelayerEscapeHatchWithdrawal, error) {
event := new(WithdrawalDelayerEscapeHatchWithdrawal) event := new(WithdrawalDelayerEscapeHatchWithdrawal)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "EscapeHatchWithdrawal", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "EscapeHatchWithdrawal", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1252,7 +1253,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterNewEmergencyCouncil(o
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewEmergencyCouncil") logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewEmergencyCouncil")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerNewEmergencyCouncilIterator{contract: _WithdrawalDelayer.contract, event: "NewEmergencyCouncil", logs: logs, sub: sub}, nil return &WithdrawalDelayerNewEmergencyCouncilIterator{contract: _WithdrawalDelayer.contract, event: "NewEmergencyCouncil", logs: logs, sub: sub}, nil
} }
@ -1264,7 +1265,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewEmergencyCouncil(op
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewEmergencyCouncil") logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewEmergencyCouncil")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1274,19 +1275,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewEmergencyCouncil(op
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerNewEmergencyCouncil) event := new(WithdrawalDelayerNewEmergencyCouncil)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewEmergencyCouncil", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewEmergencyCouncil", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1300,7 +1301,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewEmergencyCouncil(op
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewEmergencyCouncil(log types.Log) (*WithdrawalDelayerNewEmergencyCouncil, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewEmergencyCouncil(log types.Log) (*WithdrawalDelayerNewEmergencyCouncil, error) {
event := new(WithdrawalDelayerNewEmergencyCouncil) event := new(WithdrawalDelayerNewEmergencyCouncil)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewEmergencyCouncil", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewEmergencyCouncil", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1385,7 +1386,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterNewHermezGovernanceAd
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewHermezGovernanceAddress") logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewHermezGovernanceAddress")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerNewHermezGovernanceAddressIterator{contract: _WithdrawalDelayer.contract, event: "NewHermezGovernanceAddress", logs: logs, sub: sub}, nil return &WithdrawalDelayerNewHermezGovernanceAddressIterator{contract: _WithdrawalDelayer.contract, event: "NewHermezGovernanceAddress", logs: logs, sub: sub}, nil
} }
@ -1397,7 +1398,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewHermezGovernanceAdd
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewHermezGovernanceAddress") logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewHermezGovernanceAddress")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1407,19 +1408,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewHermezGovernanceAdd
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerNewHermezGovernanceAddress) event := new(WithdrawalDelayerNewHermezGovernanceAddress)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewHermezGovernanceAddress", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewHermezGovernanceAddress", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1433,7 +1434,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewHermezGovernanceAdd
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewHermezGovernanceAddress(log types.Log) (*WithdrawalDelayerNewHermezGovernanceAddress, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewHermezGovernanceAddress(log types.Log) (*WithdrawalDelayerNewHermezGovernanceAddress, error) {
event := new(WithdrawalDelayerNewHermezGovernanceAddress) event := new(WithdrawalDelayerNewHermezGovernanceAddress)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewHermezGovernanceAddress", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewHermezGovernanceAddress", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1518,7 +1519,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterNewWithdrawalDelay(op
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewWithdrawalDelay") logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "NewWithdrawalDelay")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerNewWithdrawalDelayIterator{contract: _WithdrawalDelayer.contract, event: "NewWithdrawalDelay", logs: logs, sub: sub}, nil return &WithdrawalDelayerNewWithdrawalDelayIterator{contract: _WithdrawalDelayer.contract, event: "NewWithdrawalDelay", logs: logs, sub: sub}, nil
} }
@ -1530,7 +1531,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewWithdrawalDelay(opt
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewWithdrawalDelay") logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "NewWithdrawalDelay")
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1540,19 +1541,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewWithdrawalDelay(opt
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerNewWithdrawalDelay) event := new(WithdrawalDelayerNewWithdrawalDelay)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewWithdrawalDelay", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewWithdrawalDelay", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1566,7 +1567,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchNewWithdrawalDelay(opt
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewWithdrawalDelay(log types.Log) (*WithdrawalDelayerNewWithdrawalDelay, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseNewWithdrawalDelay(log types.Log) (*WithdrawalDelayerNewWithdrawalDelay, error) {
event := new(WithdrawalDelayerNewWithdrawalDelay) event := new(WithdrawalDelayerNewWithdrawalDelay)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewWithdrawalDelay", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "NewWithdrawalDelay", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }
@ -1662,7 +1663,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) FilterWithdraw(opts *bind.F
logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "Withdraw", tokenRule, ownerRule) logs, sub, err := _WithdrawalDelayer.contract.FilterLogs(opts, "Withdraw", tokenRule, ownerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return &WithdrawalDelayerWithdrawIterator{contract: _WithdrawalDelayer.contract, event: "Withdraw", logs: logs, sub: sub}, nil return &WithdrawalDelayerWithdrawIterator{contract: _WithdrawalDelayer.contract, event: "Withdraw", logs: logs, sub: sub}, nil
} }
@ -1683,7 +1684,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchWithdraw(opts *bind.Wa
logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "Withdraw", tokenRule, ownerRule) logs, sub, err := _WithdrawalDelayer.contract.WatchLogs(opts, "Withdraw", tokenRule, ownerRule)
if err != nil { if err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event.NewSubscription(func(quit <-chan struct{}) error { return event.NewSubscription(func(quit <-chan struct{}) error {
defer sub.Unsubscribe() defer sub.Unsubscribe()
@ -1693,19 +1694,19 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchWithdraw(opts *bind.Wa
// New log arrived, parse the event and forward to the user // New log arrived, parse the event and forward to the user
event := new(WithdrawalDelayerWithdraw) event := new(WithdrawalDelayerWithdraw)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "Withdraw", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "Withdraw", log); err != nil {
return err
return tracerr.Wrap(err)
} }
event.Raw = log event.Raw = log
select { select {
case sink <- event: case sink <- event:
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
case err := <-sub.Err(): case err := <-sub.Err():
return err
return tracerr.Wrap(err)
case <-quit: case <-quit:
return nil return nil
} }
@ -1719,7 +1720,7 @@ func (_WithdrawalDelayer *WithdrawalDelayerFilterer) WatchWithdraw(opts *bind.Wa
func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseWithdraw(log types.Log) (*WithdrawalDelayerWithdraw, error) { func (_WithdrawalDelayer *WithdrawalDelayerFilterer) ParseWithdraw(log types.Log) (*WithdrawalDelayerWithdraw, error) {
event := new(WithdrawalDelayerWithdraw) event := new(WithdrawalDelayerWithdraw)
if err := _WithdrawalDelayer.contract.UnpackLog(event, "Withdraw", log); err != nil { if err := _WithdrawalDelayer.contract.UnpackLog(event, "Withdraw", log); err != nil {
return nil, err
return nil, tracerr.Wrap(err)
} }
return event, nil return event, nil
} }

+ 21
- 4
eth/ethereum.go

@ -76,6 +76,7 @@ type EthereumClient struct {
ks *ethKeystore.KeyStore ks *ethKeystore.KeyStore
ReceiptTimeout time.Duration ReceiptTimeout time.Duration
config *EthereumConfig config *EthereumConfig
opts *bind.CallOpts
} }
// NewEthereumClient creates a EthereumClient instance. The account is not mandatory (it can // NewEthereumClient creates a EthereumClient instance. The account is not mandatory (it can
@ -90,7 +91,14 @@ func NewEthereumClient(client *ethclient.Client, account *accounts.Account, ks *
IntervalReceiptLoop: defaultIntervalReceiptLoop, IntervalReceiptLoop: defaultIntervalReceiptLoop,
} }
} }
return &EthereumClient{client: client, account: account, ks: ks, ReceiptTimeout: config.ReceiptTimeout * time.Second, config: config}
return &EthereumClient{
client: client,
account: account,
ks: ks,
ReceiptTimeout: config.ReceiptTimeout * time.Second,
config: config,
opts: newCallOpts(),
}
} }
// BalanceAt retieves information about the default account // BalanceAt retieves information about the default account
@ -286,17 +294,17 @@ func (c *EthereumClient) EthERC20Consts(tokenAddress ethCommon.Address) (*ERC20C
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
name, err := instance.Name(nil)
name, err := instance.Name(c.opts)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
symbol, err := instance.Symbol(nil)
symbol, err := instance.Symbol(c.opts)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
decimals, err := instance.Decimals(nil)
decimals, err := instance.Decimals(c.opts)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
@ -311,3 +319,12 @@ func (c *EthereumClient) EthERC20Consts(tokenAddress ethCommon.Address) (*ERC20C
func (c *EthereumClient) Client() *ethclient.Client { func (c *EthereumClient) Client() *ethclient.Client {
return c.client return c.client
} }
// newCallOpts returns a CallOpts to be used in ethereum calls with a non-zero
// From address. This is a workaround for a bug in ethereumjs-vm that shows up
// in ganache: https://github.com/hermeznetwork/hermez-node/issues/317
func newCallOpts() *bind.CallOpts {
return &bind.CallOpts{
From: ethCommon.HexToAddress("0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f"),
}
}

+ 13
- 11
eth/rollup.go

@ -251,6 +251,7 @@ type RollupClient struct {
hermez *Hermez.Hermez hermez *Hermez.Hermez
tokenHEZ *HEZ.HEZ tokenHEZ *HEZ.HEZ
contractAbi abi.ABI contractAbi abi.ABI
opts *bind.CallOpts
} }
// NewRollupClient creates a new RollupClient // NewRollupClient creates a new RollupClient
@ -279,6 +280,7 @@ func NewRollupClient(client *EthereumClient, address ethCommon.Address, tokenHEZ
hermez: hermez, hermez: hermez,
tokenHEZ: tokenHEZ, tokenHEZ: tokenHEZ,
contractAbi: contractAbi, contractAbi: contractAbi,
opts: newCallOpts(),
}, nil }, nil
} }
@ -364,7 +366,7 @@ func (c *RollupClient) RollupAddToken(tokenAddress ethCommon.Address, feeAddToke
func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) { func(ec *ethclient.Client, auth *bind.TransactOpts) (*types.Transaction, error) {
owner := c.client.account.Address owner := c.client.account.Address
spender := c.address spender := c.address
nonce, err := c.tokenHEZ.Nonces(nil, owner)
nonce, err := c.tokenHEZ.Nonces(c.opts, owner)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
@ -470,7 +472,7 @@ func (c *RollupClient) RollupL1UserTxERC20Permit(fromBJJ *babyjub.PublicKey, fro
} }
owner := c.client.account.Address owner := c.client.account.Address
spender := c.address spender := c.address
nonce, err := c.tokenHEZ.Nonces(nil, owner)
nonce, err := c.tokenHEZ.Nonces(c.opts, owner)
if err != nil { if err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
} }
@ -491,7 +493,7 @@ func (c *RollupClient) RollupL1UserTxERC20Permit(fromBJJ *babyjub.PublicKey, fro
// RollupRegisterTokensCount is the interface to call the smart contract function // RollupRegisterTokensCount is the interface to call the smart contract function
func (c *RollupClient) RollupRegisterTokensCount() (registerTokensCount *big.Int, err error) { func (c *RollupClient) RollupRegisterTokensCount() (registerTokensCount *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
registerTokensCount, err = c.hermez.RegisterTokensCount(nil)
registerTokensCount, err = c.hermez.RegisterTokensCount(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -502,7 +504,7 @@ func (c *RollupClient) RollupRegisterTokensCount() (registerTokensCount *big.Int
// RollupLastForgedBatch is the interface to call the smart contract function // RollupLastForgedBatch is the interface to call the smart contract function
func (c *RollupClient) RollupLastForgedBatch() (lastForgedBatch int64, err error) { func (c *RollupClient) RollupLastForgedBatch() (lastForgedBatch int64, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_lastForgedBatch, err := c.hermez.LastForgedBatch(nil)
_lastForgedBatch, err := c.hermez.LastForgedBatch(c.opts)
lastForgedBatch = int64(_lastForgedBatch) lastForgedBatch = int64(_lastForgedBatch)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
@ -601,7 +603,7 @@ func (c *RollupClient) RollupSafeMode() (tx *types.Transaction, err error) {
// RollupInstantWithdrawalViewer is the interface to call the smart contract function // RollupInstantWithdrawalViewer is the interface to call the smart contract function
func (c *RollupClient) RollupInstantWithdrawalViewer(tokenAddress ethCommon.Address, amount *big.Int) (instantAllowed bool, err error) { func (c *RollupClient) RollupInstantWithdrawalViewer(tokenAddress ethCommon.Address, amount *big.Int) (instantAllowed bool, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
instantAllowed, err = c.hermez.InstantWithdrawalViewer(nil, tokenAddress, amount)
instantAllowed, err = c.hermez.InstantWithdrawalViewer(c.opts, tokenAddress, amount)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return false, tracerr.Wrap(err) return false, tracerr.Wrap(err)
@ -613,18 +615,18 @@ func (c *RollupClient) RollupInstantWithdrawalViewer(tokenAddress ethCommon.Addr
func (c *RollupClient) RollupConstants() (rollupConstants *common.RollupConstants, err error) { func (c *RollupClient) RollupConstants() (rollupConstants *common.RollupConstants, err error) {
rollupConstants = new(common.RollupConstants) rollupConstants = new(common.RollupConstants)
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
absoluteMaxL1L2BatchTimeout, err := c.hermez.ABSOLUTEMAXL1L2BATCHTIMEOUT(nil)
absoluteMaxL1L2BatchTimeout, err := c.hermez.ABSOLUTEMAXL1L2BATCHTIMEOUT(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
rollupConstants.AbsoluteMaxL1L2BatchTimeout = int64(absoluteMaxL1L2BatchTimeout) rollupConstants.AbsoluteMaxL1L2BatchTimeout = int64(absoluteMaxL1L2BatchTimeout)
rollupConstants.TokenHEZ, err = c.hermez.TokenHEZ(nil)
rollupConstants.TokenHEZ, err = c.hermez.TokenHEZ(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
for i := int64(0); i < int64(common.LenVerifiers); i++ { for i := int64(0); i < int64(common.LenVerifiers); i++ {
var newRollupVerifier common.RollupVerifierStruct var newRollupVerifier common.RollupVerifierStruct
rollupVerifier, err := c.hermez.RollupVerifiers(nil, big.NewInt(i))
rollupVerifier, err := c.hermez.RollupVerifiers(c.opts, big.NewInt(i))
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
@ -632,15 +634,15 @@ func (c *RollupClient) RollupConstants() (rollupConstants *common.RollupConstant
newRollupVerifier.NLevels = rollupVerifier.NLevels.Int64() newRollupVerifier.NLevels = rollupVerifier.NLevels.Int64()
rollupConstants.Verifiers = append(rollupConstants.Verifiers, newRollupVerifier) rollupConstants.Verifiers = append(rollupConstants.Verifiers, newRollupVerifier)
} }
rollupConstants.HermezAuctionContract, err = c.hermez.HermezAuctionContract(nil)
rollupConstants.HermezAuctionContract, err = c.hermez.HermezAuctionContract(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
rollupConstants.HermezGovernanceAddress, err = c.hermez.HermezGovernanceAddress(nil)
rollupConstants.HermezGovernanceAddress, err = c.hermez.HermezGovernanceAddress(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
rollupConstants.WithdrawDelayerContract, err = c.hermez.WithdrawDelayerContract(nil)
rollupConstants.WithdrawDelayerContract, err = c.hermez.WithdrawDelayerContract(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)

+ 11
- 9
eth/wdelayer.go

@ -128,6 +128,7 @@ type WDelayerClient struct {
address ethCommon.Address address ethCommon.Address
wdelayer *WithdrawalDelayer.WithdrawalDelayer wdelayer *WithdrawalDelayer.WithdrawalDelayer
contractAbi abi.ABI contractAbi abi.ABI
opts *bind.CallOpts
} }
// NewWDelayerClient creates a new WDelayerClient // NewWDelayerClient creates a new WDelayerClient
@ -145,6 +146,7 @@ func NewWDelayerClient(client *EthereumClient, address ethCommon.Address) (*WDel
address: address, address: address,
wdelayer: wdelayer, wdelayer: wdelayer,
contractAbi: contractAbi, contractAbi: contractAbi,
opts: newCallOpts(),
}, nil }, nil
} }
@ -152,7 +154,7 @@ func NewWDelayerClient(client *EthereumClient, address ethCommon.Address) (*WDel
func (c *WDelayerClient) WDelayerGetHermezGovernanceAddress() (hermezGovernanceAddress *ethCommon.Address, err error) { func (c *WDelayerClient) WDelayerGetHermezGovernanceAddress() (hermezGovernanceAddress *ethCommon.Address, err error) {
var _hermezGovernanceAddress ethCommon.Address var _hermezGovernanceAddress ethCommon.Address
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_hermezGovernanceAddress, err = c.wdelayer.GetHermezGovernanceAddress(nil)
_hermezGovernanceAddress, err = c.wdelayer.GetHermezGovernanceAddress(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -190,7 +192,7 @@ func (c *WDelayerClient) WDelayerClaimGovernance() (tx *types.Transaction, err e
func (c *WDelayerClient) WDelayerGetEmergencyCouncil() (emergencyCouncilAddress *ethCommon.Address, err error) { func (c *WDelayerClient) WDelayerGetEmergencyCouncil() (emergencyCouncilAddress *ethCommon.Address, err error) {
var _emergencyCouncilAddress ethCommon.Address var _emergencyCouncilAddress ethCommon.Address
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
_emergencyCouncilAddress, err = c.wdelayer.GetEmergencyCouncil(nil)
_emergencyCouncilAddress, err = c.wdelayer.GetEmergencyCouncil(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -227,7 +229,7 @@ func (c *WDelayerClient) WDelayerClaimEmergencyCouncil() (tx *types.Transaction,
// WDelayerIsEmergencyMode is the interface to call the smart contract function // WDelayerIsEmergencyMode is the interface to call the smart contract function
func (c *WDelayerClient) WDelayerIsEmergencyMode() (ermergencyMode bool, err error) { func (c *WDelayerClient) WDelayerIsEmergencyMode() (ermergencyMode bool, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
ermergencyMode, err = c.wdelayer.IsEmergencyMode(nil)
ermergencyMode, err = c.wdelayer.IsEmergencyMode(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return false, tracerr.Wrap(err) return false, tracerr.Wrap(err)
@ -238,7 +240,7 @@ func (c *WDelayerClient) WDelayerIsEmergencyMode() (ermergencyMode bool, err err
// WDelayerGetWithdrawalDelay is the interface to call the smart contract function // WDelayerGetWithdrawalDelay is the interface to call the smart contract function
func (c *WDelayerClient) WDelayerGetWithdrawalDelay() (withdrawalDelay *big.Int, err error) { func (c *WDelayerClient) WDelayerGetWithdrawalDelay() (withdrawalDelay *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
withdrawalDelay, err = c.wdelayer.GetWithdrawalDelay(nil)
withdrawalDelay, err = c.wdelayer.GetWithdrawalDelay(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -249,7 +251,7 @@ func (c *WDelayerClient) WDelayerGetWithdrawalDelay() (withdrawalDelay *big.Int,
// WDelayerGetEmergencyModeStartingTime is the interface to call the smart contract function // WDelayerGetEmergencyModeStartingTime is the interface to call the smart contract function
func (c *WDelayerClient) WDelayerGetEmergencyModeStartingTime() (emergencyModeStartingTime *big.Int, err error) { func (c *WDelayerClient) WDelayerGetEmergencyModeStartingTime() (emergencyModeStartingTime *big.Int, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
emergencyModeStartingTime, err = c.wdelayer.GetEmergencyModeStartingTime(nil)
emergencyModeStartingTime, err = c.wdelayer.GetEmergencyModeStartingTime(c.opts)
return tracerr.Wrap(err) return tracerr.Wrap(err)
}); err != nil { }); err != nil {
return nil, tracerr.Wrap(err) return nil, tracerr.Wrap(err)
@ -286,7 +288,7 @@ func (c *WDelayerClient) WDelayerChangeWithdrawalDelay(newWithdrawalDelay uint64
// WDelayerDepositInfo is the interface to call the smart contract function // WDelayerDepositInfo is the interface to call the smart contract function
func (c *WDelayerClient) WDelayerDepositInfo(owner, token ethCommon.Address) (depositInfo DepositState, err error) { func (c *WDelayerClient) WDelayerDepositInfo(owner, token ethCommon.Address) (depositInfo DepositState, err error) {
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
amount, depositTimestamp, err := c.wdelayer.DepositInfo(nil, owner, token)
amount, depositTimestamp, err := c.wdelayer.DepositInfo(c.opts, owner, token)
depositInfo.Amount = amount depositInfo.Amount = amount
depositInfo.DepositTimestamp = depositTimestamp depositInfo.DepositTimestamp = depositTimestamp
return tracerr.Wrap(err) return tracerr.Wrap(err)
@ -339,15 +341,15 @@ func (c *WDelayerClient) WDelayerEscapeHatchWithdrawal(to, token ethCommon.Addre
func (c *WDelayerClient) WDelayerConstants() (constants *common.WDelayerConstants, err error) { func (c *WDelayerClient) WDelayerConstants() (constants *common.WDelayerConstants, err error) {
constants = new(common.WDelayerConstants) constants = new(common.WDelayerConstants)
if err := c.client.Call(func(ec *ethclient.Client) error { if err := c.client.Call(func(ec *ethclient.Client) error {
constants.MaxWithdrawalDelay, err = c.wdelayer.MAXWITHDRAWALDELAY(nil)
constants.MaxWithdrawalDelay, err = c.wdelayer.MAXWITHDRAWALDELAY(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
constants.MaxEmergencyModeTime, err = c.wdelayer.MAXEMERGENCYMODETIME(nil)
constants.MaxEmergencyModeTime, err = c.wdelayer.MAXEMERGENCYMODETIME(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
constants.HermezRollup, err = c.wdelayer.HermezRollupAddress(nil)
constants.HermezRollup, err = c.wdelayer.HermezRollupAddress(c.opts)
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }

Loading…
Cancel
Save