These are chat archives for ethereum/tutorials

4th
Aug 2017
hariharan-rhce
@hariharan-rhce
Aug 04 2017 04:52
Hi
hariharan-rhce
@hariharan-rhce
Aug 04 2017 05:31
starting a smart contract hardware requirement
Jacks Mirzoyan
@dauletmyrzan
Aug 04 2017 06:49
Hi there! How to calculate which block will match to 9th of August 00:00 PM? Is there any formula of it? Or should I calculate it knowing that 1 hour = 212 blocks. So, knowing that current block is 4114902, I just add those hours left multiplied by 212 blocks? x = 4114902 + (212 * hoursLeft); Is this correct?
kuojenski
@kuojenski
Aug 04 2017 08:05
hi anyone here?
I try to create my own token fellowed by the webpage https://www.ethereum.org/token and I keep getting this error ==> "throw" is deprecated in favour of "revert()", "require()" and "assert()" so how can I fix it
Jacks Mirzoyan
@dauletmyrzan
Aug 04 2017 08:29
@kuojenski Yeap, "throw" is deprecated in older versions, so use those functions that platform offers. Instead of if(a < b) throw; use require(a > b);
@hTrap get it here http://faucet.ropsten.be:3001/
kuojenski
@kuojenski
Aug 04 2017 08:34
@dauletmyrzan I don't know how to do this, I'm not a code writer, is there anyone done this change so I can look up for it??
Jacks Mirzoyan
@dauletmyrzan
Aug 04 2017 08:36
@kuojenski Your errors were highlighted. Send here one of those errors (send whole row).
ENiG87
@ENiG87
Aug 04 2017 08:37
@pirokars It could very well be, that your ether is now lost, if you sent it to the testnet already. In any case I wont be that much help to you. maybe somebody else knows about ether recovery.
kuojenski
@kuojenski
Aug 04 2017 08:37
@dauletmyrzan another question, do I need a ETH to deploy my contract?
ENiG87
@ENiG87
Aug 04 2017 08:38
@palehorse-actl Yes, that's true. Although as of now this is still just a "warning" not an "error". So your code should still compile and work.
@kuojenski Yes, you do. Depending on your place of deployment (ethereum or testnet chain) you'll need ether or testnet-ether
kuojenski
@kuojenski
Aug 04 2017 08:39
@ENiG87 thanks
@dauletmyrzan function () {
throw; // Prevents accidental sending of ether
}
if (!msg.sender.send(amount * sellPrice)) { // sends ether to the seller. It's important
throw; // to do this last to avoid recursion attacks
}
ENiG87
@ENiG87
Aug 04 2017 08:41
yeah, that would be
ยดยดยด
require(!msg.sender.send(amount * sellPrice));
kuojenski
@kuojenski
Aug 04 2017 08:42
@ENiG87 I already create my wallet as normal not testnet chain, how can i use testnet chain?
ENiG87
@ENiG87
Aug 04 2017 08:43
@kuojenski you'll have to connect your node to the testnet by loading the testnet chain
alternatively: if you use remix, all adresses there are testnet-adresses
function (){
require(!msg.sender.send(amount * sellPrice)); }
although i'm not sure about that example
where did you get it?
i try to create my own token
function sell(uint256 amount) {
require(balanceOf[msg.sender] >= amount);
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
if (!msg.sender.send(amount * sellPrice)) {
throw;
} else {
Transfer(msg.sender, this, amount);
}
function () {
throw; }
ENiG87
@ENiG87
Aug 04 2017 08:50
ok, then your code should look like this:
Jacks Mirzoyan
@dauletmyrzan
Aug 04 2017 08:53
@ENiG87 can you help me with this? :)
How to calculate which block will match to 9th of August 00:00 PM? Is there any formula of it? Or should I calculate it knowing that 1 hour = 212 blocks. So, knowing that current block is 4114902, I just add those hours left multiplied by 212 blocks? x = 4114902 + (212 * hoursLeft); Is this correct?
ENiG87
@ENiG87
Aug 04 2017 08:54
function sell (uint256 amount) {
require(
balanceOf[msg.sender] >= amount;
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
Transfer(msg.sender, this, amount)
)
}
@dauletmyrzan i read your query, but i don't know why you would do that? there is no formula to calculate what the next block will be on 9th of august. you'll only can try to estimate like you already did.
kuojenski
@kuojenski
Aug 04 2017 08:57
@ENiG87 thanks alot
Jacks Mirzoyan
@dauletmyrzan
Aug 04 2017 09:05
@ENiG87 Thank you for helping. Looking at smartcontract code of another tokens, I noticed that most of them use variables such as fundingStartBlock and fundingEndBlock. Are they just pass estimated startBlock and endBlock numbers to constructor? I think it's hard to estimate up to seconds. What do u think?
ENiG87
@ENiG87
Aug 04 2017 09:40
@dauletmyrzan as far as i know fundingstartblock is used to set a block which will serve as the starting point for your funding, just as an alternative to using clocks, which can be manipulated.
Werner Bogula
@Bogula
Aug 04 2017 09:41
Hi folks, I rewrote the contract samples with require for every throw,and it seems to work. But I am not quite sure. Is there any source for an updated sample, that does not use the depracated error handling?
ENiG87
@ENiG87
Aug 04 2017 09:42
also just picking a fundingstartblock can be random, this randomness is actually wanted, as it makes it harder to manipulate the contract. it may be a little hard to estimate to seconds, but remember: start and end are not the only parameters with which you can influence the timing of your ico.
@Bogula Hello, thank you very much. This will be very much appreciated by everyone here. Where can we take a look?
@Bogula I don't know if there are "nightlys" with solidity, as far as i know throw will be excluded with the next major release
Not quite sure about the use of revert, so it is still experimental
Werner Bogula
@Bogula
Aug 04 2017 10:39
Any ideas for an Android Wallet where I can follow self created coins like the watch function in Etherium Client?
pirokars
@pirokars
Aug 04 2017 13:31
Hello guys, the same question like yesterday.
I have a problem with cryptocurrency transaction .
I did a transaction from the Polonix exchange to my Ethereum wallet, but it was being (Rinkeby - test network).
Tell me what I need to do to get my money back?
Thank for you attention.
Help me find a solution or tell someone to contact to get an answer for my question
ulusali1
@ulusali1
Aug 04 2017 14:31
i somehow cant not download mist etherum wallet to my ipad
any sugggestions on alternative etherum wallets
?
phalexo
@phalexo
Aug 04 2017 17:28
A general question about deployment. To interact with any custom token any interested parties need to know the token contract's address and its public ABI. So how does one normally go about disseminating, publishing this information? Simply putting it on some website is probably as effective as putting a billboard in the middle of a desert.
I have been able to successfully deploy a modified contract to rinkeby and interact with it myself, but that last step about how to let people know about it escapes me. Thanks for info, ideas.
phalexo
@phalexo
Aug 04 2017 17:34
@pirokars I think they warn you about this everywhere. Your coins are probably lost.
pirokars
@pirokars
Aug 04 2017 17:40
so good(. But why if you transfer money to a non-existent wallet the money does not return to the back(((
?
phalexo
@phalexo
Aug 04 2017 18:10
There is no way to know that the account does not exist, is there? To create the transaction you must have copied the wrong address and pasted it into the recipient's account address field.
It is pretty much the same situation as if it was a real account but you lost the private key /passphrase.
phalexo
@phalexo
Aug 04 2017 21:26
I have an idea for you to try, @pirokars . 1) Get an account number to which you transferred the coins by connecting to "mainnet" and looking up the transaction associated with that transfer. 2) Verify the recipeint account number matches your "rinkeby" testnet account number. If it matches 3) empty the account on "rinkeby" testnet so that it is 0 (it may not even matter, but can't hurt. 4) From the info you have about your "rinkeby" account get the private key. 5) Attempt to import that account (using the private key) into an Ethereum wallet that is connected to the MAINNET. The blockchain on mainnet considers that account real, and may synchronize the balance for you.
6) come back here and tell me what happens.
pirokars
@pirokars
Aug 04 2017 21:34
Thenk you so much for your advice, I'll try.
phalexo
@phalexo
Aug 04 2017 21:56
p.s. You seem to be confusing wallets and accounts. Not the same thing, a single wallet may contains many accounts, @pirokars
pirokars
@pirokars
Aug 04 2017 22:19
Sorry, but I do not understand how this works.
When I switch rinkeby to mainnet, I do not have a master account. First, do I need to create a new master account?
The problem is I have a bad English skill( Sorry!
phalexo
@phalexo
Aug 04 2017 22:19
You may not even have to get the private key. You could probably just try importing the account from its encrypted file, it will ask you for your passphrase. I don't believe balances are stored in those files. Look for the encryped file in the rinkeby/keystore folder, @pirokars
Yes, create the main account, and then try to import the rinkeby account.
pirokars
@pirokars
Aug 04 2017 22:28
I found my Utc file and pressed to import the account, what should I do next?
phalexo
@phalexo
Aug 04 2017 22:31
When you created the master account, it also created a similar file. You imported the the one from rinkeby folder, right? So, what happened? Can you see the account in Ethereumwallet?
phalexo
@phalexo
Aug 04 2017 22:36
Did you verify that the account number to which you had sent money is the same as your rinkeby account?
pirokars
@pirokars
Aug 04 2017 22:38
yes, imported the one from rinkeby, and now i am have two master account in mainnet.
and key nomber is same (rinkeby key=mainnet key)
phalexo
@phalexo
Aug 04 2017 22:43
No big problem, so you have two. :-) The one that you imported from rinkeby it shows zero balance?
pirokars
@pirokars
Aug 04 2017 22:43
yes 0
(
phalexo
@phalexo
Aug 04 2017 22:45
Did you find the transaction that you did from the exchange? And check the address?
Check that the the account address on mainnet is identical with the rinkeby one. Also, is your blockchain on mainnet up to date.
You need to find the original transaction to verify where you sent the coins.
phalexo
@phalexo
Aug 04 2017 22:50
What was the name ? Polonium?
pirokars
@pirokars
Aug 04 2017 22:51
I have a second problem)
My client does not want to update normally, loads only a few chunks of blocks and hangs.
I think I need a day to authorize all the etherums nods.
Poloniex
phalexo
@phalexo
Aug 04 2017 22:52
WHat client are you running?
pirokars
@pirokars
Aug 04 2017 22:54
Ethereum node needs to sync, please wait
this one
phalexo
@phalexo
Aug 04 2017 22:54
is it geth, or eth ot something else?
Can you get back on Poloniex and look up the transaction?
pirokars
@pirokars
Aug 04 2017 22:58
yes one sec
phalexo
@phalexo
Aug 04 2017 22:59
I am running geth, took me about 1.5 days to sync. Initially also had issues.
pirokars
@pirokars
Aug 04 2017 23:05
ok i have address same like in my master account mainnet
and i have Txid
phalexo
@phalexo
Aug 04 2017 23:07
The recipient address is the same? Awesome. If it works at all, then your problem is just to sync up the blockchain now.
Assuming you are REALLY on mainnet and not rinkeby. :-)
pirokars
@pirokars
Aug 04 2017 23:09
yes my friend) mainnet
phalexo
@phalexo
Aug 04 2017 23:09
You own the account now, to which youy sent the coins..
Assuming you able to unlock it with your passphrase, just sync up and hope your money is there.
p.s. If you get the money back, you may want to move it to the second main account account.
pirokars
@pirokars
Aug 04 2017 23:37
I am traying to unlock my account using myetherwallet.com, but i don't understand, where can i find my passphrase for my new account?
or how it's works?
phalexo
@phalexo
Aug 04 2017 23:38
It should be the same passphrase you used fowhen you set up the account on rinkeby.
if the same password/pssphrase does not work, nothng will help you.
pirokars
@pirokars
Aug 04 2017 23:40
But Rinkeby did not ask for any secret phrases
aaa ok password
phalexo
@phalexo
Aug 04 2017 23:42
When yoyu created your account it should have asked . I set up a passphrase when I started an account on rinkeby.
pirokars
@pirokars
Aug 04 2017 23:44
no one just password, i created in ethereum wallet client
phalexo
@phalexo
Aug 04 2017 23:44
The unlocking is temporary anyway, to do a transaction or run a contract.
You used 1 word, I used a long sentence.