Creating an On-Chain Task-to-Earn Application with Chainlink Functions & The Graph Protocol

EthCC[8] · 1 Jul 2025 · 11:08

Kevin Jones demonstrates a decentralized task-reward application using Chainlink and The Graph. The presentation walks through smart-contract automation and indexing for an on-chain task-to-earn system.

Speakers

Topics

From EthCC[8], hosted by Ethereum France.

Transcript

Heat. [Music] [Applause] Heat. [Music] What's going on everybody? Whoa, that's

very loud. So now I've tested you twice making sure you're awake. Um, thank you everyone for coming. My name is Kevin Jones. I'm a developer relations engineer working for edge node on the graph protocol. Uh I'm also a core member of the build guild working and supporting scaffold ETH. If you guys have heard of scaffold eth going to be talking about both those today. Um and I'm building something else really cool I'm going to talk about at the end as well. Um but the main focus this is going to be a very fast talk because it's only 12 minutes and uh I might blast you with some information but hopefully you get something out of it. Um well first of all I always ask like what was your journey into coming onto Ethereum as a builder right? Um, maybe you're not a builder on Ethereum. I

would assume probably a majority of you are building on chain, right? That's why we're here. Uh, for me, I when I first got started, it was a little bit difficult to like sift through all the tools. You know, this was about four or five years ago. Uh, and I felt like coming from a web 2 world where things are very established. Uh, it was very easy, right, with web 2, you know, I I used to work for Engine X, if anyone's heard of EngineX. Um, and like building on Ethereum was a little bit of a struggle at first, but eventually and luckily, I found the Build Guild. Um, if anyone hasn't heard of the Build Guild, it's a Wyoming DAO that helps incentivize builders uh to build on Ethereum by creating tools, education, content supporting the Ethereum ecosystem.

And my first entry was speedrun Ethereum. Speedrun Ethereum was awesome because it was this very cool challenged based tool that allowed you to do real world scenarios on Ethereum uh from a learning perspective. Things like simple NFT, right? like when NFTs kind of were a craze, you know, like teaching and learning how to do that was, you know, pretty easy. But, uh, this is a complete example of how you could do that in what what they call challenges. And then additional, uh, things like learning how to stake, looking learning how to do token swaps, um, and even like later on like things like building a deck and more advanced challenges, right? And I think like learning by doing and like actually completing

things is probably the most effective way. And so I was very inspired by that. Um and it's this very cool system again where you can like register on the platform, you can connect your wallet, you can complete the challenges. Um and you can do this by submitting the uh Solia Etherscan link for the actual contract. And then you can also uh submit your Verscell application that you deployed to kind of verify that you've deployed the front end and it would automatically grade you. Some of them are manual, but really still this really cool way of like educating through doing, right? Another cool thing is Scaffold ETH, right? So Scaffold ETH is a is a toolkit that allows you to build on Ethereum quickly. It's kind of a starter kit. If anyone hasn't heard of it, you should totally check it out, especially if you're working on

hackathon projects or if you just want to prototype very quickly. And so that was a great kind of entryway. And on top of that, there is a special extension called the subgraph extension from uh the graph. So what this allows you to do is it allows you to still use the existing scaffold ETH framework to build an application on Ethereum but it gives you the power to build a subgraph uh and deploy and test subgraphs locally using a complete extension system. So by spinning it up very easily, you can just run npxcreate- e uh at latest-e subgraph and it will spin up a monor repo with scaffold eth your chain that you decide to use. You can use hard hat or foundry and your front end.

So what was next? So like I I have was starting in the build guild about four years ago very passionate about building on ethereum. I started to work for edge and node and started building tooling in the graph. I was very inspired by Adam Fuller who was a product manager working in the graph and I wanted to kind of build something that would encompass the same kind of style as what speedrun Ethereum was and this is what I came up with. Ready. [Music] [Music]

Awesome. All right. So, uh, what what what is this? It's basically a kind of a inspired by Ethereum, uh, or sorry, speed on Ethereum. It's called the graph builduilders base camp. You can go to basecamp.thegraph.com the graph.com and check it out. Uh, but what it is is it's a challenge based, but we call them missions that are essentially the same kind of style, right? You can come onto the application and you can register and you can complete missions to gain NFTTS. So, one of the things that was I wouldn't say lacking, but with speedrun Ethereum is like it still uses web 2 infrastructure. And so, I wanted to kind of improve on speedrun Ethereum a little bit with some kind of cool way to integrate with the graph. And so I came up with this cool concept where we're still using scaffold. We actually built

