7 #include <validation.h> 12 #include <validation.h> 19 static const CAmount SINGLE_STEP = 0.00000001*COIN;
46 ui->
labelPayTo->setToolTip(tr(
"The address that will receive the tokens."));
47 ui->
labelAmount->setToolTip(tr(
"The amount in Token to send."));
109 bool dataValid =
true;
132 uint64_t blockGasLimit = 0;
133 uint64_t minGasPrice = 0;
134 uint64_t nGasPrice = 0;
137 ui->
labelGasLimit->setToolTip(tr(
"Gas limit: Default = %1, Max = %2.").arg(DEFAULT_GAS_LIMIT_OP_SEND).arg(blockGasLimit));
138 ui->
labelGasPrice->setToolTip(tr(
"Gas price: FABCOIN price per gas unit. Default = %1, Min = %2.").arg(QString::fromStdString(
FormatMoney(DEFAULT_GAS_PRICE))).arg(QString::fromStdString(
FormatMoney(minGasPrice))));
182 QString questionString = tr(
"Are you sure you want to send? <br /><br />");
183 questionString.append(tr(
"<b>%1 %2 </b> to ")
185 questionString.append(tr(
"<br />%3 <br />")
186 .arg(QString::fromStdString(toAddress)));
189 confirmationDialog.
exec();
190 QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();
191 if(retval == QMessageBox::Yes)
210 QString message = tr(
"To send %1 you need FABCOIN on address <br /> %2.")
213 QMessageBox::warning(
this, tr(
"Send token"), message);
228 int256_t totalSupply(balance);
232 for(
int i = 0; i < decimalDiff; i++)
236 for(
int i = decimalDiff; i < 0; i++)
241 if(value > totalSupply)
void setDecimalUnits(int value)
void setTotalSupply(const int256_t &value)
#define SetObjectStyleSheet(object, name)
std::string strReceiverAddress
QSpinBox * lineEditGasLimit
TokenAmountField * lineEditAmount
SendTokenPage(QWidget *parent=0)
struct evm_uint256be balance(struct evm_env *env, struct evm_uint160be address)
SelectedToken * m_selectedToken
UnlockContext requestUnlock()
void setValue(const int256_t &value)
base58-encoded Fabcoin addresses.
void setSingleStep(const CAmount &step)
Set single step in satoshis.
void on_numBlocksChanged()
void on_clearButton_clicked()
void clear()
Make field empty and ready for new input.
void setTokenData(std::string address, std::string sender, std::string symbol, int8_t decimals, std::string balance)
void setClientModel(ClientModel *clientModel)
void on_updateConfirmButton()
void setupUi(QWidget *SendTokenPage)
bool validate()
Perform input validation, mark field as invalid if entered value is not valid.
std::string strContractAddress
int64_t CAmount
Amount in lius (Can be negative)
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string.
QLineEdit * lineEditDescription
uint256 uint256S(const char *str)
QPushButton * confirmButton
void setAddress(const std::string &address)
void setValid(bool valid)
Mark current value as invalid in UI.
QLabel * labelDescription
std::string ToString() const
void setGasLimit(const std::string &gaslimit)
void setGasPrice(const std::string &gasPrice)
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
FabcoinAmountField * lineEditGasPrice
Model for Fabcoin network client.
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
Address toAddress(Public const &_public)
Convert a public key to address.
bool transfer(const std::string &_to, const std::string &_value, bool sendTo=false)
static QString formatToken(int decimal_units, const int256_t &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format token as string.
QValidatedLineEdit * lineEditPayTo
bool isUnspentAddress(const std::string &address) const
uint256 u256Touint(const dev::u256 &in)
void setValue(const CAmount &value)
QPushButton * clearButton
ClientModel * m_clientModel
Interface to Fabcoin wallet from Qt view code.
void setCheckValidator(const QValidator *v)
std::string strSenderAddress
struct evm_uint160be address(struct evm_env *env)
void setModel(WalletModel *_model)
void setMinimum(const CAmount &min)
void setSender(const std::string &sender)
Fabcoin address widget validator, checks for a valid fabcoin address.
bool addTokenTxEntry(const CTokenTx &tokenTx, bool fFlushOnClose=true)
OptionsModel * getOptionsModel()
void getGasInfo(uint64_t &blockGasLimit, uint64_t &minGasPrice, uint64_t &nGasPrice) const
Get the information about the needed gas.