Skip to content

Commit

Permalink
Update HIP-904 status and HSCS details (#1080)
Browse files Browse the repository at this point in the history
Signed-off-by: Stanimir Stoyanov <[email protected]>
  • Loading branch information
stoyanov-st authored Nov 20, 2024
1 parent d1cea82 commit 2eacaf5
Showing 1 changed file with 47 additions and 15 deletions.
62 changes: 47 additions & 15 deletions HIP/hip-904.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ requested-by: DEXs, Wallets, External Web3 Users. Notably Reality+, Liithos, Dro
type: Standards Track
category: Core
needs-council-approval: Yes
status: Accepted
status: Final
release: v0.56.0
last-call-date-time: 2024-04-08T07:00:00Z
created: 2024-02-25
discussions-to: https://github.com/hashgraph/hedera-improvement-proposal/discussions/905
updated: 2024-08-19
updated: 2024-11-15
replaces: 655, 777
---

Expand Down Expand Up @@ -1170,21 +1171,52 @@ HTS system contracts will need to support the new airdrop related transactions t
is exposed via smart contract functions. Additionally, redirect functions will be provided to ensure
optimal UX in which EOAs can initiate transactions through a DApp that affect their account.

| selector | function | IHRC |
|----------|----------------------------------------------------------------------------------------------|------|
| 0x… | <htsSystemContractAddress>.airdropTokens(TokenTransferList[] memory tokenTransfers) | |
| 0x… | <htsTokenAddress>.cancelAirdropFT(address receiverAddress) | Y |
| 0x… | <htsTokenAddress>.cancelAirdropNFT(address receiverAddress, int64 serialNumber) | Y |
| 0x… | <htsSystemContractAddress>.cancelAirdrops(PendingAirdropId[] memory pendingAirdrops) | |
| 0x… | <htsTokenAddress>.claimAirdropFT(address senderAddress) | Y |
| 0x… | <htsTokenAddress>.claimAirdropNFT(address senderAddress, int64 serialNumber) | Y |
| 0x… | <htsSystemContractAddress>.claimAirdrops(PendingAirdropId[] memory pendingAirdrops) | |
| 0x… | <htsTokenAddress>.rejectTokenFT() | Y |
| 0x… | <htsTokenAddress>.rejectTokensNFT(int64[] serialNumber) | Y |
| 0x… | <htsSystemContractAddress>.rejectTokens(address[] memory ftAddresses, NftId[] memory nftIds) | |
| 0x… | <hasSystemContractAddress>.setAutomaticAssociations(boolean enableAutoAssociations) | Y |
New system contract functions to be included to the `IHederaTokenService` interface.

| Function Selector Hash | Function Signature | HAPI Transaction | Response | |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|------------------|----------------|---------------------------------|
| `0x2f348119` | `function airdropTokens(TokenTransferList[] memory tokenTransfers) external returns (int64 responseCode)` | TokenAirdrop | `ResponseCode` | The response code from the call |
| `0x012ebcaf` | `function cancelAirdrops(PendingAirdrop[] memory pendingAirdrops) external returns (int64 responseCode)` | TokenCancel | `ResponseCode` | The response code from the call |
| `0x05961641` | `function claimAirdrops(PendingAirdrop[] memory pendingAirdrops) external returns (int64 responseCode)` | TokenClaim | `ResponseCode` | The response code from the call |
| `0xebd595e0` | `function rejectTokens(address rejectingAaddress, address[] memory ftAddresses, NftID[] memory nftIDs) external returns (int64 responseCode)` | TokenReject | `ResponseCode` | The response code from the call |

New system contract functions to be included for a new `IHRC904` interface.
> ⚠️ Note that Proxy Contract logic is used here, so the contract address should be the Hedera Entity on note, such as the HTS token address is used for HTS functions and the Account EVM address for HAS (Hedera Account Service) functions.
| Function Selector Hash | Function Signature | HAPI Transaction | Responsible service | Response | |
|------------------------|-----------------------------------------------------------------------------------------------------------------|------------------|---------------------|----------------|---------------------------------|
| `0xcef5b705` | `function cancelAirdropFT(address receiverAddress) external returns (int64 responseCode)` | TokenCancel | HTS | `ResponseCode` | The response code from the call |
| `0xad4917cf` | `function cancelAirdropNFT(address receiverAddress, int64 serialNumber) external returns (int64 responseCode)` | TokenCancel | HTS | `ResponseCode` | The response code from the call |
| `0xa83bc5b2` | `function claimAirdropFT(address senderAddress) external returns (int64 responseCode)` | TokenClaim | HTS | `ResponseCode` | The response code from the call |
| `0x63ada5d7` | `function claimAirdropNFT(address senderAddress, int64 serialNumber) external returns (int64 responseCode)` | TokenClaim | HTS | `ResponseCode` | The response code from the call |
| `0x76c6b391` | `function rejectTokenFT() external returns (int64 responseCode)` | TokenReject | HTS | `ResponseCode` | The response code from the call |
| `0xa869c78a` | `function rejectTokenNFTs(int64[] memory serialNumbers) external returns (int64 responseCode)` | TokenReject | HTS | `ResponseCode` | The response code from the call |
| `0xf5677e99` | `function setUnlimitedAutomaticAssociations(bool enableAutoAssociations) external returns (int64 responseCode)` | CryptoUpdate | HAS | `ResponseCode` | The response code from the call |

To increase API reuse and for consistency the input objects will closely match the HAPI protobuf objects.
We will introduce the following new structures to support the new functionality:

`PendingAirdrop` - A struct that represents a pending airdrop request.

```solidity
struct PendingAirdrop {
address sender;
address receiver;
address token;
//The NFT serial number field is populated only for the NFT type
int64 serial;
}
```

`NftID` - A struct that represents the Nft serial to be rejected.

```solidity
struct NftID {
address nft;
int64 serial;
}
```

### SDK

Expand Down

0 comments on commit 2eacaf5

Please sign in to comment.