Giter Club home page Giter Club logo

Comments (26)

ryanarndtcm avatar ryanarndtcm commented on June 14, 2024 5

Hello! We are excited to share that your grant application is approved!

The agreed upon milestones are
October 15th for Proof of Concept ($1000)

  • Compiles the trivial counter.clar example and tutorial code into EVM bytecode.

October 22nd for Prototype ($1000)

  • Compiles two of the Clarity contracts showcased in friedger/clarity-smart-contracts into EVM bytecode.

November 5th for Minimum Viable Product ($3000)

  • Compiles many or most of the Clarity Hackathon contracts (with minimal changes for porting to Ethereum) into usable EVM contracts.
  • Published user documentation.
  • Released as pre-built binaries for Windows, macOS, and Linux.

The next step will be to send you over a contract so we can disburse payment at the given milestones, please email [email protected] with your contact information.

Thank you!

from grants-program.

artob avatar artob commented on June 14, 2024 4

@ryanarndtcm @blocks8 @RaffiSapire Ahead of schedule, I have today completed M1 and released Clarc 0.1.0, a proof-of-concept that's able to compile the Clarity counter.clar example contract into usable Ethereum virtual machine (EVM) bytecode.

Here's a demo screencast of Clarc compiling, deploying, and interacting with this contract on an EVM simulator:

Screencast

Here's the symbolic EVM opcode output from Clarc for this contract:

$ clarc counter.clar -t opcode
PUSH1 0x00 PUSH1 0x00 SSTORE PUSH1 0x64 DUP1 PUSH1 0x10 PUSH1 0x00 CODECOPY
PUSH1 0x00 RETURN PUSH1 0xe0 PUSH1 0x02 EXP PUSH1 0x00 CALLDATALOAD DIV DUP1
PUSH4 0x8ada066e EQ PUSH1 0x28 JUMPI DUP1 PUSH4 0xd09de08a EQ PUSH1 0x36
JUMPI DUP1 PUSH4 0x2baeceb7 EQ PUSH1 0x4d JUMPI STOP JUMPDEST POP PUSH1 0x00
SLOAD PUSH1 0x00 MSTORE PUSH1 0x20 PUSH1 0x00 RETURN STOP JUMPDEST POP
PUSH1 0x01 PUSH1 0x00 SLOAD ADD PUSH1 0x00 SSTORE PUSH1 0x00 SLOAD PUSH1 0x00
MSTORE PUSH1 0x20 PUSH1 0x00 RETURN STOP JUMPDEST POP PUSH1 0x01 PUSH1 0x00
SLOAD SUB PUSH1 0x00 SSTORE PUSH1 0x00 SLOAD PUSH1 0x00 MSTORE PUSH1 0x20
PUSH1 0x00 RETURN STOP

Here's the equivalent deployable EVM bytecode output from Clarc for this contract:

$ clarc counter.clar -t bytecode
600060005560648060106000396000f360e060020a6000350480638ada066e146028578063d09de08a1460365780632baeceb714604d57005b5060005460005260206000f3005b5060016000540160005560005460005260206000f3005b5060016000540360005560005460005260206000f300

The compiler source code can be found at lib/Clar2EVM/compile.ml and the compiler driver (i.e., the clarc program) at bin/clarc/clarc.ml. The EVM bytecode encoder can be found at lib/EVM/encode.ml and the Clarity language parser is maintained in my standalone Clarity.ml library subproject.

So far no blockers on this project, just a ton of work. I'll share this news on the usual media, and then onwards to M2! 🚀

from grants-program.

artob avatar artob commented on June 14, 2024 4

I have today completed M2 and released Clarc 0.5.0, a prototype that's able to compile two more example contracts, panic.clar and kv-store.clar from the friedger/clarity-smart-contracts repository of Clarity contracts. 🚀

As the EVM simulator I've been using doesn't support all opcodes emitted by the compiler, I'm still in the process of figuring out how to best record a screencast demo of interacting with these contracts. While I figure that out, I'll get at least some web3.js scripts posted here soon.

I have already deployed the compiled bytecode for the three current supported contracts to the public Ropsten testnet, here:

Contract ID Contract Code Contract Bytecode Contract ABI
0x8a90b1e93020933295b3bd4ce2317062319351d4 counter.clar counter.bin counter.json
0x9a1b29fc432af1e37af03ed2fee00d742ff7372f panic.clar panic.bin panic.json
0x2e2487c64b1420111e8d66d751f75f69515c5476 kv-store.clar kv-store.bin kv-store.json

It's possible to interact with these contracts using MyEtherWallet, for example.

The new supported contracts demonstrate several more implemented features of Clarity on EVM; for example:

  • Clarity's panics are mapped to the EVM REVERT opcode
  • Clarity's tx-sender maps to the EVM CALLER opcode
  • Clarity's principal type maps nicely to Ethereum addresses (address in terms of the Solidity ABI)
  • Clarity's persistent storage for variables and maps is implemented using the EVM SLOAD and SSTORE opcodes
  • We are able to pack a tuple containing two 128-bit Clarity integers into a single 256-bit EVM machine word

I'll update the project README soon with a table documenting how we map Clarity constructs to the Ethereum virtual machine.

The delivery of this milestone was a couple of days late. That was not due to any technical blockers (beyond what I mentioned previously regarding the EVM simulator), everything is going as expected and the work done so far is proportionate to my original estimates for the M1 and M2 milestones. However, I did lose several days due to unexpected personal matters. I will aim to catch up with the original schedule over the course of the next week.

from grants-program.

dantrevino avatar dantrevino commented on June 14, 2024 3

Would love to see this. Thoughts @njordhov ?

from grants-program.

artob avatar artob commented on June 14, 2024 3

