clojure-nl

Companies working with Clojure in The Netherlands: https://docs.google.com/spreadsheets/d/1NzOqY1v-OReB1IquUgHuT3Kh8K8jhPdlwBM6ds7id6Y/edit?usp=sharing
Mno 2020-10-02T07:44:28.009200Z

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

Stefan 2020-10-02T07:53:31.009500Z

Good morning!

Stefan 2020-10-02T07:53:58.010Z

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

Mno 2020-10-02T07:55:48.011700Z

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

Stefan 2020-10-02T08:07:34.012200Z

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

Mno 2020-10-02T08:08:37.013300Z

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.

Mno 2020-10-02T08:08:47.013600Z

ERC20 tokens in particular at least

Stefan 2020-10-02T08:14:36.019100Z

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.

Stefan 2020-10-02T08:15:26.019800Z

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.

Stefan 2020-10-02T08:17:02.021700Z

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.

Mno 2020-10-02T08:18:10.022600Z

I guess that sorta makes sense..

Stefan 2020-10-02T08:18:39.023400Z

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

Mno 2020-10-02T08:19:18.023900Z

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”

Mno 2020-10-02T08:20:28.024800Z

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

Mno 2020-10-02T08:21:57.025700Z

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

Stefan 2020-10-02T08:22:08.026Z

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

Stefan 2020-10-02T08:22:26.026700Z

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

Mno 2020-10-02T08:22:40.027Z

I didn’t make the contract

Mno 2020-10-02T08:22:58.027400Z

It’s a sablier stream contract

Stefan 2020-10-02T08:23:55.027900Z

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

Stefan 2020-10-02T08:26:48.029300Z

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.

Mno 2020-10-02T08:27:16.029900Z

It’s certainly better than my random guessing

Mno 2020-10-02T08:27:43.030400Z

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

1👍
Mno 2020-10-02T08:28:37.031100Z

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

Mno 2020-10-02T08:39:48.031800Z

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

Mno 2020-10-02T08:39:53.032Z

Thanks mate!

borkdude 2020-10-02T08:41:10.032200Z

Mogguh!

borkdude 2020-10-02T08:41:49.032600Z

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

Stefan 2020-10-02T08:41:49.032700Z

You’re welcome @hobosarefriends my pleasure!

Stefan 2020-10-02T08:42:01.033Z

No worries, it seems we were just done 🙂

Stefan 2020-10-02T08:43:04.033300Z

And good morning to you too 🙂

Stefan 2020-10-02T08:44:12.034700Z

@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.

borkdude 2020-10-02T08:45:30.035600Z

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

Stefan 2020-10-02T08:46:43.036700Z

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

Stefan 2020-10-02T08:47:15.037300Z

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

borkdude 2020-10-02T08:48:07.038100Z

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

Stefan 2020-10-02T08:48:36.038600Z

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

borkdude 2020-10-02T08:50:55.039400Z

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

Stefan 2020-10-02T08:53:45.040100Z

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.

borkdude 2020-10-02T08:54:14.040500Z

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

Stefan 2020-10-02T08:54:32.040900Z

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

thomas 2020-10-02T11:43:35.041100Z

mogge

gklijs 2020-10-02T11:51:29.042600Z

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