2

I've tried several times to add a subNode to my ENS domain through MEW/Contracts. Keep getting: Error encountered during contract execution [Bad jump destination]

When clicked on "Write" to make the it also starts with Gas Limit = -1. When changed to different amounts on the several times I tried, it keep failing to create the subNode.

Also, it cost significant amount of Tx cost on gas by now, which has not been returned after the failed transaction.

  • Could you provide the failing transaction ID (or link to it on a blockchain explorer)? – carver Aug 30 '17 at 15:38
  • Thank you for having a look.... This is one of the failed the TxID: etherscan.io/tx/… – Sander Huisman Sep 1 '17 at 14:11
1

Why is this failing?

The transaction sender doesn't own the parent node. That will always be the reason that a setSubnodeOwner(...) call will fail with a "bad jump".

From ENS.sol:

/**
 * Transfers ownership of a subnode sha3(node, label) to a new address. May only be
 * called by the owner of the parent node.
 * @param node The parent node.
 * @param label The hash of the label specifying the subnode.
 * @param owner The address of the new owner.
 */
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) only_owner(node) {
    var subnode = sha3(node, label);
    NewOwner(node, label, owner);
    records[subnode].owner = owner;
}

// Permits modifications only by the owner of the specified node.
modifier only_owner(bytes32 node) {
    if (records[node].owner != msg.sender) throw;
    _;
}

The parent node that you need to own is the one you supplied as your first argument, which is:

0x4c6828bff2e6f9cb971ca9a106f0a5a653c8128287fcd8f4e5cf2ab9bd45da73

(according to etherscan)

Why might I not be the owner?

Some of the most likely reasons are:

No one is the owner

Maybe you have not run finalizeAuction() on your .eth name?

The sender is incorrect

An example scenario is:

  • You are juggling several accounts.
  • You purchased the name with a non-default account.
  • You forgot to set from in the setSubnodeOwner(...) transaction to the owning account.

The node is incorrect

Maybe you own the name, but you calculated the node (aka "namehash") incorrectly. See "Calculating Namehash" in this answer, but with 'eth' instead of 'test'.

For reference, the namehash of 'eth' is:

> web3.toHex(ens.namehash('eth'))
'0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae'

(source: ens.py)

For this specific case

There's still not enough information to be sure. We can eliminate "The sender is incorrect" because no one owns the node that was the first argument to your call. Check out the other two reasons, and feel free to comment for follow-up.

| improve this answer | |
  • Somehow I got through the proccess and the SubNode is set. Thank you for the advises. – Sander Huisman Oct 5 '17 at 10:46

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.