Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 10 2017 22:42
    @jpitts banned @etherchamp1_twitter
  • Jun 05 2016 10:33
    @chriseth banned @adamskee
Jim McDonald
@mcdee

the address of the account is not the same as msg.sender

Not sure what this means. The address of the account that sends the transaction is msg.sender, by definition (unless you are calling one contract from another, but I doubt that you're doing that)

cheetah1295
@cheetah1295

image.png

I'm simulating the elction by trying multiple accounts ( which play the role of the voters )

My code continues here
image.png
Jim McDonald
@mcdee
What is a in presentyourself()?
cheetah1295
@cheetah1295
It is a variable representing an address
Jim McDonald
@mcdee
But what does the address represent?
cheetah1295
@cheetah1295
It is supposed to represent the adress of a voter who wants to present himself as a candidate
Let me explain in more details :
When the owner has authorized a voter ( by authorizing his address) I can change the account ( at the right) to simulate the fact that this authorized voter wants to present himself as a candidate, so the account (linked to the authorized voter) will execute the function presentyourself in order to present himself as candidate at the election
Jim McDonald
@mcdee

the adress of a voter who wants to present himself as a candidate...so the account (linked to the authorized voter) will execute the function presentyourself...

Surely that should be msg.sender then rather than an (arbitrary) function parameter

cheetah1295
@cheetah1295
you mean : I should replace a by msg.sender ?
Jim McDonald
@mcdee
Sounds like it, although you then need to re-evaluate the function as it will use msg.sender twice in your require()
cheetah1295
@cheetah1295
But what should be the argument of the function then ?
and what is wrong with using msg.sender twice in require ?
Thank you very much
danieljoonlee
@danieljoonlee
has anyone used truffle-contract and truffle-hdwallet-provider together for an API?
im running into issues trying to set methods on the smart contract from a nodejs server or if anyone knows a good resource im all ears
Jim McDonald
@mcdee
@cheetah1295 you should take a step back and be clear on exactly who does what. You cannot use addresses passed as parameters as part of checking authorisation because any user can pass any address. msg.sender should be used exclusively to check authorisation.
cheetah1295
@cheetah1295
@mcdee when I change my function the requirement in require is false because the msg.sender has not the same address as the account ( and I execute the function with the account in question)
image.png
if you see at the right the account that execute the function is supposed to be a voter the owner added
however, it seems that ( the addvoters[msg.sender].adr == msg.sender) is false , but the 2 addresses are supposed to be the same ( this is what I want to have actually)
Dillon Vincent
@dillonsvincent
Daniel
@DanielRX
@cheetah1295 use "" around an address
Gernot Pokorny
@gernotpokorny
hello
I'm currently starting to learn solidity
Can somebody explain me where the satte of a state variable is stored?
is it stored on the blockchain or on the RAM of the node?
Gernot Pokorny
@gernotpokorny
Can somebody tell me when the contract is compiled to bytecode and is on the blockchain how can somebody verify what the smart contract code is and check where he wants to use the smart contract or not?
Is it necessary to include the source code somewhere + compiler information? Does this then deterministically compile everytime to the same bytecode?
Manish Ranjan
@bit-warrior
@gernotpokorny state of state variable is saved into state trie/tree. its not saved in RAM of node , it goes in blockchain datastore.
SkyClean
@SkyClean
Hello
I have Error: gas required exceeds allowance or always failing transaction when creating smart contract on remix.
Gernot Pokorny
@gernotpokorny
@bit-warrior what is meant with blockchain datastore? It is part of the blockchain?
SkyClean
@SkyClean
please give me tips
how to make contract with avoiding gas exceeds?
@gernotpokorny smart contract will be saved on blockchain.
Gernot Pokorny
@gernotpokorny
@SkyClean what is this datastorage?
Manish Ranjan
@bit-warrior
@gernotpokorny
Like for Geth, all the data related to the blockchain are saved in levelDB in form of different tries, like transaction trie, state tries, transaction receipt trrie. Level db is key-value database developed by Google.
SkyClean
@SkyClean
@bit-warrior can you give me some tips?
Gernot Pokorny
@gernotpokorny
@bit-warrior Ok so that means something like variable-states are generated by the txs and stored on the harddrive of the node. Once a new tx comes in the db on the harddrive of the node gets modified. So erc20 tokens are essentially stored in a database on the node?
Manish Ranjan
@bit-warrior
@SkyClean where are you deploying ur contract local EVM or a outside network?
Manish Ranjan
@bit-warrior
@gernotpokorny ecr tokens are contract to hold assets(something xyz coin) . So for example, u own 100 xyz coin at an ethereum address , this fact that you own 100 coin would be stored in the state trie, but ability to spend it will be controlled private key that hold.
Gernot Pokorny
@gernotpokorny
@bit-warrior ok and it is stored in thos levelDB? The blockchain is it also a db or does the blockchain consist of simple txt files?
SkyClean
@SkyClean
@bit-warrior I"m deploying contract to rospen test Net
with metamask
Gernot Pokorny
@gernotpokorny
On the blockchain contracts are stored as binary code?
Manish Ranjan
@bit-warrior
@gernotpokorny I have not seen anywhere in Ethereum specification any kind of recommendation about saving data in db vs file system. As long as you comply to the data structure recommended by specification , i guess u can choose to save anywhere you like.
Gernot Pokorny
@gernotpokorny
@bit-warrior I mean how does the geth implementation store the blockchain?
Manish Ranjan
@bit-warrior
Geth uses leveldb
Parity i guess uses Rocksdb
SkyClean
@SkyClean
@bit-warrior I"m deploying contract to rospen test Net
with metamask
but the contract has some big code amount.