Skip to content

cowri/shell-protocol-v3

Repository files navigation

Shell v3

Shell v3 improves upon the fundamentals developed in Shell v2, which you can learn more about here & here, we highly recommmend to go through these resources before diving into the v3 improvements.

We also recommend devs to dive into adapter integration docs

The goal of Shell v3 is to make the Ocean compatible with external protocols through the use of adapter primitives.

V3 Updates

The Ocean

  • Removed reentrancy guards for doInteraction and doMultipleInteraction methods so that adapter primitives may wrap/unwrap tokens to be used with external protocols.

  • doInteraction has been updated to enable wrapping Ether.

  • Refactored the order in which a primitive's balances are updated. Previously, both mints and burns would occur after the primitive had performed its computation in computeOutputAmount or computeInputAmount. Now, the primitive's balances will be minted the input token or burned the output token before performing the computation step, and then will burn the output token or mint the input token based on the result.

Adapter Primitives

  • Introducing OceanAdapter.sol, a generalized adapter interface for adapter primitives.
  • Demonstrated implementation in examples

Security

Currently, we use Slither to help identify well-known issues via static analysis. Other tools may be added in the near future as part of the continuous improvement process.

Static Analysis

To run the analysis

slither . --foundry-compile-all

Installation

Run git clone https://github.com/cowri/shell-protocol-v3-contracts.git & then run yarn install

Testing

Foundry mainnet fork tests powered by fuzzing for the existing different adapters are located here for reference

To compile the contracts

forge build

To run Foundry tests

forge test

To run coverage for Foundry tests

forge coverage

For coverage for the Adapter Contracts run forge coverage

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published