function redeem(uint256 _token) public {
// transfering the token from tokenholder to owner
token tokenBalance = token(tokenAddress);
tokenBalance.transferToOwner(owner, _token);
// the tokenholder gets the ethereum
uint256 weiVal = (_mtcTokens * redeemRate);
msg.sender.transfer(weiVal);
}
The first part of the function is transfering the token from the holder to owner by calling an external function in another contract. The second part is transfering the ethereum for each token transfered.
Does the first part will work in a synced manner (i.e. the code will run line by line) OR the execution of second part can happen even if the execution of first part is not completed?
Are there any security flaws (like re-entry attack etc)?