Giter Site home page Giter Site logo

deepface19 / testnet-challenge-3-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from polymerdevs/testnet-challenge-3-template

0.0 0.0 0.0 21.86 MB

Shell 0.40% JavaScript 12.75% Ruby 1.33% Python 0.23% Go 34.77% Assembly 0.40% Rust 0.07% Julia 0.08% TypeScript 9.74% Nix 0.01% Makefile 0.13% HTML 0.01% Handlebars 0.02% HCL 0.03% Dockerfile 0.08% Solidity 39.94% Just 0.02%

testnet-challenge-3-template's Introduction

Template for Polymer Challenge 3

This repo provides template code to complete Polymer Testnet Challenge 3: https://forum.polymerlabs.org/t/challenge-3-cross-contract-query-with-polymer/475

๐Ÿ“š Documentation

There's some basic information here in the README but a more comprehensive documentation can be found in the official Polymer documentation.

๐Ÿ“‹ Prerequisites

The repo is compatible with both Hardhat and Foundry development environments.

  • Have git installed
  • Have node installed (v18+)
  • Have Foundry installed (Hardhat will be installed when running npm install)
  • Have just installed (recommended but not strictly necessary)

You'll need some API keys from third party's:

Some basic knowledge of all of these tools is also required, although the details are abstracted away for basic usage.

๐Ÿงฐ Install dependencies

To compile your contracts and start testing, make sure that you have all dependencies installed.

From the root directory run:

just install

to install the vIBC core smart contracts as a dependency.

Additionally Hardhat will be installed as a dev dependency with some useful plugins. Check package.json for an exhaustive list.

Note: In case you're experiencing issues with dependencies using the just install recipe, check that all prerequisites are correctly installed. If issues persist with forge, try to do the individual dependency installations...

โš™๏ธ Set up your environment variables

Convert the .env.example file into an .env file. This will ignore the file for future git commits as well as expose the environment variables. Add your private keys and update the other values if you want to customize (advanced usage feature).

cp .env.example .env

This will enable you to sign transactions with your private key(s). If not added, the scripts from the justfile will fail.

Configuration file

The configuration file is where all important data is stored for the just commands and automation. We strive to make direct interaction with the config file as little as possible.

By default the configuration file is stored at root as config.json.

The configuration file is pre-set with the contract you will need to interact with on Base. Do not change it in order to correctly complete the challenge

Obtaining testnet ETH

The account associated with your private key must have both Base Sepolia and Optimism Sepolia ETH. To obtain the testnet ETH visit:

๐Ÿƒ๐Ÿฝ๐Ÿƒ๐Ÿปโ€โ™€๏ธ Instructions

The project comes with an almost complete contract CCQueryUC.sol in the contracts directory. Your task is to implement two functions:

  1. sendUniversalPacket - You will need to configure the payload to correctly be decoded and pass conditional logic of the base contract you are sending the packet to.
  2. onUniversalAcknowledgement - You will need to emit the event LogAcknowledgment in order to provide evidence to complete this challenge.

Once you have completed the implementation of these two functions, run:

just run-challenge-3

This will:

  1. Deploy your CCQueryUC.sol contract to Optimism
  2. Send a packet to the Base Contract

๐Ÿ’ก Questions or Suggestions?

Feel free to open an issue for questions, suggestions, or discussions related to this repository. For further discussion as well as a showcase of some community projects, check out the Polymer developer forum.

Thank you for being a part of our community!

testnet-challenge-3-template's People

Contributors

deepface19 avatar

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.