-
Notifications
You must be signed in to change notification settings - Fork 0
Description
We need to create:
- A solution to transfer from OTCCustody on Arbitrum to OTCCustody on Base
- Transfer must be initiated by OTCCustody on Arbitrum using
custodyToAddress - We need new collateral designation type and new collateral bridge type
We currently have following designations:
- OTCCustodyCollateralDesignation : designation in out OTCCustody contract (one per OTCIndex contract)
- SignerWalletCollateralDesignation : active (source) wallet designation (allows transfers from it)
- WalletCollateralDesignation : passive (destinatino) wallet designation (allows transfers to it)
And following bridges:
- OTCCustodyToWalletCollateralBridge : allows transfer from OTCCustody contract into wallet
- SignerWalletToWalletCollateralBridge : allows transfer from (owned) wallet to wallet
In order to transfer across from Arbitrum to Base we need to:
- transfer from our address on Arbitrum (OTCCustody contract) to an address provided by Across
- receive from address given by Across into Base (OTCCustody contract)
This means that the types of source and designation are going to be OTCCustodyCollateralDesignation, however the type of bridge will be OTCCustodyToWalletCollateralBridge, and there will need to be WalletCollateralDesignation embedded with address from Across. So I'm thinking that it would need to be new designation with reference to OTCCustodyCollateralDesignation and wallet address obtained from Across.
This needs meticulous design that combines into new designation type the two types:
- OTCCustodyCollateralDesignation
- WalletCollateralDesignation
and it needs to be done so that WalletCollateralDesignation obtains address from Across, and then OTCCustodyToWalletCollateralBridge can be created between OTCCustodyCollateralDesignation and WalletCollateralDesignation.
Currently WalletCollateralDesignation has static address. Perhaps that static address could be replaced with callback type such as FnMut() -> Address or wrapper for it.
This approach would allow us to reuse what we have, and only the address would need to be fetched from Across by a function bound to that callback.
Note
async code must live exclusively within RPC sessions, and not within the designations or bridges. See how they are currently impemented. Follow the pattern.