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.
-
Removed reentrancy guards for
doInteraction
anddoMultipleInteraction
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
orcomputeInputAmount
. 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.
- Introducing OceanAdapter.sol, a generalized adapter interface for adapter primitives.
- Demonstrated implementation in examples
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.
To run the analysis
slither . --foundry-compile-all
Run git clone https://github.com/cowri/shell-protocol-v3-contracts.git
& then run yarn install
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
To deploy the contract to localhost
anvil
forge create Ocean --unlocked --constructor-args "URI"
For coverage for the Adapter Contracts run forge coverage