0

I am using a factory A to produce child contracts. Now I want to guarantee that only these child contracts have access to a different contract B.

Using the factory as a proxy is somehow a detour as I also would like to send stuff back from B to the children. I thought using the nonce of the factory A would be great but this is not accessible in Solidity. Is there any other way?

Thanks!

  • 1
    How about just whitelisting the right contract addresses so only those addresses are able to call the contract B? – Lauri Peltonen Apr 1 at 6:09
  • B can just ask A if the calling contract is a valid caller. (A needs to keep a mapping of its children.) – smarx Apr 1 at 6:47
  • @smarx Thanks! I was thinking to complicated here. – Olympus Apr 1 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.