1
CryptoHow To

How To Interact With Your Smart Contract On Binance Smart Chain

2 Mins read

Let’s look at how to interact with your smart contract on Binance smart chain. Hopefully, you have had a chance to create your smart contract here. This is a continuation of that article, so please check it out before proceeding.

How To Interact With Your Smart Contract On Binance Smart Chain

Step I

How To Interact With Your Smart Contract On Binance Smart Chain

Scroll down on the newly created contract and click on the token dropdown, You will see something like this.

Step II

Getting the address

How To Interact With Your Smart Contract On Binance Smart Chain

Copy the address listed on your Account by clicking the copy button

How To Interact With Your Smart Contract On Binance Smart Chain
  • Paste the address on the balanceOf field
  • Click on `balanceOf` and obseerve the results on the debug console
  • Our balance is now 50000 PETER as we anticipate!!

Well done for making it this far! Let’s now look at how to transfer your coins to some other account.

Step III – Sending to another address

How To Interact With Your Smart Contract On Binance Smart Chain

Choose a new address on your Metamask and copy the address.

We will transfer our PETER tokens to that address

Step IV

How To Interact With Your Smart Contract On Binance Smart Chain

Paste the newly copied address in the transfer method, also put a comma and the amount you wish to transfer. In my case I input

<address******>, 1000

This means I wish to transfer 1000PETER from my main address to the new address. Click transfer and confirm the Metamask popup that comes up.

Step V

How To Interact With Your Smart Contract On Binance Smart Chain
  • Note the successful transfer of PETER coin after confirming the transaction.

Confirming the transfer!

In order to confirm the transfer, we need to check that our tokens have actually been transferred to the new wallet address.

First, we need to add our token contract to our Metamask. To do this, copy your token address as shown below.

Step VI

How To Interact With Your Smart Contract On Binance Smart Chain
  • Copy the address of where our contract is deployed by checking the debug logs

Step VII

How To Interact With Your Smart Contract On Binance Smart Chain

Select the new address on Metamask that we just sent the tokens to.

Click import tokens on Metamask

How To Interact With Your Smart Contract On Binance Smart Chain

Click “Add Custom Token” after pasting the token address

Click Import Token on the next page

Confirm that your token has a new value!!

Well done! Now, lets check whether our main account has less amount after doing the transfer!

Step IX

How To Interact With Your Smart Contract On Binance Smart Chain
  • Copy and Paste the address of the main account on the balanceOf field
  • Click on `balanceOf` and obseerve the results on the debug console
  • Our balance is now 49000 PETER as we anticipate!!

Conclusion

  • You could even play around with the new methods we created and see that the contract works as expected.
  • See the screenshot, you should see something similar to that

Wow! Good job if you followed this to the end! Hope you enjoyed this!

You might be interested in how to start buying crypto.

Don’t miss amazing tips!

1
Related posts
How ToProgrammingSoftware

How to link flutter with firebase email password authentication

11 Mins read
Table of contents0.1 firebase email password authentication output flow0.2 Creating our email password authentication on flutter0.3 Step 10.4 Setting up firebase and…
How To

How To Implement Data Tables In Cucumber Using Selenium Ruby

17 Mins read
Table of contents0.1 Advantages of Behavior Driven Development0.2 What is Cucumber?0.3 What are data tables in Cucumber?0.4 How to implement data tables…
Crypto

Central African Republic adopts bitcoin as an official currency

3 Mins read
Table of contents0.1 The Advantages of Using Bitcoin in the Central African Republic0.2 What Are the Advantages of Using Bitcoin?0.3 Who Uses…

Leave a Reply

Your email address will not be published. Required fields are marked *

57 + = 66

×
CryptoHow To

How To Add BNB For Testing In BSC Testnet