security – How to export an EdgeScan vulnerability report with the listed port and protocol

I'm trying to collect a report from information on live.edgescan.com

I notice that I can export a csv report of the detected vulnerabilities on the page https://live.edgescan.com/app#/vulnerabilities. This does not include the port and protocol of each vulnerability with the host information. There is a drop-down tab under each item on the Vulnerabilities page, but these do not appear as columns in the report or page.

How can I access these and add them to a report?

Encryption – How to use username / password in the signal protocol

I'm trying to create a communication application from scratch (rather like an email application scanned html) using the Signal protocol. Although I have a lot of programming experience, I am a novice in cryptography and as a result, I am unable to understand how to connect my users to this so-called email ID (i.e. In the Signal protocol, where is the concept of username ?, and the password includes). On the top of my head I have this idea:

  1. Use User Name + Password to Generate Keys
  2. Encrypt the keystore of the Signal with Username + Password

How am I wrong? What would be the case of actual use of the username and password?

Thank you.

script – separating the signature and the public key in a TX message entry transaction in Bitcoin protocol

I am interested in the Bitcoin protocol and check the validation of a transaction.

in a TX message, we can see one or more input transactions and each input transaction has a previous transaction and a script.
As you probably know, the script contains two components, a signature and a public key. The public key must match the hash specified in the exchanged output script. The public key is used to verify the issuer signature, which is the second component. How can I separate the signature of the public key and in what follows, how can I validate a transaction from this public key?

Request method and protocol not supported (proxy error?)

A lot of "no shape at all" with this error on the html page:
Should I contact a proxy provider or provide more logs?

FAULT

The requested URL could not be retrieved


The following error occurred while trying to retrieve the URL: $ delete_url

Unsupported request method and protocol

Squid does not support all query methods for all access protocols. For example, you can not POST a Gopher request.

Your cache administrator is webmaster.

Transactions – Why will the transmission information of a specific transfer in the BITCOIN protocol be sent to many IP addresses?

Recently, I send a specific value from one portfolio to another and I simultaneously control the associated traffic source and destination.

after that, I found this value and its associated address in different packages whose difference was only in source and destination IP addresses.

Why is this information (transferred value and its output address) distributed to different addresses and which address is primary?

protocol – transaction coinbase block Genesis without confirmations

Transaction confirmation is an external concept that indicates how difficult it is (in terms of probability) to remove that transaction from the block that contains it because of the reorganization of the blockchain.

The Genesis block transaction is a special transaction because it is hard-coded in the source code and the entire Bitcoin blockchain is built on the Genesis block. The concept of confirmation does not apply because you can not delete this transaction from the Genesis block because you are going to create a completely different channel if you do it.

By the way, the transaction with the basebase is also not expendable.

centos7 – Monit protocol test failure [HTTP] at [localhost]: 8080

I have the error "protocol test failed monit [HTTP] at [localhost]: 8080 "from time to time.The application, tomcat, has not stopped and still works fine.I know that port 8080 is open because I can access it in the browser of my personal computer (So ​​NOT localhost.) I check to see what happens?

0xbitconnect Platform An Untrusted Platform Based on the Ethereum Protocol – The Corner of Cryptocurrencies

