Skip to content

Commit

Permalink
Difference between address(token).transfer and token.transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
heew committed May 31, 2024
1 parent 4e9e14c commit c04cf09
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _posts/2024-05-31-TransferFunction.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: "Difference between address(this).transfer and token.transfer"
date: 2024-05-31 09:11:29 +0800
categories: jekyll update
---

We know that every token implements IERC20 has the transfer function. And every account in ethereum also has the transfer function.
As a ERC20 contract, we can call the transfer function in the smart contract like this `token.transfer`. As a ERC20 account we call the transfer function like this `address.transfer`.
But be aware that these two code is very different. `token.transfer` is to transfer the ERC20 token to the receivor

0 comments on commit c04cf09

Please sign in to comment.