github.com/ChainSafe/chainbridge-core@v1.4.2/chains/evm/calls/events/events.go (about)

     1  package events
     2  
     3  import (
     4  	"github.com/ChainSafe/chainbridge-core/types"
     5  	"github.com/ethereum/go-ethereum/common"
     6  	"github.com/ethereum/go-ethereum/crypto"
     7  )
     8  
     9  type EventSig string
    10  
    11  func (es EventSig) GetTopic() common.Hash {
    12  	return crypto.Keccak256Hash([]byte(es))
    13  }
    14  
    15  const (
    16  	DepositSig          EventSig = "Deposit(uint8,bytes32,uint64,address,bytes,bytes)"
    17  	ThresholdChangedSig EventSig = "RelayerThresholdChanged(uint256)"
    18  	ProposalEventSig    EventSig = "ProposalEvent(uint8,uint64,uint8,bytes32)"
    19  	ProposalVoteSig     EventSig = "ProposalVote(uint8,uint64,uint8,bytes32)"
    20  )
    21  
    22  // Deposit struct holds event data with all necessary parameters and a handler response
    23  // https://github.com/ChainSafe/chainbridge-solidity/blob/develop/contracts/Bridge.sol#L47
    24  type Deposit struct {
    25  	// ID of chain deposit will be bridged to
    26  	DestinationDomainID uint8
    27  	// ResourceID used to find address of handler to be used for deposit
    28  	ResourceID types.ResourceID
    29  	// Nonce of deposit
    30  	DepositNonce uint64
    31  	// Address of sender (msg.sender: user)
    32  	SenderAddress common.Address
    33  	// Additional data to be passed to specified handler
    34  	Data []byte
    35  	// ERC20Handler: responds with empty data
    36  	// ERC721Handler: responds with deposited token metadata acquired by calling a tokenURI method in the token contract
    37  	// GenericHandler: responds with the raw bytes returned from the call to the target contract
    38  	HandlerResponse []byte
    39  }