From 481ac6196552186dee9050e8c671cee8c3bcbb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Mon, 19 Aug 2024 10:28:51 +0300 Subject: [PATCH] Define some events (and constants), prepare their handling. --- server/services/constants.go | 13 ++++++++++--- server/services/transactionEvents.go | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/server/services/constants.go b/server/services/constants.go index 2df664a9..2ba387f3 100644 --- a/server/services/constants.go +++ b/server/services/constants.go @@ -12,6 +12,8 @@ var ( transactionProcessingTypeRelayedV1 = "RelayedTx" transactionProcessingTypeBuiltInFunctionCall = "BuiltInFunctionCall" transactionProcessingTypeMoveBalance = "MoveBalance" + transactionProcessingTypeContractInvoking = "SCInvoking" + transactionProcessingTypeContractDeployment = "SCDeployment" amountZero = "0" builtInFunctionClaimDeveloperRewards = core.BuiltInFunctionClaimDeveloperRewards builtInFunctionESDTTransfer = core.BuiltInFunctionESDTTransfer @@ -20,20 +22,25 @@ var ( sendingValueToNonPayableContractDataPrefix = argumentsSeparator + hex.EncodeToString([]byte("sending value to non payable contract")) emptyHash = strings.Repeat("0", 64) nodeVersionForOfflineRosetta = "N / A" + systemContractDeployAddress = "erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu" nativeAsESDTIdentifier = "EGLD-000000" ) var ( transactionEventSignalError = core.SignalErrorOperation + transactionEventInternalVMErrors = "internalVMErrors" + transactionEventSCDeploy = core.SCDeployIdentifier + transactionEventTransferValueOnly = "transferValueOnly" transactionEventESDTTransfer = "ESDTTransfer" transactionEventESDTNFTTransfer = "ESDTNFTTransfer" transactionEventESDTNFTCreate = "ESDTNFTCreate" transactionEventESDTNFTBurn = "ESDTNFTBurn" transactionEventESDTNFTAddQuantity = "ESDTNFTAddQuantity" transactionEventMultiESDTNFTTransfer = "MultiESDTNFTTransfer" - transactionEventESDTLocalBurn = "ESDTLocalBurn" - transactionEventESDTLocalMint = "ESDTLocalMint" - transactionEventESDTWipe = "ESDTWipe" + transactionEventESDTLocalBurn = core.BuiltInFunctionESDTLocalBurn + transactionEventESDTLocalMint = core.BuiltInFunctionESDTLocalMint + transactionEventESDTWipe = core.BuiltInFunctionESDTWipe + transactionEventClaimDeveloperRewards = core.BuiltInFunctionClaimDeveloperRewards transactionEventTopicInvalidMetaTransaction = "meta transaction is invalid" transactionEventTopicInvalidMetaTransactionNotEnoughGas = "meta transaction is invalid: not enough gas" ) diff --git a/server/services/transactionEvents.go b/server/services/transactionEvents.go index 14c636e2..562c2f4b 100644 --- a/server/services/transactionEvents.go +++ b/server/services/transactionEvents.go @@ -5,6 +5,12 @@ import ( "math/big" ) +type eventTransferValueOnly struct { + sender string + receiver string + value string +} + type eventESDT struct { senderAddress string receiverAddress string @@ -48,3 +54,13 @@ func (event *eventESDT) getExtendedIdentifier() string { return event.identifier } + +type eventSCDeploy struct { + contractAddress string + deployerAddress string +} + +type eventClaimDeveloperRewards struct { + value string + receiverAddress string +}