1.8 KiB
1.8 KiB
VM Integration
This page describes the interface required to implement protocol logic component.
To create a VM implementation, it is required two provide a manifest file as well as a implementation of the corresponding adapter interface.
Step by step
Prerequisites
- Install Foundry.
curl -L https://foundry.paradigm.xyz | bash
- Start by making a local copy of the Propeller Protocol Lib repository:
git clone https://github.com/propeller-heads/propeller-protocol-lib
- Install forge dependencies:
cd ./propeller-protocol-lib/evm/
forge install
Understanding the ISwapAdapter
- Read the the documentation of the Ethereum Solidity interface. It describes the functions that need to be implemented as well as the manifest file.
- Additionally read through the docstring of the ISwapAdapter.sol interface and the ISwapAdapterTypes.sol interface which defines the data types and errors used by the adapter interface.
- You can also generate the documentation locally and the look at the generated documentation in the
./docsfolder:
forge doc
Implementing the ISwapAdapter interface
- Your integration should be in a separate directory in the
evm/srcfolder. Start by cloning the template directory:
cp -r ./evm/src/template ./evm/src/<your-adapter-name>
- Implement the
ISwapAdapterinterface in the./evm/src/<your-adapter-name>.solfile. - Create tests for your implementation in the
./evm/test/<your-adapter-name>.t.solfile, again based on the template./evm/test/TemplateSwapAdapter.t.sol.