by

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
jimeejones
@jimeejones
i think this means its bedtime, might be something wrong with the testnet everything was fine before. although my contract never did show at the address. maybe i just came here to scam you out of 1 fake eth?
Alex Fisher
@alexfisher
lol
Try BTC back to me? :-)
jimeejones
@jimeejones
hahahaha
Alex Fisher
@alexfisher
night
jimeejones
@jimeejones
@ me if you hear of anything about test net issues if you can :D thanks mate , night. Go Denver.
Alex Fisher
@alexfisher
no problem
jimeejones
@jimeejones
fyi - i just suicide that addr. night.
Alex Fisher
@alexfisher
Christoph Mussenbrock
@christoph2806
Are there any eclipse Plugins for solidity/contracts development?
jimeejones
@jimeejones
@alexfisher thanks I will look later today what is going on. Might even send you back 1 test ETH ;) if you are lucky.
jimeejones
@jimeejones
@kieranelby could you tell me a little about how you deploy your Dapp to a webserver? As in what requirements are there on the web host, did you use AWS, or some other cloud based host? I know node.js is required.. If you could provide any information or links that would be great!! :)
JohnDorien1
@JohnDorien1
Is this code from the coin example actually automatically called on every new block? And does this cost the contract to execute?
function claimMiningReward() {
    if (miningReward[block.number] == 0) {
      coinfractionOf[block.coinbase] += 1;
      miningReward[block.number] = block.coinbase;
    }
  }
If it's automatically executed, I assume it can be easily modified to be used as a timer in a contract..?!
Kieran Elby
@kieranelby
Hi @jambtt , web hosting requirements for my DApp are very basic - it's all just static JS + HTML (files in https://github.com/kieranelby/KingOfTheEtherThrone/tree/master/public). No node.js or geth running on the cloud-hosted public webserver VM (which is running ubuntu + nginx).
I have a script written in Javascript (https://github.com/kieranelby/KingOfTheEtherThrone/blob/master/bin/build-public.js) that runs on a local PC (where I do have geth + node.js installed) and regenerates the site static JS + HTML every 10 minutes by talking to my local geth client, then uploads it to the webserver VM and also checks it into github to update the README there.
This is probably a slightly weird way of doing things - I did it this way partly for security (hard to hack a static website!), and partly because I wanted people to be able to see the current monarch + hall of monarchs on the github page (which has to be static, so I knew I'd need to use a site generator for that).
Downside is that the site only updates every 10 minutes - but then the DApp bit of the site can of course talk to the user's geth node and show newer data. I know that quite a few other folks use meteor to build and host their DApps.
DApp hosting is probably a bit off-topic for the solidity chat room though! Back on topic, I still can't figure out why I'm seeing odd behaviour with my contract - can anyone recommend any tools for disassembling the EVM bytecode into something quite readable? e.g. I can see a dump of the opcodes at https://etherscan.io/address/0xb336a86e2feb1e87a328fcb7dd4d04de3df254d0 but it's pretty painful trying to make sense of it without some sort of annotation (e.g. address labels, entry points, constants in decimal, ...)?
Stefan George
@Georgi87
Any idea, why this gives different results, assuming data is bytes32 encoded string "s":
LogBytes1(byte(data)); // prints "s"
LogBytes1(byte(uint(data))); prints "\x00"
chriseth
@chriseth
uintN is right-aligned bytesN is left-aligned
conversion between uintN and bytesN first shortens then changes alignment
Stefan George
@Georgi87
Thank you @chriseth
Nick
@nickmelis
any easy way to convert uint to bytes?
chriseth
@chriseth
@androlo just saw your new solidity tutorial, great stuff, thanks! I would like to talk to you about some details (especially the .= remapping and the "weird" section).
@nickmelis no easy way to convert anything to bytes instead of string
Nick
@nickmelis
@chriseth I re-used the one you wrote for addresses and changed it a little bit
function toBytes(uint256 x) returns (bytes b) {
        b = new bytes(32);
        for (uint i = 0; i < 32; i++) {
            b[i] = byte(uint8(uint(x) / (2**(8*(31 - i))))); 
        }
    }
chriseth
@chriseth
yep, looks good
Nick
@nickmelis
thanks for the review :)
Tjaden Hess
@tjade273
How would you all recommend getting a single bit from a bytes32?
Is uint256(data) / (2**((255-index))) & 0x01 the most efficient way?
chriseth
@chriseth
not from an assembly point of view but I think this is the best you can get with solidity currently
Tjaden Hess
@tjade273
Okay, thanks.
Btw, is there a reason why there isn't syntactic sugar for accessing bytesN via index? Or is it just not implemented yet?
RJ Catalano
@VoR0220
It's currently in a PR awaiting some minor testing additions
Tjaden Hess
@tjade273
Okay, cool
chriseth
@chriseth
oh is it?
argh, damn
I thought nobody looked at it yet because it was still in "pleasereview" :-)
will finish that tomorrow
Tjaden Hess
@tjade273
Another question. The docs say that nested arrays don't work in external functions, but the online compiler doesn't complain. Has something changed, or will it just fail silently?
RJ Catalano
@VoR0220
How are you calling it?
Might need to add a warning there unless @chriseth has modified the EVM unbeknownst to me.
Tjaden Hess
@tjade273
function setPubKey (bytes32[2][256] pubKey) public {...}
RJ Catalano
@VoR0220
hmmmm….
initially I thought this was purely a bytes thing due to the ability to run through an index…but it appears you can do this with ints too
let me try strings…that’ll be the true determinator
ahhhhhhh
so…there seems to be an inconsistency here
if I turn it into bytes (which is equivalent to bytes32) then it throws an error.
@chriseth has something been modified or is this a bug? I got a feeling it’s a bug...