使用Tenderly为区块链交易设置警报通知

去中心化金融社区Pubblicato 2022-03-31Pubblicato ultima volta 2022-03-31

Introduzione

Tenderly有内置的定制警报,即使是新手用户也可以在多个链上事件创建警报。

“Tenderly有内置的定制警报,即使是新手用户也可以在多个链上事件创建警报。”

现在让我们先来看看除了以太坊主网之外,我们还可以使用哪些网络:

Tenderly支持的网络

登录项目后,我们将探索位于Tenderly仪表板侧边栏的“监控->警报”服务:

登录后左侧边栏

有一个免费使用的警告,当我们打开警报页面时将显示:

我们将收到一批在15分钟内发生的警报。升级到TenderlyPro/Dev以接收实时警报。

对于测试来说,这不是一个问题,所以我们可以继续使用免费版本。为了更可靠地使用警报,我们必须升级我们的帐户。

让我们从检查创建新警报时可以完成的事情开始。

创建警报

警报类型是我们为触发通知的链事件设置的条件:

所有的警报类型

“警报目标”指的是为上述事件和条件进行监控的合约:

所有警报目标

警报目的地是当上述合约满足警报条件时将收到通知的地点:

所有警报的目的地

在创建一个新的警报之前,我们必须首先:

决定我们希望被通知哪个合约的哪些事件。

在“Contracts”选项卡中添加我们想要监控的合约,这样我们就可以在步骤2中将它作为目标。

连接将接收消息的目的地(在本指南中我们将使用电报),因此我们将能够在步骤3中向它发送通知。

将Telegram添加为目的地

在警报标签中,点击顶部菜单中的“目的地”,点击“Telegram”:

添加电报为目的地

标记它,并按照说明,让机器人发送消息给我们:

按照指示,让机器人向我们发送消息

要完成上述过程,复制指令第三步中的“魔法字”。将它粘贴到与Tenderly的电报机器人聊天中,点击@TenderlyRobot即可打开聊天。

机器人现在可以在此聊天中发送消息的确认消息!

监控YearnVault存款/取款

让我们从监控Fantom网络上的SPELLyVault上的一些事件开始。我们需要知道SPELLyVault合约地址,我们可以通过进入YearnVaults界面,点击SPELLvault找到它。

Fantom上的YearnVaults

单击它后,我们将看到包含所有金库详细信息的页面,单击“区块浏览器”按钮,就会进入金库的合约:

SPELLyVault详细信息

这将打开FTMScan(Etherscan的Fantom分叉)上的SPELLyVault合约:

在FTMScan上的SPELLyVault合约

我按顺序突出显示了用例的重要信息:

首先是合约地址

然后是“代币名称”(当打开许多合约选项卡时会有所帮助)

最后是合约执行的方法(函数)的历史

对于我们的示例,我们将在有人将代币存入Vault时添加通知。为此,需要复制合约页面URL:

https://ftmscan.com/address/0xD3c19eB022CAC706c898D60d756bf1535d605e1d

然后进入Tenderly的合约标签,点击将该合约导入到他们的仪表盘中,这将使我们能够为其创建警报:

在Tenderly中导入合约

粘贴该地址,选择“VyperContract”(名称如下所示,YearnVaults使用Vyper编程语言)。当它出现时,点击“导入”:

在Tenderly中导入合约

导入合约后,我们就可以为它创建警报了!

在Tenderly中导入合约

让我们创建一个警报:

创建新警报

我们希望每次有人存入SPELLyVault时都会收到通知。为此,我们将检查yVault合约中存在的“存款”方法。“方法”是一个类似于“函数调用”的名称,所以这是我们将在本例中使用的警报类型。

选择警报类型

目标是一个地址:

选择警报目标

我们可以选择之前添加的合约,然后选择其中存在的任何函数。许多函数可能有类似的名称,以“_”开头的函数通常是私有的内部函数,不是我们要寻找的函数。

在本例中,我们有_deposit(私有:供内部使用)和deposit(公共:供外部用户使用)。我们将选择一个公共的:

选择警报目标

