# Getting Started With Solidity Part 2 ## Making Our Token • **Remappings**: Remappings allow for custom importing text. First let's view our remappings by putting them in a .txt file. Run `forge remappings > remappings.txt` in your root directory, which creates a file called remappings.txt where you can view/modify your remappings. This also lets VSCode know of the remappings, so you won't get an error when importing. Notice the Solmate entry `solmate/=lib/solmate/src/`. Next, go to `src/Contract.sol` and rename it to `Token.sol`. Similarly rename your contract from Contract to Token. Next, import Solmate's ERC20.sol in the same format as the remapping. Then allow your token contract to inherit from Solmate's ERC20 by typing `is ERC20` after the contract name. When contract A inherits from contract B, A includes all of the functions and variables that were in contract B. ![](https://i.imgur.com/UTtdJMe.png) The red compiler warning is because there is a function we haven't implemented. In this case, it's the contructor from ERC20.sol. Let's create a constructor and nest it with ERC20.sol's constructor. ![](https://i.imgur.com/bF8radz.png) Here we nest our constructor with ERC20.sol's, and apply our constructor args to ERC20.sol. (*note* is highlighted here because it's a NatSpec keyword). We also create an owner variable so that we can permission some functions. Now let's expose mint & burn functions and permission them to owner. ![](https://i.imgur.com/oxFPljf.png) The [require](https://docs.soliditylang.org/en/v0.8.17/control-structures.html?highlight=require#panic-via-assert-and-error-via-require) function takes as input a conditional statement — if it'S true then the code block proceeds and if not the function reverts with an optional custom error message (e.g. "NOT_OWNER"). Since we have duplicate require functions, we can abstract this into a custom [modifier](https://docs.soliditylang.org/en/v0.8.17/contracts.html?highlight=custom%20modifier#function-modifiers). ![](https://i.imgur.com/uAuEoEp.png) Modifiers are formatted as: ``` modifier <modifier_name> { <optional_code> _; // this represents the function's body <optional_code> } ``` `_;` is a placeholder operator representing the codeblock of the function that its applied to. You can apply a modifier to function by typing the modifer name right before the curly braces & you can use multiple modifiers. Next, let's make this token terrible to use and apply a tax on all transfers: ![](https://i.imgur.com/zQ8X54o.png) The two tranfer functions in ERC20.sol, transfer & transferFrom, are marked 'virtual' which means they can be overidden in contracts that inherit from them (called derived contracts) by marked them as '[override](https://docs.soliditylang.org/en/latest/contracts.html#function-overriding)'. First we get the taxable amount, subtract it from the amount to be transfered, and then we use the 'ERC20' to call the corresponding transfer function in ERC20.sol's contract which runs the transfer function as normal.