I am trying to invoke a function using oz send-tx but it fails with Error: gas required exceeds allowance (8000000) or always failing transaction
Environment
I am using OZ v2.6
Details
Code to reproduce
Here is my contract code. It compiles and deploys without any issue. Please deploy to Ropsten testnet to reproduce
pragma solidity ^0.5.0;
import "@ensdomains/ens/contracts/ENS.sol";
import "@ensdomains/ethregistrar/contracts/ETHRegistrarController.sol";
contract ReverseResolver {
function setName(bytes32 node, string memory name) public;
}
contract NameStack {
bool private initialized;
ENS ens;
ETHRegistrarController controller;
ReverseResolver reverseResolver;
function initialize(address ensAddress, address controllerAddress, address reverseResolverAddress) public {
require(!initialized);
initialized = true;
ens = ENS(ensAddress);
controller = ETHRegistrarController(controllerAddress);
reverseResolver = ReverseResolver(reverseResolverAddress);
}
function registerWithConfig(string memory name, address acc, uint256 duration, bytes32 salt, address publicResolver) public payable {
controller.registerWithConfig.value(msg.value)(name, acc, duration, salt, publicResolver, acc);
}
function register(string memory name, address acc, uint256 duration, bytes32 salt) public payable {
controller.register.value(msg.value)(name, acc, duration, salt);
}
function makeCommitmentWithConfig(string memory name, bytes32 salt, address publicResolver, address owner) view public returns(bytes32) {
return controller.makeCommitmentWithConfig(name, owner, salt, publicResolver, owner);
}
function makeCommitment(string memory name, bytes32 salt, address owner) view public returns(bytes32) {
return controller.makeCommitment(name, owner, salt);
}
function commit(bytes32 commitment) public {
return controller.commit(commitment);
}
function() payable external { }
}
Then, call send-tx (details below):
$ oz send-tx --network ropsten --value 20000000000000000
? Pick an instance NameStack at 0x584C72faED8C7730170BF9761195BF08a2a0080A
? Select which function registerWithConfig(name: string, acc: address, duration: uint256, salt: bytes32, publicResolver: address)
? name (string): phantom
? acc (address): 0x98d79D728b0f5eDd1F0e68010e54Eaa78A011E76
? duration (uint256): 31556952
? salt (bytes32): 0x592d9b9f53c241b8ce6aa52c8a8f57f09c0ef4dd2fa6ce214f93c687b1fdda19
? publicResolver (address): 0x12299799a50340FB860D276805E78550cBaD3De3
You should see an error. The exact same code with same inputs works in a truffle project, so I know the issue is not in the code. How do I even debug this error? Thanks!