课程: Building an Ethereum Blockchain App: 8 Supply Chain Smart Contract dApp

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Token smart contract data, part 2

Token smart contract data, part 2

- Now let's open up the ERC 20 token. All right, the first thing that we see here is, again, this is just downloaded code, there's nothing new here. We have pragma, we're going to say that I need to have a compiler that is equal to, or greater than 4.21 and less than 060. So our current compiler of 058 fits in that range, so we're going to be fine. Here is the import directive and I talked about this in a previous episode, but this is how we can import code that was written and stored in another file. So we just showed you the ERC 20 interface, so I'm going to import it right here, and it's just as if I type it at line seven, the whole file. Then we define our contract and here's where the magic happens. Our contract is an ERC 20 token. Okay, that's okay. But we say our token is an ERC 20 interface. What that means is that my token conforms to the minimum definitions that come from the ERC 20 interface. All right, I'm…

内容