chore: Add BalancerSwapExecutor

This commit is contained in:
Diana Carvalho
2024-08-23 17:58:00 +01:00
parent d1e21a8d63
commit e49af99b1f
6 changed files with 259 additions and 9 deletions

View File

@@ -28,7 +28,8 @@ errors, such as invalid parameter lengths or unknown pool types in the swap logi
manage these approvals within the implementation to ensure smooth execution of the swap.
5. **Token Transfer Support**: Ensure that the implementation supports transferring received tokens to a designated
receiver address, either within the swap function or through an additional transfer step.
6. **Gas Efficiency**: Ensure the implementation is gas-efficient. Strive for optimal performance in the swap logic.
6. **Gas Efficiency**: Ensure the implementation is gas-efficient. Strive for optimal performance in the swap logic.
The usage of assembly is not necessary.
7. **Security Considerations**: Follow common security best practices, such as validating inputs, ensuring proper
access control, and safeguarding against reentrancy attacks.
@@ -36,4 +37,4 @@ access control, and safeguarding against reentrancy attacks.
## Example Implementation
See the example implementation of a `SwapExecutor` for Balancer here (TODO: paste link)
See the example implementation of a `SwapExecutor` for Balancer [here](../../evm/src/balancer-v2/BalancerSwapExecutor.sol).

View File

@@ -6,10 +6,10 @@ description: Provide protocol logic using the ethereum virtual machine
## Swap/exchange protocol
To integrate an EVM exchange protocol the [ISwapAdapter.sol ](https://github.com/propeller-heads/propeller-protocol-lib/blob/main/evm/interfaces/ISwapAdapter.sol)should be implemented. Additionally a manifest file is required that summarises some metadata about the protocol.
To integrate an EVM exchange protocol the [ISwapAdapter.sol ](https://github.com/propeller-heads/propeller-protocol-lib/blob/main/evm/interfaces/ISwapAdapter.sol)should be implemented. Additionally, a manifest file is required that summarises some metadata about the protocol.
{% hint style="info" %}
Although the interface is specified for Solidity, you are not limited to writing the adapater contract in Solidity. We can use any compiled evm bytecode. So if you prefer e.g. Vyper, you are welcome to implement the interface using Vyper. Unfortunately we do not provide all the tooling for Vyper contracts yet, but you can certainly submit compiled Vyper byte code.
Although the interface is specified for Solidity, you are not limited to writing the adapter contract in Solidity. We can use any compiled evm bytecode. So if you prefer e.g. Vyper, you are welcome to implement the interface using Vyper. Unfortunately we do not provide all the tooling for Vyper contracts yet, but you can certainly submit compiled Vyper byte code.
{% endhint %}
The manifest file contains information about the author, as well as additional static information about the protocol and how to test the current implementation. The file below lists all valid keys.
@@ -147,8 +147,3 @@ function getPoolIds(uint256 offset, uint256 limit)
external
returns (bytes32[] memory ids);
```