These are chat archives for ethereum/tutorials

28th
Feb 2018
mxito3
@mxito3
Feb 28 2018 00:38

I think this is an error in part of 'Improved Coin' in 'https://www.ethereum.org/token'.function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
My opinion is
‘function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(owner, msg.sender, amount); // makes the transfers
}’.

Change _transfer(this, msg.sender, amount) to _transfer(owner, msg.sender, amount)..
Except this,the true ether from the buyer can’t be sent to owner,but sent to contract.so I suggest to add this sentence ‘ if(!owner.send(msg.value)){

        revert();
    }’
I think this is an error in part of 'Improved Coin' in 'https://www.ethereum.org/token'.
who can answer my opinion....is this right?@ @alexvandesande
billtlee
@billtlee
Feb 28 2018 05:08

Hi, I have a very elementary question. Pardon my limited knowledge. The sendCoin function function sendCoin(address receiver, uint amount) returns(bool sufficient) takes in 2 variables. In this example from the Truffle documentation, there are 3 variables passing into the sendCoin function.
var meta;
MetaCoin.deployed().then(function(instance) {
meta = instance;
return meta.sendCoin(account_two, 10, {from: account_one});
}).then(function(result) {
// If this callback is called, the transaction was successfully processed.
alert("Transaction successful!")
}).catch(function(e) {
// There was an error! Handle it.
})

Can someone help me understand how this works? Thanks!

billtlee
@billtlee
Feb 28 2018 05:15
there is a reference to this 3rd parameter in the documentation.
What you see above is a special object that can always be passed as the last parameter to a function that lets you edit specific details about the transaction. Here, we set the from address ensuring this transaction came from account_one.
what short of object can be passed as the 3rd parameter?
mxito3
@mxito3
Feb 28 2018 05:37
I think this is an error in part of 'Improved Coin' in 'https://www.ethereum.org/token'.
function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
My opinion is
‘function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(owner, msg.sender, amount); // makes the transfers
}’.
Change _transfer(this, msg.sender, amount) to _transfer(owner, msg.sender, amount)..
Except this,the true ether from the buyer can’t be sent to owner,but sent to contract.so I suggest to add this sentence
‘ if(!owner.send(msg.value)){
revert();
}’
  bacause someone paid true eth to buy my coin,so i should give him or her coin and  accept the eth. @alexvandesande 
sennnnnnn
@sennnnnnn
Feb 28 2018 08:51
how to learn it?
webshopcz
@webshopcz
Feb 28 2018 09:41
Hi folks, because Ethereum blockchain eat whole SSD every few days, I must doing frequent cancel of GETH and backup of account. There is one flaw: At every backup event. all ETH are saved and all tokens (yes, I administered tokens) vanished completely. Is there someone who knows how way backup also Admin account for tokens ? Thanks Ivan
ravindramall
@ravindramall
Feb 28 2018 13:25
Hello
ravindramall
@ravindramall
Feb 28 2018 13:50
where do paste copied code from example
aditya875
@aditya875
Feb 28 2018 19:34
hi
The Unstoppable Greatness
@jackpot1136
Feb 28 2018 20:38
Jackpot1136
<html>
<head></head>
<body bgcolor="0566565">
<canvas id="canvas1" width="400" height="300">
</canvas>
<script>
var c=document.getElementById("canvas1");
var ctx=c.getContext("2d");
ctx.font="bold 22px Tahoma";
ctx.textAlign="start";
ctx.fillText("start", 10, 30);
ctx.translate(100, 150);
ctx.fillText("after translate", 10, 30);
ctx.textAlign="Kim San I";
ctx.fillText("Kim San I",40, 50);

</script>
</body>
</html>