I'm looking for some source codes using web3js for interaction with erc20 tokens and contracts. Does anyone know good source codes using web3js?

Thanks in advance!


Although, it is really easy to interact with source code via Truffle, and you can find various tutorial such as this, and many more on medium.

But if you really want to use just web3js then here is a github link. Although this is complete ethereum cast. But you can get the idea from the Inbox contract. The contract directory have an inbox.sol contract. compile.js compiles the contract by solc compiler and exports. deploy.js is deploying the compiled contract to rinkebey testnet (You can also deploy locally by using Ganache). Lastly, the inbox.test.js inside the test directory contains the code to interact with contract by web3js.

Hope it will help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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