Getting started
Web3 Functions enable you to connect the on and off-chain worlds:
- On-chain is the smart contract that you want to automate and control using your Web3 Function.
- Off-chain is your Web3 Function which can access any APIs you need and run your custom logic to determine if your smart contract should execute and what data to pass to it.
Linking the two is your Web3 Function Task - where you configure what triggers your Web3 Function to run and the target smart contract you want it to control.
You should already have the smart contract that you want to control so let's dive into how you create your Web3 Function.
git clone https://github.com/gelatodigital/web3-functions-hardhat-template.git
cd web3-functions-hardhat-template
yarn install
cp .env.example .env
Note:
PRIVATE_KEY
is optional, and only needed if you wish to deploy contracts or create a task from the CLI instead of the UI ALCHEMY_ID= // <= Your Alchemy key
PRIVATE_KEY= // <= Your Private key
Last modified 2mo ago