Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Use Contract owner for unregistering Token #3440
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac authored and arkpar committed Nov 18, 2016
1 parent 964feee commit bc15675
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/src/dapps/tokenreg/Status/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const initialState = {
isLoading: true,
subscriptionId: null,
contract: {
addres: null,
address: null,
instance: null,
raw: null,
owner: null,
Expand Down
10 changes: 5 additions & 5 deletions js/src/dapps/tokenreg/Tokens/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,22 @@ export const addGithubhintURL = (from, key, url) => (dispatch, getState) => {
export const unregisterToken = (index) => (dispatch, getState) => {
console.log('unregistering token', index);

const state = getState();
const contractInstance = state.status.contract.instance;
const { contract } = getState().status;
const { instance, owner } = contract;

const values = [ index ];
const options = {
from: state.accounts.selected.address
from: owner
};

contractInstance
instance
.unregister
.estimateGas(options, values)
.then((gasEstimate) => {
options.gas = gasEstimate.mul(1.2).toFixed(0);
console.log(`transfer: gas estimated as ${gasEstimate.toFixed(0)} setting to ${options.gas}`);

return contractInstance.unregister.postTransaction(options, values);
return instance.unregister.postTransaction(options, values);
})
.catch((e) => {
console.error(`unregisterToken #${index} error`, e);
Expand Down

0 comments on commit bc15675

Please sign in to comment.