For example, I'm trying to call the createYesNoMarket function from my own contract. I supply the universe address on deployment of my contract and I've followed the recommended contract call pattern. However, when I deploy and call the wrappedCreate function, I get a gas estimation error on Remix.

Can anyone help with this?

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

contract Universe {
    function createYesNoMarket(uint256 _endTime, uint256 _feePerEthInWei, address _denominationToken, address _designatedReporterAddress, bytes32 _topic, string _description, string _extraInfo) public payable returns(address);
}

contract AugurWrapper {
    Universe universe;
    constructor(address _a) public{
        universe = Universe(_a);
    }
    function wrappedCreate(uint256 _endTime, uint256 _feePerEthInWei, address _denominationToken, address _designatedReporterAddress, bytes32 _topic, string _description, string _extraInfo) public payable returns(address) {
        return universe.createYesNoMarket(_endTime,_feePerEthInWei,_denominationToken,_designatedReporterAddress,_topic,_description,_extraInfo);       
    }
}

Looking at the contract I believe this is failing because you aren't passing the msg.value to the createYesNoMarket call so the validity bond cannot be paid. Additionally if the AugurWrapper contract doesn't have a sufficient REP balance it will not be able to transfer the REP required for the no show bond.

Remember as well that the "mailbox" contract which will be created and collect fees generated for the market creator will only be accessible by the creator of the market, which will be this contract.

You'll need to create functions on this wrapper to transfer ownership of that mailbox or withdraw fees from it then transfer them elsewhere to solve that issue.

For future contract development questions btw please join our discord and chat with us in the #core-dev channel.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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