Utilities to build transaction data to call swapExactETHForTokens on Uniswap V2 Rotuer 02 contract.
More...
|
std::size_t | buildData (const char *amountOutMin, const char *targetTokenAddress, const char *receiverAddress, char *output) |
| Builds swapExactETHForTokens input data. More...
|
|
|
constexpr char const * | DataBoilerplate { "7ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000" } |
| Boilerplate transaction data. More...
|
|
constexpr std::size_t | DataLength { std::char_traits<char>::length(DataBoilerplate) } |
| Boilerplate transaction data length. More...
|
|
Utilities to build transaction data to call swapExactETHForTokens on Uniswap V2 Rotuer 02 contract.
- See also
- https://uniswap.org/docs/v2/smart-contracts/router02/#swapexactethfortokens
◆ buildData()
std::size_t TransactionDataBuilder::buildData |
( |
const char * |
amountOutMin, |
|
|
const char * |
targetTokenAddress, |
|
|
const char * |
receiverAddress, |
|
|
char * |
output |
|
) |
| |
|
inline |
Builds swapExactETHForTokens input data.
- Parameters
-
amountOutMin | minimum amount of output tokens |
targetTokenAddress | address of output token (path[1]) |
receiverAddress | (to) |
output | |
- Returns
- output length
◆ DataBoilerplate
constexpr char const* TransactionDataBuilder::DataBoilerplate { "7ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000" } |
|
inlineconstexpr |
Boilerplate transaction data.
Boilerplate transaction data. Includes WETH token address as path[0] and maximum possible deadline. It is missing amountOutMin, path[1] and to values.
◆ DataLength
constexpr std::size_t TransactionDataBuilder::DataLength { std::char_traits<char>::length(DataBoilerplate) } |
|
inlineconstexpr |