You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In NEW ORDER - BID and ASK ORDER functions, why you check the balance of buyer's ETH and seller's token after decrease ETH and token??
I cannot understand.
// Decrease the Buyer's Account Balance of tokens by the amount the Sell Offer Order Entry is willing to accept in exchange for ETH
balanceEthForAddress[msg.sender] -= totalAmountOfEtherAvailable;
// Overflow Checks
require(balanceEthForAddress[msg.sender] >= totalAmountOfEtherAvailable);<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE
// Decrease the Seller's Account Balance of tokens by amount they are offering since the Buy Offer Order Entry is willing to accept it all in exchange for ETH
tokenBalanceForAddress[msg.sender][tokenNameIndex] -= amountOfTokensNecessary;
// Overflow Check
require(tokenBalanceForAddress[msg.sender][tokenNameIndex] >= amountOfTokensNecessary); <<<<<<<<<<<<<<<<<<<<<<<<<< HERE
The text was updated successfully, but these errors were encountered:
In NEW ORDER - BID and ASK ORDER functions, why you check the balance of buyer's ETH and seller's token after decrease ETH and token??
I cannot understand.
// Overflow Check
// 09 Unit Test:
balanceEthForAddress[msg.sender]
is initially 3000000000000000000 (3 ETH)require(balanceEthForAddress[msg.sender] >= totalAmountOfEtherAvailable);
require(balanceEthForAddress[msg.sender] - totalAmountOfEtherAvailable <= balanceEthForAddress[msg.sender]);
// Decrease the Buyer's Account Balance of tokens by the amount the Sell Offer Order Entry is willing to accept in exchange for ETH
balanceEthForAddress[msg.sender] -= totalAmountOfEtherAvailable;
// Overflow Checks
require(balanceEthForAddress[msg.sender] >= totalAmountOfEtherAvailable);<<<<<<<<<<<<<<<<<<<<<<<<<<< HERE
and
// Overflow Check
require(tokenBalanceForAddress[msg.sender][tokenNameIndex] >= amountOfTokensNecessary);
// Decrease the Seller's Account Balance of tokens by amount they are offering since the Buy Offer Order Entry is willing to accept it all in exchange for ETH
tokenBalanceForAddress[msg.sender][tokenNameIndex] -= amountOfTokensNecessary;
// Overflow Check
require(tokenBalanceForAddress[msg.sender][tokenNameIndex] >= amountOfTokensNecessary); <<<<<<<<<<<<<<<<<<<<<<<<<< HERE
The text was updated successfully, but these errors were encountered: