[feature] chain agnostic contracts
Overview
THORChain is chain agnostic, sending/receiving any asset on any chain. There is no reason why deploying a smart contract on any EVM-based chain (ETH, BSC, Terra, etc) can interact with THORChain. Allowing the larger dev community to build on top of THORChain, adding new dapps, protocols, etc using THORChain liquidity pools/assets for collateral. This would give ETH smart contract devs access to build dapps that are fundamentally cross-chain. No other project in the crypto space is positioned better than THORChain to execute such a concept.
How it works
THORChain would need to add the ability to transfer LP units ownership to another address (ie a smart contract address). In addition, a user can send other native THORChain assets like rune or synthetics to be owned by a remote smart contract. For each EVM-based chain, THORChain would have a contract deployed. This contract would send/receive events from other contracts.
The Lifecycle (example)
Alice has 1 BTC and wants to use a derivates DeFi contract on Ethereum.
- She sends her BTC to THORChain, adding liquidity to the BTC pool and acquiring LP units.
- She then makes another transaction, transferring her LP units to the ETH derivates smart contract which includes her ETH address. This
MsgDeposit
transaction emits an event that causes Bifrost to broadcasts the event to the TC smart contract, which emits an event to the derivates smart contract (once consensus is reached). This lets the derivatives smart contract it has new LP units and to who owns them (Alice's eth address). - She then uses the ETH-based derivates smart contract to her content, trading, etc.
- Once finished, Alice has a desire to cash out to BTC, with her profits. She tells the derivatives contract to send her BTC LP units, back to her bitcoin address.
- The derivatives smart contract emits an event, which is picked up by the TC smart contract, and emitted to Bifrost, which makes an observation back on THORChain, to move the LP units from the ownership of the contract to Alice's BTC address.
- Alice then does a withdrawal from the BTC pool, getting back her BTC plus her profits.