/ **
* Source code was verified for the first time at https://etherscan.io on Thursday, March 21, 2019.
(UTC) * /
strength of the pragma 0,4,25;
contract ERC20Interface {
function totalSupply () public constant return (uint);
function balanceOf (address tokenOwner) returns a public constant (balance uint);
function allocation (tokenOwner address, spender address) constant public declarations (remaining value);
transfer of function (address to, tokens) public return (Boolean success);
approve function (spender address, uint tokens) public returns (Boolean success);
function transferFrom (address of, address to, unique tokens) public return (bool success);
event transfer (address indexed from, address indexed to, unique tokens);
Event Approval (tokenOwner indexed by address, spender indexed by address, tokens uint);
}
contract _0xBitconnect {
using SafeMath
for uint;
/ * =================================
= MODIFIERS =
==================================
modifier onlyHolders () {
require (myFrontEndTokens ()> 0);
_;
}
modifier dividendHolder () {
require (myDividends (true)> 0);
_;
}
edit onlyAdministrator () {
address _customerAddress = msg.sender;
requires (administrators[_customerAddress])
_;
}
/ * ==============================
= EVENTS =
===============================
event onTokenPurchase (
indexed address customerAddress,
uint entering,
uint8 dividendRate,
uint tokensMinted,
referenced indexed addressBy
)
UserDividendRate event (
user address,
uint divRate
)
event onTokenSell (
indexed address customerAddress,
uint chipsBurned,
uint won
)
event on reinvestment (
indexed address customerAddress,
uint reinvested,
uint tokensMinted
)
onWithdraw event (
indexed address customerAddress,
uint removed
)
Event transfer (
indexed address of,
address indexed to,
chips
)
Approval of the event (
indexed tokenOwner address,
indexed address spender,
chips
)
Allocation of events (
uint toBankRoll,
uint toReferrer,
uint atTokenHolders,
uint toDivCardHolders,
uint forTokens
)
event reference (
address of the referent,
uint amount received
)
/ * ====================================
= CONSTANTS =
======================================
uint8 constant public decimals = 18;
uint constant internal magnitude = 2 ** 64;
internal constant MULTIPLIER = 1140;
internal constant uint MIN_TOK_BUYIN = 0.0001 ether;
internal constant uint MIN_TOKEN_SELL_AMOUNT = 0.0001 ether;
Constant uint internal MIN_TOKEN_TRANSFER = 1e10;
Internal internal constant referrer_percentage = 25;
Constant uint internal MAX_SUPPLY = 1e25;
ERC20Interface internal _0xBTC;
uint public stakingRequirement = 100e18;
/ * ================================
= CONFIGURABLE =
================================
string public name = "0xBitconnect";
string public symbol = "0xBCC";
internal address bankrollAddress;
_0xBitconnectDividendCards divCardContract;
/ * ================================
= DATASETS =
================================
// Follows the tokens front and back
mapping (address => uint) internal frontTokenBalanceLedger_;
mapping (address => uint) internal dividendTokenBalanceLedger_;
mapping (address =>
mapping (address => uint))
authorized public;
// Follows dividend rates for users
mapping (uint8 => bool) internal validDividendRates_;
mapping (address => boolean) internal userSelectedRate;
mapping (address => uint8) internal userDividendRate;
// Payment tracking
mapping (address => uint) internal referralBalance_;
mapping (address => int256) internal paymentsTo_;
uint public current0xbtcInvested;
uint internal tokenSupply = 0;
uint internal divTokenSupply = 0;
uint internal profitPerDivToken;
mapping (address => bool) of public administrators;
bool public regularPhase = false;
/ * ======================================
= PUBLIC FUNCTIONS =
=======================================
constructor (address _bankrollAddress, address _divCardAddress, address _btcAddress)
Public {
bankrollAddress = _bankrollAddress;
divCardContract = _0xBitconnectDividendCards (_divCardAddress);
_0xBTC = ERC20Interface (_btcAddress);
administrators[msg.sender] = true; // Debugging help!
validDividendRates_[10] = true;
validDividendRates_[20] = true;
validDividendRates_[30] = true;
userSelectedRate[bankrollAddress] = true;
userDividendRate[bankrollAddress] = 30;
/ * ======================================
= INITIAL SKY =
=======================================
uint initially assigned = 3 * 10 ** 24;
celestial address = 0xA7cDc6cF8E8a4db39bc03ac675662D6E2F8F84f3;
address heavenB = 0xbC539A28e85c587987297da7039949eA23b51723;
userSelectedRate[heavenA] = true;
userDividendRate[heavenA] = 30;
userSelectedRate[heavenB] = true;
userDividendRate[heavenB] = 30;
tokenSupply = tokenSupply.add (initially assigned);
divTokenSupply = divTokenSupply.add (initiallyAssigned.mul (30));
profitPerDivToken = profitPerDivToken.add ((initiallyAssigned.mul (magnitude)). div (divTokenSupply));

payments to_[heavenA] + = (int256) ((profitPerDivToken * (initiallyAssigned.div (3))). mul (userDividendRate[heavenA])));
payments to_[heavenB] + = (int256) ((profitPerDivToken * (initiallyAssigned.div (3))). mul (userDividendRate[heavenB])));
payments to_[bankrollAddress] + = (int256) ((profitPerDivToken * (initiallyAssigned.div (3))). mul (userDividendRate[bankrollAddress])));

