Sfraxeth adapter and substream with SDK integration (#87)
* first commit * feat: implemented get tokens and improved modifier * feat: added missing functions (to implement) * feat: implemented getPoolIds * feat: implemented getCapabilities * feat: implemented getLimits function * fix: fixed constructor * feat and fix: implemented testGetLimitsFraxEthV3 and fixed getLimits * feat: implementing getPriceAt function * feat and fix: finished implementing getPriceAt, fixed modifier * feat: price function and tests implemented * fix: removed onlySupportedTokens modifier from getPriceAt and applied it in price and swap function * feat: implemented sell, buy, and swap functions * implementing final tests * aligned with main branch * fixes * fix: Review Fixes * feat: 🎨 sfraxeth substream initial scaffolding * fix: 🎨 protocol component creation at deployment block * build: 💚 cargo build * feat: 🎨 map proper event to balance changes * fix: 🚚 remove unnecessary files * fix: 💚 ci checks Due to the CI checks requiring the latest rust nightly, the rust-lang organisation introduced new doc related rules. This commit fixes the CI errors by making the necessary changes to the comments in substreams-balancer comments * fix: 🐛 wasm output name * fix: 🐛 update starting block = deployment block -1 * feat: 🎨 add store for reward cycles and update balances accounting after after deposit before Withdraw * feat: 🎨 finish setting up block reward logic * docs: 📝 add comments on extra module * build: 📌 adapt dependencies to workspace dependencies setting prost-types to workspace version causes build errors * feat: 🎨 add support for several EVM compatible networks * fix: 🐛 update balance delta accounting logic following the `NextRewardCycle` event only * fix: 🐛 hex address string param encoding * fix: 🐛 deployment transaction check * ci: 💚 ci check passing * fix: 🐛 issues with hex-binary encoding * refactor: ♻️ address mappings for various networks * fix: 💚 formatting * feat: Implemented testPoolBehaviour * chore: Removed unused comments * feat: ⬆️ update to recent sdk * feat: 🎨 testing setup * test: ✅ setup test environminte for sfraxeth * fix: 🐛 unwrap error in map_protocol_changes * build: ⬆️ update rust version * build: ➖ remove unnecessary deps * build: 🚚 remove unnecessary pb/tycho * fix: 🐛 remove balance owner attribute * fix: 🐛 remove unnecessary static attributes * fix: 🐛 remove manual updates * fix: 🔥 remove unused data model from contract.proto * fix: 🐛 filter by known components * feat: ⚡ use store delta for reward change accounting * refactor: ♻️ remove shallow create vault component * feat: ⚡ replace is_deployment_tx logic with simpler txn match * test: ✅ manual testing with inspection against etherscan https://etherscan.io/address/0xac3E018457B222d93114458476f3E3416Abbe38F#events * ci: 💚 ci checks * fix: 🐛 map_protocol_components output data * fix: 🐛 output type on map_protocol_changes * test: 🧪 skip balance checks * fixed FraxV3FrxEthAdapter arguments for constructor in manifest.yaml * fix: 🐛 adapter error with overflow/underflow and addresses * restore: restored previous adater version * fix: set minimum swap amount to prevent overflow/underflow * fix: set minimum swap amount only for sfrxETH -> frxETH * improve: added print block_number to runner.py when get_amout_out fails * removed console.log * alignment with propeller main * Update forge-std submodule reference to include ds-test * installed protosim_py 0.21.0 * commented out minimum swap amount for sfrxEth -> frxEth pair * updated adapter limits * working on fixes * fix: Adjust getLimits according to protocol limitation. Previously limits were estimated with token supplies, this commit simplifies limits and adjusts them so they correspond closely with what is supported by the sfrxETH contract. * chore: fmt * wip: Changed ubuntu to 20.04, fmt adapters * wip: Updated python tests * wip: Trying with ubuntu: latest * chore: fmt adapters * wip: Using ubuntu 20.04 * chore: Switched back to ubuntu-latest --------- Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com> Co-authored-by: domenicodev <domenico.romeo3919@gmail.com> Co-authored-by: kayibal <alan@datarevenue.com> Co-authored-by: domenicodev <domenico.rom3@gmail.com>
This commit is contained in:
2
substreams/ethereum-sfraxeth/src/abi/mod.rs
Normal file
2
substreams/ethereum-sfraxeth/src/abi/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
#[allow(clippy::all)]
|
||||
pub mod sfraxeth_contract;
|
||||
4096
substreams/ethereum-sfraxeth/src/abi/sfraxeth_contract.rs
Normal file
4096
substreams/ethereum-sfraxeth/src/abi/sfraxeth_contract.rs
Normal file
File diff suppressed because it is too large
Load Diff
3
substreams/ethereum-sfraxeth/src/lib.rs
Normal file
3
substreams/ethereum-sfraxeth/src/lib.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod abi;
|
||||
mod modules;
|
||||
mod pb;
|
||||
411
substreams/ethereum-sfraxeth/src/modules.rs
Normal file
411
substreams/ethereum-sfraxeth/src/modules.rs
Normal file
@@ -0,0 +1,411 @@
|
||||
use crate::{
|
||||
abi,
|
||||
pb::contract::v1::{BlockRewardCycles, RewardCycle},
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use std::collections::HashMap;
|
||||
use substreams::{
|
||||
hex,
|
||||
pb::substreams::StoreDeltas,
|
||||
scalar::BigInt,
|
||||
store::{
|
||||
StoreAdd, StoreAddBigInt, StoreAddInt64, StoreGet, StoreGetInt64, StoreGetString, StoreNew,
|
||||
StoreSet, StoreSetRaw,
|
||||
},
|
||||
};
|
||||
use substreams_ethereum::{pb::eth, Event};
|
||||
use tycho_substreams::{
|
||||
balances::aggregate_balances_changes, contract::extract_contract_changes_builder, prelude::*,
|
||||
};
|
||||
|
||||
#[substreams::handlers::map]
|
||||
pub fn map_components(
|
||||
params: String,
|
||||
block: eth::v2::Block,
|
||||
) -> Result<BlockTransactionProtocolComponents, anyhow::Error> {
|
||||
let vault_address = hex::decode(params).unwrap();
|
||||
let locked_asset = map_vault_to_locked_asset(&vault_address).unwrap();
|
||||
// We store these as a hashmap by tx hash since we need to agg by tx hash later
|
||||
Ok(BlockTransactionProtocolComponents {
|
||||
tx_components: block
|
||||
.transactions()
|
||||
.filter_map(|tx| {
|
||||
let components = tx
|
||||
.calls()
|
||||
.filter(|call| !call.call.state_reverted)
|
||||
.filter_map(|_| {
|
||||
// address doesn't exist before contract deployment, hence the first tx with
|
||||
// a log.address = vault_address is the deployment tx
|
||||
if is_deployment_tx(tx, &vault_address) {
|
||||
Some(
|
||||
ProtocolComponent::at_contract(&vault_address, &tx.into())
|
||||
.with_tokens(&[
|
||||
locked_asset.as_slice(),
|
||||
vault_address.as_slice(),
|
||||
])
|
||||
.as_swap_type("sfraxeth_vault", ImplementationType::Vm),
|
||||
)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if !components.is_empty() {
|
||||
Some(TransactionProtocolComponents { tx: Some(tx.into()), components })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Simply stores the `ProtocolComponent`s with the pool id as the key
|
||||
#[substreams::handlers::store]
|
||||
pub fn store_components(map: BlockTransactionProtocolComponents, store: StoreAddInt64) {
|
||||
store.add_many(
|
||||
0,
|
||||
&map.tx_components
|
||||
.iter()
|
||||
.flat_map(|tx_components| &tx_components.components)
|
||||
.map(|component| format!("pool:{0}", component.id))
|
||||
.collect::<Vec<_>>(),
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
||||
// updates the reward rate to be accounted for at each block for the totalAsset locked in the vault
|
||||
#[substreams::handlers::map]
|
||||
pub fn map_reward_cycles(
|
||||
block: eth::v2::Block,
|
||||
components_store: StoreGetString,
|
||||
) -> Result<BlockRewardCycles, anyhow::Error> {
|
||||
let reward_cycles = block
|
||||
.logs()
|
||||
.filter(|vault_log| {
|
||||
components_store
|
||||
.get_last(format!("pool:0x{}", hex::encode(vault_log.address())))
|
||||
.is_some()
|
||||
})
|
||||
.filter_map(|vault_log| {
|
||||
if let Some(ev) =
|
||||
abi::sfraxeth_contract::events::NewRewardsCycle::match_and_decode(vault_log.log)
|
||||
{
|
||||
substreams::log::info!(
|
||||
"New rewards cycle: end={}, next rewards={}",
|
||||
ev.cycle_end,
|
||||
ev.reward_amount,
|
||||
);
|
||||
Some(RewardCycle {
|
||||
ord: vault_log.ordinal(),
|
||||
next_reward_amount: ev.reward_amount.to_signed_bytes_be(),
|
||||
vault_address: vault_log.address().to_vec(), // be bytes
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Ok(BlockRewardCycles { reward_cycles })
|
||||
}
|
||||
|
||||
#[substreams::handlers::store]
|
||||
pub fn store_reward_cycles(block_reward_cycles: BlockRewardCycles, store: StoreSetRaw) {
|
||||
block_reward_cycles
|
||||
.reward_cycles
|
||||
.into_iter()
|
||||
.for_each(|reward_cycle| {
|
||||
let address_hex = format!("0x{}", hex::encode(&reward_cycle.vault_address));
|
||||
store.set(
|
||||
reward_cycle.ord,
|
||||
format!("reward_cycle:{}", address_hex),
|
||||
&reward_cycle.next_reward_amount,
|
||||
);
|
||||
});
|
||||
}
|
||||
#[substreams::handlers::map]
|
||||
pub fn map_relative_balances(
|
||||
block: eth::v2::Block,
|
||||
store: StoreGetInt64,
|
||||
reward_store: StoreDeltas,
|
||||
) -> Result<BlockBalanceDeltas, anyhow::Error> {
|
||||
let balance_deltas = block
|
||||
.logs()
|
||||
.filter(|log| map_vault_to_locked_asset(log.address()).is_some())
|
||||
.flat_map(|vault_log| {
|
||||
let mut deltas = Vec::new();
|
||||
|
||||
if let Some(ev) =
|
||||
abi::sfraxeth_contract::events::Withdraw::match_and_decode(vault_log.log)
|
||||
{
|
||||
let address_bytes_be = vault_log.address();
|
||||
let address_hex = format!("0x{}", hex::encode(address_bytes_be));
|
||||
|
||||
if store
|
||||
.get_last(format!("pool:{}", address_hex))
|
||||
.is_some()
|
||||
{
|
||||
substreams::log::info!(
|
||||
"Withdraw: -fraxEth {} -sfraxEth {}",
|
||||
ev.assets,
|
||||
ev.shares
|
||||
);
|
||||
deltas.extend_from_slice(&[
|
||||
BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
token: map_vault_to_locked_asset(address_bytes_be)
|
||||
.unwrap()
|
||||
.to_vec(),
|
||||
delta: ev.assets.neg().to_signed_bytes_be(),
|
||||
component_id: address_hex.as_bytes().to_vec(),
|
||||
},
|
||||
BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
token: address_bytes_be.to_vec(),
|
||||
delta: ev.shares.neg().to_signed_bytes_be(),
|
||||
component_id: address_hex.as_bytes().to_vec(),
|
||||
},
|
||||
])
|
||||
}
|
||||
} else if let Some(ev) =
|
||||
abi::sfraxeth_contract::events::Deposit::match_and_decode(vault_log.log)
|
||||
{
|
||||
let address_bytes_be = vault_log.address();
|
||||
let address_hex = format!("0x{}", hex::encode(address_bytes_be));
|
||||
if store
|
||||
.get_last(format!("pool:{}", address_hex))
|
||||
.is_some()
|
||||
{
|
||||
deltas.extend_from_slice(&[
|
||||
BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
token: map_vault_to_locked_asset(address_bytes_be)
|
||||
.unwrap()
|
||||
.to_vec(),
|
||||
delta: ev.assets.to_signed_bytes_be(),
|
||||
component_id: address_hex.as_bytes().to_vec(),
|
||||
},
|
||||
BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
token: address_bytes_be.to_vec(),
|
||||
delta: ev.shares.to_signed_bytes_be(),
|
||||
component_id: address_hex.as_bytes().to_vec(),
|
||||
},
|
||||
]);
|
||||
substreams::log::info!("Deposit: {:?}", deltas);
|
||||
}
|
||||
} else if abi::sfraxeth_contract::events::NewRewardsCycle::match_and_decode(vault_log)
|
||||
.is_some()
|
||||
{
|
||||
let address_bytes_be = vault_log.address();
|
||||
let address_hex = format!("0x{}", hex::encode(address_bytes_be));
|
||||
if store
|
||||
.get_last(format!("pool:{}", address_hex))
|
||||
.is_some()
|
||||
{
|
||||
// When the NextRewardsCycle event is emitted:
|
||||
// 1. `lastRewardAmount` is read from storage
|
||||
// 2. `storedTotalAssets` is incremented by the `lastRewardAmount` in the event
|
||||
// 3. `lastRewardAmount` is update with the `nextReward` (2nd parameter) in the
|
||||
// event
|
||||
// Hence the reward_store at key `reward_cycle:{address_hex}` will is
|
||||
// updated in this block. We want to use the first value of
|
||||
// the record at the beginning of the block (before the store_reward_cycles
|
||||
// writes to that key) ref: https://github.com/FraxFinance/frax-solidity/blob/85039d4dff2fb24d8a1ba6efc1ebf7e464df9dcf/src/hardhat/contracts/FraxETH/sfrxETH.sol.old#L984
|
||||
if let Some(last_reward_amount) = reward_store
|
||||
.deltas
|
||||
.iter()
|
||||
.find(|el| el.key == format!("reward_cycle:{}", address_hex))
|
||||
.map(|el| el.old_value.clone())
|
||||
{
|
||||
substreams::log::info!(
|
||||
"Reward cycle balance change: address {}, sfraxEth amount {}",
|
||||
address_hex,
|
||||
BigInt::from_signed_bytes_be(&last_reward_amount)
|
||||
);
|
||||
deltas.push(BalanceDelta {
|
||||
ord: vault_log.ordinal(),
|
||||
tx: Some(vault_log.receipt.transaction.into()),
|
||||
token: map_vault_to_locked_asset(address_bytes_be)
|
||||
.unwrap()
|
||||
.to_vec(),
|
||||
delta: last_reward_amount,
|
||||
component_id: address_hex.as_bytes().to_vec(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deltas
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Ok(BlockBalanceDeltas { balance_deltas })
|
||||
}
|
||||
|
||||
/// It's significant to include both the `pool_id` and the `token_id` for each balance delta as the
|
||||
/// store key to ensure that there's a unique balance being tallied for each.
|
||||
#[substreams::handlers::store]
|
||||
pub fn store_balances(deltas: BlockBalanceDeltas, store: StoreAddBigInt) {
|
||||
tycho_substreams::balances::store_balance_changes(deltas, store);
|
||||
}
|
||||
|
||||
/// This is the main map that handles most of the indexing of this substream.
|
||||
/// Every contract change is grouped by transaction index via the `transaction_changes`
|
||||
/// map. Each block of code will extend the `TransactionChanges` struct with the
|
||||
/// cooresponding changes (balance, component, contract), inserting a new one if it doesn't exist.
|
||||
/// At the very end, the map can easily be sorted by index to ensure the final
|
||||
/// `BlockChanges` is ordered by transactions properly.
|
||||
#[substreams::handlers::map]
|
||||
pub fn map_protocol_changes(
|
||||
block: eth::v2::Block,
|
||||
grouped_components: BlockTransactionProtocolComponents,
|
||||
deltas: BlockBalanceDeltas,
|
||||
components_store: StoreGetString,
|
||||
balance_store: StoreDeltas, // Note, this map module is using the `deltas` mode for the store.
|
||||
) -> Result<BlockChanges, anyhow::Error> {
|
||||
// We merge contract changes by transaction (identified by transaction index) making it easy to
|
||||
// sort them at the very end.
|
||||
let mut transaction_changes: HashMap<_, TransactionChangesBuilder> = HashMap::new();
|
||||
|
||||
// `ProtocolComponents` are gathered from `map_pools_created` which just need a bit of work to
|
||||
// convert into `TransactionChanges`
|
||||
grouped_components
|
||||
.tx_components
|
||||
.iter()
|
||||
.for_each(|tx_component| {
|
||||
// initialise builder if not yet present for this tx
|
||||
let tx = tx_component.tx.as_ref().unwrap();
|
||||
let builder = transaction_changes
|
||||
.entry(tx.index)
|
||||
.or_insert_with(|| TransactionChangesBuilder::new(tx));
|
||||
|
||||
// iterate over individual components created within this tx
|
||||
tx_component
|
||||
.components
|
||||
.iter()
|
||||
.for_each(|component| {
|
||||
builder.add_protocol_component(component);
|
||||
});
|
||||
});
|
||||
|
||||
// Balance changes are gathered by the `StoreDelta` based on `PoolBalanceChanged` creating
|
||||
// `BlockBalanceDeltas`. We essentially just process the changes that occurred to the `store`
|
||||
// this block. Then, these balance changes are merged onto the existing map of tx contract
|
||||
// changes, inserting a new one if it doesn't exist.
|
||||
aggregate_balances_changes(balance_store, deltas)
|
||||
.into_iter()
|
||||
.for_each(|(_, (tx, balances))| {
|
||||
let builder = transaction_changes
|
||||
.entry(tx.index)
|
||||
.or_insert_with(|| TransactionChangesBuilder::new(&tx));
|
||||
balances.values().for_each(|bc| {
|
||||
builder.add_balance_change(bc);
|
||||
});
|
||||
});
|
||||
|
||||
// Extract and insert any storage changes that happened for any of the components.
|
||||
extract_contract_changes_builder(
|
||||
&block,
|
||||
|addr| {
|
||||
components_store
|
||||
.get_last(format!("pool:0x{0}", hex::encode(addr)))
|
||||
.is_some()
|
||||
},
|
||||
&mut transaction_changes,
|
||||
);
|
||||
|
||||
// Process all `transaction_changes` for final output in the `BlockChanges`,
|
||||
// sorted by transaction index (the key).
|
||||
|
||||
let block_changes = BlockChanges {
|
||||
block: Some((&block).into()),
|
||||
changes: transaction_changes
|
||||
.drain()
|
||||
.sorted_unstable_by_key(|(index, _)| *index)
|
||||
.filter_map(|(_, builder)| builder.build())
|
||||
.collect::<Vec<_>>(),
|
||||
};
|
||||
|
||||
for change in &block_changes.changes {
|
||||
substreams::log::info!("🚨 Balance changes {:?}", change.balance_changes);
|
||||
substreams::log::info!("🚨 Component changes {:?}", change.component_changes);
|
||||
}
|
||||
Ok(block_changes)
|
||||
}
|
||||
|
||||
fn is_deployment_tx(tx: ð::v2::TransactionTrace, vault_address: &[u8]) -> bool {
|
||||
match vault_address {
|
||||
hex!("95aB45875cFFdba1E5f451B950bC2E42c0053f39") => {
|
||||
// Arbitrum
|
||||
tx.hash == hex!("ad86e67a2d511576f802dca2f65b6dfbec1d050c63f55878f80272a5fcafcadf")
|
||||
}
|
||||
hex!("3Cd55356433C89E50DC51aB07EE0fa0A95623D53") => {
|
||||
// BSC
|
||||
tx.hash == hex!("c043ba8c30eeed718514b7d1d1d4654521eca2f7aa5e5a7ae1e2c212ca869997")
|
||||
}
|
||||
hex!("ac3E018457B222d93114458476f3E3416Abbe38F") => {
|
||||
// Ethereum
|
||||
tx.hash == hex!("d78dbe6cba652eb844de5aa473636c202fb6366c1bfc5ff8d5a26c1a24b37b07")
|
||||
}
|
||||
hex!("b90CCD563918fF900928dc529aA01046795ccb4A") => {
|
||||
// Fantom
|
||||
tx.hash == hex!("749c9ffb6022d5e6a8f3470499bfc2e9cf3bf122f75e2a5925930407d2a9e02c")
|
||||
}
|
||||
hex!("ecf91116348aF1cfFe335e9807f0051332BE128D") => {
|
||||
// Moonbeam
|
||||
tx.hash == hex!("3545822fb0695bec2d3e9860b22073cc79845a0bb3cfccf401241dc7fe0eb86b")
|
||||
}
|
||||
hex!("484c2D6e3cDd945a8B2DF735e079178C1036578c") => {
|
||||
// Optimism
|
||||
tx.hash == hex!("e2e4c7173ae6ac0d78cacb1d48004c2aea7e1ce4ae0110a128d40bdcdc4d51b0")
|
||||
}
|
||||
hex!("6d1FdBB266fCc09A16a22016369210A15bb95761") => {
|
||||
// Polygon
|
||||
tx.hash == hex!("ada03ce824bac4a811d0b1bb60f9f26dbdd921bcd5034b1b4b973026a04ad9ea")
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// ref: https://docs.frax.finance/smart-contracts/frxeth-and-sfrxeth-contract-addresses
|
||||
fn map_vault_to_locked_asset(address_bytes: &[u8]) -> Option<[u8; 20]> {
|
||||
// basedo on ADDRESS_MAP create a match condition to return the locked_asset
|
||||
match address_bytes {
|
||||
hex!("95aB45875cFFdba1E5f451B950bC2E42c0053f39") => {
|
||||
// Arbitrum
|
||||
Some(hex!("178412e79c25968a32e89b11f63B33F733770c2A"))
|
||||
}
|
||||
hex!("3Cd55356433C89E50DC51aB07EE0fa0A95623D53") => {
|
||||
// BSC
|
||||
Some(hex!("64048A7eEcF3a2F1BA9e144aAc3D7dB6e58F555e"))
|
||||
}
|
||||
hex!("ac3E018457B222d93114458476f3E3416Abbe38F") => {
|
||||
// Ethereum
|
||||
Some(hex!("5e8422345238f34275888049021821e8e08caa1f"))
|
||||
}
|
||||
hex!("b90CCD563918fF900928dc529aA01046795ccb4A") => {
|
||||
// Fantom
|
||||
Some(hex!("9E73F99EE061C8807F69f9c6CCc44ea3d8c373ee"))
|
||||
}
|
||||
hex!("ecf91116348aF1cfFe335e9807f0051332BE128D") => {
|
||||
// Moonbeam
|
||||
Some(hex!("82bbd1b6f6De2B7bb63D3e1546e6b1553508BE99"))
|
||||
}
|
||||
hex!("484c2D6e3cDd945a8B2DF735e079178C1036578c") => {
|
||||
// Optimism
|
||||
Some(hex!("6806411765Af15Bddd26f8f544A34cC40cb9838B"))
|
||||
}
|
||||
hex!("6d1FdBB266fCc09A16a22016369210A15bb95761") => {
|
||||
// Polygon
|
||||
Some(hex!("Ee327F889d5947c1dc1934Bb208a1E792F953E96"))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
126
substreams/ethereum-sfraxeth/src/pb/contract.v1.rs
Normal file
126
substreams/ethereum-sfraxeth/src/pb/contract.v1.rs
Normal file
@@ -0,0 +1,126 @@
|
||||
// @generated
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct Events {
|
||||
#[prost(message, repeated, tag="1")]
|
||||
pub sfraxeth_approvals: ::prost::alloc::vec::Vec<SfraxethApproval>,
|
||||
#[prost(message, repeated, tag="2")]
|
||||
pub sfraxeth_deposits: ::prost::alloc::vec::Vec<SfraxethDeposit>,
|
||||
#[prost(message, repeated, tag="3")]
|
||||
pub sfraxeth_new_rewards_cycles: ::prost::alloc::vec::Vec<SfraxethNewRewardsCycle>,
|
||||
#[prost(message, repeated, tag="4")]
|
||||
pub sfraxeth_transfers: ::prost::alloc::vec::Vec<SfraxethTransfer>,
|
||||
#[prost(message, repeated, tag="5")]
|
||||
pub sfraxeth_withdraws: ::prost::alloc::vec::Vec<SfraxethWithdraw>,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SfraxethApproval {
|
||||
#[prost(string, tag="1")]
|
||||
pub evt_tx_hash: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag="2")]
|
||||
pub evt_index: u32,
|
||||
#[prost(message, optional, tag="3")]
|
||||
pub evt_block_time: ::core::option::Option<::prost_types::Timestamp>,
|
||||
#[prost(uint64, tag="4")]
|
||||
pub evt_block_number: u64,
|
||||
#[prost(bytes="vec", tag="5")]
|
||||
pub owner: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="6")]
|
||||
pub spender: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(string, tag="7")]
|
||||
pub amount: ::prost::alloc::string::String,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SfraxethDeposit {
|
||||
#[prost(string, tag="1")]
|
||||
pub evt_tx_hash: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag="2")]
|
||||
pub evt_index: u32,
|
||||
#[prost(message, optional, tag="3")]
|
||||
pub evt_block_time: ::core::option::Option<::prost_types::Timestamp>,
|
||||
#[prost(uint64, tag="4")]
|
||||
pub evt_block_number: u64,
|
||||
#[prost(bytes="vec", tag="5")]
|
||||
pub caller: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="6")]
|
||||
pub owner: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(string, tag="7")]
|
||||
pub assets: ::prost::alloc::string::String,
|
||||
#[prost(string, tag="8")]
|
||||
pub shares: ::prost::alloc::string::String,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SfraxethNewRewardsCycle {
|
||||
#[prost(string, tag="1")]
|
||||
pub evt_tx_hash: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag="2")]
|
||||
pub evt_index: u32,
|
||||
#[prost(message, optional, tag="3")]
|
||||
pub evt_block_time: ::core::option::Option<::prost_types::Timestamp>,
|
||||
#[prost(uint64, tag="4")]
|
||||
pub evt_block_number: u64,
|
||||
#[prost(uint64, tag="5")]
|
||||
pub cycle_end: u64,
|
||||
#[prost(string, tag="6")]
|
||||
pub reward_amount: ::prost::alloc::string::String,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SfraxethTransfer {
|
||||
#[prost(string, tag="1")]
|
||||
pub evt_tx_hash: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag="2")]
|
||||
pub evt_index: u32,
|
||||
#[prost(message, optional, tag="3")]
|
||||
pub evt_block_time: ::core::option::Option<::prost_types::Timestamp>,
|
||||
#[prost(uint64, tag="4")]
|
||||
pub evt_block_number: u64,
|
||||
#[prost(bytes="vec", tag="5")]
|
||||
pub from: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="6")]
|
||||
pub to: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(string, tag="7")]
|
||||
pub amount: ::prost::alloc::string::String,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct SfraxethWithdraw {
|
||||
#[prost(string, tag="1")]
|
||||
pub evt_tx_hash: ::prost::alloc::string::String,
|
||||
#[prost(uint32, tag="2")]
|
||||
pub evt_index: u32,
|
||||
#[prost(message, optional, tag="3")]
|
||||
pub evt_block_time: ::core::option::Option<::prost_types::Timestamp>,
|
||||
#[prost(uint64, tag="4")]
|
||||
pub evt_block_number: u64,
|
||||
#[prost(bytes="vec", tag="5")]
|
||||
pub caller: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="6")]
|
||||
pub receiver: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="7")]
|
||||
pub owner: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(string, tag="8")]
|
||||
pub assets: ::prost::alloc::string::String,
|
||||
#[prost(string, tag="9")]
|
||||
pub shares: ::prost::alloc::string::String,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct RewardCycle {
|
||||
#[prost(uint64, tag="1")]
|
||||
pub ord: u64,
|
||||
#[prost(bytes="vec", tag="2")]
|
||||
pub next_reward_amount: ::prost::alloc::vec::Vec<u8>,
|
||||
#[prost(bytes="vec", tag="3")]
|
||||
pub vault_address: ::prost::alloc::vec::Vec<u8>,
|
||||
}
|
||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct BlockRewardCycles {
|
||||
#[prost(message, repeated, tag="1")]
|
||||
pub reward_cycles: ::prost::alloc::vec::Vec<RewardCycle>,
|
||||
}
|
||||
// @@protoc_insertion_point(module)
|
||||
8
substreams/ethereum-sfraxeth/src/pb/mod.rs
Normal file
8
substreams/ethereum-sfraxeth/src/pb/mod.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
// @generated
|
||||
pub mod contract {
|
||||
// @@protoc_insertion_point(attribute:contract.v1)
|
||||
pub mod v1 {
|
||||
include!("contract.v1.rs");
|
||||
// @@protoc_insertion_point(contract.v1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user