Giter Club home page Giter Club logo

application's Introduction

How to obtain your blockchain application ID

Confirm your application by interacting with our HR smart contract on the Ethereum Ropsten network:

  1. Submit a hash (Keccak-256) of your email address using the applyUsingEmail() function.
  2. Retrieve your application ID using the getApplicationID() function.
  3. Copy your application ID and paste it in the application form.

⚠️ ⚠️ Ropsten is a testnet network, you do not need real Ether.

Additional information

Contract address:

0x78D36BA446D73Be73f32e2Cc181A82E3ba5fEf2E

application's People

Contributors

delaaxe avatar juniset avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

application's Issues

How to

What exactly I have to use to get application ID?

Getting ApplicationID as 0

const Web3 = require('web3');

const rpcURL = 'https://ropsten.infura.io/v3/<INFURA_PROJECT_ID>';
const contractAddress = '0xcbbfbafedb0eb83016d2a96a4e80d30b20fa3e30';
const email = '[email protected]';
const emailHash =
  '0xbe166c9942e280bb26c7e658bec28539d4b24fc633d8be6d4b005cc204933b84';
const abi = [
  {
    constant: false,
    inputs: [{ name: 'hash', type: 'bytes32' }],
    name: 'apply',
    outputs: [],
    payable: false,
    stateMutability: 'nonpayable',
    type: 'function'
  },
  {
    constant: true,
    inputs: [{ name: 'email', type: 'string' }],
    name: 'getApplicationID',
    outputs: [{ name: '', type: 'uint256' }],
    payable: false,
    stateMutability: 'view',
    type: 'function'
  }
];

const web3 = new Web3(rpcURL);

const contract = new web3.eth.Contract(abi, contractAddress);

contract.methods.apply(emailHash).call((err, result) => {
  contract.methods.getApplicationID(email).call((err, result) => {
    console.log('getApplicationID', result);
  });
});

Am I missing something or is there any problem with the contract?

Did anyone figure it out? Please respond to this.

You can clone and debug here

TIA 🙏🏻

The MetaMask Web3 object does not support synchronous methods

inpage.js:1 Uncaught Error: The MetaMask Web3 object does not support synchronous methods like eth_sendTransaction without a callback parameter. See https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client for details.
at MetamaskInpageProvider.send (inpage.js:1)
at s.send (inpage.js:1)
at n.e [as sendTransaction] (inpage.js:1)
at u.sendTransaction (inpage.js:1)
at u.execute (inpage.js:1)
at :1:10

apply is not a constant function

myContract
{
abi: [{
constant: false,
inputs: [{...}],
name: "apply",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [{...}],
name: "getApplicationID",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}],
eth: {},
at: function(address, callback),
getData: function(),
new: function()
}

var abi = [{"constant": false,"inputs":[{"name": "hash","type": "bytes32"}],"name": "apply","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": true,"inputs": [{"name": "email","type": "string"}],"name": "getApplicationID","outputs":[{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"}]

var myContract = web3.eth.contract(abi);

var myContractInstance = myContract.at("0xcbbfbafedb0eb83016d2a96a4e80d30b20fa3e30");

var result = myContractInstance.apply("4183f3a48d92d7b874e0e2dc0353e29aee0031b0a174be6f6a2e7a289e9febca");
console.log(result)

Application doesn't work anymore

curl -X GET \
  'https://api-ropsten.etherscan.io/api?module=contract&action=getabi&address=0xcbbfbafedb0eb83016d2a96a4e80d30b20fa3e30&apikey=2QRMGI15YCHS2SKW2FSXCIA7T31JYKZWKE' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 388297f8-efb6-4d38-82cd-c62cbb4d7f82' \
  -H 'cache-control: no-cache' \
  -d '[
    {
        "constant": false,
        "inputs": [
            {
                "name": "hash",
                "type": "bytes32"
            }
        ],
        "name": "apply",
        "outputs": [],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "constant": true,
        "inputs": [
            {
                "name": "email",
                "type": "string"
            }
        ],
        "name": "getApplicationID",
        "outputs": [
            {
                "name": "",
                "type": "uint256"
            }
        ],
        "payable": false,
        "stateMutability": "view",
        "type": "function"
    }
]'

Always return:

{
    "status": "0",
    "message": "NOTOK",
    "result": "Contract source code not verified"
}

So no way to add the id to the application form 😄

some issue in Contract

I think there are some issue in contract, as the apply function always call "this.sendTransaction.apply" function so always getting "Invalid Address"

Uncaught Error: invalid address
at u (web3.min.js:1)
at inputTransactionFormatter (web3.min.js:1)
at web3.min.js:1
at Array.map ()
at i.formatInput (web3.min.js:1)
at i.toPayload (web3.min.js:1)
at r.e [as sendTransaction] (web3.min.js:1)
at c.sendTransaction (web3.min.js:1)
at c.execute (web3.min.js:1)
at Index.html:56

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.