hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
313 stars 136 forks source link

Create Hedera Account Service contract #4620

Closed lukelee-sl closed 3 months ago

lukelee-sl commented 1 year ago

Problem

Epic: #4619

Currently the Hedera Account Service is not defined in Solidity making it unaccessible.

Solution

Create an interface (IHederaAddressService) and contract (HederaAddressService) files for the Hedera Account Service contract in the smart contracts repo as specified in the following table.

hash signature return description
e9482d42 getVirtualAddresses(address) address[] returns an array of virtual addresses for a given Hedera Account ID
a4e310ba getHederaAddress(address) (responseCode, address) returns the top level Hedera Account ID if applicable
d501235a isVirtualAddress(address) bool true if valid virtual address, false if long-zero or non existing account
b2526367 isAuthorized(address, messageHash, signatureBlob) bool true if account is authorized to carry out transaction execution on account. Accepts protobuf key signature blobs. May be used for ECDSA, ED25519 and complex key flows
d501235a isAuthorizedRaw(address, messageHash, signatureBlob) bool true if account is authorized to carry out transaction execution on account. Accepts single key raw signature blobs (ECDSA and ED25519). This provides similar logic to ECRECOVER.

Alternatives

No response

david-bakin-sl commented 3 months ago

Already done.