1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#pragma once
8

9
#include "Data.h"
10

11
#include <string>
12

13
namespace TW::Ethereum::ABI {
14

15
/// Abstract base class for parameters.
16 1
class ParamBase
17
{
18
public:
19 1
    virtual ~ParamBase() = default;
20
    virtual std::string getType() const = 0;
21
    virtual size_t getSize() const = 0;
22
    virtual bool isDynamic() const = 0;
23
    virtual void encode(Data& data) const = 0;
24
    virtual bool decode(const Data& encoded, size_t& offset_inout) = 0;
25
};
26

27
/// Collection parameters base class
28 1
class ParamCollection: public ParamBase
29
{
30
public:
31
    virtual size_t getCount() const = 0;
32
};
33

34
} // namespace TW::Ethereum::ABI

Read our documentation on viewing source code .

Loading