Skip to content

0xJomo/dop-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Start Guide

Update git submodules

git submodule update --init --recursive

Configure dev environment

curl -L https://foundry.paradigm.xyz | bash
foundryup

# install vscode (optional)
# - add solidity extension JuanBlanco.solidity

# install drosera-cli
curl -L https://app.drosera.io/install | bash
droseraup

open the VScode preferences and Select Solidity: Change workpace compiler version (Remote)

Select version 0.8.12

DOP Trap

The drosera.toml file is configured to deploy a simple DOP trap. Ensure the drosera.toml file is set to the following configuration:

# Contract function will be executed when the trap is triggered
response_contract = "0xF9F26c467b13A4f805DAB58c0203CAc82bf8A753"
response_function = "responseCallback(uint256)"

To deploy the trap, run the following commands:

# Compile the Trap
forge build

# Deploy/Update the Trap
# Use the account whitelisted for use on the Drosera Holesky testnet.
DROSERA_PRIVATE_KEY=0x.. drosera apply

Note: The DROSERA_PRIVATE_KEY environment variable can be used to deploy traps. You can also set it in the drosera.toml file as private_key = "0x..".

After successfully deploying the trap, the CLI will add an address field to the drosera.toml file.

Congratulations! You have successfully deployed a trap!

View your trap

Performing an OpenLayer request

yarn
yarn start

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published