it with scaffold ETH, but there's two like main contracts. One is a standard ERC1 1155 NFT contract which handles all of the rewards for the missions. And then there is a validator.soul contract which is basically hooked up to chain link functions. Uh if anyone hasn't heard of chain link functions, what they do is they utilize the oracle's decentralized network for chain link to run some computation offchain and then bring those results back on chain which is super cool because um we can build something essentially that would normally be done in a web two-way in a web 3 way. So the architecture looks like something like this. We have scaffold eth on the top right. We have nex.js uh typical uh react application.

uh we still are deploying our smart contracts to base right and we still using the graph for all of the validation right so if a user comes on and they have to you know build a subgraph and then deploy that subgraph to the studio the studio is exposing that via graphql if anyone hasn't heard of the graph uh the graph is a graphql kind of end entry point for what are called subgraphs and we utilize the chain link decentralized or Oracle network to do this kind of like validation right So still using scaffold eth using the graph. We actually used the subgraph extension of scaffold eth as well. And this is kind of what the flow looks like. So you can imagine you have an externally owned account that is connecting to the graph builder base

camp. Uh they're sending a request to this kind of main contract, right? So this is like the consumer contract is what chain calls it. That chain link contract has an inherited contract that can then call the functions router contract. And so this is like a set contract address uh that takes in just a normal transaction called send request. And then that thing gets sent off after you send the uh function call to the functions router to a coordinator. Then that coordinator uh emits an event called an oracle request. It's kind of hard to see. Uh, but what that does is when that event is fired off, all of the nodes in the entire chain link decentralized oracle are kind of seeing this event happen and they're taking all

of the data that's coming off the event and processing it. So inside of that event, you're actually sending all of the source code for the the validation that needs to happen along with any parameters, right? So in this case we're sending the user's wallet address and then we're send sending the mission that we want to validate against the decentralized oracle network then comes into a consensus right uh using the magic powers of of chain link and if you by the way if you have any secrets you can also define those secrets in a secrets endpoint um in my case it's all public information so there's no like API key or anything like that you can just access it uh but when that result comes back it comes to the coordinator

The function router then takes this and makes a call back to the contract. And if you have any, you can actually put contracts in front of this consumer contract as well. So in that case, we have an NFT contract in here and that would just do a call back and then mint that NFT. So this can all be done automated without any any need for a server. Literally, you could just like spin up the repo on your laptop and complete a mission all on chain as long as you deploy a subgraph to the graph network. So it's open source. Um, it's not on the graph protocol GitHub yet. Right now, it's just on my personal GitHub. So, if you go to kmjones1979, uh, you can go there. It's under graph builduilders-bascamp and you can see what it looks like. There's basically a few contracts. Uh, they're very simple.

Um, thank you. Uh, and it's very easy to spin this up. I think you just really need to um I think you just need to like it's kind of difficult to set up the chain link contracts. I will say that. Um, but there's really good documentation on the chain link website if you guys want to uh do this kind of scenario yourself. So, how did it go? Well, we had 1,200 visitors from 60 countries use it over the last couple months. Um, actually, this is wrong. Yeah, over the last couple months. Uh, we have 37 new builders that we've brought into the graph ecosystem uh that we wouldn't normally have. Altogether, there's been 71 missions have been completed and there's seven builders that have completed all of the four missions. So pretty awesome. So how can we keep this

going? Well, this is going to be very fast. So I'm building another cool program called Genesis. Um if anyone wants to take a look at it, please come message me afterwards or stop me. It's basically like an online tool for developers to connect. I'm utilizing the same thing in what are we called learn modules on Genesis and these will be NFTts that you can learn for learning how to build on Ethereum, Solidity, Viper, whatever you want to do. Uh there'll be uh these little modules in here to help boost the ecosystem. And yeah, uh, and then you can see what it looks like here. It's pretty cool. And then there's like a quiz functionality.

So, uh, sorry, there's a quiz functionality that is in a web two way, but again, we meant this all onchain. So, it's using chain link functions. So, thank you so much, guys. [Applause] [Music]