
Drosera

Infinite bandwidth for smart contracts using decentralized, verifiable, and composable infrastructure
bash
curl -L https://app.drosera.io/install | bash
Common Actions
BlockNumberTrap.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.12;
import "./ITrap.sol";
contract BlockNumberTrap is ITrap {
// Define data collection points
struct CollectOutput {
uint256 blockNumber;
}
// Collect data every block
function collect() external view returns (bytes memory) {
return
abi.encode(
CollectOutput({blockNumber: block.number})
);
}
// Time-series analysis on collected data over block-sample-size
function shouldRespond(
bytes[] calldata data
) external pure returns (bool, bytes memory) {
CollectOutput memory collectOutput = abi.decode(
data[0],
(CollectOutput)
);
if (collectOutput.blockNumber == 845699) {
// True: Perform response-function defined in drosera.toml
return (true, abi.encode(collectOutput.blockNumber));
}
// False: Do not perform response-function
return (false, abi.encode(collectOutput.blockNumber));
}
}
Leveraging the Best
Features
Drosera supports the following out of the box for a best-in-class developer experience:
- Infinite bandwidth for smart contracts using Drosera Traps
- Verifiable infrastructure using RiscZero zk proofs
- Asynchronous composability between off-chain compute and on-chain state using just Solidity
- Fully testable infrastructure with existing Ethereum tooling such as Foundry
- Tooling inspired by Terraform
- Decentralized and permissionless nodes powered by LibP2P for peer-to-peer networking
Community
Join the Community
- Ask for support in the Discord or create a request for Trap on Github
Credit
credit to alloy for providing vocs styles 🦾