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
@DanielMReed like I say, check out the bytecode on the blockchain and see which site matches
Daniel
@DanielRX
It's the verification that is failing, seems the bytecode is the same but the opcodes vary is all for that side
Jim McDonald
@mcdee
@DanielMReed Verification is very dependent on solidity version, optimisation and unfortunately bugs in the way that referenced code is imported. If you are pulling in any imports from outside of your immediate tree that might be part of the problem
phalexo
@phalexo
@mcdee The tricky part about upgrading one standard to another is what happens with data stored in state variables, and whether the storage structure changes. If a new standard 's changes are "orthogonal" to the old one it should be relatively easy.
Jim McDonald
@mcdee

@phalexo with most of the proposed standards the changes are orthogonal, yes. Anything that isn't you could plan for in advance if you think that it's at all a likely outcome.

In my ERC-20 contracts I have a separate storage contract for token balances but allowances are in the ERC-20 contract. If I upgrade to a contract without allowances (or without the same way of doing allowances) I can just drop the existing ones with the old contract and set something new up on the new contract. Plus, there's no reason why you couldn't leave the ERC-20 contract in place and have multiple contracts access the same token store

Daniel
@DanielRX
@mcdee See I know that, but none of those apply, the source is open, 0 imports, same version, same optim
Jim McDonald
@mcdee
@DanielMReed try compiling locally and checking the bytecode perhaps?
Jasvir Singh Grewal
@jasvir99
hi there. I was looking on qtum erc20 token and observed some strange addresses. https://etherscan.io/token/0x9a642d6b3368ddc662CA244bAdf32cDA716005BC#balances
can anyone please explain me, what are those?
Jim McDonald
@mcdee
@jasvir99 given that the contract doesn't list those as special cases I'd guess they were burn addresses (or programming mistakes)
Daniel
@DanielRX
Looks like burn (0x22222... 0x33333.... etc)
But aren't burns meant to transfer to 0x0?
ethernian
@ethernian
@DanielMReed: originally token "burning" is just reducing an account's balance without increasing some other account's balance. Transfer to "burning" addresses (i.e. without known private key) has the same effect, assuming the token are locked there forever.
Natali
@natyscode
Hi all ! What would be the best way to handle an array in solidity with such structure: ["val1":X, "val2":Y, "val3":Z]?
lukas-berlin
@lukas-berlin
@dip239 thats not correct. Burning also adjusts totalSupply. sending to unspendable address doesn´t
ethernian
@ethernian
lukas-berlin: is there any standard for burning tokens?
ethernian
@ethernian
I mean, burning is a nonstandard ERC20 extension anyway and totalSupply adjustments can be implementation dependent.
Personally, I would maintain tokenSupply and tokenInCirculation separately. Pls. correct me if I am wrong.
Jim McDonald
@mcdee
@dip239 if you send tokens to a burn address you should keep totalsupply the same. If you destroy them you should reduce totalsupply. Basically, the sum of all holdings should equal totalsupply
cheetah1295
@cheetah1295

Hi guys, I have a serious problem when using Remix IDE. I use Javascript VM to test my code . when I use an account to test it the address of the account is not the same as msg.sender
My code is about organising an election and for this function:

function presentyourself(address a){
require(addvoters[msg.sender].adr == a);
candidates[addvoters[msg.sender].index].cur = true;}

addvoters is a mapping : mapping (address => Voter) public addvoters;
and Voter is the structure representing a voter
cur is a boolean indicating if he presented himself as candidate or not

I need the msg.sender to be the same as the address of the account ( for more security) but it is not the case... any thoughts ?

_

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