I am trying to deploy one contract but I am getting the message:
“Creation of MyContract5 Pending….”
MyContract5.sol code is given below:
pragma solidity ^0.4.22;
contract MyContract5{
uint public mynumber;
constructor ( ) public {
mynumber = 24;
}
function storeNum(uint mynum) public returns (bool success) {
require(mynum >10);
mynumber = mynum; //changing the internal state. If we are not changing state then function should be declared as pure
return true;
}
}
However, when I am trying to deploy ThrowProxy Contract, I am getting the message:
“Creation of ThrowProxy Errored: Error encoding arguments: Error invalid address arg=””, type=”string”, value=””
My ThrowProxy contract is part of a test file:
pragma solidity ^0.4.22;
import "./MyContract5.sol";
contract TestMyContract5{
function testTheThrow() public {
MyContract5 mycontract = new MyContract5();
ThrowProxy throwproxy = new ThrowProxy(address(mycontract));
MyContract5(address(throwproxy)).storeNum(7);
bool r = throwproxy.execute.gas(200000)();
require(r);
}
function testNoThrow() public {
MyContract5 mycontract = new MyContract5();
ThrowProxy throwproxy = new ThrowProxy(address(mycontract));
MyContract5(address(throwproxy)).storeNum(22);
bool r = throwproxy.execute.gas(200000)();
require(r);
}
}
contract ThrowProxy{
address public target;
bytes data;
constructor (address _target) public {
target = _target;
}
function( ) public {
data = msg.data;
}
function execute( ) public returns (bool) {
return target.call(data);
}
}
Some body please guide me how to deploy contracts in Remix? Why it says pending? How can we get around with this problem? How can we get around with Invalid address arg problem? Please provide me the coding example also.
Zulfi.