Comments (26)
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.
@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:
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.
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 EVMCALLER
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
andSSTORE
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.
Would love to see this. Thoughts @njordhov ?
from grants-program.
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.
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.
This is fantastic. Congratulations on your grant.
from grants-program.
As you're working on the last milestone I've funded the remainder of the grant.
from grants-program.
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.
Funded Milestone 1 development: $1000.
from grants-program.
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.
Hey awesome @artob! We are reviewing it and will disburse M2. Thanks!
Raffi
from grants-program.
Milestone 2 funded for $1000.
from grants-program.
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.
I've posted this proposal for discussion on the forum as well: https://forum.blockstack.org/t/clarity-for-ethereum/11213
from grants-program.
@ryanarndtcm Thank you for the happy news. I'll be in touch via email.
from grants-program.
@RaffiSapire I discussed this with @ryanarndtcm on Discord, and yes, count me in. I've added it to my calendar.
from grants-program.
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.
Hey Arto! I am confirming your M2 is reviewed and approved!
from grants-program.
@ryanarndtcm @jcnelson Thanks for that! I appreciate that everyone has a hectic schedule right now, so a nice turnaround on that.
from grants-program.
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.
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.
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.
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.
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.
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)
- XFounders HOT 2
- Ur-Hackathon 3.0 HOT 2
- StacksFlow HOT 2
- DAOsign HOT 2
- Translate Stack Crowdin HOT 5
- Discord AI support bot HOT 4
- asd HOT 1
- ads HOT 1
- 123 HOT 1
- 43 HOT 1
- first grant HOT 1
- first grant HOT 1
- 656 HOT 1
- first grant HOT 1
- Test HOT 1
- CB-3Q23-01.1: sBTC Testing & Support Team HOT 4
- CB-3Q23-02.1: Liquid STX HOT 8
- CB-3Q23-03.1: Bitcoin on Stacks | Improvements HOT 14
- CB-3Q23-04.1: Stacks & Clarity | Improvements HOT 4
- CB-23Q3-05.1 FastMint, NFT-specific Subnet HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grants-program.