@ -0,0 +1,18 @@ |
|||||
|
package common |
||||
|
|
||||
|
import ( |
||||
|
eth "github.com/ethereum/go-ethereum/common" |
||||
|
) |
||||
|
|
||||
|
// Coordinator represents a Hermez network coordinator who wins an auction for an specific slot
|
||||
|
// WARNING: this is strongly based on the previous implementation, once the new spec is done, this may change a lot.
|
||||
|
type Coordinator struct { |
||||
|
CoordinatorID CoordinatorID |
||||
|
Forger eth.Address // address of the forger
|
||||
|
Beneficiary eth.Address // address of the beneficiary
|
||||
|
Withdraw eth.Address // address of the withdraw
|
||||
|
URL string // URL of the coordinators API
|
||||
|
} |
||||
|
|
||||
|
// CoordinatorID is use to identify a Hermez coordinator
|
||||
|
type CoordinatorID uint64 |
@ -1,15 +1,20 @@ |
|||||
package common |
package common |
||||
|
|
||||
import "math/big" |
|
||||
|
import ( |
||||
|
"math/big" |
||||
|
|
||||
|
eth "github.com/ethereum/go-ethereum/common" |
||||
|
"github.com/iden3/go-iden3-crypto/babyjub" |
||||
|
) |
||||
|
|
||||
// L1Tx is a struct that represents an already forged L1 tx
|
// L1Tx is a struct that represents an already forged L1 tx
|
||||
// WARNING: this struct is very unclear and a complete guess
|
// WARNING: this struct is very unclear and a complete guess
|
||||
type L1Tx struct { |
type L1Tx struct { |
||||
Tx |
Tx |
||||
Ax *big.Int // Ax is the x coordinate of the BabyJubJub curve point
|
|
||||
Ay *big.Int // Ay is the y coordinate of the BabyJubJub curve point
|
|
||||
|
PublicKey babyjub.PublicKey |
||||
LoadAmount *big.Int // amount transfered from L1 -> L2
|
LoadAmount *big.Int // amount transfered from L1 -> L2
|
||||
Mined bool |
|
||||
BlockNum uint64 |
|
||||
|
EthBlockNum uint64 |
||||
|
EthTxHash eth.Hash |
||||
|
Position int // Position among all the L1Txs in that batch
|
||||
ToForgeL1TxsNumber uint32 |
ToForgeL1TxsNumber uint32 |
||||
} |
} |
@ -1,14 +0,0 @@ |
|||||
package common |
|
||||
|
|
||||
import ( |
|
||||
eth "github.com/ethereum/go-ethereum/common" |
|
||||
) |
|
||||
|
|
||||
// Operator represents a Hermez network operator who wins an auction for an specific slot
|
|
||||
// WARNING: this is strongly based on the previous implementation, once the new spec is done, this may change a lot.
|
|
||||
type Operator struct { |
|
||||
Forger eth.Address // address of the forger
|
|
||||
Beneficiary eth.Address // address of the beneficiary
|
|
||||
Withdraw eth.Address // address of the withdraw
|
|
||||
URL string // URL of the operators API
|
|
||||
} |
|