My end-of-week update: I've got properly started with the project this week, implementing EVM bytecode encoding and decoding. I remain on track to complete M1 (the proof-of-concept) on schedule next week.

from grants-program.

artob avatar artob commented on June 14, 2024 3

I have today released Clarc 0.6.0, which incorporates about a month of work (diff) since the previous 0.5.0 release.

The current state of things is that we do support most Clarity language constructs (with limitations) and we do compile many contracts in friedger/clarity-smart-contracts, but are still--crucially--missing the implementation of Clarity's fungible-token/non-fungible-token support, which is required by a good number of contracts in that collection.

The ft-* and nft-* functions should be mapped onto the ERC-20 and ERC-721 standards, respectively. I tried for a while to (unsuccessfully) follow my original plan of taking existing, known-good Solidity implementations of those standards, compile them to bytecode, and then link that output into Clarity contracts that implement tokens using these functions.

That turns out to not be a very viable path forward, since EVM bytecode from Solidity isn't really suitable for linking in this way. So, that was, plainly, a mistake I made in my original estimation for how much work it would take to implement the ERC-20/721 token support.

I am now in the process of implementing the ERC-20 and ERC-721 standards directly using EVM opcodes (assembly). That's a bit laborious, but it's proceeding nonetheless. I will post another update later this week as I proceed.

from grants-program.

MarvinJanssen avatar MarvinJanssen commented on June 14, 2024 2

This is fantastic. Congratulations on your grant.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024 2

As you're working on the last milestone I've funded the remainder of the grant.

from grants-program.

artob avatar artob commented on June 14, 2024 1

The grant contract has now been signed, and I've created the project repository at weavery/clarc just now. (If you're interested in the project, go ⭐ it!)

from grants-program.

blocks8 avatar blocks8 commented on June 14, 2024 1

Funded Milestone 1 development: $1000.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024 1

Hi @artob we're reopening this issue, where you can post your updates on milestones. We're having a demo day at the end of the month, and we'd love to have you show off what you've built so far on M1 and M2, are you game to join.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024 1

Hey awesome @artob! We are reviewing it and will disburse M2. Thanks!
Raffi

from grants-program.

blocks8 avatar blocks8 commented on June 14, 2024 1

Milestone 2 funded for $1000.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024 1

Hello! Thank you for all your hard work this year. We would love to send you a holiday note and some custom stacks stickers. Please email me at [email protected] with your names/addresses if you'd like to receive one. We really appreciate all your help and contributions. Stacks is what it is because of you!

from grants-program.

artob avatar artob commented on June 14, 2024

I've posted this proposal for discussion on the forum as well: https://forum.blockstack.org/t/clarity-for-ethereum/11213

from grants-program.

artob avatar artob commented on June 14, 2024

@ryanarndtcm Thank you for the happy news. I'll be in touch via email.

from grants-program.

artob avatar artob commented on June 14, 2024

@RaffiSapire I discussed this with @ryanarndtcm on Discord, and yes, count me in. I've added it to my calendar.

from grants-program.

artob avatar artob commented on June 14, 2024

I am in the process of completing M2, getting close to compiling the two panic.clar and kv-store.clar example contracts.

I'll need another day or so to wrap that up and record demos, though. Expect an end-of-week update to follow.

from grants-program.

ryanarndtcm avatar ryanarndtcm commented on June 14, 2024

Hey Arto! I am confirming your M2 is reviewed and approved!

from grants-program.

artob avatar artob commented on June 14, 2024

@ryanarndtcm @jcnelson Thanks for that! I appreciate that everyone has a hectic schedule right now, so a nice turnaround on that.

from grants-program.

artob avatar artob commented on June 14, 2024

For those who missed it, my Clarc demo begins at 31m45s in the recording from yesterday's Stacks Grant Demo Day:

https://www.crowdcast.io/e/stacks-grants-demo-day--

from grants-program.

artob avatar artob commented on June 14, 2024

As a quick update from my end, I'm working hard on M3 and will release the next version later this week.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024

Hi Arto! Hope all is well. Just wanted to check in and see if we can be helpful in anyway in getting this to the finish line :) If its ended up being more work than expected, we can also help figure that out.

from grants-program.

artob avatar artob commented on June 14, 2024

Hi Arto! Hope all is well. Just wanted to check in and see if we can be helpful in anyway in getting this to the finish line :) If its ended up being more work than expected, we can also help figure that out.

Thanks for checking in, @RaffiSapire! The final milestone has been a slog, but we aren't far off now. I'll have a comprehensive update for you still this week.

from grants-program.

RaffiSapire avatar RaffiSapire commented on June 14, 2024

Thank you! We're so excited to see all of this happening. I understand this grant may have been a lot more work than anticipated. We're happy to increase the scope of the grant to compensate you for the contributions you are making. If you want to comment here on what is appropriate given the level of work we can discuss on Tuesday or after the holidays, whatever works for you!

from grants-program.

artob avatar artob commented on June 14, 2024

As an update, the work on ERC-20 support is nearing usability, I plan to spend some time over the holidays to wrap that up. ERC-721 will need more work still.

Thank you! We're so excited to see all of this happening. I understand this grant may have been a lot more work than anticipated. We're happy to increase the scope of the grant to compensate you for the contributions you are making. If you want to comment here on what is appropriate given the level of work we can discuss on Tuesday or after the holidays, whatever works for you!

Thanks for the kind words, @RaffiSapire! Would you perhaps have a moment to discuss this--that is, the possibilities for restructuring and re-scoping the grant a bit--on a brief call prior to the holidays? I'm available anytime today (Tuesday) and tomorrow. You can reach me on Discord as Arto#1837 as well as via email.

from grants-program.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.