diff --git a/erc20-balances-transfers/src/maps.rs b/erc20-balances-transfers/src/maps.rs index 3a47e55..d9ab531 100644 --- a/erc20-balances-transfers/src/maps.rs +++ b/erc20-balances-transfers/src/maps.rs @@ -78,6 +78,7 @@ pub fn to_balance_change<'a>( // -- call -- call_index: call.index, + call_address: Hex::encode(&call.address), // -- log -- log_index: log.index, @@ -94,14 +95,6 @@ pub fn to_balance_change<'a>( old_balance: old_balance.to_string(), new_balance: new_balance.to_string(), - // -- transfer -- - from: Hex::encode(&transfer.from), - to: Hex::encode(&transfer.to), - value: transfer.value.to_string(), - - // -- indexing -- - version: index_to_version(clock, storage_change), - // -- debug -- balance_change_type: change_type as i32, } diff --git a/erc20-balances-transfers/src/pb/erc20.types.v1.rs b/erc20-balances-transfers/src/pb/erc20.types.v1.rs index 4862e0b..7466c4e 100644 --- a/erc20-balances-transfers/src/pb/erc20.types.v1.rs +++ b/erc20-balances-transfers/src/pb/erc20.types.v1.rs @@ -26,21 +26,24 @@ pub struct BalanceChange { /// -- call -- #[prost(uint32, tag="6")] pub call_index: u32, + /// may indicate the “to” or “from” in a lower-level call context, but is not the address that emitted the event. + #[prost(string, tag="7")] + pub call_address: ::prost::alloc::string::String, /// -- log -- /// /// Index is the index of the log relative to the transaction. This index is always populated regardless of the state revertion of the the call that emitted this log. - #[prost(uint32, tag="7")] + #[prost(uint32, tag="10")] pub log_index: u32, /// BlockIndex represents the index of the log relative to the Block. - #[prost(uint32, tag="8")] + #[prost(uint32, tag="11")] pub log_block_index: u32, /// the block's global ordinal when the transfer was recorded. - #[prost(uint64, tag="9")] + #[prost(uint64, tag="12")] pub log_ordinal: u64, /// -- storage change -- - #[prost(string, tag="10")] + #[prost(string, tag="13")] pub storage_key: ::prost::alloc::string::String, - #[prost(uint64, tag="11")] + #[prost(uint64, tag="14")] pub storage_ordinal: u64, /// -- balance change -- /// @@ -53,18 +56,6 @@ pub struct BalanceChange { pub old_balance: ::prost::alloc::string::String, #[prost(string, tag="23")] pub new_balance: ::prost::alloc::string::String, - /// -- transfer -- - #[prost(string, tag="25")] - pub from: ::prost::alloc::string::String, - #[prost(string, tag="26")] - pub to: ::prost::alloc::string::String, - #[prost(string, tag="27")] - pub value: ::prost::alloc::string::String, - /// -- indexing -- - /// - /// latest version of the balance change (block_num << 32 + storage_ordinal) - #[prost(uint64, tag="30")] - pub version: u64, /// -- debug -- /// /// type enum isn't supported yet as a leaf node diff --git a/proto/v1/erc20.proto b/proto/v1/erc20.proto index 96d49e6..c7e4d78 100644 --- a/proto/v1/erc20.proto +++ b/proto/v1/erc20.proto @@ -34,15 +34,16 @@ message BalanceChange { // -- call -- uint32 call_index = 6; + string call_address = 7; // may indicate the “to” or “from” in a lower-level call context, but is not the address that emitted the event. // -- log -- - uint32 log_index = 7; // Index is the index of the log relative to the transaction. This index is always populated regardless of the state revertion of the the call that emitted this log. - uint32 log_block_index = 8; // BlockIndex represents the index of the log relative to the Block. - uint64 log_ordinal = 9; // the block's global ordinal when the transfer was recorded. + uint32 log_index = 10; // Index is the index of the log relative to the transaction. This index is always populated regardless of the state revertion of the the call that emitted this log. + uint32 log_block_index = 11; // BlockIndex represents the index of the log relative to the Block. + uint64 log_ordinal = 12; // the block's global ordinal when the transfer was recorded. // -- storage change -- - string storage_key = 10; - uint64 storage_ordinal = 11; + string storage_key = 13; + uint64 storage_ordinal = 14; // -- balance change -- string contract = 20; // storage_change.address @@ -50,14 +51,6 @@ message BalanceChange { string old_balance = 22; string new_balance = 23; - // -- transfer -- - string from = 25; - string to = 26; - string value = 27; - - // -- indexing -- - uint64 version = 30; // latest version of the balance change (block_num << 32 + storage_ordinal) - // -- debug -- int32 balance_change_type = 99; // type enum isn't supported yet as a leaf node }