These are chat archives for ethereum/tutorials

27th
Oct 2017
SRLB
@SRLB
Oct 27 2017 00:06
Hey guys, Im new to cryptocurrencies and my mind has literally been blown from what I've been reading.
kTweaks
@EricLegend
Oct 27 2017 00:06
:boom:
SRLB
@SRLB
Oct 27 2017 00:06
It's just so interesting
kTweaks
@EricLegend
Oct 27 2017 00:06
yeah it's def a crazy tech
SRLB
@SRLB
Oct 27 2017 00:07
And just starting to understand the possibilities of Ethereum
Profound
Bung
@bung87
Oct 27 2017 05:52
has anyone successfully run the example contract sell function? as so far I have created a contract base on the example and use a account buy some tokens,transfer tokens,set Prices all be done
Steve
@swatarianess
Oct 27 2017 05:53
which example contract sell function?
Bung
@bung87
Oct 27 2017 05:53
https://www.ethereum.org/token this official site
Steve
@swatarianess
Oct 27 2017 05:56
okay, i did not understand the question. Are you asking if the sell function works or if anyone has used it before?
To answer both, yes. :p
Bung
@bung87
Oct 27 2017 05:57
I use web3.eth.sendTransaction to start a transaction like other process,after mining does not see any changes,for example the account I want to sell token still keep 10 tokens I just bought.
I want to check the sell function works
Steve
@swatarianess
Oct 27 2017 05:58
if you want to check the sell function works, you need to interact with the contract instance, in particular with the sell function
Bung
@bung87
Oct 27 2017 06:01
as so far I known to change data in blockchain should use sendTransaction ,contract instance .sell does not affect the block chain
Steve
@swatarianess
Oct 27 2017 06:02
the sell function does in fact change state in the blockchain.
modifying the amounts in the mapping balanceOf
Bung
@bung87
Oct 27 2017 06:04
hmm ,If I call sell directly on contract instance ,then what is the msg in the function body?
eg. msg.sender is who
Steve
@swatarianess
Oct 27 2017 06:05
msg.sender is the account that called the function
the account currently interacting with the contract instance
Bung
@bung87
Oct 27 2017 06:08
I' m confused,the code "contractInstance.sell()" does not contains any account info,you meaning the currently unlocked account ?
Steve
@swatarianess
Oct 27 2017 06:09
The currently account that is unlocked and sent the transaction to the contractInstance
Bung
@bung87
Oct 27 2017 06:10
ins.sell(10)
Error: invalid address
Steve
@swatarianess
Oct 27 2017 06:10
the whole contractInstance itself "internally" has data on the account interacting with it
from what i have found msg.sender & msg.value
Bung
@bung87
Oct 27 2017 06:12
so I just cant call sell directly on contract instance
Steve
@swatarianess
Oct 27 2017 06:12
you should be able to sell directly on contract instance
Bung
@bung87
Oct 27 2017 06:12
but sendTransaction yet not work out,That`s my question
Steve
@swatarianess
Oct 27 2017 06:13
have you tested out your code in Remix?
Bung
@bung87
Oct 27 2017 06:14
yes,just got two warnings
Steve
@swatarianess
Oct 27 2017 06:15
what were the warnings?
Bung
@bung87
Oct 27 2017 06:16
Gas requirement of function browser/ballot.sol:MyAdvancedToken.sell(uint256)unknown or not constant.
MyAdvancedToken.MyAdvancedToken(uint256,bytes32,bytes32): Potentially should be constant but is not.
Steve
@swatarianess
Oct 27 2017 06:17
not sure about the 2nd warning, but with the first one i get for a few of my functions
Bung
@bung87
Oct 27 2017 06:20
The contract I created just the short version of official example,as It just warning level message I think it does not matters the contract development
any idea about my question?
Steve
@swatarianess
Oct 27 2017 06:23
hmm looking at the contract example code
you bought enough tokens to sell with the currently unlocked account, correct?
Bung
@bung87
Oct 27 2017 06:26
ins.balanceOf myaccount is 10,the transaction I want send data is ins.sell.getData(10)
then I send transaction with from myaccount address to contract instance address with the data above
Bung
@bung87
Oct 27 2017 06:33
and the contract instance contains 20 wei,and the price for sell is 1,10 tokens just costs 10 wei
Steve
@swatarianess
Oct 27 2017 06:34
and when you do that you get an invalid address error?
Where did you deploy the contract? Testnet ?
Bung
@bung87
Oct 27 2017 06:34
no , invalid address just occurs when I call ins.sell(10),
transaction result like other transaction returns,I deploy it on private network
N-B-V
@N-B-V
Oct 27 2017 07:51
Hi there, how can i connect a UI to my crowdsale contract that will display all the relevant info of my crowdsale to a user going to my site? ie. number of tokens available, token price, amount raised, ect... i cannot find a guide on how to do it anywhere.
N-B-V
@N-B-V
Oct 27 2017 08:12
So after asking my question if figured it out :) --- etherscan.io sees all public tokens and have API's to interact with them. just incase anyone was wondering.
eddie2024
@eddie2024
Oct 27 2017 11:28
manu4github
@manu4github
Oct 27 2017 13:40
can any one suggest me how to build smart contract more cost efficiently ?
manu4github
@manu4github
Oct 27 2017 13:46
i have a question if 100 transactions were called for my contract from 100 different people , is there any way to build cost efficiently, like sending multiple transactions in one transaction.
Eric Tsang
@Ectsang
Oct 27 2017 16:34
is there any source to get testnet (ropsten) ether sent to my testnet address? or do i have to ask ppl to give each time?
my mist wallet seems to be stuck on 99%
phalexo
@phalexo
Oct 27 2017 16:36
@Ectsang There is a testnet ether faucet for both Ropsten and Rinkeby. Google for it.
Eric Tsang
@Ectsang
Oct 27 2017 16:39
thank you @phalexo
Eric Tsang
@Ectsang
Oct 27 2017 16:49
Any idea why ropsten takes so long to sync @phalexo ?
macOS (latest), UTC+8, 16GB
alexvorb45
@alexvorb45
Oct 27 2017 17:32
how can i make a smart contract to send to multiple accounts at once?