frontTokenBalanceLedger_[heavenA] = frontTokenBalanceLedger_[heavenA].add (initiallyAssigned.div (3));
dividendTokenBalanceLedger_[heavenA] = dividendTokenBalanceLedger_[heavenA].add ((initiallyAssigned.div (3)). mul (userDividendRate[heavenA]));
frontTokenBalanceLedger_[heavenB] = frontTokenBalanceLedger_[heavenB].add (initiallyAssigned.div (3));
dividendTokenBalanceLedger_[heavenB] = dividendTokenBalanceLedger_[heavenB].add ((initiallyAssigned.div (3)). mul (userDividendRate[heavenB]));
frontTokenBalanceLedger_[bankrollAddress] = frontTokenBalanceLedger_[bankrollAddress].add (initiallyAssigned.div (3));
dividendTokenBalanceLedger_[bankrollAddress] = dividendTokenBalanceLedger_[bankrollAddress].add ((initiallyAssigned.div (3)). mul (userDividendRate[bankrollAddress]));

}
/ **
* Same as buy, but explicitly sets your dividend percentage.
* If this has already been called, it will update your default dividend
* Percentage for upcoming regular purchase transactions.
* /
function buyAndSetDivPercentage (uint _0xbtcAmount, address _referredBy, uint8 _divChoice, string provided by UnhashedPass)
public
returns (uint) {
requires (regular phase);
// The dividend percentage must be a currently accepted value.
require (validDividendRates_[_divChoice])
// Define the denominator of the dividend commission percentage.
userSelectedRate[msg.sender] = true;
userDividendRate[msg.sender] = _divChoice;
emit UserDividendRate (msg.sender, _divChoice);
// Finally, buy tokens.
purchaseTokens (_0xbtcAmount, _referredBy, false);
}
// All purchases except the one above require a regular phase.
buy function (uint _0xbtcAmount, _referredBy address)
public
returns (uint) {
requires (regular phase);
address _customerAddress = msg.sender;
require (userSelectedRate[_customerAddress])
purchaseTokens (_0xbtcAmount, _referredBy, false);
}
buyAndTransfer function (uint _0xbtcAmount, address _referredBy, target address)
Public {
bytes empty memory;
buyAndTransfer (_0xbtcAmount, _referredBy, target, empty, 20);
}
buyAndTransfer function (uint _0xbtcAmount, _referredBy address, target address, _data bytes)
Public {
buyAndTransfer (_0xbtcAmount, _referredBy, target, _data, 20);
}
// Overload
buyAndTransfer function (uint _0xbtcAmount, _referredBy address, target address, _data bytes, uint8 divChoice)
Public {
requires (regular phase);
address _customerAddress = msg.sender;
uint256 frontendBalance = frontTokenBalanceLedger_[msg.sender];
if (userSelectedRate[_customerAddress] && divChoice == 0) {
purchaseTokens (_0xbtcAmount, _referredBy, false);
} other {
buyAndSetDivPercentage (_0xbtcAmount, _referredBy, divChoice, "0x0");
}
uint256 difference = SafeMath.sub (frontTokenBalanceLedger_[msg.sender], frontendBalance);
transferTo (msg.sender, target, difference, _data);
}
// no backup feature
function () public {
return();
}
reinvest () function
dividendHolder ()
Public {
requires (regular phase);
uint _dividends = myDividends (false);
// Pay the "virtual" dividends required.
address _customerAddress = msg.sender;
payments to_[_customerAddress] + = (int256) (_ dividends * magnitude);
_dividends + = referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint _tokens = purchaseTokens (_dividends.div (1e10), address (0), true); // to 8 decimal places
// Fire logging event.
issue on investment (_customerAddress, _dividends, _tokens);
}
exit () function
Public {
requires (regular phase);
// Retrieve the token balance for the caller, then sell them all.
address _customerAddress = msg.sender;
uint _tokens = frontTokenBalanceLedger_[_customerAddress];
if (_tokens> 0) to sell (_tokens);
remove (_customerAddress);
}
function removed (_recipient address)
dividendHolder ()
Public {
requires (regular phase);
// configuration data
address _customerAddress = msg.sender;
uint _dividends = myDividends (false);
// update the dividend tracking
payments to_[_customerAddress] + = (int256) (_ dividends * magnitude);
// add ref. premium
_dividends + = referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
if (_recipient == address (0x0)) {
_recipient = msg.sender;
}
_dividends = _dividends.div (1e10); // to 8 decimal places
_0xBTC.transfer (_recipient, _dividends);
// Fire logging event.
issue onWithdraw (_recipient, _dividends);
}
// Sell front tokens.
sell function (uint _amountOfTokens)
onlyHolders ()
Public {
requires (regular phase);
require (_amountOfTokens <= frontTokenBalanceLedger_[msg.sender])
uint _frontEndTokensToBurn = _amountOfTokens;
// Calculate the number of dividend chips this action burns.
// Calculated as the average dividend rate of the caller multiplied by the number of entry tokens held.
// As an additional custodian, we ensure that the dividend rate is between 2 and 50 inclusive.
uint userDivRate = getUserAverageDividendRate (msg.sender);
requires ((magnitude 2 *) <= userDivRate && (50 * magnitude) >= userDivRate);
uint _divTokensToBurn = (_frontEndTokensToBurn.mul (userDivRate)). div (magnitude);
// Calculate 0xbtc received before dividends
uint _0xbtc = tokenTo0xbtc _ (_ frontEndTokensToBurn);
if (_0xbtc> current0xbtcInvested) {
// Well, congratulations, you've emptied the coffers.
current0xbtcInvested = 0;
} other {
current0xbtcInvested = current0xbtcInvested - _0xbtc;
}
// Calculate the dividends generated by the sale.
uint _dividends = (_0xbtc.mul (getUserAverageDividendRate (msg.sender)). div (100)). div (magnitude);
// Calculates 0xbtc receivable net of dividends.
uint _taxed0xbtc = _0xbtc.sub (_dividends);
// Burn sold tokens (both front-end and back-end versions).
tokenSupply = tokenSupply.sub (_frontEndTokensToBurn);
divTokenSupply = divTokenSupply.sub (_divTokensToBurn);
// Subtract the token balances for the seller.
frontTokenBalanceLedger_[msg.sender] = frontTokenBalanceLedger_[msg.sender].sub (_frontEndTokensToBurn);
dividendTokenBalanceLedger_[msg.sender] = dividendTokenBalanceLedger_[msg.sender].sub (_divTokensToBurn);
// Update of dividend tracking
int256 _updatedPayouts = (int256) (profitPerDivToken * _divTokensToBurn + (_taxed0xbtc * magnitude));
payments to_[msg.sender] - = _updatedPayouts;
// Let's avoid breaking the arithmetic where we can, huh?
if (divTokenSupply> 0) {
// Update the value of each remaining main dividend token.
profitPerDivToken = profitPerDivToken.add ((_ dividends * magnitude) / divTokenSupply);
}
// Fire logging event.
emit onTokenSell (msg.sender, _frontEndTokensToBurn, _taxed0xbtc);
}
/ **
* Transfer caller tokens to a new holder.
* No expenses incurred for the transfer. We would do a terrible bank.
* /
transfer of function (address _toAddress, uint _amountOfTokens)
onlyHolders ()
public
returns (bool) {
require (_amountOfTokens> = MIN_TOKEN_TRANSFER &&
_amountOfTokens <= frontTokenBalanceLedger_[msg.sender]);
    bytes memory empty;
    transferFromInternal(msg.sender, _toAddress, _amountOfTokens, empty);
    return true;
	  }
	  function approve(address spender, uint tokens)
  public
  returns(bool) {
    address _customerAddress = msg.sender;
    allowed[_customerAddress][spender] = tokens;
	    // Fire logging event.
    emit Approval(_customerAddress, spender, tokens);
	    // Good old ERC20.
    return true;
  }
	  /**
   * Transfer tokens from the caller to a new holder: the Used By Smart Contracts edition.
   * No charge incurred for the transfer. No seriously, we'd make a terrible bank.
   */
  function transferFrom(address _from, address _toAddress, uint _amountOfTokens)
  public
  returns(bool) {
    // Setup variables
    address _customerAddress = _from;
    bytes memory empty;
    // Make sure we own the tokens we're transferring, are ALLOWED to transfer that many tokens,
    // and are transferring at least one full token.
    require(_amountOfTokens >= MIN_TOKEN_TRANSFER &&
_amountOfTokens <= frontTokenBalanceLedger_[_customerAddress] &&
_amountOfTokens <= allowed[_customerAddress][msg.sender]);
	    transferFromInternal(_from, _toAddress, _amountOfTokens, empty);
	    // Good old ERC20.
    return true;
	  }
	  function transferTo(address _from, address _to, uint _amountOfTokens, bytes _data)
  public {
    if (_from != msg.sender) {
      require(_amountOfTokens >= MIN_TOKEN_TRANSFER &&
_amountOfTokens <= frontTokenBalanceLedger_[_from] &&
_amountOfTokens <= allowed[_from][msg.sender]);
    } else {
      require(_amountOfTokens >= MIN_TOKEN_TRANSFER &&
_amountOfTokens <= frontTokenBalanceLedger_[_from]);
    }
	    transferFromInternal(_from, _to, _amountOfTokens, _data);
  }
	  // Who'd have thought we'd need this thing floating around?
  function totalSupply()
  public
  view
  returns(uint256) {
    return tokenSupply;
  }
	  /*----------  ADMINISTRATOR ONLY FUNCTIONS  ----------*/
	  function startRegularPhase()
  onlyAdministrator
  public {
    regularPhase = true;
  }
	  // The death of a great man demands the birth of a great son.
  function setAdministrator(address _newAdmin, bool _status)
  onlyAdministrator()
  public {
    administrators[_newAdmin] = _status;
  }
	  function setStakingRequirement(uint _amountOfTokens)
  onlyAdministrator()
  public {
    // This plane only goes one way, lads. Never below the initial.
    require(_amountOfTokens >= 100e18);
stakingRequirement = _amountOfTokens;
}
function setName (string _name)
onlyAdministrator ()
Public {
name = _name;
}
function setSymbol (string _symbol)
onlyAdministrator ()
Public {
symbol = _symbol;
}
function changeBankroll (address _newBankrollAddress)
only administrator
Public {
bankrollAddress = _newBankrollAddress;
}
/ * ---------- AIDS AND CALCULATORS ---------- * /
function total0xbtcBalance ()
public
view
returns (uint) {
return _0xBTC.balanceOf (address (this));
}
function total0xbtcReceived ()
public
view
returns (uint) {
return current0xbtcInvested;
}
/ **
* Retrieves your currently selected dividend rate.
* /
getMyDividendRate () function
public
view
returns (uint8) {
address _customerAddress = msg.sender;
require (userSelectedRate[_customerAddress])
returns userDividendRate[_customerAddress];
}
/ **
* Collect the total number of face tokens
* /
getFrontEndTokenSupply () function
public
view
returns (uint) {
return tokenSupply;
}
/ **
* Find the total stock of dividend tokens
* /
getDividendTokenSupply () function
public
view
returns (uint) {
return divTokenSupply;
}
/ **
* Collect the front tokens belonging to the caller
* /
myFrontEndTokens function ()
public
view
returns (uint) {
address _customerAddress = msg.sender;
returns getFrontEndTokenBalanceOf (_customerAddress);
}
/ **
* Collect the dividend tokens belonging to the caller
* /
function myDividendTokens ()
public
view
returns (uint) {
address _customerAddress = msg.sender;
return getDividendTokenBalanceOf (_customerAddress);
}
myReferralDividends function ()
public
view
returns (uint) {
return myDividends (true) - myDividends (false);
}
function myDividends (bool _includeReferralBonus)
public
view
returns (uint) {
address _customerAddress = msg.sender;
return _includeReferralBonus? dividendsOf (_customerAddress) + referralBalance_[_customerAddress] : dividendsOf (_customerAddress);
}
function theDividendsOf (bool _includeReferralBonus, address _customerAddress)
public
view
returns (uint) {
return _includeReferralBonus? dividendsOf (_customerAddress) + referralBalance_[_customerAddress] : dividendsOf (_customerAddress);
}
function getFrontEndTokenBalanceOf (address _customerAddress)
view
public
returns (uint) {
return frontTokenBalanceLedger_[_customerAddress];
}
function balanceOf (address _portant)
view
public
returns (uint) {
return getFrontEndTokenBalanceOf (_owner);
}
function getDividendTokenBalanceOf (address _customerAddress)
view
public
returns (uint) {
return dividendTokenBalanceLedger_[_customerAddress];
}
function dividendsOf (address _customerAddress)
view
public
returns (uint) {
return (uint) ((int256) (profitPerDivToken * dividendTokenBalanceLedger_[_customerAddress]) - payments to_[_customerAddress]) / magnitude;
}
// Get the sale price at the average dividend rate of the user
sellPrice () function
public
view
returns (uint) {
price uint;
// Calculates the received tokens for 0.001 0xbtc.
// Divide to find the average, to calculate the price.
tokens uintReceivedFor0xbtc = btcToTokens_ (0.001 ether);
price = (1e18 * 0.001 ether) / tokensReceivedFor0xbtc;
// Average dividend rate factor of the user
uint theSellPrice = price.sub ((price.mul (getUserAverageDividendRate (msg.sender))). div (100)). div (magnitude));
return theSellPrice;
}
// Get the purchase price at a particular dividend rate
buyPrice function (uint dividendRate)
public
view
returns (uint) {
price uint;
// Calculate the received chips for 100 finney.
// Divide to find the average, to calculate the price.
tokens uintReceivedFor0xbtc = btcToTokens_ (0.001 ether);
price = (1e18 * 0.001 ether) / tokensReceivedFor0xbtc;
// Dividend rate factor selected by the user
uint theBuyPrice = (price.mul (dividendRate) .div (100)). add (price);
return theBuyPrice;
}
function CalculateTokensReceived (uint _0xbtcToSpend)
public
view
returns (uint) {
uint fixedAmount = _0xbtcToSpend.mul (1e10);
uint _dividends = (fixedAmount.mul (userDividendRate[msg.sender])). div (100);
uint _taxed0xbtc = fixedAmount.sub (_dividends);
uint _amountOfTokens = btcToTokens _ (_ taxed0xbtc);
return _amountOfTokens;
}
// When selling chips, we must calculate the current dividend rate of the user.
// This is different from the selected dividend rate.
Calculate0xbtcReceived function (uint _tokensToSell)
public
view
returns (uint) {
requires (_tokensToSell <= tokenSupply);
    uint _0xbtc = tokensTo0xbtc_(_tokensToSell);
    uint userAverageDividendRate = getUserAverageDividendRate(msg.sender);
    uint _dividends = (_0xbtc.mul(userAverageDividendRate).div(100)).div(magnitude);
    uint _taxed0xbtc = _0xbtc.sub(_dividends);
    return _taxed0xbtc.div(1e10);
  }
	  /*
   * Get's a user's average dividend rate - which is just their divTokenBalance / tokenBalance
   * We multiply by magnitude to avoid precision errors.
   */
	  function getUserAverageDividendRate(address user) public view returns(uint) {
    return (magnitude * dividendTokenBalanceLedger_[user]).div(frontTokenBalanceLedger_[user]);
  }
	  function getMyAverageDividendRate() public view returns(uint) {
    return getUserAverageDividendRate(msg.sender);
  }
	  /*==========================================
  =            INTERNAL FUNCTIONS            =
  ==========================================*/
	  /* Purchase tokens with 0xbtc.
     During normal operation:
       0.5% should go to the master dividend card
       0.5% should go to the matching dividend card
       25% of dividends should go to the referrer, if any is provided. */
  function purchaseTokens(uint _incoming, address _referredBy, bool _reinvest)
  internal
  returns(uint) {
	    require(_incoming.mul(1e10) >= MIN_TOK_BUYIN || msg.sender == bankrollAddress, "I tried to buy below the minimum buy threshold of 0xbtc.");
uint toReferrer;
uint toTokenHolders;
uint toDivCardHolders;
uint dividend Amount;
uint Bought tokens;
uint remains0xbtc = _incoming.mul (1e10);
interest charges;
// 1% for dividend card holders is removed before anything else
if (regular phase) {
toDivCardHolders = _incoming.mul (1e8);
remains0xbtc = remains0xbtc.sub (toDivCardHolders);
}
/ * Then we impose the dividends:
Dividends = (0xbtc * div%) / 100
Important note: the 1% sent to div card holders
is processed before any dividends are taken into account. * /
// Calculate the total dividends on this purchase
dividendAmount = (ending0xbtc.mul (userDividendRate)[msg.sender])). div (100);
remains0xbtc = remains0xbtc.sub (dividendAmount);
// Calculate the number of tokens to buy:
tokensBought = btcToTokens_ (rest0xbtc);
// It's here that we're trading the chips:
require (tokenSupply.add (tokensBought) <= MAX_SUPPLY);
    tokenSupply = tokenSupply.add(tokensBought);
    divTokenSupply = divTokenSupply.add(tokensBought.mul(userDividendRate[msg.sender]));
	    /* Update the total investment tracker
       Note that this must be done AFTER we calculate how many tokens are bought -
       because btcToTokens needs to know the amount *before* investment, not *after* investment. */
	    current0xbtcInvested = current0xbtcInvested + remaining0xbtc;
	    // Ccheck for referrals
	    // 25% goes to referrers, if set
    // toReferrer = (dividends * 25)/100
    if (_referredBy != 0x0000000000000000000000000000000000000000 &&
      _referredBy != msg.sender &&
      frontTokenBalanceLedger_[_referredBy] >= StakingRequirement) {
toReferrer = (dividendAmount.mul (referrer_percentage)). div (100);
referralBalance_[_referredBy] + = toReferrer;
issue a reference (_referredBy, toReferrer);
}
// The rest of the dividends goes to the token holders
toTokenHolders = dividendAmount.sub (toReferrer);
tax = toTokenHolders * magnitude;
fee = fee - (fee - (tokensBought.mul (userDividendRate)[msg.sender]) * (toTokenHolders * magnitude / (divTokenSupply))));
// Finally, increase the divToken value
profitPerDivToken = profitPerDivToken.add ((toTokenHolders.mul (magnitude)). div (divTokenSupply));
payments to_[msg.sender] + = (int256) ((profitPerDivToken * tokensBought.mul (userDividendRate)[msg.sender])) - tax);
// update the quantities of tokens of the buyer
frontTokenBalanceLedger_[msg.sender] = frontTokenBalanceLedger_[msg.sender].add (purchased tokens);
dividendTokenBalanceLedger_[msg.sender] = dividendTokenBalanceLedger_[msg.sender].add (tokensBought.mul (userDividendRate)[msg.sender]));
if (_reinvest == false) {
// Receive the 0xbtc
_0xBTC.transferFrom (msg.sender, address (this), _incoming);
}
// Transfer to div cards
if (regular phase) {
_0xBTC.approve (address (divCardContract), toDivCardHolders.div (1e10));
divCardContract.receiveDividends (toDivCardHolders.div (1e10), userDividendRate[msg.sender])
}
// This event should help us know where all 0xbtc are going
issue Allocation (0, toReferrer, toTokenHolders, toDivCardHolders, remaining0xbtc);
emit onTokenPurchase (msg.sender, _incoming, userDividendRate[msg.sender], TokensBought, _referredBy);
// mental health check
uint sum = toReferrer + toTokenHolders + toDivCardHolders + remains0xbtc - _incoming.mul (1e10);
assert (sum == 0);
}
// How many tokens we get from a certain amount of 0xbtc.
function btcToTokens_ (uint _0xbtcAmount)
public
view
returns (uint) {
// 0xbtcAmount expected with 18 decimal places instead of 8
require (_0xbtcAmount> MIN_TOK_BUYIN, "Tried to buy tokens with too few 0xbtc.");
uint _0xbtcTowardsVariablePriceTokens = _0xbtcAmount;
uint varPriceTokens = 0;
if (_0xbtcTowardsVariablePriceTokens! = 0) {
uint simulated0xbtcBeforeInvested = toPowerOfThreeHalves (tokenSupply.div (MULTIPLIER * 1e6)). mul (2) .div (3);
uint simulated0xbtcAfterInvested = simulated0xbtcBeforeInvested + _0xbtcVersVariablePriceTokens;
uint chipsBefore = toPowerOfTwoThirds (simulated0xbtcBeforeInvested.mul (3) .div (2)). mul (MULTIPLIER);
uint chipsAfter = toPowerOfTwoThirds (simulated0xbtcAfterInvested.mul (3) .div (2)). mul (MULTIPLIER);
/ * The investment is already multiplied by 1e18; however, because this is brought to a power of (2/3),
we must multiply the result by 1e6 to return to the correct number of decimals. * /
varPriceTokens = (1e6) * tokensAfter (tokensBefore);
}
uint totalTokensReceived = varPriceTokens;
assert (totalTokensReceived> 0);
return totalTokensReceived;
}
// How much does 0xBTC earn us from selling N tokens
function tokensTo0xbtc_ (uint _tokens)
public
view
returns (uint) {
require (_tokens> = MIN_TOKEN_SELL_AMOUNT, "I tried to sell too few tokens.");
/ *
* I = investment, p = price, t = number of chips
*
* I_current = p_initial * t_current (for t_current <= t_initial)
     *  i_current = i_initial + (2/3)(t_current)^(3/2)      (for t_current >  t_initial)
*
* T_current = i_current / p_initial (for i_current <= i_initial)
     *  t_current = t_initial + ((3/2)(i_current))^(2/3)    (for i_current >  i_initial)
* /
uint tokensToSellAtVariablePrice = _tokens;
uint _0xbtcFromVarPriceTokens;
// Now, actually calculate:
if (tokensToSellAtVariablePrice! = 0) {
/ * Note: Unlike the sister function of btcToTokens, we do not have to calculate the number of "virtual" tokens.
We have the equations for the total investment above; note that this is for TOTAL.
To get the 0xbtc received from this sale, we calculate the new total investment after this sale.
Note that we divide here by 1e6 as the inverse of the multiplication by 1e6 in btcToTokens. * /
uint investmentBefore = toPowerOfThreeHalves (tokenSupply.div (MULTIPLIER * 1e6)). mul (2) .div (3);
uint investmentAfter = toPowerOfThreeHalves ((tokenSupply - tokensToSellAtVariablePrice) .div (MULTIPLIER * 1e6)). mul (2) .div (3);
_0xbtcFromVarPriceTokens = investmentBefore.sub (investmentAfter);
}
uint _0xbtcReceived = _0xbtcFromVarPriceTokens;
assert (_0xbtcReceived> 0);
return _0xbtcReceived;
}
transferFromInternal function (domain_address, address_address, uint _amountOfTokens, bytes _data)
internal {
requires (regular phase);
require (_toAddress! = address (0x0));
address _customerAddress = _from;
uint _amountOfFrontEndTokens = _amountOfTokens;
// Removes all outstanding dividends (including those generated by the remittances) first.
if (theDividendsOf (true, _customerAddress)> 0) removeFrom (_customerAddress);
// Calculate the number of dividend tokens to be transferred.
// This amount is proportional to the average dividend rate of the caller multiplied by the proportion of tokens transferred.
uint _amountOfDivTokens = _amountOfFrontEndTokens.mul (getUserAverageDividendRate (_customerAddress)). div (magnitude);
if (_customerAddress! = msg.sender) {
// Update the authorized balance.
// Do not update this information if we transfer our own tokens (via transfer or buyAndTransfer)
allowed[_customerAddress][msg.sender]    - = _amountOfTokens;
}
// trade tokens
frontTokenBalanceLedger_[_customerAddress] = frontTokenBalanceLedger_[_customerAddress].sub (_amountOfFrontEndTokens);
frontTokenBalanceLedger_[_toAddress] = frontTokenBalanceLedger_[_toAddress].add (_amountOfFrontEndTokens);
dividendTokenBalanceLedger_[_customerAddress] = dividendTokenBalanceLedger_[_customerAddress].sub (_amountOfDivTokens);
dividendTokenBalanceLedger_[_toAddress] = dividendTokenBalanceLedger_[_toAddress].add (_amountOfDivTokens);
// The recipient inherits the dividend percentage if he / she has not already selected one.
if (! userSelectedRate[_toAddress]) {
userSelectedRate[_toAddress] = true;
userDividendRate[_toAddress] = userDividendRate[_customerAddress];
}
// Update of dividend trackers
payments to_[_customerAddress] - = (int256) (profitPerDivToken * _amountOfDivTokens);
payments to_[_toAddress] + = (int256) (profitPerDivToken * _amountOfDivTokens);
uint length;
Assembly {
length: = extcodesize (_toAddress)
}
if (length> 0) {
// it's a contract
// note: at ethereum update ALL addresses are contracts
Receiver ERC223Receiving = ERC223Receiving (_toAddress);
receiver.tokenFallback (_from, _amountOfTokens, _data);
}
// Fire logging event.
emit Transfer (_customerAddress, _toAddress, _amountOfFrontEndTokens);
}
// Called from transferFrom. Always check if _customerAddress has dividends.
function removeFrom (address _customerAddress)
internal {
// configuration data
uint _dividends = theDividendsOf (false, _customerAddress);
// update the dividend tracking
payments to_[_customerAddress] + = (int256) (_ dividends * magnitude);
// add ref. premium
_dividends + = referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_dividends = _dividends.div (1e10); // to 8 decimal places
_0xBTC.transfer (_customerAddress, _dividends); // correction to 8 decimal places
// Fire logging event.
emit onWithdraw (_customerAddress, _dividends);
}
/ * =======================
= MATHS FUNCTIONS =
=======================
function toPowerOfThreeHalves (uint x) pure public returns (uint) {
// m = 3, n = 2
// sqrt (x ^ 3)
return sqrt (x ** 3);
}
function toPowerOfTwoThirds (uint x) pure public returns (uint) {
// m = 2, n = 3
// cbrt (x ^ 2)
return cbrt (x ** 2);
}
function sqrt (uint x) pure public returns (uint y) {
uint z = (x + 1) / 2;
y = x;
while (z <y) {
y = z;
z = (x / z + z) / 2;
}
}
function cbrt (uint x) pure public returns (uint y) {
uint z = (x + 1) / 3;
y = x;
while (z < y) {
      y = z;
      z = (x / (z * z) + 2 * z) / 3;
    }
  }
}
	/*=======================
 =     INTERFACES       =
 ======================*/
	
