Fork me on GitHub
#clojure-nl
<
2020-10-02
>
Mno07:10:28

mornin’ been looking into cljs and crypto stuff for an assignment, and boy is that stuff complicated.

Stefan07:10:31

Good morning!

Stefan07:10:58

@hobosarefriends Is there a specific part that you find complicated?

Mno07:10:48

In ethereum networks they have tokens which I’m having a hard time understanding the point of

Stefan08:10:34

Which tokens do mean? Not the coins I’m assuming…

Mno08:10:37

That’s the part that’s confusing me… I’m not what they are. From what I’ve read so far it’s like casino chips for some reason, intermediate transaction currency type thing.

Mno08:10:47

ERC20 tokens in particular at least

Stefan08:10:36

Well, originally there was only one, the “ether”. It was (and still is today) meant to pay for the cost of running the network. In other words: if you want to do transactions on Ethereum, you have to pay for those. The cost of the transaction is expressed in “gas”, and you pay for gas using those “ethers” that you have to buy (using real money). People quickly realised that they could, same as ether, easily create special-purpose-money for their own applications. And then it became a bit perverted because it was used as an investment tool: you would launch a new idea that involves Ethereum, you would create a token for that idea, and convince people to invest in your idea by selling them your token. This is what they call the ICO: “initial coin offering” (coin being another word for token). ERC20 is just a standard around tokens to get some interoperability.

Stefan08:10:26

It was amazing how easy it was to create your own token and collect loads of money a few years ago. I think (and hope) this has become a lot more difficult by now.

Stefan08:10:02

Another way of looking at tokens is similar to gift cards. You can buy a gift card using real money, and then that gift card is only usable for a specific purpose. If the shop decides to stop accepting them or change the value or conditions or whatever, they can do that. Not so with real money.

Mno08:10:10

I guess that sorta makes sense..

Stefan08:10:39

More than “sorta” you’re not going to get from me, because I believe it doesn’t make too much sense myself. 🙂

Mno08:10:18

Well I thought I needed a specific token to pay for gas because I kept getting an error that said: “gas required exceeds allowance (10000000) or always failing transaction”

Mno08:10:28

but I should have more than enough if I work with rinkeby’s standard ethereum

Mno08:10:57

oh no I can’t, because the thing I’m trying to do is funded by ERC20 tokens

Stefan08:10:08

Usually that means that there is a bug in the contract so that it has maybe an infinite loop or something?

Stefan08:10:26

(as in: usually when you’re programming your own smart contract)

Mno08:10:40

I didn’t make the contract

Mno08:10:58

It’s a sablier stream contract

Stefan08:10:55

Then maybe there is something wrong with the data that you’re putting into the contract?

Stefan08:10:48

The amount of gas needed for a transaction corresponds to the amount of computation needed to execute the smart contract. If it says it needs that much gas, something is wrong. So either there is a bug in the contract, or you’re giving it data that causes it to misbehave. Those are the options that I can think of at least.

Mno08:10:16

It’s certainly better than my random guessing

Mno08:10:43

for now I’m managed to get a token I can mint, so that works.

👍 3
Mno08:10:37

I guess I’ll lower the deposit amount.. and reduce the time I suppose.

Mno08:10:48

With your insight I got it to work, but only with a ridiculous amount of that secondary token

Mno08:10:53

Thanks mate!

borkdude08:10:49

Oh I'm sorry, I barged into a conversation ;)

Stefan08:10:49

You’re welcome @hobosarefriends my pleasure!

Stefan08:10:01

No worries, it seems we were just done 🙂

Stefan08:10:04

And good morning to you too 🙂

Stefan08:10:12

@borkdude Now that we’re both here: I was wondering if you ever considered generating not only issue reports in CLJ Kondo, but also fixes. In editors it would be nice to have things replaced automatically, e.g. deleting unused imports, changing if to when when possible, etc.

borkdude08:10:30

That's not something clj-kondo will support for now, I leave that up to editor tooling. Clj-kondo reports the locations and also supports analysis output which some tools already leverage to rewrite code. E.g. https://github.com/borkdude/carve

Stefan08:10:43

Right so if I understand correctly then Kondo already reports how things could be done differently on its API (in an auto-processable fashion)?

Stefan08:10:15

I’m writing a VSCode plugin that does this based on Kibit, that’s why I was thinking about Kondo as well.

borkdude08:10:07

yeah, the plugin could pick up on clj-kondo's output. Maybe take a look at carve how it does that. Calva also uses clj-kondo's analysis output

Stefan08:10:36

Yeah I know but I want not just the warnings, also the auto-fixing 🙂 Thanks for the pointer, I’ll look into it!

borkdude08:10:55

Maybe you can contribute your things to Calva at some point, would be cool to have one editor plugin that does it all

Stefan08:10:45

Definitely, that is my intent indeed. For now I’m doing it in isolation to keep it simple, but I certainly hope that it ends up being a part of Calva.

borkdude08:10:14

Since Calva already uses clj-kondo I don't think they will mind :)

Stefan08:10:32

No I already talked to them about it and they are all for it 🙂

gklijs11:10:29

👋 middag, watching the ‘event-driven microservices conference’ really the AxonIQ conference. Might be nice to use with Clojure as well.