0

I am reading some tutorials and while planning to deploy test contract on ropsten I have something like this:

pragma solidity 0.5.1;

contract destroy {
    constructor(address payable receiver) public payable {
        selfdestruct(receiver);
    }
}

contract Test {

     function() external payable { }

    function transfer(address _to, uint256 _amount) external {
       ///
    }

}

Getting "transfer" from the abi is quite easy. But what to do with "contract destroy"? Not only is this another contract but also everything is in the constructor? Is there a way to call this from web3 python/js or at least via myetherwallet? 10x!

  • It's not really clear what you want to do here. It's not clear what the relationship between those two contracts is, what functions you want to invoke, and in general - what exactly you are having difficulties with. – goodvibration Nov 12 at 13:48
  • I want to invoke selfdestruct, but is this evne possible given the way this is written? Obviously contract destroy is included in "Test" but is there a way to invoke selfdestruct since it's not in a function? Basically i want to invoke selfdesctruct without using onlyowner as modifier since I want to be able to use several addresses and not only the "owner" but looking for various ways to achieve his...hence this got me curious. – Robert Ggg Nov 12 at 14:08
  • contract destroy is included in "Test" - what does that mean??? – goodvibration Nov 12 at 14:20
  • is there a way to invoke selfdestruct since it's not in a function - it's in the constructor of contract destroy, so simply deploy this contract in order to invoke the function. – goodvibration Nov 12 at 14:21
  • without using onlyowner as modifier since I want to be able to use several addresses and not only the "owner" - where is there anything related to "owner" anywhere in your code??? Please provide ALL the relevant information (and ONLY the relevant information). – goodvibration Nov 12 at 14:22

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.