Open edakturk14 opened 2 months ago
I'm going to be working on this first issue.
I'm going to be working on this first issue.
issue resolved! I was the first to call the function π₯³
Hey! I've checked in already :)
hey there! sorry for being late, had mid-sem exams going on :) Checked in just now!! will be working on other issues soon.
Goal
Check-in into the BatchRegistry contract.
π‘ This issue doesn't require you to raise a PR, just get yourself checked-in. Create a local branch to work on this.
BatchRegistry contract
The BatchRegistry contract is deployed on Optimism.
You can find the contract code in
packages/hardhat/contracts/BatchRegistry.sol
. It's also available in theexternalContracts.ts
file inpackages/nextjs/contracts/
(for front-end use in future issues).You can see/interact with the contract on the Debug page of SE-2: Clone this repo, run
yarn install
andyarn start
and go to http://localhost:3000/debug.π‘ You can check if you wallet address is in the allowList ;)
Checking-in
There are many ways to check-in into the Contract. Here we'll use the Scaffold-ETH 2 way β’.
1. Create your own branch
Before you begin, make sure you're working on a separate branch. Here's how:
git checkout -b [your-branch-name]
2. Spin up Your Local SE-2
Set up your local environment:
yarn install
(install dependencies)yarn start
(starts SE2 front-end)π‘ You'll notice that the dApp points to the Optimism chain. Check the
scaffold.config.ts
file to see how it's configured.3. Understand the
checkIn
functionGo the the
BatchRegistry.sol
contract and check thecheckIn
function. You'll see that in order to check in, 3 things are required:So you'll need to deploy a contract that calls the
checkIn
function on theBatchRegistry
contract.4. Set up the local environment
Instead of deploying a contract on Optimism, we'll deploy it locally so we can test.
yarn chain
yarn deploy
a. Checkpackages/hardhat/deploy/00_deploy_your_contract.ts
scaffold.config.ts
(targetNetwork should bechain.hardhat
)yarn start
If you go to the Debug page, you should see the
BatchRegistry
contract (but this time is deployed locally!)π‘ You'll need to tweak the deploy script to make yourself the owner of the
BatchRegistry
contract (so you can update the allowList, etc.)5. Deploy a contract that calls the
checkIn
functionNow it's time to create a contract that calls the
checkIn
function. E.g.CheckIn.sol
contract inpackages/hardhat/contracts/
BatchRegistry
contract (More info here: Interfaces in Solidity By Example)BatchRegistry
contractcheckIn
BatchRegistry function.00_deploy_your_contract.ts
script to deploy your contract (and pass the address of theBatchRegistry
contract)Test it!
6. Check-in live
Once you have tested that your contract works, it's time to deploy it to Optimism and check-in live!
yarn generate
)yarn account
)00_deploy_your_contract.ts
script to only deploy your contract to Optimism (you don't want to deploy theBatchRegistry
contract, which is already deployed by us!)yarn deploy --network optimism
)scaffold.config.ts
checkMeIn
function!β You should be checked-in! (You can check it by calling the
yourContractAddress
function)In future issues, we'll be showing this info on the UI.