Chapter 5: Cross-contract Communication & Token Selling
In part 4 of this tutorial series on building DApps with Ethereum, we started building and testing our DAO contract. Now let’s go one step further and handle adding content and tokens to the story, as per our introduction.
Adding Tokens
For a contract to be able to interact with another contract, it needs to be aware of that other contract’s interface — the functions available to it. Since our TNS token has a fairly straightforward interface, we can include it as such in the contract of our DAO, above the contract StoryDao
declaration and under our import
statements:
contract LockableToken is Ownable { function totalSupply() public view returns (uint256); function balanceOf(address who) ...
Get Build Your First Ethereum DApp now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.