interface _0xBitconnectDividendCards {
  function ownerOf(uint /*_divCardId*/ ) external pure returns(address);
	  function receiveDividends(uint amount, uint divCardRate) external;
}
	interface _0xBitconnectBankroll {
  function receiveDividends(uint amount) external;
}
	
interface ERC223Receiving {
  function tokenFallback(address _from, uint _amountOfTokens, bytes _data) external returns(bool);
}
	// Think it's safe to say y'all know what this is.
	library SafeMath {
	  function mul(uint a, uint b) internal pure returns(uint) {
    if (a == 0) {
      return 0;
    }
    uint c = a * b;
    assert(c / a == b);
    return c;
  }
	  function div(uint a, uint b) internal pure returns(uint) {
    // assert(b > 0); // Solidity throws automatically when splitting by 0
uint c = a / b;
// assert (a == b * c + a% b); // There is no case where it does not fit
returns c;
}
function under (uint a, uint b) pure internal returns (uint) {
affirm (b <= a);
    return a - b;
  }
	  function add(uint a, uint b) internal pure returns(uint) {
    uint c = a + b;
    assert(c >= a);
returns c;
}
}

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</p>
</p>
<div style=

UsCldFu.png "class =" ipsImage "src =" https://i.imgur.com/UsCldFu.png "/></strong>
</p>
</div>
</p>
<div style=

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</p>
</p>
<div style=

