git submodule update --init --recursive
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
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 asprivate_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!
yarn
yarn start
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.
$ forge build
$ forge test
$ forge fmt
$ forge snapshot
$ anvil
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
$ cast <subcommand>
$ forge --help
$ anvil --help
$ cast --help