主页EIPs
EIPsERC-7580
ERC-7580

Advertisement Tracking Interface

Interfaces for advertisement clients tracking user actions and checking proportional rewards.
DraftStandards Track: ERC
创建时间: 2023-12-13
wart (@wartstone)
社区讨论原文链接编辑
1 分钟了解
欢迎补充好内容
去提交
相关视频
欢迎补充好内容
去提交
正文

Abstract

This ERC proposes a standard interface for advertisement clients to track user actions in contracts and check corresponding rewards from advertisement protocols. Contracts implementing the interface use events to define a region of interest within a transaction. A Dapp could implement this interface to join an advertisement protocol, which enable projects to fund users for specific actions in a contract. While users could benefit from project funds, dapps would also get proportional rewards once they joined the protocol.

Motivation

Dapps would propsper due to mass adoption and there emerges surging demands for advertisement on chain. Compared with advertisements in web2, web3 has tremendous advantages on delivery and many other fields. We do need a set of standard tracking interfaces to facilitate advertisement related developments, which could create new economic cycles on chain, further boost dapp prosperity and ultimately benefit on chain users.

Tracking interface standard should be designed with essential & universal support for tracking user actions, and minimum restriction, which could leave most innovative space for airdrop (or advertisement) protocol. The general routine would work like this:

  1. projects get a seed id (hash) from promotion side
  2. before the target promotion action starts, project contracts called the interface onTrackStart(id, contract_address, function_hash)
  3. after the target promotion action ends, project contracts called the inferface onTrackEnd(id, contract_address, function_hash)
  4. promotion contract collect the project action info and distribute the rewards back to projects

For example, we have two entities holding their respective contracts: contract A and contract B. Contract A targets on users who did specific key moves(eg. commit specific functions) in contract B and would give bonus/airdrop to these users. Sure B would also get incentives in the meanwhile. To connect all these dots, B needs to identity these users, verify they're coming for the A's bonus. Hence, we need a track mechanism to facilitate such business.

Specification

The keywords “MUST,” “MUST NOT,” “REQUIRED,” “SHALL,” “SHALL NOT,” “SHOULD,” “SHOULD NOT,” “RECOMMENDED,” “MAY,” and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.

Interfaces

This protocol standardizes how to keep track of inter-dapp operations, which initially offers 2 main methods onTrackStart and onTrackEnd.

// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.10; interface IERCXXX { // Events /// @dev Emits when track starts. /// @param track_id track id /// @param contract_address the address of tracking contract /// @param function_hash the hash of tracking function with params event onTrackStartRecorded(uint256 track_id, address contract_address, bytes32 function_hash); /// @dev Emits when track starts. /// @param track_id track id /// @param contract_address the address of tracking contract /// @param function_hash the hash of tracking function with params event onTrackEndRecorded(uint256 track_id, address contract_address, bytes32 function_hash); // Functions /// @dev Track a specified contract function start move. /// @param track_id track id /// @param contract_address the address of tracking contract /// @param function_hash the hash of tracking function with params function onTrackStart(uint256 track_id, address contract_address, bytes32 function_hash) external; /// @dev Track a specified contract function end move. /// @param track_id track id /// @param contract_address the address of tracking contract /// @param function_hash the hash of tracking function with params function onTrackEnd(uint256 track_id, address contract_address, bytes32 function_hash); }

Rationale

The core mechanism for this proposal is to provide a shared tracking interface for inter-dapp operations, to improve the efficiency and fulfill the required tracking business. We provide two interface functions onTrackStart and onTrackEnd to fill the basic required info and connect the necessary dots. Sure there're more demands for more functions and it would be updated later.

Backwards Compatibility

No backward compatibility issues are introduced by this standard.

Security Considerations

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
支持以太坊贡献者,推动生态建设
资源
GitHub
支持社区