I am trying to figure out if this pattern for an ethereum smart contract would be possible or are there limitations in solidity or the evm which would prevent this.
Contract A is deployed on the blockchain with address 0xA, within contract A's code there is a function such that if ethereum is received above a threshold it will create another contract (say Contract Child, say at 0xB). So the contract has to respond to the event where an address sends it ether. Within Contract Child's code there are certain functions that do the following:
- Allow it to accept ether (from other third parties, say address 0xC) and return that ether at a future date automatically.
For this pattern, I was curious to know if
- Will each instance of Contract Child have its own address, accesible to the outside addresses. I know that a contract creating an instance of another contract would be an internal txn, but does this Contract Child have it's own address I can send txns to? Or do I have to access the original contract's internal storage to find those contracts. If yes, are there any special ways to access given it is not a contract with a blockchain address?
- If there are addresses where each instance of Contract child is created, I assume I can log them into an array of addresses an access them as such. Would this be correct?
- I assume the last part, the Contract receiving transactions, specifically ether transfers and then sending them back to the address which sent them would not cause any difficulty in solidity or the EVM.
I am fairly new to smart contract development so apologies if I am stating something a bit off.