I'm creating a Main contract which will be used to create dynamic contracts with msg.sender as Owner. Anyone can send ETH externally to the dynamic contract and anyone can withdraw ETH from the dynamic contract but it will only goto Owner.


contract Main{
   // this contract will just create contracts
   mapping(address => address[]) public dynamic_contracts;
   function createContract(){
      address newContract = new Dynamic(msg.sender);


Contract Dynamic{
 // this contract will hold funds and transfer em
    address Owner;
    function Dynamic (address owner) {
        Owner = owner;
    function transferFunds(){
      //transfer it to Owner

The problem is Dynamic contract is created dynamically therefore i only have its address stored in mapping dynamic_contracts of Main. I don have its abi so how do i call transferFunds function ?

Dynamic = Dynamic(msg.sender);

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.