0

I need an api to handle erc20 ethereum token deposits and withdrawals on my microjobs website.

Users should be able to withdraw their earned token automatically when they pay the network fees.

2
  • Do you create the microjobs / determine how much each pays? Or do users post microjobs to create a market place?
    – Steven V
    Commented Jan 10, 2020 at 23:22
  • Users create the microjobs to create the marketplace. They use the deposits to pay for the microjobs
    – funcrypto
    Commented Jan 11, 2020 at 8:49

1 Answer 1

1

If you are using js, you can use ethers.js or web3.js to interact with the smart contracts when certain functions are needed.

Centralized Solution For a basic, centralized implementation (assuming an ERC20 smart contract has already been deployed and tokens have been minted / distributed) you and your users would interact with the transfer function.

On creating a microjob, the creator would use the transfer function to transfer the # of tokens that will be paid for the job to your site (either a general address treasury account or you could create an account per address). Once the use completes the form for this new job, you could request the user sign the transfer transaction. Now the job should exist in the microjobs database and your site will own the ERC20 tokens available.

When it has been determined the job has been completed - some one with access to the treasury account would sign a transaction paying out for the job.

Decentralized Solution A better way to complete this would like be creating a separate contract to manage the creation of MicroJobs and manage the erc20 tokens. In this solution when a job is created, the erc20 tokens would be transferred to this MicroJob smart contract. The creator of the job would then determine when the job is complete and trigger the payment from the MicroJobs contract to the user

7
  • The idea sound good to me, I will appreciate if you can send me a message here for further discussion because i cannot send you one. Alternatively we can chat on telegram @fortuneguy1 , I will appreciate if you can create the web3js codes for me since i do not have much knowledge about it. Thank you.
    – funcrypto
    Commented Jan 11, 2020 at 19:05
  • Here is the documentation for creating and interacting with a contract in web3.js - web3js.readthedocs.io/en/v1.2.4/web3-eth-contract.html# and ethers docs.ethers.io/ethers.js/html/api-contract.html#
    – Steven V
    Commented Jan 11, 2020 at 19:21
  • Thank you for the links shared, Please assist me with the codes and i will integrate it into my website, i am not into cryptocurrency as such. Please assist me.
    – funcrypto
    Commented Jan 11, 2020 at 20:08
  • Is there any standard web3js that I can edit to solve my problems ?
    – funcrypto
    Commented Jan 12, 2020 at 0:09
  • here are some examples of how this can be done: ethereum.stackexchange.com/questions/23121/…. The documentation above also has useful examples that can be adapted to ERC20 smart contracts
    – Steven V
    Commented Jan 12, 2020 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.