Home Videos Writing Your First Smart Contract · #2 Code Your Own Cryptocurrency on Ethereum

Writing Your First Smart Contract · #2 Code Your Own Cryptocurrency on Ethereum

1 min read

For more videos on how to build decentralized applications on The Ethereum Blockchain: https://www.youtube.com/channel/UCY0xL8V6NzzFcwzHCgB8orQ?sub_confirmation=1



Tutorial Code: https://github.com/dappuniversity/token_sale/releases/tag/1_smoke_test

Full App Code: https://github.com/dappuniversity/token_sale

How to Build Ethereum Dapp (Decentralized Application Development Tutorial)

Donate Ether to the channel: 0x39C7BC5496f4eaaa1fF75d88E079C22f0519E7b9

Follow me on Twitter (@DappUniversity): https://twitter.com/DappUniversity

Email me: gregory@dappuniversity.com



  1. ethr0g

    March 23, 2018 at 4:23 pm

    Hi Gregory! Great education! thanks.


  2. SF King

    March 23, 2018 at 8:04 pm

    Hey Gregory I wanted to email you about a proposal and you had said in a past video your email to reach you at was inbox@dappuniversity.com correct? If so, the email cannot receive mail for some reason. Is there any other email I could reach you at?


  3. Руслан Миров

    March 26, 2018 at 5:24 am

    Отличные уроки!!!


  4. Peng Mark Gang

    March 26, 2018 at 3:28 pm

    Excellent vid !


  5. youtube warrior

    March 31, 2018 at 9:44 pm

    i only have windows 7 so i cant run ganache!!!! so… can i use ropsten network on meta mask instead?


  6. Yeshwanth Valaboju

    May 17, 2018 at 7:57 pm

    can you brief the setup for winidows provide a step by step document if possible


  7. Yeshwanth Valaboju

    May 19, 2018 at 11:16 am

    HI Gregor plz can you made a session on setup for windows


  8. Yeshwanth Valaboju

    May 19, 2018 at 11:16 am

    HI Gregor plz can you made a session on setup for windows


  9. Yeshwanth Valaboju

    May 19, 2018 at 11:16 am

    any one please help me with setup for windows please


  10. Yeshwanth Valaboju

    May 19, 2018 at 11:17 am

    HI Gregor plz can you made a session on setup for windows


  11. Nathan McPhee

    June 18, 2018 at 6:59 pm

    my truffle test does not work (Error – 'module' is undefined). Any ideas? I'm doing this on a Windows 10 Pro laptop


  12. Gustavo Alvarez

    June 25, 2018 at 9:01 pm

    hey! the info you are giving is great!! I would like to ask what´s the difference between setting up the work as you do and using remix???


  13. Astra Rai

    September 6, 2018 at 1:59 am

    Thanks again for the content. I look forward to viewing and taking notes on the third lesson.


  14. Vincent Emilio

    September 6, 2018 at 9:09 pm

    Hi Gregory! This is absolutely great work! Thank you for sharing your knowledge and skills. More so, on taking the time to curate your videos in a meticulous manner. I will incentivise you as a token of my appreciation< no pun, should our ICO become a success. Wish us luck! Good luck to you too! bye now:)


  15. mees bruin

    October 3, 2018 at 6:55 pm

    i have a question, i am using a macbook pro 2015 and every time i try to install ganasche, the computer gives an error. can i do it without ganasche??


  16. Babasaheb Pinjar

    November 1, 2018 at 8:10 am

    Hi Gregory, First of all I have to tell that you have made a great tutorial. I am not able to pass this test

    1) Contract: D transfers token ownership:

    AssertionError: error message must contain revert

    at test/BabaCoin.js:44:8

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:160:7)

    This is my code

    it('transfers token ownership', function() {

    return BabaCoin.deployed().then(function(instance) {

    tokenInstance = instance;

    // Test `require` statement first by transferring something larger than the sender's balance

    return tokenInstance.transfer.call(accounts[1], 99999999999999999999999);

    }).then(assert.fail).catch(function(error) {

    assert(error.message.indexOf('revert') >= 0, 'error message must contain revert');



    function transfer(address _to, uint256 _value) public returns (bool success) {

    require(balanceOf[msg.sender] >= _value);




  17. Stead fightz

    November 3, 2018 at 12:14 pm

    Sir how can I git init?


  18. nyun hong

    November 17, 2018 at 6:44 pm

    stuck on 3:21 # truffle init
    Doesn't have start any download and says bash:truffle : commons not found


  19. Saiteja Kuruva

    March 3, 2019 at 7:43 pm

    Hey ! I am unable to install Truffle on my mac can anyone let me know the tricks how I should do this?


  20. jesus oct.

    March 30, 2019 at 3:43 am

    The way you write the constructor is now deprecated, it should now be:
    constructor() public {
    // …


  21. Real Estate Central Intelligence

    April 26, 2019 at 2:52 am

    Gregory … you are amazing. Thanks a lot. You lost me with the test DappToken.js Where can i read more about this? syntax, etc


  22. Adrian Negulescu

    April 27, 2019 at 8:36 am

    When I try to test DappToken.deployed().then(function(i) { token=i; })

    the terminal throws the following error:

    ReferenceError: DappToken is not defined

    at evalmachine.<anonymous>:0:1

    at Script.runInContext (vm.js:135:20)

    at runScript (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/console.js:199:1)

    at Console.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/console.js:213:1)

    at ReplManager.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/repl.js:118:1)

    at bound (domain.js:400:14)

    at REPLServer.runBound [as eval] (domain.js:413:12)

    at REPLServer.onLine (repl.js:632:10)

    at REPLServer.emit (events.js:197:13)

    at REPLServer.EventEmitter.emit (domain.js:446:20)

    Can you please help me?


  23. atul agarwal

    June 13, 2019 at 5:45 am

    hay Gregory I was running " truffle unbox pet-shop " command as you instruct in one of your tutorials but getting an issue :

    async execute() {
    SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)

    —— can you explain what should I need to do.


  24. katoleshubham

    July 19, 2019 at 1:33 pm

    truffle migrate command not working when i run this command it is opening the truffle.js file


  25. Hendry Lim

    December 30, 2019 at 2:00 am

    Hi fellow learners, what is the difference between using truffle compile vs truffle migrate vs truffle migrate –reset? Thanks


  26. Rahul Gupta

    February 20, 2020 at 3:30 pm

    [Need Help]

    My device says 'docker' is not recognized as an internal or external command,

    operable program or batch file.

    Error: Error: You are trying to run dockerized solc, but docker is not

    installed. And when i install docker, it says you need windows home pro or entrerise version.

    Please Help!


  27. Weddingmoon Vacations

    March 5, 2020 at 2:44 am

    Hello, unfortuantley I keep getting an error when I try to run "truffle migrate" or "truffle migrate –reset". The error is as follows:
    SyntaxError: Unexpected token '}'
    at wrapSafe (internal/modules/cjs/loader.js:1071:16)
    at Module._compile (internal/modules/cjs/loader.js:1121:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Module.require (internal/modules/cjs/loader.js:1043:19)
    at Object.require (internal/modules/cjs/helpers.js:77:18)
    at Function.load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:159:1)
    at Function.detect (/usr/local/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:148:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:189:1)
    at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
    at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:52:1)
    at _webpack_require_ (/usr/local/lib/node_modules/truffle/build/webpack:/webpack/bootstrap 481bb5aaa12b754c9ee1:19:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/webpack/bootstrap 481bb5aaa12b754c9ee1:62:1
    at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:68:10)
    at Module._compile (internal/modules/cjs/loader.js:1157:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
    Truffle v5.1.15 (core: 5.1.15)
    Node v12.16.0

    I would appreciate any help someone could offer, thank you.


Leave a Reply to ethr0g Cancel reply

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

Check Also

Corona treft Bitcoin: 'Enorme vrije val!' – CRYPTO-UPDATE

Het coronavirus heeft ook een negatief effect op de koers van de Bitcoin. Analist Madelon …