最后,选择之前设置的电报目的地并保存警报:

选择警报目的地

警报已被创建,每当有人将SPELL存入该yVault时,我都会收到一条消息!

警报成功创建!

以下是我在设置这个示例并触发它后所得到的通知示例,我在交易确认后立即收到通知!

FantomyVault的新SPELL存款通知已发送至我的电报!

总结

这个Yearn示例展示了一种监控合约函数调用的简单方法。如果探索警报系统的所有选项,我们会发现可以更容易地调整到许多不同的用法,例如:

NFT的开发者可以监控他们的合约何时调用了一个新代币的铸造,并在Discord上自动宣布它。

监控Tokenomics流程的人可以使用通知来关注钱包余额和合约行为,看看开发者是否在做预期要做的事情。

我们可以看到任何一种链上活动,并得到它的通知。

Source:https://medium.com/iearn/setup-notifications-for-blockchain-transactions-with-tenderly-407a3df6e1ba

Letture associate

Why P2P and Exchangers Are Becoming Obsolete, and What Will Replace Them

Titled "Why P2P and Exchanges Are Becoming Obsolete, and What Will Replace Them," this article discusses the evolution of stablecoins, particularly USDT, from a trading tool to a global payment method. However, converting crypto back to fiat for daily expenses remains a challenge. The process of using P2P platforms or crypto exchanges has become increasingly risky and complex due to stricter banking anti-fraud measures, new legislation in Russia, and rampant fraud schemes like "triangles," where sellers can inadvertently receive stolen funds. The article highlights that while P2P was convenient, banks now scrutinize frequent peer-to-peer transfers, often freezing accounts. Exchanges also pose risks like unfavorable rates and unclear compliance. The market is therefore shifting towards integrated services that eliminate the manual conversion step. It cites OneSix as an example—a crypto wallet accessible via Telegram and web that embeds currency conversion directly into payment and withdrawal scenarios. Users can pay bills or send money as if using a bank app, with the crypto-to-fiat exchange happening seamlessly in the background. It also offers invoicing for freelancers and conducts AML checks, returning suspicious transactions instantly instead of freezing them. In conclusion, as crypto integrates into everyday finance, the demand for manual, risky exchange methods is declining. The future lies in unified platforms that combine storage, compliance, conversion, and payments into a single, secure user experience.

cryptonews.ru53 min fa

Why P2P and Exchangers Are Becoming Obsolete, and What Will Replace Them

cryptonews.ru53 min fa

The CEO of MARA Holdings Compares AI Operations to Bitcoin Mining! Which is More Profitable?

Fred Thiel, CEO of MARA Holdings (a major Bitcoin mining company), states that the rapid growth of the artificial intelligence (AI) sector is transforming mining companies' business models. He claims that powering data centers for AI is significantly more profitable than Bitcoin mining. In a recent interview, Thiel explained why many mining firms are diversifying into AI infrastructure. According to Thiel, the energy demands of data centers are surging, especially due to the spread of generative AI applications. This creates new revenue opportunities for Bitcoin mining companies with robust power infrastructure. MARA Holdings is among those monitoring this shift and aims to develop its energy and infrastructure services for AI data centers. Thiel emphasized that this move toward AI does not mean the end of Bitcoin mining. He stated that Bitcoin mining remains a sustainable business model, especially for miners in regions with low electricity costs, and it is still a crucial field for utilizing excess or idle power capacity. In recent years, many Bitcoin mining companies have begun using their energy-intensive infrastructure not just for block production but also for high-performance computing (HPC) and AI applications. This strategy aims to diversify revenue sources and increase resilience against cryptocurrency market volatility. Analysts note that the growing energy demand in the AI sector presents significant transformation opportunities for mining companies. The need for high-power, uninterrupted electricity supply, particularly for large data centers, gives Bitcoin miners with existing energy infrastructure expertise a considerable advantage.

cryptonews.ru1 h fa

The CEO of MARA Holdings Compares AI Operations to Bitcoin Mining! Which is More Profitable?

cryptonews.ru1 h fa

Trading

Spot
活动图片