Skip to main content
In this example we’re going to mint some tokens from one contract and stake them in another using transaction kit. This example will show how to do custom contract calls, show how to approve ERC20 tokens, and show how to batch transactions. You can check how to do these things within the components we will create, and then we’ll call these components in App.js We have a code sandbox for this example which you can fork here. Start off by creating a react app, you can see how to do this here Make sure you have the Transaction Kit and Ethers (version 5.4.0) packages installed, then we’ll edit two files and create two more as components. App.js and index.js.

index.js

App.js

Now we want to create a directory called components in the same directory as index.js and App.js Within components, create a directory called MintTktTokens and within that create a file called MintTktTokens.js

MintTktTokens.js

Also within that create a folder called StakeTktTokens and within that create a file called StakeTktTokens.js

StakeTktTokens.js