Initial dract of the common structs

This commit is contained in:
a_bennassar
2020-07-24 13:04:17 +02:00
parent ecf731982e
commit b9936f8564
16 changed files with 310 additions and 5 deletions

25
common/token.go Normal file
View File

@@ -0,0 +1,25 @@
package common
import (
"time"
eth "github.com/ethereum/go-ethereum/common"
)
// Token is a struct that represents an Etherum token that is supported in Hermez network
type Token struct {
ID TokenID
Addr eth.Address
Symbol string
Decimals uint64
}
// TokenInfo provides the price of the token in USD
type TokenInfo struct {
TokenID uint32
Value float64
LastUpdated time.Time
}
// TokenID is the unique identifier of the token, as set in the smart contract
type TokenID uint32 // current implementation supports up to 2^32 tokens