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
Lauri Peltonen
@microbecode
so just check the past transaction logs to see which events have been emitted
GreatYoungShaw
@GreatYoungShaw
oh thank you
Lauri Peltonen
@microbecode
np
Khuram Shahzad
@KhuramS11116070_twitter
hi
J
@yubrew
Hello all, I'm wondering if there's a current example (ideally in production) of a dividend token, where eth is split across many token holders?
Christopher
@csplawn918
These all consist of growing pains . Clearly time will heal all Kat errors .
Rahul Soshte
@rahul-soshte
I want to have a token with a infinite supply while decreasing rate of inflation every X number of blocks.How do I do that?
Lauri Peltonen
@microbecode
while decreasing...what?
AKSHAY V G
@akshayvg1133_gitlab
hi what is the necessity of mapping in solidty? i couldnt understand how it works and how one can use mapping
Lauri Peltonen
@microbecode
you don't need to use it. it's just another data structure. it's basically a list which has extra indexes for the first value
Lauri Peltonen
@microbecode
(that is actually a pretty lousy explanation...)
jacekv
@jacekv
@akshayvg1133_gitlab It is like a dictionary or map (depending on language). You have a key which points to a value (key => value).
Example:
map = {
a : 5,
b: 10
}

map[a] => 5
map[b] => 10
Andrew Redden
@androolloyd
This message was deleted
Rahul Soshte
@rahul-soshte
how do I hard fork my token?
Shalu
@shalu0628
hi, new bie here.. Is it possible to retrieve all the array values from a struct in Solidity in Remix itself?
Eric
@efalken
If I have a dynamic array, like "bytes32[] mylist", currently with 4 items, then "mylist.length" equals 4. I saw some code where "mylist.length--" was used to truncate this array by one, so that this would delete the last item in the array, leaving the first 3 items. That makes sense, but I have not seen anything written about it in the documentation, and would like confirmation that this is what is happening (eg, it could be that only the attribute 'length' was affected).
Alex Coventry
@coventry
I'm getting TypeError: Member <methodname> not unique after argument-dependent lookup in contract. There is definitely no explicit collision in the contract or any contracts it inherits from. Can this be caused by a collision in the function selectors? Is there an easy tool which will extract the function selectors for me?
Eric
@efalken
Is it worthwhile to create a separate uint variable for the number of items in an array? For example, I could access the length of a dynamic array via "mylist.length", but also with a variable that incremented when items were added, eg 'numberInList". Is there any memory or other problem created by just accessing "mylist.length"?
Eric
@efalken
Just a Public Service Announcement that mylist.length is much more expensive to call, so if you can afford the extra variable and use it a lot, it will be a lot cheaper. Accessing the length of a 5-dimensional array 10 times costs about 20k gas using the .length method, but only about 0.7k when you assign it to a variable.
Lauri Peltonen
@microbecode
Even if it might be cheaper (you have to calculate also the cost of incrementing the variable etc) it's a big possibility for an error once you forget to increment it or so. It's probably not worth the risk, especially as contracts should always be as simple as possible
AKSHAY V G
@akshayvg1133_gitlab
@jacekv thanks for the help! :-)
jacekv
@jacekv
@efalken Here you have the information about the mylist.length member https://solidity.readthedocs.io/en/v0.5.10/types.html#array-members
@akshayvg1133_gitlab You are welcome :)
Condor
@oijae05wncKMiSv_twitter
Hi there, I am not a developer, content writer, so my question may seem dumb, but still: here are some examples in inline assembly usage https://solidity.readthedocs.io/en/v0.5.3/assembly.html. Can the code from examples be rewritten in plain solidity without assembly? If yes, are there any examples of conversion?
jacekv
@jacekv
@oijae05wncKMiSv_twitter
Sure you can.
mul(1, add(2, 3)) => example: uint a = (2+3) * 1;
Condor
@oijae05wncKMiSv_twitter
Thanks a lot! is there any reference guide to the purpose or whatever)?
Condor
@oijae05wncKMiSv_twitter
Thanks a lot, I expected no answer in the first place)
jacekv
@jacekv
You are welcome :D
Eric
@efalken
@jacekv Perfect. I wish the Solidity docs had a better search algorithm. Sometime deferring to Google's search is better, in that they actually weight results, while the search box on the Solidity Docs site seems to merely look for keywords regardless of relevance.
Eric
@efalken

@microbecode It's a little scary, but Solidity can't afford the many redundant checks we are used to. So if the only places where dynamic arrays are changed have the counter adjusted accordingly, I do not see how these could become out of sync. For example:

mylist.length--;
mylistlength--;

mylist.push(id);
mylistlength++;

salihu24
@salihu24
Hello guys
Please I have no programming experience, is it possible for me to learn solidity?
Lauri Peltonen
@microbecode
sure it is possible, but it's not the easiest language to start with
salihu24
@salihu24
OK please advise me how do I go about it?
Although I started Java but dropped it
Lauri Peltonen
@microbecode
umh. I'm not sure if there are guides for Solidity with zero coding experience. you should start with some other similar simple language, such as JavaScript which has plenty of beginner guides
salihu24
@salihu24
Like wise python and Java scripts
Lauri Peltonen
@microbecode
well, start with any of those basic languages. any of those will do
learn data structures, loops, variables, all the basics
salihu24
@salihu24
Well to say the fact I have some ideas about these
I even did a nano degree for android development for beginners
But it's been long
About two years back
Schalk Dormehl
@sjalq
@chriseth or any of the other Jedi;
Is there a specific edge case that would cause a transaction to revert when pushing a struct to an array of structs?
        simple memory s = simple({
            a: 1,
            b: 2
        });
        simples.push(s);
Lauri Peltonen
@microbecode
running out of gas?
static array size?
Schalk Dormehl
@sjalq
No static size is specified.
Schalk Dormehl
@sjalq
It also doesn't indicate that this is due to gas. Everwhere i've run it says it reverts.