├── .gitmodules ├── LEGAL.txt ├── LICENSE ├── README.md ├── example-1 ├── README.md └── evm │ ├── .gitignore │ ├── Makefile │ ├── foundry.toml │ ├── package.json │ ├── src │ ├── CrossChainBorrowLend.sol │ ├── CrossChainBorrowLendGetters.sol │ ├── CrossChainBorrowLendMessages.sol │ ├── CrossChainBorrowLendState.sol │ ├── CrossChainBorrowLendStructs.sol │ ├── interfaces │ │ ├── IMockPyth.sol │ │ └── IWormhole.sol │ ├── libraries │ │ └── external │ │ │ └── BytesLib.sol │ └── pyth │ │ └── MockPyth.sol │ ├── test │ ├── CrossChainBorrowLend.t.sol │ └── helpers │ │ ├── ExposedCrossChainBorrowLend.sol │ │ └── MyERC20.sol │ └── yarn.lock └── example-2 ├── README.md ├── evm ├── .gitignore ├── Makefile ├── foundry.toml ├── package.json ├── src │ ├── contracts │ │ ├── HubSpokeMessages.sol │ │ ├── HubSpokeStructs.sol │ │ ├── lendingHub │ │ │ ├── Hub.sol │ │ │ ├── HubChecks.sol │ │ │ ├── HubGetters.sol │ │ │ ├── HubInterestUtilities.sol │ │ │ ├── HubPriceUtilities.sol │ │ │ ├── HubSetters.sol │ │ │ ├── HubState.sol │ │ │ └── HubWormholeUtilities.sol │ │ └── lendingSpoke │ │ │ ├── Spoke.sol │ │ │ ├── SpokeGetters.sol │ │ │ ├── SpokeSetters.sol │ │ │ ├── SpokeState.sol │ │ │ └── SpokeUtilities.sol │ ├── interfaces │ │ ├── IMockPyth.sol │ │ ├── ITokenBridge.sol │ │ ├── ITokenImplementation.sol │ │ ├── IWETH.sol │ │ └── IWormhole.sol │ └── libraries │ │ └── external │ │ └── BytesLib.sol ├── test │ ├── Hub.t.sol │ └── helpers │ │ ├── MyERC20.sol │ │ ├── TestGetters.sol │ │ ├── TestHelpers.sol │ │ ├── TestSetters.sol │ │ ├── TestState.sol │ │ ├── TestStructs.sol │ │ ├── TestUtilities.sol │ │ └── WormholeSimulator.sol ├── testing.env └── yarn.lock └── imgs ├── .DS_Store ├── alternative_hub_spoke.png ├── hub_diagram_BBB.png ├── hub_diagram_CCC.png ├── hub_diagram_liquidation.png ├── hub_diagram_repay_CCC.png ├── hub_diagram_withdraw_AAA.png ├── hub_spoke_basic_schema.png ├── inefficient_model.png ├── initial_diagram.png └── interest_table.png /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LEGAL.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/LEGAL.txt -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/README.md -------------------------------------------------------------------------------- /example-1/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/README.md -------------------------------------------------------------------------------- /example-1/evm/.gitignore: -------------------------------------------------------------------------------- 1 | cache 2 | lib 3 | node_modules 4 | out 5 | venus-protocol 6 | wormhole 7 | -------------------------------------------------------------------------------- /example-1/evm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/Makefile -------------------------------------------------------------------------------- /example-1/evm/foundry.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/foundry.toml -------------------------------------------------------------------------------- /example-1/evm/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/package.json -------------------------------------------------------------------------------- /example-1/evm/src/CrossChainBorrowLend.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/CrossChainBorrowLend.sol -------------------------------------------------------------------------------- /example-1/evm/src/CrossChainBorrowLendGetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/CrossChainBorrowLendGetters.sol -------------------------------------------------------------------------------- /example-1/evm/src/CrossChainBorrowLendMessages.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/CrossChainBorrowLendMessages.sol -------------------------------------------------------------------------------- /example-1/evm/src/CrossChainBorrowLendState.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/CrossChainBorrowLendState.sol -------------------------------------------------------------------------------- /example-1/evm/src/CrossChainBorrowLendStructs.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/CrossChainBorrowLendStructs.sol -------------------------------------------------------------------------------- /example-1/evm/src/interfaces/IMockPyth.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/interfaces/IMockPyth.sol -------------------------------------------------------------------------------- /example-1/evm/src/interfaces/IWormhole.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/interfaces/IWormhole.sol -------------------------------------------------------------------------------- /example-1/evm/src/libraries/external/BytesLib.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/libraries/external/BytesLib.sol -------------------------------------------------------------------------------- /example-1/evm/src/pyth/MockPyth.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/src/pyth/MockPyth.sol -------------------------------------------------------------------------------- /example-1/evm/test/CrossChainBorrowLend.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/test/CrossChainBorrowLend.t.sol -------------------------------------------------------------------------------- /example-1/evm/test/helpers/ExposedCrossChainBorrowLend.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/test/helpers/ExposedCrossChainBorrowLend.sol -------------------------------------------------------------------------------- /example-1/evm/test/helpers/MyERC20.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/test/helpers/MyERC20.sol -------------------------------------------------------------------------------- /example-1/evm/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-1/evm/yarn.lock -------------------------------------------------------------------------------- /example-2/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/README.md -------------------------------------------------------------------------------- /example-2/evm/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/.gitignore -------------------------------------------------------------------------------- /example-2/evm/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/Makefile -------------------------------------------------------------------------------- /example-2/evm/foundry.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/foundry.toml -------------------------------------------------------------------------------- /example-2/evm/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/package.json -------------------------------------------------------------------------------- /example-2/evm/src/contracts/HubSpokeMessages.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/HubSpokeMessages.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/HubSpokeStructs.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/HubSpokeStructs.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/Hub.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/Hub.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubChecks.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubChecks.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubGetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubGetters.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubInterestUtilities.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubInterestUtilities.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubPriceUtilities.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubPriceUtilities.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubSetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubSetters.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubState.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubState.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingHub/HubWormholeUtilities.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingHub/HubWormholeUtilities.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingSpoke/Spoke.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingSpoke/Spoke.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingSpoke/SpokeGetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingSpoke/SpokeGetters.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingSpoke/SpokeSetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingSpoke/SpokeSetters.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingSpoke/SpokeState.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingSpoke/SpokeState.sol -------------------------------------------------------------------------------- /example-2/evm/src/contracts/lendingSpoke/SpokeUtilities.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/contracts/lendingSpoke/SpokeUtilities.sol -------------------------------------------------------------------------------- /example-2/evm/src/interfaces/IMockPyth.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/interfaces/IMockPyth.sol -------------------------------------------------------------------------------- /example-2/evm/src/interfaces/ITokenBridge.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/interfaces/ITokenBridge.sol -------------------------------------------------------------------------------- /example-2/evm/src/interfaces/ITokenImplementation.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/interfaces/ITokenImplementation.sol -------------------------------------------------------------------------------- /example-2/evm/src/interfaces/IWETH.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/interfaces/IWETH.sol -------------------------------------------------------------------------------- /example-2/evm/src/interfaces/IWormhole.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/interfaces/IWormhole.sol -------------------------------------------------------------------------------- /example-2/evm/src/libraries/external/BytesLib.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/src/libraries/external/BytesLib.sol -------------------------------------------------------------------------------- /example-2/evm/test/Hub.t.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/Hub.t.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/MyERC20.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/MyERC20.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestGetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestGetters.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestHelpers.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestHelpers.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestSetters.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestSetters.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestState.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestState.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestStructs.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestStructs.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/TestUtilities.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/TestUtilities.sol -------------------------------------------------------------------------------- /example-2/evm/test/helpers/WormholeSimulator.sol: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/test/helpers/WormholeSimulator.sol -------------------------------------------------------------------------------- /example-2/evm/testing.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/testing.env -------------------------------------------------------------------------------- /example-2/evm/yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/evm/yarn.lock -------------------------------------------------------------------------------- /example-2/imgs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/.DS_Store -------------------------------------------------------------------------------- /example-2/imgs/alternative_hub_spoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/alternative_hub_spoke.png -------------------------------------------------------------------------------- /example-2/imgs/hub_diagram_BBB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_diagram_BBB.png -------------------------------------------------------------------------------- /example-2/imgs/hub_diagram_CCC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_diagram_CCC.png -------------------------------------------------------------------------------- /example-2/imgs/hub_diagram_liquidation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_diagram_liquidation.png -------------------------------------------------------------------------------- /example-2/imgs/hub_diagram_repay_CCC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_diagram_repay_CCC.png -------------------------------------------------------------------------------- /example-2/imgs/hub_diagram_withdraw_AAA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_diagram_withdraw_AAA.png -------------------------------------------------------------------------------- /example-2/imgs/hub_spoke_basic_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/hub_spoke_basic_schema.png -------------------------------------------------------------------------------- /example-2/imgs/inefficient_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/inefficient_model.png -------------------------------------------------------------------------------- /example-2/imgs/initial_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/initial_diagram.png -------------------------------------------------------------------------------- /example-2/imgs/interest_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wormhole-foundation/example-wormhole-lending/HEAD/example-2/imgs/interest_table.png --------------------------------------------------------------------------------