I've created a voting game on eth blockchain. I would like to make a function, that only address with previous transaction history(not a fresh address) can call. So doesn't allow people to create a fresh account to upvote their favour project.

Feel free to check the game out -> https://www.youtube.com/watch?v=3Q7dwniXz_Y

  • Would it be enough for you to inquire to the account's balance? Any account with a balance would ipso facto have had at least one transaction. – Motoma Oct 15 '18 at 20:47
  • yeah that could work as well, ideally, this would work along tx history – Damian Klepacki Oct 15 '18 at 21:08

No, it is not possible directly.

Here is an example how you can make it possible https://stackoverflow.com/questions/43635485/smart-contract-blockchain-history#answer-43649217


Thanks, @Aquila.

I get the impression from the question that you're after addresses with an established history (n months old) and not necessarily a history with your own contract.

This is probably not impossible to fish out of the blockchain using assembly but it certainly wouldn't be easy unless someone has a nifty trick to discover the block.number of the first transaction ever signed by msg.sender. I don't.

I'm not sure it's a great idea. Shouldn't the goal be to limit voting to real constituents (actual players?) in proportion to their stake? More like a whitelist or one token, one vote?

Have you considered quadratic voting? Maybe there should be a small refundable deposit held in escrow to increase the temporary cost of participation. That would increase the cost of casting large numbers of votes (as well as gas cost).

Hope it helps.

  • You right, nothing stops someone to write his own front end that has no web3 check of transaction history and fake vote it, or even just use remix to call function directly, though there is some solidiy way of doing it, but only solution I can find is to irritate through block and find transaction which is not ideal. Will have to look for other solution – Damian Klepacki Oct 15 '18 at 19:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.