Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
address.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <cstdint>
5#include <vector>
6
7
8#ifdef interface
9 #undef interface
10#endif
11#include <evmc/evmc.hpp>
12#ifndef interface
13 #define interface __STRUCT__
14#endif
15
16namespace dcn::chain
17{
18 using Address = evmc::address;
19
20 std::optional<chain::Address> readAddressWord(const std::uint8_t* data, std::size_t data_size, std::size_t offset = 0);
21 std::optional<chain::Address> readAddressWord(const std::vector<std::uint8_t> & data, std::size_t offset = 0);
22
23 chain::Address topicWordToAddress(const evmc::bytes32 & topic_word);
24
25 // Get Ethereum address from public key (last 20 bytes of Keccak256(pubkey))
26 chain::Address ethAddressFromPublicKey(const std::uint8_t* pubkey, std::size_t len);
27}
Definition address.hpp:17
chain::Address topicWordToAddress(const evmc::bytes32 &topic_word)
Definition address.cpp:25
std::optional< chain::Address > readAddressWord(const std::uint8_t *data, std::size_t data_size, std::size_t offset=0)
Definition address.cpp:8
chain::Address ethAddressFromPublicKey(const std::uint8_t *pubkey, std::size_t len)
Definition address.cpp:32
evmc::address Address
Definition address.hpp:18