HarryR / panautomata

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

Integrate 'Registry' contract with the project #13

Open HarryR opened 6 years ago

HarryR commented 6 years ago

The Registrar / Registry contract makes it easier to work with related and interlinked contracts.

See: https://github.com/HarryR/panautomata/blob/61a4bdaa26fe3dfb0305606b1d143df6c9180061/solidity/contracts/Registrar.sol

This should really be part of the first release to avoid all the problems with hard-coding contract addresses everywhere.

However, it does make deploying the contracts a little more difficult because you must associate them with a specific registry, deploy with the same account the registry was deployed with etc. It also introduces problems if you want to deploy multiples of the same contract.

Another option would be a contract factory with auto-registration... but again, adds complexities.

The problem I was having which lead to wanting this Registry contract was that whenever the migrations file changed the contract addresses would also change (which breaks stuff), this is a problem during development, but may also be a problem when deploying to the test networks.

HarryR commented 6 years ago

Another use case for a Registry / Factory contract is #23