impasse with metamask

This commit is contained in:
Jarrad Hope 2019-02-18 12:51:18 +07:00
parent b83066e057
commit 1ecaba0c58
No known key found for this signature in database
GPG Key ID: D549F0EF6ACE1FE7
4 changed files with 18 additions and 16 deletions

View File

@ -20,7 +20,7 @@ TODO:
// Todo Resolve ENS entries
const options = [
{ 'label' : 'Jarrad (Test)', 'value' : '0x926495cf9510174080ef2f7931242e85c0de2af8' },
{ 'label' : 'Jarrad (Test)', 'value' : '0x061b0227116e76025D5573cFbb1Ac854916286Fe' },
{ 'label' : 'Andreas S.', 'value' : '0x4923121411e884a4af66ec025712eba600a782d3' },
{ 'label' : 'andrey.dev', 'value' : '0xA4EcA293cb578a68b190e3e07c2B170dc753fe44' },
{ 'label' : 'barry', 'value' : '0xa46b0546481a04b7de049a8a20f8a9b2b2c5cc05' },
@ -114,14 +114,14 @@ class App extends React.Component {
});
}
handleContributorSelection(selectedContributors) {
this.setState({ selectedContributors });
handleContributorSelection(_selectedContributors) {
this.setState({ selectedContributors: _selectedContributors });
console.log(`selectedContributors:`, selectedContributors);
}
handleAwardChange(amount) {
handleAwardChange(_amount) {
let maxAllocation = this.state.allocation / this.state.selectedContributors.length;
amount = (amount <= maxAllocation ? amount : maxAllocation );
amount = (_amount <= maxAllocation ? _amount : maxAllocation );
this.setState({ award: amount });
console.log(`handleAwardChange:`, amount);
}
@ -131,6 +131,7 @@ class App extends React.Component {
}
getContributor(_address) {
console.log('getContributor', _address);
Meritocracy.methods.contributors(_address).call().then(_contributor => {
var contributorData = this.state.contributorData;
contributorData[_contributor.addr.toLowerCase()] = _contributor; // Lowercase here incase we use keys for <Select />
@ -141,8 +142,9 @@ class App extends React.Component {
}
getContributors() {
console.log('getContributors');
Meritocracy.methods.getRegistry().call().then(_registry => {
console.log('got return', _registry); // TODO why is this empty with metamask??
// This block is probably not needed if can use contributorData keys in <Select />
let registry = _registry.map(Function.prototype.call, String.prototype.toLowerCase);
let contributorList = options.filter(_e => {

View File

@ -1,21 +1,21 @@
{
"0x888fb9ca9383ed8235e8a00cd21b2fb6e0302dd22dec12606496d5d77d23ccaf": {
"0x517c867f414bece4614c0d5e1c7ecb2f49c63595faf83baa96da62b81d80b33e": {
"contracts": {
"0xfb4295b67b9ca6e0992ff331dbd64c98b6cdb4bd896e033995691356b504077c": {
"name": "ERC20Receiver",
"address": "0x914ae6A1b17F455f058bDc4d4010Bb7281BD47e2"
"address": "0x9957F3f6108f08eAcaAA52EE0A388560dc234034"
},
"0x6ef111d7ff114790dccb0eb991ffc66c0717516aa3cebfd356736581b75b0402": {
"name": "MiniMeTokenFactory",
"address": "0xc6b47B0d1c1Ce88D4615Fe489469C2E914fAD841"
"address": "0x1427B7117ac465df9Ab0Af4a49E6700cCBed8283"
},
"0x0b443399353a5650101ba464bd844ee95f00834b0b4931db54f8b4e16eed8c79": {
"0x1aa518db401ae87e1508c2317d56c9c44a5dacc66c7213b2cf68a254f7343ece": {
"name": "SNT",
"address": "0xB2F001F37DA4D3a9d87eBD6Dc4325Aa82c2A83ad"
"address": "0xcA68f46036B31988b984f652C4DF0ed595B27916"
},
"0x4ece53dda87e5f51d09fafe5ff4c2a6df503b7a04de12939a589024a9c2831a1": {
"0x6b5c2f810b3495761802ca0fa33feb653f921635d48315d416873bdab6d7158c": {
"name": "Meritocracy",
"address": "0x19bD71805744B56234E4088B9ae390DF0A49480b"
"address": "0xC72783C18e87DDEB2DFB8858B39d22A03044E1f9"
}
}
}

View File

@ -1,6 +1,6 @@
// this is also defined in index.js
const options = [
{ 'label' : 'Jarrad (Test)', 'value' : '0x926495cf9510174080ef2f7931242e85c0de2af8' },
{ 'label' : 'Jarrad (Test)', 'value' : '0x061b0227116e76025D5573cFbb1Ac854916286Fe' },
{ 'label' : 'Andreas S.', 'value' : '0x4923121411e884a4af66ec025712eba600a782d3' }, // commented because I already added to blockchain
{ 'label' : 'andrey.dev', 'value' : '0xA4EcA293cb578a68b190e3e07c2B170dc753fe44' },
{ 'label' : 'barry', 'value' : '0xa46b0546481a04b7de049a8a20f8a9b2b2c5cc05' },
@ -135,9 +135,9 @@ module.exports = {
// assumed to be the intended environment by `embark run`
development: {
dappConnection: [
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
"ws://localhost:8546",
"http://localhost:8545",
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
],
deployment: {
// The order here corresponds to the order of `web3.eth.getAccounts`, so the first one is the `defaultAccount`

View File

@ -9,7 +9,7 @@
"buildDir": "dist/",
"config": "config/",
"versions": {
"web3": "1.0.0-beta",
"web3": "1.0.0-beta.36",
"solc": "0.5.0",
"ipfs-api": "17.2.4"
},