HarryR / panautomata

Cross-chain proofs and atomic transactions
GNU General Public License v3.0
18 stars 2 forks source link

ExampleCrossToken could use a Factory contract #23

Open HarryR opened 6 years ago

HarryR commented 6 years ago

The ExampleCrossTokenProxy contract can only be used as a proxy for a single remote contract, it's open to any remote contract until a Redeem() operation is made, then it's locked to whichever remote contract that was.

You shouldn't trust users to create new contracts, nor is it ideal for users to have to find a contract which is suitable to be used as a proxy. We need to be able to trust a single contract.

The solution to this is to have a Factory contract, which acts like a Token registry but for remote ether. You ask the Factory 'Do you have a Token for Token X on Chain Y?' If it says No, then you ask it to create a token contract for that specific one. Future requests will answer with an already created one.