Prerequisites
The development environment
Before you start, set up the development environment:
-
Install Foundry by running the following command:
curl -L https://foundry.paradigm.xyz | bash \
foundryup -
Install the required dependencies:
forge install OpenZeppelin/openzeppelin-contracts
forge install Uniswap/v2-periphery -
Configure
foundry.toml
:[profile.default]
auto_detect_solc = false
block_timestamp = 1_680_220_800
bytecode_hash = "none"
evm_version = "paris"
fuzz = { runs = 1_000 }
gas_reports = ["*"]
optimizer = true
optimizer_runs = 10_000
solc = "0.8.25"
[fmt]
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true
The project structure
Create the following project structure:
orders/
├── mocks/ # Mock services
├── script/ # Deployment scripts
├── src/ # Core contracts
└── test/ # Test files
Full code
You can find the full code of the example on GitHub: /orders
Required knowledge
Warden features
You should learn about the following Warden features:
- Warden Agent Kit
- Warden precompiles
x/warden
: Managing keys and handling signature requests
Functions: keyById(), newSignRequest()x/oracle
: The price feed system and data retrieval methods
Functions: getPrice()x/async
: Future-based operations and the price prediction system
Functions: addFuture, futureById()
Solidity
Guides in this section require the knowledge of the following Solidity concepts:
- Contract inheritance
- Interface implementation
- Events and error handling
- Factory patterns
You should be also familiar with the following smart contract patterns:
abstract contract Base {
// Base functionality
}
interface IExecution {
// Execution interface
}
contract Implementation is Base, IExecution {
// Implementation details
}
Next steps
After meeting these prerequisites, you can start creating helpers and utils.