Ricardo Guilherme Schmidt cbfdd9cc72
Removes multiple domain functionaility from project (#20)
* refactor ENSSubdomainRegistry

* Rename contract

* remove obsolete file

* typo

* Add legacy contract upgradability adaptor

* refactor Dapp to use UsernameRegistrar contract

* use reservedNames.js in usernameregistrar.spec.js

* change array of merkle roots to single merkle root

* load reserved words to deploy contract

* reorganized contract methods

* add withdraw methods for controller move excess funds & wrong ens nodes

* add deployed MerkleProof addresses

* include contract terms in the @notice of register

* approve and call fix & solidity update

* add approveAndCall support

* clear subnode owner and resolver
2018-09-04 18:49:39 -03:00

29 lines
1.2 KiB
JavaScript

import React, { Fragment } from 'react';
import { Form, FormGroup, FormControl, HelpBlock, Button, ControlLabel } from 'react-bootstrap';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import web3Utils from 'web3-utils'
import { hash } from 'eth-ens-namehash'
const zeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
const getUserAddress = contract => contract._provider.publicConfigStore._state.selectedAddress;
const dispatchSetup = (ENSRegistry) => {
const { methods: { setSubnodeOwner } } = ENSRegistry;
const { sha3 } = web3Utils
setSubnodeOwner(zeroBytes32, sha3('eth'), getUserAddress(ENSRegistry))
.send()
.then(res => { console.log(res) })
setSubnodeOwner(hash('eth'), sha3('stateofus'), UsernameRegistrar._address)
.send()
.then(res => { console.log(res) })
setSubnodeOwner(hash('eth'), sha3('stateofus'), UsernameRegistrar._address)
.send()
.then(res => { console.log(res) })
}
const SetupEns = ({ ENSRegistry }) => (
<Fragment>
<Button bsStyle="primary" onClick={() => dispatchSetup(ENSRegistry)}>ADD INITIAL NODES TO ENS</Button>
</Fragment>
)
export default SetupEns;