diff --git a/lib/modules/ens/ensContractConfigs.json b/lib/modules/ens/ensContractConfigs.json new file mode 100644 index 000000000..e2167af21 --- /dev/null +++ b/lib/modules/ens/ensContractConfigs.json @@ -0,0 +1,746 @@ +{ + "ENSRegistry": { + "deploy": true, + "silent": false, + "args": [], + "className": "ENSRegistry", + "code": "608060405234801561001057600080fd5b5060008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a03191633179055610684806100596000396000f3006080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100bb57806306ab5923146100d357806314ab9038146100fc57806316a25cbd146101215780631896f70a146101565780635b0fc9c31461017a575b600080fd5b34801561009357600080fd5b5061009f60043561019e565b60408051600160a060020a039092168252519081900360200190f35b3480156100c757600080fd5b5061009f6004356101bc565b3480156100df57600080fd5b506100fa600435602435600160a060020a03604435166101d7565b005b34801561010857600080fd5b506100fa60043567ffffffffffffffff6024351661033c565b34801561012d57600080fd5b5061013960043561044d565b6040805167ffffffffffffffff9092168252519081900360200190f35b34801561016257600080fd5b506100fa600435600160a060020a0360243516610484565b34801561018657600080fd5b506100fa600435600160a060020a036024351661056f565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b60008381526020819052604081205484908390600160a060020a031615806102155750600082815260208190526040902054600160a060020a031633145b806102395750600082815260208190526040902054600160a060020a038281169116145b151561024457600080fd5b604080516020808201899052818301889052825180830384018152606090920192839052815191929182918401908083835b602083106102955780518252601f199092019160209182019101610276565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600160a060020a038b16835293519398508a95508b94507fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829391829003019150a350506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040812054839190600160a060020a031615806103795750600082815260208190526040902054600160a060020a031633145b8061039d5750600082815260208190526040902054600160a060020a038281169116145b15156103a857600080fd5b6040805167ffffffffffffffff85168152905185917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68919081900360200190a25050600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040812054839190600160a060020a031615806104c15750600082815260208190526040902054600160a060020a031633145b806104e55750600082815260208190526040902054600160a060020a038281169116145b15156104f057600080fd5b60408051600160a060020a0385168152905185917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0919081900360200190a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60008281526020819052604090205482908290600160a060020a031615806105ad5750600082815260208190526040902054600160a060020a031633145b806105d15750600082815260208190526040902054600160a060020a038281169116145b15156105dc57600080fd5b60408051600160a060020a0385168152905185917fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266919081900360200190a25050600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820ab29585bdb630f86714bdc052e84731ce84785d7ace426bc24c1104e8760968c0029", + "runtimeBytecode": "6080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100bb57806306ab5923146100d357806314ab9038146100fc57806316a25cbd146101215780631896f70a146101565780635b0fc9c31461017a575b600080fd5b34801561009357600080fd5b5061009f60043561019e565b60408051600160a060020a039092168252519081900360200190f35b3480156100c757600080fd5b5061009f6004356101bc565b3480156100df57600080fd5b506100fa600435602435600160a060020a03604435166101d7565b005b34801561010857600080fd5b506100fa60043567ffffffffffffffff6024351661033c565b34801561012d57600080fd5b5061013960043561044d565b6040805167ffffffffffffffff9092168252519081900360200190f35b34801561016257600080fd5b506100fa600435600160a060020a0360243516610484565b34801561018657600080fd5b506100fa600435600160a060020a036024351661056f565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b60008381526020819052604081205484908390600160a060020a031615806102155750600082815260208190526040902054600160a060020a031633145b806102395750600082815260208190526040902054600160a060020a038281169116145b151561024457600080fd5b604080516020808201899052818301889052825180830384018152606090920192839052815191929182918401908083835b602083106102955780518252601f199092019160209182019101610276565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600160a060020a038b16835293519398508a95508b94507fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829391829003019150a350506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040812054839190600160a060020a031615806103795750600082815260208190526040902054600160a060020a031633145b8061039d5750600082815260208190526040902054600160a060020a038281169116145b15156103a857600080fd5b6040805167ffffffffffffffff85168152905185917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68919081900360200190a25050600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040812054839190600160a060020a031615806104c15750600082815260208190526040902054600160a060020a031633145b806104e55750600082815260208190526040902054600160a060020a038281169116145b15156104f057600080fd5b60408051600160a060020a0385168152905185917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0919081900360200190a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60008281526020819052604090205482908290600160a060020a031615806105ad5750600082815260208190526040902054600160a060020a031633145b806105d15750600082815260208190526040902054600160a060020a038281169116145b15156105dc57600080fd5b60408051600160a060020a0385168152905185917fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266919081900360200190a25050600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820ab29585bdb630f86714bdc052e84731ce84785d7ace426bc24c1104e8760968c0029", + "realRuntimeBytecode": "6080604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100bb57806306ab5923146100d357806314ab9038146100fc57806316a25cbd146101215780631896f70a146101565780635b0fc9c31461017a575b600080fd5b34801561009357600080fd5b5061009f60043561019e565b60408051600160a060020a039092168252519081900360200190f35b3480156100c757600080fd5b5061009f6004356101bc565b3480156100df57600080fd5b506100fa600435602435600160a060020a03604435166101d7565b005b34801561010857600080fd5b506100fa60043567ffffffffffffffff6024351661033c565b34801561012d57600080fd5b5061013960043561044d565b6040805167ffffffffffffffff9092168252519081900360200190f35b34801561016257600080fd5b506100fa600435600160a060020a0360243516610484565b34801561018657600080fd5b506100fa600435600160a060020a036024351661056f565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b60008381526020819052604081205484908390600160a060020a031615806102155750600082815260208190526040902054600160a060020a031633145b806102395750600082815260208190526040902054600160a060020a038281169116145b151561024457600080fd5b604080516020808201899052818301889052825180830384018152606090920192839052815191929182918401908083835b602083106102955780518252601f199092019160209182019101610276565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600160a060020a038b16835293519398508a95508b94507fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e829391829003019150a350506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040812054839190600160a060020a031615806103795750600082815260208190526040902054600160a060020a031633145b8061039d5750600082815260208190526040902054600160a060020a038281169116145b15156103a857600080fd5b6040805167ffffffffffffffff85168152905185917f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa68919081900360200190a25050600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040812054839190600160a060020a031615806104c15750600082815260208190526040902054600160a060020a031633145b806104e55750600082815260208190526040902054600160a060020a038281169116145b15156104f057600080fd5b60408051600160a060020a0385168152905185917f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a0919081900360200190a25050600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b60008281526020819052604090205482908290600160a060020a031615806105ad5750600082815260208190526040902054600160a060020a031633145b806105d15750600082815260208190526040902054600160a060020a038281169116145b15156105dc57600080fd5b60408051600160a060020a0385168152905185917fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d266919081900360200190a25050600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a72305820", + "swarmHash": "ab29585bdb630f86714bdc052e84731ce84785d7ace426bc24c1104e8760968c", + "gasEstimates": { + "creation": { + "codeDepositCost": "333600", + "executionCost": "20684", + "totalCost": "354284" + }, + "external": { + "owner(bytes32)": "634", + "resolver(bytes32)": "618", + "setOwner(bytes32,address)": "23389", + "setResolver(bytes32,address)": "23370", + "setSubnodeOwner(bytes32,bytes32,address)": "infinite", + "setTTL(bytes32,uint64)": "23130", + "ttl(bytes32)": "579" + } + }, + "functionHashes": { + "owner(bytes32)": "02571be3", + "resolver(bytes32)": "0178b8bf", + "setOwner(bytes32,address)": "5b0fc9c3", + "setResolver(bytes32,address)": "1896f70a", + "setSubnodeOwner(bytes32,bytes32,address)": "06ab5923", + "setTTL(bytes32,uint64)": "14ab9038", + "ttl(bytes32)": "16a25cbd" + }, + "abiDefinition": [ + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "resolver", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "owner", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "label", + "type": "bytes32" + }, + { + "name": "owner", + "type": "address" + } + ], + "name": "setSubnodeOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "ttl", + "type": "uint64" + } + ], + "name": "setTTL", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "ttl", + "outputs": [ + { + "name": "", + "type": "uint64" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "resolver", + "type": "address" + } + ], + "name": "setResolver", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "owner", + "type": "address" + } + ], + "name": "setOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "name": "label", + "type": "bytes32" + }, + { + "indexed": false, + "name": "owner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "owner", + "type": "address" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "resolver", + "type": "address" + } + ], + "name": "NewResolver", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "ttl", + "type": "uint64" + } + ], + "name": "NewTTL", + "type": "event" + } + ], + "filename": "C:/dev/embark/lib/modules/ens/contracts/ENSRegistry.sol", + "gas": "auto", + "type": "file", + "_gasLimit": false + }, + "Resolver": { + "deploy": true, + "silent": true, + "className": "Resolver", + "code": "608060405234801561001057600080fd5b50604051602080610cdb833981016040525160008054600160a060020a03909216600160a060020a0319909216919091179055610c89806100526000396000f3006080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166310f13a8c81146100be5780632203ab561461015c57806329cd62ea146101f65780632dff6941146102145780633b3b57de1461023e57806359d1d43c1461027f578063623195b014610352578063691f3431146103b257806377372213146103ca578063c3d014d614610428578063c869023314610443578063d5fa2b0014610474575b600080fd5b3480156100ca57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a95833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506104a59650505050505050565b005b34801561016857600080fd5b5061017760043560243561063a565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561020257600080fd5b5061015a600435602435604435610746565b34801561022057600080fd5b5061022c6004356107b5565b60408051918252519081900360200190f35b34801561024a57600080fd5b506102566004356107cb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028b57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102dd9583359536956044949193909101919081908401838280828437509497506107f39650505050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103175781810151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035e57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261015a9482359460248035953695946064949201919081908401838280828437509497506108fc9650505050505050565b3480156103be57600080fd5b506102dd60043561096c565b3480156103d657600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a958335953695604494919390910191908190840183828082843750949750610a109650505050505050565b34801561043457600080fd5b5061015a600435602435610ad5565b34801561044f57600080fd5b5061045b600435610b25565b6040805192835260208301919091528051918290030190f35b34801561048057600080fd5b5061015a60043573ffffffffffffffffffffffffffffffffffffffff60243516610b42565b826000848152600160209081526040918290209151855185936005019287929182918401908083835b602083106104ed5780518252601f1990920191602091820191016104ce565b51815160209384036101000a6000190180199092169116179052920194855250604051938490038101909320845161052e9591949190910192509050610bc2565b5083600019167fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508485604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610598578181015183820152602001610580565b50505050905090810190601f1680156105c55780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a250505050565b60008281526001602081905260409091206060905b83831161073957828416158015906106885750600083815260068201602052604081205460026000196101006001841615020190911604115b1561072e57600083815260068201602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156107225780601f106106f757610100808354040283529160200191610722565b820191906000526020600020905b81548152906001019060200180831161070557829003601f168201915b5050505050915061073e565b60029092029161064f565b600092505b509250929050565b82604080518082018252848152602080820185815260008881526001835284902092516003840155516004909201919091558151858152908101849052815186927f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46928290030190a250505050565b6000908152600160208190526040909120015490565b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600082815260016020908152604091829020915183516060936005019285929182918401908083835b6020831061083b5780518252601f19909201916020918201910161081c565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188208054601f60026001831615909802909501169590950492830182900482028801820190528187529294509250508301828280156108ef5780601f106108c4576101008083540402835291602001916108ef565b820191906000526020600020905b8154815290600101906020018083116108d257829003601f168201915b5050505050905092915050565b82600019830183161561090e57600080fd5b60008481526001602090815260408083208684526006018252909120835161093892850190610bc2565b50604051839085907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a350505050565b6000818152600160208181526040928390206002908101805485516000199582161561010002959095011691909104601f81018390048302840183019094528383526060939091830182828015610a045780601f106109d957610100808354040283529160200191610a04565b820191906000526020600020905b8154815290600101906020018083116109e757829003601f168201915b50505050509050919050565b8160008381526001602090815260409091208351610a3692600290920191850190610bc2565b50604080516020808252845181830152845186937fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f79387939092839283019185019080838360005b83811015610a96578181015183820152602001610a7e565b50505050905090810190601f168015610ac35780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b816000838152600160208181526040928390209091018490558151848152915185927f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc92908290030190a2505050565b600090815260016020526040902060038101546004909101549091565b81600083815260016020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff86169081179091558251908152915185927f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd292908290030190a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c0357805160ff1916838001178555610c30565b82800160010185558215610c30579182015b82811115610c30578251825591602001919060010190610c15565b50610c3c929150610c40565b5090565b610c5a91905b80821115610c3c5760008155600101610c46565b905600a165627a7a72305820820458ee1fb63da1465b0a1fbcba8ca7c04249db10a2c939ebf73d487bd5a83d0029", + "runtimeBytecode": "6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166310f13a8c81146100be5780632203ab561461015c57806329cd62ea146101f65780632dff6941146102145780633b3b57de1461023e57806359d1d43c1461027f578063623195b014610352578063691f3431146103b257806377372213146103ca578063c3d014d614610428578063c869023314610443578063d5fa2b0014610474575b600080fd5b3480156100ca57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a95833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506104a59650505050505050565b005b34801561016857600080fd5b5061017760043560243561063a565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561020257600080fd5b5061015a600435602435604435610746565b34801561022057600080fd5b5061022c6004356107b5565b60408051918252519081900360200190f35b34801561024a57600080fd5b506102566004356107cb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028b57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102dd9583359536956044949193909101919081908401838280828437509497506107f39650505050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103175781810151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035e57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261015a9482359460248035953695946064949201919081908401838280828437509497506108fc9650505050505050565b3480156103be57600080fd5b506102dd60043561096c565b3480156103d657600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a958335953695604494919390910191908190840183828082843750949750610a109650505050505050565b34801561043457600080fd5b5061015a600435602435610ad5565b34801561044f57600080fd5b5061045b600435610b25565b6040805192835260208301919091528051918290030190f35b34801561048057600080fd5b5061015a60043573ffffffffffffffffffffffffffffffffffffffff60243516610b42565b826000848152600160209081526040918290209151855185936005019287929182918401908083835b602083106104ed5780518252601f1990920191602091820191016104ce565b51815160209384036101000a6000190180199092169116179052920194855250604051938490038101909320845161052e9591949190910192509050610bc2565b5083600019167fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508485604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610598578181015183820152602001610580565b50505050905090810190601f1680156105c55780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a250505050565b60008281526001602081905260409091206060905b83831161073957828416158015906106885750600083815260068201602052604081205460026000196101006001841615020190911604115b1561072e57600083815260068201602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156107225780601f106106f757610100808354040283529160200191610722565b820191906000526020600020905b81548152906001019060200180831161070557829003601f168201915b5050505050915061073e565b60029092029161064f565b600092505b509250929050565b82604080518082018252848152602080820185815260008881526001835284902092516003840155516004909201919091558151858152908101849052815186927f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46928290030190a250505050565b6000908152600160208190526040909120015490565b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600082815260016020908152604091829020915183516060936005019285929182918401908083835b6020831061083b5780518252601f19909201916020918201910161081c565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188208054601f60026001831615909802909501169590950492830182900482028801820190528187529294509250508301828280156108ef5780601f106108c4576101008083540402835291602001916108ef565b820191906000526020600020905b8154815290600101906020018083116108d257829003601f168201915b5050505050905092915050565b82600019830183161561090e57600080fd5b60008481526001602090815260408083208684526006018252909120835161093892850190610bc2565b50604051839085907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a350505050565b6000818152600160208181526040928390206002908101805485516000199582161561010002959095011691909104601f81018390048302840183019094528383526060939091830182828015610a045780601f106109d957610100808354040283529160200191610a04565b820191906000526020600020905b8154815290600101906020018083116109e757829003601f168201915b50505050509050919050565b8160008381526001602090815260409091208351610a3692600290920191850190610bc2565b50604080516020808252845181830152845186937fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f79387939092839283019185019080838360005b83811015610a96578181015183820152602001610a7e565b50505050905090810190601f168015610ac35780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b816000838152600160208181526040928390209091018490558151848152915185927f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc92908290030190a2505050565b600090815260016020526040902060038101546004909101549091565b81600083815260016020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff86169081179091558251908152915185927f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd292908290030190a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c0357805160ff1916838001178555610c30565b82800160010185558215610c30579182015b82811115610c30578251825591602001919060010190610c15565b50610c3c929150610c40565b5090565b610c5a91905b80821115610c3c5760008155600101610c46565b905600a165627a7a72305820820458ee1fb63da1465b0a1fbcba8ca7c04249db10a2c939ebf73d487bd5a83d0029", + "realRuntimeBytecode": "6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166310f13a8c81146100be5780632203ab561461015c57806329cd62ea146101f65780632dff6941146102145780633b3b57de1461023e57806359d1d43c1461027f578063623195b014610352578063691f3431146103b257806377372213146103ca578063c3d014d614610428578063c869023314610443578063d5fa2b0014610474575b600080fd5b3480156100ca57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a95833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506104a59650505050505050565b005b34801561016857600080fd5b5061017760043560243561063a565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561020257600080fd5b5061015a600435602435604435610746565b34801561022057600080fd5b5061022c6004356107b5565b60408051918252519081900360200190f35b34801561024a57600080fd5b506102566004356107cb565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561028b57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526102dd9583359536956044949193909101919081908401838280828437509497506107f39650505050505050565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103175781810151838201526020016102ff565b50505050905090810190601f1680156103445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035e57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261015a9482359460248035953695946064949201919081908401838280828437509497506108fc9650505050505050565b3480156103be57600080fd5b506102dd60043561096c565b3480156103d657600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261015a958335953695604494919390910191908190840183828082843750949750610a109650505050505050565b34801561043457600080fd5b5061015a600435602435610ad5565b34801561044f57600080fd5b5061045b600435610b25565b6040805192835260208301919091528051918290030190f35b34801561048057600080fd5b5061015a60043573ffffffffffffffffffffffffffffffffffffffff60243516610b42565b826000848152600160209081526040918290209151855185936005019287929182918401908083835b602083106104ed5780518252601f1990920191602091820191016104ce565b51815160209384036101000a6000190180199092169116179052920194855250604051938490038101909320845161052e9591949190910192509050610bc2565b5083600019167fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508485604051808060200180602001838103835285818151815260200191508051906020019080838360005b83811015610598578181015183820152602001610580565b50505050905090810190601f1680156105c55780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b838110156105f85781810151838201526020016105e0565b50505050905090810190601f1680156106255780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a250505050565b60008281526001602081905260409091206060905b83831161073957828416158015906106885750600083815260068201602052604081205460026000196101006001841615020190911604115b1561072e57600083815260068201602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156107225780601f106106f757610100808354040283529160200191610722565b820191906000526020600020905b81548152906001019060200180831161070557829003601f168201915b5050505050915061073e565b60029092029161064f565b600092505b509250929050565b82604080518082018252848152602080820185815260008881526001835284902092516003840155516004909201919091558151858152908101849052815186927f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46928290030190a250505050565b6000908152600160208190526040909120015490565b60009081526001602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b600082815260016020908152604091829020915183516060936005019285929182918401908083835b6020831061083b5780518252601f19909201916020918201910161081c565b518151600019602094850361010090810a820192831692199390931691909117909252949092019687526040805197889003820188208054601f60026001831615909802909501169590950492830182900482028801820190528187529294509250508301828280156108ef5780601f106108c4576101008083540402835291602001916108ef565b820191906000526020600020905b8154815290600101906020018083116108d257829003601f168201915b5050505050905092915050565b82600019830183161561090e57600080fd5b60008481526001602090815260408083208684526006018252909120835161093892850190610bc2565b50604051839085907faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe390600090a350505050565b6000818152600160208181526040928390206002908101805485516000199582161561010002959095011691909104601f81018390048302840183019094528383526060939091830182828015610a045780601f106109d957610100808354040283529160200191610a04565b820191906000526020600020905b8154815290600101906020018083116109e757829003601f168201915b50505050509050919050565b8160008381526001602090815260409091208351610a3692600290920191850190610bc2565b50604080516020808252845181830152845186937fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f79387939092839283019185019080838360005b83811015610a96578181015183820152602001610a7e565b50505050905090810190601f168015610ac35780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b816000838152600160208181526040928390209091018490558151848152915185927f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc92908290030190a2505050565b600090815260016020526040902060038101546004909101549091565b81600083815260016020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff86169081179091558251908152915185927f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd292908290030190a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c0357805160ff1916838001178555610c30565b82800160010185558215610c30579182015b82811115610c30578251825591602001919060010190610c15565b50610c3c929150610c40565b5090565b610c5a91905b80821115610c3c5760008155600101610c46565b905600a165627a7a72305820", + "swarmHash": "820458ee1fb63da1465b0a1fbcba8ca7c04249db10a2c939ebf73d487bd5a83d", + "gasEstimates": { + "creation": { + "codeDepositCost": "641800", + "executionCost": "21101", + "totalCost": "662901" + }, + "external": { + "ABI(bytes32,uint256)": "infinite", + "addr(bytes32)": "559", + "content(bytes32)": "534", + "name(bytes32)": "infinite", + "pubkey(bytes32)": "924", + "setABI(bytes32,uint256,bytes)": "infinite", + "setAddr(bytes32,address)": "22154", + "setContent(bytes32,bytes32)": "21883", + "setName(bytes32,string)": "infinite", + "setPubkey(bytes32,bytes32,bytes32)": "42083", + "setText(bytes32,string,string)": "infinite", + "text(bytes32,string)": "infinite" + } + }, + "functionHashes": { + "ABI(bytes32,uint256)": "2203ab56", + "addr(bytes32)": "3b3b57de", + "content(bytes32)": "2dff6941", + "name(bytes32)": "691f3431", + "pubkey(bytes32)": "c8690233", + "setABI(bytes32,uint256,bytes)": "623195b0", + "setAddr(bytes32,address)": "d5fa2b00", + "setContent(bytes32,bytes32)": "c3d014d6", + "setName(bytes32,string)": "77372213", + "setPubkey(bytes32,bytes32,bytes32)": "29cd62ea", + "setText(bytes32,string,string)": "10f13a8c", + "text(bytes32,string)": "59d1d43c" + }, + "abiDefinition": [ + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "key", + "type": "string" + }, + { + "name": "value", + "type": "string" + } + ], + "name": "setText", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "contentTypes", + "type": "uint256" + } + ], + "name": "ABI", + "outputs": [ + { + "name": "contentType", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "x", + "type": "bytes32" + }, + { + "name": "y", + "type": "bytes32" + } + ], + "name": "setPubkey", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "content", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "addr", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "key", + "type": "string" + } + ], + "name": "text", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "contentType", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "setABI", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "name", + "type": "string" + } + ], + "name": "setName", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "hash", + "type": "bytes32" + } + ], + "name": "setContent", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "node", + "type": "bytes32" + } + ], + "name": "pubkey", + "outputs": [ + { + "name": "x", + "type": "bytes32" + }, + { + "name": "y", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "node", + "type": "bytes32" + }, + { + "name": "addr", + "type": "address" + } + ], + "name": "setAddr", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "ensAddr", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "a", + "type": "address" + } + ], + "name": "AddrChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "hash", + "type": "bytes32" + } + ], + "name": "ContentChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "name", + "type": "string" + } + ], + "name": "NameChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": true, + "name": "contentType", + "type": "uint256" + } + ], + "name": "ABIChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "x", + "type": "bytes32" + }, + { + "indexed": false, + "name": "y", + "type": "bytes32" + } + ], + "name": "PubkeyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "node", + "type": "bytes32" + }, + { + "indexed": false, + "name": "indexedKey", + "type": "string" + }, + { + "indexed": false, + "name": "key", + "type": "string" + } + ], + "name": "TextChanged", + "type": "event" + } + ], + "filename": "C:/dev/embark/lib/modules/ens/contracts/Resolver.sol", + "gas": "auto", + "type": "file", + "_gasLimit": false + }, + "FIFSRegistrar": { + "deploy": true, + "silent": true, + "args": [ + "$ENSRegistry", + "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae" + ], + "onDeploy": [ + "ENSRegistry.methods.setOwner('0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount}).then(() => {\n ENSRegistry.methods.setResolver('0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', \"$Resolver\").send({from: web3.eth.defaultAccount});\n var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '.addr.reverse');\n ENSRegistry.methods.setResolver(reverseNode, \"$Resolver\").send({from: web3.eth.defaultAccount});\n Resolver.methods.setAddr('0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount});\n Resolver.methods.setName(reverseNode, 'eth').send({from: web3.eth.defaultAccount});\n })" + ], + "className": "FIFSRegistrar", + "code": "608060405234801561001057600080fd5b5060405160408061030883398101604052805160209091015160008054600160a060020a031916600160a060020a039093169290921782556001556102ad90819061005b90396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d22057a98114610045575b600080fd5b34801561005157600080fd5b5061007660043573ffffffffffffffffffffffffffffffffffffffff60243516610078565b005b600154604080516020808201939093528082018590528151808203830181526060909101918290528051859360009384939290918291908401908083835b602083106100d55780518252601f1990920191602091820191016100b6565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600080547f02571be300000000000000000000000000000000000000000000000000000000855260048501839052955191995073ffffffffffffffffffffffffffffffffffffffff90951696506302571be3955060248084019592945090928390030190829087803b15801561017157600080fd5b505af1158015610185573d6000803e3d6000fd5b505050506040513d602081101561019b57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff811615806101d7575073ffffffffffffffffffffffffffffffffffffffff811633145b15156101e257600080fd5b60008054600154604080517f06ab592300000000000000000000000000000000000000000000000000000000815260048101929092526024820189905273ffffffffffffffffffffffffffffffffffffffff888116604484015290519216926306ab59239260648084019382900301818387803b15801561026257600080fd5b505af1158015610276573d6000803e3d6000fd5b5050505050505050505600a165627a7a72305820ebb89ba93428b8bd5b039b76284cd01bc18764cffcb64cfd58163125d169441a0029", + "runtimeBytecode": "6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d22057a98114610045575b600080fd5b34801561005157600080fd5b5061007660043573ffffffffffffffffffffffffffffffffffffffff60243516610078565b005b600154604080516020808201939093528082018590528151808203830181526060909101918290528051859360009384939290918291908401908083835b602083106100d55780518252601f1990920191602091820191016100b6565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600080547f02571be300000000000000000000000000000000000000000000000000000000855260048501839052955191995073ffffffffffffffffffffffffffffffffffffffff90951696506302571be3955060248084019592945090928390030190829087803b15801561017157600080fd5b505af1158015610185573d6000803e3d6000fd5b505050506040513d602081101561019b57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff811615806101d7575073ffffffffffffffffffffffffffffffffffffffff811633145b15156101e257600080fd5b60008054600154604080517f06ab592300000000000000000000000000000000000000000000000000000000815260048101929092526024820189905273ffffffffffffffffffffffffffffffffffffffff888116604484015290519216926306ab59239260648084019382900301818387803b15801561026257600080fd5b505af1158015610276573d6000803e3d6000fd5b5050505050505050505600a165627a7a72305820ebb89ba93428b8bd5b039b76284cd01bc18764cffcb64cfd58163125d169441a0029", + "realRuntimeBytecode": "6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663d22057a98114610045575b600080fd5b34801561005157600080fd5b5061007660043573ffffffffffffffffffffffffffffffffffffffff60243516610078565b005b600154604080516020808201939093528082018590528151808203830181526060909101918290528051859360009384939290918291908401908083835b602083106100d55780518252601f1990920191602091820191016100b6565b51815160209384036101000a600019018019909216911617905260408051929094018290038220600080547f02571be300000000000000000000000000000000000000000000000000000000855260048501839052955191995073ffffffffffffffffffffffffffffffffffffffff90951696506302571be3955060248084019592945090928390030190829087803b15801561017157600080fd5b505af1158015610185573d6000803e3d6000fd5b505050506040513d602081101561019b57600080fd5b5051905073ffffffffffffffffffffffffffffffffffffffff811615806101d7575073ffffffffffffffffffffffffffffffffffffffff811633145b15156101e257600080fd5b60008054600154604080517f06ab592300000000000000000000000000000000000000000000000000000000815260048101929092526024820189905273ffffffffffffffffffffffffffffffffffffffff888116604484015290519216926306ab59239260648084019382900301818387803b15801561026257600080fd5b505af1158015610276573d6000803e3d6000fd5b5050505050505050505600a165627a7a72305820", + "swarmHash": "ebb89ba93428b8bd5b039b76284cd01bc18764cffcb64cfd58163125d169441a", + "gasEstimates": { + "creation": { + "codeDepositCost": "137000", + "executionCost": "40632", + "totalCost": "177632" + }, + "external": { + "register(bytes32,address)": "infinite" + } + }, + "functionHashes": { + "register(bytes32,address)": "d22057a9" + }, + "abiDefinition": [ + { + "constant": false, + "inputs": [ + { + "name": "subnode", + "type": "bytes32" + }, + { + "name": "owner", + "type": "address" + } + ], + "name": "register", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "name": "ensAddr", + "type": "address" + }, + { + "name": "node", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + } + ], + "filename": "C:/dev/embark/lib/modules/ens/contracts/FIFSRegistrar.sol", + "gas": "auto", + "type": "file", + "_gasLimit": false + } +} diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index d0e7b4d99..0a17aca83 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -86,6 +86,7 @@ class ENS { this.namesConfig = embark.config.namesystemConfig; this.registration = this.namesConfig.register || {}; this.embark = embark; + this.ensConfig = require('./ensContractConfigs'); if (this.namesConfig === {} || this.namesConfig.enabled !== true || @@ -127,7 +128,7 @@ class ENS { } registerEvents() { - this.events.once("contracts:deploy:afterAll", this.setProviderAndRegisterDomains.bind(this)); + this.events.once("contracts:deploy:afterAll", this.configureContractsAndRegister.bind(this)); this.events.once("web3Ready", this.configureContracts.bind(this)); this.events.setCommandHandler("storage:ens:associate", this.associateStorageToEns.bind(this)); @@ -135,44 +136,22 @@ class ENS { setProviderAndRegisterDomains(cb = (() => {})) { const self = this; - async.parallel([ - function getENSRegistry(paraCb) { - self.events.request('contracts:contract', "ENSRegistry", (contract) => { - paraCb(null, contract); - }); - }, - function getRegistrar(paraCb) { - self.events.request('contracts:contract', "FIFSRegistrar", (contract) => { - paraCb(null, contract); - }); - }, - function getResolver(paraCb) { - self.events.request('contracts:contract', "Resolver", (contract) => { - paraCb(null, contract); - }); - } - ], (err, results) => { - if (err) { - return cb(err); - } - if (!results[0] || !results[1] || !results[2]) { - return cb(__('Aborting ENS setup as some of the contracts did not deploy properly')); - } - // result[0] => ENSRegistry; result[1] => FIFSRegistrar; result[2] => FIFSRegistrar - let config = { - env: self.env, - registration: self.registration, - registryAbi: results[0].abiDefinition, - registryAddress: results[0].deployedAddress, - registrarAbi: results[1].abiDefinition, - registrarAddress: results[1].deployedAddress, - resolverAbi: results[2].abiDefinition, - resolverAddress: results[2].deployedAddress - }; + let config = { + env: self.env, + registration: self.registration, + registryAbi: self.ensConfig.ENSRegistry.abiDefinition, + registryAddress: self.ensConfig.ENSRegistry.deployedAddress, + registrarAbi: self.ensConfig.FIFSRegistrar.abiDefinition, + registrarAddress: self.ensConfig.FIFSRegistrar.deployedAddress, + resolverAbi: self.ensConfig.Resolver.abiDefinition, + resolverAddress: self.ensConfig.Resolver.deployedAddress + }; + console.dir(config); - if (self.doSetENSProvider) { - self.addSetProvider(config); - } + if (self.doSetENSProvider) { + console.log('PLEAGRGFIUWIUF'); + self.addSetProvider(config); + } self.events.request('blockchain:networkId', (networkId) => { const isKnownNetwork = Object.keys(ENS_CONTRACTS_CONFIG).includes(networkId); @@ -319,9 +298,48 @@ class ENS { this.embark.addCodeToEmbarkJS(code); } - configureContracts() { + configureContractsAndRegister() { this.events.request('blockchain:networkId', (networkId) => { const config = Object.assign({}, DEFAULT_ENS_CONTRACTS_CONFIG, {[this.env]: ENS_CONTRACTS_CONFIG[networkId]}); + const self = this; + async.waterfall([ + function registry(next) { + self.events.request('deploy:contract', self.ensConfig.ENSRegistry, next); + }, + function resolver(next) { + self.ensConfig.Resolver.args = [self.ensConfig.ENSRegistry.deployedAddress]; + self.events.request('deploy:contract', self.ensConfig.Resolver, next); + }, + function registrar(next) { + if (!self.registration || !self.registration.rootDomain) { + return next(); + } + const registryAddress = self.ensConfig.ENSRegistry.deployedAddress; + const resolverAddress = self.ensConfig.Resolver.deployedAddress; + const rootNode = namehash.hash(self.registration.rootDomain); + const contract = self.ensConfig.FIFSRegistrar; + contract.args = [registryAddress, rootNode]; + contract.onDeploy = [ + `ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount}).then(() => { + ENSRegistry.methods.setResolver('${rootNode}', "${resolverAddress}").send({from: web3.eth.defaultAccount}); + var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '${reverseAddrSuffix}'); + ENSRegistry.methods.setResolver(reverseNode, "${resolverAddress}").send({from: web3.eth.defaultAccount}); + Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send({from: web3.eth.defaultAccount}); + Resolver.methods.setName(reverseNode, '${self.registration.rootDomain}').send({from: web3.eth.defaultAccount}); + })` + ]; + self.events.request('deploy:contract', contract, next); + } + ], (err) => { + if (err) { + self.logger.error('Error while deploying ENS contracts'); + self.logger.error(err.message || err); + return; + } + self.setProviderAndRegisterDomains(); + }); + +/* if (this.registration && this.registration.rootDomain) { // Register root domain if it is defined