forked from ethereum/ERCs
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ERC-5564: Move to last call #4
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9d60e19
Move to last call
garyghayrat ec6253c
Add contracts to asset folder and update `Deployment Method` and `Ref…
garyghayrat 241d443
Update last call deadline
garyghayrat be6d017
Clarify specification
garyghayrat 870f8ca
Add singleton contract address
garyghayrat 8e78e09
Remove schemeId mapping file
garyghayrat a3bcb1d
Remove reference to removed schemeId file
garyghayrat 88abed7
Update erc-5564.md
SamWilsn 65f2d1e
Update erc-5564.md
SamWilsn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity 0.8.23; | ||
|
||
/// @notice `ERC5564Announcer` contract to emit an `Announcement` event to broadcast information | ||
/// about a transaction involving a stealth address. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) to learn more. | ||
contract ERC5564Announcer { | ||
/// @notice Emitted when something is sent to a stealth address. | ||
/// @param schemeId Identifier corresponding to the applied stealth address scheme, e.g. 1 for | ||
/// secp256k1, as specified in ERC-5564. | ||
/// @param stealthAddress The computed stealth address for the recipient. | ||
/// @param caller The caller of the `announce` function that emitted this event. | ||
/// @param ephemeralPubKey Ephemeral public key used by the sender to derive the `stealthAddress`. | ||
/// @param metadata Arbitrary data to emit with the event. The first byte MUST be the view tag. | ||
/// @dev The remaining metadata can be used by the senders however they like. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) for recommendations on how to structure | ||
/// this metadata. | ||
event Announcement( | ||
uint256 indexed schemeId, | ||
address indexed stealthAddress, | ||
address indexed caller, | ||
bytes ephemeralPubKey, | ||
bytes metadata | ||
); | ||
|
||
/// @notice Called by integrators to emit an `Announcement` event. | ||
/// @param schemeId Identifier corresponding to the applied stealth address scheme, e.g. 1 for | ||
/// secp256k1, as specified in ERC-5564. | ||
/// @param stealthAddress The computed stealth address for the recipient. | ||
/// @param ephemeralPubKey Ephemeral public key used by the sender. | ||
/// @param metadata Arbitrary data to emit with the event. The first byte MUST be the view tag. | ||
/// @dev The remaining metadata can be used by the senders however they like. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) for recommendations on how to structure | ||
/// this metadata. | ||
function announce( | ||
uint256 schemeId, | ||
address stealthAddress, | ||
bytes memory ephemeralPubKey, | ||
bytes memory metadata | ||
) external { | ||
emit Announcement(schemeId, stealthAddress, msg.sender, ephemeralPubKey, metadata); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
assets/erc-5564/contracts/interfaces/IERC5564Announcer.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity 0.8.23; | ||
|
||
/// @notice Interface for calling the `ERC5564Announcer` contract, which emits an `Announcement` | ||
/// event to broadcast information about a transaction involving a stealth address. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) to learn more. | ||
interface IERC5564Announcer { | ||
/// @notice Emitted when something is sent to a stealth address. | ||
/// @param schemeId Identifier corresponding to the applied stealth address scheme, e.g. 1 for | ||
/// secp256k1, as specified in ERC-5564. | ||
/// @param stealthAddress The computed stealth address for the recipient. | ||
/// @param caller The caller of the `announce` function that emitted this event. | ||
/// @param ephemeralPubKey Ephemeral public key used by the sender to derive the `stealthAddress`. | ||
/// @param metadata Arbitrary data to emit with the event. The first byte MUST be the view tag. | ||
/// @dev The remaining metadata can be used by the senders however they like. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) for recommendations on how to structure | ||
/// this metadata. | ||
event Announcement( | ||
uint256 indexed schemeId, | ||
address indexed stealthAddress, | ||
address indexed caller, | ||
bytes ephemeralPubKey, | ||
bytes metadata | ||
); | ||
|
||
/// @notice Called by integrators to emit an `Announcement` event. | ||
/// @param schemeId Identifier corresponding to the applied stealth address scheme, e.g. 1 for | ||
/// secp256k1, as specified in ERC-5564. | ||
/// @param stealthAddress The computed stealth address for the recipient. | ||
/// @param ephemeralPubKey Ephemeral public key used by the sender. | ||
/// @param metadata Arbitrary data to emit with the event. The first byte MUST be the view tag. | ||
/// @dev The remaining metadata can be used by the senders however they like. See | ||
/// [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564) for recommendations on how to structure | ||
/// this metadata. | ||
function announce( | ||
uint256 schemeId, | ||
address stealthAddress, | ||
bytes memory ephemeralPubKey, | ||
bytes memory metadata | ||
) external; | ||
} |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good