Uniswap Sniper Bot  1.0
Functions | Variables
TransactionDataBuilder Namespace Reference

Utilities to build transaction data to call swapExactETHForTokens on Uniswap V2 Rotuer 02 contract. More...

Functions

std::size_t buildData (const char *amountOutMin, const char *targetTokenAddress, const char *receiverAddress, char *output)
 Builds swapExactETHForTokens input data. More...
 

Variables

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...
 

Detailed Description

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

Function Documentation

◆ buildData()

std::size_t TransactionDataBuilder::buildData ( const char *  amountOutMin,
const char *  targetTokenAddress,
const char *  receiverAddress,
char *  output 
)
inline

Builds swapExactETHForTokens input data.

Parameters
amountOutMinminimum amount of output tokens
targetTokenAddressaddress of output token (path[1])
receiverAddress(to)
output
Returns
output length

Variable Documentation

◆ 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

Boilerplate transaction data length.

See also
DataBoilerplate