Retrieve the status of a contract by its creator

by Mutante   Last Updated April 14, 2019 22:28 PM

In a situation where there are multiple contracts stored in different blocks, is there any method to retrieve the status of a contract through its owner's address? (e.g. in my situation, each person registered in the blockchain will only have one contract.This contract will be registered with the public key of this person, i.e. the contract owner will be a public key that corresponds to a person.If I know this public key , can I retrieve the status of this contract?)



Answers 1


One easy solution is to manage contract address with a registry contract. When a contract is created it will call the registry contract and store the association with the sender.

contractRegistry.registerNew(msg.sender, address(this));

And ContractRegistry will have a mapping (address => address) contracts. That allows to determine the contract given its owner.


Another interesting alternative is to use the new opcode CREATE2 that allows the creation of contract with addresses generated deterministically.

Ismael
Ismael
April 14, 2019 23:56 PM

Related Questions


Usage regarding for loop in solidity contract

Updated October 05, 2017 07:28 AM

Bad Instruction

Updated January 11, 2018 02:28 AM


state channel between smart contracts

Updated January 04, 2019 20:28 PM