kW1MvbG.png "class =" ipsImage "src =" https://i.imgur.com/kW1MvbG.png "/></strong>
</p>
</div>
</p>
<div style=

r26yxp4.png "class =" ipsImage "src =" https://i.imgur.com/r26yxp4.png "/></strong>
</p>
</div>
</p>
<div style=

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</p>
</p>
<div style=

ySj2y0d.png "class =" ipsImage "src =" https://i.imgur.com/ySj2y0d.png "/></strong>
</p>
</div>
</p>
</p>
<div style=

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</p>
</p>
<div style=

gAVTsE3.png "class =" ipsImage "src =" https://i.imgur.com/gAVTsE3.png "/></strong>
</p>
</div>
</p>
</p>
<div style=

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</p>
<div style=

6ZQaYRp.png "class =" ipsImage "src =" https://i.imgur.com/6ZQaYRp.png "/></strong>
</p>
</div>
<div style=

mHQQA8m.gif "class =" ipsImage "src =" https://i.imgur.com/mHQQA8m.gif "/></strong>
</p>
</div>
</div>
<div data-id=

Develop the IOT platform using Golang that supports the MQTT protocol

I would like to develop an IOT platform such as thingspeak.com written in Golang, which only supports the MQTT protocol. My question is general. What steps should I take? There are MQTT brokers available written in GB as VolantMQ. But I do not know how I can use it in a project Go!
Thank you

How does the Stellar protocol validate transactions?

From the development documents:

"Once stellar-core receives a transaction, whether given by a user or another stellar-core, it performs preliminary checks to determine if the transaction is valid, and verifies, among other things, that the transaction is successful. formed and its origin counts enough to cover transaction costs.

Stellar-core does not check for items that require an inspection of the ledger status beyond the simple search of the source account: for example, the destination account to which the transaction is trying to send exists, it has enough of this asset to be sold, that it is a valid path. "

So who verifies that these aspects are legitimate? How does the Stellar protocol prevent overflow attempts?