Origami uses LayerZero for Omnichain Fungible Tokens (OFT), with a few differences:
- Use Origami's auth model (
OrigamiElevatedAccess
) rather than OpenZeppelin's Ownable - Use OpenZeppelin 4.*
- Changes to help get around stack-too-deep (for testing only)
The main
branch represents the original contracts pulled in. It is intentionally pulled into the single repo -- but not an entire fork of the full upstream github from LayerZeroLabs as that is very bloated. See version information of that below.
The origami-diffs
branch is then the extra delta for Origami required changes outlined below.
- ./src/lz-evm-messagelib-v2
- ./src/lz-evm-protocol-v2
- ./src/lz-evm-oapp-v2
- ./src/test-devtools-evm-foundry
- ./src/lz-evm-v1-0.7
- Use
OpenZeppelin v4.*
rather thanv5.*
. Origami will also update to v5 at some point, but as of now it has breaking interface changes. - Avoid stack-too-deep:
- Pull out OFT constructor parameters into a struct
- Comment out a public function which has many args. Origami doesn't depend on this in prod contracts or testing - it only impacts the LZ deployed
EndPointV2
- Add a BYO model for Ownership of the OFT and OFTAdapter contract, rather than forcing the use of OpenZeppelin's
Ownable
. In Origami's case, we use OrigamiElevatedAccess.- This model allows the implementation to define the
onlyOFTOwner()
modifier.
- This model allows the implementation to define the
In order to keep most files the same even though we use different paths here, ./remappings.txt was used.
$ forge build
No extra tests deployed here - the client code (eg Origami) has tests for these.
$ forge test